Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.

Commit 69ecf35

Browse files
authored
Merge pull request #133 from Maker-Management-Platform/87-implement-file-upload-to-octoprint
87 implement file upload to octoprint
2 parents a2e68fa + fb9d215 commit 69ecf35

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

public/images/octoprint-logo.png

9.35 KB
Loading

src/printers/components/parts/printer-form/PrinterForm.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function PrinterForm({ printer, onPrinterChange }: PrinterFormProps) {
1919
name: '',
2020
type: '',
2121
address: '',
22+
apiKey: ''
2223
},
2324
validate: {
2425
name: hasLength({ min: 3 }, "Use at least 3 characters"),
@@ -82,6 +83,14 @@ export function PrinterForm({ printer, onPrinterChange }: PrinterFormProps) {
8283
label="Type"
8384
{...form.getInputProps('type')}
8485
data={Array.from(printerTypes.values()).map(t => t.type)} />
86+
87+
{form.values.type === 'octoPrint' && <Input.Wrapper label="Api Key">
88+
<Input
89+
placeholder=""
90+
mb="sm"
91+
{...form.getInputProps('apiKey')}
92+
/>
93+
</Input.Wrapper>}
8594
<Input.Wrapper label="Address">
8695
<Input
8796
placeholder="http://192.168.0.123"

src/printers/entities/Printer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface Printer {
77
status: string
88
state: string
99
version: string
10+
apiKey?: string
1011
}
1112

1213
export interface Thermal {
@@ -19,4 +20,6 @@ export interface Job {
1920
fileName: string,
2021
}
2122

22-
export const printerTypes = new Map<string, any>([["klipper", { type: 'klipper', name: 'Klipper', logo: 'images/klipper-logo.png' }]])
23+
export const printerTypes = new Map<string, any>([["klipper", { type: 'klipper', name: 'Klipper', logo: 'images/klipper-logo.png' }], ["octoPrint", { type: 'octoPrint', name: 'op', logo: 'images/octoprint-logo.png' }]])
24+
25+

0 commit comments

Comments
 (0)