1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-25 06:49:23 +01:00
Files
dozzle/assets/composables/settings.ts
Amir Raminfar 58edb4f602 feat: adds automatic redirect when a new container is found (#2396)
* feat: implements a toast for alerting errors and other useful information

* removes unused code

* feat: adds automatic redirect when a new container is found

* complete the flow with alerts and settings page

* adds more langs and option for once

* removes files
2023-09-27 16:00:44 -07:00

49 lines
1.0 KiB
TypeScript

import { toRefs } from "@vueuse/core";
const DOZZLE_SETTINGS_KEY = "DOZZLE_SETTINGS";
export const DEFAULT_SETTINGS: {
search: boolean;
size: "small" | "medium" | "large";
menuWidth: number;
smallerScrollbars: boolean;
showTimestamp: boolean;
showStd: boolean;
showAllContainers: boolean;
lightTheme: "auto" | "dark" | "light";
hourStyle: "auto" | "24" | "12";
softWrap: boolean;
collapseNav: boolean;
automaticRedirect: boolean;
} = {
search: true,
size: "medium",
menuWidth: 15,
smallerScrollbars: false,
showTimestamp: true,
showStd: false,
showAllContainers: false,
lightTheme: "auto",
hourStyle: "auto",
softWrap: true,
collapseNav: false,
automaticRedirect: true,
};
export const settings = useStorage(DOZZLE_SETTINGS_KEY, DEFAULT_SETTINGS);
settings.value = { ...DEFAULT_SETTINGS, ...settings.value };
export const {
collapseNav,
softWrap,
hourStyle,
lightTheme,
showAllContainers,
showTimestamp,
showStd,
smallerScrollbars,
menuWidth,
size,
search,
automaticRedirect,
} = toRefs(settings);