mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
misc fixes
This commit is contained in:
committed by
Matt Hill
parent
f78d6c3034
commit
601604a3d0
@@ -30,16 +30,20 @@ export class LogsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetch (isBefore: boolean = true) {
|
async fetch (isBefore: boolean = true) {
|
||||||
const logs = await this.fetchLogs({
|
try {
|
||||||
before: isBefore ? this.before : undefined,
|
const logs = await this.fetchLogs({
|
||||||
after: !isBefore ? this.after : undefined,
|
before: isBefore ? this.before : undefined,
|
||||||
limit: this.limit,
|
after: !isBefore ? this.after : undefined,
|
||||||
})
|
limit: this.limit,
|
||||||
this.before = logs[0]?.timestamp
|
})
|
||||||
this.after = logs[logs.length - 1]?.timestamp
|
this.before = logs[0]?.timestamp
|
||||||
this.loading = false
|
this.after = logs[logs.length - 1]?.timestamp
|
||||||
|
this.loading = false
|
||||||
|
|
||||||
return logs
|
return logs
|
||||||
|
} catch (e) {
|
||||||
|
this.errToast.present(e)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getLogs () {
|
async getLogs () {
|
||||||
@@ -63,20 +67,20 @@ export class LogsPage {
|
|||||||
this.needInfinite = false
|
this.needInfinite = false
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) { }
|
||||||
this.errToast.present(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadMore () {
|
async loadMore () {
|
||||||
this.loadingMore = true
|
try {
|
||||||
const logs = await this.fetch(false)
|
this.loadingMore = true
|
||||||
const container = document.getElementById('container')
|
const logs = await this.fetch(false)
|
||||||
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
const container = document.getElementById('container')
|
||||||
newLogs.innerHTML = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n') + (logs.length ? '\n\n' : '')
|
const newLogs = document.getElementById('template').cloneNode(true) as HTMLElement
|
||||||
container.append(newLogs)
|
newLogs.innerHTML = logs.map(l => `${l.timestamp} ${l.log}`).join('\n\n') + (logs.length ? '\n\n' : '')
|
||||||
this.loadingMore = false
|
container.append(newLogs)
|
||||||
this.scrollEvent()
|
this.loadingMore = false
|
||||||
|
this.scrollEvent()
|
||||||
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
scrollEvent () {
|
scrollEvent () {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export class AppConfigPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async dismiss () {
|
async dismiss () {
|
||||||
if (this.configForm.dirty) {
|
if (this.configForm?.dirty) {
|
||||||
await this.presentAlertUnsaved()
|
await this.presentAlertUnsaved()
|
||||||
} else {
|
} else {
|
||||||
this.modalCtrl.dismiss()
|
this.modalCtrl.dismiss()
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export class AppActionsPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async executeAction (pkgId: string, actionId: string, input?: object): Promise<boolean> {
|
private async executeAction (pkgId: string, actionId: string, input?: object): Promise<boolean> {
|
||||||
|
console.log('executing action')
|
||||||
const loader = await this.loadingCtrl.create({
|
const loader = await this.loadingCtrl.create({
|
||||||
spinner: 'lines',
|
spinner: 'lines',
|
||||||
message: 'Executing action...',
|
message: 'Executing action...',
|
||||||
|
|||||||
Reference in New Issue
Block a user