From acbd861ce0debff53d2cb2fe5d77101f689b2e05 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Tue, 8 Oct 2024 10:22:59 -0700 Subject: [PATCH] feat: WIP sidebar filter select --- web/_data/serverState.ts | 16 ++-- web/components/Notifications/Sidebar.vue | 79 ++++++++++++------- web/components/UserProfile.ce.vue | 2 +- web/components/UserProfile/DropdownItem.vue | 1 - web/components/shadcn/select/Select.vue | 15 ++++ .../shadcn/select/SelectContent.vue | 58 ++++++++++++++ web/components/shadcn/select/SelectGroup.vue | 19 +++++ web/components/shadcn/select/SelectItem.vue | 44 +++++++++++ .../shadcn/select/SelectItemText.vue | 11 +++ web/components/shadcn/select/SelectLabel.vue | 13 +++ .../shadcn/select/SelectScrollDownButton.vue | 24 ++++++ .../shadcn/select/SelectScrollUpButton.vue | 24 ++++++ .../shadcn/select/SelectSeparator.vue | 17 ++++ .../shadcn/select/SelectTrigger.vue | 31 ++++++++ web/components/shadcn/select/SelectValue.vue | 11 +++ web/components/shadcn/select/index.ts | 11 +++ web/pages/index.vue | 2 +- 17 files changed, 337 insertions(+), 41 deletions(-) create mode 100644 web/components/shadcn/select/Select.vue create mode 100644 web/components/shadcn/select/SelectContent.vue create mode 100644 web/components/shadcn/select/SelectGroup.vue create mode 100644 web/components/shadcn/select/SelectItem.vue create mode 100644 web/components/shadcn/select/SelectItemText.vue create mode 100644 web/components/shadcn/select/SelectLabel.vue create mode 100644 web/components/shadcn/select/SelectScrollDownButton.vue create mode 100644 web/components/shadcn/select/SelectScrollUpButton.vue create mode 100644 web/components/shadcn/select/SelectSeparator.vue create mode 100644 web/components/shadcn/select/SelectTrigger.vue create mode 100644 web/components/shadcn/select/SelectValue.vue create mode 100644 web/components/shadcn/select/index.ts diff --git a/web/_data/serverState.ts b/web/_data/serverState.ts index e98aae6af..1f7e360a7 100644 --- a/web/_data/serverState.ts +++ b/web/_data/serverState.ts @@ -44,12 +44,10 @@ import type { // EBLACKLISTED2 // ENOCONN -// '1111-1111-5GDB-123412341234' Starter.key = TkJCrVyXMLWWGKZF6TCEvf0C86UYI9KfUDSOm7JoFP19tOMTMgLKcJ6QIOt9_9Psg_t0yF-ANmzSgZzCo94ljXoPm4BESFByR0K7nyY9KVvU8szLEUcBUT3xC2adxLrAXFNxiPeK-mZqt34n16uETKYvLKL_Sr5_JziG5L5lJFBqYZCPmfLMiguFo1vp0xL8pnBH7q8bYoBnePrAcAVb9mAGxFVPEInSPkMBfC67JLHz7XY1Y_K5bYIq3go9XPtLltJ53_U4BQiMHooXUBJCKXodpqoGxq0eV0IhNEYdauAhnTsG90qmGZig0hZalQ0soouc4JZEMiYEcZbn9mBxPg - -const state: ServerState = "BASIC" as ServerState; -const currentFlashGuid = "1111-1111-CFXF-TEST1234ZACK"; // this is the flash drive that's been booted from -const regGuid = "1111-1111-CFXF-TEST1234ZACK"; // this guid is registered in key server -const keyfileBase64 = "asdf"; // @todo raycast download key to base64 +const state: ServerState = "ENOKEYFILE2" as ServerState; +const currentFlashGuid = "4444-1111-FOUR-999900008888"; // this is the flash drive that's been booted from +const regGuid = "4444-1111-FOUR-999900008888"; // this guid is registered in key server +const keyfileBase64 = ""; // const randomGuid = `1111-1111-${makeid(4)}-123412341234`; // this guid is registered in key server // const newGuid = `1234-1234-${makeid(4)}-123412341234`; // this is a new USB, not registered @@ -106,10 +104,10 @@ switch (state) { break; } -const connectPluginInstalled = 'dynamix.unraid.net.staging.plg'; -// const connectPluginInstalled = ""; +// const connectPluginInstalled = 'dynamix.unraid.net.staging.plg'; +const connectPluginInstalled = ""; -const osVersion = "6.12.8"; +const osVersion = "7.0.0-beta.2.10"; const osVersionBranch = "stable"; // const parsedRegExp = regExp ? dayjs(regExp).format('YYYY-MM-DD') : undefined; diff --git a/web/components/Notifications/Sidebar.vue b/web/components/Notifications/Sidebar.vue index b58177f72..9d0e015a1 100644 --- a/web/components/Notifications/Sidebar.vue +++ b/web/components/Notifications/Sidebar.vue @@ -31,6 +31,12 @@ const getNotifications = gql` `; const notifications = ref([]); +watch(notifications, (newVal) => { + console.log('[notifications]', newVal); +}); + +const fetchType = ref<'UNREAD' | 'ARCHIVED'>('UNREAD'); +const setFetchType = (type: 'UNREAD' | 'ARCHIVED') => fetchType.value = type; const { unraidApiClient } = storeToRefs(useUnraidApiStore()); @@ -42,12 +48,10 @@ watch(unraidApiClient, async(newVal) => { filter: { offset: 0, limit: 10, - type: 'UNREAD', + type: fetchType.value, }, }, }); - console.log('[blah blah]', apiResponse); - notifications.value = apiResponse.data.notifications.list; } }); @@ -62,38 +66,55 @@ const { teleportTarget, determineTeleportTarget } = useTeleport(); - + Notifications - - - - Unread - - - Archived - - +
+
+ +
+
+ + +
+
- - - - - - -
+
+ +
- +

Future pagination station

diff --git a/web/components/UserProfile.ce.vue b/web/components/UserProfile.ce.vue index 62660d22c..0e13282b2 100644 --- a/web/components/UserProfile.ce.vue +++ b/web/components/UserProfile.ce.vue @@ -127,7 +127,7 @@ onBeforeMount(() => {
- + diff --git a/web/components/UserProfile/DropdownItem.vue b/web/components/UserProfile/DropdownItem.vue index d5026534d..8eb621ffc 100644 --- a/web/components/UserProfile/DropdownItem.vue +++ b/web/components/UserProfile/DropdownItem.vue @@ -23,7 +23,6 @@ const showExternalIconOnHover = computed(() => props.item?.external && props.ite :is="item?.click ? 'button' : 'a'" :disabled="item?.disabled" :href="item?.href ?? null" - :title="item?.title ? t(item?.title) : null" :target="item?.external ? '_blank' : null" :rel="item?.external ? 'noopener noreferrer' : null" class="text-left text-14px w-full flex flex-row items-center justify-between gap-x-8px px-8px py-8px cursor-pointer" diff --git a/web/components/shadcn/select/Select.vue b/web/components/shadcn/select/Select.vue new file mode 100644 index 000000000..adc42fdfb --- /dev/null +++ b/web/components/shadcn/select/Select.vue @@ -0,0 +1,15 @@ + + + diff --git a/web/components/shadcn/select/SelectContent.vue b/web/components/shadcn/select/SelectContent.vue new file mode 100644 index 000000000..cb1fbca97 --- /dev/null +++ b/web/components/shadcn/select/SelectContent.vue @@ -0,0 +1,58 @@ + + + diff --git a/web/components/shadcn/select/SelectGroup.vue b/web/components/shadcn/select/SelectGroup.vue new file mode 100644 index 000000000..614f7c3f8 --- /dev/null +++ b/web/components/shadcn/select/SelectGroup.vue @@ -0,0 +1,19 @@ + + + diff --git a/web/components/shadcn/select/SelectItem.vue b/web/components/shadcn/select/SelectItem.vue new file mode 100644 index 000000000..136ae3ea7 --- /dev/null +++ b/web/components/shadcn/select/SelectItem.vue @@ -0,0 +1,44 @@ + + + diff --git a/web/components/shadcn/select/SelectItemText.vue b/web/components/shadcn/select/SelectItemText.vue new file mode 100644 index 000000000..a0bb5c240 --- /dev/null +++ b/web/components/shadcn/select/SelectItemText.vue @@ -0,0 +1,11 @@ + + + diff --git a/web/components/shadcn/select/SelectLabel.vue b/web/components/shadcn/select/SelectLabel.vue new file mode 100644 index 000000000..e699b8edd --- /dev/null +++ b/web/components/shadcn/select/SelectLabel.vue @@ -0,0 +1,13 @@ + + + diff --git a/web/components/shadcn/select/SelectScrollDownButton.vue b/web/components/shadcn/select/SelectScrollDownButton.vue new file mode 100644 index 000000000..fb82fcaa1 --- /dev/null +++ b/web/components/shadcn/select/SelectScrollDownButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/web/components/shadcn/select/SelectScrollUpButton.vue b/web/components/shadcn/select/SelectScrollUpButton.vue new file mode 100644 index 000000000..ee4040b1f --- /dev/null +++ b/web/components/shadcn/select/SelectScrollUpButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/web/components/shadcn/select/SelectSeparator.vue b/web/components/shadcn/select/SelectSeparator.vue new file mode 100644 index 000000000..395876fc2 --- /dev/null +++ b/web/components/shadcn/select/SelectSeparator.vue @@ -0,0 +1,17 @@ + + + diff --git a/web/components/shadcn/select/SelectTrigger.vue b/web/components/shadcn/select/SelectTrigger.vue new file mode 100644 index 000000000..cce38a950 --- /dev/null +++ b/web/components/shadcn/select/SelectTrigger.vue @@ -0,0 +1,31 @@ + + + diff --git a/web/components/shadcn/select/SelectValue.vue b/web/components/shadcn/select/SelectValue.vue new file mode 100644 index 000000000..4bc37dd8b --- /dev/null +++ b/web/components/shadcn/select/SelectValue.vue @@ -0,0 +1,11 @@ + + + diff --git a/web/components/shadcn/select/index.ts b/web/components/shadcn/select/index.ts new file mode 100644 index 000000000..b1d89eedf --- /dev/null +++ b/web/components/shadcn/select/index.ts @@ -0,0 +1,11 @@ +export { default as Select } from './Select.vue' +export { default as SelectValue } from './SelectValue.vue' +export { default as SelectTrigger } from './SelectTrigger.vue' +export { default as SelectContent } from './SelectContent.vue' +export { default as SelectGroup } from './SelectGroup.vue' +export { default as SelectItem } from './SelectItem.vue' +export { default as SelectItemText } from './SelectItemText.vue' +export { default as SelectLabel } from './SelectLabel.vue' +export { default as SelectSeparator } from './SelectSeparator.vue' +export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue' +export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue' diff --git a/web/pages/index.vue b/web/pages/index.vue index 95dd91dec..878f2ab9e 100644 --- a/web/pages/index.vue +++ b/web/pages/index.vue @@ -71,7 +71,7 @@ onMounted(() => {
-
+

ConnectSettingsCe