mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
misc fixes
This commit is contained in:
committed by
Aiden McClelland
parent
95c95a9fe4
commit
9d52149a0d
@@ -30,16 +30,20 @@ export class LogsPage {
|
||||
}
|
||||
|
||||
async fetch (isBefore: boolean = true) {
|
||||
const logs = await this.fetchLogs({
|
||||
before: isBefore ? this.before : undefined,
|
||||
after: !isBefore ? this.after : undefined,
|
||||
limit: this.limit,
|
||||
})
|
||||
this.before = logs[0]?.timestamp
|
||||
this.after = logs[logs.length - 1]?.timestamp
|
||||
this.loading = false
|
||||
try {
|
||||
const logs = await this.fetchLogs({
|
||||
before: isBefore ? this.before : undefined,
|
||||
after: !isBefore ? this.after : undefined,
|
||||
limit: this.limit,
|
||||
})
|
||||
this.before = logs[0]?.timestamp
|
||||
this.after = logs[logs.length - 1]?.timestamp
|
||||
this.loading = false
|
||||
|
||||
return logs
|
||||
return logs
|
||||
} catch (e) {
|
||||
this.errToast.present(e)
|
||||
}
|
||||
}
|
||||
|
||||
async getLogs () {
|
||||
@@ -63,20 +67,20 @@ export class LogsPage {
|
||||
this.needInfinite = false
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
this.errToast.present(e)
|
||||
}
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
async loadMore () {
|
||||
this.loadingMore = true
|
||||
const logs = await this.fetch(false)
|
||||
const container = document.getElementById('container')
|
||||
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' : '')
|
||||
container.append(newLogs)
|
||||
this.loadingMore = false
|
||||
this.scrollEvent()
|
||||
try {
|
||||
this.loadingMore = true
|
||||
const logs = await this.fetch(false)
|
||||
const container = document.getElementById('container')
|
||||
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' : '')
|
||||
container.append(newLogs)
|
||||
this.loadingMore = false
|
||||
this.scrollEvent()
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
scrollEvent () {
|
||||
|
||||
@@ -107,7 +107,7 @@ export class AppConfigPage {
|
||||
}
|
||||
|
||||
async dismiss () {
|
||||
if (this.configForm.dirty) {
|
||||
if (this.configForm?.dirty) {
|
||||
await this.presentAlertUnsaved()
|
||||
} else {
|
||||
this.modalCtrl.dismiss()
|
||||
|
||||
@@ -143,6 +143,7 @@ export class AppActionsPage {
|
||||
}
|
||||
|
||||
private async executeAction (pkgId: string, actionId: string, input?: object): Promise<boolean> {
|
||||
console.log('executing action')
|
||||
const loader = await this.loadingCtrl.create({
|
||||
spinner: 'lines',
|
||||
message: 'Executing action...',
|
||||
|
||||
Reference in New Issue
Block a user