From 15172988cb22b1f4691948ad1da4fb900486c957 Mon Sep 17 00:00:00 2001 From: FangyuanCheng Date: Wed, 17 Oct 2018 15:14:46 +0800 Subject: [PATCH] Allow developers and project admins administrators to download the harbor certs from UI. Signed-off-by: FangyuanCheng --- .../lib/src/config/system/system-settings.component.ts | 5 ++--- .../repository-gridview/repository-gridview.component.html | 4 ++++ .../repository-gridview/repository-gridview.component.scss | 4 ++++ .../src/repository-gridview/repository-gridview.component.ts | 3 ++- src/portal/lib/src/service.config.ts | 2 +- src/portal/src/i18n/lang/en-us-lang.json | 1 + src/portal/src/i18n/lang/es-es-lang.json | 1 + src/portal/src/i18n/lang/fr-fr-lang.json | 1 + src/portal/src/i18n/lang/zh-cn-lang.json | 1 + 9 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/portal/lib/src/config/system/system-settings.component.ts b/src/portal/lib/src/config/system/system-settings.component.ts index 4ec95e194..6dc436fba 100644 --- a/src/portal/lib/src/config/system/system-settings.component.ts +++ b/src/portal/lib/src/config/system/system-settings.component.ts @@ -1,8 +1,7 @@ import { Component, Input, Output, EventEmitter, ViewChild, Inject } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Configuration } from '../config'; -import { SERVICE_CONFIG, IServiceConfig } from '../../service.config'; - +import { SERVICE_CONFIG, IServiceConfig, downloadUrl } from '../../service.config'; @Component({ selector: 'system-settings', templateUrl: './system-settings.component.html', @@ -10,7 +9,7 @@ import { SERVICE_CONFIG, IServiceConfig } from '../../service.config'; }) export class SystemSettingsComponent { config: Configuration; - downloadLink: string = "/api/systeminfo/getcert"; + downloadLink: string = downloadUrl; @Output() configChange: EventEmitter = new EventEmitter(); @Input() diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.html b/src/portal/lib/src/repository-gridview/repository-gridview.component.html index 850631bcd..fe1e431fc 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.html +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.html @@ -3,6 +3,10 @@
+ + + {{'CONFIG.REGISTRY_CERTIFICATE' | translate | uppercase}} + diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.scss b/src/portal/lib/src/repository-gridview/repository-gridview.component.scss index 07aeccd3b..7967523b7 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.scss +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.scss @@ -8,6 +8,10 @@ overflow: hidden; } +.download-link { + font-size: 14px; +} + .filter-divider { display: inline-block; height: 16px; diff --git a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts index 941ddec95..16c30e239 100644 --- a/src/portal/lib/src/repository-gridview/repository-gridview.component.ts +++ b/src/portal/lib/src/repository-gridview/repository-gridview.component.ts @@ -35,7 +35,7 @@ import {Tag} from '../service/interface'; import {GridViewComponent} from '../gridview/grid-view.component'; import {OperationService} from "../operation/operation.service"; import {OperateInfo, OperationState, operateChanges} from "../operation/operate"; - +import { downloadUrl } from '../service.config'; @Component({ selector: "hbr-repository-gridview", templateUrl: "./repository-gridview.component.html", @@ -44,6 +44,7 @@ import {OperateInfo, OperationState, operateChanges} from "../operation/operate" }) export class RepositoryGridviewComponent implements OnChanges, OnInit { signedCon: { [key: string]: any | string[] } = {}; + downloadLink: string = downloadUrl; @Input() projectId: number; @Input() projectName = "unknown"; @Input() urlPrefix: string; diff --git a/src/portal/lib/src/service.config.ts b/src/portal/lib/src/service.config.ts index 6672eafcf..fb21ddb60 100644 --- a/src/portal/lib/src/service.config.ts +++ b/src/portal/lib/src/service.config.ts @@ -1,7 +1,7 @@ import { InjectionToken } from '@angular/core'; export let SERVICE_CONFIG = new InjectionToken("service.config"); - +export const downloadUrl = "/api/systeminfo/getcert"; export interface IServiceConfig { /** * The base endpoint of service used to retrieve the system configuration information. diff --git a/src/portal/src/i18n/lang/en-us-lang.json b/src/portal/src/i18n/lang/en-us-lang.json index 334661841..8a076596f 100644 --- a/src/portal/src/i18n/lang/en-us-lang.json +++ b/src/portal/src/i18n/lang/en-us-lang.json @@ -583,6 +583,7 @@ "PRO_CREATION_ADMIN": "Admin Only", "ROOT_CERT": "Registry Root Certificate", "ROOT_CERT_LINK": "Download", + "REGISTRY_CERTIFICATE": "Registry certificate", "TOOLTIP": { "SELF_REGISTRATION_ENABLE": "Enable sign up.", "SELF_REGISTRATION_DISABLE": "Disable sign up.", diff --git a/src/portal/src/i18n/lang/es-es-lang.json b/src/portal/src/i18n/lang/es-es-lang.json index 9a3385206..6ed2e2412 100644 --- a/src/portal/src/i18n/lang/es-es-lang.json +++ b/src/portal/src/i18n/lang/es-es-lang.json @@ -582,6 +582,7 @@ "PRO_CREATION_ADMIN": "Solo Administradores", "ROOT_CERT": "Registro Certificado Raíz", "ROOT_CERT_LINK": "Descargar", + "REGISTRY_CERTIFICATE": "Certificado de registro", "TOOLTIP": { "SELF_REGISTRATION_ENABLE": "Activar registro.", "SELF_REGISTRATION_DISABLE": "Disable sign up.", diff --git a/src/portal/src/i18n/lang/fr-fr-lang.json b/src/portal/src/i18n/lang/fr-fr-lang.json index 3b54e539a..65b94a826 100644 --- a/src/portal/src/i18n/lang/fr-fr-lang.json +++ b/src/portal/src/i18n/lang/fr-fr-lang.json @@ -554,6 +554,7 @@ "ROOT_CERT": "Enregistrer le Certificat Racine", "ROOT_CERT_LINK": "Télécharger", "GC": "Garbage Collection", + "REGISTRY_CERTIFICATE": "certificat d'enregistrement", "TOOLTIP": { "SELF_REGISTRATION_ENABLE": "Activer l'inscription.", "SELF_REGISTRATION_DISABLE": "Désactiver l'inscription.", diff --git a/src/portal/src/i18n/lang/zh-cn-lang.json b/src/portal/src/i18n/lang/zh-cn-lang.json index ea807a13a..59c806f9c 100644 --- a/src/portal/src/i18n/lang/zh-cn-lang.json +++ b/src/portal/src/i18n/lang/zh-cn-lang.json @@ -582,6 +582,7 @@ "PRO_CREATION_ADMIN": "仅管理员", "ROOT_CERT": "镜像库根证书", "ROOT_CERT_LINK": "下载", + "REGISTRY_CERTIFICATE": "注册证书", "TOOLTIP": { "SELF_REGISTRATION_ENABLE": "激活注册功能。", "SELF_REGISTRATION_DISABLE": "禁用注册功能。",