From 55bdd1b0e2fa81d5daedf27b15906cbe42c7f0e6 Mon Sep 17 00:00:00 2001 From: BennieMeng Date: Fri, 21 Dec 2018 18:20:41 +0800 Subject: [PATCH] frontend: diffTpl replace --- .../src/app/portal/ingress/ingress.component.html | 2 +- .../persistentvolumeclaim.component.html | 2 +- .../persistentvolumeclaim.component.ts | 2 +- .../src/app/portal/secret/secret.component.html | 2 +- .../portal/statefulset/statefulset.component.html | 2 +- src/frontend/src/app/shared/diff/diff.component.ts | 4 ++-- src/frontend/src/app/shared/diff/diff.service.ts | 14 +++++++------- src/frontend/src/app/shared/diff/diff.ts | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/frontend/src/app/portal/ingress/ingress.component.html b/src/frontend/src/app/portal/ingress/ingress.component.html index 56b8f06cd..62b870ac7 100644 --- a/src/frontend/src/app/portal/ingress/ingress.component.html +++ b/src/frontend/src/app/portal/ingress/ingress.component.html @@ -30,7 +30,7 @@ - + 创建时间 diff --git a/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.html b/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.html index 260d81886..1eba8b807 100644 --- a/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.html +++ b/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.html @@ -22,7 +22,7 @@ - +
diff --git a/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.ts b/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.ts index e194e808b..dbbf6b01f 100644 --- a/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.ts +++ b/src/frontend/src/app/portal/persistentvolumeclaim/persistentvolumeclaim.component.ts @@ -81,7 +81,7 @@ export class PersistentVolumeClaimComponent implements OnInit, OnDestroy { } - diffTmp() { + diffTpl() { this.pvcService.diff(); } diff --git a/src/frontend/src/app/portal/secret/secret.component.html b/src/frontend/src/app/portal/secret/secret.component.html index 855e544f3..3c19d9733 100644 --- a/src/frontend/src/app/portal/secret/secret.component.html +++ b/src/frontend/src/app/portal/secret/secret.component.html @@ -32,7 +32,7 @@ *ngIf="authService.currentAppPermission.secret.offline || authService.currentUser.admin"> {{'SECRET.DELETE' | translate}} - + {{'TITLE.CREATE_TIME' | translate}} diff --git a/src/frontend/src/app/portal/statefulset/statefulset.component.html b/src/frontend/src/app/portal/statefulset/statefulset.component.html index edeb5b904..8a20d3091 100644 --- a/src/frontend/src/app/portal/statefulset/statefulset.component.html +++ b/src/frontend/src/app/portal/statefulset/statefulset.component.html @@ -32,7 +32,7 @@ *ngIf="authService.currentAppPermission.statefulset.offline || authService.currentUser.admin"> {{'STATEFULSET.DELETE' | translate}} - + {{'TITLE.CREATE_TIME' | translate}} diff --git a/src/frontend/src/app/shared/diff/diff.component.ts b/src/frontend/src/app/shared/diff/diff.component.ts index 044cafe72..2705dbde7 100644 --- a/src/frontend/src/app/shared/diff/diff.component.ts +++ b/src/frontend/src/app/shared/diff/diff.component.ts @@ -3,7 +3,7 @@ import { createPatch } from 'diff'; import { Diff2Html } from 'diff2html'; import { DiffService } from './diff.service'; import { Subscription } from 'rxjs'; -import { DiffTmp } from './diff'; +import { DiffTpl } from './diff'; import * as YAML from 'js-yaml'; import { MessageHandlerService } from '../message-handler/message-handler.service'; /** @@ -38,7 +38,7 @@ export class DiffComponent implements OnDestroy { html = ''; inputType = 'json'; outStyle = 'side-by-side'; - diffTpl: DiffTmp; + diffTpl: DiffTpl; get style() { return this._style; } diff --git a/src/frontend/src/app/shared/diff/diff.service.ts b/src/frontend/src/app/shared/diff/diff.service.ts index e8442acb0..23bfc8f1c 100644 --- a/src/frontend/src/app/shared/diff/diff.service.ts +++ b/src/frontend/src/app/shared/diff/diff.service.ts @@ -1,8 +1,8 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; -import { DiffTmp } from './diff'; +import { DiffTpl } from './diff'; import { MessageHandlerService } from '../message-handler/message-handler.service'; -const defaultTmp: DiffTmp = { +const defaultTmp: DiffTpl = { fileName: '', oldStr: '', newStr: '', @@ -19,18 +19,18 @@ export class DiffService { } - diffSub = new Subject(); + diffSub = new Subject(); diffOb = this.diffSub.asObservable(); diff(selected: any[], tmpPropName = 'template', namePropName = 'id') { const length = selected.length; - let diffTmp; + let diffTpl; if (length < 2) { this.messageHandlerService.showError('SHARED.DIFF.TMP_LESS'); return; } else { - diffTmp = { + diffTpl = { oldStr: selected[1][tmpPropName], newStr: selected[0][tmpPropName], oldHeader: `${selected[1][namePropName]}`, @@ -40,8 +40,8 @@ export class DiffService { this.messageHandlerService.showInfo('SHARED.DIFF.TMP_MORE'); } } - diffTmp = { ...defaultTmp, ...diffTmp }; - this.diffSub.next(diffTmp); + diffTpl = { ...defaultTmp, ...diffTpl }; + this.diffSub.next(diffTpl); } } diff --git a/src/frontend/src/app/shared/diff/diff.ts b/src/frontend/src/app/shared/diff/diff.ts index e3820261b..9ff1e0e1b 100644 --- a/src/frontend/src/app/shared/diff/diff.ts +++ b/src/frontend/src/app/shared/diff/diff.ts @@ -1,4 +1,4 @@ -export interface DiffTmp { +export interface DiffTpl { fileName?: string; oldStr: string; newStr: string;