diff --git a/src/lib/common/Stores.svelte b/src/lib/common/Stores.svelte index 628e89c..69f3130 100644 --- a/src/lib/common/Stores.svelte +++ b/src/lib/common/Stores.svelte @@ -1,6 +1,6 @@ diff --git a/src/lib/common/classes.ts b/src/lib/common/classes.ts index 22a7f00..baf7684 100644 --- a/src/lib/common/classes.ts +++ b/src/lib/common/classes.ts @@ -14,6 +14,14 @@ export class Device { } } +export class ACL { + public groups: {[key: string]: [string]} = {} + + public constructor(init?: Partial) { + Object.assign(this, init); + } +} + export class Route { advertisedRoutes: string[] = []; enabledRoutes: string[] = []; diff --git a/src/lib/common/nav.svelte b/src/lib/common/nav.svelte index 45b1aab..4300ade 100644 --- a/src/lib/common/nav.svelte +++ b/src/lib/common/nav.svelte @@ -3,6 +3,7 @@ import { fade } from 'svelte/transition'; import { writable } from 'svelte/store'; import { base } from '$app/paths'; + import { showACLPagesStore } from './stores'; // navigation bar variables let navExpanded = writable(''); @@ -46,6 +47,18 @@ User View + {#if $showACLPagesStore} + + + + + Group View + + {/if} diff --git a/src/lib/common/stores.js b/src/lib/common/stores.js index 0873d52..865caca 100644 --- a/src/lib/common/stores.js +++ b/src/lib/common/stores.js @@ -1,27 +1,42 @@ import { writable } from 'svelte/store'; -import { Device, User } from '$lib/common/classes'; +import { Device, User, ACL } from '$lib/common/classes'; + +// +// localStorage Stores (global scope, saves to the browser) +// -// used to store the value of an alert across all components -export const alertStore = writable(''); -// used to determine if the API is functioning -export const apiTestStore = writable(''); // stores the theme export const themeStore = writable(''); // stores URL and API Key export const URLStore = writable(''); export const APIKeyStore = writable(''); +// stores sorting preferences +export const deviceSortStore = writable('id'); +export const deviceSortDirectionStore = writable('ascending'); +export const userSortStore = writable('id'); +export const sortDirectionStore = writable('ascending'); // stores preauth key preference export const preAuthHideStore = writable(false); + +// Dev Setting Stores +// Shows or Hides ACL Settings +export const showACLPagesStore = writable(false); + +// +// Normal Stores (global scope, saves until refresh) +// + // stores user and device data export const userStore = writable([new User()]); export const userFilterStore = writable([new User()]); export const deviceStore = writable([new Device()]); export const deviceFilterStore = writable([new Device()]); +// stores ACL object +export const aclStore = writable(new ACL()); +// used to store the value of an alert across all components +export const alertStore = writable(''); +// used to determine if the API is functioning +export const apiTestStore = writable(''); // stores search state export const userSearchStore = writable(''); -export const deviceSearchStore = writable(''); -// stores sorting preferences -export const deviceSortStore = writable('id'); -export const deviceSortDirectionStore = writable('ascending'); -export const userSortStore = writable('id'); -export const sortDirectionStore = writable('ascending'); \ No newline at end of file +export const deviceSearchStore = writable(''); \ No newline at end of file diff --git a/src/lib/settings/DevSettings.svelte b/src/lib/settings/DevSettings.svelte new file mode 100644 index 0000000..ae1d721 --- /dev/null +++ b/src/lib/settings/DevSettings.svelte @@ -0,0 +1,13 @@ + + +

Developer Flags

+{#if showDevSettings} +
+

ACL Pages

+
+{/if} diff --git a/src/routes/groups.html/+page.svelte b/src/routes/groups.html/+page.svelte new file mode 100644 index 0000000..78bbc50 --- /dev/null +++ b/src/routes/groups.html/+page.svelte @@ -0,0 +1,23 @@ + + + + {#if showACLPagesStore} + + {/if} + diff --git a/src/routes/settings.html/+page.svelte b/src/routes/settings.html/+page.svelte index d510bf3..c25d624 100644 --- a/src/routes/settings.html/+page.svelte +++ b/src/routes/settings.html/+page.svelte @@ -2,6 +2,7 @@ // // Imports // + import DevSettings from '$lib/settings/DevSettings.svelte'; import ServerSettings from '$lib/settings/ServerSettings.svelte'; import ThemeSettings from '$lib/settings/ThemeSettings.svelte'; import { onMount } from 'svelte'; @@ -26,5 +27,7 @@

Version

insert-version +
+