diff --git a/frontend/src/components/terminal/index.vue b/frontend/src/components/terminal/index.vue index 804545e298fc..9a93da52386f 100644 --- a/frontend/src/components/terminal/index.vue +++ b/frontend/src/components/terminal/index.vue @@ -110,7 +110,7 @@ const newTerm = () => { cursorBlink: terminalStore.cursorBlink ? String(terminalStore.cursorBlink).toLowerCase() === 'enable' : true, cursorStyle: terminalStore.cursorStyle ? getStyle() : 'underline', scrollback: terminalStore.scrollback || 1000, - scrollSensitivity: terminalStore.scrollSensitivity || 15, + scrollSensitivity: terminalStore.scrollSensitivity ?? 5, }); }; diff --git a/frontend/src/store/modules/terminal.ts b/frontend/src/store/modules/terminal.ts index 1a41482ecd9f..35c7eeb5b95d 100644 --- a/frontend/src/store/modules/terminal.ts +++ b/frontend/src/store/modules/terminal.ts @@ -14,7 +14,7 @@ export const TerminalStore = defineStore({ cursorBlink: 'enable', cursorStyle: 'underline', scrollback: 1000, - scrollSensitivity: 10, + scrollSensitivity: 5, }), actions: { setLineHeight(lineHeight: number) { diff --git a/frontend/src/views/home/index.vue b/frontend/src/views/home/index.vue index 48a71606706e..5af9a6a06253 100644 --- a/frontend/src/views/home/index.vue +++ b/frontend/src/views/home/index.vue @@ -747,6 +747,11 @@ const onLoadCurrentInfo = async () => { currentInfo.value.timeSinceUptime = res.data.timeSinceUptime; let timeInterval = Number(res.data.uptime - currentInfo.value.uptime) || 3; + if (skipNextChart.value || timeInterval > 10) { + skipNextChart.value = false; + currentInfo.value = res.data; + return; + } currentChartInfo.netBytesSent = res.data.netBytesSent - currentInfo.value.netBytesSent > 0 ? Number(((res.data.netBytesSent - currentInfo.value.netBytesSent) / 1024 / timeInterval).toFixed(2)) @@ -982,7 +987,11 @@ const loadSource = (row: any) => { ); }; +const skipNextChart = ref(false); const onFocus = () => { + if (!isActive.value) { + skipNextChart.value = true; + } isActive.value = true; }; const onBlur = () => { diff --git a/frontend/src/views/terminal/setting/index.vue b/frontend/src/views/terminal/setting/index.vue index 2fd6e62e68cc..612f840c8c46 100644 --- a/frontend/src/views/terminal/setting/index.vue +++ b/frontend/src/views/terminal/setting/index.vue @@ -363,7 +363,7 @@ const iniTerm = () => { cursorBlink: true, cursorStyle: 'block', scrollback: 1000, - scrollSensitivity: 15, + scrollSensitivity: 5, }); term.value.open(terminalElement.value); applyPreviewBackground(); @@ -415,7 +415,7 @@ const onSetDefault = () => { form.cursorBlink = 'Enable'; form.cursorStyle = 'block'; form.scrollback = 1000; - form.scrollSensitivity = 6; + form.scrollSensitivity = 5; changeItem(); };