diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html index 463729673..bdcdfd4a0 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.html @@ -24,7 +24,7 @@ {{'HELM_CHART.SRC_REPO' | translate }} - + {{src}} @@ -48,28 +48,62 @@
- +
- + + + - -
{{addCMD}}{{'HELM_CHART.ADD_REPO' | translate }} + + + + + +
-
-
-
- -
- - - + + + + + + + +
{{installCMD}}{{'HELM_CHART.INSTALL_CHART' | translate }} + + + + + +
{{'HELM_CHART.VERIFY_CHART' | translate }} + + + + + +
+
@@ -77,19 +111,19 @@ - -
- + +
+ +  {{'HELM_CHART.READY' | translate }} - + +  {{'HELM_CHART.NOT_READY' | translate }} diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss index 042c13fdd..db3e2976a 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.scss @@ -25,4 +25,13 @@ word-break: break-all; } } + + .cmd-title { + white-space: nowrap; + vertical-align: middle; + } + + .cmd-content { + width: 100%; + } } \ No newline at end of file diff --git a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts index 5b2c4fd24..a26a4e042 100644 --- a/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts +++ b/src/ui_ng/lib/src/helm-chart/chart-detail/chart-detail-summary.component.ts @@ -6,6 +6,9 @@ import { } from "@angular/core"; import { HelmChartMetaData, HelmChartSecurity } from "./../../service/interface"; +import { downloadFile } from './../../utils'; +import { HelmChartService } from "../../service/index"; +import { ErrorHandler } from "./../../error-handler/error-handler"; @Component({ selector: "hbr-chart-detail-summary", @@ -22,17 +25,47 @@ export class ChartDetailSummaryComponent implements OnInit { @Input() chartVersion: string; @Input() readme: string; - constructor() {} + copiedCMD = ''; + addCMD = `helm repo add --ca-file --cert-file --key-file --username --password ${this.repoURL}/chartrepo/${this.projectName}`; + installCMD = `helm install --ca-file --cert-file --key-file --username= --password= --version ${this.chartVersion} /${this.chartName}`; + verifyCMD = `helm verify --keyring ${this.chartName}-${this.chartVersion}.tgz`; + + constructor( + private errorHandler: ErrorHandler, + private helmChartService: HelmChartService + ) {} ngOnInit(): void { } - public get addCMD() { - return `helm repo add REPO_NAME ${this.repoURL}/chartrepo/${this.projectName}`; + isCopied(cmd: string) { + return this.copiedCMD === cmd; } - public get installCMD() { - return `helm install --version ${this.chartVersion} REPO_NAME/${this.chartName}`; + onCopySuccess(e: Event, cmd: string) { + 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); + }, + ); } } diff --git a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts index 0f943559b..83be7e148 100644 --- a/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts +++ b/src/ui_ng/lib/src/helm-chart/helm-chart.component.ts @@ -75,7 +75,6 @@ export class HelmChartComponent implements OnInit { .catch(error => this.errorHandler.error(error)); this.lastFilteredChartName = ""; this.refresh(); - } updateFilterValue(value: string) { diff --git a/src/ui_ng/src/app/project/member/add-group/add-group.component.html b/src/ui_ng/src/app/project/member/add-group/add-group.component.html index 3c1c0cfaf..d723dd837 100644 --- a/src/ui_ng/src/app/project/member/add-group/add-group.component.html +++ b/src/ui_ng/src/app/project/member/add-group/add-group.component.html @@ -76,7 +76,7 @@ - {{pagination.firstItem + 1}} - {{pagination.lastItem + 1}} {{'USER.OF' | translate }} {{pagination.totalItems}} {{'MEMBER.GROUPS' | translate}} + {{pagination.totalItems}} {{'MEMBER.ITEMS' | translate}} diff --git a/src/ui_ng/src/i18n/lang/en-us-lang.json b/src/ui_ng/src/i18n/lang/en-us-lang.json index dd241ea95..844d7f2bb 100644 --- a/src/ui_ng/src/i18n/lang/en-us-lang.json +++ b/src/ui_ng/src/i18n/lang/en-us-lang.json @@ -516,7 +516,12 @@ "NO_README": "No readme file provided by this chart.", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Some changes are not saved yet. Do you want to cancel?" diff --git a/src/ui_ng/src/i18n/lang/es-es-lang.json b/src/ui_ng/src/i18n/lang/es-es-lang.json index db95f0413..0f4ba2a9e 100644 --- a/src/ui_ng/src/i18n/lang/es-es-lang.json +++ b/src/ui_ng/src/i18n/lang/es-es-lang.json @@ -515,7 +515,12 @@ "NO_README": "No readme file provided by this chart.", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Algunos cambios no se han guardado aún. ¿Quiere cancelar?" diff --git a/src/ui_ng/src/i18n/lang/fr-fr-lang.json b/src/ui_ng/src/i18n/lang/fr-fr-lang.json index 16d0faaf4..8683bd2cc 100644 --- a/src/ui_ng/src/i18n/lang/fr-fr-lang.json +++ b/src/ui_ng/src/i18n/lang/fr-fr-lang.json @@ -490,7 +490,12 @@ "ITEMS": "items", "SECURITY": "Security", "ACTIVE": "Active", - "DEPRECATED": "Deprecated" + "DEPRECATED": "Deprecated", + "VERIFY_CHART": "Verify Chart", + "COMMAND": "Commands", + "PROV_FILE": "Prov File", + "READY": "Ready", + "NOT_READY": "Not Ready" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "Certaines modifications ne sont pas encore enregistrées. Voulez-vous annuler ?" diff --git a/src/ui_ng/src/i18n/lang/zh-cn-lang.json b/src/ui_ng/src/i18n/lang/zh-cn-lang.json index 93092c1c6..efa056850 100644 --- a/src/ui_ng/src/i18n/lang/zh-cn-lang.json +++ b/src/ui_ng/src/i18n/lang/zh-cn-lang.json @@ -515,7 +515,12 @@ "NO_README": "此Chart未提供README文件", "SECURITY": "安全", "ACTIVE": "正常", - "DEPRECATED": "废弃" + "DEPRECATED": "废弃", + "VERIFY_CHART": "验证Chart", + "COMMAND": "命令", + "PROV_FILE": "Prov 文件", + "READY": "就绪", + "NOT_READY": "未就绪" }, "ALERT": { "FORM_CHANGE_CONFIRMATION": "表单内容改变,确认是否取消?"
{{'HELM_CHART.SIGNED' | translate }}{{'HELM_CHART.PROV_FILE' | translate }} -  {{'HELM_CHART.SIGNED' | translate }} -  {{'HELM_CHART.UNSIGNED' | translate }}