summaryrefslogtreecommitdiff
path: root/src/flagd-ui/lib/flagd_ui_web/components/layouts
diff options
context:
space:
mode:
authorSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
committerSaumit <justsaumit@protonmail.com>2025-09-27 02:14:26 +0530
commit82e03978b89938219958032efb1448cc76baa181 (patch)
tree626f3e54d52ecd49be0ed3bee30abacc0453d081 /src/flagd-ui/lib/flagd_ui_web/components/layouts
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'src/flagd-ui/lib/flagd_ui_web/components/layouts')
-rw-r--r--src/flagd-ui/lib/flagd_ui_web/components/layouts/root.html.heex34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/flagd-ui/lib/flagd_ui_web/components/layouts/root.html.heex b/src/flagd-ui/lib/flagd_ui_web/components/layouts/root.html.heex
new file mode 100644
index 0000000..010a552
--- /dev/null
+++ b/src/flagd-ui/lib/flagd_ui_web/components/layouts/root.html.heex
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="csrf-token" content={get_csrf_token()} />
+ <meta name="root-path" content={FlagdUiWeb.Endpoint.get_root_path()} />
+ <.live_title default="Flagd-ui">
+ {assigns[:page_title]}
+ </.live_title>
+ <link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
+ <script defer phx-track-static type="text/javascript" src={~p"/assets/js/app.js"}>
+ </script>
+ <script>
+ (() => {
+ const setTheme = (theme) => {
+ if (theme === "system") {
+ localStorage.removeItem("phx:theme");
+ document.documentElement.removeAttribute("data-theme");
+ } else {
+ localStorage.setItem("phx:theme", theme);
+ document.documentElement.setAttribute("data-theme", theme);
+ }
+ };
+ setTheme(localStorage.getItem("phx:theme") || "system");
+ window.addEventListener("storage", (e) => e.key === "phx:theme" && setTheme(e.newValue || "system"));
+ window.addEventListener("phx:set-theme", ({ detail: { theme } }) => setTheme(theme));
+ })();
+ </script>
+ </head>
+ <body>
+ {@inner_content}
+ </body>
+</html>