Compare commits
No commits in common. "c2f55a596784d6f210526e9be0709ec8ba1a998d" and "48631c98c366c5576bf5f3a57ee0365d3ab2238f" have entirely different histories.
c2f55a5967
...
48631c98c3
@ -48,7 +48,7 @@ To start the development server:
|
|||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
The app will be available at [http://localhost:5173](http://localhost:5173).
|
The app will be available at [http://localhost:3000](http://localhost:3000).
|
||||||
|
|
||||||
### Building for Production
|
### Building for Production
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,6 @@
|
|||||||
"@codemirror/lang-yaml": "^6.1.2",
|
"@codemirror/lang-yaml": "^6.1.2",
|
||||||
"@codemirror/theme-one-dark": "^6.1.3",
|
"@codemirror/theme-one-dark": "^6.1.3",
|
||||||
"@simplewebauthn/browser": "^13.1.2",
|
"@simplewebauthn/browser": "^13.1.2",
|
||||||
"@tanstack/react-query": "^5.90.10",
|
|
||||||
"@tsparticles/react": "^3.0.0",
|
"@tsparticles/react": "^3.0.0",
|
||||||
"@tsparticles/slim": "^3.9.1",
|
"@tsparticles/slim": "^3.9.1",
|
||||||
"@uiw/react-codemirror": "^4.25.1",
|
"@uiw/react-codemirror": "^4.25.1",
|
||||||
@ -72,10 +71,10 @@
|
|||||||
"description": "3D Printer ERP and Control Software.",
|
"description": "3D Printer ERP and Control Software.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env NODE_ENV=development vite",
|
"dev": "cross-env NODE_ENV=development vite",
|
||||||
"electron": "cross-env ELECTRON_START_URL=http://0.0.0.0:5173 && cross-env NODE_ENV=development && electron .",
|
"electron": "cross-env ELECTRON_START_URL=http://0.0.0.0:3000 && cross-env NODE_ENV=development && electron .",
|
||||||
"start": "serve -s build",
|
"start": "serve -s build",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"dev:electron": "concurrently \"cross-env NODE_ENV=development vite --no-open\" \"cross-env ELECTRON_START_URL=http://localhost:5173 cross-env NODE_ENV=development electron public/electron.js\"",
|
"dev:electron": "concurrently \"cross-env NODE_ENV=development vite --no-open\" \"cross-env ELECTRON_START_URL=http://localhost:3000 cross-env NODE_ENV=development electron public/electron.js\"",
|
||||||
"build:electron": "vite build && electron-builder"
|
"build:electron": "vite build && electron-builder"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
|
|||||||
@ -15,7 +15,7 @@ const NewFilamentStock = ({ onOk, reset }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewObjectForm
|
<NewObjectForm
|
||||||
type={'filamentStock'}
|
type={'filamentstock'}
|
||||||
reset={reset}
|
reset={reset}
|
||||||
defaultValues={{ state: { type: 'unconsumed' } }}
|
defaultValues={{ state: { type: 'unconsumed' } }}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useState, useRef, useEffect, useContext } from 'react'
|
import { useState, useRef, useEffect } from 'react'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Space, Flex, Card, Splitter, Divider } from 'antd'
|
import { Space, Flex, Card, Splitter, Divider } from 'antd'
|
||||||
import loglevel from 'loglevel'
|
import loglevel from 'loglevel'
|
||||||
@ -26,7 +26,6 @@ import FilamentStockIcon from '../../../Icons/FilamentStockIcon.jsx'
|
|||||||
import MissingPlaceholder from '../../common/MissingPlaceholder.jsx'
|
import MissingPlaceholder from '../../common/MissingPlaceholder.jsx'
|
||||||
import { useMediaQuery } from 'react-responsive'
|
import { useMediaQuery } from 'react-responsive'
|
||||||
import AlertsDisplay from '../../common/AlertsDisplay.jsx'
|
import AlertsDisplay from '../../common/AlertsDisplay.jsx'
|
||||||
import { ApiServerContext } from '../../context/ApiServerContext.jsx'
|
|
||||||
|
|
||||||
const log = loglevel.getLogger('ControlPrinter')
|
const log = loglevel.getLogger('ControlPrinter')
|
||||||
log.setLevel(config.logLevel)
|
log.setLevel(config.logLevel)
|
||||||
@ -50,7 +49,6 @@ const ControlPrinter = () => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const { connected, sendObjectAction } = useContext(ApiServerContext)
|
|
||||||
const [sideBarVisible, setSideBarVisible] = useState(
|
const [sideBarVisible, setSideBarVisible] = useState(
|
||||||
collapseState.temperature ||
|
collapseState.temperature ||
|
||||||
collapseState.position ||
|
collapseState.position ||
|
||||||
@ -90,38 +88,6 @@ const ControlPrinter = () => {
|
|||||||
finishEdit: () => {
|
finishEdit: () => {
|
||||||
objectFormRef?.current.handleUpdate()
|
objectFormRef?.current.handleUpdate()
|
||||||
return true
|
return true
|
||||||
},
|
|
||||||
restartFirmware: () => {
|
|
||||||
if (connected == true) {
|
|
||||||
sendObjectAction(printerId, 'printer', {
|
|
||||||
type: 'restartPrinterFirmware'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
restartMoonraker: () => {
|
|
||||||
if (connected == true) {
|
|
||||||
sendObjectAction(printerId, 'printer', {
|
|
||||||
type: 'restartMoonraker'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
restart: () => {
|
|
||||||
if (connected == true) {
|
|
||||||
sendObjectAction(printerId, 'printer', {
|
|
||||||
type: 'restartPrinter'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
startQueue: () => {
|
|
||||||
if (connected == true) {
|
|
||||||
sendObjectAction(printerId, 'printer', {
|
|
||||||
type: 'startQueue'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +128,6 @@ const ControlPrinter = () => {
|
|||||||
id={printerId}
|
id={printerId}
|
||||||
disabled={objectFormState.loading}
|
disabled={objectFormState.loading}
|
||||||
visibleActions={{ edit: false }}
|
visibleActions={{ edit: false }}
|
||||||
objectData={objectFormState.objectData}
|
|
||||||
/>
|
/>
|
||||||
<ViewButton
|
<ViewButton
|
||||||
disabled={objectFormState.loading}
|
disabled={objectFormState.loading}
|
||||||
@ -229,19 +194,6 @@ const ControlPrinter = () => {
|
|||||||
actions={actions}
|
actions={actions}
|
||||||
loading={objectFormState.loading}
|
loading={objectFormState.loading}
|
||||||
ref={actionHandlerRef}
|
ref={actionHandlerRef}
|
||||||
>
|
|
||||||
<Flex vertical>
|
|
||||||
<Splitter className={'farmcontrol-splitter'}>
|
|
||||||
<Splitter.Panel>
|
|
||||||
<Flex vertical gap={'large'}>
|
|
||||||
<InfoCollapse
|
|
||||||
title={'Printer'}
|
|
||||||
icon={<PrinterIcon />}
|
|
||||||
collapseKey='printer'
|
|
||||||
active={collapseState.printer}
|
|
||||||
onToggle={(expanded) =>
|
|
||||||
updateCollapseState('printer', expanded)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<ObjectForm
|
<ObjectForm
|
||||||
id={printerId}
|
id={printerId}
|
||||||
@ -257,6 +209,19 @@ const ControlPrinter = () => {
|
|||||||
objectData: printerObjectData
|
objectData: printerObjectData
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
|
<Flex vertical>
|
||||||
|
<Splitter className={'farmcontrol-splitter'}>
|
||||||
|
<Splitter.Panel>
|
||||||
|
<Flex vertical gap={'large'}>
|
||||||
|
<InfoCollapse
|
||||||
|
title={'Printer'}
|
||||||
|
icon={<PrinterIcon />}
|
||||||
|
collapseKey='printer'
|
||||||
|
active={collapseState.printer}
|
||||||
|
onToggle={(expanded) =>
|
||||||
|
updateCollapseState('printer', expanded)
|
||||||
|
}
|
||||||
|
>
|
||||||
<ObjectInfo
|
<ObjectInfo
|
||||||
loading={printerObjectLoading}
|
loading={printerObjectLoading}
|
||||||
column={sideBarVisible ? 1 : undefined}
|
column={sideBarVisible ? 1 : undefined}
|
||||||
@ -271,15 +236,11 @@ const ControlPrinter = () => {
|
|||||||
'moonraker.protocol': false,
|
'moonraker.protocol': false,
|
||||||
'moonraker.host': false,
|
'moonraker.host': false,
|
||||||
tags: false,
|
tags: false,
|
||||||
firmware: false,
|
firmware: false
|
||||||
alerts: false
|
|
||||||
}}
|
}}
|
||||||
objectData={printerObjectData}
|
objectData={printerObjectData}
|
||||||
type='printer'
|
type='printer'
|
||||||
/>
|
/>
|
||||||
)
|
|
||||||
}}
|
|
||||||
</ObjectForm>
|
|
||||||
</InfoCollapse>
|
</InfoCollapse>
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
title={'Job'}
|
title={'Job'}
|
||||||
@ -290,9 +251,9 @@ const ControlPrinter = () => {
|
|||||||
updateCollapseState('job', expanded)
|
updateCollapseState('job', expanded)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{objectFormState.objectData?.currentJob?._id ? (
|
{printerObjectData?.currentJob?._id ? (
|
||||||
<ObjectForm
|
<ObjectForm
|
||||||
id={objectFormState.objectData.currentJob._id}
|
id={printerObjectData.currentJob._id}
|
||||||
type='job'
|
type='job'
|
||||||
onStateChange={() => {}}
|
onStateChange={() => {}}
|
||||||
>
|
>
|
||||||
@ -330,9 +291,9 @@ const ControlPrinter = () => {
|
|||||||
updateCollapseState('subJob', expanded)
|
updateCollapseState('subJob', expanded)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{objectFormState.objectData?.currentSubJob?._id ? (
|
{printerObjectData?.currentSubJob?._id ? (
|
||||||
<ObjectForm
|
<ObjectForm
|
||||||
id={objectFormState.objectData.currentSubJob._id}
|
id={printerObjectData.currentSubJob._id}
|
||||||
type='subjob'
|
type='subjob'
|
||||||
onStateChange={() => {}}
|
onStateChange={() => {}}
|
||||||
>
|
>
|
||||||
@ -370,11 +331,9 @@ const ControlPrinter = () => {
|
|||||||
updateCollapseState('filamentStock', expanded)
|
updateCollapseState('filamentStock', expanded)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{objectFormState.objectData?.currentFilamentStock?._id ? (
|
{printerObjectData?.currentFilamentStock?._id ? (
|
||||||
<ObjectForm
|
<ObjectForm
|
||||||
id={
|
id={printerObjectData.currentFilamentStock._id}
|
||||||
objectFormState.objectData.currentFilamentStock._id
|
|
||||||
}
|
|
||||||
type='filamentStock'
|
type='filamentStock'
|
||||||
onStateChange={() => {}}
|
onStateChange={() => {}}
|
||||||
>
|
>
|
||||||
@ -423,6 +382,9 @@ const ControlPrinter = () => {
|
|||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</ObjectForm>
|
||||||
</ActionHandler>
|
</ActionHandler>
|
||||||
<InfoCollapse
|
<InfoCollapse
|
||||||
title='Notes'
|
title='Notes'
|
||||||
|
|||||||
@ -61,10 +61,9 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
|||||||
// Calculate computed values for initial data
|
// Calculate computed values for initial data
|
||||||
const computedValues = calculateComputedValues(defaultValues, model)
|
const computedValues = calculateComputedValues(defaultValues, model)
|
||||||
const initialFormData = { ...defaultValues, ...computedValues }
|
const initialFormData = { ...defaultValues, ...computedValues }
|
||||||
|
|
||||||
form.setFieldsValue(initialFormData)
|
form.setFieldsValue(initialFormData)
|
||||||
setObjectData((prev) => {
|
setObjectData(initialFormData)
|
||||||
return merge({}, prev, initialFormData)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}, [form, defaultValues, calculateComputedValues, model])
|
}, [form, defaultValues, calculateComputedValues, model])
|
||||||
|
|
||||||
@ -114,6 +113,7 @@ const NewObjectForm = ({ type, style, defaultValues = {}, children }) => {
|
|||||||
|
|
||||||
// Merge all values (user input + computed values)
|
// Merge all values (user input + computed values)
|
||||||
const allValues = { ...values, ...computedValues }
|
const allValues = { ...values, ...computedValues }
|
||||||
|
|
||||||
setObjectData((prev) => {
|
setObjectData((prev) => {
|
||||||
return merge({}, prev, allValues)
|
return merge({}, prev, allValues)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -63,8 +63,7 @@ function mapActionsToMenuItems(actions, currentUrlWithActions, id, objectData) {
|
|||||||
item.children = mapActionsToMenuItems(
|
item.children = mapActionsToMenuItems(
|
||||||
action.children,
|
action.children,
|
||||||
currentUrlWithActions,
|
currentUrlWithActions,
|
||||||
id,
|
id
|
||||||
objectData
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
|
|||||||
@ -127,7 +127,7 @@ const ObjectProperty = ({
|
|||||||
formItemName = name ? name.split('.') : undefined
|
formItemName = name ? name.split('.') : undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
var textParams = { style: { whiteSpace: 'nowrap', minWidth: '0' } }
|
var textParams = { style: { whiteSpace: 'nowrap' } }
|
||||||
|
|
||||||
if (disabled == true) {
|
if (disabled == true) {
|
||||||
textParams = { ...textParams, delete: true, type: 'secondary' }
|
textParams = { ...textParams, delete: true, type: 'secondary' }
|
||||||
|
|||||||
@ -10,30 +10,19 @@ const UrlDisplay = ({ url, showCopy = true, showLink = false }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex style={{ minWidth: 0 }}>
|
<Flex>
|
||||||
{showLink ? (
|
{showLink ? (
|
||||||
<Link
|
<Link
|
||||||
href={url}
|
href={url}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
style={{
|
style={{ marginRight: 8 }}
|
||||||
marginRight: 8,
|
|
||||||
minWidth: 0,
|
|
||||||
flex: 1,
|
|
||||||
overflow: 'hidden',
|
|
||||||
width: 0
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Text ellipsis style={{ display: 'block' }}>
|
<Text ellipsis>{url}</Text>
|
||||||
{url}
|
|
||||||
</Text>
|
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Text
|
<Text style={{ marginRight: 8 }} ellipsis>
|
||||||
style={{ marginRight: 8, minWidth: 0, flex: 1, width: 0 }}
|
|
||||||
ellipsis
|
|
||||||
>
|
|
||||||
{url}
|
{url}
|
||||||
</Text>
|
</Text>
|
||||||
<Tooltip title='Open URL' arrow={false}>
|
<Tooltip title='Open URL' arrow={false}>
|
||||||
@ -41,7 +30,7 @@ const UrlDisplay = ({ url, showCopy = true, showLink = false }) => {
|
|||||||
icon={<LinkIcon />}
|
icon={<LinkIcon />}
|
||||||
type='text'
|
type='text'
|
||||||
size='small'
|
size='small'
|
||||||
style={{ minWidth: 25, flexShrink: 0 }}
|
style={{ minWidth: 25 }}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
window.open(url, '_blank', 'noopener,noreferrer')
|
window.open(url, '_blank', 'noopener,noreferrer')
|
||||||
|
|||||||
@ -83,11 +83,6 @@ const AuthProvider = ({ children }) => {
|
|||||||
// Read token from cookies if present
|
// Read token from cookies if present
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
try {
|
try {
|
||||||
console.log(
|
|
||||||
'Retreiving token from cookies...',
|
|
||||||
getAuthCookies(),
|
|
||||||
validateAuthCookies()
|
|
||||||
)
|
|
||||||
// First validate existing cookies to clean up expired ones
|
// First validate existing cookies to clean up expired ones
|
||||||
if (validateAuthCookies()) {
|
if (validateAuthCookies()) {
|
||||||
const {
|
const {
|
||||||
@ -215,11 +210,7 @@ const AuthProvider = ({ children }) => {
|
|||||||
setUserProfile(authData)
|
setUserProfile(authData)
|
||||||
|
|
||||||
// Store in cookies for persistence between tabs
|
// Store in cookies for persistence between tabs
|
||||||
const cookieSuccess = setAuthCookies({
|
const cookieSuccess = setAuthCookies(authData)
|
||||||
user: authData,
|
|
||||||
access_token: authData.access_token,
|
|
||||||
expires_at: authData.expires_at
|
|
||||||
})
|
|
||||||
if (!cookieSuccess) {
|
if (!cookieSuccess) {
|
||||||
messageApi.warning(
|
messageApi.warning(
|
||||||
'Authentication successful but failed to save login state. You may need to log in again if you close this tab.'
|
'Authentication successful but failed to save login state. You may need to log in again if you close this tab.'
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
const config = {
|
const config = {
|
||||||
development: {
|
development: {
|
||||||
backendUrl: 'https://dev.tombutcher.work/api',
|
backendUrl: 'http://192.168.68.53:8080',
|
||||||
printServerUrl: 'ws://192.168.68.53:8081',
|
printServerUrl: 'ws://192.168.68.53:8081',
|
||||||
apiServerUrl: 'https://dev-wss.tombutcher.work',
|
apiServerUrl: 'ws://192.168.68.53:9090',
|
||||||
logLevel: 'trace'
|
logLevel: 'trace'
|
||||||
},
|
},
|
||||||
production: {
|
production: {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ export const FilamentStock = {
|
|||||||
required: true,
|
required: true,
|
||||||
columnWidth: 300,
|
columnWidth: 300,
|
||||||
value: (objectData) => {
|
value: (objectData) => {
|
||||||
if (objectData?.state?.type === 'unconsumed') {
|
if (!objectData.currentWeight) {
|
||||||
return objectData?.startingWeight
|
return objectData?.startingWeight
|
||||||
} else {
|
} else {
|
||||||
return objectData.currentWeight
|
return objectData.currentWeight
|
||||||
|
|||||||
@ -3,8 +3,6 @@ import InfoCircleIcon from '../../components/Icons/InfoCircleIcon'
|
|||||||
import ReloadIcon from '../../components/Icons/ReloadIcon'
|
import ReloadIcon from '../../components/Icons/ReloadIcon'
|
||||||
import EditIcon from '../../components/Icons/EditIcon'
|
import EditIcon from '../../components/Icons/EditIcon'
|
||||||
import PlayCircleIcon from '../../components/Icons/PlayCircleIcon'
|
import PlayCircleIcon from '../../components/Icons/PlayCircleIcon'
|
||||||
import PauseCircleIcon from '../../components/Icons/PauseCircleIcon'
|
|
||||||
import StopCircleIcon from '../../components/Icons/StopCircleIcon'
|
|
||||||
|
|
||||||
export const Printer = {
|
export const Printer = {
|
||||||
name: 'printer',
|
name: 'printer',
|
||||||
@ -42,97 +40,6 @@ export const Printer = {
|
|||||||
icon: EditIcon,
|
icon: EditIcon,
|
||||||
url: (_id) =>
|
url: (_id) =>
|
||||||
`/dashboard/production/printers/info?printerId=${_id}&action=edit`
|
`/dashboard/production/printers/info?printerId=${_id}&action=edit`
|
||||||
},
|
|
||||||
{ type: 'divider' },
|
|
||||||
{
|
|
||||||
name: 'restartSubmenu',
|
|
||||||
label: 'Restart',
|
|
||||||
icon: ReloadIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.online == false
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'restart',
|
|
||||||
label: 'Restart',
|
|
||||||
icon: ReloadIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.online == false
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=restart`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'restartFirmware',
|
|
||||||
label: 'Restart Firmware',
|
|
||||||
icon: ReloadIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.online == false
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=restartFirmware`
|
|
||||||
},
|
|
||||||
{ type: 'divider' },
|
|
||||||
{
|
|
||||||
name: 'restartMoonraker',
|
|
||||||
label: 'Restart Moonraker',
|
|
||||||
icon: ReloadIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.online == false
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=restartMoonraker`
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'queue',
|
|
||||||
label: 'Queue',
|
|
||||||
icon: PlayCircleIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.online == false
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'Start',
|
|
||||||
label: 'Start',
|
|
||||||
icon: PlayCircleIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
console.log(objectData?.subJobs?.length)
|
|
||||||
return (
|
|
||||||
objectData?.state?.type == 'error' ||
|
|
||||||
objectData?.state?.type == 'printing' ||
|
|
||||||
objectData?.subJobs?.length == 0 ||
|
|
||||||
objectData?.subJobs?.length == undefined
|
|
||||||
)
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=startQueue`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'pause',
|
|
||||||
label: 'Pause',
|
|
||||||
icon: PauseCircleIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return objectData?.state?.type != 'printing'
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=pauseQueue`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Stop',
|
|
||||||
label: 'Stop',
|
|
||||||
icon: StopCircleIcon,
|
|
||||||
disabled: (objectData) => {
|
|
||||||
return (
|
|
||||||
objectData?.state?.type != 'printing' ||
|
|
||||||
objectData?.state?.type != 'error'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
url: (_id) =>
|
|
||||||
`/dashboard/production/printers/control?printerId=${_id}&action=stopQueue`
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
columns: ['name', '_id', 'state', 'tags', 'connectedAt'],
|
columns: ['name', '_id', 'state', 'tags', 'connectedAt'],
|
||||||
|
|||||||
@ -11,9 +11,8 @@ export default defineConfig({
|
|||||||
outDir: 'build'
|
outDir: 'build'
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
allowedHosts: ['dev.tombutcher.work'],
|
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
port: 5173,
|
open: false,
|
||||||
open: false
|
port: 3000
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
31
yarn.lock
31
yarn.lock
@ -1289,10 +1289,10 @@
|
|||||||
resolved "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz"
|
resolved "https://registry.npmjs.org/@epic-web/invariant/-/invariant-1.0.0.tgz"
|
||||||
integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==
|
integrity sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==
|
||||||
|
|
||||||
"@esbuild/darwin-x64@0.25.9":
|
"@esbuild/darwin-arm64@0.25.9":
|
||||||
version "0.25.9"
|
version "0.25.9"
|
||||||
resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz"
|
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz"
|
||||||
integrity sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==
|
integrity sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==
|
||||||
|
|
||||||
"@eslint-community/eslint-utils@^4.2.0":
|
"@eslint-community/eslint-utils@^4.2.0":
|
||||||
version "4.7.0"
|
version "4.7.0"
|
||||||
@ -1812,10 +1812,10 @@
|
|||||||
estree-walker "^2.0.2"
|
estree-walker "^2.0.2"
|
||||||
picomatch "^4.0.2"
|
picomatch "^4.0.2"
|
||||||
|
|
||||||
"@rollup/rollup-darwin-x64@4.48.0":
|
"@rollup/rollup-darwin-arm64@4.48.0":
|
||||||
version "4.48.0"
|
version "4.48.0"
|
||||||
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.48.0.tgz"
|
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.48.0.tgz"
|
||||||
integrity sha512-Q9RMXnQVJ5S1SYpNSTwXDpoQLgJ/fbInWOyjbCnnqTElEyeNvLAB3QvG5xmMQMhFN74bB5ZZJYkKaFPcOG8sGg==
|
integrity sha512-QhR2KA18fPlJWFefySJPDYZELaVqIUVnYgAOdtJ+B/uH96CFg2l1TQpX19XpUMWUqMyIiyY45wje8K6F4w4/CA==
|
||||||
|
|
||||||
"@rtsao/scc@^1.1.0":
|
"@rtsao/scc@^1.1.0":
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
@ -1940,18 +1940,6 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
defer-to-connect "^2.0.0"
|
defer-to-connect "^2.0.0"
|
||||||
|
|
||||||
"@tanstack/query-core@5.90.10":
|
|
||||||
version "5.90.10"
|
|
||||||
resolved "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.10.tgz"
|
|
||||||
integrity sha512-EhZVFu9rl7GfRNuJLJ3Y7wtbTnENsvzp+YpcAV7kCYiXni1v8qZh++lpw4ch4rrwC0u/EZRnBHIehzCGzwXDSQ==
|
|
||||||
|
|
||||||
"@tanstack/react-query@^5.90.10":
|
|
||||||
version "5.90.10"
|
|
||||||
resolved "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.10.tgz"
|
|
||||||
integrity sha512-BKLss9Y8PQ9IUjPYQiv3/Zmlx92uxffUOX8ZZNoQlCIZBJPT5M+GOMQj7xislvVQ6l1BstBjcX0XB/aHfFYVNw==
|
|
||||||
dependencies:
|
|
||||||
"@tanstack/query-core" "5.90.10"
|
|
||||||
|
|
||||||
"@tootallnate/once@2":
|
"@tootallnate/once@2":
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
|
resolved "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz"
|
||||||
@ -8780,7 +8768,7 @@ react-router@7.8.2:
|
|||||||
cookie "^1.0.1"
|
cookie "^1.0.1"
|
||||||
set-cookie-parser "^2.6.0"
|
set-cookie-parser "^2.6.0"
|
||||||
|
|
||||||
react@*, "react@^18 || ^19", "react@^18.0.0 || ^19.1.0", react@^19.1.1, "react@>= 16.8.0", "react@>= 16.x", react@>=16, react@>=16.0.0, react@>=16.11.0, react@>=16.8, react@>=16.8.0, react@>=16.8.4, react@>=16.9.0, react@>=17.0.0, react@>=18:
|
react@*, "react@^18.0.0 || ^19.1.0", react@^19.1.1, "react@>= 16.8.0", "react@>= 16.x", react@>=16, react@>=16.0.0, react@>=16.11.0, react@>=16.8, react@>=16.8.0, react@>=16.8.4, react@>=16.9.0, react@>=17.0.0, react@>=18:
|
||||||
version "19.1.1"
|
version "19.1.1"
|
||||||
resolved "https://registry.npmjs.org/react/-/react-19.1.1.tgz"
|
resolved "https://registry.npmjs.org/react/-/react-19.1.1.tgz"
|
||||||
integrity sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==
|
integrity sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==
|
||||||
@ -10604,6 +10592,11 @@ yaml@^1.10.0:
|
|||||||
resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz"
|
resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz"
|
||||||
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
|
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
|
||||||
|
|
||||||
|
yaml@^2.4.2:
|
||||||
|
version "2.8.1"
|
||||||
|
resolved "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz"
|
||||||
|
integrity sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==
|
||||||
|
|
||||||
yargs-parser@^21.1.1:
|
yargs-parser@^21.1.1:
|
||||||
version "21.1.1"
|
version "21.1.1"
|
||||||
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz"
|
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user