mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 12:40:25 +08:00
fix: 优化实时日志modal重载
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user