mirror of
https://github.com/unraid/api.git
synced 2026-01-05 08:00:33 -06:00
fix: eslint fixes rd.1
This commit is contained in:
@@ -15,7 +15,7 @@ export interface Theme {
|
||||
metaColor: string;
|
||||
name: string;
|
||||
textColor: string;
|
||||
}
|
||||
}
|
||||
|
||||
export const useThemeStore = defineStore('theme', () => {
|
||||
// State
|
||||
@@ -23,7 +23,7 @@ export const useThemeStore = defineStore('theme', () => {
|
||||
// Getters
|
||||
const darkMode = computed(() => (theme.value?.name === 'black' || theme.value?.name === 'azure') ?? false);
|
||||
const bannerGradient = computed(() => {
|
||||
if (!theme.value?.banner || !theme.value?.bannerGradient) return undefined;
|
||||
if (!theme.value?.banner || !theme.value?.bannerGradient) { return undefined; }
|
||||
const start = theme.value?.bgColor ? 'var(--color-customgradient-start)' : 'rgba(0, 0, 0, 0)';
|
||||
const end = theme.value?.bgColor ? 'var(--color-customgradient-end)' : 'var(--color-beta)';
|
||||
return `background-image: linear-gradient(90deg, ${start} 0, ${end} 30%);`;
|
||||
@@ -49,13 +49,13 @@ export const useThemeStore = defineStore('theme', () => {
|
||||
};
|
||||
let { alpha, beta, gamma } = darkMode.value ? defaultColors.darkTheme : defaultColors.lightTheme;
|
||||
// overwrite with hex colors set in webGUI @ /Settings/DisplaySettings
|
||||
if (theme.value?.textColor) alpha = theme.value?.textColor;
|
||||
if (theme.value?.textColor) { alpha = theme.value?.textColor; }
|
||||
if (theme.value?.bgColor) {
|
||||
beta = theme.value?.bgColor;
|
||||
body.style.setProperty('--color-customgradient-start', hexToRgba(beta, 0));
|
||||
body.style.setProperty('--color-customgradient-end', hexToRgba(beta, 0.7));
|
||||
}
|
||||
if (theme.value?.metaColor) gamma = theme.value?.metaColor;
|
||||
if (theme.value?.metaColor) { gamma = theme.value?.metaColor; }
|
||||
body.style.setProperty('--color-alpha', alpha);
|
||||
body.style.setProperty('--color-beta', beta);
|
||||
body.style.setProperty('--color-gamma', gamma);
|
||||
|
||||
@@ -3,7 +3,7 @@ import { defineStore, createPinia, setActivePinia } from 'pinia';
|
||||
import { addPreventClose, removePreventClose } from '~/composables/preventClose';
|
||||
import { startTrial, type StartTrialResponse } from '~/composables/services/keyServer';
|
||||
|
||||
import { useCallbackStore, useCallbackActionsStore } from '~/store/callbackActions';
|
||||
import { useCallbackActionsStore } from '~/store/callbackActions';
|
||||
import { useDropdownStore } from '~/store/dropdown';
|
||||
import { useServerStore } from '~/store/server';
|
||||
import type { ExternalPayload, TrialExtend, TrialStart } from '~/store/callback';
|
||||
@@ -15,7 +15,6 @@ import type { ExternalPayload, TrialExtend, TrialStart } from '~/store/callback'
|
||||
setActivePinia(createPinia());
|
||||
|
||||
export const useTrialStore = defineStore('trial', () => {
|
||||
const callbackStore = useCallbackStore();
|
||||
const callbackActionsStore = useCallbackActionsStore();
|
||||
const dropdownStore = useDropdownStore();
|
||||
const serverStore = useServerStore();
|
||||
@@ -35,25 +34,25 @@ export const useTrialStore = defineStore('trial', () => {
|
||||
return {
|
||||
heading: 'Trial Key Creation Failed',
|
||||
subheading: 'Key server did not return a trial key. Please try again later.',
|
||||
}
|
||||
};
|
||||
case 'trialExtend':
|
||||
return {
|
||||
heading: 'Extending your free trial by 15 days',
|
||||
subheading: 'Please keep this window open',
|
||||
}
|
||||
};
|
||||
case 'trialStart':
|
||||
return {
|
||||
heading: 'Starting your free 30 day trial',
|
||||
subheading: 'Please keep this window open',
|
||||
}
|
||||
};
|
||||
case 'success':
|
||||
return {
|
||||
heading: 'Trial Key Created',
|
||||
subheading: 'Please wait while the page reloads to install your trial key',
|
||||
}
|
||||
};
|
||||
case 'ready':
|
||||
return null;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const requestTrial = async (type?: TrialExtend | TrialStart) => {
|
||||
@@ -89,7 +88,9 @@ export const useTrialStore = defineStore('trial', () => {
|
||||
}
|
||||
};
|
||||
|
||||
const setTrialStatus = (status: TrialStatus) => trialStatus.value = status;
|
||||
const setTrialStatus = (status: TrialStatus) => {
|
||||
trialStatus.value = status;
|
||||
};
|
||||
|
||||
watch(trialStatus, (newVal, oldVal) => {
|
||||
console.debug('[trialStatus]', newVal, oldVal);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import { from, ApolloClient, createHttpLink, InMemoryCache, split } from '@apollo/client/core/core.cjs';
|
||||
import { onError } from '@apollo/client/link/error'
|
||||
import { onError } from '@apollo/client/link/error';
|
||||
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
|
||||
import { getMainDefinition } from '@apollo/client/utilities';
|
||||
import { provideApolloClient } from '@vue/apollo-composable';
|
||||
import { logErrorMessages } from '@vue/apollo-util'
|
||||
import { logErrorMessages } from '@vue/apollo-util';
|
||||
import { createClient } from 'graphql-ws';
|
||||
import { defineStore, createPinia, setActivePinia } from 'pinia';
|
||||
|
||||
import { useAccountStore } from '~/store/account';
|
||||
import { useErrorsStore } from '~/store/errors';
|
||||
// import { useErrorsStore } from '~/store/errors';
|
||||
import { useServerStore } from '~/store/server';
|
||||
/**
|
||||
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
|
||||
* @see https://github.com/vuejs/pinia/discussions/1085
|
||||
*/
|
||||
setActivePinia(createPinia());
|
||||
let baseUrl = window.location.origin
|
||||
let baseUrl = window.location.origin;
|
||||
const localDevUrl = baseUrl.includes(':4321'); /** @todo use ENV */
|
||||
if (localDevUrl) {
|
||||
/** @temp local dev mode */
|
||||
@@ -30,7 +30,7 @@ console.debug('[useUnraidApiStore] wsEndpoint', wsEndpoint.toString());
|
||||
export const useUnraidApiStore = defineStore('unraidApi', () => {
|
||||
console.debug('[useUnraidApiStore]');
|
||||
const accountStore = useAccountStore();
|
||||
const errorsStore = useErrorsStore();
|
||||
// const errorsStore = useErrorsStore();
|
||||
const serverStore = useServerStore();
|
||||
|
||||
const unraidApiClient = ref<ApolloClient<any>>();
|
||||
@@ -50,7 +50,7 @@ export const useUnraidApiStore = defineStore('unraidApi', () => {
|
||||
}
|
||||
const headers = { 'x-api-key': serverStore.apiKey };
|
||||
|
||||
const httpLink = new createHttpLink({
|
||||
const httpLink = createHttpLink({
|
||||
uri: httpEndpoint.toString(),
|
||||
headers,
|
||||
});
|
||||
@@ -67,7 +67,7 @@ export const useUnraidApiStore = defineStore('unraidApi', () => {
|
||||
/**
|
||||
* @todo integrate errorsStore errorsStore.setError(error);
|
||||
*/
|
||||
const errorLink = onError((errors) => {
|
||||
const errorLink = onError((errors) => {
|
||||
logErrorMessages(errors);
|
||||
// // { graphQLErrors, networkError }
|
||||
// if (graphQLErrors) {
|
||||
@@ -86,8 +86,8 @@ export const useUnraidApiStore = defineStore('unraidApi', () => {
|
||||
({ query }) => {
|
||||
const definition = getMainDefinition(query);
|
||||
return (
|
||||
definition.kind === "OperationDefinition" &&
|
||||
definition.operation === "subscription"
|
||||
definition.kind === 'OperationDefinition' &&
|
||||
definition.operation === 'subscription'
|
||||
);
|
||||
},
|
||||
wsLink,
|
||||
@@ -114,7 +114,7 @@ export const useUnraidApiStore = defineStore('unraidApi', () => {
|
||||
|
||||
const closeUnraidApiClient = async () => {
|
||||
console.debug('[useUnraidApiStore.closeUnraidApiClient] STARTED');
|
||||
if (!unraidApiClient.value) return console.debug('[useUnraidApiStore.closeUnraidApiClient] unraidApiClient not set');
|
||||
if (!unraidApiClient.value) { return console.debug('[useUnraidApiStore.closeUnraidApiClient] unraidApiClient not set'); }
|
||||
if (unraidApiClient.value) {
|
||||
await unraidApiClient.value.clearStore();
|
||||
unraidApiClient.value.stop();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import type { Config } from 'tailwindcss'
|
||||
import defaultTheme from 'tailwindcss/defaultTheme'
|
||||
import type { Config } from 'tailwindcss';
|
||||
|
||||
export default <Partial<Config>>{
|
||||
safelist: [
|
||||
@@ -100,8 +99,8 @@ export default <Partial<Config>>{
|
||||
},
|
||||
screens: {
|
||||
'2xs': '470px',
|
||||
'xs': '530px',
|
||||
xs: '530px',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { KeyIcon } from '@heroicons/vue/24/solid';
|
||||
import { Theme } from '~/store/theme';
|
||||
import { UserProfileLink } from '~/types/userProfile';
|
||||
|
||||
@@ -30,6 +29,8 @@ export type ServerState = 'BASIC'
|
||||
| 'EBLACKLISTED2'
|
||||
| 'ENOCONN'
|
||||
| undefined;
|
||||
|
||||
export type ServerconnectPluginInstalled = 'dynamix.unraid.net.plg' | 'dynamix.unraid.net.staging.plg' | 'dynamix.unraid.net.plg_installFailed' | 'dynamix.unraid.net.staging.plg_installFailed' | '';
|
||||
export interface Server {
|
||||
apiKey?: string;
|
||||
apiVersion?: string;
|
||||
@@ -128,5 +129,3 @@ export interface ServerStateData {
|
||||
error?: ServerStateDataError | boolean;
|
||||
withKey?: boolean; // @todo potentially remove
|
||||
}
|
||||
|
||||
export type ServerconnectPluginInstalled = 'dynamix.unraid.net.plg' | 'dynamix.unraid.net.staging.plg' | 'dynamix.unraid.net.plg_installFailed' | 'dynamix.unraid.net.staging.plg_installFailed' | '';
|
||||
|
||||
@@ -7,4 +7,4 @@ export interface TimeStringsObject {
|
||||
seconds: number;
|
||||
firstDateWasLater: boolean;
|
||||
displaySeconds?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user