feat(shell,api,keys): firefly v1 shell over the api with cookie auth, period, palette and keymap
This commit is contained in:
1 parent
ae4de7911b
commit
c74dac3e00
37 files changed
+58163
-79
No files matched your search
@@ -0,0 +1,28 @@
|
||||
const SIDEBAR_KEY = "ffui.sidebar.collapsed";
|
||||
|
||||
class Ui {
|
||||
palette = $state(false);
|
||||
paletteQuery = $state("");
|
||||
quickEntry = $state(false);
|
||||
mobileNav = $state(false);
|
||||
collapsed = $state(
|
||||
typeof localStorage !== "undefined" &&
|
||||
localStorage.getItem(SIDEBAR_KEY) === "1"
|
||||
);
|
||||
|
||||
openPalette(query = "") {
|
||||
this.paletteQuery = query;
|
||||
this.palette = true;
|
||||
}
|
||||
|
||||
toggleSidebar() {
|
||||
if (window.matchMedia("(max-width: 1023px)").matches) {
|
||||
this.mobileNav = !this.mobileNav;
|
||||
return;
|
||||
}
|
||||
this.collapsed = !this.collapsed;
|
||||
localStorage.setItem(SIDEBAR_KEY, this.collapsed ? "1" : "0");
|
||||
}
|
||||
}
|
||||
|
||||
export const ui = new Ui();
|
||||
Reference in new issue
Block a user