From 2104eebe0275d309b97273d639b690b6fc8c9028 Mon Sep 17 00:00:00 2001 From: Zack Spear Date: Mon, 30 Oct 2023 12:43:23 -0700 Subject: [PATCH] chore: lint manual fixes --- web/.eslintrc.cjs | 1 + web/_data/serverState.ts | 27 ++++++++++--------- web/components/KeyActions.vue | 1 + web/components/Registration.ce.vue | 2 -- .../Registration/UpdateExpirationAction.vue | 9 ------- web/components/Ui/Lightswitch.vue | 2 +- web/components/UpdateOs.ce.vue | 18 ------------- web/components/UpdateOs/CallbackButton.vue | 2 +- web/components/UpdateOs/CheckButton.vue | 2 +- web/components/UpdateOs/Downgrade.vue | 3 --- web/components/UpdateOs/Update.vue | 3 --- web/components/UpdateOs/UpdateIneligible.vue | 2 -- web/components/UserProfile.ce.vue | 1 - .../UserProfile/CallbackFeedback.vue | 1 - .../UserProfile/DropdownContent.vue | 1 - web/composables/services/request.ts | 4 +-- web/pages/index.vue | 1 - web/store/callbackActions.ts | 5 ++-- web/store/replaceRenew.ts | 18 ++++++++----- web/store/server.ts | 4 +-- web/store/updateOs.ts | 25 ++++++++--------- web/store/updateOsActions.ts | 21 ++++++--------- 22 files changed, 59 insertions(+), 94 deletions(-) diff --git a/web/.eslintrc.cjs b/web/.eslintrc.cjs index c8f88d08f..9aded5ea0 100644 --- a/web/.eslintrc.cjs +++ b/web/.eslintrc.cjs @@ -21,5 +21,6 @@ module.exports = { 'vue/multi-word-component-names': 'off', 'vue/v-on-event-hyphenation': 'off', 'vue/no-v-html': 'off', + 'no-fallthrough': 'off', } }; diff --git a/web/_data/serverState.ts b/web/_data/serverState.ts index 31f473412..2ad454892 100644 --- a/web/_data/serverState.ts +++ b/web/_data/serverState.ts @@ -1,15 +1,15 @@ import type { Server, ServerState } from '~/types/server'; -function makeid (length: number) { - const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; - const charactersLength = characters.length; - let result = ''; - for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } - return result; -} +// function makeid(length: number) { +// const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; +// const charactersLength = characters.length; +// let result = ''; +// for (let i = 0; i < length; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } +// return result; +// } // '1111-1111-5GDB-123412341234' Starter.key = TkJCrVyXMLWWGKZF6TCEvf0C86UYI9KfUDSOm7JoFP19tOMTMgLKcJ6QIOt9_9Psg_t0yF-ANmzSgZzCo94ljXoPm4BESFByR0K7nyY9KVvU8szLEUcBUT3xC2adxLrAXFNxiPeK-mZqt34n16uETKYvLKL_Sr5_JziG5L5lJFBqYZCPmfLMiguFo1vp0xL8pnBH7q8bYoBnePrAcAVb9mAGxFVPEInSPkMBfC67JLHz7XY1Y_K5bYIq3go9XPtLltJ53_U4BQiMHooXUBJCKXodpqoGxq0eV0IhNEYdauAhnTsG90qmGZig0hZalQ0soouc4JZEMiYEcZbn9mBxPg -const randomGuid = '1111-1111-5GDB-123412341234'; +const staticGuid = '1111-1111-5GDB-123412341234'; // 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 @@ -65,12 +65,15 @@ switch (state) { const uptime = Date.now() - 60 * 60 * 1000; // 1 hour ago const twoDaysAgo = Date.now() - 2 * 24 * 60 * 60 * 1000; // 2 days ago -const oneDayAgo = Date.now() - 24 * 60 * 60 * 1000; // 1 day ago +// const oneDayAgo = Date.now() - 24 * 60 * 60 * 1000; // 1 day ago const oneHourFromNow = Date.now() + 60 * 60 * 1000; // 1 hour from now const oneDayFromNow = Date.now() + 24 * 60 * 60 * 1000; // 1 day from now let expireTime = 0; -if (state === 'TRIAL') { expireTime = oneHourFromNow; } // in 1 hour -else if (state === 'EEXPIRED') { expireTime = uptime; } // 1 hour ago +if (state === 'TRIAL') { + expireTime = oneHourFromNow; // in 1 hour +} else if (state === 'EEXPIRED') { + expireTime = uptime; // 1 hour ago +} let regExp: number | undefined; if (state === 'STARTER' || state === 'UNLEASHED') { @@ -98,7 +101,7 @@ export const serverState: Server = { flashBackupActivated: !!connectPluginInstalled, flashProduct: 'SanDisk_3.2Gen1', flashVendor: 'USB', - guid: randomGuid, + guid: staticGuid, // "guid": "0781-5583-8355-81071A2B0211", inIframe: false, // keyfile: 'DUMMY_KEYFILE', diff --git a/web/components/KeyActions.vue b/web/components/KeyActions.vue index ff7e97c15..6ef9491de 100644 --- a/web/components/KeyActions.vue +++ b/web/components/KeyActions.vue @@ -12,6 +12,7 @@ const props = withDefaults(defineProps<{ maxWidth?: boolean; t: any; }>(), { + actions: undefined, filterBy: undefined, filterOut: undefined, maxWidth: false, diff --git a/web/components/Registration.ce.vue b/web/components/Registration.ce.vue index e3dfef866..47c4347f6 100644 --- a/web/components/Registration.ce.vue +++ b/web/components/Registration.ce.vue @@ -21,7 +21,6 @@ import { ShieldCheckIcon, ShieldExclamationIcon, } from '@heroicons/vue/24/solid'; -import dayjs from 'dayjs'; import { storeToRefs } from 'pinia'; import { useI18n } from 'vue-i18n'; @@ -44,7 +43,6 @@ const { flashVendor, flashProduct, keyActions, - keyfile, regGuid, regTm, regTo, diff --git a/web/components/Registration/UpdateExpirationAction.vue b/web/components/Registration/UpdateExpirationAction.vue index c805ccda8..da9953a78 100644 --- a/web/components/Registration/UpdateExpirationAction.vue +++ b/web/components/Registration/UpdateExpirationAction.vue @@ -6,7 +6,6 @@ import useDateTimeHelper from '~/composables/dateTime'; import { DOCS_REGISTRATION_LICENSING } from '~/helpers/urls'; import { useReplaceRenewStore } from '~/store/replaceRenew'; import { useServerStore } from '~/store/server'; -import { useUpdateOsStore, useUpdateOsActionsStore } from '~/store/updateOsActions'; export interface Props { t: any; @@ -16,8 +15,6 @@ const props = defineProps(); const replaceRenewStore = useReplaceRenewStore(); const serverStore = useServerStore(); -const updateOsStore = useUpdateOsStore(); -const updateOsActionsStore = useUpdateOsActionsStore(); const { renewStatus } = storeToRefs(replaceRenewStore); const { @@ -25,10 +22,7 @@ const { regExp, regUpdatesExpired, renewAction, - regTy, } = storeToRefs(serverStore); -const { availableWithRenewal } = storeToRefs(updateOsStore); -const { ineligibleText } = storeToRefs(updateOsActionsStore); const reload = () => { window.location.reload(); @@ -62,9 +56,6 @@ const output = computed(() => { -

(), { diff --git a/web/components/UpdateOs.ce.vue b/web/components/UpdateOs.ce.vue index fc0d9f151..7f5faf3ee 100644 --- a/web/components/UpdateOs.ce.vue +++ b/web/components/UpdateOs.ce.vue @@ -15,21 +15,12 @@ else echo "Third party plugins found - PLEASE CHECK YOUR UNRAID NOTIFICATIONS AND WAIT FOR THE MESSAGE THAT IT IS SAFE TO REBOOT!" fi */ -import { storeToRefs } from 'pinia'; import { useI18n } from 'vue-i18n'; -import { useUpdateOsStore, useUpdateOsActionsStore } from '~/store/updateOsActions'; - import 'tailwindcss/tailwind.css'; import '~/assets/main.css'; const { t } = useI18n(); - -const updateOsStore = useUpdateOsStore(); -const updateOsActionsStore = useUpdateOsActionsStore(); - -const { available, availableWithRenewal } = storeToRefs(updateOsStore); -const { rebootType } = storeToRefs(updateOsActionsStore); diff --git a/web/components/UpdateOs/CallbackButton.vue b/web/components/UpdateOs/CallbackButton.vue index 5513d1198..3c7cd959d 100644 --- a/web/components/UpdateOs/CallbackButton.vue +++ b/web/components/UpdateOs/CallbackButton.vue @@ -6,7 +6,7 @@ import { onBeforeMount } from 'vue'; import { WEBGUI_TOOLS_UPDATE } from '~/helpers/urls'; import { useUpdateOsActionsStore } from '~/store/updateOsActions'; -const props = defineProps<{ +defineProps<{ t: any; }>(); diff --git a/web/components/UpdateOs/CheckButton.vue b/web/components/UpdateOs/CheckButton.vue index 092d296be..49062d951 100644 --- a/web/components/UpdateOs/CheckButton.vue +++ b/web/components/UpdateOs/CheckButton.vue @@ -24,7 +24,7 @@ const updateOsStore = useUpdateOsStore(); const updateOsActionsStore = useUpdateOsActionsStore(); const { guid, keyfile, osVersion, osVersionBranch } = storeToRefs(serverStore); -const { isOsVersionStable, parsedReleaseTimestamp } = storeToRefs(updateOsStore); +const { parsedReleaseTimestamp } = storeToRefs(updateOsStore); const { status } = storeToRefs(updateOsActionsStore); const includeNext = ref(osVersionBranch.value !== 'stable'); diff --git a/web/components/UpdateOs/Downgrade.vue b/web/components/UpdateOs/Downgrade.vue index 8ddeade8a..5ffee1004 100644 --- a/web/components/UpdateOs/Downgrade.vue +++ b/web/components/UpdateOs/Downgrade.vue @@ -1,14 +1,11 @@