2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 12:40:25 +08:00

fix: 优化实时日志modal重载

This commit is contained in:
耗子
2024-10-23 15:47:53 +08:00
parent df4e47cc7b
commit 86fb1c392e
3 changed files with 7 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ const logRef = ref<LogInst | null>(null)
let logWs: WebSocket | null = null
const init = async () => {
const cmd = `tail -n 40 -f '${props.path}'`
const cmd = `tail -n 200 -f '${props.path}'`
ws.exec(cmd)
.then((ws: WebSocket) => {
logWs = ws

View File

@@ -12,7 +12,7 @@ const logRef = ref<LogInst | null>(null)
let logWs: WebSocket | null = null
const init = async () => {
const cmd = `tail -n 40 -f '${props.path}'`
const cmd = `tail -n 200 -f '${props.path}'`
ws.exec(cmd)
.then((ws: WebSocket) => {
logWs = ws
@@ -36,14 +36,12 @@ const handleClose = () => {
log.value = ''
}
watch(
() => props.path,
() => {
handleClose()
watch([() => props.path, () => show.value], () => {
handleClose()
if (show.value) {
init()
}
)
})
watchEffect(() => {
if (log.value) {
nextTick(() => {

View File

@@ -441,7 +441,7 @@ if (import.meta.hot) {
<p>负载状态</p>
<n-progress
type="dashboard"
:percentage="formatPercent((realtime.load.load1 / cores) * 100)"
:percentage="Math.round(formatPercent((realtime.load.load1 / cores) * 100))"
:color="statusColor((realtime.load.load1 / cores) * 100)"
>
</n-progress>