Commit d6cca1c5 authored by wangqinghua's avatar wangqinghua

interface update

parent 535fc572
......@@ -235,6 +235,17 @@ export class BasicEditComponent implements OnInit {
groupArr.push(groupid);
}
}
this.validateForm.groups = groupArr;
this.isOkLoading = true;
if (this.modalTitle == '编辑资源') {
this.update();
} else {
this.create();
}
}
//创建
create() {
const interfaceArr = [];
this.interfaceslist.forEach(res => {
const a = {
......@@ -244,8 +255,8 @@ export class BasicEditComponent implements OnInit {
type: res.type,
port: res.port,
useip: res.useip,
bulk:''
}
bulk: ''
};
if (res.type == '2') {
if (res.bulk == true || res.bulk == '1') {
a.bulk = '1';
......@@ -258,17 +269,6 @@ export class BasicEditComponent implements OnInit {
interfaceArr.push(a);
});
this.validateForm.interfaces = interfaceArr;
this.validateForm.groups = groupArr;
this.isOkLoading = true;
if (this.modalTitle == '编辑资源') {
this.update();
} else {
this.create();
}
}
//创建
create() {
if (this.macroTYpe == 'macroExpand') {
this.validateForm.macros = this.macroList2;
}
......@@ -296,6 +296,31 @@ export class BasicEditComponent implements OnInit {
//更新
update() {
const interfaceArr = [];
this.interfaceslist.forEach(res => {
const a = {
main: res.main,
ip: res.ip,
dns: res.dns,
type: res.type,
port: res.port,
useip: res.useip,
bulk: '',
hostid: this.hostId,
interfaceid: res.interfaceid
};
if (res.type == '2') {
if (res.bulk == true || res.bulk == '1') {
a.bulk = '1';
} else {
a.bulk = '0';
}
} else {
delete a.bulk;
}
interfaceArr.push(a);
});
this.validateForm.interfaces = interfaceArr;
//比较监控模版是否发生变化
const clearArr = [];
if (!this.isInVentory) {
......@@ -311,9 +336,6 @@ export class BasicEditComponent implements OnInit {
if (this.macroTYpe == 'macroExpand') {
this.validateForm.macros = this.macroList2;
}
this.validateForm.interfaces.forEach(e=>{
e.hostid = this.hostId
});
this.validateForm.hostid = this.hostId;
this.validateForm.macros = this.macroList1;
this.overAllSer.updateHost(this.validateForm).subscribe(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment