aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
diff options
context:
space:
mode:
authorLvbo163 <lv.bo163@zte.com.cn>2017-09-20 14:44:57 +0800
committerLvbo163 <lv.bo163@zte.com.cn>2017-09-20 14:44:57 +0800
commit3628e915b22b3171f1ab7678fb3432c6986faa53 (patch)
tree230cbeb68e52cbc8a30142f9b26ac7aafcdcfd44 /sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
parent3b9daa6af92637841b8a60a3f4ce0912b3dab240 (diff)
show current workflow name
show workflow name while a workflow is selected. Issue-ID: SDC-354 Change-Id: I61d72d36f20552cf57ca8713b44d93a053cbd172 Signed-off-by: Lvbo163 <lv.bo163@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
index 4183391e..4cd88480 100644
--- a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
+++ b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.ts
@@ -25,6 +25,7 @@ import { Workflow } from "../../model/workflow/workflow";
export class MenuComponent {
@ViewChild(MicroserviceComponent) public microserviceComponent: MicroserviceComponent;
@ViewChild(WorkflowsComponent) public workflowsComponent: WorkflowsComponent;
+ public currentWorkflow = 'Workflows';
constructor(private broadcastService: BroadcastService, private workflowService: WorkflowService) {
}
@@ -58,23 +59,20 @@ export class MenuComponent {
}
public workflowSelected(workflow: Workflow) {
+ this.currentWorkflow = workflow.name;
this.broadcastService.broadcast(this.broadcastService.workflow, workflow);
}
public download() {
const filename = this.workflowService.workflow.name + '.json';
const content = JSON.stringify(this.workflowService.workflow);
- // 创建隐藏的可下载链接
var eleLink = document.createElement('a');
eleLink.download = filename;
eleLink.style.display = 'none';
- // 字符内容转变成blob地址
var blob = new Blob([content]);
eleLink.href = URL.createObjectURL(blob);
- // 触发点击
document.body.appendChild(eleLink);
eleLink.click();
- // 然后移除
document.body.removeChild(eleLink);
}
}