From 00c147b809265bd3394a3a005113052cb3e3e832 Mon Sep 17 00:00:00 2001 From: BennieMeng Date: Fri, 12 Apr 2019 18:55:30 +0800 Subject: [PATCH] frontend: change log copy command deployments to deployment --- .../src/app/portal/pod-logging/pod-logging.component.ts | 3 ++- src/frontend/src/app/shared/list-pod/list-pod.component.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/app/portal/pod-logging/pod-logging.component.ts b/src/frontend/src/app/portal/pod-logging/pod-logging.component.ts index f3c827aee..bbce58381 100644 --- a/src/frontend/src/app/portal/pod-logging/pod-logging.component.ts +++ b/src/frontend/src/app/portal/pod-logging/pod-logging.component.ts @@ -93,7 +93,8 @@ export class PodLoggingComponent implements OnInit, OnDestroy { this.messageHandlerService.showInfo('缺少机房信息,请联系管理员'); } const command = this.selectedPod ? - `kubetool log --source ${this.logSource === undefined ? '' : this.logSource} --${this.resourceType} ` + + `kubetool log --source ${this.logSource === undefined ? '' : this.logSource}` + + ` --${this.resourceType === 'deployments' ? 'deployment' : this.resourceType} ` + `${this.resourceName} --pod=${this.selectedPod.metadata.name} --container=${this.selectedContainer} --layout=log` : ''; this.copyService.copy(command); this.switchCopyButton(); diff --git a/src/frontend/src/app/shared/list-pod/list-pod.component.ts b/src/frontend/src/app/shared/list-pod/list-pod.component.ts index e7058d7c2..7b6b32398 100644 --- a/src/frontend/src/app/shared/list-pod/list-pod.component.ts +++ b/src/frontend/src/app/shared/list-pod/list-pod.component.ts @@ -200,7 +200,8 @@ export class ListPodComponent implements OnDestroy { this.messageHandlerService.showInfo('缺少机房信息,请联系管理员'); } const kubeToolCmd = `kubetool log --source ${this.logSource === undefined ? '' : this.logSource} ` + - ` --${this.resourceType} ${this.resourceName} --pod=${pod.metadata.name} --layout=log`; + ` --${this.resourceType === 'deployments' ? 'deployment' : this.resourceType} ${this.resourceName}` + + ` --pod=${pod.metadata.name} --layout=log`; this.copyService.copy(kubeToolCmd); this.switchCopyButton(); }