diff --git a/_data/serverState.ts b/_data/serverState.ts index 8297bd4ec..b1b413af4 100644 --- a/_data/serverState.ts +++ b/_data/serverState.ts @@ -29,7 +29,7 @@ const blacklistedGuid = '154B-00EE-0700-9B50CF819816'; // EBLACKLISTED1 // EBLACKLISTED2 // ENOCONN -const state: string = 'TRIAL'; +const state: string = 'ENOKEYFILE2'; const uptime = Date.now() - 60 * 60 * 1000; // 1 hour ago let expireTime = 0; @@ -47,7 +47,7 @@ const serverState = { lanIp: '192.168.0.1', locale: 'en', pluginInstalled: true, - registered: true, + registered: false, site: 'http://localhost:4321', state, uptime, diff --git a/app.vue b/app.vue index 2a9197d4b..eb4348d4d 100644 --- a/app.vue +++ b/app.vue @@ -13,7 +13,7 @@ onBeforeMount(() => {

Vue Components

- + @@ -24,7 +24,7 @@ onBeforeMount(() => {

Web Components

- + diff --git a/components/Auth.ce.vue b/components/Auth.ce.vue index 8f6ed99e7..a81b6ee10 100644 --- a/components/Auth.ce.vue +++ b/components/Auth.ce.vue @@ -1,11 +1,69 @@ diff --git a/nuxt.config.ts b/nuxt.config.ts index edee62bf6..b1e7ff097 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -25,14 +25,18 @@ export default defineNuxtConfig({ { name: 'ConnectComponents', tags: [ - { - name: 'ConnectUserProfile', - path: '@/components/UserProfile.ce', - }, { name: 'ConnectAuth', path: '@/components/Auth.ce', }, + { + name: 'ConnectCallbackHandler', + path: '@/components/CallbackHandler.ce', + }, + { + name: 'ConnectDownloadApiLogs', + path: '@/components/DownloadApiLogs.ce', + }, { name: 'ConnectKeyActions', path: '@/components/KeyActions.ce', @@ -49,10 +53,6 @@ export default defineNuxtConfig({ name: 'ConnectWanIpCheck', path: '@/components/WanIpCheck.ce', }, - { - name: 'ConnectCallbackHandler', - path: '@/components/CallbackHandler.ce', - }, ], }, ], diff --git a/store/server.ts b/store/server.ts index 8f72100d1..1caaf7fc7 100644 --- a/store/server.ts +++ b/store/server.ts @@ -4,6 +4,7 @@ import type { Server, ServerState, ServerStateData, + ServerStateDataAction, } from '~/types/server'; /** * @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components @@ -29,7 +30,7 @@ export const useServerStore = defineStore('server', () => { const locale = ref(''); const name = ref(''); const pluginInstalled = ref(false); - const registered = ref(false); + const registered = ref(); const regGen = ref(0); const regGuid = ref(''); const site = ref(''); @@ -76,15 +77,24 @@ export const useServerStore = defineStore('server', () => { } }); + const signInAction: ServerStateDataAction = { + click: () => { console.debug('signIn') }, + external: true, + icon: GlobeAltIcon, + name: 'signIn', + text: 'Sign In with Unraid.net Account', + }; + const signOutAction: ServerStateDataAction = { + click: () => { console.debug('signOut') }, + external: true, + icon: ArrowRightOnRectangleIcon, + name: 'signOut', + text: 'Sign Out of Unraid.net', + }; const stateDataDefault: ServerStateData = { actions: [ - { - click: () => { console.debug('signIn') }, - external: true, - icon: GlobeAltIcon, - name: 'signIn', - text: 'Sign In with Unraid.net Account', - }, + // sign in + ...(registered.value ? [] : [signInAction]), { click: () => { console.debug('purchase') }, external: true, @@ -92,13 +102,8 @@ export const useServerStore = defineStore('server', () => { name: 'purchase', text: 'Purchase Key', }, - // { - // click: () => { console.debug('signOut') }, - // external: true, - // icon: ArrowRightOnRectangleIcon, - // name: 'signOut', - // text: 'signOut', - // }, + // sign out, + ...(registered.value ? [signOutAction] : []), ], humanReadable: 'Trial', heading: 'Thank you for choosing Unraid OS!', @@ -129,70 +134,99 @@ export const useServerStore = defineStore('server', () => { case 'EGUID': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'EGUID1': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'ENOKEYFILE2': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'ETRIAL': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'ENOKEYFILE1': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'ENOFLASH': - return { - ...stateDataDefault, - }; case 'ENOFLASH1': - return { - ...stateDataDefault, - }; case 'ENOFLASH2': - return { - ...stateDataDefault, - }; case 'ENOFLASH3': - return { - ...stateDataDefault, - }; case 'ENOFLASH4': - return { - ...stateDataDefault, - }; case 'ENOFLASH5': - return { - ...stateDataDefault, - }; case 'ENOFLASH6': - return { - ...stateDataDefault, - }; case 'ENOFLASH7': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'EBLACKLISTED': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'EBLACKLISTED1': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'EBLACKLISTED2': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; case 'ENOCONN': return { ...stateDataDefault, + error: { + heading: `${state.value} temp heading`, + message: `${state.value} temp message – this is an error message`, + reAuthFix: false, + }, }; default: return { diff --git a/tailwind.config.ts b/tailwind.config.ts index c5bbad97f..ee7b9c74c 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -49,6 +49,7 @@ export default >{ '6px': '6px', '8px': '8px', '12px': '12px', + '14px': '14px', '16px': '16px', '20px': '20px', '24px': '24px',