alert updates

This commit is contained in:
Henry Dollman
2024-07-15 15:49:00 -04:00
parent f1819e59b9
commit 6696e1c749
9 changed files with 224 additions and 115 deletions

View File

@@ -1,8 +1,9 @@
import PocketBase from 'pocketbase'
import { atom } from 'nanostores'
import { SystemRecord } from '@/types'
import { AlertRecord, SystemRecord } from '@/types'
import { createRouter } from '@nanostores/router'
/** PocketBase JS Client */
export const pb = new PocketBase('/')
export const $router = createRouter(
@@ -13,12 +14,19 @@ export const $router = createRouter(
{ links: false }
)
/** Navigate to url using router */
export const navigate = (urlString: string) => {
$router.open(urlString)
}
/** Store if user is authenticated */
export const $authenticated = atom(pb.authStore.isValid)
export const $servers = atom([] as SystemRecord[])
/** List of system records */
export const $systems = atom([] as SystemRecord[])
/** List of alert records */
export const $alerts = atom([] as AlertRecord[])
/** SSH public key */
export const $publicKey = atom('')