Compare commits

...

No commits in common. "V1.0" and "master" have entirely different histories.
V1.0 ... master

12 changed files with 135 additions and 126 deletions

Binary file not shown.

View File

@ -21,7 +21,8 @@ export default {
this.$store.dispatch('user/setUrlToken', token).then(() => {
this.$router.push('/')
})
} else {
}
else {
this.$router.push('/login')
return
}

View File

@ -172,7 +172,7 @@ export function deteleLog(data) {
}
// 获取网络抓包信息
export function getPacketCaptureInfo(data) {
export function getPacketCaptureInfo(data){
return request({
url: '/pcap/status',
method: 'get',
@ -180,7 +180,7 @@ export function getPacketCaptureInfo(data) {
})
}
// 开始抓包
export function startPacketCapture(data) {
export function startPacketCapture(data){
return request({
url: '/pcap/start',
method: 'post',
@ -188,7 +188,7 @@ export function startPacketCapture(data) {
})
}
// 停止抓包
export function stopPacketCapture(data) {
export function stopPacketCapture(data){
return request({
url: '/pcap/stop',
method: 'post',
@ -196,7 +196,7 @@ export function stopPacketCapture(data) {
})
}
// 删除抓包文件
export function deletePacketCapture(data) {
export function deletePacketCapture(data){
return request({
url: '/pcap/delete',
method: 'post',

View File

@ -29,7 +29,7 @@ export default {
// message: 'Switch Language Success',
// type: 'success'
// })
window.location.reload()
window.location.reload();
}
}
}

View File

@ -43,8 +43,8 @@ export default {
upDateMsg: 'Firmware is being upgraded, please wait for a while。'
},
table: {
DNS1: 'Preferred DNS Server',
DNS2: 'Alternate DNS Server',
DNS1:"Preferred DNS Server",
DNS2:"Alternate DNS Server",
productName: 'Product Name',
productMode: 'Product Model',
serialNumber: 'Serial Number',
@ -112,7 +112,7 @@ export default {
chooseFile: 'Upgrade File',
microphoneSwitch: 'Microphone Switch',
factorySettingsTips:
'The default IP address of the device in the factory state is 192.168.1.108. After the restoration, you need to log in again.',
'The default IP address of the device in the factory state is 192.168.1.101. After the restoration, you need to log in again.',
fileUpload: 'File uploading...',
fileSave: 'Saving...',
routerRestartIng: 'Device Rebooting...',
@ -205,7 +205,7 @@ export default {
lsssCode: 'Failed to update the firmware, because the file version is too low.', // 644code
EnableCalling: 'Whether or not to enable calling',
CallButton0: 'SIP Username (Button 1)',
CallButton1: 'SIP Username (Button 2)'
CallButton1: 'SIP Username (Button 2)',
},
theme: {
change: 'Change Theme',

View File

@ -36,11 +36,11 @@ export default {
changePassword: '修改密码',
changePasswordTip: '监测到密码过弱或者密码已过期,请先修改密码后登录',
changePasswordMsg: '密码过期,请先修改密码后登录!',
upDateMsg: '固件正在升级,请稍等一段时间。'
upDateMsg: '固件正在升级,请稍等一段时间。',
},
table: {
DNS1: '首选DNS服务器',
DNS2: '备用DNS服务器',
DNS1:"首选DNS服务器",
DNS2:"备用DNS服务器",
productName: '产品名称',
productMode: '型号',
serialNumber: '序列号',
@ -104,7 +104,7 @@ export default {
chooseFile: '选择文件',
microphoneSwitch: '内置麦克风开关',
factorySettingsTips:
'出厂状态默认设备IP地址为192.168.1.108,恢复完成后需重新登录。',
'出厂状态默认设备IP地址为192.168.1.101,恢复完成后需重新登录。',
routerRestartTips: '设备即将重启,是否确认继续!',
fileUpload: '文件上传中...',
fileSave: '正在保存...',
@ -197,7 +197,7 @@ export default {
lsssCode: '固件升级失败,此固件升级文件的版本号低于当前版本。', // 644code
EnableCalling: '是否启用呼叫',
CallButton0: 'SIP用户名称 (按键1)',
CallButton1: 'SIP用户名称 (按键2)'
CallButton1: 'SIP用户名称 (按键2)',
},
theme: {
change: '换肤',

View File

@ -73,12 +73,12 @@
>
<el-form-item label=" ">
<el-radio v-model="formSIPData.sip" label="on">{{
$t("table.open")
}}
$t("table.open")
}}
</el-radio>
<el-radio v-model="formSIPData.sip" label="off">{{
$t("table.close")
}}
$t("table.close")
}}
</el-radio>
</el-form-item>
<el-form-item :label="$t('table.deviceID')">
@ -105,10 +105,10 @@
<svg-icon :icon-class="sip2PasswordType === 'password' ? 'eye' : 'eye-open'" />
</span>
</el-form-item>
<el-form-item v-if="formSIPData.sipCallFunc === 'on'" :label="$t('table.CallButton0')">
<el-form-item :label="$t('table.CallButton0')" v-if="formSIPData.sipCallFunc === 'on'">
<el-input v-model="formSIPData.sipCallUsername0" />
</el-form-item>
<el-form-item v-if="formSIPData.sipCallFunc === 'on'" :label="$t('table.CallButton1')">
<el-form-item :label="$t('table.CallButton1')" v-if="formSIPData.sipCallFunc === 'on'">
<el-input v-model="formSIPData.sipCallUsername1" />
</el-form-item>
</el-form>
@ -176,29 +176,29 @@
</el-form-item>
<el-form-item :label="$t('table.WAN_IP_Type')">
<el-select
v-model="formONVIFData.wanType"
style="width:350px;"
@change="selectChangeNet"
v-model="formONVIFData.wanType"
style="width:350px;"
@change="selectChangeNet"
>
<el-option
v-for="item in NetType"
:key="item.key"
:label="item.label"
:value="item.key"
v-for="item in NetType"
:key="item.key"
:label="item.label"
:value="item.key"
/>
</el-select>
</el-form-item>
<el-form-item v-if="formONVIFData.wanType === '1'" :label="$t('table.WAN_IP_DomainName')">
<el-form-item :label="$t('table.WAN_IP_DomainName')" v-if="formONVIFData.wanType === '1'">
<el-input v-model="formONVIFData.wanDomainName" />
</el-form-item>
<el-form-item v-if="formONVIFData.wanType === '0'" :label="$t('table.WAN_IP_Address')">
<el-form-item :label="$t('table.WAN_IP_Address')" v-if="formONVIFData.wanType === '0'">
<el-input v-model="formONVIFData.wanIP" />
</el-form-item>
<el-form-item :label="$t('table.WAN_Port')">
<el-input v-model="formONVIFData.wanOnvifPort" type="number" :min="0" :max="65535" />
<el-input v-model="formONVIFData.wanOnvifPort" type="number" :min="0" :max="65535"/>
</el-form-item>
<el-form-item :label="$t('table.WAN_RTSP_Port')">
<el-input v-model="formONVIFData.wanRTSPPort" type="number" :min="0" :max="65535" />
<el-input v-model="formONVIFData.wanRTSPPort" type="number" :min="0" :max="65535"/>
</el-form-item>
</el-form>
<el-button
@ -216,6 +216,7 @@
import { deviceInfo, deviceEdit } from '@/api/index.js'
import { encryptData, decryptData } from '@/utils/encryption/entrypt'
export default {
name: 'Agreement',
data() {
@ -238,11 +239,11 @@ export default {
NetType: [
{
label: this.$t('table.WAN_IP_Address'),
key: '0'
key:"0",
},
{
label: this.$t('table.WAN_IP_DomainName'),
key: '1'
key:"1",
}
],
selectIndex: '0',
@ -265,9 +266,9 @@ export default {
sipUsername: '',
sipPassword: '',
sipPassword2: '',
sipCallFunc: 'off',
sipCallUsername0: '',
sipCallUsername1: ''
sipCallFunc:'off',
sipCallUsername0:'',
sipCallUsername1:'',
},
formONVIFData: {
onvif: '',
@ -284,7 +285,7 @@ export default {
wanOnvifPort: '',
wanRTSPPort: '',
wanDomainName: '',
wanType: '0'
wanType:"0",
},
sipPasswordType: 'password',
@ -456,7 +457,8 @@ export default {
})
return
}
} else if (this.selectIndex === '1') {
}
else if (this.selectIndex === '1') {
param = {
...this.formSIPData
}
@ -485,12 +487,13 @@ export default {
}
param.sipPassword = encryptData(param.sipPassword)
param.sipPassword2 = encryptData(param.sipPassword2)
} else if (this.selectIndex === '0') {
}
else if (this.selectIndex === '0') {
param = {
...this.formONVIFData
}
if (this.formONVIFData.wanDomainName !== '') {
if (!wanDName.test(param.wanDomainName)) {
if(this.formONVIFData.wanDomainName !== ''){
if(!wanDName.test(param.wanDomainName)){
this.$message({
type: 'warning',
message: this.$i18n.t('table.isRight7')
@ -498,8 +501,8 @@ export default {
return
}
}
if (this.formONVIFData.wanIP !== '') {
if (!ipv4Regex.test(param.wanIP)) {
if(this.formONVIFData.wanIP !== ''){
if(!ipv4Regex.test(param.wanIP)){
this.$message({
type: 'warning',
message: this.$i18n.t('table.isRight4')
@ -507,28 +510,30 @@ export default {
return
}
}
if (this.formONVIFData.wanOnvifPort !== '') {
const l = Number(this.formONVIFData.wanOnvifPort)
if (l > 0 && l < 65536) {
if(this.formONVIFData.wanOnvifPort !== ''){
const l = Number(this.formONVIFData.wanOnvifPort);
if(l > 0 && l < 65536){
} else {
}
else {
this.$message({
type: 'warning',
message: this.$i18n.t('table.isRight5')
})
return
return;
}
}
if (this.formONVIFData.wanRTSPPort !== '') {
const l = Number(this.formONVIFData.wanRTSPPort)
if (l > 0 && l < 65536) {
if(this.formONVIFData.wanRTSPPort !== ''){
const l = Number(this.formONVIFData.wanRTSPPort);
if(l > 0 && l < 65536){
} else {
}
else {
this.$message({
type: 'warning',
message: this.$i18n.t('table.isRight6')
})
return
return;
}
}
if (!param.onvifUsername) {
@ -598,12 +603,12 @@ export default {
}
})
},
IPV4Single(ip) {
IPV4Single(ip){
//
const IPV4 = /^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/
const IPV4 = /^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
// true false
return IPV4.test(ip)
}
},
}
}
</script>

View File

@ -109,12 +109,12 @@ export default {
aoVol: 0, //
dhcp: 'on',
playStatus: '', //
dns0: '', // dns1
dns1: '', // dns2
wanDomainName: '', // Wan
wanIP: '', // wan IP
wanInfo: ''// wan
playStatus: '',//
dns0: '',// dns1
dns1: '',// dns2
wanDomainName: '',// Wan
wanIP: '',// wan IP
wanInfo: '',// wan
}
}
},
@ -131,11 +131,12 @@ export default {
this.formData.dns0 = res.data.dns0 || ''
this.formData.dns1 = res.data.dns1 || ''
this.formData.wanIP = res.data.wanIP || ''
if (res.data.wanDomainName !== undefined) {
if(res.data.wanDomainName !== undefined){
this.formData.wanDomainName = res.data.wanDomainName || ''
console.log('AAA', res)
}
this.formData.wanInfo = `${this.formData.wanDomainName} (${this.formData.wanIP})`
} else {
this.$message.error(res.message)
}

View File

@ -23,27 +23,27 @@
<!-- <el-button type="primary" style="margin-top: 48px;" @click="factorySetting">
{{ $t('table.factorySettings') }}
</el-button> -->
<!-- <div class="formbox">-->
<!-- <div class="formbox-l">{{ $t('table.NetworkPacketCapture') }}</div>-->
<!-- <el-button type="primary" v-if="DataDB.status === 0 || DataDB.status === 2" @click.stop="StartPacketCapture(1)">-->
<!-- {{ $t('table.StartPacketCapture') }}-->
<!-- </el-button>-->
<!-- <el-button type="danger" v-else @click.stop="StartPacketCapture(0)">-->
<!-- {{ $t('table.StopPacketCapture') }}-->
<!-- </el-button>-->
<!-- <el-button type="primary" @click.stop="DownloadFile" :disabled="DataDB.status !== 2">-->
<!-- {{ $t('table.Download') }}-->
<!-- </el-button>-->
<!-- <el-button type="primary" @click.stop="DeletePacketCaptureRecords" :disabled="DataDB.status !== 2">-->
<!-- {{ $t('table.Delete') }}-->
<!-- </el-button>-->
<!-- <span v-if="DataDB.status === 1" class="SpanBox1">-->
<!-- {{ $t('table.CapturingPacket') }}-->
<!-- </span>-->
<!-- <span v-else-if="DataDB.status === 2" class="SpanBox1">-->
<!-- {{ $t('table.PacketCaptureHasBeenStopped') }}-->
<!-- </span>-->
<!-- </div>-->
<div class="formbox">
<div class="formbox-l">{{ $t('table.NetworkPacketCapture') }}</div>
<el-button type="primary" v-if="DataDB.status === 0 || DataDB.status === 2" @click.stop="StartPacketCapture(1)">
{{ $t('table.StartPacketCapture') }}
</el-button>
<el-button type="danger" v-else @click.stop="StartPacketCapture(0)">
{{ $t('table.StopPacketCapture') }}
</el-button>
<el-button type="primary" @click.stop="DownloadFile" :disabled="DataDB.status !== 2">
{{ $t('table.Download') }}
</el-button>
<el-button type="primary" @click.stop="DeletePacketCaptureRecords" :disabled="DataDB.status !== 2">
{{ $t('table.Delete') }}
</el-button>
<span v-if="DataDB.status === 1" class="SpanBox1">
{{ $t('table.CapturingPacket') }}
</span>
<span v-else-if="DataDB.status === 2" class="SpanBox1">
{{ $t('table.PacketCaptureHasBeenStopped') }}
</span>
</div>
</div>
</div>
</template>
@ -61,14 +61,14 @@ export default {
name: 'FactorySetting',
data() {
return {
DataDB: {
status: 0,
file: ''
DataDB:{
status:0,
file:'',
}
}
},
mounted() {
this.getPacketInfo()
this.getPacketInfo();
},
methods: {
factorySetting() {
@ -138,48 +138,49 @@ export default {
})
},
StartPacketCapture(Flag) {
if (Flag === 1) {
StartPacketCapture(Flag){
if(Flag === 1){
startPacketCapture({}).then(res => {
setTimeout(() => {
this.getPacketInfo()
}, 300)
})
} else if (Flag === 0) {
setTimeout(()=>{
this.getPacketInfo();
}, 300);
});
}
else if(Flag === 0){
stopPacketCapture({}).then(res => {
setTimeout(() => {
this.getPacketInfo()
}, 300)
setTimeout(()=>{
this.getPacketInfo();
}, 300);
})
}
},
getPacketInfo() {
getPacketInfo(){
getPacketCaptureInfo({}).then(res => {
const data = res.data
this.DataDB.status = data.status
this.DataDB.file = data.file
const data = res.data;
this.DataDB.status = data.status;
this.DataDB.file = data.file;
}).catch(() => {
})
});
},
DeletePacketCaptureRecords() {
DeletePacketCaptureRecords(){
const data = {
name: this.DataDB.file
}
name: this.DataDB.file,
};
// console.log(data);
deletePacketCapture(data).then(res => {
this.DataDB.status = 0
this.DataDB.status = 0;
this.$message.success(this.$i18n.t('table.Delete') + this.$i18n.t('table.success'))
}).catch(() => {
})
});
},
DownloadFile() {
if (this.DataDB.file === '') {
return
DownloadFile(){
if(this.DataDB.file === ''){
return;
}
const URL = '/prod-api/pcap/' + this.DataDB.file
window.open(URL)
const URL = '/prod-api/pcap/' + this.DataDB.file;
window.open(URL);
}
}
}

View File

@ -15,7 +15,7 @@
<h3 class="title">
IP Speaker
</h3>
<!-- <img src="@/assets/login/logo_white.svg" alt="">-->
<!-- <img src="@/assets/login/logo_white.svg" alt="">-->
<h3 class="title">
{{ $t('login.title') }}
</h3>

View File

@ -33,9 +33,9 @@
{{ $t("table.check") }}
</el-button>
<el-button
type="text"
size="mini"
@click="download(scope.row.name)"
type="text"
size="mini"
@click="download(scope.row.name)"
>
{{ $t("table.Download") }}
</el-button>
@ -196,10 +196,10 @@ export default {
clearInterval(this.timer)
this.timer = null
},
download(name) {
const URL = '/prod-api/log/download/' + name
window.open(URL)
}
download(name){
const URL = '/prod-api/log/download/' + name;
window.open(URL);
},
}
}
</script>

View File

@ -92,8 +92,8 @@ export default {
data() {
return {
formData: {
dns0: '',
dns1: '',
dns0:'',
dns1:'',
name: '',
model: '',
mac: '',
@ -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)
}
})
@ -145,7 +146,7 @@ export default {
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
const idRegex = /^(?:[2-9]\d{0,3}|1\d{0,3}|9999)$/
const subnetRegex = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){3}$/
// const dnsRegex = /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*$/
const dnsRegex = /^(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*$/;
// Id
if (!param.id) {
this.$message({