chore: lint auto fixes

This commit is contained in:
Zack Spear
2023-10-30 11:45:41 -07:00
committed by Zack Spear
parent ca93ac7143
commit caab570be6
38 changed files with 362 additions and 304 deletions

View File

@@ -1,140 +1,140 @@
import type { OsReleasesResponse } from '@/stores/callback';
const testOsReleasesResponse: OsReleasesResponse = {
"next": [
next: [
{
"version": "7.0.0-beta2",
"name": "Unraid Server 7.0.0-beta2",
"basefile": "unRAIDServer-7.0.0-beta2-x86_64.zip",
"date": "2023-11-03",
"url": "https://dl.next.unraid.net/unRAIDServer-7.0.0-beta2-x86_64.zip",
"changelog": "",
"md5": "FAKEbddcf415f2d0518804e551c1beXXX",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.next.unraid.net/unRAIDServer-7.0.0-beta2.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '7.0.0-beta2',
name: 'Unraid Server 7.0.0-beta2',
basefile: 'unRAIDServer-7.0.0-beta2-x86_64.zip',
date: '2023-11-03',
url: 'https://dl.next.unraid.net/unRAIDServer-7.0.0-beta2-x86_64.zip',
changelog: '',
md5: 'FAKEbddcf415f2d0518804e551c1beXXX',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.next.unraid.net/unRAIDServer-7.0.0-beta2.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "7.0.0-beta1",
"name": "Unraid Server 7.0.0-beta1",
"basefile": "unRAIDServer-7.0.0-beta1-x86_64.zip",
"date": "2023-10-02",
"url": "https://dl.next.unraid.net/unRAIDServer-7.0.0-beta1-x86_64.zip",
"changelog": "",
"md5": "FAKEbddcf415f2d0518804e551c1beYYY",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.next.unraid.net/unRAIDServer-7.0.0-beta1.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '7.0.0-beta1',
name: 'Unraid Server 7.0.0-beta1',
basefile: 'unRAIDServer-7.0.0-beta1-x86_64.zip',
date: '2023-10-02',
url: 'https://dl.next.unraid.net/unRAIDServer-7.0.0-beta1-x86_64.zip',
changelog: '',
md5: 'FAKEbddcf415f2d0518804e551c1beYYY',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.next.unraid.net/unRAIDServer-7.0.0-beta1.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.12.2-rc2",
"name": "Unraid Server 6.12.2-rc2",
"basefile": "unRAIDServer-6.12.2-rc2-x86_64.zip",
"date": "2023-06-15",
"url": "https://dl.next.unraid.net/unRAIDServer-6.12.2-rc2-x86_64.zip",
"changelog": "",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.next.unraid.net/unRAIDServer-6.12.2-rc2.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.2-rc2',
name: 'Unraid Server 6.12.2-rc2',
basefile: 'unRAIDServer-6.12.2-rc2-x86_64.zip',
date: '2023-06-15',
url: 'https://dl.next.unraid.net/unRAIDServer-6.12.2-rc2-x86_64.zip',
changelog: '',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.next.unraid.net/unRAIDServer-6.12.2-rc2.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
}
],
"stable": [
stable: [
{
"version": "6.12.5",
"name": "Unraid Server 6.12.5",
"basefile": "unRAIDServer-6.12.5-x86_64.zip",
"date": "2023-08-31",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.12.5-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.12.5-release-notes",
"md5": "FAKEbddcf415f2d0518804e551c16125",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.12.5.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.5',
name: 'Unraid Server 6.12.5',
basefile: 'unRAIDServer-6.12.5-x86_64.zip',
date: '2023-08-31',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.5-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.12.5-release-notes',
md5: 'FAKEbddcf415f2d0518804e551c16125',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.5.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.12.4",
"name": "Unraid Server 6.12.4",
"basefile": "unRAIDServer-6.12.4-x86_64.zip",
"date": "2023-08-31",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.12.4-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.12.4-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.12.4.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.4',
name: 'Unraid Server 6.12.4',
basefile: 'unRAIDServer-6.12.4-x86_64.zip',
date: '2023-08-31',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.4-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.12.4-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.4.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.12.3",
"name": "Unraid Server 6.12.3",
"basefile": "unRAIDServer-6.12.3-x86_64.zip",
"date": "2023-07-31",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.12.3-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.12.3-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.12.3.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.3',
name: 'Unraid Server 6.12.3',
basefile: 'unRAIDServer-6.12.3-x86_64.zip',
date: '2023-07-31',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.3-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.12.3-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.3.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.12.2",
"name": "Unraid Server 6.12.2",
"basefile": "unRAIDServer-6.12.2-x86_64.zip",
"date": "2023-06-30",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.12.2-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.12.2-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.12.2.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.2',
name: 'Unraid Server 6.12.2',
basefile: 'unRAIDServer-6.12.2-x86_64.zip',
date: '2023-06-30',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.2-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.12.2-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.2.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.12.1",
"name": "Unraid Server 6.12.1",
"basefile": "unRAIDServer-6.12.1-x86_64.zip",
"date": "2023-06-08",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.12.1-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.12.1-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.12.1.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.12.1',
name: 'Unraid Server 6.12.1',
basefile: 'unRAIDServer-6.12.1-x86_64.zip',
date: '2023-06-08',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.1-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.12.1-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.12.1.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.10.1",
"name": "Unraid Server 6.10.1",
"basefile": "unRAIDServer-6.10.1-x86_64.zip",
"date": "2020-04-15",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.10.1-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.10.1-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.10.1.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.10.1',
name: 'Unraid Server 6.10.1',
basefile: 'unRAIDServer-6.10.1-x86_64.zip',
date: '2020-04-15',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.10.1-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.10.1-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.10.1.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
},
{
"version": "6.9.0",
"name": "Unraid Server 6.9.0",
"basefile": "unRAIDServer-6.9.0-x86_64.zip",
"date": "2019-10-31",
"url": "https://dl.stable.unraid.net/unRAIDServer-6.9.0-x86_64.zip",
"changelog": "https://unraid.net/blog/unraid-os-6.9.0-release-notes",
"md5": "9050bddcf415f2d0518804e551c1be98",
"size": 12345122,
"sha256": "fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4",
"plugin_url": "https://dl.stable.unraid.net/unRAIDServer-6.9.0.plg",
"plugin_sha256": "83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9"
version: '6.9.0',
name: 'Unraid Server 6.9.0',
basefile: 'unRAIDServer-6.9.0-x86_64.zip',
date: '2019-10-31',
url: 'https://dl.stable.unraid.net/unRAIDServer-6.9.0-x86_64.zip',
changelog: 'https://unraid.net/blog/unraid-os-6.9.0-release-notes',
md5: '9050bddcf415f2d0518804e551c1be98',
size: 12345122,
sha256: 'fda177bb1336270b24e4df0fd0c1dd0596c44699204f57c83ce70a0f19173be4',
plugin_url: 'https://dl.stable.unraid.net/unRAIDServer-6.9.0.plg',
plugin_sha256: '83850536ed6982bd582ed107d977d59e9b9b786363e698b14d1daf52e2dec2d9'
}
]
};
export default testOsReleasesResponse;
export default testOsReleasesResponse;

View File

@@ -58,8 +58,8 @@ switch (state) {
case 'UNLEASHED':
// @ts-ignore
case 'LIFETIME':
if (regDev === 0) regDev = 99999;
if (regTy === '') regTy = state.charAt(0).toUpperCase() + state.substring(1).toLowerCase(); // title case
if (regDev === 0) { regDev = 99999; }
if (regTy === '') { regTy = state.charAt(0).toUpperCase() + state.substring(1).toLowerCase(); } // title case
break;
}
@@ -72,7 +72,7 @@ let expireTime = 0;
if (state === 'TRIAL') { expireTime = oneHourFromNow; } // in 1 hour
else if (state === 'EEXPIRED') { expireTime = uptime; } // 1 hour ago
let regExp: number | undefined = undefined;
let regExp: number | undefined;
if (state === 'STARTER' || state === 'UNLEASHED') {
// regExp = oneHourFromNow;
regExp = oneDayFromNow;
@@ -95,7 +95,7 @@ export const serverState: Server = {
description: 'DevServer9000',
deviceCount: 3,
expireTime,
flashBackupActivated: connectPluginInstalled ? true : false,
flashBackupActivated: !!connectPluginInstalled,
flashProduct: 'SanDisk_3.2Gen1',
flashVendor: 'USB',
guid: randomGuid,
@@ -109,7 +109,7 @@ export const serverState: Server = {
name: 'dev-static',
osVersion: '6.12.4',
// registered: connectPluginInstalled ? true : false,
registered: connectPluginInstalled ? false : true,
registered: !connectPluginInstalled,
regGen: 0,
regTm: twoDaysAgo,
regTo: 'Zack Spear',

View File

@@ -113,26 +113,31 @@ const classes = computed(() => {
:class="classes.button"
@click="click ?? $emit('click')"
>
<div v-if="btnStyle === 'fill'"
class="absolute -top-[2px] -right-[2px] -bottom-[2px] -left-[2px] -z-10 bg-gradient-to-r from-unraid-red to-orange opacity-100 transition-all rounded-md group-hover:opacity-60 group-focus:opacity-60" />
<div v-if="btnStyle === 'outline'"
class="absolute -top-[2px] -right-[2px] -bottom-[2px] -left-[2px] -z-10 bg-gradient-to-r from-unraid-red to-orange opacity-0 transition-all rounded-md group-hover:opacity-100 group-focus:opacity-100" />
<div
v-if="btnStyle === 'fill'"
class="absolute -top-[2px] -right-[2px] -bottom-[2px] -left-[2px] -z-10 bg-gradient-to-r from-unraid-red to-orange opacity-100 transition-all rounded-md group-hover:opacity-60 group-focus:opacity-60"
/>
<div
v-if="btnStyle === 'outline'"
class="absolute -top-[2px] -right-[2px] -bottom-[2px] -left-[2px] -z-10 bg-gradient-to-r from-unraid-red to-orange opacity-0 transition-all rounded-md group-hover:opacity-100 group-focus:opacity-100"
/>
<component
v-if="icon"
:is="icon"
:class="classes.icon" />
v-if="icon"
:class="classes.icon"
/>
{{ text }}
<slot></slot>
<slot />
<component
v-if="iconRight"
:is="iconRight"
v-if="iconRight"
:class="[
classes.icon,
iconRightHoverDisplay && 'opacity-0 group-hover:opacity-100 group-focus:opacity-100 transition-all',
]" />
]"
/>
</component>
</template>

View File

@@ -46,10 +46,12 @@ const { rebootType } = storeToRefs(updateOsActionsStore);
v-if="restoreVersion && rebootType === ''"
:release-date="restoreReleaseDate"
:version="restoreVersion"
:t="t" />
:t="t"
/>
<UpdateOsThirdPartyDrivers
v-if="rebootType === 'thirdPartyDriversDownloading'"
:t="t" />
:t="t"
/>
</UiPageContainer>
</template>

View File

@@ -31,9 +31,9 @@ const showRebootRequired = computed(() => rebootType.value !== '');
<template>
<div class="flex flex-row justify-start gap-x-4px">
<button
@click="updateOsActionsStore.viewCurrentReleaseNotes(t('{0} Release Notes', [osVersion]))"
class="group leading-none"
:title="t('View release notes')"
@click="updateOsActionsStore.viewCurrentReleaseNotes(t('{0} Release Notes', [osVersion]))"
>
<UiBadge
color="custom"

View File

@@ -50,4 +50,4 @@ provide(I18nInjectionKey, i18n);
/* unraid-i18n-host {
font-size: 16px;
} */
</style>
</style>

View File

@@ -22,7 +22,7 @@ const { keyActions } = storeToRefs(useServerStore());
const computedActions = computed((): ServerStateDataAction[] | undefined => props.actions ? props.actions : keyActions.value);
const filteredKeyActions = computed((): ServerStateDataAction[] | undefined => {
if (!computedActions.value || (!props.filterOut && !props.filterBy)) return computedActions.value;
if (!computedActions.value || (!props.filterOut && !props.filterBy)) { return computedActions.value; }
return computedActions.value.filter((action: { name: string; }) => {
return props.filterOut

View File

@@ -21,7 +21,7 @@ import {
ShieldCheckIcon,
ShieldExclamationIcon,
} from '@heroicons/vue/24/solid';
import dayjs from 'dayjs'
import dayjs from 'dayjs';
import { storeToRefs } from 'pinia';
import { useI18n } from 'vue-i18n';
@@ -59,7 +59,7 @@ const {
const { outputDateTimeFormatted: formattedRegTm } = useDateTimeHelper(dateTimeFormat.value, t, false, regTm.value);
const devicesAvailable = computed((): number => {
switch(regTy.value) {
switch (regTy.value) {
case 'Starter':
return 4;
case 'Basic':
@@ -78,30 +78,39 @@ const devicesAvailable = computed((): number => {
const items = computed((): RegistrationItemProps[] => {
return [
...(regTy.value ? [{
label: t('License key type'),
text: regTy.value,
}] : []),
...(state.value === 'TRIAL' || state.value === 'EEXPIRED' ? [{
error: state.value === 'EEXPIRED',
label: t('Trial expiration'),
component: UserProfileUptimeExpire,
componentProps: {
forExpire: true,
shortText: true,
t: t,
},
componentOpacity: true,
}] : []),
...(regTo.value ? [{
label: t('Registered to'),
text: regTo.value,
}] : []),
...(regTo.value && regTm.value ? [{
label: t('Registered on'),
text: formattedRegTm.value,
}] : []),
...(regExp.value && (state.value === 'STARTER' || state.value === 'UNLEASHED') ? [{
...(regTy.value
? [{
label: t('License key type'),
text: regTy.value,
}]
: []),
...(state.value === 'TRIAL' || state.value === 'EEXPIRED'
? [{
error: state.value === 'EEXPIRED',
label: t('Trial expiration'),
component: UserProfileUptimeExpire,
componentProps: {
forExpire: true,
shortText: true,
t,
},
componentOpacity: true,
}]
: []),
...(regTo.value
? [{
label: t('Registered to'),
text: regTo.value,
}]
: []),
...(regTo.value && regTm.value
? [{
label: t('Registered on'),
text: formattedRegTm.value,
}]
: []),
...(regExp.value && (state.value === 'STARTER' || state.value === 'UNLEASHED')
? [{
label: t('OS Update Eligibility'),
warning: regUpdatesExpired.value,
component: RegistrationUpdateExpirationAction,
@@ -109,36 +118,49 @@ const items = computed((): RegistrationItemProps[] => {
componentOpacity: !regUpdatesExpired.value,
}]
: []),
...(state.value === 'EGUID' ? [{
label: t('Registered GUID'),
text: regGuid.value,
}] : [] ),
...(guid.value ? [{
label: t('Flash GUID'),
text: guid.value,
}] : [] ),
...(flashVendor.value ? [{
label: t('Flash Vendor'),
text: flashVendor.value,
}] : [] ),
...(flashProduct.value ? [{
label: t('Flash Product'),
text: flashProduct.value,
}] : [] ),
...(!stateDataError.value ? [{
error: deviceCount.value > devicesAvailable.value,
label: t('Attached Storage Devices'),
text: deviceCount.value > devicesAvailable.value
? t('{0} out of {1} allowed devices upgrade your key to support more devices', [deviceCount.value, devicesAvailable.value > 12 ? t('unlimited') : devicesAvailable.value])
: t('{0} out of {1} devices', [deviceCount.value, devicesAvailable.value > 12 ? t('unlimited') : devicesAvailable.value]),
}] : []),
...(!stateDataError.value && guid.value ? [{
...(state.value === 'EGUID'
? [{
label: t('Registered GUID'),
text: regGuid.value,
}]
: []),
...(guid.value
? [{
label: t('Flash GUID'),
text: guid.value,
}]
: []),
...(flashVendor.value
? [{
label: t('Flash Vendor'),
text: flashVendor.value,
}]
: []),
...(flashProduct.value
? [{
label: t('Flash Product'),
text: flashProduct.value,
}]
: []),
...(!stateDataError.value
? [{
error: deviceCount.value > devicesAvailable.value,
label: t('Attached Storage Devices'),
text: deviceCount.value > devicesAvailable.value
? t('{0} out of {1} allowed devices upgrade your key to support more devices', [deviceCount.value, devicesAvailable.value > 12 ? t('unlimited') : devicesAvailable.value])
: t('{0} out of {1} devices', [deviceCount.value, devicesAvailable.value > 12 ? t('unlimited') : devicesAvailable.value]),
}]
: []),
...(!stateDataError.value && guid.value
? [{
label: t('Key Replacement Eligibility'),
component: RegistrationReplaceCheck,
componentProps: { t: t },
}] : []),
componentProps: { t },
}]
: []),
// filter out renew action and only display other key actions…renew is displayed in RegistrationUpdateExpirationAction
...(keyActions.value?.filter(action => !['renew'].includes(action.name)).length > 0 ? [{
...(keyActions.value?.filter(action => !['renew'].includes(action.name)).length > 0
? [{
label: t('License key actions'),
component: KeyActions,
componentProps: {
@@ -167,8 +189,9 @@ const items = computed((): RegistrationItemProps[] => {
</h3>
<div
v-if="stateData.message"
class="prose text-16px leading-relaxed whitespace-normal opacity-75"
v-html="stateData.message"
class="prose text-16px leading-relaxed whitespace-normal opacity-75"></div>
/>
</header>
<dl>
<RegistrationItem
@@ -185,7 +208,8 @@ const items = computed((): RegistrationItemProps[] => {
<component
:is="item.component"
v-bind="item.componentProps"
:class="[item.componentOpacity && !item.error ? 'opacity-75' : '']" />
:class="[item.componentOpacity && !item.error ? 'opacity-75' : '']"
/>
</template>
</RegistrationItem>
</dl>

View File

@@ -36,7 +36,7 @@ const evenBgColor = computed(() => {
{{ text }}
</span>
<template v-if="$slots['right']">
<slot name="right"></slot>
<slot name="right" />
</template>
</dd>
</div>

View File

@@ -20,10 +20,11 @@ defineProps<{
<div class="flex flex-wrap items-start justify-between gap-8px">
<BrandButton
v-if="!replaceStatusOutput"
@click="replaceRenewStore.check"
:icon="KeyIcon"
:text="t('Check Eligibility')"
class="flex-grow" />
class="flex-grow"
@click="replaceRenewStore.check"
/>
<UiBadge
v-else
@@ -38,7 +39,7 @@ defineProps<{
btn-style="underline"
:external="true"
:href="DOCS_REGISTRATION_REPLACE_KEY.toString()"
:iconRight="ArrowTopRightOnSquareIcon"
:icon-right="ArrowTopRightOnSquareIcon"
:text="t('Learn More')"
class="text-14px"
/>

View File

@@ -38,11 +38,11 @@ const output = computed(() => {
<template>
<component
v-if="output"
:is="componentIs"
v-if="output"
:title="output.title"
>
<slot></slot>
<slot />
{{ output.text }}
</component>
</template>

View File

@@ -71,9 +71,9 @@ const output = computed(() => {
v-if="renewStatus === 'installed'"
:icon="ArrowPathIcon"
:text="t('Reload Page')"
@click="reload"
class="flex-grow"
/>
@click="reload"
/>
<BrandButton
v-else-if="regUpdatesExpired"
:disabled="renewAction?.disabled"
@@ -82,16 +82,16 @@ const output = computed(() => {
:icon-right="ArrowTopRightOnSquareIcon"
:icon-right-hover-display="true"
:text="t('Extend License')"
@click="renewAction.click()"
:title="t('Pay your annual fee to continue receiving OS updates.')"
class="flex-grow"
@click="renewAction.click()"
/>
<BrandButton
btn-style="underline"
:external="true"
:href="DOCS_REGISTRATION_LICENSING.toString()"
:iconRight="ArrowTopRightOnSquareIcon"
:icon-right="ArrowTopRightOnSquareIcon"
:text="t('Learn More')"
class="text-14px"
/>

View File

@@ -108,7 +108,7 @@ const computedStyleClasses = computed(() => {
]"
>
<component :is="icon" v-if="icon" class="flex-shrink-0" :class="computedStyleClasses.icon" />
<slot></slot>
<slot />
<component :is="iconRight" v-if="iconRight" class="flex-shrink-0" :class="computedStyleClasses.icon" />
</span>
</template>

View File

@@ -26,6 +26,6 @@ withDefaults(defineProps<{
!error && !warning && 'text-beta bg-alpha border-gamma-opaque',
]"
>
<slot></slot>
<slot />
</div>
</template>

View File

@@ -53,7 +53,9 @@ const checked = ref(false);
</span>
</span>
</Switch>
<SwitchLabel class="text-14px">{{ label }}</SwitchLabel>
<SwitchLabel class="text-14px">
{{ label }}
</SwitchLabel>
</div>
</SwitchGroup>
</template>

View File

@@ -11,6 +11,6 @@ withDefaults(defineProps<{
class="grid gap-y-24px w-full mx-auto px-16px"
:class="maxWidth"
>
<slot></slot>
<slot />
</div>
</template>
</template>

View File

@@ -35,9 +35,10 @@ const { rebootType } = storeToRefs(updateOsActionsStore);
<template>
<UiPageContainer>
<UpdateOsStatus
:showUpdateCheck="true"
:show-update-check="true"
:title="t('Update Unraid OS')"
:t="t" />
:t="t"
/>
<!-- <UpdateOsUpdateIneligible
v-if="availableWithRenewal && rebootType === ''"
:t="t" />

View File

@@ -25,10 +25,11 @@ onBeforeMount(() => {
<template>
<div class="flex flex-col sm:flex-shrink-0 sm:flex-grow-0 items-center">
<BrandButton
@click="updateOsActionsStore.executeUpdateOsCallback()"
:icon="ArrowPathIcon"
:icon-right="ArrowTopRightOnSquareIcon"
:text="t('Check for OS Updates')"
class="flex-0" />
class="flex-0"
@click="updateOsActionsStore.executeUpdateOsCallback()"
/>
</div>
</template>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
/**
/**
* @todo require keyfile to be set before allowing user to check for OS updates
* @todo require keyfile to update
* @todo require valid guid / server state to update
@@ -48,7 +48,7 @@ const check = async () => {
skipCache: true,
}).finally(() => {
updateOsActionsStore.setStatus('ready');
})
});
};
watchEffect(() => {
@@ -99,16 +99,19 @@ watchEffect(() => {
</span>
</span>
</Switch>
<SwitchLabel class="text-14px">{{ t('Check for Prereleases') }}</SwitchLabel>
<SwitchLabel class="text-14px">
{{ t('Check for Prereleases') }}
</SwitchLabel>
</div>
</SwitchGroup>
<span class="flex flex-col gap-y-8px">
<BrandButton
@click="check"
:disabled="status === 'checking'"
btn-style="outline"
:text="buttonText"
class="flex-0" />
class="flex-0"
@click="check"
/>
<span
v-if="parsedReleaseTimestamp"
class="text-14px opacity-75 text-center"

View File

@@ -73,14 +73,16 @@ const downgradeButton = ref<UserProfileLink | undefined>({
:href="FORUMS_BUG_REPORT.toString()"
:icon="LifebuoyIcon"
:icon-right="ArrowTopRightOnSquareIcon"
:text="t('Open a bug report')" />
:text="t('Open a bug report')"
/>
<BrandButton
@click="downgradeButton?.click"
btn-style="outline"
:external="downgradeButton?.external"
:icon="ArrowUturnDownIcon"
:name="downgradeButton?.name"
:text="downgradeButton?.text" />
:text="downgradeButton?.text"
@click="downgradeButton?.click"
/>
</div>
</div>
</UiCardWrapper>

View File

@@ -57,13 +57,15 @@ const regExpOutput = computed(() => {
<template>
<div class="grid gap-y-16px">
<h1 v-if="title" class="text-24px">{{ title }}</h1>
<h1 v-if="title" class="text-24px">
{{ title }}
</h1>
<div class="flex flex-col md:flex-row gap-16px justify-start md:items-start md:justify-between">
<div class="inline-flex flex-wrap justify-start gap-8px">
<button
@click="updateOsActionsStore.viewCurrentReleaseNotes(t('{0} Release Notes', [osVersion]))"
class="group"
:title="t('View release notes')"
@click="updateOsActionsStore.viewCurrentReleaseNotes(t('{0} Release Notes', [osVersion]))"
>
<UiBadge :icon="InformationCircleIcon" class="underline">
{{ t('Current Version {0}', [osVersion]) }}
@@ -94,7 +96,6 @@ const regExpOutput = computed(() => {
{{ t('Key ineligible for {0}', [availableWithRenewal]) }}
</UiBadge>
<UiBadge
v-if="status === 'checking'"
:color="'orange'"
@@ -109,10 +110,10 @@ const regExpOutput = computed(() => {
:title="parsedReleaseTimestamp ? t('Last checked: {0}', [parsedReleaseTimestamp.relative]) : ''"
>
{{ (available
? t('Unraid {0} Available', [available])
: (availableWithRenewal
? t('Up-to-date with eligible releases')
: t('Up-to-date')))
? t('Unraid {0} Available', [available])
: (availableWithRenewal
? t('Up-to-date with eligible releases')
: t('Up-to-date')))
}}
</UiBadge>
<UiBadge
@@ -127,12 +128,14 @@ const regExpOutput = computed(() => {
<div class="shrink-0">
<UpdateOsCallbackButton
v-if="showUpdateCheck && rebootType === ''"
:t="t" />
:t="t"
/>
<BrandButton
v-else-if="rebootType === 'downgrade' || rebootType === 'upgrade'"
@click="updateOsActionsStore.rebootServer()"
:icon="ArrowPathIcon"
:text="rebootType === 'downgrade' ? t('Reboot Now to Downgrade') : t('Reboot Now to Update')" />
:text="rebootType === 'downgrade' ? t('Reboot Now to Downgrade') : t('Reboot Now to Update')"
@click="updateOsActionsStore.rebootServer()"
/>
</div>
</div>
</div>

View File

@@ -31,7 +31,6 @@ const props = defineProps<{
t: any;
}>();
const serverStore = useServerStore();
const { dateTimeFormat } = storeToRefs(serverStore);
@@ -78,7 +77,7 @@ const flashBackupCopy = computed(() => {
${props.t('You can also manually create a new backup by clicking the Create Flash Backup button.')}
`;
}
return `${base} ${props.t('You can manually create a backup by clicking the Create Flash Backup button.')}`
return `${base} ${props.t('You can manually create a backup by clicking the Create Flash Backup button.')}`;
});
const acknowledgeBackup = ref<boolean>(false);
@@ -100,7 +99,7 @@ const startFlashBackup = () => {
* Checking for element on the page to determine if the flash backup has started
*/
const checkFlashBackupStatus = () => {
let loadingElement: HTMLCollectionOf<Element> = document.getElementsByClassName('spinner');
const loadingElement: HTMLCollectionOf<Element> = document.getElementsByClassName('spinner');
setTimeout(() => {
if (loadingElement.length > 0 && loadingElement[0]) {
const el = loadingElement[0] as HTMLDivElement;
@@ -154,20 +153,23 @@ watchEffect(() => {
<div class="prose opacity-75 text-16px leading-relaxed whitespace-normal">
<p>{{ t('Receive the latest and greatest for Unraid OS. Whether it new features, security patches, or bug fixes keeping your server up-to-date ensures the best experience that Unraid has to offer.') }}</p>
<p v-if="available">{{ flashBackupCopy }}</p>
<p v-if="available">
{{ flashBackupCopy }}
</p>
</div>
</div>
<div class="flex flex-col sm:flex-shrink-0 items-center gap-16px">
<template v-if="available && updateButton">
<BrandButton
@click="startFlashBackup"
btn-style="outline"
:disabled="flashBackupBasicStatus === 'started'"
:icon="ArchiveBoxArrowDownIcon"
:name="'flashBackup'"
:text="flashBackupText"
class="flex-none" />
class="flex-none"
@click="startFlashBackup"
/>
<p v-if="flashBackupBasicStatus === 'started'" class="text-12px italic opacity-75 shrink">
{{ t('Backing up...this may take a few minutes') }}
@@ -213,13 +215,14 @@ watchEffect(() => {
</span>
</span>
</Switch>
<SwitchLabel class="text-14px">{{ t('I have made a Flash Backup') }}</SwitchLabel>
<SwitchLabel class="text-14px">
{{ t('I have made a Flash Backup') }}
</SwitchLabel>
</div>
</SwitchGroup>
</template>
<BrandButton
@click="updateButton?.click"
btn-style="fill"
:disabled="disableCallbackButton"
:external="updateButton?.external"
@@ -228,7 +231,9 @@ watchEffect(() => {
:name="updateButton?.name"
:text="t('View Available Updates')"
:title="!acknowledgeBackup ? t('Acklowledge that you have made a Flash Backup to enable this action') : ''"
class="flex-none" />
class="flex-none"
@click="updateButton?.click"
/>
</div>
</div>
</UiCardWrapper>

View File

@@ -82,7 +82,8 @@ watchEffect(() => {
<div
class="prose text-black text-16px leading-relaxed whitespace-normal"
v-html="text" />
v-html="text"
/>
</div>
<div class="flex flex-col sm:flex-shrink-0 items-center gap-16px">
@@ -92,9 +93,9 @@ watchEffect(() => {
:icon="renewAction.icon"
:icon-right="ArrowTopRightOnSquareIcon"
:text="t('Extend License')"
@click="renewAction.click()"
:title="t('Pay your annual fee to continue receiving OS updates.')"
class="flex-grow"
@click="renewAction.click()"
/>
<!-- <BrandButton
btn-style="black"
@@ -106,14 +107,15 @@ watchEffect(() => {
<BrandButton
v-if="availableWithRenewal && updateButton"
@click="updateButton?.click"
btn-style="outline-black"
:external="updateButton?.external"
:icon="EyeIcon"
:icon-right="ArrowTopRightOnSquareIcon"
:name="updateButton?.name"
:text="t('View Changelog')"
class="flex-none" />
class="flex-none"
@click="updateButton?.click"
/>
</div>
</div>
</UiCardWrapper>

View File

@@ -271,7 +271,9 @@ const { copy, copied, isSupported } = useClipboard({ source: keyUrl.value });
:error="true"
:text="t('Post Install License Key Error')"
>
<h4 class="text-18px text-left font-semibold">{{ t(stateData.heading) }}</h4>
<h4 class="text-18px text-left font-semibold">
{{ t(stateData.heading) }}
</h4>
<div class="text-left text-16px" v-html="t(stateData.message)" />
</UpcCallbackFeedbackStatus>

View File

@@ -43,12 +43,14 @@ const filteredKeyActions = computed(() => keyActions.value?.filter(action => !['
const links = computed(():UserProfileLink[] => {
return [
...(regUpdatesExpired.value ? [{
href: WEBGUI_TOOLS_REGISTRATION.toString(),
icon: KeyIcon,
text: props.t('OS Update Eligibility Expired'),
title: props.t('Go to Tools > Registration to Learn More'),
}] : []),
...(regUpdatesExpired.value
? [{
href: WEBGUI_TOOLS_REGISTRATION.toString(),
icon: KeyIcon,
text: props.t('OS Update Eligibility Expired'),
title: props.t('Go to Tools > Registration to Learn More'),
}]
: []),
// callback to account.unraid.net/server/update-os
updateOsActionsStore.initUpdateOsCallback(),
// connect plugin links

View File

@@ -23,8 +23,8 @@ const time = computed(() => {
return expireTime.value;
}
return (state.value === 'TRIAL' || state.value === 'EEXPIRED') && expireTime.value && expireTime.value > 0
? expireTime.value
: uptime.value;
? expireTime.value
: uptime.value;
});
const countUp = computed<boolean>(() => {

View File

@@ -70,9 +70,9 @@ const useDateTimeHelper = (
// use the format from the server to determine the format to use
const findMatchingFormat = (
selectedFormat: string,
formats: DateFormatOption[] | TimeFormatOption[],
): DateFormatOption | TimeFormatOption | undefined =>
selectedFormat: string,
formats: DateFormatOption[] | TimeFormatOption[],
): DateFormatOption | TimeFormatOption | undefined =>
formats.find(formatOption => formatOption.format === selectedFormat);
const dateFormat = findMatchingFormat(format?.date ?? dateFormatOptions[0].format, dateFormatOptions);

View File

@@ -50,4 +50,4 @@ export const keyLatest = async (payload: KeyLatestPayload) => await KeyServer
export const getOsReleaseBySha256 = async (sha256: string): Release => await KeyServer
.url(`/versions/sha256/${sha256}`)
.get()
.json();
.json();

View File

@@ -68,14 +68,14 @@ export const WebguiUnraidApiCommand = async (payload: WebguiUnraidApiCommandPayl
export interface NotifyPostParameters {
cmd: 'init' | 'smtp-init' | 'cron-init' | 'add' | 'get' | 'hide' | 'archive';
csrf_token: string;
e?: string; // 'add' command option
s?: string; // 'add' command option
d?: string; // 'add' command option
i?: string; // 'add' command option
m?: string; // 'add' command option
x?: string; // 'add' command option
t?: string; // 'add' command option
file?: string; // 'hide' and 'archive' command option
e?: string; // 'add' command option
s?: string; // 'add' command option
d?: string; // 'add' command option
i?: string; // 'add' command option
m?: string; // 'add' command option
x?: string; // 'add' command option
t?: string; // 'add' command option
file?: string; // 'hide' and 'archive' command option
}
export const WebguiNotify = async (payload: NotifyPostParameters) => {
console.debug('[WebguiNotify] payload', payload);
@@ -91,4 +91,4 @@ export const WebguiNotify = async (payload: NotifyPostParameters) => {
console.error('[WebguiNotify] catch failed to execute Notify', error, payload);
return error;
}
}
};

View File

@@ -60,10 +60,12 @@ export default defineNuxtConfig({
build: {
minify: 'terser',
terserOptions: {
mangle: process.env.VITE_ALLOW_CONSOLE_LOGS ? false : {
reserved: terserReservations(charsToReserve),
toplevel: true,
},
mangle: process.env.VITE_ALLOW_CONSOLE_LOGS
? false
: {
reserved: terserReservations(charsToReserve),
toplevel: true,
},
},
},
},

View File

@@ -114,7 +114,9 @@ onMounted(() => {
<code>
<pre>{{ valueToMakeCallback }}</pre>
</code>
<BrandButton v-if="callbackDestination" :href="callbackDestination" :external="true">{{ 'Go to Callback URL' }}</BrandButton>
<BrandButton v-if="callbackDestination" :href="callbackDestination" :external="true">
{{ 'Go to Callback URL' }}
</BrandButton>
<h4>Full URL Destination</h4>
<code>
<pre>{{ callbackDestination }}</pre>

View File

@@ -79,7 +79,7 @@ export const useCallbackActionsStore = defineStore('callbackActions', () => {
console.debug('[redirectToCallbackType] updateOs done');
// removing query string relase is set so users can't refresh the page and go through the same actions
window.history.replaceState(null, '', window.location.pathname);
return
return;
}
}

View File

@@ -28,7 +28,6 @@ export interface UiBadgePropsExtended extends UiBadgeProps {
text?: string;
}
interface CachedValidationResponse extends ValidateGuidResponse {
key: string;
timestamp: number;
@@ -101,7 +100,7 @@ export const useReplaceRenewStore = defineStore('replaceRenewCheck', () => {
const purgeValidationResponse = () => {
validationResponse.value = undefined;
sessionStorage.removeItem(REPLACE_CHECK_LOCAL_STORAGE_KEY);
}
};
const check = async () => {
if (!guid.value) {

View File

@@ -617,8 +617,8 @@ export const useServerStore = defineStore('server', () => {
const trialExtensionEligible = computed(() => !regGen.value || regGen.value < 2);
const tooManyDevices = computed((): Error | undefined => {
if ((deviceCount.value !== 0 && regDev.value !== 0 && deviceCount.value > regDev.value)
|| !config.value?.valid && config.value?.error === 'INVALID') {
if ((deviceCount.value !== 0 && regDev.value !== 0 && deviceCount.value > regDev.value) ||
!config.value?.valid && config.value?.error === 'INVALID') {
return {
heading: 'Too Many Devices',
level: 'error',
@@ -880,7 +880,7 @@ export const useServerStore = defineStore('server', () => {
}, refreshTimeout);
};
const filteredKeyActions = (filterType: 'by' | 'out', filters: ServerStateDataKeyActions[]): ServerStateDataAction[] | undefined => {
const filteredKeyActions = (filterType: 'by' | 'out', filters: ServerStateDataKeyActions[]): ServerStateDataAction[] | undefined => {
if (!stateData.value.actions) { return; }
return stateData.value.actions.filter((action) => {

View File

@@ -139,7 +139,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
const isAvailableStable = computed(() => available.value ? isVersionStable(available.value) : false);
const filteredNextReleases = computed(() => {
if (!osVersion.value) return undefined;
if (!osVersion.value) { return undefined; }
if (releases.value?.response?.next) {
return releases.value?.response?.next.filter(
@@ -150,7 +150,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
});
const filteredPreviewReleases = computed(() => {
if (!osVersion.value) return undefined;
if (!osVersion.value) { return undefined; }
if (releases.value?.response?.preview) {
return releases.value?.response?.preview.filter(
@@ -161,7 +161,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
});
const filteredStableReleases = computed(() => {
if (!osVersion.value) return undefined;
if (!osVersion.value) { return undefined; }
if (releases.value?.response?.stable) {
return releases.value?.response?.stable.filter(
@@ -172,7 +172,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
});
const filteredTestReleases = computed(() => {
if (!osVersion.value) return undefined;
if (!osVersion.value) { return undefined; }
if (releases.value?.response?.test) {
return releases.value?.response?.test.filter(
@@ -192,7 +192,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
...(filteredNextReleases.value && { next: [...filteredNextReleases.value] }),
...(filteredPreviewReleases.value && { preview: [...filteredPreviewReleases.value] }),
...(filteredTestReleases.value && { test: [...filteredTestReleases.value] }),
}
};
});
/**
@@ -217,8 +217,8 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
const useTestBranch = webguiTestBranch || accountAppTestBranch;
let releasesUrl = OS_RELEASES;
if (useNextBranch) releasesUrl = OS_RELEASES_NEXT;
if (usePreviewBranch || useTestBranch) releasesUrl = OS_RELEASES_PREVIEW;
if (useNextBranch) { releasesUrl = OS_RELEASES_NEXT; }
if (usePreviewBranch || useTestBranch) { releasesUrl = OS_RELEASES_PREVIEW; }
/** @todo implement separate test branch json once available */
// if (useTestBranch) releasesUrl = OS_RELEASES_PREVIEW.toString();
return releasesUrl;
@@ -229,7 +229,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
timestamp: Date.now(),
response,
};
}
};
const cacheReleasesResponse = () => {
localStorage.setItem(RELEASES_LOCAL_STORAGE_KEY, JSON.stringify(releases.value));
@@ -256,19 +256,19 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
* Which will trigger a new API call to get the releases.
* Otherwise skip the API call and use the cached data.
*/
else if (!payload.skipCache && releases.value) {
const currentTime = new Date().getTime();
const cacheDuration = import.meta.env.DEV ? 30000 : 604800000; // 30 seconds for testing, 7 days for prod
if (currentTime - releases.value.timestamp > cacheDuration) {
else if (!payload.skipCache && releases.value) {
const currentTime = new Date().getTime();
const cacheDuration = import.meta.env.DEV ? 30000 : 604800000; // 30 seconds for testing, 7 days for prod
if (currentTime - releases.value.timestamp > cacheDuration) {
// cache is expired, purge it
console.debug('[requestReleases] cache EXPIRED');
await purgeReleasesCache();
} else {
// if the cache is valid return the existing response
console.debug('[requestReleases] cache VALID', releases.value.response);
return releases.value.response;
}
}
console.debug('[requestReleases] cache EXPIRED');
await purgeReleasesCache();
} else {
// if the cache is valid return the existing response
console.debug('[requestReleases] cache VALID', releases.value.response);
return releases.value.response;
}
}
// If here we're needing to fetch a new releases…whether it's the first time or b/c the cache was expired
try {
@@ -311,7 +311,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
return console.error('[checkForUpdate] no releases found');
}
Object.keys(releases.value.response ?? {}).forEach(key => {
Object.keys(releases.value.response ?? {}).forEach((key) => {
// this is just to make TS happy (it's already checked above…thanks github copilot for knowing what I needed)
if (!releases.value) {
return;
@@ -327,7 +327,7 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
return;
}
branchReleases.find(release => {
branchReleases.find((release) => {
if (gt(release.version, osVersion.value)) {
// before we set the available version, check if the license key updates have expired to ensure we don't show an update that the user can't install
if (regUpdatesExpired.value && releaseDateGtRegExpDate(release.date, regExp.value)) {
@@ -346,14 +346,14 @@ export const useUpdateOsStoreGeneric = (payload: UpdateOsStorePayload) =>
const findRelease = (searchKey: keyof Release, searchValue: string): Release | null => {
const response = releases?.value?.response;
if (!response) return null;
if (!response) { return null; }
for (const key of Object.keys(response)) {
const branchReleases = response[key as keyof ReleasesResponse];
if (!branchReleases || branchReleases.length === 0) continue;
if (!branchReleases || branchReleases.length === 0) { continue; }
const foundRelease = branchReleases.find(release => release[searchKey] === searchValue);
if (foundRelease) return foundRelease;
if (foundRelease) { return foundRelease; }
}
return null;

View File

@@ -67,8 +67,8 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => {
return 'A valid OS version is required to check for OS updates.';
}
if (regUpdatesExpired.value) {
const base = `Your {0} license included one year of free updates at the time of purchase. You are now eligible to extend your license and access the latest OS updates.`;
const addtlText = `You are still eligible to access OS updates that were published on or before {1}.`;
const base = 'Your {0} license included one year of free updates at the time of purchase. You are now eligible to extend your license and access the latest OS updates.';
const addtlText = 'You are still eligible to access OS updates that were published on or before {1}.';
return updateOsStore.available ? `${base} ${addtlText}` : base;
}
return '';
@@ -82,7 +82,7 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => {
name: 'updateOs',
text: 'Unraid OS {0} Update Available',
textParams: [updateOsStore.available],
}
};
});
// Actions
@@ -105,7 +105,7 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => {
name: 'updateOs',
text: updateOsStore.available ? 'Unraid OS {0} Update Available' : 'Check for OS Updates',
textParams: [updateOsStore.available],
}
};
};
const executeUpdateOsCallback = async () => {
@@ -125,7 +125,7 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => {
* @description When receiving the callback the Account update page we'll use the provided sha256 of the release to get the release from the keyserver
*/
const getReleaseFromKeyServer = async (sha256: string): Release => {
console.debug('[getReleaseFromKeyServer]', sha256)
console.debug('[getReleaseFromKeyServer]', sha256);
try {
const response = await getOsReleaseBySha256(sha256);
console.debug('[getReleaseFromKeyServer]', response);
@@ -159,7 +159,7 @@ export const useUpdateOsActionsStore = defineStore('updateOsActions', () => {
document.rebootNow.submit();
};
const viewCurrentReleaseNotes = ( modalTitle: string, webguiFilePath?: string | undefined,) => {
const viewCurrentReleaseNotes = (modalTitle: string, webguiFilePath?: string | undefined) => {
// @ts-ignore  this is a global function provided by the webgui
if (typeof openChanges === 'function') {
// @ts-ignore

View File

@@ -107,7 +107,7 @@ export default <Partial<Config>>{
/**
* @todo modify prose classes to use pixels for webgui…sadge https://tailwindcss.com/docs/typography-plugin#customizing-the-default-theme
*/
typography: (theme) => ({
typography: theme => ({
DEFAULT: {
css: {
color: theme('colors.beta'),

View File

@@ -8,4 +8,4 @@ export interface RegistrationItemProps {
label?: string;
text?: number | string;
warning?: boolean;
}
}