mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 10:46:16 +01:00
15 lines
389 B
TypeScript
15 lines
389 B
TypeScript
import PocketBase from 'pocketbase'
|
|
import { atom } from 'nanostores'
|
|
import { SystemRecord } from '@/types'
|
|
|
|
export const pb = new PocketBase('/')
|
|
// @ts-ignore
|
|
pb.authStore.storageKey = 'pb_admin_auth'
|
|
|
|
export const $authenticated = atom(pb.authStore.isValid)
|
|
export const $servers = atom([] as SystemRecord[])
|
|
|
|
pb.authStore.onChange(() => {
|
|
$authenticated.set(pb.authStore.isValid)
|
|
})
|