mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +08:00
combine hub and agent repos
This commit is contained in:
24
hub/site/src/lib/stores.ts
Normal file
24
hub/site/src/lib/stores.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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>
|
Reference in New Issue
Block a user