mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
no logs conditional
This commit is contained in:
committed by
Aiden McClelland
parent
4b2a032ae0
commit
fc266a5d21
@@ -56,6 +56,8 @@ export class LogsPage {
|
|||||||
try {
|
try {
|
||||||
// get logs
|
// get logs
|
||||||
const logs = await this.fetch()
|
const logs = await this.fetch()
|
||||||
|
if (!logs.length) return
|
||||||
|
|
||||||
const container = document.getElementById('container')
|
const container = document.getElementById('container')
|
||||||
const beforeContainerHeight = container.scrollHeight
|
const beforeContainerHeight = container.scrollHeight
|
||||||
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
||||||
@@ -78,6 +80,8 @@ export class LogsPage {
|
|||||||
try {
|
try {
|
||||||
this.loadingMore = true
|
this.loadingMore = true
|
||||||
const logs = await this.fetch(false)
|
const logs = await this.fetch(false)
|
||||||
|
if (!logs.length) return this.loadingMore = false
|
||||||
|
|
||||||
const container = document.getElementById('container')
|
const container = document.getElementById('container')
|
||||||
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
||||||
newLogs.innerHTML = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n') + (logs.length ? '\n\n' : '')
|
newLogs.innerHTML = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n') + (logs.length ? '\n\n' : '')
|
||||||
|
|||||||
Reference in New Issue
Block a user