mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
no page or limit
This commit is contained in:
committed by
Aiden McClelland
parent
3d5ac47a82
commit
5ed99520ae
@@ -14,8 +14,8 @@ export class AppLogsPage {
|
||||
page = 1
|
||||
pkgId: string
|
||||
firstTimeLoaded = false
|
||||
needInfinite = false
|
||||
pageLength = 20
|
||||
needInfinite = true
|
||||
before: string
|
||||
|
||||
constructor (
|
||||
private readonly route: ActivatedRoute,
|
||||
@@ -33,11 +33,17 @@ export class AppLogsPage {
|
||||
// get logs
|
||||
const logs = await this.embassyApi.getPackageLogs({
|
||||
id: this.pkgId,
|
||||
limit: this.pageLength,
|
||||
page: this.page,
|
||||
before: this.before,
|
||||
})
|
||||
this.firstTimeLoaded = true
|
||||
|
||||
if (!logs.length) {
|
||||
this.needInfinite = false
|
||||
return
|
||||
}
|
||||
|
||||
this.before = logs[0].timestamp
|
||||
|
||||
const container = document.getElementById('container')
|
||||
const beforeContainerHeight = container.scrollHeight
|
||||
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
||||
@@ -48,9 +54,6 @@ export class AppLogsPage {
|
||||
// scroll down
|
||||
scrollBy(0, afterContainerHeight - beforeContainerHeight)
|
||||
this.content.scrollToPoint(0, afterContainerHeight - beforeContainerHeight)
|
||||
|
||||
const wrapper = document.getElementById('ion-content')
|
||||
this.needInfinite = logs.length === this.pageLength
|
||||
} catch (e) {
|
||||
this.errToast.present(e)
|
||||
}
|
||||
@@ -58,7 +61,6 @@ export class AppLogsPage {
|
||||
|
||||
async loadData (e: any): Promise<void> {
|
||||
await this.getLogs()
|
||||
this.page++
|
||||
e.target.complete()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,9 @@ export class ServerLogsPage {
|
||||
@ViewChild(IonContent, { static: false }) private content: IonContent
|
||||
loading = true
|
||||
logs: string
|
||||
needInfinite = false
|
||||
needInfinite = true
|
||||
firstTimeLoaded = false
|
||||
page = 1
|
||||
pageLength = 20
|
||||
before: string
|
||||
|
||||
constructor (
|
||||
private readonly errToast: ErrorToastService,
|
||||
@@ -29,10 +28,14 @@ export class ServerLogsPage {
|
||||
async getLogs () {
|
||||
try {
|
||||
// get logs
|
||||
const logs = await this.embassyApi.getServerLogs({
|
||||
limit: this.pageLength,
|
||||
page: this.page,
|
||||
})
|
||||
const logs = await this.embassyApi.getServerLogs({ before: this.before })
|
||||
|
||||
if (!logs.length) {
|
||||
this.needInfinite = false
|
||||
return
|
||||
}
|
||||
|
||||
this.before = logs[0].timestamp
|
||||
|
||||
this.firstTimeLoaded = true
|
||||
|
||||
@@ -46,9 +49,6 @@ export class ServerLogsPage {
|
||||
// scroll down
|
||||
scrollBy(0, afterContainerHeight - beforeContainerHeight)
|
||||
this.content.scrollToPoint(0, afterContainerHeight - beforeContainerHeight)
|
||||
|
||||
const wrapper = document.getElementById('ion-content')
|
||||
this.needInfinite = logs.length === this.pageLength
|
||||
} catch (e) {
|
||||
this.errToast.present(e)
|
||||
}
|
||||
@@ -56,7 +56,6 @@ export class ServerLogsPage {
|
||||
|
||||
async loadData (e: any): Promise<void> {
|
||||
await this.getLogs()
|
||||
this.page++
|
||||
e.target.complete()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user