mirror of
https://github.com/unraid/api.git
synced 2026-01-04 23:50:37 -06:00
refactor: ServerState type
This commit is contained in:
@@ -52,7 +52,7 @@ export const useServerStore = defineStore('server', () => {
|
||||
const regGen = ref<number>(0);
|
||||
const regGuid = ref<string>('');
|
||||
const site = ref<string>('');
|
||||
const state = ref<string>(''); // @todo implement ServerState ENUM
|
||||
const state = ref<ServerState>();
|
||||
const theme = ref<Theme>();
|
||||
const uptime = ref<number>(0);
|
||||
const username = ref<string>(''); // @todo potentially move to a user store
|
||||
|
||||
@@ -2,24 +2,30 @@ import { KeyIcon } from '@heroicons/vue/24/solid';
|
||||
import { Theme } from '~/store/theme';
|
||||
import { UserProfileLink } from '~/types/userProfile';
|
||||
|
||||
export enum ServerState {
|
||||
BASIC = 'BASIC',
|
||||
PLUS = 'PLUS',
|
||||
PRO = 'PRO',
|
||||
TRIAL = 'TRIAL',
|
||||
EEXPIRED = 'EEXPIRED',
|
||||
ENOKEYFILE = 'ENOKEYFILE',
|
||||
EGUID = 'EGUID',
|
||||
EGUID1 = 'EGUID1',
|
||||
ETRIAL = 'ETRIAL',
|
||||
ENOKEYFILE2 = 'ENOKEYFILE2',
|
||||
ENOKEYFILE1 = 'ENOKEYFILE1',
|
||||
ENOFLASH = 'ENOFLASH',
|
||||
EBLACKLISTED = 'EBLACKLISTED',
|
||||
EBLACKLISTED1 = 'EBLACKLISTED1',
|
||||
EBLACKLISTED2 = 'EBLACKLISTED2',
|
||||
ENOCONN = 'ENOCONN',
|
||||
}
|
||||
export type ServerState = 'BASIC'
|
||||
| 'PLUS'
|
||||
| 'PRO'
|
||||
| 'TRIAL'
|
||||
| 'EEXPIRED'
|
||||
| 'ENOKEYFILE'
|
||||
| 'EGUID'
|
||||
| 'EGUID1'
|
||||
| 'ETRIAL'
|
||||
| 'ENOKEYFILE2'
|
||||
| 'ENOKEYFILE1'
|
||||
| 'ENOFLASH'
|
||||
| 'ENOFLASH1'
|
||||
| 'ENOFLASH2'
|
||||
| 'ENOFLASH3'
|
||||
| 'ENOFLASH4'
|
||||
| 'ENOFLASH5'
|
||||
| 'ENOFLASH6'
|
||||
| 'ENOFLASH7'
|
||||
| 'EBLACKLISTED'
|
||||
| 'EBLACKLISTED1'
|
||||
| 'EBLACKLISTED2'
|
||||
| 'ENOCONN'
|
||||
| undefined;
|
||||
export interface Server {
|
||||
apiKey?: string;
|
||||
avatar?: string;
|
||||
@@ -42,8 +48,7 @@ export interface Server {
|
||||
regGen?: number;
|
||||
regGuid?: string;
|
||||
site?: string;
|
||||
// state?: ServerState;
|
||||
state: string;
|
||||
state?: ServerState;
|
||||
theme: Theme;
|
||||
uptime?: number;
|
||||
username?: string;
|
||||
@@ -67,7 +72,7 @@ export interface ServerAccountCallbackSendPayload {
|
||||
regGen?: number;
|
||||
regGuid?: string;
|
||||
site?: string;
|
||||
state: string;
|
||||
state: ServerState;
|
||||
wanFQDN?: string;
|
||||
}
|
||||
|
||||
@@ -81,7 +86,7 @@ export interface ServerPurchaseCallbackSendPayload {
|
||||
keyTypeForPurchase: ServerKeyTypeForPurchase;
|
||||
locale: string;
|
||||
registered: boolean;
|
||||
state: string;
|
||||
state: ServerState;
|
||||
site: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user