diff options
author | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-20 14:44:57 +0800 |
---|---|---|
committer | Lvbo163 <lv.bo163@zte.com.cn> | 2017-09-20 14:44:57 +0800 |
commit | 3628e915b22b3171f1ab7678fb3432c6986faa53 (patch) | |
tree | 230cbeb68e52cbc8a30142f9b26ac7aafcdcfd44 /sdc-workflow-designer-ui/src/app/components/menu | |
parent | 3b9daa6af92637841b8a60a3f4ce0912b3dab240 (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')
3 files changed, 9 insertions, 5 deletions
diff --git a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.css b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.css index 2fa48afa..6ba4133b 100644 --- a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.css +++ b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.css @@ -14,6 +14,10 @@ float: right; } +.btn-left{ + float: left; +} + button i{ padding-right: 3px; } diff --git a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.html b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.html index e54dd4e6..8cf9dc57 100644 --- a/sdc-workflow-designer-ui/src/app/components/menu/menu.component.html +++ b/sdc-workflow-designer-ui/src/app/components/menu/menu.component.html @@ -12,8 +12,10 @@ */ --> +<div class="btn-left"> + <p-splitButton [label]="currentWorkflow" icon="fa-arrows" (onClick)="showWorkflows()" [model]="getWorkflows()"></p-splitButton> +</div> <div class="btn-right"> - <p-splitButton label="Workflows" icon="fa-check" (onClick)="showWorkflows()" [model]="getWorkflows()"></p-splitButton> <button type="button" class="btn white" (click)="save()"> <i class="fa fa-save"></i>Save </button> 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); } } |