diff --git a/web/_data/serverState.ts b/web/_data/serverState.ts index bdf827658..c3901b69a 100644 --- a/web/_data/serverState.ts +++ b/web/_data/serverState.ts @@ -58,7 +58,7 @@ export const serverState: Server = { license: '', locale: 'en_US', // en_US, ja name: 'fuji', - osVersion: '6.12.5-rc1', + osVersion: '6.12.3', registered: true, regGen: 0, // "regGuid": "0781-5583-8355-81071A2B0211", diff --git a/web/components/Brand/Button.vue b/web/components/Brand/Button.vue index 128e33772..0d480173d 100644 --- a/web/components/Brand/Button.vue +++ b/web/components/Brand/Button.vue @@ -12,6 +12,7 @@ export interface ButtonProps { external?: boolean; href?: string; icon?: typeof XCircleIcon | typeof BrandLoading | typeof BrandLoadingWhite; + iconRight?: typeof XCircleIcon | typeof BrandLoading | typeof BrandLoadingWhite; text?: string; } const props = withDefaults(defineProps(), { @@ -20,6 +21,7 @@ const props = withDefaults(defineProps(), { click: undefined, href: undefined, icon: undefined, + iconRight: undefined, text: undefined, }); @@ -51,5 +53,6 @@ const classes = computed(() => { > {{ text }} + diff --git a/web/components/UpdateOs.ce.vue b/web/components/UpdateOs.ce.vue new file mode 100644 index 000000000..bfca23aa2 --- /dev/null +++ b/web/components/UpdateOs.ce.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/web/components/UserProfile/DropdownItem.vue b/web/components/UserProfile/DropdownItem.vue index c5363bd2e..9cd31f929 100644 --- a/web/components/UserProfile/DropdownItem.vue +++ b/web/components/UserProfile/DropdownItem.vue @@ -4,7 +4,6 @@ import type { ServerStateDataAction } from '~/types/server'; import type { UserProfileLink } from '~/types/userProfile'; export interface Props { - clickParams?: any; // so we can pass in params to the click handler item: ServerStateDataAction | UserProfileLink; rounded?: boolean; t: any; diff --git a/web/locales/en_US.json b/web/locales/en_US.json index 65736a44b..2b7b1de9c 100644 --- a/web/locales/en_US.json +++ b/web/locales/en_US.json @@ -211,5 +211,7 @@ "Current Version: Unraid {0}": "Current Version: Unraid {0}", "New Version: {0}": "New Version: {0}", "This update will require a reboot": "This update will require a reboot", - "Confirm and start update": "Confirm and start update" + "Confirm and start update": "Confirm and start update", + "Update Unraid OS": "Update Unraid OS", + "Last checked: {0}": "Last checked: {0}" } diff --git a/web/nuxt.config.ts b/web/nuxt.config.ts index 1632f7cd6..45e1531ed 100644 --- a/web/nuxt.config.ts +++ b/web/nuxt.config.ts @@ -96,6 +96,10 @@ export default defineNuxtConfig({ name: 'UnraidUserProfile', path: '@/components/UserProfile.ce', }, + { + name: 'UnraidUpdateOs', + path: '@/components/UpdateOs.ce', + }, { name: 'UnraidWanIpCheck', path: '@/components/WanIpCheck.ce', diff --git a/web/pages/index.vue b/web/pages/index.vue index 4a83873df..63f4e1c0d 100644 --- a/web/pages/index.vue +++ b/web/pages/index.vue @@ -19,27 +19,32 @@ onBeforeMount(() => { UserProfileCe -
+

DownloadApiLogsCe

-
+

AuthCe

-
+

KeyActionsCe

-
+

WanIpCheckCe

-
+
+

+ UpdateOsCe +

+ +

ModalsCe

diff --git a/web/pages/webComponents.vue b/web/pages/webComponents.vue index c2baf12b2..bdb62e81d 100644 --- a/web/pages/webComponents.vue +++ b/web/pages/webComponents.vue @@ -17,27 +17,32 @@ onBeforeMount(() => { UserProfileCe -
+

DownloadApiLogsCe

-
+

AuthCe

-
+

KeyActionsCe

-
+

WanIpCheckCe

-
+
+

+ UpdateOsCe +

+ +

ModalsCe

diff --git a/web/store/updateOs.ts b/web/store/updateOs.ts index 91a13fe0a..caeb96f56 100644 --- a/web/store/updateOs.ts +++ b/web/store/updateOs.ts @@ -69,10 +69,8 @@ export const useUpdateOsStoreGeneric = ( } // getters - const isOsVersionStable = computed(() => { - const hasPrerelease = prerelease(osVersion.value); - return !hasPrerelease; - }); + const cachedReleasesTimestamp = computed(() => releases.value?.timestamp); + const isOsVersionStable = computed(() => !isVersionStable(osVersion.value)); const filteredStableReleases = computed(() => { if (!osVersion.value) return undefined; @@ -186,9 +184,11 @@ export const useUpdateOsStoreGeneric = ( /** * If we're on stable and the user hasn't requested to include next releases in the check - * then remove next releases from the cached data + * then remove next releases from the data */ - if (!payload.includeNext && isOsVersionStable.value && releases.value.response.next) { + console.debug('[checkForUpdate] checking for next releases', payload.includeNext, isOsVersionStable.value, releases.value.response.next) + if (!payload.includeNext || isOsVersionStable.value && releases.value.response.next) { + console.debug('[checkForUpdate] removing next releases from data') delete releases.value.response.next; } @@ -238,11 +238,14 @@ export const useUpdateOsStoreGeneric = ( return releaseForReturn; }; + const isVersionStable = (version: SemVer | string): boolean => prerelease(version) === null; + return { // state available, releases, // getters + cachedReleasesTimestamp, isOsVersionStable, filteredStableReleases, filteredNextReleases, @@ -251,5 +254,6 @@ export const useUpdateOsStoreGeneric = ( checkForUpdate, findReleaseByMd5, requestReleases, + isVersionStable, }; }); diff --git a/web/store/updateOsActions.ts b/web/store/updateOsActions.ts index 2714223c1..ee5844ee5 100644 --- a/web/store/updateOsActions.ts +++ b/web/store/updateOsActions.ts @@ -22,8 +22,9 @@ import { type UpdateOsActionStore, } from '~/store/updateOs'; -import { type InstallPluginPayload } from '~/composables/installPlugin'; +import type { InstallPluginPayload } from '~/composables/installPlugin'; import type { ServerStateDataAction } from '~/types/server'; +import type { UserProfileLink } from '~/types/userProfile'; /** * @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components @@ -47,7 +48,7 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => { const callbackUpdateRelease = ref(null); // Actions - const initUpdateOsCallback = (includeNextReleases: boolean = false) => { + const initUpdateOsCallback = (includeNextReleases: boolean = false): UserProfileLink => { return { click: (includeNext: boolean = includeNextReleases) => { callbackStore.send( diff --git a/web/types/userProfile.ts b/web/types/userProfile.ts index de3c6c364..2acd05000 100644 --- a/web/types/userProfile.ts +++ b/web/types/userProfile.ts @@ -9,7 +9,7 @@ export interface UserProfileLink { icon?: typeof ArrowTopRightOnSquareIcon; name?: string; text: string; - textParams?: string|number[]; + textParams?: string[] | number[]; title?: string; }