mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 01:39:34 +08:00
25 lines
722 B
Go
25 lines
722 B
Go
import PocketBase from 'pocketbase'
|
|
import { atom, WritableAtom } from 'nanostores'
|
|
import { AlertRecord, ChartTimes, SystemRecord } from '@/types'
|
|
|
|
/** PocketBase JS Client */
|
|
export const pb = new PocketBase('/')
|
|
|
|
/** Store if user is authenticated */
|
|
export const $authenticated = atom(pb.authStore.isValid)
|
|
|
|
/** List of system records */
|
|
export const $systems = atom([] as SystemRecord[])
|
|
|
|
/** Last updated system record (realtime) */
|
|
export const $updatedSystem = atom({} as SystemRecord)
|
|
|
|
/** List of alert records */
|
|
export const $alerts = atom([] as AlertRecord[])
|
|
|
|
/** SSH public key */
|
|
export const $publicKey = atom('')
|
|
|
|
/** Chart time period */
|
|
export const $chartTime = atom('1h') as WritableAtom<ChartTimes>
|