mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 18:56:17 +01:00
updates
This commit is contained in:
@@ -4,8 +4,6 @@ import { SystemRecord } from '@/types'
|
||||
import { createRouter } from '@nanostores/router'
|
||||
|
||||
export const pb = new PocketBase('/')
|
||||
// @ts-ignore
|
||||
pb.authStore.storageKey = 'pb_admin_auth'
|
||||
|
||||
export const $router = createRouter(
|
||||
{
|
||||
@@ -20,9 +18,6 @@ export const navigate = (urlString: string) => {
|
||||
}
|
||||
|
||||
export const $authenticated = atom(pb.authStore.isValid)
|
||||
pb.authStore.onChange(() => {
|
||||
$authenticated.set(pb.authStore.isValid)
|
||||
})
|
||||
|
||||
export const $servers = atom([] as SystemRecord[])
|
||||
|
||||
|
||||
@@ -54,3 +54,5 @@ export const formatShortDate = (timestamp: string) => shortDateFormatter.format(
|
||||
|
||||
export const updateFavicon = (newIconUrl: string) =>
|
||||
((document.querySelector("link[rel='icon']") as HTMLLinkElement).href = newIconUrl)
|
||||
|
||||
export const isAdmin = () => pb.authStore.model?.admin
|
||||
|
||||
Reference in New Issue
Block a user