add: audit log, reports

add: theme preference setting
This commit is contained in:
trisua 2025-04-02 11:39:51 -04:00
parent b2df2739a7
commit d3d0c41334
38 changed files with 925 additions and 169 deletions

View file

@ -6,20 +6,22 @@ function media_theme_pref() {
if (
window.matchMedia("(prefers-color-scheme: dark)").matches &&
!window.localStorage.getItem("tetratto:theme")
(!window.localStorage.getItem("tetratto:theme") ||
window.localStorage.getItem("tetratto:theme") === "Auto")
) {
document.documentElement.classList.add("dark");
// window.localStorage.setItem("theme", "dark");
} else if (
window.matchMedia("(prefers-color-scheme: light)").matches &&
!window.localStorage.getItem("tetratto:theme")
(!window.localStorage.getItem("tetratto:theme") ||
window.localStorage.getItem("tetratto:theme") === "Auto")
) {
document.documentElement.classList.remove("dark");
// window.localStorage.setItem("theme", "light");
} else if (window.localStorage.getItem("tetratto:theme")) {
/* restore theme */
const current = window.localStorage.getItem("tetratto:theme");
document.documentElement.className = current;
document.documentElement.className = current.toLowerCase();
}
}

View file

@ -144,4 +144,10 @@
]);
});
});
self.define("report", (_, asset, asset_type) => {
window.open(
`/mod_panel/file_report?asset=${asset}&asset_type=${asset_type}`,
);
});
})();