670948f113
- CRITICAL: Change DNS zones endpoint from GET to POST to avoid leaking API token in URL query parameters - HIGH: Add sync.RWMutex to protect dnsProvider field in Server, Deployer, and proxy Manager against concurrent read/write races - HIGH: Capture old DNS provider reference synchronously before launching background cleanup goroutine - HIGH: Use getDNS()/getDNSProviderLocked() accessors instead of direct field reads in all DNS operations
28 lines
773 B
JavaScript
28 lines
773 B
JavaScript
import { w as writable, d as derived } from "./index3.js";
|
|
const THEME_KEY = "dw_theme";
|
|
function getInitialMode() {
|
|
if (typeof localStorage !== "undefined") {
|
|
const stored = localStorage.getItem(THEME_KEY);
|
|
if (stored === "light" || stored === "dark" || stored === "system") return stored;
|
|
}
|
|
return "system";
|
|
}
|
|
const themeMode = writable(getInitialMode());
|
|
themeMode.subscribe((value) => {
|
|
if (typeof localStorage !== "undefined") {
|
|
localStorage.setItem(THEME_KEY, value);
|
|
}
|
|
});
|
|
derived(themeMode, ($mode) => {
|
|
if ($mode === "system") {
|
|
if (typeof window !== "undefined") {
|
|
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
}
|
|
return "light";
|
|
}
|
|
return $mode;
|
|
});
|
|
export {
|
|
themeMode as t
|
|
};
|