From dfda9a659d828d836996daea9a57e2679c3d9a6e Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Wed, 22 Mar 2023 14:23:49 +0800 Subject: [PATCH 1/2] 20230322 --- src/views/bounced/analysisConfiguration.vue | 4 +- src/views/general/network.vue | 86 ++++++++++++++++----- 2 files changed, 69 insertions(+), 21 deletions(-) diff --git a/src/views/bounced/analysisConfiguration.vue b/src/views/bounced/analysisConfiguration.vue index bf9a790d..5721e50d 100644 --- a/src/views/bounced/analysisConfiguration.vue +++ b/src/views/bounced/analysisConfiguration.vue @@ -757,8 +757,8 @@ export default { OnSceneload(newV) { var ip = window.location.host; this.ipData = 'http://' + ip.split(':')[0] + ':5000'; - this.$refs.analysisWeb.contentWindow.getIpData('http://172.16.1.168:5000'); - // this.$refs.analysisWeb.contentWindow.getIpData(this.ipData); + // this.$refs.analysisWeb.contentWindow.getIpData('http://172.16.1.168:5000'); + this.$refs.analysisWeb.contentWindow.getIpData(this.ipData); this.$refs.analysisWeb.contentWindow.getDianwei(this.$route.query.id); this.unityDone = true; window.publish('Custom',JSON.stringify({"type":'getImage',"videoid":this.$route.query.id})); diff --git a/src/views/general/network.vue b/src/views/general/network.vue index eedba942..78e95a14 100644 --- a/src/views/general/network.vue +++ b/src/views/general/network.vue @@ -268,26 +268,38 @@ export default { // value.split("/")[0] let valdata = value.split('/')[0]; let valdata2 = value.split('/')[1]; + // let valdata3 = value.split('/')[1+n]; console.log("valdata",valdata) console.log("valdata2",valdata2) let isCorrect = true; if (valdata.length) { for (let i = 0; i < valdata.length; i++) { - if (regexp.test(valdata[i]) == false) { + // if(i!=1&&i!=0){ + // console.log("i111111") + // isCorrect = false; + // callback(new Error('请输入正确的IP地址')); + // }else{ + console.log("i5555") + if (regexp.test(valdata[i]) == false) { + console.log("i22222") if (!Number(valdata2)) { // callback(new Error('请输入整数,值为[1,32]')); isCorrect = false; callback(new Error('请输入正确的IP地址')); } else { if (valdata2 < 1 || valdata2 > 32) { + console.log("i44444") callback(new Error('请输入整数,值为[1,32]')); isCorrect = false; } else { - callback(); + console.log("i3333") + callback(new Error('请输入正确的IP地址')); } } } + // } + } } } @@ -362,7 +374,7 @@ export default { } ], sizeForm: { - name: 'eth0', + name: '', region: '00:11:14:1a:62:fe', MTU: '1500', date2: '', @@ -432,8 +444,8 @@ export default { }, options: [ { - value: 'eth0', - label: 'eth0' + value: '', + label: '' }, // { // value: 'wlan0', @@ -443,7 +455,7 @@ export default { //数据获取 netWork:[ { - name: 'eth0', + name: '', region: '00:11:14:1a:62:fe', MTU: '1500', date2: '', @@ -543,13 +555,14 @@ export default { }, created() { + // this.publishClient() this.createMqtt() + }, mounted() { - -// window.setInterval( () => { //每隔30秒自动请求一次方法 this.getdata() ,保证数据实时的更新 -// this.publishClient() -// }, 1000 * 5 ) + setTimeout(() => { + this.publishClient() + }, 1000 * 5 ); }, methods:{ //点击保存 @@ -569,7 +582,7 @@ export default { var ner = { type:"netplanSet", - ethName:"eth0", + ethName:sizeForm.name, dhcp4: false, addresses:tableDataN,//静态地址 gateway4:sizeForm.gateway4, @@ -582,12 +595,49 @@ export default { type: 'warning' }) .then(() => { - // this.$message({ - // type: 'success', - // message: '删除成功!' - // }); + this.$message({ + type: 'success', + message: '设置成功!' + }); 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(() => { this.$message({ @@ -648,9 +698,7 @@ export default { //创建链接,接收数据 var topicSends = ['Contorl_server']; window.PubScribe(topicSends,-1,this.realInfo); - setTimeout(() => { - this.publishClient() - }, 5000); + }, publishClient(){ window.publish('Contorl_client',JSON.stringify({"type":"getNet"})); From e98c8b7e82e4a4ffb1996788c3fa55e8f7213ee0 Mon Sep 17 00:00:00 2001 From: chengdandan <2549057906@qq.com> Date: Wed, 22 Mar 2023 16:45:38 +0800 Subject: [PATCH 2/2] 20230322 --- src/components/target/typeChart.vue | 30 +++++++++------- src/config/apiurl.js | 2 +- src/views/general/network.vue | 54 ++++++++++++++--------------- 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/src/components/target/typeChart.vue b/src/components/target/typeChart.vue index 96836494..3f1e508d 100644 --- a/src/components/target/typeChart.vue +++ b/src/components/target/typeChart.vue @@ -45,7 +45,7 @@