mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-25 23:03:47 +01:00
24 lines
747 B
TypeScript
24 lines
747 B
TypeScript
import { Container } from "@/models/Container";
|
|
|
|
const DOZZLE_HOST = "DOZZLE_HOST";
|
|
export const sessionHost = useSessionStorage<string | null>(DOZZLE_HOST, null);
|
|
|
|
if (config.hosts.length === 1 && !sessionHost.value) {
|
|
sessionHost.value = config.hosts[0].id;
|
|
}
|
|
|
|
export function persistentVisibleKeys(container: ComputedRef<Container>) {
|
|
return computed(() => useStorage(container.value.storageKey, []));
|
|
}
|
|
|
|
const DOZZLE_PINNED_CONTAINERS = "DOZZLE_PINNED_CONTAINERS";
|
|
export const pinnedContainers = useStorage(DOZZLE_PINNED_CONTAINERS, new Set<string>());
|
|
|
|
export function togglePinnedContainer(id: string) {
|
|
if (pinnedContainers.value.has(id)) {
|
|
pinnedContainers.value.delete(id);
|
|
} else {
|
|
pinnedContainers.value.add(id);
|
|
}
|
|
}
|