chore: fix dev console and allowed-headers

This commit is contained in:
Eli Bosley
2025-04-02 11:28:21 -04:00
parent 3c6683c814
commit 7a421ce4ec
9 changed files with 13 additions and 52 deletions

View File

@@ -52,7 +52,7 @@ export async function bootstrapNestServer(): Promise<NestFastifyApplication> {
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

View File

@@ -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",

View File

@@ -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<NumberFieldRootProps & { class?: HTMLAttributes['class'] }>();
interface Props extends NumberFieldRootProps {
class?: HTMLAttributes['class'];
}
const props = defineProps<Props>();
const emits = defineEmits<NumberFieldRootEmits>();
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props;
return delegated;
});

View File

@@ -1,42 +0,0 @@
<script setup lang="ts">
import { ref } from "vue";
import { Switch, SwitchGroup, SwitchLabel } from "@headlessui/vue";
export interface Props {
label?: string;
// propChecked?: boolean;
}
withDefaults(defineProps<Props>(), {
label: "",
// propChecked: false,
});
const checked = ref(false);
</script>
<template>
<SwitchGroup>
<div class="flex items-center gap-8px p-8px rounded">
<Switch
v-model="checked"
:class="
checked
? 'bg-gradient-to-r from-unraid-red to-orange'
: 'bg-transparent'
"
class="relative inline-flex h-24px w-[48px] items-center rounded-full overflow-hidden"
>
<span
v-show="!checked"
class="absolute z-0 inset-0 opacity-10 bg-primary"
/>
<span
:class="checked ? 'translate-x-[26px]' : 'translate-x-[2px]'"
class="inline-block h-20px w-20px transform rounded-full bg-white transition"
/>
</Switch>
<SwitchLabel>{{ label }}</SwitchLabel>
</div>
</SwitchGroup>
</template>

View File

@@ -1,2 +1 @@
export { default as Switch } from "./Switch.vue";
export { default as SwitchHeadlessUI } from "./SwitchHeadlessUI.vue";

View File

@@ -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,

View File

@@ -47,6 +47,8 @@ const classOverride = computed(() => {
:class="classOverride"
:disabled="!control.enabled"
:required="control.required"
blah="true"
:blah-2="true"
>
<NumberFieldDecrement v-if="stepperEnabled" />
<NumberFieldInput />

View File

@@ -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"
/>
</ControlLayout>
</template>

View File

@@ -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,