fix: 网元日志实时查看组件参数调整

This commit is contained in:
TsMask
2024-10-17 15:07:04 +08:00
parent 3e0529cf87
commit 8e70706ed5

View File

@@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, onMounted, watch, ref, nextTick } from 'vue'; import { reactive, watch, ref } from 'vue';
import { ProModal } from 'antdv-pro-modal'; import { ProModal } from 'antdv-pro-modal';
import TerminalSSHView from '@/components/TerminalSSHView/index.vue'; import TerminalSSHView from '@/components/TerminalSSHView/index.vue';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
@@ -86,19 +86,20 @@ function fnInit() {
function fnReload() { function fnReload() {
if (!viewTerminal.value) return; if (!viewTerminal.value) return;
viewTerminal.value.ctrlC(); viewTerminal.value.ctrlC();
if (state.form.showType !== 'lines') { if (state.form.showType !== 'lines') {
state.form.lines = 10; state.form.lines = 10;
} else { } else {
state.form.char = 0; state.form.char = 0;
} }
viewTerminal.value.clear(); viewTerminal.value.clear();
viewTerminal.value.send('tail', { setTimeout(() => {
filePath: props.filePath, viewTerminal.value.send('tail', {
lines: state.form.lines, filePath: props.filePath,
char: state.form.char, lines: state.form.lines,
follow: state.form.follow, char: state.form.char,
}); follow: state.form.follow,
});
}, 1000);
} }
</script> </script>
@@ -122,9 +123,11 @@ function fnReload() {
<TerminalSSHView <TerminalSSHView
ref="viewTerminal" ref="viewTerminal"
:id="`V${Date.now()}`" :id="`V${Date.now()}`"
style="height: calc(100% - 36px)" prefix="tail"
url="/ws/view"
:ne-type="neType" :ne-type="neType"
:ne-id="neId" :ne-id="neId"
style="height: calc(100% - 36px)"
@connect="fnInit()" @connect="fnInit()"
></TerminalSSHView> ></TerminalSSHView>
<!-- 命令控制属性 --> <!-- 命令控制属性 -->