From 7a421ce4eca3825d1e4a84c1ca65689c6e2aef9a Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Wed, 2 Apr 2025 11:28:21 -0400 Subject: [PATCH] chore: fix dev console and allowed-headers --- api/src/unraid-api/main.ts | 2 +- unraid-ui/package.json | 2 +- .../components/form/number/NumberField.vue | 7 +++- .../form/switch/SwitchHeadlessUI.vue | 42 ------------------- unraid-ui/src/components/form/switch/index.ts | 1 - unraid-ui/src/components/index.ts | 2 +- unraid-ui/src/forms/NumberField.vue | 2 + unraid-ui/src/forms/Switch.vue | 4 +- unraid-ui/src/index.ts | 3 +- 9 files changed, 13 insertions(+), 52 deletions(-) delete mode 100644 unraid-ui/src/components/form/switch/SwitchHeadlessUI.vue diff --git a/api/src/unraid-api/main.ts b/api/src/unraid-api/main.ts index 6fdf78320..a2f7b5ed1 100644 --- a/api/src/unraid-api/main.ts +++ b/api/src/unraid-api/main.ts @@ -52,7 +52,7 @@ export async function bootstrapNestServer(): Promise { origin: true, // Allows all origins credentials: true, methods: ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS'], - allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With'], + allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'X-CSRF-TOKEN', 'X-API-KEY'], }); // Setup Nestjs Pino Logger diff --git a/unraid-ui/package.json b/unraid-ui/package.json index 1a1b547bf..fb89d8e57 100644 --- a/unraid-ui/package.json +++ b/unraid-ui/package.json @@ -25,7 +25,7 @@ "build:watch": "vite build -c vite.web-component.ts --mode production --watch", "build:wc": "REM_PLUGIN=true vite build -c vite.web-component.ts --mode production", "clean": "rm -rf dist", - "typecheck": "vue-tsc --noEmit", + "type-check": "vue-tsc --noEmit", "// Deploy to Unraid Server": "", "preunraid:deploy": "pnpm build:wc", "unraid:deploy": "just deploy", diff --git a/unraid-ui/src/components/form/number/NumberField.vue b/unraid-ui/src/components/form/number/NumberField.vue index 837d71c22..bad257570 100644 --- a/unraid-ui/src/components/form/number/NumberField.vue +++ b/unraid-ui/src/components/form/number/NumberField.vue @@ -4,12 +4,15 @@ import type { NumberFieldRootEmits, NumberFieldRootProps } from 'reka-ui'; import { NumberFieldRoot, useForwardPropsEmits } from 'reka-ui'; import { computed, type HTMLAttributes } from 'vue'; -const props = defineProps(); +interface Props extends NumberFieldRootProps { + class?: HTMLAttributes['class']; +} + +const props = defineProps(); const emits = defineEmits(); const delegatedProps = computed(() => { const { class: _, ...delegated } = props; - return delegated; }); diff --git a/unraid-ui/src/components/form/switch/SwitchHeadlessUI.vue b/unraid-ui/src/components/form/switch/SwitchHeadlessUI.vue deleted file mode 100644 index 7fec95f68..000000000 --- a/unraid-ui/src/components/form/switch/SwitchHeadlessUI.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/unraid-ui/src/components/form/switch/index.ts b/unraid-ui/src/components/form/switch/index.ts index f85a6dd5b..c986f8abc 100644 --- a/unraid-ui/src/components/form/switch/index.ts +++ b/unraid-ui/src/components/form/switch/index.ts @@ -1,2 +1 @@ export { default as Switch } from "./Switch.vue"; -export { default as SwitchHeadlessUI } from "./SwitchHeadlessUI.vue"; diff --git a/unraid-ui/src/components/index.ts b/unraid-ui/src/components/index.ts index 7a4fb1fb2..701382028 100644 --- a/unraid-ui/src/components/index.ts +++ b/unraid-ui/src/components/index.ts @@ -35,7 +35,7 @@ export { SelectTrigger, SelectValue, } from '@/components/form/select'; -export { Switch, SwitchHeadlessUI } from '@/components/form/switch'; +export { Switch } from '@/components/form/switch'; export { ScrollArea, ScrollBar } from '@/components/common/scroll-area'; export { Sheet, diff --git a/unraid-ui/src/forms/NumberField.vue b/unraid-ui/src/forms/NumberField.vue index 1921d8fc0..ca1377442 100644 --- a/unraid-ui/src/forms/NumberField.vue +++ b/unraid-ui/src/forms/NumberField.vue @@ -47,6 +47,8 @@ const classOverride = computed(() => { :class="classOverride" :disabled="!control.enabled" :required="control.required" + blah="true" + :blah-2="true" > diff --git a/unraid-ui/src/forms/Switch.vue b/unraid-ui/src/forms/Switch.vue index ab0a47c0e..3dfc83c42 100644 --- a/unraid-ui/src/forms/Switch.vue +++ b/unraid-ui/src/forms/Switch.vue @@ -25,8 +25,8 @@ const description = computed(() => props.uischema.options?.description); :name="control.path" :disabled="!control.enabled" :required="control.required" - :checked="Boolean(control.data)" - @update:checked="onChange" + :modelValue="Boolean(control.data)" + @update:modelValue="onChange" /> diff --git a/unraid-ui/src/index.ts b/unraid-ui/src/index.ts index 075ef4d7b..f3c48c365 100644 --- a/unraid-ui/src/index.ts +++ b/unraid-ui/src/index.ts @@ -69,7 +69,7 @@ import { SelectTrigger, SelectValue, } from '@/components/form/select'; -import { Switch, SwitchHeadlessUI } from '@/components/form/switch'; +import { Switch } from '@/components/form/switch'; import { CardWrapper, PageContainer } from '@/components/layout'; // Composables import useTeleport from '@/composables/useTeleport'; @@ -144,7 +144,6 @@ export { StepperTitle, StepperTrigger, Switch, - SwitchHeadlessUI, tailwindConfig, Lightswitch, Tabs,