逻辑不严谨bug修改
This commit is contained in:
parent
76f90e3f88
commit
23016d7da1
|
|
@ -780,6 +780,9 @@ export default {
|
|||
console.log('msg', msg);
|
||||
// var optionsDataN = this.optionsData
|
||||
console.log(' msg.netstates[this.optionsData]', this.optionsData);
|
||||
console.log(' msg.netstates[this.optionsData]', msg.netstates[this.optionsData]);
|
||||
console.log(' msg.netplan[this.optionsData]', msg.netplan[this.optionsData]);
|
||||
|
||||
if (msg.netplan[this.optionsData] != undefined) {
|
||||
this.dhcp4 = msg.netplan[this.optionsData].dhcp4 || false;
|
||||
}
|
||||
|
|
@ -804,6 +807,7 @@ export default {
|
|||
} else {
|
||||
this.sizeForm.status = 'NO';
|
||||
}
|
||||
if (data && data.length > 0) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
if (data[i].family == 17) {
|
||||
this.sizeForm.mac = data[i].address;
|
||||
|
|
@ -811,6 +815,8 @@ export default {
|
|||
this.tableDataPanduan.push(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.tableDataPanduan.length > 0 && msg.netplan[this.optionsData].addresses) {
|
||||
if (this.tableDataPanduan.length == msg.netplan[this.optionsData].addresses.length) {
|
||||
for (let i = 0; i < this.tableDataPanduan.length; i++) {
|
||||
for (let b = 0; b < msg.netplan[this.optionsData].addresses.length; b++) {
|
||||
|
|
@ -827,6 +833,8 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let addressesN = [];
|
||||
if (msg.netplan[this.optionsData].addresses && msg.netplan[this.optionsData].addresses.length > 0) {
|
||||
addressesN = msg.netplan[this.optionsData].addresses.map((value, index) => {
|
||||
|
|
@ -840,17 +848,25 @@ export default {
|
|||
//获取静态路由
|
||||
var dataJ = msg.netplan[this.optionsData].routes;
|
||||
this.sizeForm.tableRouter = [];
|
||||
if (dataJ && dataJ.length > 0) {
|
||||
for (let r = 0; r < dataJ.length; r++) {
|
||||
this.sizeForm.tableRouter.push(dataJ[r]);
|
||||
}
|
||||
}
|
||||
|
||||
this.sizeForm.gateway4 = msg.netplan[this.optionsData].gateway4;
|
||||
var legend = msg.netplan[this.optionsData].nameservers.addresses.map((value, index) => {
|
||||
let legend = [];
|
||||
if (msg.netplan[this.optionsData].nameservers && msg.netplan[this.optionsData].nameservers.addresses) {
|
||||
legend = msg.netplan[this.optionsData].nameservers.addresses.map((value, index) => {
|
||||
return {
|
||||
address: value,
|
||||
id: index
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
this.sizeForm.tableDataDNS = legend;
|
||||
console.log('从mqtt获取数据后重新整理的数据', this.sizeForm);
|
||||
} else {
|
||||
this.sizeForm = {
|
||||
name: this.optionsData,
|
||||
|
|
@ -866,14 +882,18 @@ export default {
|
|||
mtu: '',
|
||||
mac: '',
|
||||
moren: '',
|
||||
speed: ''
|
||||
speed: '',
|
||||
tableData: []
|
||||
};
|
||||
//获取静态路由
|
||||
var dataJ = msg.netplan[this.optionsData].routes;
|
||||
this.sizeForm.tableRouter = [];
|
||||
if (dataJ && dataJ.length > 0) {
|
||||
for (let r = 0; r < dataJ.length; r++) {
|
||||
this.sizeForm.tableRouter.push(dataJ[r]);
|
||||
}
|
||||
}
|
||||
|
||||
let addressesN = [];
|
||||
if (msg.netplan[this.optionsData].addresses && msg.netplan[this.optionsData].addresses.length > 0) {
|
||||
addressesN = msg.netplan[this.optionsData].addresses.map((value, index) => {
|
||||
|
|
@ -885,13 +905,17 @@ export default {
|
|||
}
|
||||
|
||||
this.sizeForm.tableData = addressesN;
|
||||
var legend = msg.netplan[this.optionsData].nameservers.addresses.map((value, index) => {
|
||||
let legend = [];
|
||||
if (msg.netplan[this.optionsData].nameservers && msg.netplan[this.optionsData].nameservers.addresses) {
|
||||
legend = msg.netplan[this.optionsData].nameservers.addresses.map((value, index) => {
|
||||
return {
|
||||
address: value,
|
||||
id: index
|
||||
};
|
||||
});
|
||||
}
|
||||
this.sizeForm.tableDataDNS = legend;
|
||||
console.log('从mqtt获取数据后重新整理的数据2', this.sizeForm);
|
||||
}
|
||||
},
|
||||
changeName(val) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue