summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/views')
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/ccvpn-detail/ccvpn-detail.component.ts1
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/e2e-creation/e2e-creation.component.ts26
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/e2e-detail/e2e-detail.component.ts11
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts127
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/mdons-detail/mdons-detail.component.ts24
-rw-r--r--usecaseui-portal/src/app/views/services/services-list/services-list.component.ts164
6 files changed, 154 insertions, 199 deletions
diff --git a/usecaseui-portal/src/app/views/services/services-list/ccvpn-detail/ccvpn-detail.component.ts b/usecaseui-portal/src/app/views/services/services-list/ccvpn-detail/ccvpn-detail.component.ts
index a253b044..51cb941e 100644
--- a/usecaseui-portal/src/app/views/services/services-list/ccvpn-detail/ccvpn-detail.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/ccvpn-detail/ccvpn-detail.component.ts
@@ -498,7 +498,6 @@ export class CcvpnDetailComponent implements OnInit {
}
});
- console.log(this.siteTableData);
this.siteAddModelShow = false;
}
diff --git a/usecaseui-portal/src/app/views/services/services-list/e2e-creation/e2e-creation.component.ts b/usecaseui-portal/src/app/views/services/services-list/e2e-creation/e2e-creation.component.ts
index 91ac1031..121f50d4 100644
--- a/usecaseui-portal/src/app/views/services/services-list/e2e-creation/e2e-creation.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/e2e-creation/e2e-creation.component.ts
@@ -23,14 +23,12 @@ import * as d3 from 'd3';
styleUrls: ['./e2e-creation.component.less']
})
export class E2eCreationComponent implements OnInit {
-
constructor(private myhttp: ServiceListService) { }
ngOnInit() {
this.gete2eTemParameters(this.e2e_ns_temParametersContent);
this.getVimInfo();
this.getSdnControllers();
- console.log(this.createParams);
}
@Output() e2eCloseCreate = new EventEmitter();
@@ -78,8 +76,6 @@ export class E2eCreationComponent implements OnInit {
};
gete2eTemParameters(data) { //Get template parameters
let type = this.createParams.commonParams.templateType == "E2E Service" ? "e2e" : "ns";
- console.log(this.createParams);
- console.log(data);
if (type == "e2e") {
this.templateParameters = data;
this.templateParameters.nestedTemplates.forEach((item) => {
@@ -99,16 +95,13 @@ export class E2eCreationComponent implements OnInit {
});
this.roote2e.children.push(nsIndex);
});
- console.log(this.templateParameters);
- console.log(this.roote2e)
+
} else if (type == "ns") {
if (data["model"] != undefined && typeof data["model"] == 'string') {
this.nsTemplateParameters = JSON.parse(data["model"]);
- console.log(data["model"],"----------1111");
} else {
this.nsTemplateParameters = data;
}
- console.log(this.nsTemplateParameters);
this.nsTemplateParameters["inputs2"] = [];
let inputs = this.nsTemplateParameters.inputs;
for (let key in inputs) {
@@ -120,11 +113,8 @@ export class E2eCreationComponent implements OnInit {
"type": "vnf",
}
});
- console.log(this.nsTemplateParameters);
}
-
this.drawImage(type)
-
}
vimInfos = [];
getVimInfo() {
@@ -152,13 +142,10 @@ export class E2eCreationComponent implements OnInit {
globalSubscriberId: "", // "customer.id",
serviceType: "", // "serviceType.value",
parameters: {
- locationConstraints: [
-
- ],
+ locationConstraints: [],
resources: [],
requestInputs: {},
}
-
}
// ns requstbody
@@ -172,11 +159,8 @@ export class E2eCreationComponent implements OnInit {
}
}
ns_service2 = {
- locationConstraints: [
-
- ],
- additionalParamForNs: {
- }
+ locationConstraints: [],
+ additionalParamForNs: {}
}
submit() {
let type = this.createParams.commonParams.templateType == "E2E Service" ? "e2e" : "ns";
@@ -218,7 +202,6 @@ export class E2eCreationComponent implements OnInit {
})
this.service.parameters.resources.push(nsService);
})
- console.log(this.service)
this.service.parameters.requestInputs['orchestrator'] = this.createParams.orchestrator.name;
if (this.createParams.isSol005Interface) {
this.service.parameters.requestInputs['isSol005Interface'] = this.createParams.isSol005Interface;
@@ -244,7 +227,6 @@ export class E2eCreationComponent implements OnInit {
}
this.ns_service2.locationConstraints.push(vnfparams);
})
- console.log(this.ns_service2);
let requstbody = {
step1: this.ns_service,
diff --git a/usecaseui-portal/src/app/views/services/services-list/e2e-detail/e2e-detail.component.ts b/usecaseui-portal/src/app/views/services/services-list/e2e-detail/e2e-detail.component.ts
index 50f63b3e..ca49a6b9 100644
--- a/usecaseui-portal/src/app/views/services/services-list/e2e-detail/e2e-detail.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/e2e-detail/e2e-detail.component.ts
@@ -78,12 +78,12 @@ export class E2eDetailComponent implements OnInit {
}
dataInit() {
- console.log(this.detailParams);
+
this.serviceInstanceName = this.detailParams['service-instance-name'] || this.detailParams["nsName"];
if (this.detailParams.serviceDomain == 'E2E Service') {
this.input_parameters = JSON.stringify(this.detailParams['input-parameters']);
this.input_parameters = JSON.parse(this.input_parameters);
- console.log(this.input_parameters);
+
this.service = {
name: this.input_parameters.service.name,
description: this.input_parameters.service.description,
@@ -118,9 +118,7 @@ export class E2eDetailComponent implements OnInit {
});
this.roote2e.children.push(nsIndex);
});
- console.log(this.e2e_nestedTemplates);
- console.log(this.e2e_requestInputs);
- console.log(this.roote2e)
+
}
} else if (this.detailParams.serviceDomain == 'Network Service') {
this.ns_service = {
@@ -137,9 +135,6 @@ export class E2eDetailComponent implements OnInit {
"type": "vnf"
}
});
- console.log(this.ns_nestedTemplates);
- console.log(this.ns_requestInputs);
- console.log(this.rootns)
}
this.drawImage(this.detailParams.serviceDomain)
}
diff --git a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts
index 232de474..8d0f2562 100644
--- a/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/mdons-creation/mdons-creation.component.ts
@@ -12,14 +12,14 @@ import * as d3 from 'd3';
export class MdonsCreationComponent implements OnInit {
mdons_creation_form: FormGroup;
- uniList= [];
+ uniList = [];
uniIdSelected = { id: null };
- enniList= [];
+ enniList = [];
enniIdSelected = { id: null };
- nniList= [];
+ nniList = [];
nniIdSelected = { id: null };
-
- nniMap : Map<any, any> = new Map<any, any>();
+
+ nniMap: Map<any, any> = new Map<any, any>();
templateParameters = {
invariantUUID: "",
@@ -49,22 +49,22 @@ export class MdonsCreationComponent implements OnInit {
],
resources: [],
requestInputs: {
- name:"",
- customer:"",
- service_provider:"",
- due_date:"",
- end_date:"",
- uni_id:"",
- enni_id:""
+ name: "",
+ customer: "",
+ service_provider: "",
+ due_date: "",
+ end_date: "",
+ uni_id: "",
+ enni_id: ""
}
}
}
- mdonsModelShow : boolean = false;
- constructor(private myhttp: ServiceListService,private fb: FormBuilder) {
+ mdonsModelShow: boolean = false;
+ constructor(private myhttp: ServiceListService, private fb: FormBuilder) {
+
-
- }
+ }
@Input() createParams;
@Input() mdons_temParametersContent;
@Output() mdonsCloseCreate = new EventEmitter();
@@ -73,67 +73,66 @@ export class MdonsCreationComponent implements OnInit {
this.getalluni();
this.getallenni();
this.getallnni();
- this.templateParameters=this.mdons_temParametersContent;
+ this.templateParameters = this.mdons_temParametersContent;
this.mdonsModelShow = true;
this.mdons_creation_form = this.fb.group({});
this.buildFormArrayOfGroupsFromArr();
- console.log("Controls "+this.mdons_creation_form.controls['terms'])
}
buildFormArrayOfGroupsFromArr() {
- for(let i of this.templateParameters.inputs){
- if(i.isRequired === "true" && !(i.name.includes('_id'))){
- this.mdons_creation_form.addControl(i.name, this.fb.control('', [Validators.required]))
+ for (let i of this.templateParameters.inputs) {
+ if (i.isRequired === "true" && !(i.name.includes('_id'))) {
+ this.mdons_creation_form.addControl(i.name, this.fb.control('', [Validators.required]))
} else {
- this.mdons_creation_form.addControl(i.name, this.fb.control(''))
+ this.mdons_creation_form.addControl(i.name, this.fb.control(''))
}
}
}
getalluni() {
this.myhttp.getAllNI("UNI")
- .subscribe((data) => {
- this.uniList = data.map(item => ({id: item }) );
- if(data.length !== 0){
- this.uniIdSelected = this.uniList[0];
- }
- })
-}
+ .subscribe((data) => {
+ this.uniList = data.map(item => ({ id: item }));
+ if (data.length !== 0) {
+ this.uniIdSelected = this.uniList[0];
+ }
+ })
+ }
-getallenni() {
- this.myhttp.getAllNI("ENNI")
+ getallenni() {
+ this.myhttp.getAllNI("ENNI")
.subscribe((data) => {
- this.enniList = data.map(item => ({id: item }) );
- if(data.length !== 0){
- this.enniIdSelected = this.enniList[0];
- }
+ this.enniList = data.map(item => ({ id: item }));
+ if (data.length !== 0) {
+ this.enniIdSelected = this.enniList[0];
+ }
})
-}
+ }
-getallnni() {
- this.myhttp.getAllNI("NNI")
+ getallnni() {
+ this.myhttp.getAllNI("NNI")
.subscribe((data) => {
- this.nniList = data.map(item => ({id: item }) );
- if(data.length !== 0){
- this.nniIdSelected = this.nniList[0];
- }
+ this.nniList = data.map(item => ({ id: item }));
+ if (data.length !== 0) {
+ this.nniIdSelected = this.nniList[0];
+ }
})
-}
+ }
-chooseUni(parameterName, item){
- //if(this.uniIdSelected !== item) this.uniIdSelected = item;
- this.nniMap.set(parameterName,item);
-}
+ chooseUni(parameterName, item) {
+ //if(this.uniIdSelected !== item) this.uniIdSelected = item;
+ this.nniMap.set(parameterName, item);
+ }
-chooseEnni(parameterName, item){
- //if(this.enniIdSelected !== item) this.enniIdSelected = item;
- this.nniMap.set(parameterName,item);
-}
+ chooseEnni(parameterName, item) {
+ //if(this.enniIdSelected !== item) this.enniIdSelected = item;
+ this.nniMap.set(parameterName, item);
+ }
-chooseNni(parameterName, item){
- //if(this.nniIdSelected !== item) this.nniIdSelected = item;
- this.nniMap.set(parameterName,item);
-}
+ chooseNni(parameterName, item) {
+ //if(this.nniIdSelected !== item) this.nniIdSelected = item;
+ this.nniMap.set(parameterName, item);
+ }
goback() {
this.mdonsCloseCreate.emit();
@@ -145,30 +144,28 @@ chooseNni(parameterName, item){
if (this.mdons_creation_form.invalid) {
return;
} else {
- this.service.serviceInvariantUuid = this.templateParameters.invariantUUID;
- this.service.name = this.templateParameters.name;
- this.service.description = this.templateParameters.description;
+ this.service.serviceInvariantUuid = this.templateParameters.invariantUUID;
+ this.service.name = this.templateParameters.name;
+ this.service.description = this.templateParameters.description;
this.service.serviceUuid = this.templateParameters.uuid;
this.service.globalSubscriberId = this.createParams.commonParams.customer.id;
this.service.serviceType = this.createParams.commonParams.serviceType.name;
this.templateParameters.inputs.forEach((ipnut) => {
this.service.parameters.requestInputs[ipnut.name] = ipnut.value == undefined ? ipnut.defaultValue : ipnut.value;
- if(ipnut.name.includes('uni') && ipnut.name.includes('id')) {
+ if (ipnut.name.includes('uni') && ipnut.name.includes('id')) {
this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.uniIdSelected.id : this.nniMap.get(ipnut.name).id;
}
- if(ipnut.name.includes('enni') && ipnut.name.includes('id')) {
+ if (ipnut.name.includes('enni') && ipnut.name.includes('id')) {
this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.enniIdSelected.id : this.nniMap.get(ipnut.name).id;
}
- if(ipnut.name.includes('nni') && ipnut.name.includes('id')) {
+ if (ipnut.name.includes('nni') && ipnut.name.includes('id')) {
this.service.parameters.requestInputs[ipnut.name] = this.nniMap.get(ipnut.name) == undefined ? this.nniIdSelected.id : this.nniMap.get(ipnut.name).id;
}
- if(ipnut.name==='name') {
+ if (ipnut.name === 'name') {
this.service.name = ipnut.value == undefined ? ipnut.defaultValue : ipnut.value;
- }
+ }
})
-
- console.log(this.service)
this.mdonsCloseCreate.emit({ service: this.service });
}
}
diff --git a/usecaseui-portal/src/app/views/services/services-list/mdons-detail/mdons-detail.component.ts b/usecaseui-portal/src/app/views/services/services-list/mdons-detail/mdons-detail.component.ts
index 1b0d3565..3818eb91 100644
--- a/usecaseui-portal/src/app/views/services/services-list/mdons-detail/mdons-detail.component.ts
+++ b/usecaseui-portal/src/app/views/services/services-list/mdons-detail/mdons-detail.component.ts
@@ -41,38 +41,33 @@ export class MdonsDetailComponent implements OnInit {
ngOnInit() {
- console.log(this.detailParams);
this.serviceInstanceName = this.detailParams['serviceDomain'] || this.detailParams["nsName"];
this.input_parameters = JSON.parse(this.detailParams['input-parameters']);
- console.log(this.input_parameters);
+
this.service = {
name: this.input_parameters.service.name,
- description: this.input_parameters.service.description,
- };
+ description: this.input_parameters.service.description,
+ };
if (this.input_parameters.service.parameters.requestInputs != undefined && Object.keys(this.input_parameters.service.parameters.requestInputs).length > 0) {
this.e2e_requestInputs = this.input_parameters.service.parameters.requestInputs;
}
if (this.e2e_requestInputs != undefined) {
- for(let item of this.e2e_requestInputs) {
- console.log("outside "+item);
- if((item.includes("enni_id") || item.includes("uni_id"))){
- console.log("inside "+item);
+ for (let item of this.e2e_requestInputs) {
+ if ((item.includes("enni_id") || item.includes("uni_id"))) {
let nsIndex = {
"name": "ns",
"type": "ns",
"children": []
};
-
+
this.roote2e.children.push(nsIndex);
}
-
+
}
- console.log(this.e2e_requestInputs);
- console.log(this.roote2e)
}
- this.drawImage(this.roote2e,this.imgmap);
+ this.drawImage(this.roote2e, this.imgmap);
}
goback() {
@@ -112,14 +107,11 @@ export class MdonsDetailComponent implements OnInit {
.attr('fill', 'white');
var i = 0;
var nodes = cluster.nodes(data).reverse();
- console.log(nodes);
nodes.forEach(function (d) {
d.y = d.depth * 200 + 100;
-
});
var links = cluster.links(nodes);
-
var linkEnter = svg.selectAll("path.link")
.data(links);
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);
}