diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..de7c2b3 --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,26 @@ +{ + "permissions": { + "allow": [ + "Read(//c/Users/berwn/.claude/**)", + "Read(//c/Users/berwn/**)", + "Read(//c/dev/b4l_r4l/**)", + "mcp__nocodb__getBaseInfo", + "mcp__nocodb__getTablesList", + "mcp__nocodb__getTableSchema", + "Bash(xargs -I {} head -30 {})", + "Bash(xargs head:*)", + "Bash(npm install:*)", + "Bash(npx svelte-check:*)", + "Bash(npx drizzle-kit:*)", + "Bash(npx svelte-kit:*)", + "Bash(git init:*)", + "Bash(git status:*)", + "Bash(git add:*)", + "Bash(git commit:*)", + "Bash(git:*)", + "mcp__nixos__nix", + "Bash(npm run:*)", + "Bash(ls /c/dev/b4l_r4l/node_modules/bwip-js/dist/*.d.ts)" + ] + } +} diff --git a/src/routes/(app)/components/[id]/+page.svelte b/src/routes/(app)/components/[id]/+page.svelte index beb95f7..684e437 100644 --- a/src/routes/(app)/components/[id]/+page.svelte +++ b/src/routes/(app)/components/[id]/+page.svelte @@ -37,7 +37,7 @@ class="rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-100 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700"> Label - diff --git a/src/routes/(app)/components/[id]/print/+page.svelte b/src/routes/(app)/components/[id]/print/+page.svelte deleted file mode 100644 index 595745a..0000000 --- a/src/routes/(app)/components/[id]/print/+page.svelte +++ /dev/null @@ -1,102 +0,0 @@ - - - - Print Label - {data.component.title} - - -
-
- ← Back -
- - -
-
- -
- Printer setup: Select your Brother printer, paper size "DK-1201" (29mm x 90.3mm). Set margins to minimum. -
- -

Preview ({copies} label{copies > 1 ? 's' : ''}):

-
- -{#each Array(copies) as _, i} -
-
-
- {@html data.qrSvg} -
-
-
- {data.component.title} -
-
- {data.component.componentType} - {#if data.component.brand}· {data.component.brand}{/if} -
- {#if data.component.partNumber} -
P/N: {data.component.partNumber}
- {/if} - {#if data.component.serialNumber} -
S/N: {data.component.serialNumber}
- {/if} -
- {data.shortId} -
-
-
-
-{/each} - - diff --git a/src/routes/(app)/devices/[id]/+page.svelte b/src/routes/(app)/devices/[id]/+page.svelte index c6eb46f..478c989 100644 --- a/src/routes/(app)/devices/[id]/+page.svelte +++ b/src/routes/(app)/devices/[id]/+page.svelte @@ -62,7 +62,7 @@ class="rounded-md border border-gray-300 px-3 py-1.5 text-sm text-gray-600 hover:bg-gray-100 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700"> Label - diff --git a/src/routes/(app)/devices/[id]/print/+page.svelte b/src/routes/(app)/devices/[id]/print/+page.svelte deleted file mode 100644 index 1973de2..0000000 --- a/src/routes/(app)/devices/[id]/print/+page.svelte +++ /dev/null @@ -1,104 +0,0 @@ - - - - Print Label - {data.device.title} - - - -
-
- ← Back -
- - -
-
- -
- Printer setup: Select your Brother printer, paper size "DK-1201" (29mm x 90.3mm). Set margins to minimum. -
- -

Preview ({copies} label{copies > 1 ? 's' : ''}):

-
- - -{#each Array(copies) as _, i} -
-
-
- {@html data.qrSvg} -
-
-
- {data.device.title} -
- {#if data.device.brand || data.device.model} -
- {[data.device.brand, data.device.model].filter(Boolean).join(' ')} -
- {/if} - {#if data.device.serialNumber} -
- S/N: {data.device.serialNumber} -
- {/if} -
- {data.shortId} -
-
-
-
-{/each} - - diff --git a/src/routes/(print)/+layout.server.ts b/src/routes/(print)/+layout.server.ts new file mode 100644 index 0000000..d8d9e1a --- /dev/null +++ b/src/routes/(print)/+layout.server.ts @@ -0,0 +1,8 @@ +import type { LayoutServerLoad } from './$types'; +import { redirect } from '@sveltejs/kit'; + +export const load: LayoutServerLoad = async ({ locals }) => { + if (!locals.user) { + redirect(302, '/login'); + } +}; diff --git a/src/routes/(print)/+layout.svelte b/src/routes/(print)/+layout.svelte new file mode 100644 index 0000000..adf9743 --- /dev/null +++ b/src/routes/(print)/+layout.svelte @@ -0,0 +1,6 @@ + + +{@render children()} diff --git a/src/routes/(app)/components/[id]/print/+page.server.ts b/src/routes/(print)/print/component/[id]/+page.server.ts similarity index 100% rename from src/routes/(app)/components/[id]/print/+page.server.ts rename to src/routes/(print)/print/component/[id]/+page.server.ts diff --git a/src/routes/(print)/print/component/[id]/+page.svelte b/src/routes/(print)/print/component/[id]/+page.svelte new file mode 100644 index 0000000..0f751d6 --- /dev/null +++ b/src/routes/(print)/print/component/[id]/+page.svelte @@ -0,0 +1,80 @@ + + + + Print - {data.component.title} + + +
+
+ ← Back +
+ + +
+
+
+ Setup: Brother QL-820NWB, paper "29mm x 90mm" (DK-1201), margins minimum. +
+
+ +{#each Array(copies) as _} +
+
+
+ {@html data.qrSvg} +
+
+
+ {data.component.title} +
+
+ {data.component.componentType} + {#if data.component.brand}· {data.component.brand}{/if} +
+ {#if data.component.partNumber} +
P/N: {data.component.partNumber}
+ {/if} + {#if data.component.serialNumber} +
S/N: {data.component.serialNumber}
+ {/if} +
+ {data.shortId} +
+
+
+
+{/each} + + diff --git a/src/routes/(app)/devices/[id]/print/+page.server.ts b/src/routes/(print)/print/device/[id]/+page.server.ts similarity index 100% rename from src/routes/(app)/devices/[id]/print/+page.server.ts rename to src/routes/(print)/print/device/[id]/+page.server.ts diff --git a/src/routes/(print)/print/device/[id]/+page.svelte b/src/routes/(print)/print/device/[id]/+page.svelte new file mode 100644 index 0000000..d4fca7c --- /dev/null +++ b/src/routes/(print)/print/device/[id]/+page.svelte @@ -0,0 +1,80 @@ + + + + Print - {data.device.title} + + +
+
+ ← Back +
+ + +
+
+
+ Setup: Brother QL-820NWB, paper "29mm x 90mm" (DK-1201), margins minimum. +
+
+ +{#each Array(copies) as _} +
+
+
+ {@html data.qrSvg} +
+
+
+ {data.device.title} +
+ {#if data.device.brand || data.device.model} +
+ {[data.device.brand, data.device.model].filter(Boolean).join(' ')} +
+ {/if} + {#if data.device.serialNumber} +
+ S/N: {data.device.serialNumber} +
+ {/if} +
+ {data.shortId} +
+
+
+
+{/each} + +