Merge pull request #6065 from pureshine/download_btn

Allow developers and project admins  administrators to downloadthe harbor certs  from UI.
This commit is contained in:
Fangyuan Cheng 2018-10-17 16:16:14 +08:00 committed by GitHub
commit d7ead338d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 5 deletions

View File

@ -1,8 +1,7 @@
import { Component, Input, Output, EventEmitter, ViewChild, Inject } from '@angular/core'; import { Component, Input, Output, EventEmitter, ViewChild, Inject } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { Configuration } from '../config'; import { Configuration } from '../config';
import { SERVICE_CONFIG, IServiceConfig } from '../../service.config'; import { SERVICE_CONFIG, IServiceConfig, downloadUrl } from '../../service.config';
@Component({ @Component({
selector: 'system-settings', selector: 'system-settings',
templateUrl: './system-settings.component.html', templateUrl: './system-settings.component.html',
@ -10,7 +9,7 @@ import { SERVICE_CONFIG, IServiceConfig } from '../../service.config';
}) })
export class SystemSettingsComponent { export class SystemSettingsComponent {
config: Configuration; config: Configuration;
downloadLink: string = "/api/systeminfo/getcert"; downloadLink: string = downloadUrl;
@Output() configChange: EventEmitter<Configuration> = new EventEmitter<Configuration>(); @Output() configChange: EventEmitter<Configuration> = new EventEmitter<Configuration>();
@Input() @Input()

View File

@ -3,6 +3,10 @@
<div class="toolbar"> <div class="toolbar">
<div class="row flex-items-xs-right option-right rightPos"> <div class="row flex-items-xs-right option-right rightPos">
<div class="flex-xs-middle"> <div class="flex-xs-middle">
<a #certDownloadLink [href]="downloadLink" target="_blank" class="btn btn-link btn-font download-link">
<clr-icon shape="download"></clr-icon>
{{'CONFIG.REGISTRY_CERTIFICATE' | translate | uppercase}}
</a>
<hbr-push-image-button style="display: inline-block;" [registryUrl]="registryUrl" [projectName]="projectName"></hbr-push-image-button> <hbr-push-image-button style="display: inline-block;" [registryUrl]="registryUrl" [projectName]="projectName"></hbr-push-image-button>
<hbr-filter [withDivider]="true" filterPlaceholder="{{'REPOSITORY.FILTER_FOR_REPOSITORIES' | translate}}" (filterEvt)="doSearchRepoNames($event)" [currentValue]="lastFilteredRepoName"></hbr-filter> <hbr-filter [withDivider]="true" filterPlaceholder="{{'REPOSITORY.FILTER_FOR_REPOSITORIES' | translate}}" (filterEvt)="doSearchRepoNames($event)" [currentValue]="lastFilteredRepoName"></hbr-filter>
<span class="card-btn" (click)="showCard(true)" (mouseenter) ="mouseEnter('card') " (mouseleave) ="mouseLeave('card')"> <span class="card-btn" (click)="showCard(true)" (mouseenter) ="mouseEnter('card') " (mouseleave) ="mouseLeave('card')">

View File

@ -8,6 +8,10 @@
overflow: hidden; overflow: hidden;
} }
.download-link {
font-size: 14px;
}
.filter-divider { .filter-divider {
display: inline-block; display: inline-block;
height: 16px; height: 16px;

View File

@ -35,7 +35,7 @@ import {Tag} from '../service/interface';
import {GridViewComponent} from '../gridview/grid-view.component'; import {GridViewComponent} from '../gridview/grid-view.component';
import {OperationService} from "../operation/operation.service"; import {OperationService} from "../operation/operation.service";
import {OperateInfo, OperationState, operateChanges} from "../operation/operate"; import {OperateInfo, OperationState, operateChanges} from "../operation/operate";
import { downloadUrl } from '../service.config';
@Component({ @Component({
selector: "hbr-repository-gridview", selector: "hbr-repository-gridview",
templateUrl: "./repository-gridview.component.html", templateUrl: "./repository-gridview.component.html",
@ -44,6 +44,7 @@ import {OperateInfo, OperationState, operateChanges} from "../operation/operate"
}) })
export class RepositoryGridviewComponent implements OnChanges, OnInit { export class RepositoryGridviewComponent implements OnChanges, OnInit {
signedCon: { [key: string]: any | string[] } = {}; signedCon: { [key: string]: any | string[] } = {};
downloadLink: string = downloadUrl;
@Input() projectId: number; @Input() projectId: number;
@Input() projectName = "unknown"; @Input() projectName = "unknown";
@Input() urlPrefix: string; @Input() urlPrefix: string;

View File

@ -1,7 +1,7 @@
import { InjectionToken } from '@angular/core'; import { InjectionToken } from '@angular/core';
export let SERVICE_CONFIG = new InjectionToken("service.config"); export let SERVICE_CONFIG = new InjectionToken("service.config");
export const downloadUrl = "/api/systeminfo/getcert";
export interface IServiceConfig { export interface IServiceConfig {
/** /**
* The base endpoint of service used to retrieve the system configuration information. * The base endpoint of service used to retrieve the system configuration information.

View File

@ -583,6 +583,7 @@
"PRO_CREATION_ADMIN": "Admin Only", "PRO_CREATION_ADMIN": "Admin Only",
"ROOT_CERT": "Registry Root Certificate", "ROOT_CERT": "Registry Root Certificate",
"ROOT_CERT_LINK": "Download", "ROOT_CERT_LINK": "Download",
"REGISTRY_CERTIFICATE": "Registry certificate",
"TOOLTIP": { "TOOLTIP": {
"SELF_REGISTRATION_ENABLE": "Enable sign up.", "SELF_REGISTRATION_ENABLE": "Enable sign up.",
"SELF_REGISTRATION_DISABLE": "Disable sign up.", "SELF_REGISTRATION_DISABLE": "Disable sign up.",

View File

@ -582,6 +582,7 @@
"PRO_CREATION_ADMIN": "Solo Administradores", "PRO_CREATION_ADMIN": "Solo Administradores",
"ROOT_CERT": "Registro Certificado Raíz", "ROOT_CERT": "Registro Certificado Raíz",
"ROOT_CERT_LINK": "Descargar", "ROOT_CERT_LINK": "Descargar",
"REGISTRY_CERTIFICATE": "Certificado de registro",
"TOOLTIP": { "TOOLTIP": {
"SELF_REGISTRATION_ENABLE": "Activar registro.", "SELF_REGISTRATION_ENABLE": "Activar registro.",
"SELF_REGISTRATION_DISABLE": "Disable sign up.", "SELF_REGISTRATION_DISABLE": "Disable sign up.",

View File

@ -554,6 +554,7 @@
"ROOT_CERT": "Enregistrer le Certificat Racine", "ROOT_CERT": "Enregistrer le Certificat Racine",
"ROOT_CERT_LINK": "Télécharger", "ROOT_CERT_LINK": "Télécharger",
"GC": "Garbage Collection", "GC": "Garbage Collection",
"REGISTRY_CERTIFICATE": "certificat d'enregistrement",
"TOOLTIP": { "TOOLTIP": {
"SELF_REGISTRATION_ENABLE": "Activer l'inscription.", "SELF_REGISTRATION_ENABLE": "Activer l'inscription.",
"SELF_REGISTRATION_DISABLE": "Désactiver l'inscription.", "SELF_REGISTRATION_DISABLE": "Désactiver l'inscription.",

View File

@ -582,6 +582,7 @@
"PRO_CREATION_ADMIN": "仅管理员", "PRO_CREATION_ADMIN": "仅管理员",
"ROOT_CERT": "镜像库根证书", "ROOT_CERT": "镜像库根证书",
"ROOT_CERT_LINK": "下载", "ROOT_CERT_LINK": "下载",
"REGISTRY_CERTIFICATE": "注册证书",
"TOOLTIP": { "TOOLTIP": {
"SELF_REGISTRATION_ENABLE": "激活注册功能。", "SELF_REGISTRATION_ENABLE": "激活注册功能。",
"SELF_REGISTRATION_DISABLE": "禁用注册功能。", "SELF_REGISTRATION_DISABLE": "禁用注册功能。",