summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2019-10-15 16:28:59 +0800
committercyuamber <xuranyjy@chinamobile.com>2019-10-15 16:29:09 +0800
commit65be860e2a6844da71d4046254a189d911adbbd9 (patch)
tree5313cdd32205a22848f26a4bf0a99fe93ac53407 /usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts
parent58372d3b8c3f99cbd199ea2c717388bb6b2eed16 (diff)
feat:add healModel component of services-list page5.0.2-ONAPelalto
Change-Id: I0665fb880663645fd620355387f1a113f72d40c5 Issue-ID: USECASEUI-307 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts68
1 files changed, 68 insertions, 0 deletions
diff --git a/usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts b/usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts
new file mode 100644
index 00000000..a7ffe663
--- /dev/null
+++ b/usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts
@@ -0,0 +1,68 @@
+import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
+
+@Component({
+ selector: 'app-heal-model',
+ templateUrl: './heal-model.component.html',
+ styleUrls: ['./heal-model.component.less']
+})
+export class HealModelComponent implements OnInit {
+ @Input()healModelVisible: boolean;
+ @Input()thisService;
+ @Input()nsParams;
+ @Input()healActions;
+ @Input()nsAdditional;
+ @Input()vnfParams;
+ @Input()vmSelected;
+ @Input()vnfVms;
+ @Input()templatehealstarting;
+ @Input()templatehealSuccessFaild;
+
+ @Output() cancel = new EventEmitter<boolean>();
+ @Output() healModalOK = new EventEmitter<any>();
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+
+ addActionsHealing() {
+ this.healActions.push({ value: "" })
+ }
+
+ minusActionsHealing(index) {
+ this.healActions.splice(index, 1);
+ }
+
+ addNsAdditional() {
+ this.nsAdditional.push({ key: "", value: "" })
+ }
+
+ minusNsAdditional(index) {
+ this.nsAdditional.splice(index, 1);
+ }
+
+ healOk() {
+ this.healModelVisible = false;
+ // nsParams
+ this.nsParams.actionsHealing = this.healActions.map((item) => {
+ return item.value
+ });
+ let additional = {};
+ this.nsAdditional.forEach((item) => {
+ additional[item.key] = item.value;
+ });
+ this.nsParams.additionalParamsforNs = JSON.stringify(additional);
+ // vnfParams
+ this.vnfParams.additionalParams.actionvminfo.vmid = this.vmSelected["vmId"];
+ this.vnfParams.additionalParams.actionvminfo.vmname = this.vmSelected["vmName"];
+
+ let requestBody = this.thisService["serviceDomain"] == "Network Service" ? { healNsData: this.nsParams } : { healVnfData: this.vnfParams };
+ this.healModalOK.emit(requestBody)
+ }
+
+ healCancel() {
+ this.healModelVisible = false;
+ }
+
+}