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