ui: persist log timestamp toggle and add tooltips to log buttons

This commit is contained in:
henrygd
2026-09-30 21:25:16 -04:00
parent 2502dd9626
commit 5b0952ffcf
4 changed files with 76 additions and 80 deletions

View File

@@ -40,6 +40,17 @@ export const $chartTime = atom<ChartTimes>(defaultChartTime)
/** Whether to display average or max chart values */
export const $maxValues = atom(false)
const logTimestampsKey = "besz-log-ts"
/** Whether to show timestamps in Docker and systemd logs */
export const $showLogTimestamps = atom<boolean>(JSON.parse(localStorage.getItem(logTimestampsKey) ?? "true"))
export function toggleLogTimestamps() {
const next = !$showLogTimestamps.get()
$showLogTimestamps.set(next)
localStorage.setItem(logTimestampsKey, JSON.stringify(next))
}
// export const UserSettingsSchema = v.object({
// chartTime: v.picklist(["1h", "12h", "24h", "1w", "30d"]),
// emails: v.optional(v.array(v.pipe(v.string(), v.email())), [pb?.authStore?.record?.email ?? ""]),