This commit is contained in:
chengdandan 2023-03-22 14:23:49 +08:00
parent a7188adc38
commit dfda9a659d
2 changed files with 69 additions and 21 deletions

View File

@ -757,8 +757,8 @@ export default {
OnSceneload(newV) { OnSceneload(newV) {
var ip = window.location.host; var ip = window.location.host;
this.ipData = 'http://' + ip.split(':')[0] + ':5000'; this.ipData = 'http://' + ip.split(':')[0] + ':5000';
this.$refs.analysisWeb.contentWindow.getIpData('http://172.16.1.168:5000'); // this.$refs.analysisWeb.contentWindow.getIpData('http://172.16.1.168:5000');
// this.$refs.analysisWeb.contentWindow.getIpData(this.ipData); this.$refs.analysisWeb.contentWindow.getIpData(this.ipData);
this.$refs.analysisWeb.contentWindow.getDianwei(this.$route.query.id); this.$refs.analysisWeb.contentWindow.getDianwei(this.$route.query.id);
this.unityDone = true; this.unityDone = true;
window.publish('Custom',JSON.stringify({"type":'getImage',"videoid":this.$route.query.id})); window.publish('Custom',JSON.stringify({"type":'getImage',"videoid":this.$route.query.id}));

View File

@ -268,26 +268,38 @@ export default {
// value.split("/")[0] // value.split("/")[0]
let valdata = value.split('/')[0]; let valdata = value.split('/')[0];
let valdata2 = value.split('/')[1]; let valdata2 = value.split('/')[1];
// let valdata3 = value.split('/')[1+n];
console.log("valdata",valdata) console.log("valdata",valdata)
console.log("valdata2",valdata2) console.log("valdata2",valdata2)
let isCorrect = true; let isCorrect = true;
if (valdata.length) { if (valdata.length) {
for (let i = 0; i < valdata.length; i++) { for (let i = 0; i < valdata.length; i++) {
// if(i!=1&&i!=0){
// console.log("i111111")
// isCorrect = false;
// callback(new Error('IP'));
// }else{
console.log("i5555")
if (regexp.test(valdata[i]) == false) { if (regexp.test(valdata[i]) == false) {
console.log("i22222")
if (!Number(valdata2)) { if (!Number(valdata2)) {
// callback(new Error('[1,32]')); // callback(new Error('[1,32]'));
isCorrect = false; isCorrect = false;
callback(new Error('请输入正确的IP地址')); callback(new Error('请输入正确的IP地址'));
} else { } else {
if (valdata2 < 1 || valdata2 > 32) { if (valdata2 < 1 || valdata2 > 32) {
console.log("i44444")
callback(new Error('请输入整数,值为[1,32]')); callback(new Error('请输入整数,值为[1,32]'));
isCorrect = false; isCorrect = false;
} else { } else {
callback(); console.log("i3333")
callback(new Error('请输入正确的IP地址'));
} }
} }
} }
// }
} }
} }
} }
@ -362,7 +374,7 @@ export default {
} }
], ],
sizeForm: { sizeForm: {
name: 'eth0', name: '',
region: '00:11:14:1a:62:fe', region: '00:11:14:1a:62:fe',
MTU: '1500', MTU: '1500',
date2: '', date2: '',
@ -432,8 +444,8 @@ export default {
}, },
options: [ options: [
{ {
value: 'eth0', value: '',
label: 'eth0' label: ''
}, },
// { // {
// value: 'wlan0', // value: 'wlan0',
@ -443,7 +455,7 @@ export default {
// //
netWork:[ netWork:[
{ {
name: 'eth0', name: '',
region: '00:11:14:1a:62:fe', region: '00:11:14:1a:62:fe',
MTU: '1500', MTU: '1500',
date2: '', date2: '',
@ -543,13 +555,14 @@ export default {
}, },
created() { created() {
// this.publishClient()
this.createMqtt() this.createMqtt()
}, },
mounted() { mounted() {
setTimeout(() => {
// window.setInterval( () => { //30 this.getdata() this.publishClient()
// this.publishClient() }, 1000 * 5 );
// }, 1000 * 5 )
}, },
methods:{ methods:{
// //
@ -569,7 +582,7 @@ export default {
var ner = { var ner = {
type:"netplanSet", type:"netplanSet",
ethName:"eth0", ethName:sizeForm.name,
dhcp4: false, dhcp4: false,
addresses:tableDataN,// addresses:tableDataN,//
gateway4:sizeForm.gateway4, gateway4:sizeForm.gateway4,
@ -582,12 +595,49 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
// this.$message({ this.$message({
// type: 'success', type: 'success',
// message: '!' message: '设置成功!'
// }); });
console.log("JSON.stringify(ner)",JSON.stringify(ner)) console.log("JSON.stringify(ner)",JSON.stringify(ner))
// window.publish('Contorl_client',JSON.stringify(ner)); // window.publish('Contorl_client',JSON.stringify(ner));
this.sizeForm={
name: '',
region: '00:11:14:1a:62:fe',
MTU: '1500',
date2: '',
delivery: false,
type: [],
resource: '',
desc: true,
ip: '192.168.1.5/24',
ip1: '192.168.50.10/24',
ip2: 'e.g.192.168.50.10/24',
ip3: 'e.g.192.168.50.10/24',
ip4: 'e.g.192.168.50.10/24',
dns1: 'e.g.1.1.1.1',
dns2: 'e.g.1.0.0.1',
dns3: 'e.g.1.0.0.1',
status:'NO',
gateway4: '',
mtu:'',
mac:'',
moren:'',
speed:'',
tableRouter: [],
tableData: [],
tableDataDNS: [],
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
setTimeout(() => {
loading.close();
this.publishClient()
}, 5000);
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
@ -648,9 +698,7 @@ export default {
// //
var topicSends = ['Contorl_server']; var topicSends = ['Contorl_server'];
window.PubScribe(topicSends,-1,this.realInfo); window.PubScribe(topicSends,-1,this.realInfo);
setTimeout(() => {
this.publishClient()
}, 5000);
}, },
publishClient(){ publishClient(){
window.publish('Contorl_client',JSON.stringify({"type":"getNet"})); window.publish('Contorl_client',JSON.stringify({"type":"getNet"}));