- Spoolman: Add link spool feature, UUID display, and sync feedback

- Link to Spoolman: Manually link existing Spoolman spools to AMS trays
    - Hover over AMS slot to see "Link to Spoolman" button
    - Select from list of unlinked Spoolman spools
    - Automatically sets extra.tag field in Spoolman
  - Spool UUID display: View and copy Bambu Lab spool UUID in AMS hover card
    - Shows first 8 chars with copy button (full UUID to clipboard)
    - Fallback copy method for HTTP contexts
  - Sync feedback: Shows synced count and skipped spools with reasons
    - Expandable list when more than 5 skipped
    - Color swatches for identification
  - Fixed Spoolman 400 Bad Request: extra field values must be valid JSON
  - Updated documentation (wiki, website)
This commit is contained in:
maziggy
2026-01-02 09:20:24 +01:00
parent fd3919574b
commit 5b8d24f2ce
12 changed files with 1070 additions and 480 deletions
+25
View File
@@ -1119,12 +1119,30 @@ export interface SpoolmanStatus {
url: string | null;
}
export interface SkippedSpool {
location: string;
reason: string;
filament_type: string | null;
color: string | null;
}
export interface SpoolmanSyncResult {
success: boolean;
synced_count: number;
skipped_count: number;
skipped: SkippedSpool[];
errors: string[];
}
export interface UnlinkedSpool {
id: number;
filament_name: string | null;
filament_material: string | null;
filament_color_hex: string | null;
remaining_weight: number | null;
location: string | null;
}
// Update types
export interface VersionInfo {
version: string;
@@ -2037,6 +2055,13 @@ export const api = {
request<{ spools: unknown[] }>('/spoolman/spools'),
getSpoolmanFilaments: () =>
request<{ filaments: unknown[] }>('/spoolman/filaments'),
getUnlinkedSpools: () =>
request<UnlinkedSpool[]>('/spoolman/spools/unlinked'),
linkSpool: (spoolId: number, trayUuid: string) =>
request<{ success: boolean; message: string }>(`/spoolman/spools/${spoolId}/link`, {
method: 'POST',
body: JSON.stringify({ tray_uuid: trayUuid }),
}),
// Updates
getVersion: () => request<VersionInfo>('/updates/version'),