mirror of
https://github.com/unraid/api.git
synced 2026-01-06 08:39:54 -06:00
fix(web): replaceCheck type
This commit is contained in:
@@ -8,12 +8,17 @@ import type { WretchError } from 'wretch';
|
||||
|
||||
import { validateGuid, type ValidateGuidPayload } from '~/composables/services/keyServer';
|
||||
import { useServerStore } from '~/store/server';
|
||||
import type { UiBadgeProps } from '~/types/ui/badge';
|
||||
/**
|
||||
* @see https://stackoverflow.com/questions/73476371/using-pinia-with-vue-js-web-components
|
||||
* @see https://github.com/vuejs/pinia/discussions/1085
|
||||
*/
|
||||
setActivePinia(createPinia());
|
||||
|
||||
export interface UiBadgePropsExtended extends UiBadgeProps {
|
||||
text?: string;
|
||||
}
|
||||
|
||||
export const useReplaceCheckStore = defineStore('replaceCheck', () => {
|
||||
const serverStore = useServerStore();
|
||||
|
||||
@@ -27,7 +32,7 @@ export const useReplaceCheckStore = defineStore('replaceCheck', () => {
|
||||
cause?: unknown;
|
||||
} | null>(null);
|
||||
const status = ref<'checking' | 'eligible' | 'error' | 'ineligible' | 'ready'>(guid.value ? 'ready' : 'error');
|
||||
const statusOutput = computed(() => {
|
||||
const statusOutput = computed((): UiBadgePropsExtended => {
|
||||
// text values are translated in the component
|
||||
switch (status.value) {
|
||||
case 'eligible':
|
||||
|
||||
12
web/types/ui/badge.ts
Normal file
12
web/types/ui/badge.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { XCircleIcon } from '@heroicons/vue/24/solid';
|
||||
import type { Component } from 'vue';
|
||||
|
||||
export type UiBadgePropsColor = 'alpha' | 'beta' | 'gamma' | 'gray' | 'red' | 'yellow' | 'green' | 'blue' | 'indigo' | 'purple' | 'pink' | 'orange' | 'black' | 'white' | 'transparent' | 'current' | 'custom';
|
||||
|
||||
export interface UiBadgeProps {
|
||||
color?: UiBadgePropsColor;
|
||||
icon?: typeof XCircleIcon | Component;
|
||||
iconRight?: typeof XCircleIcon | Component;
|
||||
iconStyles?: string;
|
||||
size?: '12px' | '14px' | '16px' | '18px' | '20px' | '24px';
|
||||
}
|
||||
Reference in New Issue
Block a user