mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 18:56:17 +01:00
refactor: centralize chart max/avg value state to global store
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import PocketBase from "pocketbase"
|
||||
import { atom, map, WritableAtom } from "nanostores"
|
||||
import { atom, map, PreinitializedWritableAtom } from "nanostores"
|
||||
import { AlertRecord, ChartTimes, SystemRecord, UserSettings } from "@/types"
|
||||
import { basePath } from "@/components/router"
|
||||
|
||||
@@ -22,7 +22,10 @@ export const $publicKey = atom("")
|
||||
export const $hubVersion = atom("")
|
||||
|
||||
/** Chart time period */
|
||||
export const $chartTime = atom("1h") as WritableAtom<ChartTimes>
|
||||
export const $chartTime = atom("1h") as PreinitializedWritableAtom<ChartTimes>
|
||||
|
||||
/** Whether to display average or max chart values */
|
||||
export const $maxValues = atom(false)
|
||||
|
||||
/** User settings */
|
||||
export const $userSettings = map<UserSettings>({
|
||||
|
||||
Reference in New Issue
Block a user