mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-12 10:55:51 +02:00
fix: log container not scroll to bottom
This commit is contained in:
parent
4bce9025af
commit
04bf6d78d4
1 changed files with 7 additions and 6 deletions
|
@ -23,7 +23,7 @@ const control = reactive({
|
|||
type: logType(),
|
||||
conf_name: route.query.conf_name,
|
||||
server_idx: parseInt(route.query.server_idx as string),
|
||||
directive_idx: parseInt(route.query.directive_idx as string),
|
||||
directive_idx: parseInt(route.query.directive_idx as string)
|
||||
})
|
||||
|
||||
function openWs() {
|
||||
|
@ -51,11 +51,12 @@ function addLog(data: string, prepend: boolean = false) {
|
|||
} else {
|
||||
buffer.value += data
|
||||
}
|
||||
|
||||
const elem = (logContainer.value as any as Element)
|
||||
elem.scroll({
|
||||
top: elem.scrollHeight,
|
||||
left: 0,
|
||||
nextTick(() => {
|
||||
const elem = (logContainer.value as any as Element)
|
||||
elem?.scroll({
|
||||
top: elem.scrollHeight,
|
||||
left: 0
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue