mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-22 07:31:28 +01:00
Merge pull request #5549 from ninjadq/fix_chart_ui_related_issue
Fix chart ui related issue
This commit is contained in:
commit
74f1b0b166
@ -24,7 +24,7 @@
|
|||||||
<tr *ngFor="let src of summary.sources; let i = index">
|
<tr *ngFor="let src of summary.sources; let i = index">
|
||||||
<td class="left" *ngIf="i === 0">{{'HELM_CHART.SRC_REPO' | translate }}</td>
|
<td class="left" *ngIf="i === 0">{{'HELM_CHART.SRC_REPO' | translate }}</td>
|
||||||
<td class="left" *ngIf="i !== 0"></td>
|
<td class="left" *ngIf="i !== 0"></td>
|
||||||
<td class="left text-wrapper" >
|
<td class="left text-wrapper">
|
||||||
<a href="{{src}}">{{src}}</a>
|
<a href="{{src}}">{{src}}</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -48,28 +48,62 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-12 content-group">
|
<div class="col-md-12 content-group">
|
||||||
<div>
|
<div>
|
||||||
<label>{{'HELM_CHART.ADD_REPO' | translate }}</label>
|
<label>{{'HELM_CHART.COMMAND' | translate }}</label>
|
||||||
</div>
|
</div>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="left">{{addCMD}}</td>
|
<td class="left cmd-title">{{'HELM_CHART.ADD_REPO' | translate }}</td>
|
||||||
|
<td class="left cmd-content">
|
||||||
|
<input class="cmd-content" type="text"
|
||||||
|
[(ngModel)]="addCMD" #addCMDInput readonly/>
|
||||||
|
</td>
|
||||||
|
<td class="left">
|
||||||
|
<span>
|
||||||
|
<clr-icon shape="copy" size="24"
|
||||||
|
[class.is-success]="isCopied('add')"
|
||||||
|
[ngxClipboard]="addCMDInput"
|
||||||
|
(cbOnSuccess)="onCopySuccess($event, 'add')"
|
||||||
|
></clr-icon>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-12 content-group">
|
|
||||||
<div>
|
|
||||||
<label>{{'HELM_CHART.INSTALL_CHART' | translate }}</label>
|
|
||||||
</div>
|
|
||||||
<table class="table">
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="left">{{installCMD}}</td>
|
<td class="left cmd-title">{{'HELM_CHART.INSTALL_CHART' | translate }}</td>
|
||||||
|
<td class="left">
|
||||||
|
<input class="cmd-content" type="text"
|
||||||
|
[(ngModel)]="installCMD" #installCMDInput readonly/>
|
||||||
|
</td>
|
||||||
|
<td class="left">
|
||||||
|
<span>
|
||||||
|
<clr-icon shape="copy" size="24"
|
||||||
|
[class.is-success]="isCopied('install')"
|
||||||
|
[ngxClipboard]="installCMDInput"
|
||||||
|
(cbOnSuccess)="onCopySuccess($event, 'install')"
|
||||||
|
></clr-icon>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr *ngIf="prov_ready">
|
||||||
|
<td class="left cmd-title">{{'HELM_CHART.VERIFY_CHART' | translate }}</td>
|
||||||
|
<td class="left">
|
||||||
|
<input class="cmd-content" type="text"
|
||||||
|
[(ngModel)]="verifyCMD" #verifyCMDInput readonly/>
|
||||||
|
</td>
|
||||||
|
<td class="left">
|
||||||
|
<span>
|
||||||
|
<clr-icon shape="copy" size="24"
|
||||||
|
[class.is-success]="isCopied('verify')"
|
||||||
|
[ngxClipboard]="verifyCMDInput"
|
||||||
|
(cbOnSuccess)="onCopySuccess($event, 'verify')"
|
||||||
|
></clr-icon>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12 content-group">
|
<div class="col-md-12 content-group">
|
||||||
<div>
|
<div>
|
||||||
<label>{{'HELM_CHART.SECURITY' | translate }}</label>
|
<label>{{'HELM_CHART.SECURITY' | translate }}</label>
|
||||||
@ -77,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="security?.signature?.signed;then signed_content else unsignd_content"></div>
|
<div *ngIf="prov_ready;then signedContent else unsignedContent"></div>
|
||||||
<ng-template #signed_content>
|
<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 #unsignd_content>
|
<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>
|
||||||
|
@ -25,4 +25,13 @@
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cmd-title {
|
||||||
|
white-space: nowrap;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cmd-content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
@ -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",
|
||||||
@ -22,17 +25,47 @@ export class ChartDetailSummaryComponent implements OnInit {
|
|||||||
@Input() chartVersion: string;
|
@Input() chartVersion: string;
|
||||||
@Input() readme: string;
|
@Input() readme: string;
|
||||||
|
|
||||||
constructor() {}
|
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(
|
||||||
|
private errorHandler: ErrorHandler,
|
||||||
|
private helmChartService: HelmChartService
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get addCMD() {
|
isCopied(cmd: string) {
|
||||||
return `helm repo add REPO_NAME ${this.repoURL}/chartrepo/${this.projectName}`;
|
return this.copiedCMD === cmd;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get installCMD() {
|
onCopySuccess(e: Event, cmd: string) {
|
||||||
return `helm install --version ${this.chartVersion} REPO_NAME/${this.chartName}`;
|
this.copiedCMD = cmd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get prov_ready() {
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,6 @@ export class HelmChartComponent implements OnInit {
|
|||||||
.catch(error => this.errorHandler.error(error));
|
.catch(error => this.errorHandler.error(error));
|
||||||
this.lastFilteredChartName = "";
|
this.lastFilteredChartName = "";
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFilterValue(value: string) {
|
updateFilterValue(value: string) {
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
<clr-dg-footer>
|
<clr-dg-footer>
|
||||||
<clr-dg-pagination #pagination [clrDgPageSize]="5">
|
<clr-dg-pagination #pagination [clrDgPageSize]="5">
|
||||||
{{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }} {{pagination.totalItems}} {{'MEMBER.GROUPS' | translate}}
|
{{pagination.totalItems}} {{'MEMBER.ITEMS' | translate}}
|
||||||
</clr-dg-pagination>
|
</clr-dg-pagination>
|
||||||
</clr-dg-footer>
|
</clr-dg-footer>
|
||||||
</clr-datagrid>
|
</clr-datagrid>
|
||||||
|
@ -516,7 +516,12 @@
|
|||||||
"NO_README": "No readme file provided by this chart.",
|
"NO_README": "No readme file provided by this chart.",
|
||||||
"SECURITY": "Security",
|
"SECURITY": "Security",
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated"
|
"DEPRECATED": "Deprecated",
|
||||||
|
"VERIFY_CHART": "Verify Chart",
|
||||||
|
"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?"
|
||||||
|
@ -515,7 +515,12 @@
|
|||||||
"NO_README": "No readme file provided by this chart.",
|
"NO_README": "No readme file provided by this chart.",
|
||||||
"SECURITY": "Security",
|
"SECURITY": "Security",
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated"
|
"DEPRECATED": "Deprecated",
|
||||||
|
"VERIFY_CHART": "Verify Chart",
|
||||||
|
"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?"
|
||||||
|
@ -490,7 +490,12 @@
|
|||||||
"ITEMS": "items",
|
"ITEMS": "items",
|
||||||
"SECURITY": "Security",
|
"SECURITY": "Security",
|
||||||
"ACTIVE": "Active",
|
"ACTIVE": "Active",
|
||||||
"DEPRECATED": "Deprecated"
|
"DEPRECATED": "Deprecated",
|
||||||
|
"VERIFY_CHART": "Verify Chart",
|
||||||
|
"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 ?"
|
||||||
|
@ -515,7 +515,12 @@
|
|||||||
"NO_README": "此Chart未提供README文件",
|
"NO_README": "此Chart未提供README文件",
|
||||||
"SECURITY": "安全",
|
"SECURITY": "安全",
|
||||||
"ACTIVE": "正常",
|
"ACTIVE": "正常",
|
||||||
"DEPRECATED": "废弃"
|
"DEPRECATED": "废弃",
|
||||||
|
"VERIFY_CHART": "验证Chart",
|
||||||
|
"COMMAND": "命令",
|
||||||
|
"PROV_FILE": "Prov 文件",
|
||||||
|
"READY": "就绪",
|
||||||
|
"NOT_READY": "未就绪"
|
||||||
},
|
},
|
||||||
"ALERT": {
|
"ALERT": {
|
||||||
"FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
|
"FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
|
||||||
|
Loading…
Reference in New Issue
Block a user