Add robot name prefix to system setting UI

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
AllForNothing 2020-11-03 16:34:36 +08:00
parent 99d818f4db
commit ca93eb2218
10 changed files with 53 additions and 8 deletions

View File

@ -367,7 +367,9 @@
"EXPIRES_AT": "Expires At",
"EXPIRATION_TOOLTIP": "If not set, the expiration time of system configuration will be used",
"INVALID_VALUE": "The value of the expiration time is invalid",
"NEVER_EXPIRED": "Never Expired"
"NEVER_EXPIRED": "Never Expired",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
@ -868,6 +870,7 @@
"LDAP_UID": "The attribute used in a search to match a user. It could be uid, cn, email, sAMAccountName or other attributes depending on your LDAP/AD.",
"LDAP_SCOPE": "The scope to search for users.",
"TOKEN_EXPIRATION": "The expiration time (in minutes) of a token created by the token service. Default is 30 minutes.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "The expiration time (in days) of the token of the robot account, Default is 30 days. Show the number of days converted from minutes and rounds down",
"PRO_CREATION_RESTRICTION": "The flag to define what users have permission to create projects. By default, everyone can create a project. Set to 'Admin Only' so that only an administrator can create a project.",
"ROOT_CERT_DOWNLOAD": "Download the root certificate of registry.",

View File

@ -368,7 +368,9 @@
"EXPIRES_AT": "Expires At",
"EXPIRATION_TOOLTIP": "If not set, the expiration time of system configuration will be used",
"INVALID_VALUE": "The value of the expiration time is invalid",
"NEVER_EXPIRED": "Never Expired"
"NEVER_EXPIRED": "Never Expired",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
@ -868,6 +870,7 @@
"LDAP_UID": "El atributo usado en una búsqueda para encontrar un usuario. Debe ser el uid, cn, email, sAMAccountName u otro atributo dependiendo del LDAP/AD.",
"LDAP_SCOPE": "El ámbito de búsqueda para usuarios",
"TOKEN_EXPIRATION": "El tiempo de expiración (en minutos) del token creado por el servicio de tokens. Por defecto son 30 minutos.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "El tiempo de caducidad (días) del token de la cuenta del robot, el valor predeterminado es 30 días. Muestra el número de días convertidos de minutos y redondeos.",
"PRO_CREATION_RESTRICTION": "Marca para definir qué usuarios tienen permisos para crear proyectos. Por defecto, todos pueden crear proyectos. Seleccione 'Solo Administradores' para que solamente los administradores puedan crear proyectos.",
"ROOT_CERT_DOWNLOAD": "Download the root certificate of registry.",

View File

@ -359,7 +359,9 @@
"EXPIRES_AT": "Expires At",
"EXPIRATION_TOOLTIP": "If not set, the expiration time of system configuration will be used",
"INVALID_VALUE": "The value of the expiration time is invalid",
"NEVER_EXPIRED": "Never Expired"
"NEVER_EXPIRED": "Never Expired",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"WEBHOOK": {
"EDIT_BUTTON": "EDIT",
@ -849,6 +851,7 @@
"LDAP_UID": "Attribut utilisé dans une recherche pour trouver un utilisateur. Cela peut être uid, cn, email, sAMAccountName ou d'autres attributs selon votre LDAP/AD.",
"LDAP_SCOPE": "Le scope de recherche des utilisateurs.",
"TOKEN_EXPIRATION": "Le temps d'expiration (en minutes) d'un jeton créé par le service de jeton. La valeur par défaut est 30 minutes.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "Le délai d'expiration (en jours) du jeton du compte robot est défini par défaut sur 30 jours. Afficher le nombre de jours convertis à partir des minutes et des arrondis",
"PRO_CREATION_RESTRICTION": "L'indicateur pour définir quels utilisateurs ont le droit de créer des projets. Par défaut, tout le monde peut créer un projet. Définissez sur 'Administrateur Seulement' pour que seul un administrateur puisse créer un projet.",
"ROOT_CERT_DOWNLOAD": "Téléchargez le certificat racine du dépôt.",

View File

@ -365,7 +365,9 @@
"EXPIRES_AT": "Expires At",
"EXPIRATION_TOOLTIP": "If not set, the expiration time of system configuration will be used",
"INVALID_VALUE": "The value of the expiration time is invalid",
"NEVER_EXPIRED": "Never Expired"
"NEVER_EXPIRED": "Never Expired",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"GROUP": {
"GROUP": "Grupo",
@ -864,6 +866,7 @@
"LDAP_UID": "O atributo utilizado na busca de um uusário. Pode ser uid, cn, email, sAMAccountName ou outro atributo dependendo LDAP/AD.",
"LDAP_SCOPE": "O escopo de busca de usuários.",
"TOKEN_EXPIRATION": "O tempo de expiração (em minutos) de um token criado pelo serviço de token. O padrão é 30 minutos.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "O tempo de expiração (dias) do token da conta do robô, o padrão é 30 dias. Mostra o número de dias convertidos de minutos e arredonda para baixo",
"PRO_CREATION_RESTRICTION": "A opção para definir quais usuários possuem permissão de criar projetos. Por padrão, qualquer um pode criar projetos. Configure para 'Apenas Administradores' para que apenas Administradores possam criar projetos.",
"ROOT_CERT_DOWNLOAD": "Baixar o certificado raiz do registry.",

View File

@ -367,7 +367,9 @@
"EXPIRES_AT": "Expires At",
"EXPIRATION_TOOLTIP": "If not set, the expiration time of system configuration will be used",
"INVALID_VALUE": "The value of the expiration time is invalid",
"NEVER_EXPIRED": "Never Expired"
"NEVER_EXPIRED": "Never Expired",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"WEBHOOK": {
"EDIT_BUTTON": "DÜZENLE",
@ -868,6 +870,7 @@
"LDAP_UID": "Bir kullanıcıyla eşleşmek için aramada kullanılan özellik. LDAP / AD'nize bağlı olarak, kullanıcı kimliği, cn, e-posta, sAMAccountName veya diğer özellikler olabilir.",
"LDAP_SCOPE": "Kullanıcıları aramak için kapsam.",
"TOKEN_EXPIRATION": "Token servisi tarafından oluşturulan bir tokenın sona erme süresi (dakika cinsinden). Varsayılan 30 dakikadır.",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "Robot hesabının token son kullanma süresi (gün olarak), Varsayılan 30 gündür. Dakika ve yuvarlamadan dönüştürülen gün sayısını göster",
"PRO_CREATION_RESTRICTION": "Hangi kullanıcıların proje oluşturma iznine sahip olduğunu belirten bayrak. Varsayılan olarak, herkes bir proje oluşturabilir. 'Yalnızca Yönetici' olarak ayarlayın, böylece yalnızca bir yönetici bir proje oluşturabilir.",
"ROOT_CERT_DOWNLOAD": "Kayıt defteri kök sertifikasını indirin.",

View File

@ -366,7 +366,9 @@
"EXPIRES_AT": "到期日",
"EXPIRATION_TOOLTIP": "如不设置,将会使用系统设置中的过期时间。",
"INVALID_VALUE": "无效的过期日期",
"NEVER_EXPIRED": "永不过期"
"NEVER_EXPIRED": "永不过期",
"NAME_PREFIX": "机器人账户名称前缀",
"NAME_PREFIX_REQUIRED": "机器人账户名称前缀为必填项"
},
"WEBHOOK": {
"EDIT_BUTTON": "编辑",
@ -869,6 +871,7 @@
"LDAP_UID": "在搜索中用来匹配用户的属性可以是uid,cn,email,sAMAccountName或者其它LDAP/AD服务器支持的属性。",
"LDAP_SCOPE": "搜索用户的范围。",
"TOKEN_EXPIRATION": "由令牌服务创建的令牌的过期时间分钟默认为30分钟。",
"ROBOT_NAME_PREFIX": "每个机器人账户名称的前缀字符串,默认值为 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "机器人账户的令牌的过期时间默认为30天,显示的结果为分钟转化的天数并向下取整。",
"PRO_CREATION_RESTRICTION": "用来确定哪些用户有权限创建项目,默认为’所有人‘,设置为’仅管理员‘则只有管理员可以创建项目。",
"ROOT_CERT_DOWNLOAD": "下载镜像库根证书。",

View File

@ -364,7 +364,9 @@
"EXPIRES_AT": "到期日",
"EXPIRATION_TOOLTIP": "如不設置,將會使用系統設置中的過期時間。",
"INVALID_VALUE": "無效的過期日期",
"NEVER_EXPIRED": "永不過期"
"NEVER_EXPIRED": "永不過期",
"NAME_PREFIX": "Robot Name Prefix",
"NAME_PREFIX_REQUIRED": "Robot name prefix is required"
},
"WEBHOOK":{
"EDIT_BUTTON": "編輯",
@ -864,6 +866,7 @@
"LDAP_UID": "在搜索中用來匹配用戶的屬性,可以是uid,cn,email,sAMAccountName或者其它LDAP/AD服務器支持的屬性。",
"LDAP_SCOPE": "搜索用戶的範圍。",
"TOKEN_EXPIRATION": "由令牌服務創建的令牌的過期時間(分鐘),默認為30分鐘。",
"ROBOT_NAME_PREFIX": "Prefixed string for each robot name,and default value is 'robot$'",
"ROBOT_TOKEN_EXPIRATION": "機器人帳戶的令牌的過期時間(天),默認為30天,顯示的結果為分鐘轉化的天數並向下取整。",
"PRO_CREATION_RESTRICTION": "用來確定哪些用戶有權限創建項目,默認為'所有人',設置為'僅管理員'則只有管理員可以創建項目。",
"ROOT_CERT_DOWNLOAD": "下載鏡像庫根證書。",

View File

@ -86,6 +86,7 @@ export class Configuration {
verify_remote_cert: BoolValueItem;
robot_token_duration: NumberValueItem;
token_expiration: NumberValueItem;
robot_name_prefix?: StringValueItem;
scan_all_policy: ComplexValueItem;
read_only: BoolValueItem;
notification_enable: BoolValueItem;
@ -138,6 +139,7 @@ export class Configuration {
this.email_password = new StringValueItem("", true);
this.email_insecure = new BoolValueItem(false, true);
this.token_expiration = new NumberValueItem(30, true);
this.robot_name_prefix = new StringValueItem("", true);
this.robot_token_duration = new NumberValueItem(30 * (60 * 24), true);
this.cfg_expiration = new NumberValueItem(30, true);
this.verify_remote_cert = new BoolValueItem(false, true);

View File

@ -32,6 +32,22 @@
<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}}
<clr-tooltip>
<clr-icon clrTooltipTrigger shape="info-circle" size="24"></clr-icon>
<clr-tooltip-content clrPosition="top-right" clrSize="lg" *clrIfOpen>
<span>{{'CONFIG.TOOLTIP.ROBOT_NAME_PREFIX' | translate}}</span>
</clr-tooltip-content>
</clr-tooltip>
</label>
<input clrInput name="robotNamePrefix" type="text"
[(ngModel)]="systemSettings.robot_name_prefix.value"
required
autocomplete="off"
id="robotNamePrefix" size="20" [disabled]="!robotNamePrefixEditable()" />
<clr-control-error>{{'ROBOT_ACCOUNT.NAME_PREFIX_REQUIRED' | translate}}</clr-control-error>
</clr-input-container>
<clr-input-container>
<label for="robotTokenExpiration" class="required">{{'ROBOT_ACCOUNT.TOKEN_EXPIRATION' | translate}}
<clr-tooltip>

View File

@ -82,6 +82,12 @@ export class SystemSettingsComponent implements OnChanges, OnInit {
this.systemSettings.robot_token_duration.editable;
}
robotNamePrefixEditable(): boolean {
return this.systemSettings &&
this.systemSettings.robot_name_prefix &&
this.systemSettings.robot_name_prefix.editable;
}
public isValid(): boolean {
return this.systemSettingsForm && this.systemSettingsForm.valid;
}
@ -108,7 +114,7 @@ export class SystemSettingsComponent implements OnChanges, OnInit {
let changes = {};
for (let prop in allChanges) {
if (prop === 'token_expiration' || prop === 'read_only' || prop === 'project_creation_restriction'
|| prop === 'robot_token_duration' || prop === 'notification_enable') {
|| prop === 'robot_token_duration' || prop === 'notification_enable' || prop === 'robot_name_prefix') {
changes[prop] = allChanges[prop];
}
}