diff --git a/src/database/models/Job.js b/src/database/models/Job.js index 6997805..c6a9d74 100644 --- a/src/database/models/Job.js +++ b/src/database/models/Job.js @@ -1,6 +1,7 @@ import JobIcon from '../../components/Icons/JobIcon' import InfoCircleIcon from '../../components/Icons/InfoCircleIcon' import ReloadIcon from '../../components/Icons/ReloadIcon' +import CheckIcon from '../../components/Icons/CheckIcon' export const Job = { name: 'job', @@ -16,6 +17,19 @@ export const Job = { icon: InfoCircleIcon, url: (_id) => `/dashboard/production/jobs/info?jobId=${_id}` }, + { + name: 'deploy', + label: 'Deploy', + default: true, + row: true, + icon: CheckIcon, + url: (_id) => + `/dashboard/production/jobs/info?jobId=${_id}?action=deploy`, + disabled: (objectData) => { + console.log('Should be disabled', objectData?.state?.type != 'draft') + return objectData?.state?.type != 'draft' + } + }, { name: 'reload', label: 'Reload', diff --git a/src/database/models/Printer.js b/src/database/models/Printer.js index df3f019..85ca8c1 100644 --- a/src/database/models/Printer.js +++ b/src/database/models/Printer.js @@ -76,12 +76,24 @@ export const Printer = { showName: false, readOnly: true }, + { + name: 'active', + label: 'Active', + type: 'bool', + required: true + }, + { + name: 'online', + label: 'Online', + type: 'bool', + readOnly: true + }, { name: 'vendor', label: 'Vendor', type: 'object', objectType: 'vendor', - required: true + required: false }, { name: 'vendor._id', @@ -149,7 +161,7 @@ export const Printer = { label: 'Filament Stock', type: 'object', objectType: 'filamentStock', - required: true + required: false }, { name: 'currentFilamentStock._id', @@ -158,6 +170,42 @@ export const Printer = { objectType: 'filamentStock', showHyperlink: true, readOnly: true + }, + { + name: 'currentJob', + label: 'Current Job', + type: 'object', + objectType: 'job', + required: false + }, + { + name: 'currentJob._id', + label: 'Current Job ID', + type: 'id', + objectType: 'job', + showHyperlink: true, + readOnly: true + }, + { + name: 'currentSubJob', + label: 'Current Sub Job', + type: 'object', + objectType: 'subJob', + required: false + }, + { + name: 'currentSubJob._id', + label: 'Current Sub Job ID', + type: 'id', + objectType: 'subJob', + showHyperlink: true, + readOnly: true + }, + { + name: 'alerts', + label: 'Alerts', + type: 'alerts', + required: false } ] }