fix: 网元切换时命令操作信息过滤
This commit is contained in:
@@ -80,6 +80,14 @@ async function fnIPerf() {
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 网元切换时重置
|
||||
if (neType !== state.params.neType || neId !== state.params.neId) {
|
||||
state.initialized = false;
|
||||
state.params.neType = neType;
|
||||
state.params.neId = neId;
|
||||
}
|
||||
|
||||
// 软件版本检查
|
||||
state.params.neType = neType;
|
||||
state.params.neId = neId;
|
||||
@@ -88,7 +96,6 @@ async function fnIPerf() {
|
||||
neId,
|
||||
version: state.data.version,
|
||||
});
|
||||
|
||||
if (resVersion.code !== RESULT_CODE_SUCCESS) {
|
||||
Modal.confirm({
|
||||
title: t('common.tipTitle'),
|
||||
@@ -99,6 +106,7 @@ async function fnIPerf() {
|
||||
} else {
|
||||
state.versionInfo = resVersion.data;
|
||||
}
|
||||
|
||||
// 初始化的直接重发
|
||||
if (state.initialized) {
|
||||
fnResend();
|
||||
@@ -145,8 +153,8 @@ function fnResend() {
|
||||
if (!toolTerminal.value) return;
|
||||
state.running = true;
|
||||
toolTerminal.value.ctrlC();
|
||||
toolTerminal.value.clear();
|
||||
setTimeout(() => {
|
||||
toolTerminal.value.clear();
|
||||
const data = JSON.parse(JSON.stringify(state.data));
|
||||
if (state.dataType === 'options') data.command = '';
|
||||
toolTerminal.value.send('iperf', data);
|
||||
@@ -180,9 +188,12 @@ function fnProcessMessage(data: string): string {
|
||||
if (lestIndex !== -1) {
|
||||
text = text.substring(0, lestIndex);
|
||||
}
|
||||
if (text.endsWith('# ')) {
|
||||
text = text.substring(0, text.lastIndexOf('\r\n') + 2);
|
||||
}
|
||||
|
||||
// console.log({ parts, text });
|
||||
if (parts[0].startsWith('iperf')) {
|
||||
if (parts.length > 1 && parts[0].startsWith('iperf')) {
|
||||
return parts[0] + '\r\n' + text;
|
||||
}
|
||||
return text;
|
||||
|
||||
Reference in New Issue
Block a user