summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/services-list/heal-model/heal-model.component.ts
diff options
context:
space:
mode:
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;
+ }
+
+}