Merge remote-tracking branch 'origin/lichang' into lichang
This commit is contained in:
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@@ -2112,7 +2112,7 @@ export default {
|
|||||||
realTimeStop:"Stop",
|
realTimeStop:"Stop",
|
||||||
realTime:"Real Time Speed",
|
realTime:"Real Time Speed",
|
||||||
pid:"PID",
|
pid:"PID",
|
||||||
name:"APP Name",
|
name:"Program name",
|
||||||
username:"User Name",
|
username:"User Name",
|
||||||
runTime:"Run Time",
|
runTime:"Run Time",
|
||||||
numThreads:"Thread",
|
numThreads:"Thread",
|
||||||
@@ -2121,13 +2121,11 @@ export default {
|
|||||||
diskWrite:"Disk Write",
|
diskWrite:"Disk Write",
|
||||||
},
|
},
|
||||||
net:{
|
net:{
|
||||||
PID:"PID",
|
localAddr:"Local Address",
|
||||||
name:"name",
|
remoteAddr:"Foreign Address",
|
||||||
localAddr:"localAddr",
|
status:"State",
|
||||||
remoteAddr:"remoteAddr",
|
proto:"Proto",
|
||||||
status:"status",
|
port:"Port",
|
||||||
type:"type",
|
|
||||||
port:"port",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2121,13 +2121,11 @@ export default {
|
|||||||
diskWrite:"磁盘写入",
|
diskWrite:"磁盘写入",
|
||||||
},
|
},
|
||||||
net:{
|
net:{
|
||||||
PID:"PID",
|
localAddr:"本地地址",
|
||||||
name:"名称",
|
remoteAddr:"远程地址",
|
||||||
localAddr:"localAddr",
|
|
||||||
remoteAddr:"remoteAddr",
|
|
||||||
status:"状态",
|
status:"状态",
|
||||||
type:"类型",
|
proto:"协议",
|
||||||
port:"接口",
|
port:"端口",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ let fromState = ref({
|
|||||||
nef_ip: '172.16.5.210',
|
nef_ip: '172.16.5.210',
|
||||||
mme_ip: '172.16.5.220',
|
mme_ip: '172.16.5.220',
|
||||||
n3iwf_ip: '172.16.5.230',
|
n3iwf_ip: '172.16.5.230',
|
||||||
|
smsc_ip: '172.16.5.240',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ export function usePara5G() {
|
|||||||
case 'N3IWF':
|
case 'N3IWF':
|
||||||
state.from.sbi.n3iwf_ip = item.ip;
|
state.from.sbi.n3iwf_ip = item.ip;
|
||||||
break;
|
break;
|
||||||
|
case 'SMSC':
|
||||||
|
state.from.sbi.smsc_ip = item.ip;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,155 +1,205 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive ,toRaw, onMounted } from 'vue';
|
import { reactive, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
||||||
import { PageContainer } from 'antdv-pro-layout';
|
import { PageContainer } from 'antdv-pro-layout';
|
||||||
import { SizeType } from 'ant-design-vue/lib/config-provider';
|
|
||||||
import { ColumnsType } from 'ant-design-vue/lib/table';
|
import { ColumnsType } from 'ant-design-vue/lib/table';
|
||||||
import useI18n from '@/hooks/useI18n';
|
import useI18n from '@/hooks/useI18n';
|
||||||
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
||||||
import {
|
import { RESULT_CODE_ERROR } from '@/constants/result-constants';
|
||||||
RESULT_CODE_ERROR
|
|
||||||
} from '@/constants/result-constants';
|
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const ws = new WS();
|
const ws = new WS();
|
||||||
|
|
||||||
//查询数据
|
/**表单查询参数 */
|
||||||
let queryParams = reactive({
|
let queryParams = reactive({
|
||||||
pid: undefined,
|
pid: undefined,
|
||||||
name:"",
|
name: '',
|
||||||
port: undefined,
|
port: undefined,
|
||||||
flag: false,
|
|
||||||
changeTime:5000,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//临时缓存:用于搜索后清除筛选条件
|
/**状态对象 */
|
||||||
let bufferParams = reactive({
|
let state = reactive({
|
||||||
|
/**调度器 */
|
||||||
|
interval: null as any,
|
||||||
|
/**刷新周期 */
|
||||||
|
intervalTime: 5_000,
|
||||||
|
/**查询参数 */
|
||||||
|
query: {
|
||||||
pid: undefined,
|
pid: undefined,
|
||||||
name:"",
|
name: '',
|
||||||
port: undefined,
|
port: undefined,
|
||||||
flag: false,
|
},
|
||||||
changeTime:5000,
|
|
||||||
})
|
|
||||||
|
|
||||||
//时间粒度
|
|
||||||
let timeOptions =[
|
|
||||||
{label:t('views.tool.ps.realTimeHigh'),value:3000},
|
|
||||||
{label:t('views.tool.ps.realTimeRegular'),value:5000},
|
|
||||||
{label:t('views.tool.ps.realTimeLow'),value:10000},
|
|
||||||
];
|
|
||||||
|
|
||||||
/**钩子函数,界面打开初始化*/
|
|
||||||
onMounted(() =>{
|
|
||||||
fnRealTime()//建立连接
|
|
||||||
extracted()//先立刻发送请求获取第一次的数据
|
|
||||||
queryReset2(false)//设置定时器
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**查询按钮**/
|
/**接收数据后回调(成功) */
|
||||||
function queryTime(){//将表单中的数据传递给缓存数据(缓存数据自动同步请求信息中)
|
function wsMessage(res: Record<string, any>) {
|
||||||
bufferParams.pid=queryParams.pid;
|
const { code, requestId, data } = res;
|
||||||
bufferParams.port=queryParams.port;
|
if (code === RESULT_CODE_ERROR) {
|
||||||
bufferParams.name=queryParams.name;
|
console.warn(res.msg);
|
||||||
bufferParams.flag=true
|
return;
|
||||||
queryParams.pid=undefined;
|
|
||||||
queryParams.name="";
|
|
||||||
queryParams.port=undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**重置按钮**/
|
// 建联时发送请求
|
||||||
function queryReset(){
|
if (!requestId && data.clientId) {
|
||||||
queryParams.flag = false
|
fnGetList();
|
||||||
bufferParams.flag = false
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let s:any = null
|
// 收到消息数据
|
||||||
/**定时器**/
|
if (requestId.startsWith('net_')) {
|
||||||
function queryReset2(c:boolean){
|
// 将数据填入表格
|
||||||
if(c){
|
if (Array.isArray(data)) {
|
||||||
clearInterval(s)//清理旧定时器
|
if (tableState.loading) {
|
||||||
ws.close();//断开原来的wb连接
|
tableState.loading = false;
|
||||||
fnRealTime();//建立新的实时数据连接
|
}
|
||||||
|
tableState.data = data;
|
||||||
|
} else {
|
||||||
|
tableState.data = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s = setInterval(()=>{//设置新的定时器s
|
|
||||||
extracted();
|
|
||||||
},queryParams.changeTime)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**刷新频率改变**/
|
/**实时数据*/
|
||||||
function fnRealTime2() {//时间粒度改变时触发
|
function fnRealTime(reLink: boolean) {
|
||||||
queryReset2(true)//改变定时器
|
if (reLink) {
|
||||||
|
ws.close();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 实时数据
|
|
||||||
*/
|
|
||||||
function fnRealTime() {
|
|
||||||
const options: OptionsType = {
|
const options: OptionsType = {
|
||||||
url: '/ws',
|
url: '/ws',
|
||||||
onmessage: wsMessage,
|
onmessage: wsMessage,
|
||||||
onerror: wsError,
|
onerror: (ev: any) => {
|
||||||
|
// 接收数据后回调
|
||||||
|
console.error(ev);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
//建立连接
|
//建立连接
|
||||||
ws.connect(options);
|
ws.connect(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**接收数据后回调(失败) */
|
/**调度器周期变更*/
|
||||||
function wsError(ev: any) {
|
function fnIntervalChange(v: any) {
|
||||||
// 接收数据后回调
|
clearInterval(state.interval);
|
||||||
console.error(ev);
|
const timer = parseInt(v);
|
||||||
}
|
if (timer > 1_000) {
|
||||||
|
state.intervalTime = v;
|
||||||
/**接收数据后回调(成功) */
|
fnGetList();
|
||||||
function wsMessage(res: Record<string, any>) {
|
|
||||||
const { code, requestId, data } = res;//获取数据
|
|
||||||
if (code === RESULT_CODE_ERROR) {
|
|
||||||
console.warn(res.msg);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 处理数据,组成ip : port
|
|
||||||
let processedData:any[]=[];
|
|
||||||
|
|
||||||
|
|
||||||
if (Array.isArray(data)) {
|
|
||||||
processedData = data.map((item:any) => {
|
|
||||||
const localAddr = `${item.localaddr?.ip || ''} : ${item.localaddr?.port || ''}`;
|
|
||||||
const remoteAddr = `${item.remoteaddr?.ip || ''} : ${item.remoteaddr?.port || ''}`;
|
|
||||||
return { ...item, localAddr, remoteAddr };
|
|
||||||
});
|
|
||||||
} else if (typeof data === 'object' && data !== null) {
|
|
||||||
// 如果data是单个对象,将其包装在数组中
|
|
||||||
const localAddr = `${data.localaddr?.ip || ''} : ${data.localaddr?.port || ''}`;
|
|
||||||
const remoteAddr = `${data.remoteaddr?.ip || ''} : ${data.remoteaddr?.port || ''}`;
|
|
||||||
processedData = [{ ...data, localAddr, remoteAddr }];
|
|
||||||
} else {
|
|
||||||
console.warn('收到意外的数据格式:', data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (requestId) {
|
|
||||||
tableState.data = processedData; // 将数据填入表格
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function extracted() {//将表单各条件值取出,并打包在data中发送请求
|
/**查询列表 */
|
||||||
const {pid,name, port, flag} = toRaw(bufferParams)//从queryParams中取出各属性值
|
function fnGetList() {
|
||||||
let data = {} // { 'PID': PID, 'name': name, 'port': port }
|
if (tableState.loading || ws.state() === -1) return;
|
||||||
if (flag){//若flag为真则把值封装进data
|
tableState.loading = true;
|
||||||
data = { 'pid': pid, 'name': name, 'port': port }
|
const msg = {
|
||||||
|
requestId: `net_${state.interval}`,
|
||||||
|
type: 'net',
|
||||||
|
data: state.query,
|
||||||
|
};
|
||||||
|
// 首发
|
||||||
|
ws.send(msg);
|
||||||
|
// 定时刷新数据
|
||||||
|
state.interval = setInterval(() => {
|
||||||
|
msg.data = JSON.parse(JSON.stringify(state.query));
|
||||||
|
ws.send(msg);
|
||||||
|
}, state.intervalTime);
|
||||||
}
|
}
|
||||||
//发送请求
|
|
||||||
|
/**查询参数传入 */
|
||||||
|
function fnQuery() {
|
||||||
|
state.query = JSON.parse(JSON.stringify(queryParams));
|
||||||
|
nextTick(() => {
|
||||||
ws.send({
|
ws.send({
|
||||||
'requestId': 'dxxx',
|
requestId: `net_${state.interval}`,
|
||||||
'type': 'net',
|
type: 'net',
|
||||||
'data': data,
|
data: state.query,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**查询参数重置 */
|
||||||
|
function fnQueryReset() {
|
||||||
|
Object.assign(queryParams, {
|
||||||
|
pid: undefined,
|
||||||
|
name: '',
|
||||||
|
port: undefined,
|
||||||
|
});
|
||||||
|
tablePagination.current = 1;
|
||||||
|
tablePagination.pageSize = 20;
|
||||||
|
// 重置查询条件
|
||||||
|
Object.assign(state.query, {
|
||||||
|
pid: undefined,
|
||||||
|
name: '',
|
||||||
|
port: undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**表格状态类型 */
|
||||||
|
type TableStateType = {
|
||||||
|
/**加载等待 */
|
||||||
|
loading: boolean;
|
||||||
|
/**记录数据 */
|
||||||
|
data: object[];
|
||||||
|
};
|
||||||
|
|
||||||
/**表格状态 */
|
/**表格状态 */
|
||||||
let tableState: TableStateType = reactive({
|
let tableState: TableStateType = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
size: 'large',
|
|
||||||
data: [],
|
data: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**表格字段列 */
|
||||||
|
const tableColumns: ColumnsType<any> = [
|
||||||
|
{
|
||||||
|
title: t('views.tool.ps.pid'),
|
||||||
|
dataIndex: 'pid',
|
||||||
|
align: 'right',
|
||||||
|
width: 100,
|
||||||
|
sorter: {
|
||||||
|
compare: (a: any, b: any) => a.pid - b.pid,
|
||||||
|
multiple: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.tool.net.proto'),
|
||||||
|
dataIndex: 'type',
|
||||||
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
|
customRender(opt) {
|
||||||
|
return `${opt.value}`.toUpperCase();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.tool.net.localAddr'),
|
||||||
|
dataIndex: 'localAddr',
|
||||||
|
align: 'left',
|
||||||
|
width: 150,
|
||||||
|
customRender(opt) {
|
||||||
|
const { ip, port } = opt.value;
|
||||||
|
return port !== 0 ? `${ip}:${port}` : `${ip}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.tool.net.remoteAddr'),
|
||||||
|
dataIndex: 'remoteAddr',
|
||||||
|
align: 'left',
|
||||||
|
width: 150,
|
||||||
|
customRender(opt) {
|
||||||
|
const { ip, port } = opt.value;
|
||||||
|
return port !== 0 ? `${ip}:${port}` : `${ip}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.tool.net.status'),
|
||||||
|
dataIndex: 'status',
|
||||||
|
align: 'left',
|
||||||
|
width: 120,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('views.tool.ps.name'),
|
||||||
|
dataIndex: 'name',
|
||||||
|
align: 'left',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
/**表格分页器参数 */
|
/**表格分页器参数 */
|
||||||
let tablePagination = reactive({
|
let tablePagination = reactive({
|
||||||
/**当前页数 */
|
/**当前页数 */
|
||||||
@@ -175,122 +225,95 @@ let tablePagination = reactive({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表格状态类型 */
|
/**钩子函数,界面打开初始化*/
|
||||||
type TableStateType = {
|
onMounted(() => {
|
||||||
/**加载等待 */
|
fnRealTime(false);
|
||||||
loading: boolean;
|
});
|
||||||
/**紧凑型 */
|
|
||||||
size: SizeType;
|
|
||||||
/**记录数据 */
|
|
||||||
data: object[];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**表格字段列 */
|
|
||||||
const tableColumns: ColumnsType<any> = [
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.PID'),
|
|
||||||
dataIndex: 'pid',
|
|
||||||
align: 'center',
|
|
||||||
width: 50,
|
|
||||||
sorter:{//PID排序
|
|
||||||
compare:(a:any, b:any)=>a.pid-b.pid,
|
|
||||||
multiple:1,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.name'),
|
|
||||||
dataIndex: 'name',
|
|
||||||
align: 'center',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.localAddr'),
|
|
||||||
dataIndex: 'localAddr',
|
|
||||||
align: 'center',
|
|
||||||
width: 70,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.remoteAddr'),
|
|
||||||
dataIndex:'remoteAddr',
|
|
||||||
align: 'center',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.status'),
|
|
||||||
dataIndex: 'status',
|
|
||||||
align: 'center',
|
|
||||||
width: 70,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t('views.tool.net.type'),
|
|
||||||
dataIndex: 'type',
|
|
||||||
align: 'center',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
/**钩子函数,界面关闭*/
|
||||||
|
onBeforeUnmount(() => {
|
||||||
|
ws.close();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<PageContainer>
|
<PageContainer>
|
||||||
<a-card
|
<a-card
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
:body-style="{ marginBottom: '24px', paddingBottom: 0 }"
|
||||||
>
|
>
|
||||||
<a-form :model="queryParams" name="formParams" layout="horizontal">
|
<!-- 表格搜索栏 -->
|
||||||
|
<a-form :model="queryParams" name="queryParams" layout="horizontal">
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="4" :md="6" :xs="12">
|
<a-col :lg="4" :md="6" :xs="12">
|
||||||
<a-form-item :label="t('views.tool.ps.realTime')" name="changeTime">
|
|
||||||
<a-select
|
|
||||||
v-model:value="queryParams.changeTime"
|
|
||||||
:options="timeOptions"
|
|
||||||
:placeholder="t('common.selectPlease')"
|
|
||||||
@change='fnRealTime2'
|
|
||||||
style='width: 100%'
|
|
||||||
/>
|
|
||||||
</a-form-item></a-col>
|
|
||||||
<a-col :lg="3" :md="6" :xs="12">
|
|
||||||
<a-form-item :label="t('views.tool.ps.pid')" name="pid">
|
<a-form-item :label="t('views.tool.ps.pid')" name="pid">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="queryParams.pid"
|
v-model:value="queryParams.pid"
|
||||||
allow-clear
|
allow-clear
|
||||||
:placeholder="t('common.inputPlease')"
|
:placeholder="t('common.inputPlease')"
|
||||||
style='width: 100%'
|
style="width: 100%"
|
||||||
></a-input-number>
|
></a-input-number>
|
||||||
</a-form-item></a-col>
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item :label="t('views.tool.net.name')" name="name">
|
<a-form-item :label="t('views.tool.ps.name')" name="name">
|
||||||
<a-input
|
<a-input
|
||||||
v-model:value="queryParams.name"
|
v-model:value="queryParams.name"
|
||||||
allow-clear
|
allow-clear
|
||||||
:placeholder="t('common.inputPlease')"
|
:placeholder="t('common.inputPlease')"
|
||||||
></a-input>
|
></a-input>
|
||||||
</a-form-item></a-col>
|
</a-form-item>
|
||||||
<a-col :lg="5" :md="10" :xs="20">
|
</a-col>
|
||||||
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item :label="t('views.tool.net.port')" name="port">
|
<a-form-item :label="t('views.tool.net.port')" name="port">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model:value="queryParams.port"
|
v-model:value="queryParams.port"
|
||||||
allow-clear
|
allow-clear
|
||||||
:placeholder="t('common.inputPlease')"
|
:placeholder="t('common.inputPlease')"
|
||||||
style='width: 100%'
|
style="width: 100%"
|
||||||
></a-input-number>
|
></a-input-number>
|
||||||
</a-form-item></a-col>
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
<a-col :lg="4" :md="12" :xs="24">
|
<a-col :lg="4" :md="12" :xs="24">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-button type="primary" @click='queryTime()'>
|
<a-space :size="8">
|
||||||
|
<a-button type="primary" @click.prevent="fnQuery()">
|
||||||
<template #icon><SearchOutlined /></template>
|
<template #icon><SearchOutlined /></template>
|
||||||
{{ t('common.search') }}
|
{{ t('common.search') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="default" @click.prevent="queryReset()" style='left: 20px;'>
|
<a-button type="default" @click.prevent="fnQueryReset">
|
||||||
<template #icon><ClearOutlined /></template>
|
<template #icon><ClearOutlined /></template>
|
||||||
{{ t('common.reset') }}
|
{{ t('common.reset') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
||||||
|
<!-- 插槽-卡片左侧侧 -->
|
||||||
|
<template #title>
|
||||||
|
<a-form layout="inline">
|
||||||
|
<a-form-item :label="t('views.tool.ps.realTime')" name="realTime">
|
||||||
|
<a-select
|
||||||
|
v-model:value="state.intervalTime"
|
||||||
|
:options="[
|
||||||
|
{ label: t('views.tool.ps.realTimeHigh'), value: 3_000 },
|
||||||
|
{ label: t('views.tool.ps.realTimeRegular'), value: 5_000 },
|
||||||
|
{ label: t('views.tool.ps.realTimeLow'), value: 10_000 },
|
||||||
|
{ label: t('views.tool.ps.realTimeStop'), value: -1 },
|
||||||
|
]"
|
||||||
|
:placeholder="t('common.selectPlease')"
|
||||||
|
@change="fnIntervalChange"
|
||||||
|
style="width: 100px"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 表格列表 -->
|
||||||
<a-table
|
<a-table
|
||||||
class="table"
|
class="table"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
@@ -298,11 +321,13 @@ const tableColumns: ColumnsType<any> = [
|
|||||||
:pagination="tablePagination"
|
:pagination="tablePagination"
|
||||||
:loading="tableState.loading"
|
:loading="tableState.loading"
|
||||||
:data-source="tableState.data"
|
:data-source="tableState.data"
|
||||||
:size="tableState.size"
|
size="small"
|
||||||
:scroll="{ x: tableColumns.length * 120 }"
|
:scroll="{ x: tableColumns.length * 120 }"
|
||||||
></a-table>
|
></a-table>
|
||||||
|
</a-card>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.table :deep(.ant-pagination) {
|
.table :deep(.ant-pagination) {
|
||||||
padding: 0 24px;
|
padding: 0 24px;
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ function wsMessage(res: Record<string, any>) {
|
|||||||
if (requestId.startsWith('ps_')) {
|
if (requestId.startsWith('ps_')) {
|
||||||
// 将数据填入表格
|
// 将数据填入表格
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
|
if (tableState.loading) {
|
||||||
|
tableState.loading = false;
|
||||||
|
}
|
||||||
tableState.data = data;
|
tableState.data = data;
|
||||||
} else {
|
} else {
|
||||||
tableState.data = [];
|
tableState.data = [];
|
||||||
@@ -97,10 +100,9 @@ function fnGetList() {
|
|||||||
ws.send(msg);
|
ws.send(msg);
|
||||||
// 定时刷新数据
|
// 定时刷新数据
|
||||||
state.interval = setInterval(() => {
|
state.interval = setInterval(() => {
|
||||||
msg.data = state.query;
|
msg.data = JSON.parse(JSON.stringify(state.query));
|
||||||
ws.send(msg);
|
ws.send(msg);
|
||||||
}, state.intervalTime);
|
}, state.intervalTime);
|
||||||
tableState.loading = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**查询参数传入 */
|
/**查询参数传入 */
|
||||||
@@ -320,8 +322,6 @@ onBeforeUnmount(() => {
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<div>{{ state.query }}</div>
|
|
||||||
<div>{{ queryParams }}</div>
|
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
<a-card :bordered="false" :body-style="{ padding: '0px' }">
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import {
|
|||||||
packetStop,
|
packetStop,
|
||||||
packetFilter,
|
packetFilter,
|
||||||
} from '@/api/trace/packet';
|
} from '@/api/trace/packet';
|
||||||
import { s } from 'vite/dist/node/types.d-aGj9QkWt';
|
|
||||||
const ws = new WS();
|
const ws = new WS();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@@ -366,6 +365,7 @@ onBeforeUnmount(() => {
|
|||||||
type="primary"
|
type="primary"
|
||||||
:loading="downLoading"
|
:loading="downLoading"
|
||||||
@click.prevent="fnDownloadPCAP()"
|
@click.prevent="fnDownloadPCAP()"
|
||||||
|
v-if="state.task.outputPCAP"
|
||||||
>
|
>
|
||||||
<template #icon><DownloadOutlined /></template>
|
<template #icon><DownloadOutlined /></template>
|
||||||
{{ t('common.downloadText') }}
|
{{ t('common.downloadText') }}
|
||||||
@@ -378,7 +378,7 @@ onBeforeUnmount(() => {
|
|||||||
</a-tag>
|
</a-tag>
|
||||||
</a-space>
|
</a-space>
|
||||||
|
|
||||||
<a-space :size="8" class="toolbar-info">
|
<a-space :size="8" class="toolbar-info" v-show="state.initialized">
|
||||||
<span>
|
<span>
|
||||||
{{ t('views.traceManage.task.traceId') }}:
|
{{ t('views.traceManage.task.traceId') }}:
|
||||||
<strong>{{ state.task.taskNo }}</strong>
|
<strong>{{ state.task.taskNo }}</strong>
|
||||||
|
|||||||
Reference in New Issue
Block a user