summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/views/services/services-list/services-list.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/services-list.component.ts164
1 files changed, 77 insertions, 87 deletions
diff --git a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
index a6ddb1af..76b3b6be 100644
--- a/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/services-list.component.ts
@@ -30,7 +30,7 @@ export class ServicesListComponent implements OnInit {
@HostBinding('@routerAnimate') routerAnimateState;
@ViewChild('notification') notification1: any;
- public width:number = document.documentElement.clientWidth;
+ public width: number = document.documentElement.clientWidth;
constructor(
private myhttp: ServiceListService,
@@ -96,10 +96,10 @@ export class ServicesListComponent implements OnInit {
}
];
- progressCcvpnOutTimer :any; // ccvpn��NS progress Timer
- progressingCcvpnTimer :any;
- progressNsOutTimer :any;
- progressingNsTimer :any;
+ progressCcvpnOutTimer: any; // ccvpn NS progress Timer
+ progressingCcvpnTimer: any;
+ progressNsOutTimer: any;
+ progressingNsTimer: any;
//The icon behind each row of data in the table expands
iconMoreShow(data, tableData) {
@@ -120,18 +120,19 @@ export class ServicesListComponent implements OnInit {
getallCustomers() {
this.myhttp.getAllCustomers()
.subscribe((data) => {
- this.customerList = data.map(item => ({ name: item["subscriber-name"], id: item["global-customer-id"] }) );
- if(data.length !== 0){
+ this.customerList = data.map(item => ({ name: item["subscriber-name"], id: item["global-customer-id"] }));
+ if (data.length !== 0) {
this.customerSelected = this.customerList[0];
this.choseCustomer();
}
})
+
}
getallOrchestrators() {
this.myhttp.getAllOrchestrators()
.subscribe((data) => {
- if(data.length > 0){
+ if (data.length > 0) {
this.orchestratorList = data.map((item) => {
return { name: item["name"], id: item["name"] }
});
@@ -141,11 +142,11 @@ export class ServicesListComponent implements OnInit {
}
choseCustomer(item = this.customerSelected) {
- if(this.customerSelected !== item) this.customerSelected = item;
+ if (this.customerSelected !== item) this.customerSelected = item;
this.myhttp.getServiceTypes(this.customerSelected)
.subscribe((data) => {
- this.serviceTypeList = data.map( item => ({ name: item["service-type"] }));
- if(data.length !== 0){
+ this.serviceTypeList = data.map(item => ({ name: item["service-type"] }));
+ if (data.length !== 0) {
this.serviceTypeSelected = this.serviceTypeList[0];
this.choseServiceType();
}
@@ -153,7 +154,7 @@ export class ServicesListComponent implements OnInit {
}
choseServiceType(item = this.serviceTypeSelected) {
- if(this.serviceTypeSelected !== item) this.serviceTypeSelected = item;
+ if (this.serviceTypeSelected !== item) this.serviceTypeSelected = item;
this.getTableData();
}
@@ -174,7 +175,7 @@ export class ServicesListComponent implements OnInit {
e2e_ns_temParametersContent: any;
mdons_temParametersContent: any;
- createdModalShow(obj: any): void{
+ createdModalShow(obj: any): void {
this.createData = obj.createData;
if (obj.templateType === "SOTN" || obj.templateType === "CCVPN") {
this.ccvpn_temParametersContent = obj.data;
@@ -182,11 +183,11 @@ export class ServicesListComponent implements OnInit {
} else if (obj.templateType === "E2E Service" || obj.templateType === "Network Service") {
this.e2e_ns_temParametersContent = obj.data;
this.createshow2 = true;
- } else if(obj.templateType === "MDONS"){
+ } else if (obj.templateType === "MDONS") {
this.mdons_temParametersContent = obj.data;
this.showCreateMDONS = true;
}
- this.listDisplay = true;
+ this.listDisplay = true;
}
//tableData
@@ -245,13 +246,13 @@ export class ServicesListComponent implements OnInit {
//
item["serviceStatusInfo"] = item["orchestration-status"]
- if (item["operationResult"] === "2001") {
+ if (item["operationResult"] === "2001") {
item["status"] = "Available";
item["tips"] = "Available";
item["statusClass"] = item["operationResult"];
}
// 2018.12.13
- else if (item["operationResult"] === "2002") {
+ else if (item["operationResult"] === "2002") {
if (item["operationType"] === "1001" || item["operationType"] === "1002") {
// item["status"] = this.accordingState["operationResult"][item["operationResult"]];
item["status"] = this.listSortMasters["operationResults"].find((its) => {
@@ -268,7 +269,7 @@ export class ServicesListComponent implements OnInit {
}
}
- else if (item["operationResult"] === "2003") {
+ else if (item["operationResult"] === "2003") {
item["status"] = this.listSortMasters["operationResults"].find((its) => {
return its["sortCode"] == item["operationResult"] && its["language"] == this.language
})["sortValue"];
@@ -303,13 +304,13 @@ export class ServicesListComponent implements OnInit {
} else {
let updata = (prodata) => {
item["rate"] = prodata.progress || 0;
- if(item["rate"] > 100) {
+ if (item["rate"] > 100) {
item["status"] = prodata.status;
this.getTableData();
}
item["tips"] = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] === item["operationType"] && its["language"] === this.language
- })["sortValue"] + '\xa0\xa0\xa0' + (item["rate"] > 100? item["status"] : prodata.progress + '%');
+ })["sortValue"] + '\xa0\xa0\xa0' + (item["rate"] > 100 ? item["status"] : prodata.progress + '%');
}
let obj = {
serviceId: item["service-instance-id"],
@@ -330,7 +331,7 @@ export class ServicesListComponent implements OnInit {
}
return item;
})
- this.tableData.forEach( item => {
+ this.tableData.forEach(item => {
if (item.serviceDomain === 'E2E Service') {
if (item.operationResult === 2001) {
this.serviceNunber[0]["Success"] += 1;
@@ -397,7 +398,7 @@ export class ServicesListComponent implements OnInit {
})
}
- scaleModalOK(obj: any,templatescalestarting,templateScaleSuccessFaild) :void{
+ scaleModalOK(obj: any, templatescalestarting, templateScaleSuccessFaild): void {
this.scaleE2eService(this.thisService, obj, templateScaleSuccessFaild);
this.scaleNotification(templatescalestarting);
}
@@ -448,7 +449,7 @@ export class ServicesListComponent implements OnInit {
}
}
- healModalOK(obj: any,templatehealstarting,templatehealSuccessFaild) :void{
+ healModalOK(obj: any, templatehealstarting, templatehealSuccessFaild): void {
this.healNsVnfService(this.thisService, obj, templatehealSuccessFaild);
this.healNotification(templatehealstarting);
}
@@ -490,7 +491,7 @@ export class ServicesListComponent implements OnInit {
}
} else if (service["serviceDomain"] === 'E2E Service' || service["serviceDomain"] === 'Network Service') {
this.detailNSShow = true;
- }else if( service["serviceDomain"] === 'MDONS'){
+ } else if (service["serviceDomain"] === 'MDONS') {
this.detailshowMDONS = false;
}
this.listDisplay = true;
@@ -507,15 +508,15 @@ export class ServicesListComponent implements OnInit {
this.deleteModalVisible = true;
}
- deleteModalOK(obj: any,templateDeleteSuccessFaild) :void{
+ deleteModalOK(obj: any, templateDeleteSuccessFaild): void {
this.deleteModalVisible = false;
this.loadingAnimateShow = true;
if (this.thisService["serviceDomain"] === "Network Service") {
- this.deleteNsService(obj,this.thisService);
+ this.deleteNsService(obj, this.thisService);
} else {
this.deleteService(this.thisService, templateDeleteSuccessFaild);
}
- this.notification1.notificationStart(this.thisService['serviceDomain'],'deleteStarting',this.thisService["service-instance-name"] ||this.thisService["nsInstanceName"])
+ this.notification1.notificationStart(this.thisService['serviceDomain'], 'deleteStarting', this.thisService["service-instance-name"] || this.thisService["nsInstanceName"])
}
deleteSuccessNotification(template: TemplateRef<{}>): void {
@@ -578,7 +579,8 @@ export class ServicesListComponent implements OnInit {
};
let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
return this.queryProgress(queryParams, updata);
- }).then(() => {
+ }).then((data) => {
+
newData.rate = 100;
newData.status = "Successful";
this.createSuccessNotification(templateCreateSuccessFaild);
@@ -626,10 +628,7 @@ export class ServicesListComponent implements OnInit {
rate: 0,
tips: ""
}
-
-
if (data == "FAILED") {
- this.msg.error("create ns service Failed :" + JSON.stringify(data));
newData.status = "Failed";
newData.tips = "Unavailable";
this.thisCreateService = newData;
@@ -657,7 +656,7 @@ export class ServicesListComponent implements OnInit {
let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
return this.queryProgress(queryParams, updata);
}).then((data) => {
- if(data == false){
+ if (data == false) {
return false;
}
newData.rate = 100;
@@ -726,7 +725,7 @@ export class ServicesListComponent implements OnInit {
}
let queryParams = { serviceId: data["serviceId"], operationId: data["operationId"], operationType: "1001" };
return this.queryProgress(queryParams, updata);
- }).then(() => {
+ }).then((data) => {
newData.rate = 100;
newData.status = "Successful";
this.createSuccessNotification(templateCreateSuccessFaild);
@@ -775,7 +774,6 @@ export class ServicesListComponent implements OnInit {
this.tableData = [newData, ...this.tableData];
this.createNotification(templateCreatestarting);
if (data.status == "FAILED") {
- this.msg.error("create ns service Failed :" + JSON.stringify(data));
newData.status = "Failed";
this.createSuccessNotification(templateCreateSuccessFaild);
return false;
@@ -814,7 +812,7 @@ export class ServicesListComponent implements OnInit {
}
return this.queryNsProgress(jobid, newData["service-instance-id"], updata, operationType);
- }).then(() => {
+ }).then((data) => {
newData.rate = 100;
newData.status = "Successful";
this.thisCreateService = newData;
@@ -843,17 +841,15 @@ export class ServicesListComponent implements OnInit {
if (data.status == "FAILED") {
this.loadingAnimateShow = false;
res("Failed");
- this.msg.error("create e2e service Failed :" + JSON.stringify(data));
return false;
}
res(data.service);
},
- (error) => {
- this.msg.error('HTTP error '+error.message);
- this.loadingAnimateShow = false;
- res("FAILED");
- return false;
- })
+ (error) => {
+ this.loadingAnimateShow = false;
+ res("FAILED");
+ return false;
+ })
})
return mypromise;
}
@@ -864,7 +860,6 @@ export class ServicesListComponent implements OnInit {
.subscribe((data) => {
if (data.status == "FAILED") {
this.loadingAnimateShow = false;
- this.msg.error("create ns service Failed :" + JSON.stringify(data));
res("Failed");
return false;
}
@@ -883,7 +878,6 @@ export class ServicesListComponent implements OnInit {
this.myhttp.scaleE2eService(id, requestBody)
.subscribe((data) => {
if (data.status == "FAILED") {
- this.msg.error("scale E2e service Failed :" + JSON.stringify(data));
service.status = "Failed";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
@@ -930,12 +924,11 @@ export class ServicesListComponent implements OnInit {
service.statusClass = "1004";
let id = service.nsInstanceId || service["service-instance-id"] || service["vnfNsInstanceId"];
let paramsObj = {
- "ns_instance_id":id
+ "ns_instance_id": id
};
this.myhttp.healNsService(paramsObj, requestBody)
.subscribe((data) => {
if (data.status == "FAILED") {
- this.msg.error("heal nsvnf service Failed :" + JSON.stringify(data));
service.status = "Failed";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
@@ -959,7 +952,7 @@ export class ServicesListComponent implements OnInit {
})["sortValue"] + '\xa0\xa0\xa0' + service["status"];
}
}
- this.queryNsProgress(jobid, null, updata, operationType).then(() => {
+ this.queryNsProgress(jobid, null, updata, operationType).then((data1) => {
service.rate = 100;
service.status = "Successful";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
@@ -992,7 +985,6 @@ export class ServicesListComponent implements OnInit {
this.myhttp.updateccvpn(id, obj)
.subscribe((data) => {
if (data.status == "FAILED") {
- this.msg.error("scale E2e service Failed :" + JSON.stringify(data));
this.detailData["status"] = "Failed";
this.detailData["tips"] = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == this.detailData["statusClass"] && its["language"] == this.language
@@ -1031,9 +1023,9 @@ export class ServicesListComponent implements OnInit {
})
}
- deleteService(service:any, templateDeleteSuccessFaild) {
- let allprogress = {};
- let querypros = [];
+ deleteService(service: any, templateDeleteSuccessFaild) {
+ let allprogress = {};
+ let querypros = [];
service.rate = 0;
service.status = "In Progress";
service.tips = "";
@@ -1050,7 +1042,6 @@ export class ServicesListComponent implements OnInit {
.subscribe((data) => {
this.loadingAnimateShow = false;
if (data.status == "FAILED") {
- this.msg.error("delete service Failed :" + JSON.stringify(data));
service.status = "Failed";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
@@ -1086,7 +1077,7 @@ export class ServicesListComponent implements OnInit {
})
});
Promise.all(deletePros).then(() => {
- Promise.all(querypros).then(() => {
+ Promise.all(querypros).then((data) => {
service.rate = 100;
service.status = "Successful";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
@@ -1107,7 +1098,7 @@ export class ServicesListComponent implements OnInit {
})
}
- deleteNsService(obj:any,service:any) {
+ deleteNsService(obj: any, service: any) {
service.rate = 0;
service.status = "In Progress";
service.tips = "";
@@ -1117,7 +1108,7 @@ export class ServicesListComponent implements OnInit {
this.stopNsService(id, obj).then((jobid) => {
if (jobid === "Failed") {
service.status = "Failed";
- this.notification1.notificationFailed(service.serviceDomain,'deleteStarting',service["service-instance-name"] ||service["nsInstanceName"])
+ this.notification1.notificationFailed(service.serviceDomain, 'deleteStarting', service["service-instance-name"] || service["nsInstanceName"])
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
})["sortValue"] + this.listSortMasters["operationResults"].find((its) => {
@@ -1127,18 +1118,18 @@ export class ServicesListComponent implements OnInit {
}
let updata = (prodata) => {
service.rate = prodata.progress || 0;
- if(service['rate'] > 100)service["status"] = prodata.status;
+ if (service['rate'] > 100) service["status"] = prodata.status;
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
- })["sortValue"] + (service["rate"] > 100? service["status"] : ('\xa0\xa0\xa0' + service.rate + "%"));
+ })["sortValue"] + (service["rate"] > 100 ? service["status"] : ('\xa0\xa0\xa0' + service.rate + "%"));
}
this.queryNsProgress(jobid, null, updata, operationType).then(() => {
let paramsObj = {
- "ns_instance_id":id
+ "ns_instance_id": id
};
this.myhttp.nsDeleteInstance(paramsObj)
.subscribe((data) => {
- if(data.status == "SUCCESS"){
+ if (data.status == "SUCCESS") {
service.rate = 100;
service.status = "Successful";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
@@ -1146,15 +1137,15 @@ export class ServicesListComponent implements OnInit {
})["sortValue"] + this.listSortMasters["operationResults"].find((its) => {
return its["sortCode"] == 2001 && its["language"] == this.language
})["sortValue"];
- this.notification1.notificationSuccess(service.serviceDomain,'deleteStarting',service["service-instance-name"] ||service["nsInstanceName"])
- }else {
+ this.notification1.notificationSuccess(service.serviceDomain, 'deleteStarting', service["service-instance-name"] || service["nsInstanceName"])
+ } else {
service.status = "Failed";
service.tips = this.listSortMasters["operationTypes"].find((its) => {
return its["sortCode"] == service.statusClass && its["language"] == this.language
})["sortValue"] + this.listSortMasters["operationResults"].find((its) => {
return its["sortCode"] == 2002 && its["language"] == this.language
})["sortValue"];
- this.notification1.notificationFailed(service.serviceDomain,'deleteStarting',service["service-instance-name"] ||service["nsInstanceName"])
+ this.notification1.notificationFailed(service.serviceDomain, 'deleteStarting', service["service-instance-name"] || service["nsInstanceName"])
return false;
}
let hasUndone = this.tableData.some((item) => {
@@ -1172,14 +1163,13 @@ export class ServicesListComponent implements OnInit {
stopNsService(id, obj) {
let paramsObj = {
- "ns_instance_id":id
+ "ns_instance_id": id
}
return new Promise((res, rej) => {
this.myhttp.stopNsService(paramsObj, obj)
.subscribe((data) => {
this.loadingAnimateShow = false;
if (data.status == "FAILED") {
- this.msg.error("stop ns service Failed :" + JSON.stringify(data));
res("Failed");
return false;
}
@@ -1189,30 +1179,30 @@ export class ServicesListComponent implements OnInit {
}
queryProgress(obj, callback) {
- return new Promise( res => {
- let operationTypeObj = {operationType:obj.operationType};
+ return new Promise(res => {
+ let operationTypeObj = { operationType: obj.operationType };
let errorNums = 180;
- let requeryCcvpn = () => {
- this.myhttp.getProgress(obj,operationTypeObj)
+ let requeryCcvpn = () => {
+ this.myhttp.getProgress(obj, operationTypeObj)
.subscribe((data) => {
if (data.status === "FAILED") {
callback({ progress: 255, status: "Failed" });
- }else if (data.operationStatus === null || data.operationStatus.progress === undefined) {
+ } else if (data.operationStatus === null || data.operationStatus.progress === undefined) {
errorNums--;
if (errorNums === 0) {
callback({ progress: 255, status: "time over" });
return false;
}
- this.progressCcvpnOutTimer = setTimeout(()=>{
+ this.progressCcvpnOutTimer = setTimeout(() => {
requeryCcvpn();
- },10000);
- }else if (data.operationStatus.progress > 100) {
+ }, 10000);
+ } else if (data.operationStatus.progress > 100) {
callback({ progress: 255, status: "time over" });
- }else if (data.operationStatus.progress < 100) {
+ } else if (data.operationStatus.progress < 100) {
callback(data.operationStatus);
- this.progressingCcvpnTimer = setTimeout(()=>{
+ this.progressingCcvpnTimer = setTimeout(() => {
requeryCcvpn();
- },5000);
+ }, 5000);
} else {
res(data.operationStatus);
}
@@ -1226,31 +1216,31 @@ export class ServicesListComponent implements OnInit {
return new Promise((res, rej) => {
let errorNums = 180;
let paramsObj = {
- "responseId":0,
- "serviceInstanceId":id,
- "operationType":operationType
+ "responseId": 0,
+ "serviceInstanceId": id,
+ "operationType": operationType
}
- let requeryNs = () => {
- this.myhttp.getNsProgress(jobid,paramsObj)
+ let requeryNs = () => {
+ this.myhttp.getNsProgress(jobid, paramsObj)
.subscribe((data) => {
if (data.status == "FAILED") {
callback({ progress: 255, status: "Failed" });
- }else if (data.responseDescriptor === null || data.responseDescriptor.progress === undefined) {
+ } else if (data.responseDescriptor === null || data.responseDescriptor.progress === undefined) {
errorNums--;
if (errorNums === 0) {
callback({ progress: 255, status: "time over" });
return false;
}
- this.progressNsOutTimer = setTimeout(()=>{
+ this.progressNsOutTimer = setTimeout(() => {
requeryNs();
- },10000);
- }else if (data.responseDescriptor.progress > 100 && data.responseDescriptor.status === "error") {
+ }, 10000);
+ } else if (data.responseDescriptor.progress > 100 && data.responseDescriptor.status === "error") {
callback({ progress: 255, status: data.responseDescriptor.statusDescription });
- }else if (data.responseDescriptor.progress < 100) {
+ } else if (data.responseDescriptor.progress < 100) {
callback(data.responseDescriptor);
- this.progressingNsTimer = setTimeout(()=>{
+ this.progressingNsTimer = setTimeout(() => {
requeryNs();
- },5000);
+ }, 5000);
} else {
res(data);
}