From 9fa4911aec72ae7b14eeade2b272f62e1b9a4969 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Fri, 10 Nov 2023 11:45:47 -0800 Subject: [PATCH] feat: list of releases can now be seen at the top (#2480) --- assets/auto-imports.d.ts | 85 ++++++++++-------- assets/components.d.ts | 5 +- assets/components/Links.vue | 63 +++++++++++++ .../LogViewer/LogEventSource.spec.ts | 4 +- assets/components/Popup.vue | 2 +- assets/components/Releases.vue | 74 +++++++++++++++ assets/components/SideMenu.vue | 2 +- assets/components/common/Dropdown.vue | 61 +++++-------- assets/components/common/DropdownMenu.vue | 44 +++++++++ assets/components/common/Links.vue | 49 ---------- assets/components/common/MobileMenu.vue | 4 +- .../containerContext.ts | 0 .../eventsource.ts | 0 assets/{composables => composable}/media.ts | 0 assets/{composables => composable}/popup.ts | 0 assets/{composables => composable}/search.ts | 0 assets/{composables => composable}/storage.ts | 0 assets/{composables => composable}/title.ts | 0 assets/{composables => composable}/toast.ts | 0 assets/{composables => composable}/visible.ts | 0 assets/pages/settings.vue | 53 ++++------- assets/stores/releases.ts | 29 ++++++ go.mod | 2 + go.sum | 6 ++ internal/auth/simple.go | 4 +- internal/auth/users.go | 15 ++-- internal/content/disk.go | 12 +-- internal/profile/settings.go | 12 +-- internal/releases/github.go | 90 +++++++++++++++++++ internal/web/index.go | 2 +- internal/web/profile.go | 2 +- internal/web/releases.go | 24 +++++ internal/web/routes.go | 1 + locales/en.yml | 8 ++ vite.config.ts | 2 +- 35 files changed, 458 insertions(+), 197 deletions(-) create mode 100644 assets/components/Links.vue create mode 100644 assets/components/Releases.vue create mode 100644 assets/components/common/DropdownMenu.vue delete mode 100644 assets/components/common/Links.vue rename assets/{composables => composable}/containerContext.ts (100%) rename assets/{composables => composable}/eventsource.ts (100%) rename assets/{composables => composable}/media.ts (100%) rename assets/{composables => composable}/popup.ts (100%) rename assets/{composables => composable}/search.ts (100%) rename assets/{composables => composable}/storage.ts (100%) rename assets/{composables => composable}/title.ts (100%) rename assets/{composables => composable}/toast.ts (100%) rename assets/{composables => composable}/visible.ts (100%) create mode 100644 assets/stores/releases.ts create mode 100644 internal/releases/github.go create mode 100644 internal/web/releases.go diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index 8df58545..b4bf0999 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -26,7 +26,7 @@ declare global { const computedInject: typeof import('@vueuse/core')['computedInject'] const computedWithControl: typeof import('@vueuse/core')['computedWithControl'] const config: typeof import('./stores/config')['default'] - const containerContext: typeof import('./composables/containerContext')['containerContext'] + const containerContext: typeof import('./composable/containerContext')['containerContext'] const controlledComputed: typeof import('@vueuse/core')['controlledComputed'] const controlledRef: typeof import('@vueuse/core')['controlledRef'] const createApp: typeof import('vue')['createApp'] @@ -56,14 +56,14 @@ declare global { const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] const getDeep: typeof import('./utils/index')['getDeep'] - const globalShowPopup: typeof import('./composables/popup')['globalShowPopup'] + const globalShowPopup: typeof import('./composable/popup')['globalShowPopup'] const h: typeof import('vue')['h'] const hourStyle: typeof import('./stores/settings')['hourStyle'] const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch'] const inject: typeof import('vue')['inject'] const injectLocal: typeof import('@vueuse/core')['injectLocal'] const isDefined: typeof import('@vueuse/core')['isDefined'] - const isMobile: typeof import('./composables/media')['isMobile'] + const isMobile: typeof import('./composable/media')['isMobile'] const isObject: typeof import('./utils/index')['isObject'] const isProxy: typeof import('vue')['isProxy'] const isReactive: typeof import('vue')['isReactive'] @@ -102,10 +102,10 @@ declare global { const onUnmounted: typeof import('vue')['onUnmounted'] const onUpdated: typeof import('vue')['onUpdated'] const pausableWatch: typeof import('@vueuse/core')['pausableWatch'] - const persistentVisibleKeys: typeof import('./composables/storage')['persistentVisibleKeys'] - const pinnedContainers: typeof import('./composables/storage')['pinnedContainers'] + const persistentVisibleKeys: typeof import('./composable/storage')['persistentVisibleKeys'] + const pinnedContainers: typeof import('./composable/storage')['pinnedContainers'] const provide: typeof import('vue')['provide'] - const provideContainerContext: typeof import('./composables/containerContext')['provideContainerContext'] + const provideContainerContext: typeof import('./composable/containerContext')['provideContainerContext'] const provideLocal: typeof import('@vueuse/core')['provideLocal'] const reactify: typeof import('@vueuse/core')['reactify'] const reactifyObject: typeof import('@vueuse/core')['reactifyObject'] @@ -120,14 +120,15 @@ declare global { const refDefault: typeof import('@vueuse/core')['refDefault'] const refThrottled: typeof import('@vueuse/core')['refThrottled'] const refWithControl: typeof import('@vueuse/core')['refWithControl'] + const releases: typeof import('./stores/releases')['default'] const resolveComponent: typeof import('vue')['resolveComponent'] const resolveRef: typeof import('@vueuse/core')['resolveRef'] const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] const search: typeof import('./stores/settings')['search'] - const sessionHost: typeof import('./composables/storage')['sessionHost'] + const sessionHost: typeof import('./composable/storage')['sessionHost'] const setActivePinia: typeof import('pinia')['setActivePinia'] const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] - const setTitle: typeof import('./composables/title')['setTitle'] + const setTitle: typeof import('./composable/title')['setTitle'] const settings: typeof import('./stores/settings')['settings'] const shallowReactive: typeof import('vue')['shallowReactive'] const shallowReadonly: typeof import('vue')['shallowReadonly'] @@ -188,10 +189,11 @@ declare global { const useCeil: typeof import('@vueuse/math')['useCeil'] const useClamp: typeof import('@vueuse/math')['useClamp'] const useClipboard: typeof import('@vueuse/core')['useClipboard'] + const useClipboardItems: typeof import('@vueuse/core')['useClipboardItems'] const useCloned: typeof import('@vueuse/core')['useCloned'] const useColorMode: typeof import('@vueuse/core')['useColorMode'] const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog'] - const useContainerContext: typeof import('./composables/containerContext')['useContainerContext'] + const useContainerContext: typeof import('./composable/containerContext')['useContainerContext'] const useContainerStore: typeof import('./stores/container')['useContainerStore'] const useCounter: typeof import('@vueuse/core')['useCounter'] const useCssModule: typeof import('vue')['useCssModule'] @@ -245,7 +247,7 @@ declare global { const useLastChanged: typeof import('@vueuse/core')['useLastChanged'] const useLink: typeof import('vue-router')['useLink'] const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage'] - const useLogStream: typeof import('./composables/eventsource')['useLogStream'] + const useLogStream: typeof import('./composable/eventsource')['useLogStream'] const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys'] const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory'] const useMath: typeof import('@vueuse/math')['useMath'] @@ -284,6 +286,7 @@ declare global { const useProjection: typeof import('@vueuse/math')['useProjection'] const useRafFn: typeof import('@vueuse/core')['useRafFn'] const useRefHistory: typeof import('@vueuse/core')['useRefHistory'] + const useReleases: typeof import('./stores/releases')['useReleases'] const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver'] const useRound: typeof import('@vueuse/math')['useRound'] const useRoute: typeof import('vue-router')['useRoute'] @@ -293,7 +296,7 @@ declare global { const useScriptTag: typeof import('@vueuse/core')['useScriptTag'] const useScroll: typeof import('@vueuse/core')['useScroll'] const useScrollLock: typeof import('@vueuse/core')['useScrollLock'] - const useSearchFilter: typeof import('./composables/search')['useSearchFilter'] + const useSearchFilter: typeof import('./composable/search')['useSearchFilter'] const useSeoMeta: typeof import('@vueuse/head')['useSeoMeta'] const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage'] const useShare: typeof import('@vueuse/core')['useShare'] @@ -323,7 +326,7 @@ declare global { const useTitle: typeof import('@vueuse/core')['useTitle'] const useToNumber: typeof import('@vueuse/core')['useToNumber'] const useToString: typeof import('@vueuse/core')['useToString'] - const useToast: typeof import('./composables/toast')['useToast'] + const useToast: typeof import('./composable/toast')['useToast'] const useToggle: typeof import('@vueuse/core')['useToggle'] const useTransition: typeof import('@vueuse/core')['useTransition'] const useTrunc: typeof import('@vueuse/math')['useTrunc'] @@ -333,7 +336,7 @@ declare global { const useVModels: typeof import('@vueuse/core')['useVModels'] const useVibrate: typeof import('@vueuse/core')['useVibrate'] const useVirtualList: typeof import('@vueuse/core')['useVirtualList'] - const useVisibleFilter: typeof import('./composables/visible')['useVisibleFilter'] + const useVisibleFilter: typeof import('./composable/visible')['useVisibleFilter'] const useWakeLock: typeof import('@vueuse/core')['useWakeLock'] const useWebNotification: typeof import('@vueuse/core')['useWebNotification'] const useWebSocket: typeof import('@vueuse/core')['useWebSocket'] @@ -390,7 +393,7 @@ declare module 'vue' { readonly computedInject: UnwrapRef readonly computedWithControl: UnwrapRef readonly config: UnwrapRef - readonly containerContext: UnwrapRef + readonly containerContext: UnwrapRef readonly controlledComputed: UnwrapRef readonly controlledRef: UnwrapRef readonly createApp: UnwrapRef @@ -418,14 +421,14 @@ declare module 'vue' { readonly getCurrentInstance: UnwrapRef readonly getCurrentScope: UnwrapRef readonly getDeep: UnwrapRef - readonly globalShowPopup: UnwrapRef + readonly globalShowPopup: UnwrapRef readonly h: UnwrapRef readonly hourStyle: UnwrapRef readonly ignorableWatch: UnwrapRef readonly inject: UnwrapRef readonly injectLocal: UnwrapRef readonly isDefined: UnwrapRef - readonly isMobile: UnwrapRef + readonly isMobile: UnwrapRef readonly isObject: UnwrapRef readonly isProxy: UnwrapRef readonly isReactive: UnwrapRef @@ -461,10 +464,10 @@ declare module 'vue' { readonly onUnmounted: UnwrapRef readonly onUpdated: UnwrapRef readonly pausableWatch: UnwrapRef - readonly persistentVisibleKeys: UnwrapRef - readonly pinnedContainers: UnwrapRef + readonly persistentVisibleKeys: UnwrapRef + readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef - readonly provideContainerContext: UnwrapRef + readonly provideContainerContext: UnwrapRef readonly provideLocal: UnwrapRef readonly reactify: UnwrapRef readonly reactifyObject: UnwrapRef @@ -483,10 +486,10 @@ declare module 'vue' { readonly resolveRef: UnwrapRef readonly resolveUnref: UnwrapRef readonly search: UnwrapRef - readonly sessionHost: UnwrapRef + readonly sessionHost: UnwrapRef readonly setActivePinia: UnwrapRef readonly setMapStoreSuffix: UnwrapRef - readonly setTitle: UnwrapRef + readonly setTitle: UnwrapRef readonly settings: UnwrapRef readonly shallowReactive: UnwrapRef readonly shallowReadonly: UnwrapRef @@ -543,10 +546,11 @@ declare module 'vue' { readonly useBrowserLocation: UnwrapRef readonly useCached: UnwrapRef readonly useClipboard: UnwrapRef + readonly useClipboardItems: UnwrapRef readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef - readonly useContainerContext: UnwrapRef + readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef readonly useCssModule: UnwrapRef @@ -599,7 +603,7 @@ declare module 'vue' { readonly useLastChanged: UnwrapRef readonly useLink: UnwrapRef readonly useLocalStorage: UnwrapRef - readonly useLogStream: UnwrapRef + readonly useLogStream: UnwrapRef readonly useMagicKeys: UnwrapRef readonly useManualRefHistory: UnwrapRef readonly useMediaControls: UnwrapRef @@ -633,6 +637,7 @@ declare module 'vue' { readonly usePrevious: UnwrapRef readonly useRafFn: UnwrapRef readonly useRefHistory: UnwrapRef + readonly useReleases: UnwrapRef readonly useResizeObserver: UnwrapRef readonly useRoute: UnwrapRef readonly useRouter: UnwrapRef @@ -641,7 +646,7 @@ declare module 'vue' { readonly useScriptTag: UnwrapRef readonly useScroll: UnwrapRef readonly useScrollLock: UnwrapRef - readonly useSearchFilter: UnwrapRef + readonly useSearchFilter: UnwrapRef readonly useSeoMeta: UnwrapRef readonly useSessionStorage: UnwrapRef readonly useShare: UnwrapRef @@ -670,7 +675,7 @@ declare module 'vue' { readonly useTitle: UnwrapRef readonly useToNumber: UnwrapRef readonly useToString: UnwrapRef - readonly useToast: UnwrapRef + readonly useToast: UnwrapRef readonly useToggle: UnwrapRef readonly useTransition: UnwrapRef readonly useUrlSearchParams: UnwrapRef @@ -679,7 +684,7 @@ declare module 'vue' { readonly useVModels: UnwrapRef readonly useVibrate: UnwrapRef readonly useVirtualList: UnwrapRef - readonly useVisibleFilter: UnwrapRef + readonly useVisibleFilter: UnwrapRef readonly useWakeLock: UnwrapRef readonly useWebNotification: UnwrapRef readonly useWebSocket: UnwrapRef @@ -730,7 +735,7 @@ declare module '@vue/runtime-core' { readonly computedInject: UnwrapRef readonly computedWithControl: UnwrapRef readonly config: UnwrapRef - readonly containerContext: UnwrapRef + readonly containerContext: UnwrapRef readonly controlledComputed: UnwrapRef readonly controlledRef: UnwrapRef readonly createApp: UnwrapRef @@ -758,14 +763,14 @@ declare module '@vue/runtime-core' { readonly getCurrentInstance: UnwrapRef readonly getCurrentScope: UnwrapRef readonly getDeep: UnwrapRef - readonly globalShowPopup: UnwrapRef + readonly globalShowPopup: UnwrapRef readonly h: UnwrapRef readonly hourStyle: UnwrapRef readonly ignorableWatch: UnwrapRef readonly inject: UnwrapRef readonly injectLocal: UnwrapRef readonly isDefined: UnwrapRef - readonly isMobile: UnwrapRef + readonly isMobile: UnwrapRef readonly isObject: UnwrapRef readonly isProxy: UnwrapRef readonly isReactive: UnwrapRef @@ -801,10 +806,10 @@ declare module '@vue/runtime-core' { readonly onUnmounted: UnwrapRef readonly onUpdated: UnwrapRef readonly pausableWatch: UnwrapRef - readonly persistentVisibleKeys: UnwrapRef - readonly pinnedContainers: UnwrapRef + readonly persistentVisibleKeys: UnwrapRef + readonly pinnedContainers: UnwrapRef readonly provide: UnwrapRef - readonly provideContainerContext: UnwrapRef + readonly provideContainerContext: UnwrapRef readonly provideLocal: UnwrapRef readonly reactify: UnwrapRef readonly reactifyObject: UnwrapRef @@ -823,10 +828,10 @@ declare module '@vue/runtime-core' { readonly resolveRef: UnwrapRef readonly resolveUnref: UnwrapRef readonly search: UnwrapRef - readonly sessionHost: UnwrapRef + readonly sessionHost: UnwrapRef readonly setActivePinia: UnwrapRef readonly setMapStoreSuffix: UnwrapRef - readonly setTitle: UnwrapRef + readonly setTitle: UnwrapRef readonly settings: UnwrapRef readonly shallowReactive: UnwrapRef readonly shallowReadonly: UnwrapRef @@ -883,10 +888,11 @@ declare module '@vue/runtime-core' { readonly useBrowserLocation: UnwrapRef readonly useCached: UnwrapRef readonly useClipboard: UnwrapRef + readonly useClipboardItems: UnwrapRef readonly useCloned: UnwrapRef readonly useColorMode: UnwrapRef readonly useConfirmDialog: UnwrapRef - readonly useContainerContext: UnwrapRef + readonly useContainerContext: UnwrapRef readonly useContainerStore: UnwrapRef readonly useCounter: UnwrapRef readonly useCssModule: UnwrapRef @@ -939,7 +945,7 @@ declare module '@vue/runtime-core' { readonly useLastChanged: UnwrapRef readonly useLink: UnwrapRef readonly useLocalStorage: UnwrapRef - readonly useLogStream: UnwrapRef + readonly useLogStream: UnwrapRef readonly useMagicKeys: UnwrapRef readonly useManualRefHistory: UnwrapRef readonly useMediaControls: UnwrapRef @@ -973,6 +979,7 @@ declare module '@vue/runtime-core' { readonly usePrevious: UnwrapRef readonly useRafFn: UnwrapRef readonly useRefHistory: UnwrapRef + readonly useReleases: UnwrapRef readonly useResizeObserver: UnwrapRef readonly useRoute: UnwrapRef readonly useRouter: UnwrapRef @@ -981,7 +988,7 @@ declare module '@vue/runtime-core' { readonly useScriptTag: UnwrapRef readonly useScroll: UnwrapRef readonly useScrollLock: UnwrapRef - readonly useSearchFilter: UnwrapRef + readonly useSearchFilter: UnwrapRef readonly useSeoMeta: UnwrapRef readonly useSessionStorage: UnwrapRef readonly useShare: UnwrapRef @@ -1010,7 +1017,7 @@ declare module '@vue/runtime-core' { readonly useTitle: UnwrapRef readonly useToNumber: UnwrapRef readonly useToString: UnwrapRef - readonly useToast: UnwrapRef + readonly useToast: UnwrapRef readonly useToggle: UnwrapRef readonly useTransition: UnwrapRef readonly useUrlSearchParams: UnwrapRef @@ -1019,7 +1026,7 @@ declare module '@vue/runtime-core' { readonly useVModels: UnwrapRef readonly useVibrate: UnwrapRef readonly useVirtualList: UnwrapRef - readonly useVisibleFilter: UnwrapRef + readonly useVisibleFilter: UnwrapRef readonly useWakeLock: UnwrapRef readonly useWebNotification: UnwrapRef readonly useWebSocket: UnwrapRef diff --git a/assets/components.d.ts b/assets/components.d.ts index e4f0ac8a..e59f629b 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -29,13 +29,14 @@ declare module 'vue' { DistanceTime: typeof import('./components/common/DistanceTime.vue')['default'] DockerEventLogItem: typeof import('./components/LogViewer/DockerEventLogItem.vue')['default'] Dropdown: typeof import('./components/common/Dropdown.vue')['default'] + DropdownMenu: typeof import('./components/common/DropdownMenu.vue')['default'] FieldList: typeof import('./components/LogViewer/FieldList.vue')['default'] FuzzySearchModal: typeof import('./components/FuzzySearchModal.vue')['default'] 'Ic:sharpFindInPage': typeof import('~icons/ic/sharp-find-in-page')['default'] 'Ic:sharpKeyboardReturn': typeof import('~icons/ic/sharp-keyboard-return')['default'] InfiniteLoader: typeof import('./components/InfiniteLoader.vue')['default'] KeyShortcut: typeof import('./components/common/KeyShortcut.vue')['default'] - Links: typeof import('./components/common/Links.vue')['default'] + Links: typeof import('./components/Links.vue')['default'] LogActionsToolbar: typeof import('./components/LogViewer/LogActionsToolbar.vue')['default'] LogContainer: typeof import('./components/LogViewer/LogContainer.vue')['default'] LogDate: typeof import('./components/LogViewer/LogDate.vue')['default'] @@ -44,6 +45,7 @@ declare module 'vue' { LogStd: typeof import('./components/LogViewer/LogStd.vue')['default'] LogViewer: typeof import('./components/LogViewer/LogViewer.vue')['default'] LogViewerWithSource: typeof import('./components/LogViewer/LogViewerWithSource.vue')['default'] + 'Mdi:announcement': typeof import('~icons/mdi/announcement')['default'] 'Mdi:arrowUp': typeof import('~icons/mdi/arrow-up')['default'] 'Mdi:check': typeof import('~icons/mdi/check')['default'] 'Mdi:chevronDoubleDown': typeof import('~icons/mdi/chevron-double-down')['default'] @@ -64,6 +66,7 @@ declare module 'vue' { 'Ph:computerTower': typeof import('~icons/ph/computer-tower')['default'] 'Ph:controlBold': typeof import('~icons/ph/control-bold')['default'] Popup: typeof import('./components/Popup.vue')['default'] + Releases: typeof import('./components/Releases.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] ScrollableView: typeof import('./components/ScrollableView.vue')['default'] diff --git a/assets/components/Links.vue b/assets/components/Links.vue new file mode 100644 index 00000000..963bf565 --- /dev/null +++ b/assets/components/Links.vue @@ -0,0 +1,63 @@ + + diff --git a/assets/components/LogViewer/LogEventSource.spec.ts b/assets/components/LogViewer/LogEventSource.spec.ts index 58f6c65c..13aad530 100644 --- a/assets/components/LogViewer/LogEventSource.spec.ts +++ b/assets/components/LogViewer/LogEventSource.spec.ts @@ -5,11 +5,11 @@ import EventSource, { sources } from "eventsourcemock"; import LogEventSource from "./LogEventSource.vue"; import LogViewer from "./LogViewer.vue"; import { settings } from "@/stores/settings"; -import { useSearchFilter } from "@/composables/search"; +import { useSearchFilter } from "@/composable/search"; import { vi, describe, expect, beforeEach, test, afterEach } from "vitest"; import { computed, nextTick } from "vue"; import { createRouter, createWebHistory } from "vue-router"; -import { containerContext } from "@/composables/containerContext"; +import { containerContext } from "@/composable/containerContext"; vi.mock("@/stores/config", () => ({ __esModule: true, diff --git a/assets/components/Popup.vue b/assets/components/Popup.vue index 91d257fc..1af0ef8b 100644 --- a/assets/components/Popup.vue +++ b/assets/components/Popup.vue @@ -14,7 +14,7 @@ + + diff --git a/assets/components/SideMenu.vue b/assets/components/SideMenu.vue index 66697187..b568ac39 100644 --- a/assets/components/SideMenu.vue +++ b/assets/components/SideMenu.vue @@ -63,7 +63,7 @@ + + diff --git a/assets/components/common/DropdownMenu.vue b/assets/components/common/DropdownMenu.vue new file mode 100644 index 00000000..69700c0a --- /dev/null +++ b/assets/components/common/DropdownMenu.vue @@ -0,0 +1,44 @@ + + + diff --git a/assets/components/common/Links.vue b/assets/components/common/Links.vue deleted file mode 100644 index 390cea74..00000000 --- a/assets/components/common/Links.vue +++ /dev/null @@ -1,49 +0,0 @@ - - diff --git a/assets/components/common/MobileMenu.vue b/assets/components/common/MobileMenu.vue index 57ffff2f..29af6667 100644 --- a/assets/components/common/MobileMenu.vue +++ b/assets/components/common/MobileMenu.vue @@ -22,7 +22,7 @@
- const { base, secured } = config; -import { sessionHost } from "@/composables/storage"; +import { sessionHost } from "@/composable/storage"; const store = useContainerStore(); const route = useRoute(); const { visibleContainers } = storeToRefs(store); diff --git a/assets/composables/containerContext.ts b/assets/composable/containerContext.ts similarity index 100% rename from assets/composables/containerContext.ts rename to assets/composable/containerContext.ts diff --git a/assets/composables/eventsource.ts b/assets/composable/eventsource.ts similarity index 100% rename from assets/composables/eventsource.ts rename to assets/composable/eventsource.ts diff --git a/assets/composables/media.ts b/assets/composable/media.ts similarity index 100% rename from assets/composables/media.ts rename to assets/composable/media.ts diff --git a/assets/composables/popup.ts b/assets/composable/popup.ts similarity index 100% rename from assets/composables/popup.ts rename to assets/composable/popup.ts diff --git a/assets/composables/search.ts b/assets/composable/search.ts similarity index 100% rename from assets/composables/search.ts rename to assets/composable/search.ts diff --git a/assets/composables/storage.ts b/assets/composable/storage.ts similarity index 100% rename from assets/composables/storage.ts rename to assets/composable/storage.ts diff --git a/assets/composables/title.ts b/assets/composable/title.ts similarity index 100% rename from assets/composables/title.ts rename to assets/composable/title.ts diff --git a/assets/composables/toast.ts b/assets/composable/toast.ts similarity index 100% rename from assets/composables/toast.ts rename to assets/composable/toast.ts diff --git a/assets/composables/visible.ts b/assets/composable/visible.ts similarity index 100% rename from assets/composables/visible.ts rename to assets/composable/visible.ts diff --git a/assets/pages/settings.vue b/assets/pages/settings.vue index 8b2d2f95..7cd70179 100644 --- a/assets/pages/settings.vue +++ b/assets/pages/settings.vue @@ -6,10 +6,10 @@
- +
@@ -34,7 +34,7 @@
-
-
- import { - search, - lightTheme, - smallerScrollbars, - showTimestamp, - showStd, - hourStyle, - showAllContainers, - size, - softWrap, automaticRedirect, + hourStyle, + lightTheme, + search, + showAllContainers, + showStd, + showTimestamp, + size, + smallerScrollbars, + softWrap, } from "@/stores/settings"; const { t } = useI18n(); setTitle(t("title.settings")); - -const currentVersion = config.version; -let nextRelease = $ref({ html_url: "", name: "" }); -let hasUpdate = $ref(false); - -async function fetchNextRelease() { - if (!["dev", "master"].includes(currentVersion)) { - const response = await fetch("https://api.github.com/repos/amir20/dozzle/releases/latest"); - if (response.ok) { - const release = await response.json(); - hasUpdate = - release.tag_name.slice(1).localeCompare(currentVersion, undefined, { numeric: true, sensitivity: "base" }) > 0; - nextRelease = release; - } - } else { - hasUpdate = true; - nextRelease = { - html_url: "", - name: "master", - }; - } -} - -fetchNextRelease(); +const { latest, hasUpdate } = useReleases();