Add session timeout input (#17769)

Signed-off-by: AllForNothing <sshijun@vmware.com>

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
Shijun Sun 2022-11-15 11:39:48 +08:00 committed by GitHub
parent 9c9aa58d6a
commit f2212eef25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 62 additions and 1 deletions

View File

@ -111,6 +111,7 @@ export class Configuration {
oidc_group_filter: StringValueItem;
audit_log_forward_endpoint: StringValueItem;
skip_audit_log_database: BoolValueItem;
session_timeout: NumberValueItem;
public constructor() {
this.auth_mode = new StringValueItem('db_auth', true);
this.project_creation_restriction = new StringValueItem(
@ -184,6 +185,7 @@ export class Configuration {
this.storage_per_project = new NumberValueItem(-1, true);
this.audit_log_forward_endpoint = new StringValueItem('', true);
this.skip_audit_log_database = new BoolValueItem(false, true);
this.session_timeout = new NumberValueItem(60, true);
}
}

View File

@ -69,6 +69,39 @@
'TOOLTIP.NUMBER_REQUIRED' | translate
}}</clr-control-error>
</clr-input-container>
<clr-input-container>
<label for="sessionTimeout" class="required"
>{{ 'CONFIG.SESSION_TIMEOUT' | translate }}
<clr-tooltip>
<clr-icon
clrTooltipTrigger
shape="info-circle"
size="24"></clr-icon>
<clr-tooltip-content
clrPosition="top-right"
clrSize="lg"
*clrIfOpen>
<span>{{
'CONFIG.SESSION_TIMEOUT_INFO' | translate
}}</span>
</clr-tooltip-content>
</clr-tooltip>
</label>
<input
clrInput
name="sessionTimeout"
type="text"
#ngSessionTimeout="ngModel"
[(ngModel)]="sessionTimeout"
required
pattern="^[1-9]{1}[0-9]*$"
id="sessionTimeout"
size="10"
[disabled]="!editable" />
<clr-control-error>{{
'TOOLTIP.NUMBER_REQUIRED' | translate
}}</clr-control-error>
</clr-input-container>
<clr-input-container>
<label for="robotNamePrefix" class="required"
>{{ 'ROBOT_ACCOUNT.NAME_PREFIX' | translate }}

View File

@ -65,6 +65,15 @@ export class SystemSettingsComponent implements OnInit {
this.currentConfig.token_expiration.value = +v;
}
get sessionTimeout() {
return this.currentConfig.session_timeout.value;
}
set sessionTimeout(v) {
// convert string to number
this.currentConfig.session_timeout.value = +v;
}
get robotTokenExpirationValue() {
return this.currentConfig.robot_token_duration.value;
}
@ -112,7 +121,8 @@ export class SystemSettingsComponent implements OnInit {
prop === 'notification_enable' ||
prop === 'robot_name_prefix' ||
prop === 'audit_log_forward_endpoint' ||
prop === 'skip_audit_log_database'
prop === 'skip_audit_log_database' ||
prop === 'session_timeout'
) {
changes[prop] = allChanges[prop];
}

View File

@ -868,6 +868,8 @@
"SAVE_SUCCESS": "Konfiguration erfolgreich gespeichert",
"VERIFY_REMOTE_CERT": "Zertifikat der Gegenstelle prüfen",
"TOKEN_EXPIRATION": "Token-Ablauf (Minuten)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Auth Mode",
"PRO_CREATION_RESTRICTION": "Projekt Erzeugung",
"SELF_REGISTRATION": "Selbst-Registrierung",

View File

@ -868,6 +868,8 @@
"SAVE_SUCCESS": "Configuration has been successfully saved.",
"VERIFY_REMOTE_CERT": "Verify Remote Cert",
"TOKEN_EXPIRATION": "Token Expiration (Minutes)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Auth Mode",
"PRO_CREATION_RESTRICTION": "Project Creation",
"SELF_REGISTRATION": "Allow Self-Registration",

View File

@ -869,6 +869,8 @@
"SAVE_SUCCESS": "La configuración ha sido guardada satisfactoriamente.",
"VERIFY_REMOTE_CERT": "Verificar Certificado Remoto",
"TOKEN_EXPIRATION": "Expiración del Token (Minutos)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Modo de autentificación",
"PRO_CREATION_RESTRICTION": "Creación de Proyecto",
"SELF_REGISTRATION": "Permitir auto-registro",

View File

@ -849,6 +849,8 @@
"SAVE_SUCCESS": "La configuration a été sauvegardée avec succès.",
"VERIFY_REMOTE_CERT": "Vérifier le Certificat Distant",
"TOKEN_EXPIRATION": "Expiration du Jeton (Minutes)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Mode d'Identification",
"PRO_CREATION_RESTRICTION": "Création du Projet",
"SELF_REGISTRATION": "Autoriser l'Auto-Inscription",

View File

@ -864,6 +864,8 @@
"SAVE_SUCCESS": "Configuração salva com sucesso.",
"VERIFY_REMOTE_CERT": "Verificar Certificado remoto",
"TOKEN_EXPIRATION": "Expiração do Token (Minutos)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Modo de autenticação",
"PRO_CREATION_RESTRICTION": "Criação de Projeto",
"SELF_REGISTRATION": "Permitir cadastro de usuários.",

View File

@ -868,6 +868,8 @@
"SAVE_SUCCESS": "Yapılandırma başarıyla kaydedildi.",
"VERIFY_REMOTE_CERT": "Uzaktan Sertifikayı Doğrula",
"TOKEN_EXPIRATION": "Token Sonu (Dakika)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "Yetkilendirme Modu",
"PRO_CREATION_RESTRICTION": "Proje oluşturma",
"SELF_REGISTRATION": "Kendi Kendine Kayıt Yapmaya İzin Ver",

View File

@ -870,6 +870,8 @@
"SAVE_SUCCESS": "变更的配置项成功保存。",
"VERIFY_REMOTE_CERT": "验证远程证书",
"TOKEN_EXPIRATION": "令牌过期时间(分钟)",
"SESSION_TIMEOUT": "会话过期时间(分钟)",
"SESSION_TIMEOUT_INFO": "设置 Harbor UI 的会话过期时间。默认值为60分钟。",
"AUTH_MODE": "认证模式",
"PRO_CREATION_RESTRICTION": "项目创建",
"SELF_REGISTRATION": "允许自注册",

View File

@ -865,6 +865,8 @@
"SAVE_SUCCESS": "變更的配置項成功保存。",
"VERIFY_REMOTE_CERT": "驗證遠程證書",
"TOKEN_EXPIRATION": "令牌過期時間(分鐘)",
"SESSION_TIMEOUT": "Session Timeout (Minutes)",
"SESSION_TIMEOUT_INFO": "Set the session timeout for Harbor UI. The default is 60 minutes.",
"AUTH_MODE": "認證模式",
"PRO_CREATION_RESTRICTION": "項目創建",
"SELF_REGISTRATION": "允許自註冊",