mirror of
https://github.com/goharbor/harbor
synced 2025-04-13 19:17:29 +00:00
Change UI about security table
1. Change wording from 'sign' to 'ready' 2. Provide download for prov file
This commit is contained in:
parent
173100be6d
commit
cff8fc52ba
|
@ -111,19 +111,19 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="left">{{'HELM_CHART.SIGNED' | translate }}</td>
|
<td class="left">{{'HELM_CHART.PROV_FILE' | translate }}</td>
|
||||||
<div *ngIf="prov_ready;then signedContent else unsignedContent"></div>
|
<div *ngIf="prov_ready;then signedContent else unsignedContent"></div>
|
||||||
<ng-template #signedContent>
|
<ng-template #signedContent>
|
||||||
<td class="left">
|
<td class="left">
|
||||||
<span class="content-icon">
|
<span class="content-icon">
|
||||||
<clr-icon shape="shield-check" class="is-success"></clr-icon>
|
<clr-icon shape="shield-check" class="is-success"></clr-icon>
|
||||||
</span> {{'HELM_CHART.SIGNED' | translate }}</td>
|
</span> <a (click)="downloadChart()">{{'HELM_CHART.READY' | translate }}</a></td>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template #unsignedContent>
|
<ng-template #unsignedContent>
|
||||||
<td class="left">
|
<td class="left">
|
||||||
<span class="content-icon">
|
<span class="content-icon">
|
||||||
<clr-icon shape="shield-x" class="is-error"></clr-icon>
|
<clr-icon shape="shield-x" class="is-error"></clr-icon>
|
||||||
</span> {{'HELM_CHART.UNSIGNED' | translate }}</td>
|
</span> {{'HELM_CHART.NOT_READY' | translate }}</td>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -6,6 +6,9 @@ import {
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
|
|
||||||
import { HelmChartMetaData, HelmChartSecurity } from "./../../service/interface";
|
import { HelmChartMetaData, HelmChartSecurity } from "./../../service/interface";
|
||||||
|
import { downloadFile } from './../../utils';
|
||||||
|
import { HelmChartService } from "../../service/index";
|
||||||
|
import { ErrorHandler } from "./../../error-handler/error-handler";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "hbr-chart-detail-summary",
|
selector: "hbr-chart-detail-summary",
|
||||||
|
@ -23,8 +26,14 @@ export class ChartDetailSummaryComponent implements OnInit {
|
||||||
@Input() readme: string;
|
@Input() readme: string;
|
||||||
|
|
||||||
copiedCMD = '';
|
copiedCMD = '';
|
||||||
|
addCMD = `helm repo add --ca-file <ca file> --cert-file <cert file> --key-file <key file> --username <username> --password <password> <repo name> ${this.repoURL}/chartrepo/${this.projectName}`;
|
||||||
|
installCMD = `helm install --ca-file <ca file> --cert-file <cert file> --key-file <key file> --username=<username> --password=<password> --version ${this.chartVersion} <repo name>/${this.chartName}`;
|
||||||
|
verifyCMD = `helm verify --keyring <key path> ${this.chartName}-${this.chartVersion}.tgz`;
|
||||||
|
|
||||||
constructor() {}
|
constructor(
|
||||||
|
private errorHandler: ErrorHandler,
|
||||||
|
private helmChartService: HelmChartService
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
@ -37,21 +46,26 @@ export class ChartDetailSummaryComponent implements OnInit {
|
||||||
this.copiedCMD = cmd;
|
this.copiedCMD = cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public get addCMD() {
|
|
||||||
return `helm repo add --ca-file <ca file> --cert-file <cert file> --key-file <key file> --username <username> --password <password> <repo name> ${this.repoURL}/chartrepo/${this.projectName}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get installCMD() {
|
|
||||||
return `helm install --ca-file <ca file> --cert-file <cert file> --key-file <key file> --username=<username> --password=<password> --version ${this.chartVersion} <repo name>/${this.chartName}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get verifyCMD() {
|
|
||||||
return `helm verify --keyring <key path> ${this.chartName}-${this.chartVersion}.tgz`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public get prov_ready() {
|
public get prov_ready() {
|
||||||
return this.security && this.security.signature && this.security.signature.signed;
|
return this.security && this.security.signature && this.security.signature.signed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
downloadChart() {
|
||||||
|
if (!this.summary ||
|
||||||
|
!this.summary.urls ||
|
||||||
|
this.summary.urls.length < 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let filename = `${this.summary.urls[0]}.prov`;
|
||||||
|
|
||||||
|
this.helmChartService.downloadChart(this.projectName, filename).subscribe(
|
||||||
|
res => {
|
||||||
|
downloadFile(res);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.errorHandler.error(error);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -518,7 +518,10 @@
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated",
|
"DEPRECATED": "Deprecated",
|
||||||
"VERIFY_CHART": "Verify Chart",
|
"VERIFY_CHART": "Verify Chart",
|
||||||
"COMMAND": "Commands"
|
"COMMAND": "Commands",
|
||||||
|
"PROV_FILE": "Prov File",
|
||||||
|
"READY": "Ready",
|
||||||
|
"NOT_READY": "Not Ready"
|
||||||
},
|
},
|
||||||
"ALERT": {
|
"ALERT": {
|
||||||
"FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?"
|
"FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?"
|
||||||
|
|
|
@ -517,7 +517,10 @@
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated",
|
"DEPRECATED": "Deprecated",
|
||||||
"VERIFY_CHART": "Verify Chart",
|
"VERIFY_CHART": "Verify Chart",
|
||||||
"COMMAND": "Commands"
|
"COMMAND": "Commands",
|
||||||
|
"PROV_FILE": "Prov File",
|
||||||
|
"READY": "Ready",
|
||||||
|
"NOT_READY": "Not Ready"
|
||||||
},
|
},
|
||||||
"ALERT": {
|
"ALERT": {
|
||||||
"FORM_CHANGE_CONFIRMATION": "Algunos cambios no se han guardado aún. ¿Quiere cancelar?"
|
"FORM_CHANGE_CONFIRMATION": "Algunos cambios no se han guardado aún. ¿Quiere cancelar?"
|
||||||
|
|
|
@ -492,7 +492,10 @@
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated",
|
"DEPRECATED": "Deprecated",
|
||||||
"VERIFY_CHART": "Verify Chart",
|
"VERIFY_CHART": "Verify Chart",
|
||||||
"COMMAND": "Commands"
|
"COMMAND": "Commands",
|
||||||
|
"PROV_FILE": "Prov File",
|
||||||
|
"READY": "Ready",
|
||||||
|
"NOT_READY": "Not Ready"
|
||||||
},
|
},
|
||||||
"ALERT": {
|
"ALERT": {
|
||||||
"FORM_CHANGE_CONFIRMATION": "Certaines modifications ne sont pas encore enregistrées. Voulez-vous annuler ?"
|
"FORM_CHANGE_CONFIRMATION": "Certaines modifications ne sont pas encore enregistrées. Voulez-vous annuler ?"
|
||||||
|
|
|
@ -517,7 +517,10 @@
|
||||||
"ACTIVE": "正常",
|
"ACTIVE": "正常",
|
||||||
"DEPRECATED": "废弃",
|
"DEPRECATED": "废弃",
|
||||||
"VERIFY_CHART": "验证Chart",
|
"VERIFY_CHART": "验证Chart",
|
||||||
"COMMAND": "命令"
|
"COMMAND": "命令",
|
||||||
|
"PROV_FILE": "Prov 文件",
|
||||||
|
"READY": "就绪",
|
||||||
|
"NOT_READY": "未就绪"
|
||||||
},
|
},
|
||||||
"ALERT": {
|
"ALERT": {
|
||||||
"FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
|
"FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user