diff --git a/src/api/index.js b/src/api/index.js index 5937ada..45a35ef 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -170,3 +170,36 @@ export function deteleLog(data) { data }) } + +// 获取网络抓包信息 +export function getPacketCaptureInfo(data){ + return request({ + url: '/pcap/status', + method: 'get', + data + }) +} +// 开始抓包 +export function startPacketCapture(data){ + return request({ + url: '/pcap/start', + method: 'post', + data + }) +} +// 停止抓包 +export function stopPacketCapture(data){ + return request({ + url: '/pcap/stop', + method: 'post', + data + }) +} +// 删除抓包文件 +export function deletePacketCapture(data){ + return request({ + url: '/pcap/delete', + method: 'post', + data + }) +} diff --git a/src/lang/en.js b/src/lang/en.js index 5060bc2..3a22f4d 100644 --- a/src/lang/en.js +++ b/src/lang/en.js @@ -79,6 +79,13 @@ export default { toTop: 'Back to top', toBottom: 'Back to bottom', clear: 'Clear Screen', + NetworkPacketCapture: 'Network packet capture', + CapturingPacket: 'Capturing packets (Max 10 MB)......', + PacketCaptureHasBeenStopped: 'Packet capture is stopped and saved as tcpdump.pcap.', + StartPacketCapture: 'Start', + StopPacketCapture: 'Stop', + Download: 'Download', + Delete: 'Delete', refresh: 'Auto Refresh', update: 'Update', choose: 'Choice', diff --git a/src/lang/zh.js b/src/lang/zh.js index 583860c..ed6323b 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -79,6 +79,13 @@ export default { refresh: '自动刷新', choose: '选择', tips: '提示', + NetworkPacketCapture: '网络抓包', + CapturingPacket: '正在抓包(最大10兆)......', + PacketCaptureHasBeenStopped: '抓包已停止,保存为tcpdump.pcap。', + StartPacketCapture: '开始', + StopPacketCapture: '停止', + Download: '下载', + Delete: '删除', factorySettings: '恢复出厂设置', routerRestart: '重启设备', SIPserver: 'SIP服务器', diff --git a/src/views/factorySetting/index.vue b/src/views/factorySetting/index.vue index 1843939..f3f84d4 100644 --- a/src/views/factorySetting/index.vue +++ b/src/views/factorySetting/index.vue @@ -23,19 +23,53 @@ +
+
{{ $t('table.NetworkPacketCapture') }}
+ + {{ $t('table.StartPacketCapture') }} + + + {{ $t('table.StopPacketCapture') }} + + + {{ $t('table.Download') }} + + + {{ $t('table.Delete') }} + + + {{ $t('table.CapturingPacket') }} + + + {{ $t('table.PacketCaptureHasBeenStopped') }} + +
diff --git a/src/views/systemSetting/index.vue b/src/views/systemSetting/index.vue index 01c29d3..41ce54f 100644 --- a/src/views/systemSetting/index.vue +++ b/src/views/systemSetting/index.vue @@ -133,7 +133,8 @@ export default { this.formData.aoVol = parseInt(res.data.aoVol) || 0 this.formData.dns0 = res.data.dns0 || '' this.formData.dns1 = res.data.dns1 || '' - } else { + } + else { this.$message.error(res.message) } }) diff --git a/vue.config.js b/vue.config.js index 1d593c0..2e80a6d 100644 --- a/vue.config.js +++ b/vue.config.js @@ -93,7 +93,7 @@ module.exports = { pathRewrite: { '^/dev-api': '' } }, '/prod-api': { - target: 'http://192.168.1.91:8080', // http://192.168.1.91:8080 + target: 'http://127.0.0.1:8080', // http://192.168.1.91:8080 secure: false, // 如果是https接口,需要配置这个参数 changeOrigin: true, // 如果接口跨域,需要进行这个参数配置 pathRewrite: { '^/prod-api': '' }