mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
verify auth if error fetching systems
This commit is contained in:
@@ -26,15 +26,23 @@ export async function copyToClipboard(content: string) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const updateSystemList = () => {
|
||||
pb.collection<SystemRecord>('systems')
|
||||
.getFullList({ sort: '+name' })
|
||||
.then((records) => {
|
||||
$systems.set(records)
|
||||
const verifyAuth = () => {
|
||||
pb.collection('users')
|
||||
.authRefresh()
|
||||
.catch(() => {
|
||||
pb.authStore.clear()
|
||||
})
|
||||
}
|
||||
|
||||
export const updateSystemList = async () => {
|
||||
try {
|
||||
const records = await pb.collection<SystemRecord>('systems').getFullList({ sort: '+name' })
|
||||
$systems.set(records)
|
||||
} catch (e) {
|
||||
verifyAuth()
|
||||
}
|
||||
}
|
||||
|
||||
export const updateAlerts = () => {
|
||||
pb.collection('alerts')
|
||||
.getFullList<AlertRecord>({ fields: 'id,name,system' })
|
||||
|
Reference in New Issue
Block a user