From ce611e52f386dc3af6e1c7991d7eb0236a81e9d6 Mon Sep 17 00:00:00 2001 From: Tom Butcher Date: Mon, 20 Jul 2026 02:11:09 +0100 Subject: [PATCH] Add PrinterProfile and FilamentProfile to ObjectModels; enhance GCodeFile value handling --- src/database/ObjectModels.js | 6 ++++++ src/database/models/GCodeFile.js | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/database/ObjectModels.js b/src/database/ObjectModels.js index 15c8663..a7af3e2 100644 --- a/src/database/ObjectModels.js +++ b/src/database/ObjectModels.js @@ -1,4 +1,6 @@ import { Printer } from './models/Printer.js' +import { PrinterProfile } from './models/PrinterProfile.js' +import { FilamentProfile } from './models/FilamentProfile.js' import { Host } from './models/Host.js' import { Filament } from './models/Filament.js' import { Material } from './models/Material.js' @@ -49,6 +51,8 @@ import QuestionCircleIcon from '../components/Icons/QuestionCircleIcon' export const objectModels = [ Printer, + PrinterProfile, + FilamentProfile, Host, Filament, FilamentSku, @@ -100,6 +104,8 @@ export const objectModels = [ // Re-export individual models for direct access export { Printer, + PrinterProfile, + FilamentProfile, Host, Filament, FilamentSku, diff --git a/src/database/models/GCodeFile.js b/src/database/models/GCodeFile.js index ff507eb..c980e1f 100644 --- a/src/database/models/GCodeFile.js +++ b/src/database/models/GCodeFile.js @@ -144,9 +144,14 @@ export const GCodeFile = { label: 'Name', columnFixed: 'left', type: 'text', - value: null, required: true, - columnWidth: 200 + columnWidth: 200, + value: (objectData) => { + if (objectData?.name == undefined) { + return objectData?.file?.name + } + return objectData?.name + } }, { name: 'file',