Compare commits

...
138 Commits
Author SHA1 Message Date
winbin 6bfb20766a bugfix: refresh metadata on refresh directory 2021-02-12 23:02:29 +08:00
winbin 616c7aa7f4 edit page 2021-02-11 01:21:32 +08:00
winbin d6cd1c81fb Add The Language Change And Chinese 2021-02-11 00:57:36 +08:00
Stefan Dej 74f104f1a4 push version number
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-09 22:55:15 +01:00
Stefan Dej 9ccc3f69a3 last fixes for control panel customizing
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-09 22:23:20 +01:00
Stefan Dej 0d2f9bd8d8 bugfix: fix order in console from preset
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-08 22:25:23 +01:00
Stefan Dej 28aa03a55f remove debug output
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 23:19:22 +01:00
Stefan Dej d891ec0800 bugfix: only allow positiv values in control and extruder settings
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 23:00:53 +01:00
Stefan Dej 767a9403fd bugfix: editing existing preset doesn't work after add another heater (fix #182)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 22:33:48 +01:00
Stefan Dej 6fb8d16143 bugfix: colorpicker return object instead of string (fix #193)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 22:16:10 +01:00
Stefan Dej 0cffe5f235 disable debug output, fixed typo
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:50:02 +01:00
Stefan Dej f634872297 bugfix: save only hex values of chart colors
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:50:02 +01:00
Stefan Dej 91014a7349 feature: hide additional sensors in temp list
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:50:02 +01:00
Stefan Dej 850eecd600 add speed in chart tooltip
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:50:02 +01:00
Stefan Dej fff66f0c3b feature: hide additional sensors
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:50:02 +01:00
Stefan Dej 3749b76162 feature: add customize feedrate & feed distances to ExtruderPanel.vue (fix #158)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 21:36:46 +01:00
Stefan Dej 88ac7a5cae feature: add customize feedrate for ControlPanel.vue (fix #49)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 03:26:06 +01:00
Stefan Dej eb123ffc01 feature: add preheat function in gcode files context menu
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 02:42:43 +01:00
Stefan Dej 411087434c feature: add disk usage to gcode-files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-07 00:58:40 +01:00
Stefan Dej 8db37259e1 feature: add update notification
feature: display branch if not master in UpdatePanel.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-06 23:57:54 +01:00
Stefan Dej 3a03d93fef bugfix: add vertical divider for better "button feeling"
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-06 22:23:48 +01:00
Stefan Dej 42071ae422 feature: process notify_klippy_shutdown from moonraker
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-06 21:56:57 +01:00
Stefan Dej aeb6ae1ec9 feature: disable power devices with attribute "locked_while_printing" in moonraker while printing
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-06 21:39:04 +01:00
Stefan Dej 837f6641d0 bugfix: esp32 cam or ustreamer link fix bypassCache append (fixed #185)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-06 02:20:08 +01:00
Stefan Dej 7a139d68c5 bugfix: remove ":" in ConnectingDialog.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-04 21:45:54 +01:00
lixxbox 24bfb8bc58 hotfix: mainsail docs logo
I accidentally removed the logo from the config during the recent commit.
2021-02-04 12:29:06 +01:00
Stefan Dej 390bb40c69 fix some docs
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-02-03 21:05:10 +01:00
lixxbox 84470463fe remove duplicates 2021-02-03 20:51:50 +01:00
lixxbox f9c989793c adding quicktips and some minor changes to the docs 2021-02-03 20:51:50 +01:00
Stefan Dej b0044f3d2b push version number
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:57:25 +01:00
Stefan Dej e2e496c31e bugfix: update metadata by override gcode file
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:56:06 +01:00
Stefan Dej 8363932ae9 bugfix: fixed tooltip css
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej f958027671 feature: add additional sensor support in temperature panel (bme280...)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 4b678468ab bugfix: duplicate preset entries in tools combobox
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 9090c60038 feature: add hover marker in tempchart
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 35955d4899 feature: add combobox for target temp with preset values
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 4a58f0c3e2 feature: add zoom in tempchart
feature: add combine tooltip in tempchart

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 4003166000 feature: save chart settings in mainsail.json
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 9888d796bd add power to tempHistory
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 8a8587786a feature: add autoscale tempchart
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-31 01:23:44 +01:00
Stefan Dej 64c6790d3a bugfix: miscellaneous sorting (pwm entries before non pwm)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-30 02:33:29 +01:00
Stefan Dej 28998090e6 bugfix: block upload by drag&drop gcode upload during a print (fixed #163)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-30 02:19:06 +01:00
Stefan Dej 87e1ccb384 bugfix: duplicate event history
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-30 02:09:59 +01:00
Stefan Dej e5469b47ca bugfix: allow .ufp and show thumbnails
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-27 21:03:44 +01:00
Stefan Dej a72af00c0a push version number to v1.0.2
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 21:45:54 +01:00
Stefan Dej 576f3ee4fa bugfix: thumbnails in gcode files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 21:40:14 +01:00
Stefan Dej 2ee53b26bb push version number
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 18:02:18 +01:00
Stefan Dej 414a05bf7b bugfix: fixed updateManager order
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 17:05:39 +01:00
Stefan Dej bb83dcda11 type in MinSettingsPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 15:47:32 +01:00
Stefan Dej 4f34b63fc0 bugfix: fixed problem with older moonraker version (registered_directories)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 15:44:26 +01:00
Stefan Dej ae058ca2d0 bugfix: fix undefined dir in filetree
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 15:01:24 +01:00
Stefan Dej 53e394eddd bugfix: hide docs in ConfigFilesPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 15:00:34 +01:00
Stefan Dej 25221ca6cb feature: redesign MoonrakerFailedPluginsPanel.vue and MinSettingsPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 14:57:58 +01:00
Stefan Dej e7999d5577 bugfix: load thumbnails between 32-64px in gcode files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-24 14:57:20 +01:00
Rufo Sanchez 9545fc76bb Reduce CPU utilization of progress circle
The value of the math progress circle winds up calculating progress to
an incredibly fine degree, which causes hundreds of updates and
recalculations. Changing the progress circle to round to the closest
percentage greatly reduces the number of updates, dropping the browser's
CPU usage by 10-20%.
2021-01-24 00:15:45 +01:00
Stefan Dej 3e0607fc9b bugfix: load thumbnails between 32-64px in gcode files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 23:51:37 +01:00
Stefan Dej f6eb37928b bugfix: fix margins in edit preset dialog
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 23:17:42 +01:00
Stefan Dej e16694eae8 bugfix: firefox > edit presets > checkbox and input remove linebreak
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 23:12:30 +01:00
Stefan Dej d786d88348 bugfix: add warning when saving a empty preset
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 23:05:58 +01:00
Stefan Dej bce06f0e1b bugfix: fixed duplicate printers after browser sleep
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 19:53:25 +01:00
Stefan Dej 294f48124f bugfix: add close/exit button in SelectPrinterDialog.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 19:29:46 +01:00
Stefan Dej cc77c47d54 type in WebcamPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 19:25:40 +01:00
Stefan Dej 6a0f19926e refresh webcam little code cleanup
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 19:25:13 +01:00
Samori Gorse 45198d7d93 feat(refresh-webcam): Refresh webcam view on focus
Computers with agressive power management policies
tend to stop the webcam feed after getting to sleep.

This forces the webcam feed to be restarted on focus.
2021-01-23 18:57:57 +01:00
Stefan Dej 54c78e2735 bugfix: add heater change gcode in event list (console history)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 01:39:11 +01:00
Stefan Dej 659504f77e feature: restart moonraker if you click SAVE & RESTART of moonraker.conf
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 01:36:29 +01:00
Stefan Dej e81ba35909 update config editor topbar buttons responsive
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 01:30:16 +01:00
Stefan Dej feb9579ae1 update updateManager for multiclient support (https://github.com/Arksine/moonraker/pull/63)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-23 00:53:24 +01:00
Stefan Dej 35013e755c feature: add registered_directories in server init process
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 21:56:45 +01:00
Stefan Dej 4b5f03b886 bugfix: download config files (issue with url build)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 20:04:25 +01:00
Stefan Dej 7dc16da940 bugfix: add SelectPrinterDialog.vue hostname rule (http: && https: is invalid)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 20:00:43 +01:00
Stefan Dej 08bd7440a9 bugfix: add remotePrinter hostname rule (http: && https: is invalid)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 19:23:25 +01:00
Stefan Dej 2e0ba91e50 bugfix: change restart icons in KlippyStatePanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 19:16:23 +01:00
Stefan Dej ca79e3b63e bugfix: convertNamein preset panel
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-20 01:06:38 +01:00
Stefan Dej 9429e11645 push version number to 1.0.0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:55:05 +01:00
Stefan Dej 7b90c32b96 bugfix: type in printer select dialog
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:54:50 +01:00
Stefan Dej f2809d304c feater: add remotemode
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:10:43 +01:00
Stefan Dej 1d86c22126 rename peripherie to miscellaneous
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:08:09 +01:00
Stefan Dej d767f50bbb feature: convert heater, fan & sensor names
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:08:09 +01:00
Stefan Dej a6c4dd75f1 bugfix: fixed favicon glitches
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:08:09 +01:00
Stefan Dej bd44c5608a bugfix: change colors and put lines in the front of the temp chart
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:08:09 +01:00
Stefan Dej 97012256f6 bugfix: disable preset button during a print
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 23:08:09 +01:00
Stefan Dej 5ee8e69d81 Update CNAME 2021-01-19 22:59:36 +01:00
Stefan Dej d05fa70832 bugfix: disable update button during print in UpdatePanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-19 20:26:40 +01:00
Stefan Dej edf1507359 bugfix: fix nginx config
bugfix: disable upload limit in nginx config
bugfix: disable cache for index.html

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 23:27:20 +01:00
Stefan Dej bb831cd22f bugfix: add unit to requested_speed
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 20:54:52 +01:00
Stefan Dej 423d2eaa88 bugfix: layer_count to 0 until the print starts
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 20:53:33 +01:00
Stefan Dej 92679b001a bugfix: unknown attribute in farm printer getter
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 20:23:02 +01:00
Stefan Dej 21c01b0de7 bugfix: favicon wrong url
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 20:20:39 +01:00
Stefan Dej 0ae1b32a56 bugfix: dashboard status panel and farm printer panel -> different eta time
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-18 00:14:32 +01:00
Stefan Dej 7cda0f7058 feature: add custom gcode to presets
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-17 23:00:37 +01:00
Stefan Dej fe246393ea feature: add HomeAll (G28) button in Heightmap.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-17 23:00:37 +01:00
Stefan Dej a512743038 bugfix: topbar SAVE_CONFIG button doesnt work
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-17 23:00:37 +01:00
ace 645084700d simplify nginx config in setup documentation 2021-01-17 19:55:32 +01:00
Stefan Dej b784b3f277 bugfix: reload for klippy state message
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-17 01:51:52 +01:00
Stefan Dej c5999221bc feature: add preheat & cooldown function in ToolsPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-17 01:32:26 +01:00
Stefan Dej d1cb7f2def bugfix: StatusPanel.vue text no warp
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 19:46:59 +01:00
Stefan Dej 6927ce6038 bugfix: save config without restart
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 17:50:19 +01:00
Stefan Dej 4579129a4f feature: upload & start button in topbar
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 02:25:34 +01:00
Stefan Dej 5fd89c2600 bugfix: gcode_position unknown fixed in StatusPanel.vue
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 02:25:16 +01:00
Stefan Dej 354f6e9250 feature: close top corner menu after all functions except power devices
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 01:44:15 +01:00
Stefan Dej 9e6e8c1290 bugfix: change sync icon to restart icon in top corner menu
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 01:37:22 +01:00
Stefan Dej 7164dd7c3c feature: add klipper config references link in editor
feature: add save & restart button in editor

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 01:36:42 +01:00
Stefan Dej b38b052004 feature: add requested speed to StatusPanel.vue during print
feature: add ETA to StatusPanel.vue
feature: add current & max layer to StatusPanel.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-16 01:26:40 +01:00
Stefan Dej ff366ee966 bugfix: ControlPanel.vue padding top during a print
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-15 22:03:59 +01:00
Stefan Dej dc1a7dfe03 bugfix: console autocomplete -> fixed addEvent attributes
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-15 21:35:10 +01:00
Stefan Dej d2d5d3da0c bugfix: delete margin top klipper state panel
bugfix: peripherie pwm state true (check value)

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-15 00:39:03 +01:00
Stefan Dej 03322739d5 update packages
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-15 00:24:56 +01:00
Stefan Dej 31b4d4cb3d feature: display reprint & clear print button in print_state error
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-15 00:24:32 +01:00
Stefan Dej d2d8546bc9 bugfix: uppercase every first letter in peripherie names
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-14 23:35:29 +01:00
Stefan Dej 93c952cabb feature: add clear print stats button in complete state
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-14 00:32:24 +01:00
Stefan Dej 02f9f9a1d4 feature: add output_pin to PeripheriePanel.vue (fan panel before)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-14 00:25:32 +01:00
Stefan Dej e3607c8f3d feature: add detached state in update manager
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-13 00:21:48 +01:00
Stefan Dej 2b08e34ba7 feature: show klipper & moonraker branch on hover
feature: disable update buttons during a print

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 23:44:30 +01:00
Stefan Dej 747722ec2c feature: hide mainsail in the update manager in remoteMode
bugfix: fixed padding bottom of the close button in the UpdateDialog.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 23:13:06 +01:00
Stefan Dej 0befcea658 bugfix: clear new printer objects on reset
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 23:02:33 +01:00
Stefan Dej ff3cf167ad fixed addEvent commits
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 22:46:29 +01:00
Stefan Dej c8cff6d3d8 feature: add gcodeStore types (respond, command)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 21:46:17 +01:00
Stefan Dej 397d9b8a7c bugfix: tool input is empty -> klipper error unable to parse
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-12 00:46:24 +01:00
Stefan Dej 84f2b6a473 bugfix: switching printers in remoteMode change to single mode
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-11 22:48:23 +01:00
Stefan Dej b6d20f20ee feature: moonraker failed_plugin output on dashboard
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-11 00:14:15 +01:00
Stefan Dej 13859d3832 feature: add moonraker update notifications
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-10 03:27:42 +01:00
Stefan Dej b88ebf38c7 fix package list tooltip width
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-10 02:55:53 +01:00
Stefan Dej 5831e43fba feature: add farm mode
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-10 02:53:17 +01:00
Stefan Dej 21669f11f7 add discord invite link
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-09 20:38:18 +01:00
Stefan Dej 7b20b47d21 add .version file to build
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-09 19:46:31 +01:00
Stefan Dej 8d15e59e35 update manual setup guide and kiauh description
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 14:09:22 +01:00
Stefan Dej 8ee93d1c4a update virtual_sdcard path to gcode_files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 01:29:18 +01:00
Stefan Dej 0b23e512e6 update kiauh guides
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 00:54:29 +01:00
Stefan Dej 7ff060edff update mainsailOS and kiauh guides
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 00:46:07 +01:00
Stefan Dej 0bfc856606 update mainsailOS and kiauh guides
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 00:37:19 +01:00
Stefan Dej 3c78c5af58 add mainsailOS and kiauh guides
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-06 00:31:55 +01:00
Stefan Dej efbbbb0142 fixed typo & order of installation
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-04 20:41:11 +01:00
Stefan Dej d57f68b511 bugfix: only display 32x32 thumbnails in gcode files list
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-03 03:48:58 +01:00
Stefan Dej 64f473e0c6 fixed typo "dashboard". thx Mak
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-02 17:29:09 +01:00
Stefan Dej a2863f2141 Create CNAME 2021-01-02 17:22:25 +01:00
Stefan Dej ef3b179339 update vuetify to 2.4.0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-02 03:36:22 +01:00
Stefan Dej 2bceb2b24f update vuetify to 2.4.0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2021-01-02 03:27:03 +01:00
122 changed files with 6791 additions and 2313 deletions

No files matched your search

+2
View File
@@ -6,6 +6,8 @@ Mainsail is a lightweight & responsive web interface for the [Klipper](https://g
To begin using Mainsail start by [installing](https://meteyou.github.io/mainsail/setup/) it or read the [pages](https://meteyou.github.io/mainsail/) for more informations.
For support join our discord server -> [https://discord.gg/skWTwTD](https://discord.gg/skWTwTD)
## Credit, sources and inspiration
* [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
* [Eric Callahan (arksine)](https://github.com/Arksine) for [Moonraker (Klipper API)](https://github.com/Arksine/moonraker). Without Moonraker, Mainsail would not be possible.
+1
View File
@@ -0,0 +1 @@
docs.mainsail.xyz
+10 -1
View File
@@ -1,6 +1,15 @@
title: "Mainsail"
tagline: A web interface for Klipper
description: Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
logo: "/assets/img/logo-mainsail.png"
description: A web interface for Klipper
theme: just-the-docs
remote_theme: pmarsceill/just-the-docs
color_scheme: "mainsail"
search_enabled: true
defaults:
-
scope:
path: "" # an empty string here means all files in the project
values:
image: assets/img/rtfm.png
-7
View File
@@ -1,7 +0,0 @@
---
layout: default
title: Additional Support
nav_order: 6
has_children: true
permalink: /additional
---
Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 KiB

+1 -1
View File
@@ -1,7 +1,7 @@
---
layout: default
title: Customizing
nav_order: 5
nav_order: 6
has_children: true
permalink: /customizing
---
+9 -1
View File
@@ -9,7 +9,15 @@ has_children: false
Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
[Setup Guide](/setup-guide/index.md){: .btn}
[Setup Guide](/setup){: .btn}
[Release Notes](https://github.com/meteyou/mainsail/releases){: .btn}{:target="_blank"}
For support join us on Discord, or open an issue on Github.
[Discord](https://discord.gg/skWTwTD){: .btn}{:target="_blank"}
[Github](https://github.com/meteyou/mainsail){: .btn}{:target="_blank"}
## Screenshots
![Dashboard](assets/img/screenshot.png)
+2 -2
View File
@@ -1,7 +1,7 @@
---
layout: default
title: Necessary Configuration
nav_order: 4
nav_order: 5
has_children: false
permalink: /necessary-configuration
---
@@ -13,7 +13,7 @@ Mainsail requires a minimum configuration to function properly. It should give y
This allows gcode file uploads.
```yaml
[virtual_sdcard]
path: ~/sdcard
path: ~/gcode_files
```
### display_status
+37
View File
@@ -0,0 +1,37 @@
---
layout: default
title: Additional Sensors
parent: Quicktips
has_children: false
permalink: /quicktips/additional-sensors
description: >-
Integrate additional sensors into the temperature graph. For example Raspberry Pi, MCU, BMExxx, HTU21D, LM75 and more..
---
# {{ page.title }}
{{ page.description }}
## Raspberry Pi temperature sensor
Append the following section to your printer.cfg:
```yaml
[temperature_sensor raspberry_pi]
sensor_type: rpi_temperature
min_temp: 10
max_temp: 100
```
## ATSAM, ATAMD, and STM32 temperature sensor
Append the following section to your printer.cfg:
```yaml
[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100
```
For more information on this topic and how to add additional sensors, please refer to [Klipper documentation](https://www.klipper3d.org/Config_Reference.html#builtin-micro-controller-temperature-sensor){:target="_blank"}.
{: .info}
+26
View File
@@ -0,0 +1,26 @@
---
layout: default
title: Console Shortcuts
parent: Quicktips
has_children: false
permalink: /quicktips/console-shortcuts
description: >-
Similar to a terminal of your OS, there are some keyboard shortcuts in Mainsail that make your everyday life easier.
---
# {{ page.title }}
{{ page.description }}
## Help command
Issue a `HELP` command to get a list of possible commands.
## Autocomplete
You can start typing a command and then complete it with the tab-key. If there are several possibilities, you will get a list of choices.
![](../assets/img/quicktips/console-shortcuts/tab_complete.gif)
## Scroll through commands
Using the &uarr; up / &darr; down arrow keys you can scroll through previous commands.
+20
View File
@@ -0,0 +1,20 @@
---
layout: default
title: Disable Octoprint LCD menu
parent: Quicktips
has_children: false
permalink: /quicktips/disable-octoprint-lcd-menu
description: >-
Klipper is shipped with an Octoprint entry in the LCD menu. These menu points don't work with Mainsail.
---
# {{ page.title }}
{{ page.description }}
## Modify printer.cfg
Just add the following entry to your printer.cfg:
```yaml
[menu __main __octoprint]
type: disabled
```
@@ -0,0 +1,34 @@
---
layout: default
title: Hide macros, outputs or fans
parent: Quicktips
has_children: false
permalink: /quicktips/hide-gcode_macros
description: >-
As you probably already noticed, you can show and hide the gcode macros in the interface settings, but there is more...
---
# {{ page.title }}
{{ page.description }}
Did you know, that you can also hide gcode macros by prefixing the name with an underscore?
```yaml
[gcode_macro MY_AWESOME_GCODE]
gcode:
_MY_HELPER_CODE
```
```yaml
[gcode_macro _MY_HELPER_CODE]
gcode:
M300
```
`MY_AWESOME_GCODE` appears in your interface settings, `_MY_HELPER_CODE` not.
![](../assets/img/quicktips/hide-gcode_macros/my_awesome_macro.png)
By the way, this also works for other configuration sections like, **fans and outputs.**
{: .info}
+11
View File
@@ -0,0 +1,11 @@
---
layout: default
title: Quicktips
nav_order: 10
has_children: true
permalink: /quicktips
description: quick tips, without much explanation
---
# {{ page.title }}
{{ page.description }}
+31
View File
@@ -0,0 +1,31 @@
---
layout: default
title: Presets
parent: Quicktips
has_children: false
permalink: /quicktips/presets
description: >-
Mainsail supports so-called presets. They are often used for preheat & cooldown, but also execute normal gcode.
---
# {{ page.title }}
{{ page.description }}
## Setup
In Mainsails interface settings you will find a section called "Preheat Presets". There you can set your presets via "ADD PRESET" and the following dialog.
### Preheat
Enter a name \(e.g. name, color and type of filament\) and the temperatures obtained. You can disable individual heaters and even specify a custom gcode for the preheat phase.
![](../assets/img/quicktips/presets/preheat.png)
### Further Examples
#### Z-Offset
To quickly switch between different Z-offsets \(flexplates with smooth and textured surfaces\), you can create presets and deactivate the heaters.
As G-Code you simply enter `SET_GCODE_OFFSET Z=0.2`, of course with your determined offset.
![](../assets/img/quicktips/presets/gcodeoffset.png)
@@ -1,17 +1,19 @@
---
layout: default
title: Slicer upload
parent: Additional Support
nav_order: 1
permalink: /additional/slicer-upload
title: Slicer Upload
parent: Quicktips
permalink: /quicktips/slicer-upload
description: >-
It is possible to upload G-Code from your slicer and have it start printing.
---
## Upload from Slicer
# {{ page.title }}
{{ page.description }}
Moonraker has compatibility with Octoprint's legacy file upload API.
### PrusaSlicer/SuperSlicer (prior to v2.3.0)
You can upload your GCode-files from your Slicer. Moonraker simulates the octoprint-upload function.
If not already been done, switch to advanced or expert mode and set the options under "Printer Settings / General" as shown in the screenshot below.
If not already been done, switch to advanced or expert mode and set the options under `Printer Settings / General` as shown in the screenshot below.
For "API Key" you can type anything.
![screenshot](../assets/img/additional/FileUpload-PrusaSlicer-2.2.0.png)
@@ -1,20 +1,27 @@
---
layout: default
title: Thumbnails
parent: Additional Support
nav_order: 1
permalink: /additional/thumbnails
parent: Quicktips
permalink: /quicktips/thumbnails
description: >-
Mainsail can display thumbnails in the file browser and as previews in the print status.
---
## Thumbnails
Mainsail can display thumbnails in the file browser and as previews in the print status.
# {{ page.title }}
{{ page.description }}
![preview](../assets/img/additional/large-preview.png)
### PrusaSlicer (since v2.3.0)
In "Expert" mode PrusaSlicer has an option in the "Printer Settings" tab to activate previews.
Under `General / Firmware`, enter `32x32,400x300` as "G-code thumbnails".
![SuperSlicer](../assets/img/additional/PrusaSlicer2.3.0-thumbnails.png)
### SuperSlicer (since v2.2.54.0)
In "Expert" mode SuperSlicer has some very convenient options in the "printer settings" tab to activate and customize the previews.
In "Expert" mode SuperSlicer has some very convenient options in the "Printer Settings" tab to activate and customize the previews.
![SuperSlicer](../assets/img/additional/SuperSlicer-thumbnails.png)
+33
View File
@@ -0,0 +1,33 @@
---
layout: default
title: Update Manager
parent: Quicktips
has_children: false
permalink: /quicktips/update-manager
description: >-
Perform updates of Mainsail, Klipper, Moonraker and your system from within Mainsail.
---
# {{ page.title }}
{{ page.description }}
## Moonraker.conf
Add the following section to your printers moonraker.conf:
```yaml
[update_manager]
[update_manager client mainsail]
type: web
repo: meteyou/mainsail
path: ~/mainsail
```
Once you have restarted the moonraker service, the Update Manager will appear in Mainsails machine settings.
![](../assets/img/quicktips/update-manager/update-manager.png)
You can find further information on this topic by checking out the [Moonraker documentation](https://github.com/Arksine/moonraker/blob/master/docs/configuration.md#update_manager){:target="_blank"}.
{: .info}
+14
View File
@@ -0,0 +1,14 @@
---
layout: default
title: Remote Mode
nav_order: 4
has_children: false
permalink: /remotemode
description: >-
description in progress
---
# {{ page.title }}
{{ page.description }}
The description will follow soon.
+8 -2
View File
@@ -1,8 +1,14 @@
---
layout: default
title: Setup Guide
title: Setup Guides
nav_order: 2
has_children: true
permalink: /setup/
has_toc: false
---
This is a guide to setting up Klipper, Moonraker & Mainsail on a Raspberry Pi with Raspberry Pi OS. Other SBCs and/or Linux distributions might work, but may require a customized installation script or configs.
# Setup Guides
There are different ways to install Mainsail.
- [MainsailOS (recommend)](mainsail-os.md)
- [Kiauh (Klipper Install And Update Helper)](kiauh.md)
- [Manual Setup](manual-setup/index.md)
+14
View File
@@ -0,0 +1,14 @@
---
layout: default
title: Kiauh Guide
parent: Setup Guides
nav_order: 2
has_children: false
permalink: /setup/kiauh
---
# Installing Mainsail with Kiauh
Kiauh is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail and various
other extensions easily and comfortably.
For more informations and get to the guide click [here](https://github.com/th33xitus/kiauh).
+27
View File
@@ -0,0 +1,27 @@
---
layout: default
title: MainsailOS Guide
parent: Setup Guides
nav_order: 1
has_children: false
permalink: /setup/mainsail-os
---
# Installing Mainsail with MainsailOS
The recommended way to install Mainsail on a Raspberry Pi is to use [MainsailOS](https://github.com/raymondh2/MainsailOS),
a pre-packaged disk image. If you are building a custom configuration, you may need to skip
these instructions and install Mainsail [manually](manual-setup/index.md).
1. Download the latest mainsailOS [Release](https://github.com/raymondh2/MainsailOS/releases)
2. Unzip the .img file from your download.
3. Use [BalenaEtcher](https://www.balena.io/etcher/) to write the .img on to an 8GB, or larger SDcard. *THIS WILL DESTROY ALL DATA ON YOUR CARD*.
_note: It is a good idea to use a premium SDcard from a reputable manufacturer such as Sandisk, Kingston or Samsung. Low end cards will often fail quickly when used in this application_
4. If you will be using wifi, edit the file `mainsailos-wpa-supplicant.txt` with your Wifi information. If you are having trouble seeing this file on the sdcard, try removing it and re-inserting it into your card reader.
5. Make sure that your MCU(s) is connected to your pi, If you will be using wired networking, also make sure your ethernet cable is connected.
5. Insert the SDcard into your Pi, and power on the Pi.
6. Find your pi on the network, and ssh into it, (Using PuTTY on Windows or the terminal on MacOS)
* If your network supports bonjour, the pi should show up as `mainsailos.local`
* If your network automatically assigns DNS hostnames, it may simply show up as `mainsailos`
* Failing these two options, you may need to check your router's DHCP server, and find out what IP address as been assigned to the device.
+9
View File
@@ -0,0 +1,9 @@
---
layout: default
title: Manual Setup Guide
parent: Setup Guides
nav_order: 3
has_children: true
permalink: /setup/manual-setup
---
This is a guide to setting up Klipper, Moonraker & Mainsail on a Raspberry Pi with Raspberry Pi OS. Other SBCs and/or Linux distributions might work, but may require a customized installation script or configs.
@@ -1,9 +1,10 @@
---
layout: default
title: Klipper
parent: Setup Guide
parent: Manual Setup Guide
grand_parent: Setup Guides
nav_order: 3
permalink: /setup/klipper
permalink: /setup/manual-setup/klipper
---
## Klipper
@@ -38,14 +39,14 @@ You have to create the directories for your klipper configuration and the virtua
```bash
mkdir ~/klipper_config
mkdir ~/sdcard
mkdir ~/gcode_files
```
Move your printer.cfg to ~/klipper_config and check if the following entries are present in the config.
```ini
[virtual_sdcard]
# for gcode upload
path: ~/sdcard
path: ~/gcode_files
[display_status]
# for display messages in status panel
@@ -55,7 +56,7 @@ path: ~/sdcard
# Mainsail needs gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT` to make the buttons work.
```
> ℹ️ **These entries are very important.**
For the full functionality of mainsail, you should also define gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT`. You'll find further information in [this](../necessary-cfg.md){: target="_blank"} document.
For the full functionality of mainsail, you should also define gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT`. You'll find further information in [this](../../necessary-cfg.md){: target="_blank"} document.
After your config is in place, restart klipper with `sudo service klipper restart`. Check the `/tmp/klippy.log` for errors, if Klipper starts correctly you can continue the guide.
@@ -1,9 +1,10 @@
---
layout: default
title: Mainsail
parent: Setup Guide
parent: Manual Setup Guide
grand_parent: Setup Guides
nav_order: 5
permalink: /setup/mainsail
permalink: /setup/manual-setup/mainsail
---
@@ -39,7 +40,7 @@ upstream apiserver {
upstream mjpgstreamer {
#if you need to change your webcam port, edit it here
ip_hash;
server 127.0.0.1:8081;
server 127.0.0.1:8080;
}
```
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
@@ -85,35 +86,15 @@ server {
index index.html;
server_name _;
#max upload size for gcodes
client_max_body_size 200M;
#disable max upload size
client_max_body_size 0;
location / {
try_files $uri $uri/ /index.html;
}
location /printer {
proxy_pass http://apiserver/printer;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /api {
proxy_pass http://apiserver/api;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /access {
proxy_pass http://apiserver/access;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
location = /index.html {
add_header Cache-Control "no-store, no-cache, must-revalidate";
}
location /websocket {
@@ -127,16 +108,8 @@ server {
proxy_read_timeout 86400;
}
location /machine {
proxy_pass http://apiserver/machine;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /server {
proxy_pass http://apiserver/server;
location ~ ^/(printer|api|access|machine|server)/ {
proxy_pass http://apiserver$request_uri;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -182,7 +155,7 @@ Now it should be possible to open the interface: `http://<printer-ip>/`.
if you want to get the full experience with mainsail and klipper virtual_sdcard print, you should use these macros, or use them as templates for your own.
[Macro Link](../necessary-cfg.md){: .btn target="_blank"}
[Macro Link](../../necessary-cfg.md){: .btn target="_blank"}
### Change the Hostname (optional)
@@ -195,7 +168,7 @@ and you can config your hostname:
`sudo raspi-config`
in 2 Network Options > N1 Hostname you can edit your hostname of your raspberry pi. After a reboot you can use http://<hostname>.local/ to open the webinterface.
in 2 Network Options > N1 Hostname you can edit your hostname of your raspberry pi. After a reboot you can use http://\<hostname\>.local/ to open the webinterface.
---
@@ -1,9 +1,10 @@
---
layout: default
title: Moonraker
parent: Setup Guide
parent: Manual Setup Guide
grand_parent: Setup Guides
nav_order: 4
permalink: /setup/moonraker
permalink: /setup/manual-setup/moonraker
---
## Moonraker
Moonraker is a web server that exposes APIs which lets Mainsail interact with Klipper.
@@ -21,9 +22,6 @@ cd ~/moonraker/scripts
./install-moonraker.sh -c /home/pi/klipper_config/moonraker.conf
```
Once the script is finished, both Moonraker and Klipper should be started.
In `/tmp/klippy.log` the following entry should appear: `Moonraker: server connection detected`
### Configuration
> ⚠️ **Please pay attention to the following steps!**
Misconfigured trusted_clients are a very common source of failure.
@@ -47,6 +45,7 @@ config_path: ~/klipper_config
enabled: true
trusted_clients:
192.168.1.0/24
2a02:810d:9340:33f6::/64
[update_manager]
client_repo: meteyou/mainsail
@@ -1,9 +1,10 @@
---
layout: default
title: Operating System
parent: Setup Guide
parent: Manual Setup Guide
grand_parent: Setup Guides
nav_order: 2
permalink: /setup/operating-systen
permalink: /setup/manual-setup/operating-systen
---
## Operation System
> ⚠️ **Please don't use an OctoPi image!**
+962 -865
View File
File diff suppressed because it is too large. Load diff
+20 -16
View File
@@ -1,43 +1,47 @@
{
"name": "mainsail",
"version": "0.4.1",
"version": "1.2.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"build": "vue-cli-service build && npm run build.zip",
"lint": "vue-cli-service lint",
"build.zip": "cd ./dist && zip -r mainsail.zip ./ && cd .."
},
"dependencies": {
"axios": "^0.21.0",
"core-js": "^3.7.0",
"axios": "^0.21.1",
"core-js": "^3.8.2",
"object-assign-deep": "^0.4.0",
"prismjs": "^1.22.0",
"prismjs": "^1.23.0",
"vue": "^2.6.12",
"vue-context": "^6.0.0",
"vue-github-api": "^0.1.7",
"vue-headful": "^2.1.0",
"vue-i18n": "^8.22.4",
"vue-plotly": "^1.1.0",
"vue-prism-editor": "^1.2.2",
"vue-resource": "^1.5.1",
"vue-simple-upload": "^0.1.6",
"vue-toast-notification": "^0.6.0",
"vuetify": "^2.3.18",
"vuex": "^3.5.1"
"vuetify": "^2.4.2",
"vuex": "^3.6.0"
},
"devDependencies": {
"@mdi/font": "^5.8.55",
"@vue/cli-plugin-babel": "^4.5.9",
"@vue/cli-plugin-babel": "^4.5.10",
"@vue/cli-plugin-eslint": "^4.5.3",
"@vue/cli-plugin-pwa": "^4.5.9",
"@vue/cli-service": "^4.5.9",
"@vue/cli-plugin-pwa": "^4.5.10",
"@vue/cli-service": "^4.5.10",
"babel-eslint": "^10.1.0",
"css-loader": "^5.0.1",
"eslint": "^7.13.0",
"eslint-plugin-vue": "^7.1.0",
"sass": "^1.29.0",
"sass-loader": "^10.1.0",
"eslint": "^7.17.0",
"eslint-plugin-vue": "^7.4.1",
"generate-file-webpack-plugin": "^1.0.1",
"sass": "^1.32.4",
"sass-loader": "^10.1.1",
"sw-precache-webpack-plugin": "^1.0.0",
"vue-cli-plugin-route": "0.0.7",
"vue-cli-plugin-vuetify": "^2.0.7",
"vue-cli-plugin-vuetify": "^2.0.9",
"vue-router": "^3.4.9",
"vue-template-compiler": "^2.6.12",
"vuetify-loader": "^1.6.0"
+174 -35
View File
@@ -29,11 +29,13 @@
<v-toolbar-title>{{ printername !== "" ? printername : hostname }}</v-toolbar-title>
</div>
<ul class="navi" :expand="$vuetify.breakpoint.mdAndUp">
<printer-selecter></printer-selecter>
<li v-for="(category, index) in routes" :key="index" :prepend-icon="category.icon"
:class="[category.path !== '/' && currentPage.includes(category.path) ? 'active' : '', 'nav-item']"
:value="true"
>
<router-link
style="position: relative;"
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
v-if="
(category.title === 'Webcam' && boolNaviWebcam) ||
@@ -44,7 +46,19 @@
)
">
<v-icon>mdi-{{ category.icon }}</v-icon>
<span class="nav-title">{{ category.title }}</span>
<v-icon
small
color="warning"
style="
top: 11px;
left: 32px;
position: absolute;
"
v-if="category.title === 'Settings' && isUpdateAvailable"
>mdi-progress-upload</v-icon>
<span class="nav-title">
{{ $t(`Router.${category.title}`) }}
</span>
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
</router-link>
@@ -52,7 +66,7 @@
<li v-for="(page, pageIndex) in category.children" class="nav-item" v-bind:key="`${index}-${pageIndex}`">
<router-link :to="page.path" class="nav-link" @click.prevent v-if="klippy_state !== 'error' || page.alwaysShow">
<v-icon>mdi-{{ page.icon }}</v-icon>
<span class="nav-title">{{ page.title }}</span>
<span class="nav-title">{{ $t(`Router.${page.title}`) }}</span>
</router-link>
</li>
</ul>
@@ -66,14 +80,16 @@
<v-app-bar app elevate-on-scroll>
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-spacer></v-spacer>
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">SAVE CONFIG</v-btn>
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
<input type="file" ref="fileUploadAndStart" accept=".gcode, .ufp" style="display: none" @change="uploadAndStart" />
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">{{ $t("App.SAVECONFIG")}}</v-btn>
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && ['standby', 'complete'].includes(printer_state)" :loading="loadings.includes['btnUploadAndStart']" @click="btnUploadAndStart"><v-icon class="mr-2">mdi-file-upload</v-icon>{{ $t("App.UploadPrint")}}</v-btn>
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">{{ $t("App.EmergencyStop")}}</span></v-btn>
<top-corner-menu></top-corner-menu>
</v-app-bar>
<v-main id="content">
<v-scroll-y-transition>
<v-container fluid id="page-container" class="container px-sm-6 px-3 mx-auto">
<v-container fluid id="page-container" class="container px-3 px-sm-6 py-sm-6 mx-auto">
<keep-alive>
<router-view></router-view>
</keep-alive>
@@ -81,15 +97,33 @@
</v-scroll-y-transition>
</v-main>
<v-dialog v-model="overlayDisconnect" persistent width="300">
<v-card color="primary" dark >
<v-card-text class="pt-2">
Connecting...
<v-progress-linear indeterminate color="white" class="mb-0 mt-2"></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
<v-snackbar
:timeout="-1"
:value="true"
fixed
right
bottom
dark
v-model="uploadSnackbar.status"
>
<strong>{{ $t("App.Uploading")}} {{ uploadSnackbar.filename }}</strong><br />
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
<template v-slot:action="{ attrs }">
<v-btn
color="red"
text
v-bind="attrs"
@click="cancelUpload"
style="min-width: auto;"
>
<v-icon class="0">mdi-close</v-icon>
</v-btn>
</template>
</v-snackbar>
<select-printer-dialog v-if="remoteMode"></select-printer-dialog>
<connecting-dialog v-if="!remoteMode"></connecting-dialog>
<update-dialog></update-dialog>
</v-app>
</template>
@@ -99,22 +133,39 @@
import { mapState, mapGetters } from 'vuex'
import TopCornerMenu from "@/components/TopCornerMenu"
import UpdateDialog from "@/components/UpdateDialog"
import ConnectingDialog from "@/components/ConnectingDialog";
import SelectPrinterDialog from "@/components/SelectPrinterDialog";
import PrinterSelecter from "@/components/PrinterSelecter"
import axios from "axios";
export default {
props: {
source: String,
},
components: {
PrinterSelecter,
ConnectingDialog,
SelectPrinterDialog,
UpdateDialog,
TopCornerMenu,
},
data: () => ({
overlayDisconnect: true,
drawer: null,
activeClass: 'active',
routes: routes,
routes: routes.filter((element) => element.title !== "Printers"),
boolNaviHeightmap: false,
uploadSnackbar: {
status: false,
filename: "",
percent: 0,
speed: 0,
total: 0,
cancelTokenSource: "",
lastProgress: {
time: 0,
loaded: 0
}
}
}),
created () {
this.$vuetify.theme.dark = true;
@@ -127,6 +178,8 @@ export default {
...mapState({
isConnected: state => state.socket.isConnected,
hostname: state => state.printer.hostname,
apiHost: state => state.socket.hostname,
apiPort: state => state.socket.port,
klippy_state: state => state.server.klippy_state,
printer_state: state => state.printer.print_stats.state,
loadings: state => state.socket.loadings,
@@ -140,6 +193,7 @@ export default {
save_config_pending: state => state.printer.configfile.save_config_pending,
klipperVersion: state => state.printer.software_version,
remoteMode: state => state.socket.remoteMode,
}),
...mapGetters([
'getTitle',
@@ -170,6 +224,11 @@ export default {
return this.$store.getters["files/getCustomStylesheet"]
}
},
isUpdateAvailable: {
get() {
return this.$store.getters["server/updateManager/isUpdateAvailable"]
}
}
},
methods: {
clickEmergencyStop: function() {
@@ -177,10 +236,90 @@ export default {
this.$socket.sendObj('printer.emergency_stop', {}, 'socket/removeLoading',{ name: 'topbarEmergencyStop' });
},
clickSaveConfig: function() {
this.$store.commit('server/addEvent', "SAVE_CONFIG");
this.$store.commit('server/addEvent', { message: "SAVE_CONFIG", type: "command" });
this.$store.commit('socket/addLoading', { name: 'topbarSaveConfig' });
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" }, 'socket/removeLoading', { name: 'topbarSaveConfig' });
},
btnUploadAndStart: function() {
this.$refs.fileUploadAndStart.click()
},
async uploadAndStart() {
if (this.$refs.fileUploadAndStart.files.length) {
this.$store.commit('socket/addLoading', { name: 'btnUploadAndStart' })
let successFiles = []
for (const file of this.$refs.fileUploadAndStart.files) {
const result = await this.doUploadAndStart(file)
successFiles.push(result)
}
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
for(const file of successFiles) {
this.$toast.success("Upload of "+file+" successful!")
}
this.$refs.fileUploadAndStart.value = ''
this.$router.push("/");
}
},
doUploadAndStart(file) {
let toast = this.$toast
let formData = new FormData()
let filename = file.name.replace(" ", "_")
this.uploadSnackbar.filename = filename
this.uploadSnackbar.status = true
this.uploadSnackbar.percent = 0
this.uploadSnackbar.speed = 0
this.uploadSnackbar.lastProgress.loaded = 0
this.uploadSnackbar.lastProgress.time = 0
formData.append('file', file, filename)
formData.append('print', true)
return new Promise(resolve => {
this.uploadSnackbar.cancelTokenSource = axios.CancelToken.source();
axios.post('//' + this.apiHost + ':' + this.apiPort + '/server/files/upload',
formData, {
cancelToken: this.uploadSnackbar.cancelTokenSource.token,
headers: { 'Content-Type': 'multipart/form-data' },
onUploadProgress: (progressEvent) => {
this.uploadSnackbar.percent = (progressEvent.loaded * 100) / progressEvent.total
if (this.uploadSnackbar.lastProgress.time) {
const time = progressEvent.timeStamp - this.uploadSnackbar.lastProgress.time
const data = progressEvent.loaded - this.uploadSnackbar.lastProgress.loaded
if (time) this.uploadSnackbar.speed = data / (time / 1000)
}
this.uploadSnackbar.lastProgress.time = progressEvent.timeStamp
this.uploadSnackbar.lastProgress.loaded = progressEvent.loaded
this.uploadSnackbar.total = progressEvent.total
}
}
).then((result) => {
this.uploadSnackbar.status = false
resolve(result.data.result)
}).catch(() => {
this.uploadSnackbar.status = false
this.$store.commit('socket/removeLoading', { name: 'btnUploadAndStart' })
toast.error("Cannot upload the file!")
})
})
},
cancelUpload: function() {
this.uploadSnackbar.cancelTokenSource.cancel()
this.uploadSnackbar.status = false
},
formatFilesize(fileSizeInBytes) {
let i = -1
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']
do {
fileSizeInBytes = fileSizeInBytes / 1024
i++
} while (fileSizeInBytes > 1024)
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i]
},
drawFavicon(val) {
let favicon16 = document.querySelector("link[rel*='icon'][sizes='16x16']")
let favicon32 = document.querySelector("link[rel*='icon'][sizes='32x32']")
@@ -195,7 +334,7 @@ export default {
let centerX = canvas.width / 2;
let centerY = canvas.height / 2;
let radius = 32;
let percent = val * 100;
let percent = (val * 100).toFixed(0);
/* draw the grey circle */
context.beginPath();
@@ -223,7 +362,7 @@ export default {
context.fillStyle = "#e41313";
context.fill();
//favicon16.href = canvas.toDataURL('image/png')
favicon16.href = canvas.toDataURL('image/png')
favicon32.href = canvas.toDataURL('image/png')
} else {
const [favicon16Default, favicon32Default] = this.defaultFavicons
@@ -244,9 +383,6 @@ export default {
config() {
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
},
isConnected(newVal) {
this.overlayDisconnect = !newVal;
},
customStylesheet(newVal) {
if (newVal !== null) {
let style = document.getElementById("customStylesheet")
@@ -318,7 +454,7 @@ export default {
margin: 0;
}
nav ul.navi a.nav-link {
nav ul.navi .nav-link {
display: block;
color: white;
border-radius: .5em;
@@ -332,25 +468,25 @@ export default {
margin: 0.5em 1em;
}
nav ul.navi a.nav-link:hover,
nav ul.navi li.active>a.nav-link,
nav ul.navi a.nav-link.router-link-active {
nav ul.navi .nav-link:hover,
nav ul.navi li.active>.nav-link,
nav ul.navi .nav-link.router-link-active {
background: rgba(255,255,255,.3);
opacity: 1;
}
nav ul.navi li.active>a.nav-link i.nav-arrow ,
nav ul.navi a.nav-link.router-link-active i.nav-arrow {
nav ul.navi li.active>.nav-link i.nav-arrow ,
nav ul.navi .nav-link.router-link-active i.nav-arrow {
transform: rotate(0);
}
nav ul.navi a.nav-link>i.v-icon {
nav ul.navi .nav-link>i.v-icon {
color: white;
font-size: 1.7em;
margin-right: .5em;
}
nav ul.navi a.nav-link>span.nav-title {
nav ul.navi .nav-link>span.nav-title {
line-height: 30px;
font-weight: 600;
text-transform: uppercase;
@@ -358,12 +494,15 @@ export default {
letter-spacing: 1px;
}
nav ul.navi a.nav-link>i.nav-arrow {
nav ul.navi .nav-link>.nav-arrow {
float: right;
margin-top: 5px;
margin-right: 0;
transform: rotate(90deg);
}
nav ul.navi .nav-link>.nav-arrow.right {
transform: rotate(-90deg);
}
nav ul.navi>li>ul.child {
display: none;
@@ -377,16 +516,16 @@ export default {
display: block;
}
nav ul.navi>li>ul.child a.nav-link {
nav ul.navi>li>ul.child .nav-link {
padding: 5px 15px 5px 15px;
}
nav ul.navi>li>ul.child a.nav-link:hover,
nav ul.navi>li>ul.child a.nav-link.router-link-active {
nav ul.navi>li>ul.child .nav-link:hover,
nav ul.navi>li>ul.child .nav-link.router-link-active {
background: rgba(255,255,255,.2);
}
nav ul.navi>li>ul.child a.nav-link>span.nav-title {
nav ul.navi>li>ul.child .nav-link>span.nav-title {
text-transform: capitalize;
font-weight: 400;
font-size: 14px;
+86
View File
@@ -0,0 +1,86 @@
<style scoped>
</style>
<template>
<v-dialog v-model="showDialog" persistent :width="400">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>{{ $t("App.Connecting") }}<span v-if="connectingFailed"> {{ $t("App.Failed") }}</span><span v-if="isConnecting"> {{ $t("App.To") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}</span>
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-5" v-if="isConnecting">
<v-progress-linear color="white" indeterminate></v-progress-linear>
</v-card-text>
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
<div class="text-center">
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
</div>
</v-card-text>
</v-card>
</v-dialog>
</template>
<script>
import { mapState } from "vuex";
import Vue from "vue";
export default {
data: function() {
return {
showDialog: true,
}
},
computed: {
...mapState({
isConnected: state => state.socket.isConnected,
isConnecting: state => state.socket.isConnecting,
connectingFailed: state => state.socket.connectingFailed,
}),
protocol: {
get() {
return this.$store.state.socket.protocol
}
},
hostname: {
get() {
return this.$store.state.socket.hostname
},
set(newName) {
return this.$store.dispatch('socket/setData', { hostname: newName });
}
},
port: {
get() {
return this.$store.state.socket.port
},
set(newName) {
return this.$store.dispatch('socket/setData', { port: newName });
}
}
},
methods: {
connect() {
window.console.log("save connection")
Vue.prototype.$socket.setUrl(this.protocol+"://"+this.hostname+":"+this.port+"/websocket")
Vue.prototype.$socket.connect()
},
reconnect() {
this.$store.dispatch('socket/setData', { connectingFailed: false })
Vue.prototype.$socket.connect()
}
},
mounted() {
this.tmpHostname = this.hostname+":"+this.port
},
watch: {
isConnected(newVal) {
this.showDialog = !newVal
}
}
}
</script>
+84
View File
@@ -0,0 +1,84 @@
<style scoped>
</style>
<template>
<div v-if="(remoteMode && countPrinters > 1) || (!remoteMode && countPrinters)">
<li :class="currentPage === '/allPrinters' ? 'nav-item active' : 'nav-item '">
<div
class="nav-link "
@click.prevent
@click="switchToPrinters"
role="button"
>
<v-icon>mdi-view-dashboard-outline</v-icon>
<span class="nav-title">Printers</span>
<v-menu bottom :offset-x="true">
<template v-slot:activator="{ on, attrs }">
<v-icon class="nav-arrow right" v-bind="attrs" v-on="on" >mdi-chevron-down</v-icon>
</template>
<v-list dense>
<v-list-item two-line v-for="printer in printers" v-bind:key="printer._namespace" @click="changePrinter(printer)" :disabled="!printer.socket.isConnected" link>
<v-list-item-content>
<v-list-item-title>{{ getPrinterName(printer._namespace) }}</v-list-item-title>
<v-list-item-subtitle>{{ getPrinterDescription(printer)}}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
</div>
<v-item-group class="v-btn-toggle mx-4 d-block row" name="printers" v-if="false">
<v-btn class="col" color="primary" @click="switchToPrinters">Printers</v-btn>
</v-item-group>
</li>
<v-divider class="my-4"></v-divider>
</div>
</template>
<script>
import { mapState } from 'vuex'
import router from "@/plugins/router";
export default {
name: "PrinterSelecter.vue",
computed: {
...mapState({
remoteMode: state => state.socket.remoteMode
}),
countPrinters: {
get() {
return this.$store.getters["farm/countPrinters"]
}
},
printers: {
get() {
return this.$store.getters["farm/getPrinters"]
}
},
currentPage: function() {
return this.$route.fullPath;
},
},
methods: {
switchToPrinters() {
router.push("/allPrinters");
},
getPrinterName(namespace) {
return this.$store.getters["farm/"+namespace+"/getPrinterName"]
},
getPrinterDescription(printer) {
return this.$store.getters["farm/"+printer._namespace+"/getStatus"]
},
changePrinter(printer) {
if (printer.socket.isConnected) {
if (this.remoteMode) this.$store.dispatch('changePrinter', { printer: printer._namespace })
else window.location.href = "//"+printer.socket.hostname+(parseInt(printer.socket.webPort) !== 80 ? ':'+printer.socket.webPort : '')
}
},
}
}
</script>
+283
View File
@@ -0,0 +1,283 @@
<style scoped>
</style>
<template>
<v-dialog v-model="showDialog" persistent :width="400">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
<span v-if="isConnecting">{{ $t("App.ConnectionTo") }}{{ parseInt(port) !== 80 ? hostname+':'+port : hostname }}</span>
<span v-if="connectingFailed">{{ $t("App.ConnectionFailed") }}</span>
<span v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">{{ $t("App.SelectPrinter") }}</span>
<span v-if="dialogAddPrinter.bool">{{ $t("App.AddPrinter") }}</span>
<span v-if="dialogEditPrinter.bool">{{ $t("App.EditPrinter") }}</span>
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool && this['farm/countPrinters'] > 0" small class="minwidth-0" @click="checkPrinters"><v-icon small>mdi-sync</v-icon></v-btn>
<v-btn small class="minwidth-0" v-if="!isConnecting && !connectingFailed && dialogAddPrinter.bool" @click="dialogAddPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
<v-btn small class="minwidth-0" v-if="!isConnecting && !connectingFailed && dialogEditPrinter.bool" @click="dialogEditPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-5" v-if="isConnecting">
<v-progress-linear color="white" indeterminate></v-progress-linear>
</v-card-text>
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}.</p>
<div class="text-center">
<v-btn @click="switchToChangePrinter" color="white" outlined class="mr-3">{{ $t("App.ChangePrinter") }}</v-btn>
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
</div>
</v-card-text>
<v-card-text class="pt-3" v-if="!isConnecting && dialogAddPrinter.bool">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-8">
<v-text-field
v-model="dialogAddPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
<v-col class="col-4">
<v-text-field
v-model="dialogAddPrinter.port"
:rules="[v => !!v || 'Port is required']"
label="Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="addPrinter"
>
{{ $t("App.AddPrinter") }}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-text class="pt-3" v-if="!isConnecting && dialogEditPrinter.bool">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-8">
<v-text-field
v-model="dialogEditPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
<v-col class="col-4">
<v-text-field
v-model="dialogEditPrinter.port"
:rules="[v => !!v || 'Port is required']"
label="Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="">
<v-btn
color="red"
outlined
class="middle minwidth-0"
@click="delPrinter"
>
<v-icon small>mdi-delete</v-icon>
</v-btn>
</v-col>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="updatePrinter"
>
{{ $t("App.UpdatePrinter") }}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-text class="pt-3" v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">
<v-container class="px-0 pb-0">
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;" @click="connect(printer)">
<v-row align="center">
<v-col class="col-auto pr-0">
<v-progress-circular
indeterminate
color="primary"
v-if="printer.socket.isConnecting"
></v-progress-circular>
<v-icon
:color="printer.socket.isConnected ? 'green' : 'red'"
v-if="!printer.socket.isConnecting"
>mdi-{{ printer.socket.isConnected ? 'checkbox-marked-circle' : 'cancel' }}</v-icon>
</v-col>
<v-col>{{ printer.socket.hostname }}{{ parseInt(printer.socket.port) !== 80 ? ":"+printer.socket.port : "" }}</v-col>
<v-col class="col-auto"><v-btn small class="minwidth-0" v-on:click.stop.prevent="editPrinter(index)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
</v-row>
</v-col>
</v-row>
<v-row v-if="showCorsInfo">
<v-col>
<p class="text-center" v-if="this['farm/countPrinters'] === 0">{{ $t("App.Hello") }}</p>
<p class="text-center">{{ $t("App.PleaseRememberToAdd") }}<code>{{ currentUrl }}</code> {{ $t("App.InMoonrakerConf") }}</p>
<p class="text-center">{{ $t("App.YouCanFindMore") }}<a href="https://docs.mainsail.xyz/remotemode" target="_blank">{{ $t("App.Remotemode") }}</a>.</p>
</v-col>
</v-row>
<v-row>
<v-col class="text-center mt-0">
<v-btn @click="dialogAddPrinter.bool = true">{{ $t("App.AddPrinter") }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</template>
<script>
import { mapState, mapGetters, mapActions } from "vuex";
import Vue from "vue";
export default {
data: function() {
return {
showDialog: true,
dialogAddPrinter: {
bool: false,
hostname: "",
port: 7125
},
dialogEditPrinter: {
bool: false,
index: 0,
hostname: "",
port: 0
}
}
},
computed: {
...mapState({
isConnected: state => state.socket.isConnected,
isConnecting: state => state.socket.isConnecting,
connectingFailed: state => state.socket.connectingFailed,
remoteMode: state => state.socket.remoteMode,
protocol: state => state.socket.protocol,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
}),
...mapGetters([
"farm/countPrinters",
"farm/getPrinters"
]),
...mapActions({
readPrinters: "farm/readStoredPrinters"
}),
currentUrl: {
get() {
return "http://"+window.location.hostname+(window.location.port !== 80 && window.location.port !== '' ? ':'+window.location.port : '')
}
},
showCorsInfo: {
get() {
if (this["farm/countPrinters"]) {
for (const [ ,printer] of Object.entries(this["farm/getPrinters"])) {
if (!printer.socket.isConnected) return true
}
return false
}
return true
}
}
},
methods: {
addPrinter() {
this.$store.commit('farm/addPrinter',{
hostname: this.dialogAddPrinter.hostname,
port: this.dialogAddPrinter.port,
protocol: this.protocol
})
this.dialogAddPrinter.hostname = ""
this.dialogAddPrinter.bool = false
this.$store.dispatch("farm/savePrinters")
},
editPrinter(index) {
this.dialogEditPrinter.hostname = this["farm/getPrinters"][index].socket.hostname
this.dialogEditPrinter.port = this["farm/getPrinters"][index].socket.port
this.dialogEditPrinter.index = index
this.dialogEditPrinter.bool = true
},
updatePrinter() {
this.$store.commit("farm/"+this.dialogEditPrinter.index+"/setSocketData", {
hostname: this.dialogEditPrinter.hostname,
port: this.dialogEditPrinter.port,
isConnecting: true,
})
this.$store.dispatch("farm/"+this.dialogEditPrinter.index+"/reconnect")
this.dialogEditPrinter.bool = false
this.checkPrinters()
},
delPrinter() {
this.$store.commit("farm/removePrinter", { name: this.dialogEditPrinter.index })
this.$store.dispatch("farm/savePrinters")
this.dialogEditPrinter.bool = false
},
connect(printer) {
this.$store.dispatch('socket/setData', {
hostname: printer.socket.hostname,
port: printer.socket.port
})
Vue.prototype.$socket.setUrl(this.protocol+"://"+printer.socket.hostname+":"+printer.socket.port+"/websocket")
Vue.prototype.$socket.connect()
},
reconnect() {
this.$store.dispatch('socket/setData', { connectingFailed: false })
Vue.prototype.$socket.connect()
},
switchToChangePrinter() {
this.$store.dispatch('socket/setData', { connectingFailed: false })
},
checkPrinters() {
Object.entries(this['farm/getPrinters']).forEach(([key, printer]) => {
if (!printer.socket.isConnected && !printer.socket.isConnecting) {
this.$store.dispatch('farm/'+key+'/connect')
}
})
}
},
mounted() {
this.$store.dispatch("farm/readStoredPrinters")
},
watch: {
isConnected(newVal) {
this.showDialog = !newVal
},
}
}
</script>
+27 -15
View File
@@ -5,7 +5,7 @@
</style>
<template>
<v-menu bottom left :offset-y="true" :close-on-content-click="false">
<v-menu bottom left :offset-y="true" :close-on-content-click="false" v-model="showMenu">
<template v-slot:activator="{ on, attrs }">
<v-btn dark icon v-bind="attrs" v-on="on">
<v-icon>mdi-dots-vertical</v-icon>
@@ -13,37 +13,37 @@
</template>
<v-list dense>
<v-subheader class="" style="height: auto;">Klipper Control</v-subheader>
<v-subheader class="" style="height: auto;">{{ $t("App.KlipperControl") }}</v-subheader>
<v-list-item class="minheight30" link @click="doRestart()">
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Restart</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Restart") }}</v-list-item-title>
</v-list-item>
<v-list-item class="minheight30" link @click="doFirmwareRestart()">
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Firmware Restart</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.FirmwareRestart") }}</v-list-item-title>
</v-list-item>
<v-divider class="mt-0"></v-divider>
<v-subheader class="pt-2" style="height: auto;">Restart Services</v-subheader>
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.RestartServices") }}</v-subheader>
<v-list-item class="minheight30" link @click="doServiceRestartKlipper()">
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Klipper</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Klipper") }}</v-list-item-title>
</v-list-item>
<v-list-item class="minheight30" link @click="doServiceRestartMoonraker()">
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Moonraker</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Moonraker") }}</v-list-item-title>
</v-list-item>
<div v-if="countPowerDevices">
<v-divider class="mt-0"></v-divider>
<v-subheader class="pt-2" style="height: auto;">Power Devices</v-subheader>
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error')">
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.PowerDevices") }}</v-subheader>
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error' || device.locked_while_printing && ['printing', 'paused'].includes(printer_state))">
<v-list-item-title>
<v-icon class="mr-2">mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}</v-icon>{{ device.device }}
<v-icon class="mr-2" :color="device.status === 'on' ? '' : 'grey darken-2'">mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}</v-icon>{{ device.device }}
</v-list-item-title>
</v-list-item>
</div>
<v-divider class="mt-0"></v-divider>
<v-subheader class="pt-2" style="height: auto;">Host Control</v-subheader>
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.HostControl") }}</v-subheader>
<v-list-item class="minheight30" link @click="doHostReboot()">
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Reboot</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Reboot") }}</v-list-item-title>
</v-list-item>
<v-list-item class="minheight30" link @click="doHostShutdown()">
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Shutdown</v-list-item-title>
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Shutdown") }}</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
@@ -55,8 +55,14 @@ import Vue from "vue";
export default {
name: "TopCornerMenu.vue",
data: function () {
return {
showMenu: false,
}
},
computed: {
...mapState({
printer_state: state => state.printer.print_stats.state,
devices: (state) => state.server.power.devices,
}),
countPowerDevices: {
@@ -74,23 +80,29 @@ export default {
Vue.prototype.$socket.sendObj(rpc,{ [device.device]: null },"server/power/responseToggle")
},
doRestart: function() {
this.$store.commit('server/addEvent', "RESTART")
this.showMenu = false
this.$store.commit('server/addEvent', { message: "RESTART", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "RESTART" })
},
doFirmwareRestart: function() {
this.$store.commit('server/addEvent', "FIRMWARE_RESTART")
this.showMenu = false
this.$store.commit('server/addEvent', { message: "FIRMWARE_RESTART", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" })
},
doServiceRestartKlipper: function() {
this.showMenu = false
this.$socket.sendObj('machine.services.restart', { service: "klipper" })
},
doServiceRestartMoonraker: function() {
this.showMenu = false
this.$socket.sendObj('machine.services.restart', { service: "moonraker" })
},
doHostReboot: function() {
this.showMenu = false
this.$socket.sendObj('machine.reboot', { })
},
doHostShutdown: function() {
this.showMenu = false
this.$socket.sendObj('machine.shutdown', { })
},
}
+9 -6
View File
@@ -25,10 +25,10 @@
</template>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-update</v-icon>Updating {{ application }}{{ complete ? " done!" : "..." }}</span>
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t("App.Updating")}} {{ application }}{{ complete ? " done!" : "..." }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-6 pb-2">
<v-card-text class="py-6">
<v-data-table
:headers="headers"
:options="options"
@@ -45,7 +45,7 @@
color="primary"
>
<template #no-data>
<div class="py-2">empty</div>
<div class="py-2">{{ $t("App.Empty")}}</div>
</template>
<template #item="{ item }">
@@ -61,7 +61,7 @@
</v-data-table>
<v-row>
<v-col class="text-center pt-5">
<v-btn @click="close" :disabled="!complete" color="primary">close</v-btn>
<v-btn @click="close" :disabled="!complete" color="primary">{{ $t("App.Close")}}</v-btn>
</v-col>
</v-row>
</v-card-text>
@@ -128,8 +128,11 @@ export default {
return items;
},
close() {
if (this.application === "client" && this.complete) window.location.reload(true)
else this.$store.commit('server/updateManager/resetUpdateResponse')
if (this.application !== null && this.complete && ["client", "mainsail"].includes(this.application.toLowerCase())) window.location.reload(true)
else {
this.$store.commit('server/updateManager/resetUpdateResponse')
this.$socket.sendObj('machine.update.status', { refresh: false }, 'server/updateManager/getStatus')
}
}
},
updated(){
+90 -10
View File
@@ -1,8 +1,9 @@
<template>
<div id="tempchart" style="height: 270px; width: 100%;"></div>
<div id="tempchart" style="height: 300px; width: 100%;"></div>
</template>
<script>
import { mapState } from 'vuex'
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
export default {
@@ -11,10 +12,13 @@ export default {
},
data: function() {
return {
chart : null,
tempchartDisplayMinutes: 10,
timer: '',
timerChart: '',
timerDataset: '',
chartOptions: {
theme: "dark1",
zoomEnabled: true,
backgroundColor: 'transparent',
animationEnabled: true,
legend: {
@@ -22,8 +26,52 @@ export default {
verticalAlign: "top",
},
toolTip:{
content: "{name}: {y}",
yValueFormatString: "#,###.00",
shared: true,
borderColor: "#ffffff30",
content: (e) => {
let output = ""
if (e.entries[0].dataPoint.x) {
const date = new Date(e.entries[0].dataPoint.x)
const hours = "0" + date.getHours();
const minutes = "0" + date.getMinutes();
const seconds = "0" + date.getSeconds();
output += "<strong>"+hours.substr(-2) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2)+"</strong>"
}
const mainEntries = e.entries.filter(dataset => dataset.dataSeries.showInLegend && dataset.dataSeries.visible).sort((a,b) => {
if (a.dataSeries.legendText > b.dataSeries.legendText) return 1
if (a.dataSeries.legendText < b.dataSeries.legendText) return -1
return 0
})
if (mainEntries.length) {
mainEntries.forEach(dataset => {
output += "<br />"
output += dataset.dataSeries.legendText+": "+dataset.dataPoint.y.toFixed(1)
const datasetTarget = e.entries.find(datasetTarget => datasetTarget.dataSeries.name === dataset.dataSeries.name+"_target")
if (datasetTarget) {
output += " / "+datasetTarget.dataPoint.y.toFixed(1)
}
output += "°C"
const datasetPower = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_power")
if (datasetPower) {
output += " at "+datasetPower.dataPoint.y.toFixed(0)+"%"
}
const datasetSpeed = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_speed")
if (datasetSpeed) {
output += " at "+datasetSpeed.dataPoint.y.toFixed(0)+"%"
}
})
}
return output
}
},
axisX:{
valueFormatString: "HH:mm" ,
@@ -40,16 +88,44 @@ export default {
minimum: 0,
maximum: 300,
interval: 50,
suffix: '°C'
},
axisY2: {
gridThickness: 0,
gridColor: '#ffffff30',
minimum: 0,
maximum: 100,
interval: 25,
suffix: '%'
},
data: [ ]
},
chart : null
}
},
computed: {
...mapState({
intervalChartUpdate: state => state.gui.tempchart.intervalChartUpdate,
intervalDatasetUpdate: state => state.gui.tempchart.intervalDatasetUpdate,
}),
datasets: {
get () {
return this.$store.state.printer.tempHistory.datasets
const datasets = this.$store.state.printer.tempHistory.datasets
return datasets.sort((a,b) => {
if ('name' in a && 'name' in b) {
if (a.name.endsWith("_target") > b.name.endsWith("_power")) return -1
if (a.name.endsWith("_power") < b.name.endsWith("_target")) return 1
if (a.name.endsWith("_target") > b.name.endsWith("_target")) return -1
if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1
}
return 0
})
}
},
autoscale: {
get() {
return this.$store.state.gui.tempchart.autoscale
}
},
maxTemp: {
@@ -69,8 +145,7 @@ export default {
},
created() {
this.timer = setInterval(() => {
this.timerChart = setInterval(() => {
if (
document.getElementById("tempchart") &&
this.chart &&
@@ -79,10 +154,15 @@ export default {
this.chartOptions.data = this.datasets
this.chartOptions.axisX.minimum = new Date() - 60* this.tempchartDisplayMinutes *1000
this.chartOptions.axisX.maximum = new Date()
this.chartOptions.axisY.maximum = this.maxTemp
this.chartOptions.axisY.maximum = this.autoscale ? null : this.maxTemp
//this.chartOptions.axisY.interval = this.autoscale ? 25 : 50
this.chart.render()
}
}, 1000);
}, this.intervalChartUpdate)
this.timerDataset = setInterval(() => {
this.$store.dispatch("printer/tempHistory/updateDatasets")
}, this.intervalDatasetUpdate)
},
mounted: function() {
this.createChart()
+7 -1
View File
@@ -2,9 +2,15 @@
import panels from './panels'
import topCornerMenu from './TopCornerMenu'
import updateDialog from './UpdateDialog'
import connectingDialog from './ConnectingDialog'
import selectPrinterDialog from './SelectPrinterDialog'
import printerSelecter from './PrinterSelecter'
export default {
panels,
topCornerMenu,
updateDialog
updateDialog,
connectingDialog,
selectPrinterDialog,
printerSelecter,
}
+79 -66
View File
@@ -11,59 +11,47 @@
<template>
<v-card>
<v-row class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 pb-0 text-center">
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn>
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">QGL</v-btn>
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">Z Tilt</v-btn>
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('X-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
<v-btn @click="doSendMove('X-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
<v-btn @click="doSendMove('X-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
<v-btn @click="doSendMove('X+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
<v-btn @click="doSendMove('X+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
<v-btn @click="doSendMove('X+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Y-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
<v-btn @click="doSendMove('Y-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
<v-btn @click="doSendMove('Y-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
<v-btn @click="doSendMove('Y+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
<v-btn @click="doSendMove('Y+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
<v-btn @click="doSendMove('Y+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Z-25')" dense class="btnMinWidthAuto col"><span class="body-2">-25</span></v-btn>
<v-btn @click="doSendMove('Z-1')" dense class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
<v-btn @click="doSendMove('Z-0.1')" dense class="btnMinWidthAuto col"><span class="body-2">-0.1</span></v-btn>
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
<v-btn @click="doSendMove('Z+0.1')" dense class="btnMinWidthAuto col"><span class="body-2">+0.1</span></v-btn>
<v-btn @click="doSendMove('Z+1')" dense class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
<v-btn @click="doSendMove('Z+25')" dense class="btnMinWidthAuto col"><span class="body-2">+25</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="" v-if="this['printer/getMacros'].length > 0">
<v-col class="col-12 px-4 py-2 text-center">
<div v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
<v-btn small color="primary" class="mx-1 my-1" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
</div>
</v-col>
</v-row>
<v-container class="pt-0">
<v-row no-gutters class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 mt-3 pb-0 text-center">
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">{{ $t("Dashboard.Home")}} </span>{{ $t("Dashboard.All")}}</v-btn>
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">{{ $t("Dashboard.QGL")}}</v-btn>
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">{{ $t("Dashboard.ZTilt")}}</v-btn>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="text-center">
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
<v-col class="text-center">
<v-btn v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" small color="primary" class="mx-1 mt-3" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
</template>
@@ -85,59 +73,84 @@
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.printer.configfile.config,
loadings: state => state.socket.loadings,
printer_state: state => state.printer.print_stats.state
printer_state: state => state.printer.print_stats.state,
feedrateXY: state => state.gui.dashboard.control.feedrateXY,
stepsXY: state => state.gui.dashboard.control.stepsXY,
feedrateZ: state => state.gui.dashboard.control.feedrateZ,
stepsZ: state => state.gui.dashboard.control.stepsZ,
}),
...mapGetters([
'printer/getMacros',
])
]),
stepsXYsorted: {
get() {
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return b-a })
}
},
stepsXYsortedReverse: {
get() {
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return a-b })
}
},
stepsZsorted: {
get() {
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return b-a })
}
},
stepsZsortedReverse: {
get() {
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return a-b })
}
}
},
methods: {
doHome() {
this.$store.commit('server/addEvent', "G28");
this.$store.commit('server/addEvent', { message: "G28", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeAll' });
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' });
},
doHomeX() {
this.$store.commit('server/addEvent', "G28 X");
this.$store.commit('server/addEvent', { message: "G28 X", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeX' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "socket/removeLoading", { name: 'homeX' });
},
doHomeY() {
this.$store.commit('server/addEvent', "G28 Y");
this.$store.commit('server/addEvent', { message: "G28 Y", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeY' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "socket/removeLoading", { name: 'homeY' });
},
doHomeZ() {
this.$store.commit('server/addEvent', "G28 Z");
this.$store.commit('server/addEvent', { message: "G28 Z", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'homeZ' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "socket/removeLoading", { name: 'homeZ' });
},
doQGL() {
this.$store.commit('server/addEvent', "QUAD_GANTRY_LEVEL");
this.$store.commit('server/addEvent', { message: "QUAD_GANTRY_LEVEL", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'qgl' });
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "socket/removeLoading", { name: 'qgl' });
},
doZtilt() {
this.$store.commit('server/addEvent', "Z_TILT_ADJUST");
this.$store.commit('server/addEvent', { message: "Z_TILT_ADJUST", type: 'command' });
this.$store.commit('socket/addLoading', { name: 'zTilt' });
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
},
doSendMove(gcode) {
doSendMove(gcode, feedrate) {
gcode = "G91" + "\n" +
"G1 " + gcode + " F6000" + "\n" +
"G1 " + gcode + " F"+feedrate*60 + "\n" +
"G90";
this.doSend(gcode);
},
doSend(gcode) {
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "server/getGcodeRespond");
},
doSendMacro(gcode) {
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
},
}
},
}
</script>
+38 -26
View File
@@ -4,26 +4,28 @@
<template>
<v-card v-if="(['standby', 'paused', 'complete'].includes(printer_state))">
<v-row class="px-3">
<v-col class="col-12 col-md-6">
<v-label>Feed amount in mm:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
</v-btn-toggle>
</v-col>
<v-col class="col-12 col-md-6">
<v-label>Feedrate in mm/s:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="px-3">
<v-col class="col-12 text-center">
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> Extrude</v-btn>
</v-col>
</v-row>
<v-container>
<v-row class="">
<v-col class="col col-md-6">
<v-label>{{ $t("Dashboard.FeedAmountIn") }} mm:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
</v-btn-toggle>
</v-col>
<v-col class="col col-md-6">
<v-label>{{ $t("Dashboard.FeedrateIn") }} mm/s:</v-label>
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="">
<v-col class="col text-center">
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t("Dashboard.Retract") }}</v-btn>
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t("Dashboard.Extrude") }}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
</template>
@@ -38,9 +40,7 @@
data: function() {
return {
feedAmount: 25,
feedrate: 5,
feedAmounts: [ 100, 25, 10, 5, 1 ],
feedrates: [ 60, 30, 15, 5, 1 ],
feedrate: 5
}
},
computed: {
@@ -48,11 +48,23 @@
loadings: state => state.socket.loadings,
printer_state: state => state.printer.print_stats.state,
extruder: state => state.printer.extruder,
config: state => state.printer.configfile.config
config: state => state.printer.configfile.config,
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
feedrates: state => state.gui.dashboard.extruder.feedrates,
}),
...mapGetters([
'printer/getExtrudePossible',
]),
feedamountsSorted: {
get() {
return [...this.feedamounts].sort((a,b) => { return b-a })
}
},
feedratesSorted: {
get() {
return [...this.feedrates].sort((a,b) => { return b-a })
}
}
},
methods: {
setFeedAmount(value) {
@@ -63,13 +75,13 @@
},
sendRetract() {
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
},
sendDetract() {
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
},
+121
View File
@@ -0,0 +1,121 @@
<style>
.v-card.disabledPrinter {
opacity: 0.6;
filter: grayscale(70%);
}
</style>
<template>
<v-card
:class="(!printer.socket.isConnected && !printer.socket.isConnecting ? 'disabledPrinter' : '')"
:loading="printer.socket.isConnecting"
@click="clickPrinter"
>
<v-toolbar flat dense :color="isCurrentPrinter ? 'primary' : ''">
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ printer_name }}</span>
</v-toolbar-title>
</v-toolbar>
<v-img
height="200px"
:src="printer_image"
class="d-flex align-end"
>
<v-card-title class="white--text py-2" style="background-color: rgba(0,0,0,0.3); backdrop-filter: blur(3px);">
<v-row>
<v-col class="col-auto pr-0 d-flex align-center" style="width: 58px">
<img class="my-auto" :src="printer_logo" style="width: 100%;" />
</v-col>
<v-col class="col" style="width: 100px">
<h3 class="font-weight-regular">{{ printer_status }}</h3>
<span class="subtitle-2 text-truncate px-0 text--disabled d-block" v-if="printer_current_filename !== ''"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ printer_current_filename }}</span>
</v-col>
</v-row>
</v-card-title>
</v-img>
<v-card-text class="px-0 py-2" v-if="printer_preview.length">
<v-container class="py-0">
<v-row>
<v-col :class="object.name === 'ETA' ? 'col-auto' : 'col' + ' px-2'" v-for="object in printer_preview" v-bind:key="object.name">
<strong class="d-block text-center">{{ object.name }}</strong>
<span class="d-block text-center">{{ object.value }}</span>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
props: {
printer: {
type: Object,
required: true,
},
},
computed: {
...mapState({
remoteMode: state => state.socket.remoteMode
}),
isCurrentPrinter: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/isCurrentPrinter"]
}
},
printer_name: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterName"]
}
},
printer_status: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getStatus"]
}
},
printer_current_filename: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getCurrentFilename"]
}
},
printer_image: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getImage"]
}
},
printer_logo: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getLogo"]
}
},
printer_position: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getPosition"]
}
},
printer_preview: {
get() {
return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterPreview"]
}
}
},
methods: {
clickPrinter() {
if (this.printer.socket.isConnected) this.changePrinter()
else this.reconnectPrinter()
},
changePrinter() {
if (this.remoteMode) this.$store.dispatch('changePrinter', { printer: this.printer._namespace })
else window.location.href = "//"+this.printer.socket.hostname+(parseInt(this.printer.socket.webPort) !== 80 ? ':'+this.printer.socket.webPort : '')
},
reconnectPrinter() {
this.$store.dispatch("farm/"+this.printer._namespace+"/reconnect")
}
}
}
</script>
+4 -4
View File
@@ -2,21 +2,21 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>Klippy-State: {{ klippy_state}}</span>
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>{{ $t('Setting.KlippyState')}}{{ klippy_state}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-0">
<v-layout wrap class=" text-center">
<v-flex col class="text-left" v-if="klippy_connected"><pre style="white-space: pre-wrap;">{{ klippy_message }}</pre></v-flex>
<v-flex col class="text-left" v-if="!klippy_connected">
<p>Moonraker can't connect to Klippy!<br />Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.</p>
<p style="white-space:pre-wrap">{{ $t('Setting.KlippyInfo') }}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE Restart</v-btn>
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.Restart') }}</v-btn>
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.FIRMWARERestart') }}</v-btn>
</v-card-text>
</v-card>
</template>
+11 -9
View File
@@ -9,23 +9,25 @@
!boolMacroResume ||
!boolMacroCancelPrint
">
<v-toolbar flat dense>
<v-toolbar flat dense color="orange darken-2">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-alert-circle" left></v-icon>Missing configuration
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MissingConfiguration") }}
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col class="text-left">
<p v-if="!boolVirtualSdcard"><code>virtual_sdcard</code> is not defined in config.</p>
<p v-if="!boolPauseResume"><code>pause_resume</code> is not defined in config.</p>
<p v-if="!boolDisplayStatus"><code>display_status</code> is not defined in config.</p>
<p v-if="!boolMacroPause"><code>gcode_macro PAUSE</code> is not defined in config.</p>
<p v-if="!boolMacroResume"><code>gcode_macro RESUME</code> is not defined in config.</p>
<p v-if="!boolMacroCancelPrint"><code>gcode_macro CANCEL_PRINT</code> is not defined in config.</p>
<p class="mb-0"><a href="https://meteyou.github.io/mainsail/necessary-configuration" target="_blank">Here you will find more information.</a></p>
<p v-if="!boolVirtualSdcard" class="orange--text"><code>virtual_sdcard</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
<div class="text-center">
<v-btn href="https://docs.mainsail.xyz/necessary-configuration" target="_blank" color="white" outlined small><v-icon small class="mr-1">mdi-information</v-icon>{{ $t("Dashboard.MoreInformation") }}</v-btn>
</div>
</v-flex>
</v-layout>
</v-card-text>
+33 -31
View File
@@ -23,46 +23,48 @@
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t("Dashboard.Console") }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupConsole')">
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Dashboard.HideTemperatures')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Dashboard.CustomFilters')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-toolbar>
<v-card-text class="py-0">
<v-row>
<v-col>
<v-text-field
label="Send code..."
ref="gcodeCommandField"
solo
hide-details
autocomplete="off"
v-model="gcode"
v-on:keyup.enter="doSend"
v-on:keyup.up="onKeyUp"
v-on:keyup.down="onKeyDown"
:items="items"
v-on:keydown.tab="getAutocomplete"
></v-text-field>
</v-col>
<v-col class="col-auto align-content-center">
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
<v-icon class="mr-2">mdi-send</v-icon> send
</v-btn>
</v-col>
</v-row>
<v-card-text>
<v-container class="py-0 px-0">
<v-row>
<v-col>
<v-text-field
:label="$t('Dashboard.SendCode')"
ref="gcodeCommandField"
solo
hide-details
autocomplete="off"
v-model="gcode"
v-on:keyup.enter="doSend"
v-on:keyup.up="onKeyUp"
v-on:keyup.down="onKeyDown"
:items="items"
v-on:keydown.tab="getAutocomplete"
></v-text-field>
</v-col>
<v-col class="col-auto align-content-center">
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
<v-icon class="mr-2">mdi-send</v-icon> {{ $t("Dashboard.Send") }}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-text class="px-0 py-0 content">
<v-divider></v-divider>
@@ -79,7 +81,7 @@
sort-by="date"
>
<template #no-data>
<div class="py-2">empty</div>
<div class="py-2">{{ $t("Dashboard.Empty") }}</div>
</template>
<template #item="{ item }">
@@ -163,7 +165,7 @@ import {mapState} from 'vuex'
methods: {
doSend() {
this.$store.commit('socket/addLoading', { name: 'sendGcode' });
this.$store.commit('server/addEvent', this.gcode);
this.$store.commit('server/addEvent', { message: this.gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "socket/removeLoading", { name: 'sendGcode' });
this.lastCommands.push(this.gcode);
this.gcode = "";
@@ -198,7 +200,7 @@ import {mapState} from 'vuex'
let output = "";
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
this.$store.commit('server/addEvent', output);
this.$store.commit('server/addEvent', { message: output, type: 'command' });
}
}
}
@@ -20,22 +20,22 @@
<v-card class="mt-6" v-if="['printing', 'paused'].includes(printer_state)">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</span>
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>{{ $t("Dashboard.PrintSettings") }}</span>
</v-toolbar-title>
</v-toolbar>
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" command="M220" attribute-name="S" ></tool-slider>
<v-divider></v-divider>
<tool-slider label="Extrusion factor" :target="extrude_factor" :max="200" :multi="100" :step="1" command="M221" attribute-name="S" ></tool-slider>
</v-card>
<v-card class="mt-6" v-if="this['printer/getFans'].length">
<v-card class="mt-6" v-if="this['printer/getMiscellaneous'].length">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon :class="'mdi mdi-fan '+(this['printer/getPartFanSpeed'] ? 'icon-rotate' : '')" left></v-icon>Fans</span>
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>{{ $t("Dashboard.Miscellaneous") }}</span>
</v-toolbar-title>
</v-toolbar>
<div v-for="(fan, index) of this['printer/getFans']" v-bind:key="index">
<div v-for="(object, index) of this['printer/getMiscellaneous']" v-bind:key="index">
<v-divider v-if="index"></v-divider>
<fan-slider :name="fan.name" :type="fan.type" :target="fan.speed" :controllable="fan.controllable" :multi="100" class="py-0" ></fan-slider>
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)" ></miscellaneous-slider>
</div>
</v-card>
</div>
@@ -43,12 +43,12 @@
<script>
import { mapState, mapGetters } from 'vuex'
import FanSlider from '../../inputs/FanSlider'
import ToolSlider from '../../inputs/ToolSlider'
import MiscellaneousSlider from "@/inputs/MiscellaneousSlider";
export default {
components: {
FanSlider,
MiscellaneousSlider,
ToolSlider
},
data () {
@@ -63,8 +63,7 @@
printer_state: state => state.printer.print_stats.state,
}),
...mapGetters([
'printer/getFans',
'printer/getPartFanSpeed',
'printer/getMiscellaneous',
]),
},
}
@@ -0,0 +1,44 @@
<template>
<v-card
class="mb-6">
<v-toolbar flat dense color="orange darken-2">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MoonrakerFailedPlugins") }}
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col class="text-left">
<p class="orange--text">{{ $t("Dashboard.MoonrakerErrorInfo") }}</p>
<p class="mb-2 orange--text">{{ $t("Dashboard.FollowingPluginHasAnError") }}</p>
<ul class="mt-0 pt-0">
<li v-for="plugin in failedPlugins" v-bind:key="plugin" class="orange--text"><code>{{ plugin }}</code></li>
</ul>
</v-flex>
</v-layout>
</v-card-text>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left">
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Dashboard.DownloadLog") }}</v-btn>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex';
export default {
data: () => ({
}),
computed: {
...mapState({
failedPlugins: state => state.server.failed_plugins,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
}),
},
}
</script>
@@ -25,182 +25,188 @@
</style>
<template>
<div>
<v-card>
<v-card-title>
Config Files
<v-spacer class="d-none d-sm-block"></v-spacer>
<input type="file" ref="fileUpload" style="display: none" multiple @change="uploadFile" />
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0">
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="uploadFileButton" :loading="loadings.includes['configFileUpload']"><v-icon>mdi-file-upload</v-icon></v-btn>
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn class="flex-grow-1" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
<v-menu :offset-y="true" title="Setup current list">
<template v-slot:activator="{ on, attrs }">
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" label="Hidden files"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
</v-card-title>
<v-card-subtitle>Current path: {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:page.sync="currentPage"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page.sync="countPerPage"
:footer-props="{
itemsPerPageText: 'Files'
}"
mobile-breakpoint="0"
item-key="name">
<v-row>
<v-col>
<v-card>
<v-card-title>
{{ $t('Setting.ConfigFiles') }}
<v-spacer class="d-none d-sm-block"></v-spacer>
<input type="file" ref="fileUpload" style="display: none" multiple @change="uploadFile" />
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0">
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="uploadFileButton" :loading="loadings.includes['configFileUpload']"><v-icon>mdi-file-upload</v-icon></v-btn>
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn class="flex-grow-1" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
<v-menu :offset-y="true" title="Setup current list">
<template v-slot:activator="{ on, attrs }">
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Setting.HiddenFiles')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
</v-card-title>
<v-card-subtitle>{{ $t('Setting.CurrentPath') }} {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:page.sync="currentPage"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page.sync="countPerPage"
:footer-props="{
itemsPerPageText: $t('Setting.Files')
}"
mobile-breakpoint="0"
item-key="name">
<template #no-data>
<div class="text-center">empty</div>
</template>
<template #no-data>
<div class="text-center">{{ $t('Setting.Empty') }}</div>
</template>
<template slot="body.prepend" v-if="(currentPath !== '')">
<tr
class="file-list-cursor"
@click="clickRowGoBack">
<td class="pr-0 text-center" style="width: 32px;"><v-icon>mdi-folder-upload</v-icon></td>
<td class=" " colspan="8">..</td>
</tr>
</template>
<template slot="body.prepend" v-if="(currentPath !== '')">
<tr
class="file-list-cursor"
@click="clickRowGoBack">
<td class="pr-0 text-center" style="width: 32px;"><v-icon>mdi-folder-upload</v-icon></td>
<td class=" " colspan="8">..</td>
</tr>
</template>
<template #item="{ item }">
<tr
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
:data-name="item.filename">
<td class="pr-0 text-center" style="width: 32px;">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory">mdi-file</v-icon>
</td>
<td class=" ">{{ item.filename }}</td>
<td class="text-no-wrap text-right">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
<td class="text-right">{{ formatDate(item.modified) }}</td>
</tr>
</template>
</v-data-table>
</v-card>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> Edit file
</v-list-item>
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
</v-list-item>
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
</v-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
</v-list-item>
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory && currentPath !== '' && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
</v-list-item>
</v-list>
</v-menu>
<v-dialog v-model="editor.showLoader" hide-overlay persistent width="300" >
<v-card color="primary" dark >
<v-card-text>
Please stand by
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
</v-card-text>
<template #item="{ item }">
<tr
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
:data-name="item.filename">
<td class="pr-0 text-center" style="width: 32px;">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory">mdi-file</v-icon>
</td>
<td class=" ">{{ item.filename }}</td>
<td class="text-no-wrap text-right">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
<td class="text-right">{{ formatDate(item.modified) }}</td>
</tr>
</template>
</v-data-table>
</v-card>
</v-dialog>
<v-dialog v-model="editor.show" fullscreen hide-overlay transition="dialog-bottom-transition" content-class="config-editor-overlay">
<v-card d-flex>
<v-toolbar dark color="primary">
<v-btn icon dark @click="editor.show = false">
<v-icon>mdi-close</v-icon>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> {{ $t('Setting.EditFile') }}
</v-list-item>
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Setting.Download') }}
</v-list-item>
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Setting.Rename') }}
</v-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Setting.Delete') }}
</v-list-item>
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory && currentPath !== '' && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Setting.Delete') }}
</v-list-item>
</v-list>
</v-menu>
<v-dialog v-model="editor.showLoader" hide-overlay persistent width="300" >
<v-card color="primary" dark >
<v-card-text>
{{ $t('Setting.PleaseStandBy') }}
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="editor.show" fullscreen hide-overlay transition="dialog-bottom-transition" content-class="config-editor-overlay">
<v-card d-flex>
<v-toolbar dark color="primary">
<v-btn icon dark @click="editor.show = false">
<v-icon>mdi-close</v-icon>
</v-btn>
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark text href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>{{ $t('Setting.ConfigReference') }}</v-btn>
<v-divider white vertical v-if="currentPath !== '/config_examples'" class="d-none d-md-flex"></v-divider>
<v-btn dark text @click="saveFile(false)" v-if="currentPath !== '/config_examples'"><v-icon small class="mr-1">mdi-content-save</v-icon><span class="d-none d-sm-inline">{{ $t('Setting.Save') }}</span></v-btn>
<v-divider white vertical v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"></v-divider>
<v-btn dark text @click="saveFile(true)" v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"><v-icon small class="mr-1">mdi-restart</v-icon>{{ $t('Setting.SaveRestart') }}</v-btn>
</v-toolbar-items>
</v-toolbar>
<prism-editor class="my-editor" v-model="editor.sourcecode" :readonly="editor.readonly" :highlight="highlighter" line-numbers></prism-editor>
</v-card>
</v-dialog>
<v-dialog v-model="dialogRenameFile.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.RenameFile') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogRenameFile.newName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="renameFileAction">{{ $t('Setting.Rename') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFile.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.CreateFile') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFile.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFile.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFileAction">{{ $t('Setting.Create') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFolder.show" max-width="400">
<v-card>
<v-card-title class="headline">{{ $t('Setting.CreateFolder') }}</v-card-title>
<v-card-text>
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFolder.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFolder.show = false">{{ $t('Setting.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createFolderAction">{{ $t('Setting.Create') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-snackbar
:timeout="-1"
:value="true"
fixed
right
bottom
dark
v-model="uploadSnackbar.status"
>
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t('Setting.Uploading') }} {{ uploadSnackbar.filename }}</strong><br />
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
<template v-slot:action="{ attrs }">
<v-btn
color="red"
text
v-bind="attrs"
@click="cancelUpload"
style="min-width: auto;"
>
<v-icon class="0">mdi-close</v-icon>
</v-btn>
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark text @click="saveFile" v-if="currentPath !== '/config_examples'">Save</v-btn>
</v-toolbar-items>
</v-toolbar>
<prism-editor class="my-editor" v-model="editor.sourcecode" :readonly="editor.readonly" :highlight="highlighter" line-numbers></prism-editor>
</v-card>
</v-dialog>
<v-dialog v-model="dialogRenameFile.show" max-width="400">
<v-card>
<v-card-title class="headline">Rename File</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogRenameFile.newName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameFile.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="renameFileAction">rename</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFile.show" max-width="400">
<v-card>
<v-card-title class="headline">Create File</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogCreateFile.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFile.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="createFileAction">create</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFolder.show" max-width="400">
<v-card>
<v-card-title class="headline">Create Folder</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogCreateFolder.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFolder.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="createFolderAction">create</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-snackbar
:timeout="-1"
:value="true"
fixed
right
bottom
dark
v-model="uploadSnackbar.status"
>
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>Uploading {{ uploadSnackbar.filename }}</strong><br />
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
<template v-slot:action="{ attrs }">
<v-btn
color="red"
text
v-bind="attrs"
@click="cancelUpload"
style="min-width: auto;"
>
<v-icon class="0">mdi-close</v-icon>
</v-btn>
</template>
</v-snackbar>
</div>
</template>
</v-snackbar>
</v-col>
</v-row>
</template>
<script>
@@ -228,9 +234,9 @@
selected: [],
headers: [
{ text: '', value: '', },
{ text: 'Name', value: 'filename', },
{ text: 'Filesize', value: 'size', align: 'right', },
{ text: 'Last modified', value: 'modified', align: 'right', },
{ text: this.$t('Setting.Name'), value: 'filename', },
{ text: this.$t('Setting.Filesize'), value: 'size', align: 'right', },
{ text: this.$t('Setting.LastModified'), value: 'modified', align: 'right', },
],
options: {
},
@@ -289,6 +295,7 @@
hostname: state => state.socket.hostname,
port: state => state.socket.port,
loadings: state => state.socket.loadings,
printer_state: state => state.printer.print_stats.state,
}),
countPerPage: {
get: function() {
@@ -375,7 +382,7 @@
this.files = findDirectory(this.filetree, dirArray);
if (dirArray.length === 1 && this.currentPath === "") {
this.files = this.files.filter(element => element.filename !== "gcodes");
this.files = this.files.filter(element => !["gcodes", "docs"].includes(element.filename))
}
if (!this.showHiddenFiles) {
@@ -405,7 +412,7 @@
clickRowGoBack: function() {
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
},
saveFile: function() {
saveFile: function(boolRestart = false) {
let file = new File([this.editor.sourcecode], this.editor.item.filename);
let formData = new FormData();
@@ -421,6 +428,13 @@
this.$toast.success("File '"+this.editor.item.filename+"' successfully saved.");
this.editor.show = false;
this.editor.sourcecode = "";
if (boolRestart && this.editor.item.filename === "moonraker.conf") {
this.$socket.sendObj('machine.services.restart', { service: "moonraker" })
} else if (boolRestart) {
this.$store.commit('server/addEvent', { message: "FIRMWARE_RESTART", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" })
}
}).catch(() => {
this.$toast.error("Error save "+this.editor.item.filename);
});
@@ -439,7 +453,7 @@
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
let link = document.createElement("a");
link.download = name;
link.href = '//' + this.hostname + ':' + this.port + '/server/files/' + filename;
link.href = '//' + this.hostname + ':' + this.port + '/server/files' + filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
+24 -21
View File
@@ -6,30 +6,33 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t('Setting.Console') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-row>
<v-col class="py-0">
<v-switch v-model="hideWaitTemperatures" label="Hide temperatures" hide-details class="mt-1"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="boolCustomFilters" label="Custom filter" hide-details class="mt-1"></v-switch>
</v-col>
</v-row>
<v-row v-if="boolCustomFilters">
<v-col class="">
<v-textarea
outlined
label="Rules"
v-model="customFilters"
hide-details
></v-textarea>
</v-col>
</v-row>
<v-container px-0 py-0>
<v-row>
<v-col class="py-2">
<v-switch v-model="hideWaitTemperatures" :label="$t('Setting.HideTemperatures')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolCustomFilters" :label="$t('Setting.CustomFilter')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row v-if="boolCustomFilters">
<v-col class="py-2">
<v-textarea
outlined
:label="$t('Setting.Rules')"
v-model="customFilters"
hide-details
class="mb-2"
></v-textarea>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -0,0 +1,63 @@
<style>
.webcamImage {
width: 100%;
}
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Setting.ControlExtruder') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-2 pb-0">
<v-text-field
:label="$t('Setting.FeedrateXY')"
v-model="feedrateXY"
type="number"
suffix="mm/s"
></v-text-field>
<v-text-field
:label="$t('Setting.FeedrateZ')"
v-model="feedrateZ"
type="number"
suffix="mm/s"
></v-text-field>
</v-card-text>
</v-card>
</template>
<script>
export default {
components: {
},
data: function() {
return {
}
},
computed: {
feedrateXY: {
get() {
return this.$store.state.gui.dashboard.control.feedrateXY
},
set(value) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: value } } })
}
},
feedrateZ: {
get() {
return this.$store.state.gui.dashboard.control.feedrateZ
},
set(value) {
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateZ: value } } })
}
},
},
methods: {
}
}
</script>
@@ -1,32 +1,32 @@
<style>
.settings_dashboard_switch .v-messages {
display: none;
}
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>Dashbaord</span>
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>{{ $t('Setting.Dashboard') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-row>
<v-col class="py-0">
<v-switch v-model="boolShowWebcamOnDashboard" label="Webcam" class="settings_dashboard_switch mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="boolShowTempchartOnDashboard" label="Tempchart" class="settings_dashboard_switch mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="boolShowConsoleOnDashboard" label="Console" class="settings_dashboard_switch mt-0"></v-switch>
</v-col>
</v-row>
<v-card-text>
<v-container px-0 py-0>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowWebcamOnDashboard" :label="$t('Setting.Webcam')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowTempchartOnDashboard" :label="$t('Setting.Tempchart')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolShowConsoleOnDashboard" :label="$t('Setting.Console')" hide-details class="mt-0"></v-switch>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
+11 -11
View File
@@ -2,23 +2,23 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>Endstops</span>
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>{{ $t('Setting.Endstops')}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pb-0">
<div v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-row>
<v-col class="py-2">
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
<v-container px-0 py-0>
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-col>
<label class="mt-1 d-inline-block">{{ $t('Setting.Endstop')}} <b>{{ index.toUpperCase() }}</b></label>
<v-chip class="float-right" :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
</v-col>
</v-row>
</div>
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
<v-col class="py-0">
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
</v-col>
</v-row>
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
<v-col>
<p>{{ $t('Setting.EndstopInfo')}}</p>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
@@ -8,18 +8,14 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-cog</v-icon>General</span>
<span class="subheading"><v-icon left>mdi-cog</v-icon>{{ $t('Setting.General') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-0">
<v-row>
<v-col class="pt-2 pb-0">
<v-text-field
v-model="printerName"
label="Printer Name"
></v-text-field>
</v-col>
</v-row>
<v-card-text class="pt-2 pb-0">
<v-text-field
v-model="printerName"
:label="$t('Setting.PrinterName')"
></v-text-field>
</v-card-text>
</v-card>
</template>
@@ -0,0 +1,58 @@
<style>
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-translate</v-icon>{{ $t('Setting.Language') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pt-2 pb-0">
<v-select
v-model="lang"
@change="changeLanguage"
:items="items"
:label="$t('Setting.Language')"
></v-select>
</v-card-text>
</v-card>
</template>
<script>
export default {
components: {
},
data: function() {
return {
items: [
{
text: "English",
value: "en"
},
{
text: "简体中文",
value: "zh"
}
]
}
},
computed: {
lang: {
get() {
return localStorage.getItem("lang")
},
set(newName){
return localStorage.setItem("lang",newName)
}
}
},
methods: {
changeLanguage(val){
this.$i18n.locale = this.lang = val
}
}
}
</script>
@@ -2,16 +2,16 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</span>
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Setting.MachineLimits')}}</span>
</v-toolbar-title>
</v-toolbar>
<tool-slider label="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
<tool-slider :label="$t('Setting.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
<v-divider></v-divider>
<tool-slider label="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
<tool-slider :label="$t('Setting.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
<v-divider></v-divider>
<tool-slider label="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
<tool-slider :label="$t('Setting.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
<v-divider></v-divider>
<tool-slider label="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
<tool-slider :label="$t('Setting.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
</v-card>
</template>
@@ -2,18 +2,20 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>Logfiles</span>
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>{{ $t("Setting.Logfiles")}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text :class="'text-center text-lg-left py-0'">
<v-row>
<v-col :class="'col-12' +(klippy_state !== 'ready' ? 'col-md-6' : 'col-md-12')+ ''">
<v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper</v-btn>
</v-col>
<v-col :class="'col-12 pt-0 ' +(klippy_state !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12')+ ''">
<v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker</v-btn>
</v-col>
</v-row>
<v-container pb-0 px-0>
<v-row>
<v-col :class="'col-12' +(klippy_state !== 'ready' ? 'col-md-6' : 'col-md-12')+ ''">
<v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper</v-btn>
</v-col>
<v-col :class="'col-12 pt-0 ' +(klippy_state !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12')+ ''">
<v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -3,17 +3,17 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>Macros</span>
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Setting.Macros') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<div v-for="(macro, index) in this['printer/getAllMacros']" v-bind:key="index">
<v-row>
<v-col class="py-0">
<v-container px-0 py-0>
<v-row v-for="(macro, index) in this['printer/getAllMacros']" v-bind:key="index">
<v-col class="py-2">
<settings-macro-switch :name="macro.name"></settings-macro-switch>
</v-col>
</v-row>
</div>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -0,0 +1,345 @@
<template>
<div>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-fire</v-icon>{{ $t('Setting.PreheatPresets') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-container>
<v-row v-for="(preset, index) in this['gui/getPreheatPresets']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-row align="center">
<v-col class="pl-6">
<strong>{{ preset.name }}</strong>
</v-col>
<v-col class="col-6">
<div v-for="[key, value] in Object.entries(preset.values)" v-bind:key="key">
<span class="text-no-wrap" v-if="value.bool" >{{ convertPresetName(key, value) }}: {{ value.value }}°C</span>
</div>
</v-col>
<v-col class="col-auto text-right"><v-btn small class="minwidth-0 float-right" v-on:click.stop.prevent="editPreset(preset)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
</v-row>
</v-col>
</v-row>
<v-row>
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-row align="center">
<v-col class="pl-6">
<strong>{{ $t('Setting.Cooldown')}}</strong>
</v-col>
<v-col class="col-auto text-right"><v-btn small class="minwidth-0 float-right" v-on:click.stop.prevent="editCooldown"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
</v-row>
</v-col>
</v-row>
<v-row>
<v-col class="text-center mt-0">
<v-btn @click="createPreset">{{ $t('Setting.AddPreset')}}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
<v-dialog v-model="dialog.bool" persistent :width="600">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-fire" left></v-icon>
{{ dialog.index === null ? $t('Setting.Create') : $t('Setting.Edit') }} {{ $t('Setting.Preset') }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="dialog.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3">
<v-container class="pb-0">
<v-form
v-model="dialog.valid"
@submit.prevent="savePreset"
>
<template v-if="dialog.bool">
<v-row>
<v-col class="col-6">
<v-row>
<v-col class="col-12">
<v-text-field
v-model="dialog.name"
:label="$t('Setting.Name')"
hide-details="auto"
:rules="[rules.required, rules.unique]"
dense
></v-text-field>
</v-col>
</v-row>
<v-row class="mt-2 mx-0 mb-2" v-for="(heater) of this['printer/getHeaters']" v-bind:key="heater.name" align="center">
<v-checkbox
v-model="dialog.values[heater.name].bool"
hide-details
class="shrink mt-0"
></v-checkbox>
<v-text-field
v-model="dialog.values[heater.name].value"
:label="convertName(heater.name)"
hide-details="auto"
type="number"
suffix="°C"
></v-text-field>
</v-row>
<v-row class="mt-2 mx-0 mb-2" v-for="(fan) of this['printer/getTemperatureFans']" v-bind:key="'temperature_fan '+fan.name" align="center">
<v-checkbox
v-model="dialog.values['temperature_fan '+fan.name].bool"
hide-details
class="shrink mt-0"
></v-checkbox>
<v-text-field
v-model="dialog.values['temperature_fan '+fan.name].value"
:label="convertName(fan.name)"
hide-details="auto"
type="number"
suffix="°C"
></v-text-field>
</v-row>
</v-col>
<v-col class="col-6">
<v-textarea
outlined
name="input-7-4"
:label="$t('Setting.CustomGCode')"
v-model="dialog.gcode"
hide-details="auto"
></v-textarea>
</v-col>
</v-row>
<v-row class="mt-3" v-if="dialog.boolInvalidMin">
<v-col class="py-0">
<v-alert dense text type="error">{{ $t('Setting.PresetInfo')}}</v-alert>
</v-col>
</v-row>
<v-row class="mt-3">
<v-col class="text-center">
<v-btn
color="red"
outlined
class="float-left minwidth-0"
@click="deletePreset"
v-if="this.dialog.index !== null"
>
<v-icon>mdi-delete</v-icon>
</v-btn>
<v-btn
color="white"
outlined
:class="dialog.index !== null ? 'float-right' : '' "
type="submit"
>
{{ dialog.index === null ? $t('Setting.Store') : $t('Setting.Update') }} {{ $t('Setting.Preset') }}
</v-btn>
</v-col>
</v-row>
</template>
</v-form>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="cooldownDialog.bool" persistent :width="300">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-fire" left></v-icon> {{ $t('Setting.EditCooldown')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="cooldownDialog.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3">
<v-container class="pb-0">
<v-form
v-model="cooldownDialog.valid"
@submit.prevent="saveCooldown"
>
<v-row>
<v-col class="col-12">
<v-textarea
outlined
name="input-7-4"
:label="$t('Setting.CustomGCode')"
v-model="cooldownDialog.gcode"
:rules="[rules.required]"
></v-textarea>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="white"
outlined
type="submit"
>
{{ $t('Setting.UpdateCooldown')}}
</v-btn>
</v-col>
</v-row>
</v-form>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import {convertName} from "@/plugins/helpers";
export default {
components: {
},
data: function() {
return {
dialog: {
bool: false,
valid: false,
name: "",
gcode: "",
index: null,
boolInvalidMin: false,
values: {},
},
rules: {
required: (value) => value !== '' || 'required',
unique: (value) => !this.existsPresetName(value) || 'Name already exists',
},
cooldownDialog: {
bool: false,
gcode: "",
valid: false,
}
}
},
computed: {
...mapState({
orgState: state => state.gui.presets,
cooldownGcode: state => state.gui.cooldownGcode,
}),
...mapGetters([
'printer/getHeaters',
'printer/getTemperatureFans',
'gui/getPreheatPresets',
])
},
mounted() {
this.clearDialog()
},
methods: {
convertName: convertName,
convertPresetName(name, value) {
if (value.type === "temperature_fan") name = name.replace("temperature_fan ", "")
return this.convertName(name)
},
existsPresetName(name) {
return (this["gui/getPreheatPresets"].findIndex((preset) => preset.name === name && preset.index !== this.dialog.index) >= 0)
},
createPreset() {
this.clearDialog()
this.dialog.bool = true
},
clearDialog() {
this.dialog.bool = false
this.dialog.index = null
this.dialog.name = ""
this.dialog.gcode = ""
this.dialog.boolInvalidMin = false
this.dialog.values = {}
for(const heater of this["printer/getHeaters"]) {
this.dialog.values[heater.name] = {
bool: true,
value: 0,
type: 'heater',
}
}
for(const fan of this["printer/getTemperatureFans"]) {
this.dialog.values['temperature_fan '+fan.name] = {
bool: true,
value: 0,
type: 'temperature_fan',
}
}
},
editPreset(preset) {
this.dialog.name = preset.name
this.dialog.index = preset.index
this.dialog.gcode = preset.gcode
this.dialog.values = {}
for(const heater of this["printer/getHeaters"]) {
if (heater.name in preset.values) {
this.dialog.values[heater.name] = {...preset.values[heater.name]}
} else {
this.dialog.values[heater.name] = {
bool: false,
value: 0,
type: 'heater',
}
}
}
for(const fan of this["printer/getTemperatureFans"]) {
if ('temperature_fan '+fan.name in preset.values) {
this.dialog.values['temperature_fan '+fan.name] = {...preset.values['temperature_fan '+fan.name]}
} else {
this.dialog.values['temperature_fan '+fan.name] = {
bool: false,
value: 0,
type: 'temperature_fan',
}
}
}
this.dialog.bool = true
},
savePreset() {
let setValues = 0
for (const key of Object.keys(this.dialog.values)) {
if (this.dialog.values[key].bool) setValues++
}
if (this.dialog.gcode.length) setValues++
if (setValues === 0) this.dialog.boolInvalidMin = true
else if (this.dialog.valid) {
for (const key of Object.keys(this.dialog.values)) {
this.dialog.values[key].value = parseInt(this.dialog.values[key].value)
}
if (this.dialog.index) {
this.$store.dispatch('gui/updatePreset', this.dialog )
} else this.$store.dispatch('gui/addPreset', this.dialog )
this.clearDialog()
}
},
deletePreset() {
this.$store.dispatch('gui/deletePreset', this.dialog )
this.clearDialog()
},
editCooldown() {
this.cooldownDialog.gcode = this.cooldownGcode
this.cooldownDialog.bool = true
},
saveCooldown() {
if (this.cooldownDialog.valid) {
this.$store.dispatch("gui/setSettings", {cooldownGcode: this.cooldownDialog.gcode})
this.cooldownDialog.bool = false
}
},
}
}
</script>
@@ -0,0 +1,339 @@
<template>
<div>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ $t('Setting.RemotePrinters') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-3">
<v-container>
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
<v-row align="center">
<v-col class="col-auto pr-0">
<v-progress-circular
indeterminate
color="primary"
v-if="printer.socket.isConnecting"
></v-progress-circular>
<v-icon
:color="printer.socket.isConnected ? 'green' : 'red'"
v-if="!printer.socket.isConnecting"
>mdi-{{ printer.socket.isConnected ? 'checkbox-marked-circle' : 'cancel' }}</v-icon>
</v-col>
<v-col>{{ printer.socket.hostname }}{{ parseInt(printer.socket.port) !== 80 ? ":"+printer.socket.port : "" }}</v-col>
<v-col class="col-auto"><v-btn small class="minwidth-0" v-on:click.stop.prevent="editPrinter(index)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
</v-row>
</v-col>
</v-row>
<v-row>
<v-col class="text-center mt-0">
<v-btn @click="dialogAddPrinter.bool = true">{{ $t('Setting.AddPrinter')}}</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
<v-dialog v-model="dialogAddPrinter.bool" persistent :width="400">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
{{ $t('Setting.AddPrinter')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="dialogAddPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3" v-if="remoteMode">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-8">
<v-text-field
v-model="dialogAddPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
<v-col class="col-4">
<v-text-field
v-model="dialogAddPrinter.port"
:rules="[v => !!v || 'Port is required']"
label="Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="addPrinter"
>
{{ $t('Setting.AddPrinter')}}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-text class="pt-3" v-if="!remoteMode">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-12">
<v-text-field
v-model="dialogAddPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="col-6">
<v-text-field
v-model="dialogAddPrinter.webPort"
:rules="[v => !!v || 'Web-Port is required']"
label="Web-Port"
required
></v-text-field>
</v-col>
<v-col class="col-6">
<v-text-field
v-model="dialogAddPrinter.port"
:rules="[v => !!v || 'API-Port is required']"
label="API-Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="addPrinter"
>
{{ $t('Setting.AddPrinter')}}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="dialogEditPrinter.bool" persistent :width="400">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-connection" left></v-icon>
{{ $t('Setting.EditPrinter')}}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="dialogEditPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3" v-if="remoteMode">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-8">
<v-text-field
v-model="dialogEditPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
<v-col class="col-4">
<v-text-field
v-model="dialogEditPrinter.port"
:rules="[v => !!v || 'Port is required']"
label="Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="">
<v-btn
color="red"
outlined
class="middle minwidth-0"
@click="delPrinter"
>
<v-icon small>mdi-delete</v-icon>
</v-btn>
</v-col>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="updatePrinter"
>
{{ $t('Setting.UpdatePrinter')}}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-text class="pt-3" v-if="!remoteMode">
<v-container class="px-0 py-0">
<v-row>
<v-col class="col-12">
<v-text-field
v-model="dialogEditPrinter.hostname"
:rules="[
v => !!v || 'Hostname is required',
v => !v.startsWith('http:') || 'invalid hostname/IP',
v => !v.startsWith('https:') || 'invalid hostname/IP',
]"
label="Hostname/IP"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="col-6">
<v-text-field
v-model="dialogEditPrinter.webPort"
:rules="[v => !!v || 'Web-Port is required']"
label="Web-Port"
required
></v-text-field>
</v-col>
<v-col class="col-6">
<v-text-field
v-model="dialogEditPrinter.port"
:rules="[v => !!v || 'API-Port is required']"
label="API-Port"
required
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col class="">
<v-btn
color="red"
outlined
class="middle minwidth-0"
@click="delPrinter"
>
<v-icon small>mdi-delete</v-icon>
</v-btn>
</v-col>
<v-col class="text-right">
<v-btn
color="white"
outlined
class="middle"
@click="updatePrinter"
>
{{ $t('Setting.UpdatePrinter')}}
</v-btn>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
export default {
components: {
},
data: function() {
return {
dialogAddPrinter: {
bool: false,
hostname: "",
port: "7125",
webPort: "80"
},
dialogEditPrinter: {
bool: false,
hostname: "",
port: "",
webPort: "80",
index: ""
}
}
},
computed: {
...mapState({
remoteMode: state => state.socket.remoteMode,
protocol: state => state.socket.protocol,
}),
...mapGetters([
'farm/getPrinters',
])
},
methods: {
addPrinter() {
this.$store.commit('farm/addPrinter',{
hostname: this.dialogAddPrinter.hostname,
port: this.dialogAddPrinter.port,
webPort: this.dialogAddPrinter.webPort,
protocol: this.protocol
})
this.dialogAddPrinter.hostname = ""
this.dialogAddPrinter.port = "7125"
this.dialogAddPrinter.webPort = "80"
this.dialogAddPrinter.bool = false
this.$store.dispatch("farm/savePrinters")
},
editPrinter(index) {
this.dialogEditPrinter.hostname = this["farm/getPrinters"][index].socket.hostname
this.dialogEditPrinter.port = this["farm/getPrinters"][index].socket.port
this.dialogEditPrinter.webPort = this["farm/getPrinters"][index].socket.webPort
this.dialogEditPrinter.index = index
this.dialogEditPrinter.bool = true
},
updatePrinter() {
this.$store.commit("farm/"+this.dialogEditPrinter.index+"/setSocketData", {
hostname: this.dialogEditPrinter.hostname,
port: this.dialogEditPrinter.port,
webPort: this.dialogEditPrinter.webPort,
isConnecting: true,
})
this.$store.dispatch("farm/"+this.dialogEditPrinter.index+"/reconnect")
this.dialogEditPrinter.bool = false
this.$store.dispatch("farm/savePrinters")
},
delPrinter() {
this.$store.commit("farm/removePrinter", { name: this.dialogEditPrinter.index })
this.$store.dispatch("farm/savePrinters")
this.dialogEditPrinter.bool = false
this.$store.dispatch("farm/savePrinters")
},
}
}
</script>
@@ -10,7 +10,7 @@
<v-switch v-model="runout.enabled" hide-details @change="changeSensor(runout)" class="settingsRunoutSwitchInput my-0"></v-switch>
</v-toolbar>
<v-card-text v-if="runout.enabled">
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? 'detected' : 'empty' }}</v-chip>
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? $t('Setting.detected') : $t('Setting.Empty') }}</v-chip>
</v-card-text>
</v-card>
</div>
@@ -37,7 +37,7 @@
methods: {
changeSensor(runout) {
const gcode = 'SET_FILAMENT_SENSOR SENSOR='+runout.name+' ENABLE='+(runout.enabled ? 1 : 0)
this.$store.commit('server/addEvent', gcode)
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
}
+93 -118
View File
@@ -2,92 +2,66 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-update</v-icon>Update</span>
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Setting.UpdateManager')}}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
</template>
<span>Check for updates</span>
<span>{{ $t('Setting.CheckForUpdates')}}</span>
</v-tooltip>
</v-toolbar>
<v-card-text class="px-0 pt-0 pb-0 content">
<v-row v-if="'version' in klipper">
<v-col class="pl-6 py-2 text-no-wrap">
<strong>Klipper</strong><br />
{{ klipper.version }}
</v-col>
<v-col class="pr-6 py-2 text-right">
<v-chip
small
label
outlined
:color="getColor(klipper)"
@click="updateKlipper"
:disabled="is_disabled(klipper)"
class="minwidth-0 mt-2 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getIcon(klipper) }}</v-icon>{{ getText(klipper) }}</v-chip>
</v-col>
</v-row>
<div v-if="'version' in moonraker">
<v-divider class="mt-0 mb-0" ></v-divider>
<v-row>
<v-col class="pl-6 py-2 text-no-wrap">
<strong>Moonraker</strong><br />
{{ moonraker.version }}
</v-col>
<v-col class="pr-6 py-2 text-right">
<v-chip
small
label
outlined
:color="getColor(moonraker)"
@click="updateMoonraker"
:disabled="is_disabled(moonraker)"
class="minwidth-0 mt-2 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getIcon(moonraker) }}</v-icon>{{ getText(moonraker) }}</v-chip>
</v-col>
</v-row>
</div>
<div v-if="mainsail !== false && 'version' in mainsail">
<v-divider class="mt-0 mb-0" ></v-divider>
<v-row>
<v-col class="pl-6 py-2 text-no-wrap">
<strong>Mainsail</strong><br />
{{ 'v'+package_version }}
<span v-if="!is_disabled(mainsail)"> &gt; {{ mainsail.remote_version.replace('Version ', 'v') }}</span>
</v-col>
<v-col class="pr-6 py-2 text-right">
<v-chip
small
label
outlined
:color="getColor(mainsail)"
@click="updateMainsail"
:disabled="is_disabled(mainsail)"
class="minwidth-0 mt-2 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getIcon(mainsail) }}</v-icon>{{ getText(mainsail) }}</v-chip>
</v-col>
</v-row>
</div>
<v-divider class="mt-0 mb-0 border-top-2" ></v-divider>
<v-row>
<v-col class="pl-6 py-2 text-no-wrap">
<strong>System</strong><br />
OS-Packages
</v-col>
<v-col class="pr-6 py-2 text-right">
<v-chip
small
label
outlined
color="gray"
@click="updateSystem"
class="minwidth-0 mt-2 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-progress-upload</v-icon>upgrade</v-chip>
</v-col>
</v-row>
<v-card-text class="px-0 py-0">
<v-container py-0 px-0>
<div v-for="(value, key) of updateableSoftwares" v-bind:key="key">
<v-divider class="my-0" ></v-divider>
<v-row class="py-2">
<v-col class="pl-6">
{{ 'name' in value ? value.name : key }}<br />
{{ getVersionOutput(value) }}
</v-col>
<v-col class="col-auto pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="getBtnColor(value)"
@click="updateModule(key)"
:disabled="getBtnDisabled(value)"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
</v-col>
</v-row>
</div>
<div v-if="'system' in version_info">
<v-divider class="my-0 border-top-2" ></v-divider>
<v-row class="pt-2">
<v-col class="col-auto pl-6 text-no-wrap">
<strong>{{ $t('Setting.System')}}</strong><br />
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} {{ $t('Setting.PackagesCanBeUpgraded')}}</span>
</template>
<span>{{ version_info.system.package_list.join(', ') }}</span>
</v-tooltip>
<span v-if="version_info.system.package_count === 0">{{ $t('Setting.OSPackages')}}</span>
</v-col>
<v-col class="pr-6 text-right" align-self="center">
<v-chip
small
label
outlined
:color="version_info.system.package_count ? 'primary' : 'green'"
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
@click="updateSystem"
class="minwidth-0 px-2 text-uppercase"
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
</v-col>
</v-row>
</div>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -107,16 +81,14 @@
computed: {
...mapState({
package_version: state => state.packageVersion,
klipper: state => state.server.updateManager.klipper,
moonraker: state => state.server.updateManager.moonraker,
loadings: state => state.socket.loadings,
remoteMode: state => state.socket.remoteMode,
printer_state: state => state.printer.print_stats.state,
version_info: state => state.server.updateManager.version_info
}),
mainsail:{
updateableSoftwares: {
get() {
if ('name' in this.$store.state.server.updateManager.client)
return this.$store.state.server.updateManager.client
return false
return this.$store.getters["server/updateManager/getUpdateableSoftwares"]
}
}
},
@@ -125,73 +97,76 @@
this.$store.commit('socket/addLoading', { name: 'loadingBtnSyncUpdateManager' });
this.$socket.sendObj('machine.update.status', { refresh: true }, 'server/updateManager/getStatus')
},
getColor(object) {
getBtnColor(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return 'orange'
if ('is_dirty' in object && object.is_dirty) return 'orange'
if ('is_valid' in object && !object.is_valid) return 'red'
if ('is_dirty' in object && object.is_dirty) return 'red'
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'primary'
if ('name' in object && object.name === "mainsail") {
if ('v'+this.package_version !== object.remote_version.replace('Version ', 'v')) return 'primary'
}
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'primary'
return 'green'
}
return 'red'
},
getText(object) {
getBtnText(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return 'detached'
if ('is_valid' in object && !object.is_valid) return 'invalid'
if ('is_dirty' in object && object.is_dirty) return 'dirty'
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'update'
if ('name' in object && object.name === "mainsail") {
if ('v'+this.package_version !== object.remote_version.replace('Version ', 'v')) return 'update'
}
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'update'
return 'up-to-date'
}
return 'ERROR'
},
getIcon(object) {
getBtnIcon(object) {
if (typeof object === 'object' && object !== false) {
if ('detached' in object && object.detached) return 'alert-circle'
if ('is_valid' in object && !object.is_valid) return 'alert-circle'
if ('is_dirty' in object && object.is_dirty) return 'alert-circle'
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'progress-upload'
if ('name' in object && object.name === "mainsail") {
if ('v'+this.package_version !== object.remote_version.replace('Version ', 'v')) return 'progress-upload'
}
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'progress-upload'
return 'check'
}
return 'ERROR'
},
is_disabled(object) {
if (typeof object === 'object' && object !== false) {
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return false
getBtnDisabled(object) {
if (['printing', 'paused'].includes(this.printer_state)) return true
if ('detached' in object && object.detached) return true
if ('name' in object && object.name === "mainsail") {
if ('v'+this.package_version !== object.remote_version.replace('Version ', 'v')) return false
}
if (typeof object === 'object' && object !== false) {
if ('is_valid' in object && !object.is_valid) return true
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return false
}
return true
},
updateKlipper() {
this.$socket.sendObj('machine.update.klipper', { })
getVersionOutput(object) {
const local_version = 'version' in object ? object.version : '?'
const remote_version = 'remote_version' in object ? object.remote_version : '?'
let output = ""
if ('remote_alias' in object && object.remote_alias !== "origin") output += object.remote_alias
if ('branch' in object && object.branch !== "master") {
if (output !== "") output += "/"
output += object.branch
}
if (output !== "") output += ": "
output += local_version !== remote_version ? local_version+" > "+remote_version : local_version
return output
},
updateMoonraker() {
this.$socket.sendObj('machine.update.moonraker', { })
},
updateMainsail() {
this.$socket.sendObj('machine.update.client', { })
updateModule(key) {
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
else this.$socket.sendObj('machine.update.client', { name: key })
},
updateSystem() {
this.$socket.sendObj('machine.update.system', { })
+36 -34
View File
@@ -1,47 +1,49 @@
<style>
.content { overflow: hidden; }
</style>
<template>
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam') }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-row>
<v-col class="py-0">
<v-text-field
v-model="webcamUrl"
hide-details
label="Webcam URL"
></v-text-field>
</v-col>
</v-row>
<v-row v-if="rotationEnabled">
<v-col class="py-0" col-auto>
<v-switch v-model="rotate" hide-details label="Rotate"></v-switch>
</v-col>
<v-col>
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="flipX" hide-details label="Flip webcam horizontally"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="flipY" hide-details label="Flip webcam vertically"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<v-switch v-model="boolNavi" hide-details label="Show in navigation"></v-switch>
</v-col>
</v-row>
<v-container px-0 py-0>
<v-row>
<v-col class="pt-2 mb-1">
<v-text-field
v-model="webcamUrl"
hide-details
:label="$t('Setting.WebcamURL')"
></v-text-field>
</v-col>
</v-row>
<v-row v-if="rotationEnabled">
<v-col class="py-2" col-auto>
<v-switch v-model="rotate" hide-details :label="$t('Setting.Rotate')" class="mt-0"></v-switch>
</v-col>
<v-col>
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="flipX" hide-details :label="$t('Setting.FlipWebcamHorizontally')" class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="flipY" hide-details :label="$t('Setting.FlipWebcamVertically')" class="mt-0"></v-switch>
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-switch v-model="boolNavi" hide-details :label="$t('Setting.ShowInNavigation')" class="mt-0"></v-switch>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
+8
View File
@@ -1,6 +1,7 @@
import Vue from 'vue'
import GeneralPanel from './GeneralPanel'
import ControlPanel from './ControlPanel'
import WebcamPanel from './WebcamPanel'
import DashboardPanel from "./DashboardPanel";
import ConsolePanel from "./ConsolePanel";
@@ -11,8 +12,12 @@ import ConfigFilesPanel from "./ConfigFilesPanel";
import RunoutPanel from "./RunoutPanel";
import LogfilesPanel from "./LogfilesPanel";
import UpdatePanel from "./UpdatePanel";
import RemotePrintersPanel from "./RemotePrintersPanel";
import PresetsPanel from "./PresetsPanel";
import LanguagePanel from "./LanguagePanel";
Vue.component('settings-general-panel', GeneralPanel);
Vue.component('settings-control-panel', ControlPanel);
Vue.component('settings-webcam-panel', WebcamPanel);
Vue.component('settings-dashboard-panel', DashboardPanel);
Vue.component('settings-console-panel', ConsolePanel);
@@ -23,6 +28,9 @@ Vue.component('settings-runout-panel', RunoutPanel);
Vue.component('settings-logfiles-panel', LogfilesPanel);
Vue.component('settings-config-files-panel', ConfigFilesPanel);
Vue.component('settings-update-panel', UpdatePanel);
Vue.component('settings-remote-printers-panel', RemotePrintersPanel);
Vue.component('settings-presets-panel', PresetsPanel);
Vue.component('settings-language-panel', LanguagePanel);
export default {
+281 -98
View File
@@ -17,114 +17,203 @@
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading align-baseline">
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown") }}
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : $t("Dashboard.Unknown")) }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-item-group class="v-btn-toggle" name="controllers">
<v-btn small class="px-2 minwidth-0" color="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')" title="Pause print"><v-icon small>mdi-pause</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob" title="Cancel print"><v-icon small>mdi-stop</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob" title="Resume job"><v-icon small>mdi-play</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'error')" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob" title="Clear job"><v-icon small>mdi-close</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-if="(printer_state === 'complete')" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob" title="Reprint job"><v-icon small>mdi-autorenew</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-pause</v-icon>
</template>
<span>{{ $t("Dashboard.PausePrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
</template>
<span>{{ $t("Dashboard.CancelPrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-play</v-icon>
</template>
<span>{{ $t("Dashboard.ResumePrint") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-broom</v-icon>
</template>
<span>{{ $t("Dashboard.ClearPrintStats") }}</span>
</v-tooltip>
</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small>mdi-printer</v-icon>
</template>
<span>{{ $t("Dashboard.ReprintJob") }}</span>
</v-tooltip>
</v-btn>
</v-item-group>
</v-toolbar>
<v-row v-if="current_filename" class="mx-0">
<v-col class="col-auto py-3 pr-0">
<v-progress-circular
:rotate="-90"
:size="50"
:width="7"
:value="printPercent * 100"
color="red"
>
</v-progress-circular>
</v-col>
<v-col class="col py-3" style="width: 100px;">
<h3 class="font-weight-regular">{{ Math.round(printPercent * 100)+"%" }}{{ display_message ? " - "+display_message : "" }}</h3>
<span class="subtitle-2 text-truncate d-block px-0 text--disabled"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ current_filename }}</span>
</v-col>
</v-row>
<v-divider class="mt-0 mb-0" ></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-container v-if="current_filename ">
<v-row>
<v-col
class="col-12 col-sm-4 pl-sm-3 pt-0 pr-sm-0 pb-0"
v-if="
['printing', 'paused', 'complete'].includes(printer_state) &&
current_file &&
current_file.thumbnails &&
current_file.thumbnails.length &&
current_file.thumbnails.find(element => element.width === 400)
">
<img
class="statusPanel-image-preview"
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
/>
<v-col class="col-auto pr-0 py-2">
<v-progress-circular
:rotate="-90"
:size="50"
:width="7"
:value="Math.round(printPercent * 100)"
color="red"
>
</v-progress-circular>
</v-col>
<v-col
:class="
(['printing', 'paused', 'complete'].includes(printer_state) &&
current_file &&
current_file.thumbnails &&
current_file.thumbnails.length &&
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 py-0 col-sm-8 pl-sm-0' : 'col-12 py-0'
">
<v-row class="text-center pt-2" align="center">
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
<v-icon>mdi-axis-arrow</v-icon>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>X</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>Y</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0 pr-sm-6">
<v-row><v-col class="px-0 py-0"><strong>Z</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ position.length ? position[2].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
</v-row>
<v-divider class="my-2" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)"></v-divider>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)">
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
<v-icon>mdi-poll</v-icon>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ filament_used > 1000 ? (filament_used / 1000).toFixed(2)+"m" : filament_used.toFixed(2)+"mm" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>Print</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time) }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0 pr-sm-6">
<v-row><v-col class="px-0 py-0"><strong>Total</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time_total) }}</v-col></v-row>
</v-col>
</v-row>
<v-divider class="my-2" v-if="['printing', 'paused', 'error'].includes(printer_state)"></v-divider>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
<v-icon>mdi-clock-outline</v-icon>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>File</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ print_time > 0 && printPercent > 0 ? formatTime(print_time / printPercent - print_time) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0">
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ (filament_used > 0 && 'filament_total' in current_file && current_file.filament_total > filament_used) ? formatTime(print_time / (filament_used / current_file.filament_total) - print_time) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-0 pr-sm-6">
<v-row><v-col class="px-0 py-0"><strong>Slicer</strong></v-col></v-row>
<v-row><v-col class="px-0 py-0">{{ 'estimated_time' in current_file && current_file.estimated_time > print_time ? formatTime(current_file.estimated_time - print_time) : '--'}}</v-col></v-row>
</v-col>
</v-row>
<v-col class="col py-2" style="width: 100px;">
<h3 class="font-weight-regular">{{ Math.round(printPercent * 100)+"%" }}{{ printer_state !== "error" ? (display_message ? " - "+display_message : "") : print_stats_message }}</h3>
<span class="subtitle-2 text-truncate d-block px-0 text--disabled"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ current_filename }}</span>
</v-col>
</v-row>
</v-container>
<v-divider v-if="current_filename " class="mt-0 mb-0" ></v-divider>
<v-card-text class="px-0 py-0 content">
<v-container>
<v-row>
<v-col
class="col-12 col-sm-4 pl-sm-0 pt-0 pr-sm-0 pb-0"
v-if="
['printing', 'paused', 'complete'].includes(printer_state) &&
current_file &&
current_file.thumbnails &&
current_file.thumbnails.length &&
current_file.thumbnails.find(element => element.width === 400)
">
<img
class="statusPanel-image-preview"
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
/>
</v-col>
<v-col
:class="
(['printing', 'paused', 'complete'].includes(printer_state) &&
current_file &&
current_file.thumbnails &&
current_file.thumbnails.length &&
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 col-sm-8' : 'col-12'
">
<v-row class="text-center" align="center">
<v-col class="flex-grow-0 py-2">
<v-icon>mdi-axis-arrow</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>X</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>Y</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>Z</strong></v-col></v-row>
<v-row>
<v-col class="px-0 pt-1">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ position.length ? position[2].toFixed(2) : "--" }}</span>
</template>
<span v-if="gcode_position !== undefined && gcode_position.length >= 3">G-Code: {{ gcode_position[2].toFixed(2) }}mm</span>
</v-tooltip>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-2">
<v-icon>mdi-poll</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
<v-row>
<v-col class="px-0 pt-1">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on" v-if="filament_used >= 1000" class=" text-no-wrap">{{ (filament_used / 1000).toFixed(2) }} m</span>
<span v-bind="attrs" v-on="on" v-if="filament_used < 1000" class=" text-no-wrap">{{ filament_used.toFixed(2) }} mm</span>
</template>
<span v-if="'filament_total' in current_file">{{ (filament_used / 1000).toFixed(2) }} / {{ (current_file.filament_total / 1000).toFixed(2) }}m = {{ ( 100 / current_file.filament_total * filament_used).toFixed(0) }}% </span>
</v-tooltip>
</v-col>
</v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Print") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time) }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Total") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time_total) }}</v-col></v-row>
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) && 'filament_total' in current_file ">
<v-col class="flex-grow-0 py-2">
<v-icon>mdi-printer-3d</v-icon>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Speed") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ (requested_speed / 60).toFixed(0) }} mm/s</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Layer") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.ETA") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
</v-col>
</v-row>
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="px-0">
<v-divider></v-divider>
</v-col>
</v-row>
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
<v-col class="flex-grow-0 py-2">
<v-icon>mdi-clock-outline</v-icon>
</v-col>
<v-col class="equal-width py-2 ">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.File") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
</v-col>
<v-col class="equal-width py-2">
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Slicer") }}</strong></v-col></v-row>
<v-row><v-col class="px-0 pt-1">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
</v-col>
</v-row>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -142,6 +231,8 @@
...mapState({
toolhead: state => state.printer.toolhead,
position: state => state.printer.toolhead.position,
gcode_position: state => state.printer.gcode_move.gcode_position,
requested_speed: state => state.printer.gcode_move.speed,
printProgress: state => state.printer.virtual_sdcard.progress,
file_position: state => state.printer.virtual_sdcard.file_position,
@@ -152,6 +243,7 @@
filament_used: state => state.printer.print_stats.filament_used,
current_filename: state => state.printer.print_stats.filename,
printer_state: state => state.printer.print_stats.state,
print_stats_message: state => state.printer.print_stats.message,
display_message: state => state.printer.display_status.message,
loadings: state => state.socket.loadings,
@@ -160,6 +252,90 @@
get() {
return this.$store.getters["printer/getPrintPercent"];
}
},
max_layers: {
get() {
if (
'first_layer_height' in this.current_file &&
'layer_height' in this.current_file &&
'object_height' in this.current_file
) {
const max = Math.ceil((this.current_file.object_height - this.current_file.first_layer_height) / this.current_file.layer_height + 1)
return max > 0 ? max : 0
}
return 0
}
},
current_layer: {
get() {
if (
this.print_time > 0 &&
'first_layer_height' in this.current_file &&
'layer_height' in this.current_file &&
this.gcode_position !== undefined &&
this.gcode_position.length >= 3
) {
let current_layer = Math.ceil((this.gcode_position[2] - this.current_file.first_layer_height) / this.current_file.layer_height + 1)
current_layer = (current_layer <= this.max_layers) ? current_layer : this.max_layers
return current_layer > 0 ? current_layer : 0
}
return 0
}
},
estimated_time_file: {
get() {
if (this.print_time > 0 && this.printPercent > 0) {
return (this.print_time / this.printPercent - this.print_time).toFixed(0)
}
return 0
}
},
estimated_time_filament: {
get() {
if (this.filament_used > 0 && 'filament_total' in this.current_file && this.current_file.filament_total > this.filament_used) {
return (this.print_time / (this.filament_used / this.current_file.filament_total) - this.print_time).toFixed(0)
}
return 0
}
},
estimated_time_slicer: {
get() {
if ('estimated_time' in this.current_file && this.current_file.estimated_time > this.print_time) {
return (this.current_file.estimated_time - this.print_time).toFixed(0)
}
return 0
}
},
eta: {
get() {
let time = 0
let timeCount = 0
if (this.estimated_time_file > 0) {
time += parseInt(this.estimated_time_file)
timeCount++
}
if (this.estimated_time_filament > 0) {
time += parseInt(this.estimated_time_filament)
timeCount++
}
if (this.estimated_time_slicer > 0) {
time += parseInt(this.estimated_time_slicer)
timeCount++
}
if (time && timeCount) return Date.now() + (time / timeCount) * 1000
return 0
}
}
},
methods: {
@@ -191,6 +367,13 @@
return h+':'+m+':'+s;
},
formatDateTime(msec) {
const date = new Date(msec)
const h = date.getHours() >= 10 ? date.getHours() : "0"+date.getHours()
const m = date.getMinutes() >= 10 ? date.getMinutes() : "0"+date.getMinutes()
return h+":"+m
},
}
}
</script>
+325 -98
View File
@@ -6,88 +6,235 @@
.colHeaterIcons {
width: 68px;
}
.canvasjs-chart-tooltip>div {
border-radius: 10px !important;
}
</style>
<template>
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 py-2 content">
<v-row align="center">
<v-col class="py-0 font-weight-bold" style="padding-left: 68px;">Name</v-col>
<v-col class="py-0 text-center font-weight-bold d-none d-sm-block">State</v-col>
<v-col class="py-0 text-center font-weight-bold">Current</v-col>
<v-col class="text-center py-0 pr-8 font-weight-bold">Target</v-col>
</v-row>
<div v-for="(heater, index) in heaters" v-bind:key="index" >
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
</v-col>
<v-col class="py-0 font-weight-bold">{{ heater.name }}</v-col>
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
<v-col class="py-0 text-center">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</v-col>
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
</v-col>
</v-row>
</div>
<div v-for="(fan, index) in this['printer/getTemperatureFans']" v-bind:key="index+99" >
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
</v-col>
<v-col class="py-0 font-weight-bold">{{ fan.name }}</v-col>
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
<v-col class="py-0 text-center">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</v-col>
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" ></toolInput>
</v-col>
</v-row>
</div>
<div v-for="(sensor,index) in this['printer/getTemperatureSensors']" v-bind:key="index+999">
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
<v-icon color="grey darken-2" :title="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
</v-col>
<v-col class="py-0 font-weight-bold">{{ sensor.name }}</v-col>
<v-col class="py-0 d-none d-sm-block"><span>&nbsp;</span></v-col>
<v-col class="py-0 text-center">
<v-tooltip top>
<div>
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Dashboard.Temperatures") }}</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-item-group class="v-btn-toggle" name="controllers">
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].length">
<template v-slot:activator="{ on, attrs }">
<span
style="cursor: default;"
class=" px-0"
v-bind="attrs"
v-on="on"
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Dashboard.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
</template>
<span>min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
</v-tooltip>
</v-col>
<v-col class="text-center py-0 pr-8 vertical_align_center"><span>&nbsp;</span></v-col>
</v-row>
</div>
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
<v-row v-if="boolTempchart">
<v-col class="px-8">
<temp-chart ></temp-chart>
</v-col>
</v-row>
</v-card-text>
</v-card>
<v-list dense class="py-0">
<v-list-item v-for="preset of this['gui/getPreheatPresets']" v-bind:key="preset.index" link @click="preheat(preset)">
<v-list-item-icon class="mr-0">
<v-icon small>mdi-fire</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="preset.name"></v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
<v-divider></v-divider>
<v-list dense class="py-0">
<v-list-item link @click="cooldown()">
<v-list-item-icon class="mr-0">
<v-icon small>mdi-snowflake</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>{{ $t("Dashboard.Cooldown") }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Dashboard.Cooldown") }}</v-btn>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupTemperatures')">
<template v-slot:activator="{ on, attrs }">
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Dashboard.ShowChart')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Dashboard.AutoscaleChart')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
</v-toolbar>
<v-card-text class="px-0 py-2 content">
<v-container class="px-0">
<v-row align="center">
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Dashboard.Name") }}</v-col>
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Dashboard.State") }}</v-col>
<v-col class="py-2 text-center font-weight-bold">{{ $t("Dashboard.Current") }}</v-col>
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Dashboard.Target") }}</v-col>
</v-row>
<div v-for="(heater, index) in heaters" v-bind:key="index" >
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="pl-8 pr-0 flex-grow-0 py-2 colHeaterIcons">
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(heater)">{{ convertName(heater.name) }}</span></v-col>
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
<v-col class="py-2 text-center">
<span class="d-block">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</span>
<span v-for="(values, key) of heater.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
</v-col>
<v-col class="text-center py-2 pr-8 vertical_align_center">
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" :items="heater.presets" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
</v-col>
</v-row>
</div>
<div v-for="(fan, index) in temperatureFans" v-bind:key="index+99" >
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(fan)">{{ convertName(fan.name) }}</span></v-col>
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
<v-col class="py-2 text-center">
<span class="d-block">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span>
<span v-for="(values, key) of fan.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
</v-col>
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" :items="fan.presets" ></toolInput>
</v-col>
</v-row>
</div>
<div v-for="(sensor,index) in temperatureSensors" v-bind:key="index+999">
<v-divider class="my-2"></v-divider>
<v-row align="center">
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
<v-icon color="grey darken-2" :title="$t('Dashboard.Min')+sensor.min_temp+'° / ' + $t('Dashboard.Max')+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
</v-col>
<v-col class="py-2 font-weight-bold">
<span style="cursor: pointer;" @click="openHeater(sensor)">{{ convertName(sensor.name) }}</span>
</v-col>
<v-col class="py-2 d-none d-sm-block"><span>&nbsp;</span></v-col>
<v-col class="py-2 text-center">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span
style="cursor: default;"
class="d-block px-0"
v-bind="attrs"
v-on="on"
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
</template>
<span>{{ $t('Dashboard.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />{{ $t('Dashboard.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
</v-tooltip>
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
</v-col>
<v-col class="text-center py-2 pr-8 vertical_align_center"><span>&nbsp;</span></v-col>
</v-row>
</div>
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
<v-row v-if="boolTempchart">
<v-col class="px-8 pt-6">
<temp-chart ></temp-chart>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
<v-dialog v-model="editHeater.bool" persistent :width="400">
<v-card dark>
<v-toolbar flat dense color="primary">
<v-toolbar-title>
<span class="subheading">
<v-icon left>mdi-{{ 'icon' in editHeater.object ? editHeater.object.icon : "info" }}</v-icon>
{{ 'name' in editHeater.object ? convertName(editHeater.object.name) : "UNKNOWN" }}
</span>
</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn small class="minwidth-0" @click="editHeater.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
</v-toolbar>
<v-card-text class="pt-3">
<v-container class="px-0 py-0">
<v-row v-if="'chartTemperature' in editHeater.object && editHeater.object.chartTemperature">
<v-col class="col-12">
<v-checkbox
v-model="editHeater.boolTemperature"
:label="$t('Dashboard.ShowCurrentTemperatureInChart')"
hide-details
class="mt-0"
@change="setVisible('temperature')"
></v-checkbox>
</v-col>
</v-row>
<v-row v-if="'chartTarget' in editHeater.object && editHeater.object.chartTarget">
<v-col class="col-12">
<v-checkbox
v-model="editHeater.boolTarget"
:label="$t('Dashboard.ShowTargetTemperatureInChart')"
hide-details
class="mt-0"
@change="setVisible('target')"
></v-checkbox>
</v-col>
</v-row>
<v-row v-if="'chartPower' in editHeater.object && editHeater.object.chartPower">
<v-col class="col-12">
<v-checkbox
v-model="editHeater.boolPower"
:label="$t('Dashboard.ShowPWMPowerInChart')"
hide-details
class="mt-0"
@change="setVisible('power')"
></v-checkbox>
</v-col>
</v-row>
<v-row v-if="'chartSpeed' in editHeater.object && editHeater.object.chartSpeed">
<v-col class="col-12">
<v-checkbox
v-model="editHeater.boolSpeed"
:label="$t('Dashboard.ShowPWMPowerInChart')"
hide-details
class="mt-0"
@change="setVisible('speed')"
></v-checkbox>
</v-col>
</v-row>
<v-row v-for="key in Object.keys(editHeater.additionSensors)" v-bind:key="key">
<v-col class="col-12">
<v-checkbox
v-model="editHeater.additionSensors[key]"
:label="$t('Dashboard.Show')+key+$t('Dashboard.InList')"
hide-details
class="mt-0"
@change="setVisibleAdditionalSensor(key)"
></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col class="col-12 text-center">
<v-color-picker
hide-canvas
hide-mode-switch
mode="hexa"
v-model="editHeater.color"
@input="setChartColor"
class="mx-auto"
></v-color-picker>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapGetters, mapState } from 'vuex'
import { mapState, mapGetters } from 'vuex'
import toolInput from '../../inputs/ToolInput'
import TempChart from '@/components/charts/TempChart'
import {convertName} from "@/plugins/helpers"
export default {
components: {
@@ -96,52 +243,132 @@
},
data: function() {
return {
extruderTemps: [250,215,195,0],
editHeater: {
bool: false,
object: {},
boolTemperature: false,
boolTarget: false,
boolPower: false,
boolSpeed: false,
additionSensors: {},
color: "",
}
}
},
computed: {
...mapState({
datasets: state => state.printer.tempHistory.datasets,
boolTempchart: state => state.gui.dashboard.boolTempchart,
printer: state => state.printer,
cooldownGcode: state => state.gui.cooldownGcode,
printer_state: state => state.printer.print_stats.state,
}),
...mapGetters([
'printer/getTemperatureFans',
'printer/getTemperatureSensors',
'gui/getPreheatPresets'
]),
heaters: {
get () {
return this.$store.getters["printer/getHeaters"]
}
},
temperatureFans: {
get () {
return this.$store.getters["printer/getTemperatureFans"]
}
},
temperatureSensors: {
get () {
return this.$store.getters["printer/getTemperatureSensors"]
}
},
boolTempchart: {
get() {
return this.$store.state.gui.dashboard.boolTempchart
},
set: function(newVal) {
return this.$store.dispatch("gui/setSettings", { dashboard: { boolTempchart: newVal } })
}
},
autoscaleTempchart: {
get() {
return this.$store.state.gui.tempchart.autoscale
},
set: function(newVal) {
return this.$store.dispatch("gui/setSettings", { tempchart: { autoscale: newVal } })
}
}
},
created() {
},
methods: {
convertName: convertName,
cssBorderLeftColor(color) {
return {
"border-left-color": color
}
},
preheat(preset) {
for (const [name, attributes] of Object.entries(preset.values)) {
if (attributes.bool) {
let gcode = "SET_HEATER_TEMPERATURE HEATER="+name+" TARGET="+attributes.value
},
mounted () {
if (attributes.type === "temperature_fan") {
const fanName = name.replace("temperature_fan ", "")
gcode = "SET_TEMPERATURE_FAN_TARGET temperature_fan="+fanName+" TARGET="+attributes.value
}
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
}
if (preset.gcode !== "") {
setTimeout(() => {
this.$store.commit('server/addEvent', { message: preset.gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: preset.gcode })
}, 100)
}
},
cooldown() {
this.$store.commit('server/addEvent', { message: this.cooldownGcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: this.cooldownGcode })
},
openHeater(object) {
this.editHeater.object = object
this.editHeater.color = object.chartColor
this.editHeater.boolTemperature = 'chartTemperature' in object && object.chartTemperature !== undefined && 'visible' in object.chartTemperature ? object.chartTemperature.visible : false
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'visible' in object.chartTarget ? object.chartTarget.visible : false
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'visible' in object.chartPower ? object.chartPower.visible : false
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'visible' in object.chartSpeed ? object.chartSpeed.visible : false
let additionalSensors = {}
Object.keys(object.additionValues).forEach(sensor => {
additionalSensors[sensor] = object.additionValues[sensor]['gui']['boolList']
})
this.editHeater.additionSensors = Object.assign(additionalSensors)
this.editHeater.bool = true
},
setVisible(type) {
if ("name" in this.editHeater.object) {
this.$store.commit('printer/tempHistory/setVisible', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
}
},
setVisibleAdditionalSensor(sensor) {
if ("name" in this.editHeater.object) {
this.$store.dispatch('gui/setTempchartDatasetAdditionalSensorSetting', { name: this.editHeater.object.name, sensor: sensor, value: this.editHeater.additionSensors[sensor] })
}
},
setChartColor(value) {
if ("name" in this.editHeater.object) {
if (typeof value === "object" && 'hex' in value) value = value.hex
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.object.name, value: value })
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: 'color', value: value })
}
}
},
}
</script>
<style scoped>
.equal-width {
flex-basis: 0;
}
.category-header {
flex: 0 0 100px;
}
a:not(:hover) {
color: inherit;
}
.content span,
.content strong {
padding-left: 8px;
padding-right: 8px;
white-space: pre-wrap;
}
</style>
</script>
+27 -3
View File
@@ -8,11 +8,11 @@
<v-card>
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam')}}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="px-0 py-0 content">
<img :src="webcamConfig.url" class="webcamImage" :style="webcamStyle" />
<img :src="url" class="webcamImage" :style="webcamStyle" :alt="$t('Setting.Webcam')"/>
</v-card-text>
</v-card>
</template>
@@ -21,6 +21,15 @@
import { mapState } from 'vuex'
export default {
data: function() {
return {
refresh: Math.ceil(Math.random() * Math.pow(10, 12))
}
},
created: function () {
document.addEventListener("focus", () => this.handleRefreshChange(), false);
document.addEventListener("visibilitychange", this.handleRefreshChange, false);
},
components: {
},
@@ -28,8 +37,16 @@
...mapState({
'webcamConfig': state => state.gui.webcam
}),
url() {
let basicUrl = this.webcamConfig.url
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
const params = new URLSearchParams(basicUrl)
params.set('bypassCache', ""+this.refresh)
return decodeURIComponent(params.toString())
},
webcamStyle() {
var transforms = '';
let transforms = '';
if (this.webcamConfig.flipX) {
transforms += ' scaleX(-1)'
}
@@ -47,5 +64,12 @@
return '';
}
},
methods: {
handleRefreshChange() {
if (!document.hidden) {
this.refresh = Math.ceil(Math.random() * Math.pow(10, 12))
}
}
}
}
</script>
+25 -23
View File
@@ -6,28 +6,30 @@
<v-card v-if="(['printing', 'paused'].includes(printer_state))">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>Z Baby Stepping</span>
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>{{ $t("Dashboard.ZBabyStepping") }}</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-1">
<v-row class="">
<v-col class="col-12 pb-0 text-center">
<p>Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
</v-col>
</v-row>
<v-row>
<v-col class="col-12 pt-0 text-center d-flex flex-column align-center flex-sm-row justify-center">
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
</v-btn-toggle>
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-card-text class="px-0 py-0">
<v-container>
<v-row class="py-0">
<v-col class="col text-center">
<p class="mb-0">{{ $t("Dashboard.CurrentOffset") }} {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
</v-col>
</v-row>
<v-row>
<v-col class="col text-center d-flex flex-column align-center flex-sm-row justify-center">
<v-btn-toggle dense no-gutters class="mx-2 mt-3 mt-sm-0 order-last flex-nowrap order-sm-first" >
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
</v-btn-toggle>
<v-btn-toggle dense no-gutters class="mx-2 order-first flex-nowrap order-sm-last" >
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
</v-container>
</v-card-text>
</v-card>
</template>
@@ -57,25 +59,25 @@
sendBabySteppingDownFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingDownFine' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDownFine' });
},
sendBabySteppingDown() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingDown' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDown' });
},
sendBabySteppingUpFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingUpFine' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUpFine' });
},
sendBabySteppingUp() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('socket/addLoading', { name: 'babySteppingUp' });
this.$store.commit('server/addEvent', gcode);
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUp' });
},
}
+4 -2
View File
@@ -3,11 +3,12 @@ import Vue from 'vue'
import StatusPanel from './StatusPanel.vue'
import KlippyStatePanel from './KlippyStatePanel.vue'
import MinSettingsPanel from './MinSettingsPanel.vue'
import MoonrakerFailedPluginsPanel from './MoonrakerFailedPluginsPanel.vue'
import ToolsPanel from './ToolsPanel.vue'
import ControlPanel from "./ControlPanel";
import ExtruderPanel from "./ExtruderPanel";
import ZOffsetPanel from "./ZOffsetPanel";
import Peripherie from "./PeripheriePanel";
import Miscellaneous from "./MiscellaneousPanel";
import WebcamPanel from "./WebcamPanel";
import MiniconsolePanel from "./MiniconsolePanel";
import Settings from "./Settings/";
@@ -16,11 +17,12 @@ import PowerControlPanel from "./PowerControlPanel.vue";
Vue.component('status-panel', StatusPanel);
Vue.component('klippy-state-panel', KlippyStatePanel);
Vue.component('min-settings-panel', MinSettingsPanel);
Vue.component('moonraker-failed-plugins-panel', MoonrakerFailedPluginsPanel);
Vue.component('tools-panel', ToolsPanel);
Vue.component('control-panel', ControlPanel);
Vue.component('extruder-panel', ExtruderPanel);
Vue.component('zoffset-panel', ZOffsetPanel);
Vue.component('peripherie-panel', Peripherie);
Vue.component('miscellaneous-panel', Miscellaneous);
Vue.component('webcam-panel', WebcamPanel);
Vue.component('miniconsole-panel', MiniconsolePanel);
Vue.component('power-control-panel', PowerControlPanel);
-109
View File
@@ -1,109 +0,0 @@
<style>
._fan-slider-subheader {
height: auto;
}
</style>
<template>
<v-row>
<v-col :class="controllable ? 'pb-1 pt-3' : 'py-2'">
<v-subheader class="_fan-slider-subheader">
<span>{{ convertName }}</span>
<v-spacer></v-spacer>
<span class="font-weight-bold">{{ Math.round(value) }} %</span>
</v-subheader>
<v-card-text class="py-0" v-if="controllable">
<v-slider
v-model="value"
:min="0"
:max="100"
@change="sendCmd"
hide-details>
<template v-slot:prepend>
<v-icon @click="decrement">mdi-minus</v-icon>
</template>
<template v-slot:append>
<v-icon @click="increment">mdi-plus</v-icon>
</template>
</v-slider>
</v-card-text>
</v-col>
</v-row>
</template>
<script>
export default {
data: function() {
return {
value: this.target * this.multi,
}
},
props: {
target: {
type: Number,
required: true,
},
name: {
type: String,
required: true,
default: ''
},
type: {
type: String,
required: false,
default: ''
},
controllable: {
type: Boolean,
required: false,
default: false
},
multi: {
type: Number,
required: false,
default: 1
},
},
computed: {
convertName() {
let tmp = this.name;
tmp = tmp.replaceAll("_", " ");
tmp = tmp.charAt(0).toUpperCase() + tmp.slice(1);
return tmp;
}
},
methods: {
sendCmd() {
let gcode = "";
if (this.type === "fan") gcode = "M106 S"+(this.value * 2.55).toFixed(0);
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value/100);
if (gcode !== "") {
this.$store.commit('server/addEvent', gcode);
this.$socket.sendObj('printer.gcode.script', { script: gcode });
}
},
decrement() {
this.value = this.value > 0 ? (this.value - 1).toFixed(0) : 0;
this.sendCmd();
},
increment() {
this.value = this.value < 100 ? (this.value + 1).toFixed(0) : 100;
this.sendCmd();
}
},
watch: {
target: function(newVal) {
this.value = newVal * this.multi;
},
},
created: function() {
},
}
</script>
+120
View File
@@ -0,0 +1,120 @@
<style>
._fan-slider-subheader {
height: auto;
}
</style>
<template>
<v-container class="px-0 py-2">
<v-row>
<v-col>
<v-subheader class="_fan-slider-subheader">
<v-icon small :class="'mr-2 '+(value ? 'icon-rotate' : '')" v-if="type !== 'output_pin'">mdi-fan</v-icon>
<span>{{ convertName(this.name) }}</span>
<v-spacer></v-spacer>
<span class="font-weight-bold" v-if="!controllable || (controllable && pwm)">{{ Math.round(value*100) }} %</span>
<v-icon v-if="controllable && !pwm" @click="switchOutputPin">{{ value ? "mdi-toggle-switch" : "mdi-toggle-switch-off-outline" }}</v-icon>
</v-subheader>
<v-card-text class="py-0" v-if="controllable && pwm">
<v-slider
v-model="value"
:min="0"
:max="1"
:step="0.01"
@change="sendCmd"
hide-details>
<template v-slot:prepend>
<v-icon @click="decrement">mdi-minus</v-icon>
</template>
<template v-slot:append>
<v-icon @click="increment">mdi-plus</v-icon>
</template>
</v-slider>
</v-card-text>
</v-col>
</v-row>
</v-container>
</template>
<script>
import {convertName} from "@/plugins/helpers";
export default {
data: function() {
return {
value: this.target,
}
},
props: {
target: {
type: Number,
required: true,
},
name: {
type: String,
required: true,
default: ''
},
type: {
type: String,
required: false,
default: ''
},
controllable: {
type: Boolean,
required: false,
default: false
},
pwm: {
type: Boolean,
required: false,
default: false
},
multi: {
type: Number,
required: false,
default: 1
},
},
methods: {
convertName: convertName,
sendCmd() {
let gcode = "";
if (this.type === "fan") gcode = "M106 S"+(this.value * this.multi).toFixed(0)
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value*this.multi)
if (this.type === "output_pin") gcode = "SET_PIN PIN="+this.name+" VALUE="+(this.value*this.multi).toFixed(2)
if (gcode !== "") {
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
},
switchOutputPin() {
this.value = this.value ? 0 : 1
const gcode = "SET_PIN PIN="+this.name+" VALUE="+(this.value*this.multi).toFixed(2)
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
},
decrement() {
this.value = this.value > 0 ? (this.value - 0.01).toFixed(2) : 0;
this.sendCmd();
},
increment() {
this.value = this.value < 1 ? (this.value + 0.01).toFixed(2) : 100;
this.sendCmd();
}
},
watch: {
target: function(newVal) {
this.value = newVal;
},
},
created: function() {
},
}
</script>
+2 -4
View File
@@ -1,11 +1,9 @@
<style>
.settings_macro_switch .v-messages {
display: none;
}
</style>
<template>
<v-switch v-model="value" :label="name.toUpperCase()" @change="setValue" class="settings_macro_switch mt-0"></v-switch>
<v-switch v-model="value" :label="name.toUpperCase()" @change="setValue" hide-details class="mt-0"></v-switch>
</template>
+24 -3
View File
@@ -19,14 +19,27 @@
</style>
<template>
<v-text-field type="number" min="0" :max="max_temp" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps" onClick="this.select();">
</v-text-field>
<v-combobox
dense
hide-details
onClick="this.select();"
v-model="value"
:items="items"
item-text="value"
@change="setTemps"
></v-combobox>
</template>
<script>
import Vue from "vue";
/*
<v-text-field v-if="false" type="number" min="0" :max="max_temp" step="any" ref="toolField" class="tool-input">
</v-text-field>
*/
export default {
data: function() {
return {
@@ -40,19 +53,27 @@
max_temp: Number,
command: String,
attributeName: String,
items: Array,
},
computed: {
},
methods: {
setTemps() {
if (typeof this.value === 'object' && this.value !== null) this.value = this.value.value
if (parseFloat(this.value) === 0) this.value = 0
if (this.max_temp !== undefined && this.value > this.max_temp) {
this.value = this.target;
Vue.$toast.error("Temperature too high for "+this.name+"! (max: "+this.max_temp+")");
} else if (this.min_temp !== undefined && this.value < this.min_temp && parseFloat(this.value) !== 0) {
this.value = this.target;
Vue.$toast.error("Temperature too low for "+this.name+"! (min: "+this.min_temp+")");
} else this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value });
} else {
const gcode = this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
this.$socket.sendObj('printer.gcode.script', { script: gcode });
}
}
},
watch: {
+27 -25
View File
@@ -5,32 +5,34 @@
</style>
<template>
<v-row>
<v-col class="pb-1 pt-3">
<v-subheader class="_tool-slider-subheader">
<span>{{ label }}</span>
<v-spacer></v-spacer>
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
</v-subheader>
<v-card-text class="py-0">
<v-slider
v-model="value"
:min="min"
:max="max"
@change="sendCmd"
hide-details>
<v-container class="px-0 py-2">
<v-row>
<v-col class="pb-1 pt-3">
<v-subheader class="_tool-slider-subheader">
<span>{{ label }}</span>
<v-spacer></v-spacer>
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
</v-subheader>
<v-card-text class="py-0">
<v-slider
v-model="value"
:min="min"
:max="max"
@change="sendCmd"
hide-details>
<template v-slot:prepend>
<v-icon @click="decrement">mdi-minus</v-icon>
</template>
<template v-slot:prepend>
<v-icon @click="decrement">mdi-minus</v-icon>
</template>
<template v-slot:append>
<v-icon @click="increment">mdi-plus</v-icon>
</template>
</v-slider>
</v-card-text>
</v-col>
</v-row>
<template v-slot:append>
<v-icon @click="increment">mdi-plus</v-icon>
</template>
</v-slider>
</v-card-text>
</v-col>
</v-row>
</v-container>
</template>
@@ -96,7 +98,7 @@
methods: {
sendCmd() {
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
this.$store.commit('server/addEvent', gcode)
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
},
decrement() {
+237
View File
@@ -0,0 +1,237 @@
{
"App": {
"SAVECONFIG": "SAVE CONFIG",
"UploadPrint": "Upload & Print",
"EmergencyStop": "Emergency Stop",
"Uploading": "Uploading",
"Connecting": "Connecting",
"To": "to",
"Failed": "failed",
"CannotNotConnectTo": "Cannot not connect to",
"TryAgain": "try again",
"ConnectionTo": "Connection to",
"ConnectionFailed": "Connection failed",
"SelectPrinter": "Select Printer",
"AddPrinter": "Add Printer",
"EditPrinter": "Edit Printer",
"UpdatePrinter": "Update Printer",
"ChangePrinter": "Change Printer",
"Hello": "Hello and welcome to the remote mode of Mainsail!",
"PleaseRememberToAdd": "Please remember to add",
"InMoonrakerConf": "in moonraker.conf within 'cors_domains'.",
"YouCanFindMore": "You can find more details at",
"Remotemode": "docs.mainsail.xyz/remotemode",
"Empty": "Empty",
"Close": "Close",
"KlipperControl": "Klipper Control",
"Restart": "Restart",
"FirmwareRestart": "Firmware Restart",
"RestartServices": "Restart Services",
"Klipper": "Klipper",
"Moonraker": "Moonraker",
"PowerDevices": "Power Devices",
"HostControl": "Host Control",
"Reboot": "Reboot",
"Shutdown": "Shutdown"
},
"Router" : {
"Dashboard": "Dashboard",
"Printers": "Printers",
"Settings": "Settings",
"Webcam": "Webcam",
"Console": "Console",
"Heightmap": "Heightmap",
"G-Code Files": "G-Code Files",
"Machine": "Machine",
"Interface": "Interface"
},
"Dashboard": {
"MissingConfiguration": "Missing configuration",
"IsNotDefinedInConfig": "is not defined in config.",
"MoreInformation": "more information",
"MoonrakerFailedPlugins": "Moonraker Failed Plugins",
"MoonrakerErrorInfo": "An error was detected while loading the moonraker plugins. Please check the logfile and fix the issue.",
"FollowingPluginHasAnError": "Following plugin has an error:",
"DownloadLog": "Download Log",
"PausePrint": "Pause print",
"CancelPrint": "Cancel print",
"ResumePrint": "Resume print",
"ClearPrintStats": "Clear print stats",
"ReprintJob": "Reprint job",
"Filament": "Filament",
"Print": "Print",
"Total": "Total",
"Speed": "Speed",
"Layer": "Layer",
"ETA": "ETA",
"File": "File",
"Slicer": "Slicer",
"ZBabyStepping": "Z Baby Stepping",
"CurrentOffset": "Current Offset: ",
"Home": "Home",
"All": "All",
"QGL": "QGL",
"ZTilt": "Z Tilt",
"FeedAmountIn": "Feed amount in",
"FeedrateIn": "Feedrate in",
"Retract": "Retract",
"Extrude": "Extrude",
"PrintSettings": "Print Settings",
"Miscellaneous": "Miscellaneous",
"Temperatures": "Temperatures",
"Presets": "Presets",
"Cooldown": "Cooldown",
"Name": "Name",
"State": "State",
"Current": "Current",
"Target": "Target",
"Min": "min: ",
"Max": "max: ",
"ShowCurrentTemperatureInChart": "Show current temperature in chart",
"ShowTargetTemperatureInChart": "Show target temperature in chart",
"ShowPWMPowerInChart": "Show PWM-power in chart",
"Show": "Show",
"InList": "in list",
"SetupTemperatures": "Setup Temperatures",
"ShowChart": "Show Chart",
"AutoscaleChart": "Autoscale Chart",
"Console": "Console",
"SendCode": "Send code...",
"Send": "Send",
"Empty": "Empty",
"Setup Console": "Setup Console",
"Hide temperatures": "Hide temperatures",
"Custom filters": "Custom filters",
"Unknown": "Unknown"
},
"Files": {
"GCodeFiles": "G-Code Files",
"UploadNewGcode": "Upload new Gcode",
"CreateNewDirectory": "Create new Directory",
"RefreshCurrentDirectory":"Refresh current Directory",
"SetupCurrentList":"Setup current list",
"HiddenFiles":"Hidden files",
"FreeDisk":"Free disk: ",
"Used":"Used: ",
"Free":"Free: ",
"Total":"Total: ",
"Files": "Files",
"Search":"Search",
"Empty": "Empty",
"blabla": "bla bla",
"DropFilesToAddGcode": "Drop files to add gcode.",
"PrintStart": "Print start",
"Preheat": "Preheat",
"Download": "Download",
"Rename": "Rename",
"Delete": "Delete",
"StartJob": "Start Job",
"DoYouWantToStart": "Do you want to start",
"No": "No",
"Yes": "Yes",
"NewDirectory": "New Directory",
"PleaseEnterANewDirectoryName": "Please enter a new directory name:",
"RenameFile": "Rename File",
"Name": "Name",
"Cancel": "Cancel",
"Create": "Create",
"RenameDirectory": "Rename Directory",
"Uploading": "Uploading",
"CurrentPath": "Current path",
"Filesize": "Filesize",
"LastModified": "Last modified",
"ObjectHeight": "Object Height",
"LayerHeight": "Layer Height",
"FilamentUsage": "Filament Usage",
"PrintTime": "Print Time",
"Slicer": "Slicer"
},
"Console": {
"send": "send",
"SetupConsole": "Setup Console",
"SendCode": "Send code...",
"Empty": "Empty",
"HideTemperatures": "Hide temperatures",
"CustomFilters": "Custom filters",
"Date": "Date",
"Event": "Event"
},
"Setting": {
"Language": "Language",
"General": "General",
"PrinterName": "Printer Name",
"ControlExtruder": "Control & Extruder",
"PreheatPresets": "Preheat Presets",
"Webcam": "Webcam",
"Tempchart": "Tempchart",
"Macros": "Macros",
"Dashboard": "Dashboard",
"Console": "Console",
"RemotePrinters": "Remote Printers",
"ConfigFiles": "Config Files",
"SetupCurrentList": "Setup current list",
"HiddenFiles": "Hidden files",
"CurrentPath: ": "Current path: ",
"Empty": "Empty",
"EditFile": "Edit file",
"Download": "Download",
"Rename": "Rename",
"Delete": "Delete",
"PleaseStandBy": "Please stand by",
"ConfigReference": "Config Reference",
"Save": "Save",
"SaveRestart": "Save & restart",
"RenameFile": "Rename File",
"Name": "Name",
"Cancel": "Cancel",
"Create": "Create",
"Edit": "Edit",
"CreateFile": "Create File",
"CreateFolder": "Create Folder",
"Uploading": "Uploading",
"Files": "Files",
"Filesize": "Filesize",
"LastModified": "Last modified",
"MachineLimits": "Machine Limits",
"Velocity": "Velocity",
"Acceleration": "Acceleration",
"Deceleration": "Deceleration",
"SquareCornerVelocity": "Square corner velocity",
"KlippyState": "Klippy-State: ",
"KlippyInfo": "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.",
"Restart": "Restart",
"FIRMWARERestart": "FIRMWARE Restart",
"UpdateManager": "Update Manager",
"CheckForUpdates": "Check for updates",
"System": "System",
"PackagesCanBeUpgraded": "packages can be upgraded",
"OSPackages": "OS-Packages",
"Endstops": "Endstops",
"Endstop": "Endstop",
"EndstopInfo": "Press the sync-button on the right-bottom to load the current endstop status.",
"Logfiles": "Logfiles",
"WebcamURL": "Webcam URL",
"Rotate": "Rotate",
"FlipWebcamHorizontally": "Flip webcam horizontally",
"FlipWebcamVertically": "Flip webcam vertically",
"ShowInNavigation": "Show in navigation",
"HideTemperatures": "Hide temperatures",
"CustomFilter": "Custom filter",
"Rules": "Rules",
"FeedrateXY": "Feedrate XY",
"FeedrateZ": "Feedrate Z",
"Cooldown": "Cooldown",
"AddPreset": "add preset",
"Preset": "Preset",
"CustomGCode": "Custom G-Code",
"PresetInfo": "You have to set minimum a target temperature or a custom gcode.",
"Store": "Store",
"Update": "Update",
"EditCooldown": "Edit Cooldown",
"UpdateCooldown": "Update Cooldown",
"AddPrinter": "Add Printer",
"EditPrinter": "Edit Printer",
"UpdatePrinter": "Update Printer",
"detected": "detected"
}
}
+237
View File
@@ -0,0 +1,237 @@
{
"App": {
"SAVECONFIG": "保存配置",
"UploadPrint": "上传并打印",
"EmergencyStop": "紧急停止",
"Uploading": "上传",
"Connecting": "连接",
"To": "到",
"Failed": "失败",
"CannotNotConnectTo": "无法连接到",
"TryAgain": "重试",
"ConnectionTo": "连接到",
"ConnectionFailed": "连接失败",
"SelectPrinter": "选择打印机",
"AddPrinter": "添加打印机",
"EditPrinter": "编辑打印机",
"UpdatePrinter": "更新打印机",
"ChangePrinter": "更换打印机",
"Hello": "大家好,欢迎来到主帆遥控模式!",
"PleaseRememberToAdd": "请记得添加",
"InMoonrakerConf": "在 moonraker.conf 的 'cors_domains' 中.",
"YouCanFindMore": "详情请浏览",
"Remotemode": "docs.mainsail.xyz/remotemode",
"Empty": "空的",
"Close": "关闭",
"KlipperControl": "Klipper 控制",
"Restart": "重启",
"FirmwareRestart": "固件重启",
"RestartServices": "重启服务",
"Klipper": "Klipper",
"Moonraker": "Moonraker",
"PowerDevices": "电力设备",
"HostControl": "主机控制",
"Reboot": "重启",
"Shutdown": "关机"
},
"Router" : {
"Dashboard": "仪表盘",
"Printers": "打印机",
"Settings": "设置",
"Webcam": "摄像头",
"Console": "控制台",
"Heightmap": "Heightmap",
"G-Code Files": "G-Code 文件",
"Machine": "机器",
"Interface": "界面"
},
"Dashboard": {
"MissingConfiguration": "缺少配置",
"IsNotDefinedInConfig": "未在配置中定义.",
"MoreInformation": "更多信息",
"MoonrakerFailedPlugins": "Moonraker 失败的插件",
"MoonrakerErrorInfo": "加载moonraker插件时检测到一个错误. 请检查日志文件并修复这个问题.",
"FollowingPluginHasAnError": "以下插件有一个错误:",
"DownloadLog": "下载日志",
"PausePrint": "暂停打印",
"CancelPrint": "取消打印",
"ResumePrint": "继续打印",
"ClearPrintStats": "清除打印统计信息",
"ReprintJob": "重新打印工作",
"Filament": "Filam耗材ent",
"Print": "打印",
"Total": "总计",
"Speed": "速度",
"Layer": "层",
"ETA": "ETA",
"File": "文件",
"Slicer": "切片",
"ZBabyStepping": "Z Baby Stepping",
"CurrentOffset": "当前偏移量: ",
"Home": "Home",
"All": "All",
"QGL": "QGL",
"ZTilt": "Z 倾斜",
"FeedAmountIn": "进料量",
"FeedrateIn": "输入",
"Retract": "回抽",
"Extrude": "挤出",
"PrintSettings": "打印设置",
"Miscellaneous": "其他",
"Temperatures": "温度",
"Presets": "预设",
"Cooldown": "冷却",
"Name": "名称",
"State": "状态",
"Current": "当前",
"Target": "目标",
"Min": "最小: ",
"Max": "最大: ",
"ShowCurrentTemperatureInChart": "在图表中显示当前温度",
"ShowTargetTemperatureInChart": "在图表中显示目标温度",
"ShowPWMPowerInChart": "在图表中显示PWM功率",
"Show": "显示",
"InList": "在列表中",
"SetupTemperatures": "设置温度",
"ShowChart": "显示图表",
"AutoscaleChart": "自动缩放图表",
"Console": "控制台",
"SendCode": "发送代码...",
"Send": "发送",
"Empty": "空的",
"SetupConsole": "设置控制台",
"HideTemperatures": "隐藏温度",
"CustomFilters": "自定义筛选器",
"Unknown": "未知"
},
"Files": {
"GCodeFiles": "G-Code 文件",
"UploadNewGcode": "上传新 Gcode",
"CreateNewDirectory": "创建新目录",
"RefreshCurrentDirectory":"刷新当前目录",
"SetupCurrentList":"设置当前列表",
"HiddenFiles":"隐藏文件",
"FreeDisk":"可用磁盘: ",
"Used":"使用: ",
"Free":"空闲: ",
"Total":"总共: ",
"Files": "文件",
"Search":"搜索",
"Empty": "空的",
"blabla": "巴拉巴拉",
"DropFilesToAddGcode": "Drop files to add gcode.",
"PrintStart": "开始打印",
"Preheat": "预热",
"Download": "下载",
"Rename": "重命名",
"Delete": "删除",
"StartJob": "开始作业",
"DoYouWantToStart": "你想开始吗",
"No": "否",
"Yes": "是",
"NewDirectory": "新建目录",
"PleaseEnterANewDirectoryName": "请输入新的目录名称:",
"RenameFile": "重命名文件",
"Name": "名称",
"Cancel": "取消",
"Create": "创建",
"RenameDirectory": "重命名目录",
"Uploading": "上传",
"CurrentPath": "当前路径",
"Filesize": "文件大小",
"LastModified": "上次修改",
"ObjectHeight": "对象高度",
"LayerHeight": "层高",
"FilamentUsage": "耗材使用",
"PrintTime": "打印时间",
"Slicer": "切片"
},
"Console": {
"send": "发送",
"SetupConsole": "设置控制台",
"SendCode": "发送代码...",
"Empty": "空的",
"HideTemperatures": "隐藏温度",
"CustomFilters": "自定义筛选器",
"Date": "时间",
"Event": "事件"
},
"Setting": {
"Language": "语言",
"General": "一般",
"PrinterName": "打印机名称",
"ControlExtruder": "控制 & 挤出机",
"PreheatPresets": "预热预设",
"Webcam": "摄像头",
"Tempchart": "温度图",
"Macros": "宏",
"Dashboard": "仪表盘",
"Console": "控制台",
"RemotePrinters": "远程打印机",
"ConfigFiles": "配置文件",
"SetupCurrentList": "设置当前列表",
"HiddenFiles": "隐藏文件",
"CurrentPath": "当前路径: ",
"Empty": "空的",
"EditFile": "编辑文件",
"Download": "下载",
"Rename": "重命名",
"Delete": "删除",
"PleaseStandBy": "请等待",
"ConfigReference": "配置参考",
"Save": "保存",
"SaveRestart": "保存 & 重启",
"RenameFile": "重命名文件",
"Name": "名称",
"Cancel": "取消",
"Create": "创建",
"Edit": "编辑",
"CreateFile": "创建文件",
"CreateFolder": "创建文件夹",
"Uploading": "上传",
"Files": "文件",
"Filesize": "文件大小",
"LastModified": "上次修改",
"MachineLimits": "机器限制",
"Velocity": "速度",
"Acceleration": "加速",
"Deceleration": "减速",
"SquareCornerVelocity": "直角速度",
"KlippyState": "Klippy 状态: ",
"KlippyInfo": "Moonraker 不能连接到 Klippy! \n请检查Klipper服务是否正在运行, 并且是否配置了UDS (Unix域套接字). ",
"Restart": "重启",
"FIRMWARERestart": "固件重启",
"UpdateManager": "更新管理器",
"CheckForUpdates": "检查更新",
"System": "系统",
"PackagesCanBeUpgraded": "软件包可以升级",
"OSPackages": "OS包",
"Endstops": "限位开关",
"Endstop": "限位",
"EndstopInfo": "按右下角的同步按钮加载当前的限位状态。",
"Logfiles": "日志文件",
"WebcamURL": "摄像头链接",
"Rotate": "旋转",
"FlipWebcamHorizontally": "水平翻转摄像头 ",
"FlipWebcamVertically": "垂直翻转摄像头",
"ShowInNavigation": "在导航中显示 ",
"HideTemperatures": "隐藏温度",
"CustomFilter": "自定义筛选器",
"Rules": "规则",
"FeedrateXY": "XY 步进速度",
"FeedrateZ": "Z 步进速度",
"Cooldown": "冷却",
"AddPreset": "添加预设",
"Preset": "预设",
"CustomGCode": "自定义 G-Code",
"PresetInfo": "您必须设置最低目标温度或自定义gcode.",
"Store": "储存",
"Update": "更新",
"EditCooldown": "编辑冷却",
"UpdateCooldown": "更新冷却",
"AddPrinter": "添加打印机",
"EditPrinter": "编辑打印机",
"UpdatePrinter": "更新打印机",
"detected": "发现"
}
}
+10 -3
View File
@@ -2,12 +2,14 @@ import Vue from 'vue'
import WebSocketClient from './plugins/wsClient'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import i18n from './plugins/i18n'
import VueResource from 'vue-resource'
import './components'
import store from './store'
import router from './plugins/router'
import vueHeadful from 'vue-headful';
Vue.config.productionTip = false;
Vue.use(VueResource);
@@ -19,26 +21,29 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO
Vue.component('vue-headful', vueHeadful);
fetch('/config.json')
.then(res => res.json())
.then(file => {
store.commit('socket/setData', file);
const websocketProtocol = document.location.protocol === 'https:' ? 'wss://' : 'ws://';
const socketClient = new WebSocketClient(websocketProtocol + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
const socketClient = new WebSocketClient(store.state.socket.protocol + '://' + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
store: store,
reconnectEnabled: true,
reconnectInterval: store.state.socket.reconnectInterval,
});
socketClient.connect();
if (!store.state.socket.remoteMode) socketClient.connect()
Vue.prototype.$socket = socketClient;
new Vue({
vuetify,
router,
store,
i18n,
render: h => h(App)
}).$mount('#app')
})
.catch((error) => {
let p = document.createElement("p");
@@ -47,3 +52,5 @@ fetch('/config.json')
document.getElementById('app').append(p);
window.console.error('Error:', error);
});
+10 -11
View File
@@ -34,7 +34,7 @@
<v-text-field
v-model="gcode"
:items="items"
label="Send code..."
:label="$t('Console.SendCode')"
solo
class="gcode-command-field"
ref="gcodeCommandField"
@@ -48,21 +48,21 @@
<v-col class="col-auto align-content-center">
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
<v-icon class="mr-2">mdi-send</v-icon> send
<v-icon class="mr-2">mdi-send</v-icon> {{ $t('Console.send')}}
</v-btn>
</v-col>
<v-col class="col-auto align-content-center">
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Console.SetupConsole')">
<template v-slot:activator="{ on, attrs }">
<v-btn class="gcode-command-btn px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon>mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Console.HideTemperatures')"></v-checkbox>
</v-list-item>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Console.CustomFilters')"></v-checkbox>
</v-list-item>
</v-list>
</v-menu>
@@ -83,7 +83,7 @@
mobile-breakpoint="0"
>
<template #no-data>
<div class="text-center">empty</div>
<div class="text-center">{{ $t("Console.Empty")}}</div>
</template>
<template #item="{ item }">
@@ -116,13 +116,13 @@
sortBy: 'date',
headers: [
{
text: 'Date',
text: this.$t('Console.Date'),
value: 'date',
width: '15%',
dateType: 'Date',
},
{
text: 'Event',
text: this.$t('Console.Event'),
sortable: false,
value: 'message',
width: '85%'
@@ -171,7 +171,7 @@
methods: {
doSend() {
this.$store.commit('socket/addLoading', { name: 'sendGcode' });
this.$store.commit('server/addEvent', this.gcode);
this.$store.commit('server/addEvent', { message: this.gcode, type: 'command' });
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "socket/removeLoading", { name: 'sendGcode' });
this.lastCommands.push(this.gcode);
this.gcode = "";
@@ -185,7 +185,6 @@
let seconds = date.getSeconds();
if (seconds < 10) seconds = "0"+seconds.toString();
return hours+":"+minutes+":"+seconds;
},
colorConsoleMessage: colorConsoleMessage,
@@ -219,7 +218,7 @@
let output = "";
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
this.$store.commit('server/addEvent', output);
this.$store.commit('server/addEvent', { message: output, type: 'command' });
}
}
}
+5 -3
View File
@@ -2,13 +2,14 @@
<v-row>
<v-col class="col-sm-12 col-md-5">
<min-settings-panel v-if="klippy_state === 'ready' && existsPrinterConfig"></min-settings-panel>
<status-panel v-if="klippy_state === 'ready'"></status-panel>
<moonraker-failed-plugins-panel v-if="moonrakerFailedPlugins.length"></moonraker-failed-plugins-panel>
<klippy-state-panel v-if="socket_connected && klippy_state !== 'ready'"></klippy-state-panel>
<webcam-panel v-if="showDashboardWebcam" class="mt-6"></webcam-panel>
<status-panel v-if="klippy_state === 'ready'"></status-panel>
<webcam-panel class="mt-6" v-if="showDashboardWebcam"></webcam-panel>
<z-offset-panel class="mt-6" v-if="klippy_state === 'ready'"></z-offset-panel>
<control-panel class="mt-6" v-if="klippy_state === 'ready'"></control-panel>
<extruder-panel class="mt-6" v-if="klippy_state === 'ready'"></extruder-panel>
<peripherie-panel v-if="klippy_state === 'ready'"></peripherie-panel>
<miscellaneous-panel v-if="klippy_state === 'ready'"></miscellaneous-panel>
</v-col>
<v-col class="col-sm-12 col-md-7" v-if="klippy_connected">
<tools-panel v-if="socket_connected && klippy_connected"></tools-panel>
@@ -31,6 +32,7 @@
socket_connected: state => state.socket.isConnected,
klippy_connected: state => state.server.klippy_connected,
klippy_state: state => state.server.klippy_state,
moonrakerFailedPlugins: state => state.server.failed_plugins,
showDashboardWebcam: state => state.gui.dashboard.boolWebcam,
showDashboardConsole: state => state.gui.dashboard.boolConsole,
+37
View File
@@ -0,0 +1,37 @@
<style>
</style>
<template>
<v-row>
<v-col
v-for="(printer,key) in printers"
v-bind:key="key"
class="col-12 col-sm-6 col-md-4"
>
<farm-printer-panel v-bind:printer="printer"></farm-printer-panel>
</v-col>
</v-row>
</template>
<script>
import FarmPrinterPanel from "@/components/panels/FarmPrinterPanel";
export default {
components: { FarmPrinterPanel },
data () {
return {
}
},
computed: {
printers: {
get() {
return this.$store.getters["farm/getPrinters"]
}
}
},
methods: {
}
}
</script>
+151 -49
View File
@@ -51,20 +51,20 @@
<div>
<v-card class="fileupload-card my-3" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
<v-card-title>
G-Code Files
{{ $t("Files.GCodeFiles")}}
<v-spacer class="d-none d-sm-block"></v-spacer>
<input type="file" ref="fileUpload" accept=".gcode" style="display: none" multiple @change="uploadFile" />
<input type="file" ref="fileUpload" accept=".gcode, .ufp" style="display: none" multiple @change="uploadFile" />
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0" name="controllers">
<v-btn @click="clickUploadButton" title="Upload new Gcode" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
<v-btn @click="createDirectory" title="Create new Directory" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn @click="refreshFileList" title="Refresh current Directory" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup current list">
<v-btn @click="clickUploadButton" :title="$t('Files.UploadNewGcode')" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
<v-btn @click="createDirectory" :title="$t('Files.CreateNewDirectory')" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn @click="refreshFileList" :title="$t('Files.RefreshCurrentDirectory')" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Files.SetupCurrentList')">
<template v-slot:activator="{ on, attrs }">
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" label="Hidden files"></v-checkbox>
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Files.HiddenFiles')"></v-checkbox>
</v-list-item>
<v-divider></v-divider>
<v-list-item class="minHeight36" v-for="header of configHeaders" v-bind:key="header.key">
@@ -74,12 +74,26 @@
</v-menu>
</v-item-group>
</v-card-title>
<v-card-subtitle>Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}</v-card-subtitle>
<v-card-subtitle>
{{ $t("Files.CurrentPath") }} {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}<br />
<div v-if="this.disk_usage !== null">
<v-tooltip top>
<template v-slot:activator="{ on, attrs }">
<span v-bind="attrs" v-on="on">{{ $t('Files.FreeDisk') + formatFilesize(disk_usage.free) }}</span>
</template>
<span>
{{ $t('Files.Used') + formatFilesize(this.disk_usage.used) }}<br />
{{ $t('Files.Free') + formatFilesize(this.disk_usage.free) }}<br />
{{ $t('Files.Total') + formatFilesize(this.disk_usage.total) }}
</span>
</v-tooltip>
</div>
</v-card-subtitle>
<v-card-text>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="Search"
:label="$t('Files.Search')"
single-line
hide-details
></v-text-field>
@@ -94,7 +108,7 @@
:sort-desc.sync="sortDesc"
:items-per-page.sync="countPerPage"
:footer-props="{
itemsPerPageText: 'Files'
itemsPerPageText: $t('Files.Files')
}"
item-key="name"
:search="search"
@@ -107,7 +121,7 @@
</template>
<template #no-data>
<div class="text-center">empty</div>
<div class="text-center">{{ $t('Files.empty') }}</div>
</template>
<template slot="body.prepend" v-if="(currentPath !== 'gcodes')">
@@ -134,8 +148,14 @@
>
<td class="pr-0 text-center" style="width: 32px;">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory && !(item.thumbnails && item.thumbnails.length > 0)">mdi-file</v-icon>
<img v-if="!item.isDirectory && item.thumbnails && item.thumbnails.length > 0" :src="'data:image/gif;base64,'+(item.thumbnails.length ? item.thumbnails[0].data : '--')" />
<v-icon v-if="!item.isDirectory && !(existsSmallThumbnail(item))">mdi-file</v-icon>
<v-tooltip v-if="!item.isDirectory && existsSmallThumbnail(item) && existsBigThumbnail(item)" top>
<template v-slot:activator="{ on, attrs }">
<img :src="'data:image/gif;base64,'+getSmallThumbnail(item)" width="32" height="32" v-bind="attrs" v-on="on" />
</template>
<span><img :src="'data:image/gif;base64,'+getBigThumbnail(item)" width="250" /></span>
</v-tooltip>
<img v-if="!item.isDirectory && existsSmallThumbnail(item) && !existsBigThumbnail(item)" :src="'data:image/gif;base64,'+getSmallThumbnail(item)" width="32" height="32" />
</td>
<td class=" ">{{ item.filename }}</td>
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'size')[0].visible">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
@@ -147,87 +167,99 @@
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'slicer')[0].visible">{{ item.slicer ? item.slicer : '--' }}<br /><small v-if="item.slicer_version">{{ item.slicer_version}}</small></td>
</tr>
</template>
<v-data-footer>{{ $t('Files.blabla')}}</v-data-footer>
</v-data-table>
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
<div class="textnode">Drop files to add gcode.</div>
<div class="textnode">{{ $t('Files.DropFilesToAddGcode')}}</div>
</div>
</v-card>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-play</v-icon> Print start
<v-icon class="mr-1">mdi-play</v-icon> {{ $t("Files.PrintStart")}}
</v-list-item>
<v-list-item
@click="preheat"
v-if="
'first_layer_extr_temp' in contextMenu.item &&
contextMenu.item.first_layer_extr_temp > 0 &&
'first_layer_bed_temp' in contextMenu.item &&
contextMenu.item.first_layer_bed_temp > 0
"
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
>
<v-icon class="mr-1">mdi-fire</v-icon> {{ $t('Files.Preheat')}}
</v-list-item>
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Filse.Download')}}
</v-list-item>
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
</v-list-item>
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
</v-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
</v-list-item>
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
</v-list-item>
</v-list>
</v-menu>
<v-dialog v-model="dialogPrintFile.show" max-width="400">
<v-dialog v-model="dialogPrintFile.show" :max-width="getThumbnailWidth(dialogPrintFile.item)">
<v-card>
<v-img
contain
v-if="dialogPrintFile.item.thumbnails && dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400)"
:src="'data:image/gif;base64,'+(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400).data : '')"
:height="(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 400 || element.width === 300).height : '')+'px'"
v-if="existsBigThumbnail(dialogPrintFile.item)"
:src="'data:image/gif;base64,'+getBigThumbnail(dialogPrintFile.item)"
></v-img>
<v-card-title class="headline">Start Job</v-card-title>
<v-card-text>Do you want to start {{ dialogPrintFile.item.filename }}?</v-card-text>
<v-card-title class="headline">{{ $t('Files.StartJob') }}</v-card-title>
<v-card-text>{{ $t('Files.DoYouWantToStart') + dialogPrintFile.item.filename }}?</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">No</v-btn>
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">Yes</v-btn>
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">{{ $t('Files.No')}}</v-btn>
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">{{$t('Files.Yes')}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
<v-card>
<v-card-title class="headline">New Directory</v-card-title>
<v-card-title class="headline">{{ $t('Files.NewDirectory') }}</v-card-title>
<v-card-text>
Please enter a new directory name:
{{ $t('Files.PleaseEnterANewDirectoryName') }}
<v-text-field label="Name" :rules="input_rules" @keypress.enter="createDirectoryAction" required v-model="dialogCreateDirectory.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateDirectory.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="createDirectoryAction">create</v-btn>
<v-btn color="" text @click="dialogCreateDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
<v-btn color="primary" text @click="createDirectoryAction">{{ $t('Files.Create') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogRenameFile.show" max-width="400">
<v-card>
<v-card-title class="headline">Rename File</v-card-title>
<v-card-title class="headline">{{ $t('Files.RenameFile')}}</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></v-text-field>
<v-text-field :label="$t('Files.Name')" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameFile.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="renameFileAction">rename</v-btn>
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Files.Cancel') }}</v-btn>
<v-btn color="primary" text @click="renameFileAction">{{ $t('Files.Rename') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
<v-card>
<v-card-title class="headline">Rename Directory</v-card-title>
<v-card-title class="headline">{{ $t('Files.RenameDirectory') }}</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogRenameDirectory.newName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameDirectory.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="renameDirectoryAction">rename</v-btn>
<v-btn color="" text @click="dialogRenameDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Files.Rename') }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@@ -240,7 +272,7 @@
dark
v-model="uploadSnackbar.status"
>
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>Uploading {{ uploadSnackbar.filename }}</strong><br />
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t("Files.Uploading") + uploadSnackbar.filename }}</strong><br />
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
<template v-slot:action="{ attrs }">
@@ -290,14 +322,14 @@
},
headers: [
{ text: '', value: '', align: 'left', configable: false, visible: true, filterable: false },
{ text: 'Name', value: 'filename', align: 'left', configable: false, visible: true },
{ text: 'Filesize', value: 'size', align: 'right', configable: true, visible: true },
{ text: 'Last modified', value: 'modified', align: 'right', configable: true, visible: true },
{ text: 'Object Height', value: 'object_height', align: 'right', configable: true, visible: true },
{ text: 'Layer Height', value: 'layer_height', align: 'right', configable: true, visible: true },
{ text: 'Filament Usage', value: 'filament_total', align: 'right', configable: true, visible: true },
{ text: 'Print Time', value: 'estimated_time', align: 'right', configable: true, visible: true },
{ text: 'Slicer', value: 'slicer', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.Name'), value: 'filename', align: 'left', configable: false, visible: true },
{ text: this.$t('Files.Filesize'), value: 'size', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.LastModified'), value: 'modified', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.ObjectHeight'), value: 'object_height', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.LayerHeight'), value: 'layer_height', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.FilamentUsage'), value: 'filament_total', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.PrintTime'), value: 'estimated_time', align: 'right', configable: true, visible: true },
{ text: this.$t('Files.Slicer'), value: 'slicer', align: 'right', configable: true, visible: true },
],
options: {
@@ -345,6 +377,7 @@
hostname: state => state.socket.hostname,
port: state => state.socket.port,
loadings: state => state.socket.loadings,
printer_state: state => state.printer.print_stats.state,
displayMetadata: state => state.gui.gcodefiles.showMetadata,
}),
@@ -381,6 +414,11 @@
return this.$store.dispatch("gui/setSettings", { gcodefiles: { hideMetadataColums: newVal } })
}
},
disk_usage: {
get: function() {
return this.$store.getters["files/getDiskUsage"](this.currentPath)
}
}
},
created() {
this.loadPath()
@@ -514,6 +552,26 @@
this.contextMenu.item = item
this.$nextTick(() => { this.contextMenu.shown = true })
},
preheat() {
if (
'first_layer_extr_temp' in this.contextMenu.item &&
'first_layer_bed_temp' in this.contextMenu.item &&
!['error', 'printing', 'paused'].includes(this.printer_state)
) {
let gcode = ""
if (this.contextMenu.item.first_layer_extr_temp > 0) {
gcode = "M104 S"+this.contextMenu.item.first_layer_extr_temp
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
if (this.contextMenu.item.first_layer_bed_temp > 0) {
gcode = "M140 S"+this.contextMenu.item.first_layer_bed_temp
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: gcode })
}
}
},
downloadFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
let link = document.createElement("a");
@@ -613,7 +671,7 @@
this.dropzone.visibility = 'hidden';
this.dropzone.opacity = 0;
if (!this.is_printing && e.dataTransfer.files.length) {
if (e.dataTransfer.files.length) {
await this.doUploadFile(e.dataTransfer.files[0]);
}
}
@@ -720,6 +778,50 @@
this.$store.dispatch("gui/setGcodefilesMetadata", {name: name, value: value});
}
},
existsSmallThumbnail(item) {
return (
'thumbnails' in item &&
item.thumbnails !== undefined &&
item.thumbnails.findIndex(thumb => thumb.width >= 32 && thumb.width <= 64 && thumb.height >= 32 && thumb.height <= 64) !== -1
)
},
getSmallThumbnail(item) {
if (this.existsSmallThumbnail(item)) {
const thumbnail = item.thumbnails.find(thumb =>
thumb.width >= 32 && thumb.width <= 64 &&
thumb.height >= 32 && thumb.height <= 64
)
if (thumbnail) return thumbnail.data
}
return ""
},
existsBigThumbnail(item) {
return (
'thumbnails' in item &&
item.thumbnails !== undefined &&
item.thumbnails.findIndex(thumb => thumb.width >= 300 && thumb.width <= 400) !== -1
)
},
getBigThumbnail(item) {
if (this.existsBigThumbnail(item)) {
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
if (thumbnail) return thumbnail.data
}
return ""
},
getThumbnailWidth(item) {
if (this.existsBigThumbnail(item)) {
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
if (thumbnail) return thumbnail.width
}
return 400
}
},
watch: {
filetree: {
+35 -30
View File
@@ -26,12 +26,14 @@
class=" d-sm-none"
@click="openRenameProfile()">{{ this.bed_mesh && this.bed_mesh.profile_name ? this.bed_mesh.profile_name : "" }}</v-btn>
<v-item-group class="v-btn-toggle d-none d-sm-flex" name="controllers">
<v-btn small class="px-2 minwidth-0" color="primary" @click="homePrinter" :loading="loadings.includes('homeAll')" title="Home All"><v-icon small>mdi-home</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" @click="clearBedMesh" :loading="loadings.includes('bedMeshClear')" v-if="this.bed_mesh && this.bed_mesh.profile_name" title="Clear bed mesh">Clear</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" @click="calibrateDialog = true" :loading="loadings.includes('bedMeshCalibrate')" :disabled="is_printing" title="Calibrate new bed mesh">Calibrate</v-btn>
</v-item-group>
</v-toolbar>
<v-card-text class="d-sm-none text-center pb-0">
<v-item-group class="v-btn-toggle" name="controllers">
<v-btn small class="px-2 minwidth-0" color="primary" @click="homePrinter" :loading="loadings.includes('homeAll')" title="Home All"><v-icon small>mdi-home</v-icon></v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" @click="clearBedMesh" :loading="loadings.includes('bedMeshClear')" v-if="this.bed_mesh && this.bed_mesh.profile_name" title="Clear bed mesh">Clear</v-btn>
<v-btn small class="px-2 minwidth-0" color="primary" @click="calibrateDialog = true" :loading="loadings.includes('bedMeshCalibrate')" :disabled="is_printing" title="Calibrate new bed mesh">Calibrate</v-btn>
</v-item-group>
@@ -40,11 +42,13 @@
No bed_mesh has been loaded yet.
</v-card-text>
<v-card-text class="px-0 py-0 content" v-if="this.bed_mesh && this.bed_mesh.profile_name">
<v-row>
<v-col class="pb-0 pt-5">
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
</v-col>
</v-row>
<v-container class="px-0 py-0">
<v-row>
<v-col class="pb-0 pt-5">
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions v-if="this.bed_mesh && this.bed_mesh.profile_name" class="py-0">
<v-spacer></v-spacer>
@@ -62,26 +66,22 @@
<span class="subheading"><v-icon left>mdi-stack-overflow</v-icon>Profile</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-0">
<v-row>
<v-col class="px-0 py-1">
<v-simple-table>
<template v-slot:default>
<tbody>
<tr v-for="(profile, index) in profiles" :key="index" >
<td>{{ profile.name }}<small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
<td class="text-right">
<v-btn-toggle dense no-gutters>
<v-btn class="btnMinWidthAuto" @click="loadProfile(profile.name)" :loading="loadings.includes('bedMeshLoad_'+profile.name)" :disabled="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) || 'deleted' in profile.data" ><v-icon small>mdi-view-grid-plus</v-icon></v-btn>
<v-btn class="btnMinWidthAuto" @click="openRemoveProfile(profile.name)" :loading="loadings.includes('bedMeshRemove_'+profile.name)" :disabled="'deleted' in profile.data" ><v-icon small>mdi-delete</v-icon></v-btn>
</v-btn-toggle>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
</v-row>
<v-card-text class="py-0 px-0">
<v-simple-table>
<template v-slot:default>
<tbody>
<tr v-for="(profile, index) in profiles" :key="index" >
<td>{{ profile.name }}<small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
<td class="text-right">
<v-btn-toggle dense no-gutters>
<v-btn class="btnMinWidthAuto" @click="loadProfile(profile.name)" :loading="loadings.includes('bedMeshLoad_'+profile.name)" :disabled="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) || 'deleted' in profile.data" ><v-icon small>mdi-view-grid-plus</v-icon></v-btn>
<v-btn class="btnMinWidthAuto" @click="openRemoveProfile(profile.name)" :loading="loadings.includes('bedMeshRemove_'+profile.name)" :disabled="'deleted' in profile.data" ><v-icon small>mdi-delete</v-icon></v-btn>
</v-btn-toggle>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-card-text>
</v-card>
</v-col>
@@ -324,7 +324,7 @@
},
loadProfile: function(name) {
this.$store.commit('socket/addLoading', { name: 'bedMeshLoad_'+name })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE LOAD="+name)
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE LOAD="+name, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+name }, "socket/removeLoading", { name: 'bedMeshLoad_'+name })
},
openRenameProfile: function() {
@@ -334,7 +334,7 @@
renameProfile: function() {
this.renameDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshRename' })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase())
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase(), type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "socket/removeLoading", { name: 'bedMeshRename' })
},
openRemoveProfile: function(name) {
@@ -344,19 +344,24 @@
removeProfile: function() {
this.removeDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshRemove_'+this.newName })
this.$store.commit('server/addEvent', "BED_MESH_PROFILE REMOVE="+this.newName)
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE REMOVE="+this.newName, type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.newName }, "printer/removeBedMeshProfile", { name: this.newName })
this.removeDialogProfile = ""
},
homePrinter: function() {
this.$store.commit('socket/addLoading', { name: 'homeAll' })
this.$store.commit('server/addEvent', { message: "G28", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' })
},
clearBedMesh: function() {
this.$store.commit('socket/addLoading', { name: 'bedMeshClear' })
this.$store.commit('server/addEvent', "BED_MESH_CLEAR")
this.$store.commit('server/addEvent', { message: "BED_MESH_CLEAR", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "socket/removeLoading", { name: 'bedMeshClear' })
},
calibrateMesh: function() {
this.calibrateDialog = false;
this.$store.commit('socket/addLoading', { name: 'bedMeshCalibrate' });
this.$store.commit('server/addEvent', "BED_MESH_CALIBRATE")
this.$store.commit('server/addEvent', { message: "BED_MESH_CALIBRATE", type: 'command' })
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
}
},
+7 -3
View File
@@ -1,9 +1,13 @@
<template>
<div>
<router-view></router-view>
</div>
<v-container fluid class="px-0 py-0">
<v-row>
<v-col>
<router-view></router-view>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
+7 -3
View File
@@ -3,15 +3,19 @@
<v-row>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-general-panel></settings-general-panel>
<settings-language-panel class="mt-6"></settings-language-panel>
<settings-webcam-panel class="mt-6"></settings-webcam-panel>
</v-col>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-dashboard-panel></settings-dashboard-panel>
<settings-dashboard-panel class="mt-6"></settings-dashboard-panel>
<settings-console-panel class="mt-6"></settings-console-panel>
</v-col>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-macros-panel></settings-macros-panel>
</v-col>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-presets-panel></settings-presets-panel>
<settings-remote-printers-panel class="mt-6"></settings-remote-printers-panel>
<settings-control-panel class="mt-6"></settings-control-panel>
</v-col>
</v-row>
</div>
</template>
+7 -17
View File
@@ -1,35 +1,25 @@
<template>
<div>
<v-container fluid py-0 px-0>
<v-row>
<v-col class="col-12 col-sm-6">
<settings-config-files-panel></settings-config-files-panel>
</v-col>
<v-col class="col-12 col-sm-6">
<v-row v-if="klippy_state === 'ready'">
<v-col class="col-12 pt-0">
<settings-limits-panel></settings-limits-panel>
</v-col>
</v-row>
<v-row v-if="klippy_state !== 'ready'">
<v-col class="col-12 pt-0">
<klippy-state-panel></klippy-state-panel>
</v-col>
</v-row>
<v-row>
<settings-limits-panel v-if="klippy_state === 'ready'"></settings-limits-panel>
<klippy-state-panel v-if="klippy_state !== 'ready'"></klippy-state-panel>
<settings-update-panel v-if="updateManager" class="mt-6"></settings-update-panel>
<v-row class="mt-6">
<v-col class="col-md-6" v-if="klippy_state === 'ready'">
<settings-endstop-panel></settings-endstop-panel>
<settings-runout-panel></settings-runout-panel>
</v-col>
<v-col :class="(klippy_state !== 'ready' ? 'col-md-12' : 'col-md-6')">
<settings-update-panel v-if="updateManager"></settings-update-panel>
<settings-logfiles-panel :class="updateManager ? 'mt-6' : ''"></settings-logfiles-panel>
<settings-logfiles-panel></settings-logfiles-panel>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row>
</v-row>
</div>
</v-container>
</template>
<script>
import {mapState} from "vuex";
+12 -1
View File
@@ -24,7 +24,7 @@ export function caseInsensitiveNameSort(a, b) {
export function colorConsoleMessage(item) {
if (item.message.startsWith('!! ')) return "red--text"
if ('send' in item && item.send) return "blue--text"
if ('type' in item && item.type === 'command') return "blue--text"
return '';
}
@@ -36,4 +36,15 @@ export function formatConsoleMessage(message) {
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>')
return message;
}
export function convertName(name) {
let output = ""
name = name.replaceAll("_", " ")
name.split(" ").forEach(split => {
output += " "+split.charAt(0).toUpperCase() + split.slice(1)
})
output = output.slice(1)
return output;
}
+26
View File
@@ -0,0 +1,26 @@
import Vue from 'vue';
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
function loadLocaleMessages () {
const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
const messages = {}
locales.keys().forEach(key => {
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
if (matched && matched.length > 1) {
const locale = matched[1]
messages[locale] = locales(key)
}
})
return messages
}
let lang = localStorage.getItem("lang") || 'en'
localStorage.setItem("lang",lang);
export default new VueI18n({
locale: process.env.VUE_APP_I18N_LOCALE || lang,
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || lang,
messages: loadLocaleMessages()
})
+47 -27
View File
@@ -1,26 +1,32 @@
export default class WebSocketClient {
constructor (url, options) {
this.instance = null;
this.url = url;
this.reconnectInterval = options.reconnectInterval;
this.store = options.store;
this.wsData = [];
this.timerId = 0;
this.keepAliveTimeout = 1000;
this.instance = null
this.url = url
this.reconnects = 0
this.maxReconnects = options.maxReconnects || 10
this.reconnectInterval = options.reconnectInterval || 1000
this.store = options.store
this.wsData = []
this.timerId = 0
this.keepAliveTimeout = 1000
this.onOpen = null;
this.onMessage = null;
this.onClose = null;
this.onError = null;
this.onOpen = null
this.onMessage = null
this.onClose = null
this.onError = null
this.blacklistMessages = [
"Metadata not available for",
"Klippy Request Timed Out",
"Klippy Host not connected",
];
]
this.blacklistFunctions = [
"getPowerDevices",
];
]
}
setUrl(url) {
this.url = url
}
createMessage (method, params, id) {
@@ -42,26 +48,36 @@ export default class WebSocketClient {
}
connect () {
this.instance = new WebSocket(this.url);
this.store.dispatch("socket/setData", { isConnecting: true })
this.instance = new WebSocket(this.url)
this.instance.onopen = () => {
if (this.store) this.passToStore('socket/onOpen', event);
};
this.reconnects = 0
if (this.store) this.passToStore('socket/onOpen', event)
}
this.instance.onclose = (e) => {
this.passToStore('socket/onClose', e);
this.passToStore('socket/onClose', e)
setTimeout(() => {
this.connect();
}, this.reconnectInterval);
};
if (!e.wasClean && this.reconnects < this.maxReconnects) {
this.reconnects++
setTimeout(() => {
this.connect()
}, this.reconnectInterval)
} else {
this.store.dispatch("socket/setData", {
isConnecting: false,
connectingFailed: true
})
}
}
this.instance.onerror = () => {
this.instance.close();
};
this.instance.close()
}
this.instance.onmessage = (msg) => {
let data = JSON.parse(msg.data);
let data = JSON.parse(msg.data)
if (this.store) {
if (this.wsData.filter(item => item.id === data.id).length > 0 &&
this.wsData.filter(item => item.id === data.id)[0].action !== "") {
@@ -79,7 +95,7 @@ export default class WebSocketClient {
error: data.error,
requestParams: tmpWsData.params
})
);
)
}
} else {
let result = data.result
@@ -95,7 +111,11 @@ export default class WebSocketClient {
}
} else this.passToStore('socket/onMessage', data)
}
};
}
}
close() {
if (this.instance) this.instance.close()
}
sendObj (method, params, action = '', actionPreload = null) {
@@ -107,7 +127,7 @@ export default class WebSocketClient {
params: params,
actionPreload: actionPreload,
})
this.instance.send(this.createMessage(method, params, id));
this.instance.send(this.createMessage(method, params, id))
}
}
}
+8 -1
View File
@@ -1,5 +1,6 @@
import Dashboard from '../pages/Dashboard.vue'
import Webcam from '../pages/Webcam.vue'
import Farm from '../pages/Farm.vue'
import Console from '../pages/Console.vue'
import Heightmap from '../pages/Heightmap.vue'
import Files from '../pages/Files.vue'
@@ -11,10 +12,16 @@ const routes = [
{
title: "Dashboard",
path: '/',
icon: 'view-dashboard',
icon: 'monitor-dashboard',
component: Dashboard,
alwaysShow: true,
},
{
title: "Printers",
path: '/allPrinters',
component: Farm,
alwaysShow: false,
},
{
title: "Webcam",
path: '/cam',
+19
View File
@@ -1,3 +1,4 @@
//import Vue from 'vue'
import router from "../plugins/router";
@@ -6,4 +7,22 @@ export default {
switchToDashboard() {
router.push("/");
},
changePrinter({ dispatch, getters, state }, payload) {
const remoteMode = state.socket.remoteMode
dispatch('files/reset')
dispatch('gui/reset')
dispatch('printer/reset')
dispatch('server/reset')
dispatch('socket/reset')
const printerSocket = getters["farm/"+payload.printer+"/getSocketData"]
dispatch('socket/setSocket', {
hostname: printerSocket.hostname,
port: printerSocket.port,
remoteMode: remoteMode,
})
}
}
+97
View File
@@ -0,0 +1,97 @@
import printer from './printer'
export default {
namespaced: true,
state: () => {
},
getters: {
countPrinters: state => {
return Object.keys(state).length
},
getPrinters: state => {
return state
},
getPrinterName: (getters) => (namespace) => {
return getters[namespace+"/getPrinterName"]
}
},
actions: {
readStoredPrinters({ rootState, commit }) {
if (rootState.socket.remoteMode) {
if (localStorage.getItem('printers')) {
try {
const printers = JSON.parse(localStorage.getItem('printers')) || []
printers.forEach((printer) => {
commit('addPrinter',{
hostname: printer.hostname,
port: printer.port,
protocol: rootState.socket.protocol
})
})
} catch(e) {
localStorage.removeItem('printers')
}
}
} else {
rootState.gui.remotePrinters.forEach((printer) => {
commit('addPrinter',{
hostname: printer.hostname,
port: printer.port,
webPort: printer.webPort,
protocol: rootState.socket.protocol
})
})
}
},
savePrinters({ rootState, state, dispatch }) {
const printers = []
if (rootState.socket.remoteMode) {
for (const key in state) {
printers.push({
hostname: state[key].socket.hostname,
port: state[key].socket.port,
})
}
localStorage.setItem('printers', JSON.stringify(printers))
} else {
for (const key in state) {
printers.push({
hostname: state[key].socket.hostname,
port: state[key].socket.port,
webPort: state[key].socket.webPort,
})
}
dispatch("gui/setSettings", { remotePrinters: printers }, { root: true })
}
}
},
mutations: {
addPrinter(state, payload) {
if ('hostname' in payload && payload.hostname !== "") {
const pritnerExist = Object.entries(state).findIndex((printer) =>
printer.length > 0 &&
'socket' in printer[1] &&
'hostname' in printer[1].socket && printer[1].socket.hostname === payload.hostname &&
'port' in printer[1].socket && printer[1].socket.port === payload.port
)
const nextPrinterName = 'printer'+Object.entries(state).length
if (pritnerExist === -1 && !this.hasModule(['farm', nextPrinterName])) {
this.registerModule(['farm', nextPrinterName], printer)
this.commit('farm/'+nextPrinterName+'/setSocketData', {...payload, _namespace: nextPrinterName })
this.dispatch('farm/'+nextPrinterName+'/connect', {}, { root: true })
}
}
},
removePrinter(state, payload) {
if (payload.name in state) {
if (state[payload.name].socket.instance) state[payload.name].socket.instance.close()
this.unregisterModule(['farm', payload.name])
}
}
}
}
+175
View File
@@ -0,0 +1,175 @@
export default {
reset({commit}) {
commit('reset')
},
connect({ state, commit, dispatch, getters }) {
commit("setSocketData", { isConnecting: true })
const socket = new WebSocket(getters.getSocketUrl)
socket.onopen = () => {
commit("setSocketData", {
instance: socket,
reconnects: 0,
isConnecting: false,
isConnected: true
})
dispatch("initPrinter")
}
socket.onclose = (e) => {
if (!e.wasClean && state.socket.reconnects < state.socket.maxReconnects) {
commit("setSocketData", { reconnects: state.socket.reconnects + 1 })
setTimeout(() => {
dispatch("connect")
}, state.socket.reconnectInterval)
} else {
commit("setSocketData", {
isConnecting: false,
isConnected: false,
reconnects: 0
})
}
}
socket.onerror = () => {
}
socket.onmessage = (msg) => {
let data = JSON.parse(msg.data)
if (data && data.method) {
switch (data.method) {
case "notify_status_update":
commit("setData", data.params[0])
break
case "notify_filelist_changed":
commit("notifyFilelistChanged", data.params[0])
break
case "notify_klippy_disconnected":
dispatch("disconnectKlippy")
break
case "notify_klippy_ready":
dispatch("initPrinter")
break
}
} else if ("result" in data) {
if (
state.socket.wsData.filter(item => item.id === data.id).length > 0 &&
state.socket.wsData.filter(item => item.id === data.id)[0].action !== undefined &&
state.socket.wsData.filter(item => item.id === data.id)[0].action !== ""
) {
let result = data.result
if (result === "ok") result = { result: result }
if (typeof(result) === "string") result = { result: result }
let preload = {}
let wsData = state.socket.wsData.filter(item => item.id === data.id)[0]
if (wsData.actionPreload) Object.assign(preload, wsData.actionPreload)
Object.assign(preload, { requestParams: wsData.params })
Object.assign(preload, result)
dispatch(wsData.action, preload)
}
}
}
},
reconnect({ state, dispatch }) {
if(state.socket.instance) state.socket.instance.close()
dispatch("connect")
},
sendObj ({ state, commit }, payload) {
if (state.socket.instance && state.socket.instance.readyState === WebSocket.OPEN) {
const id = Math.floor(Math.random() * 10000) + 1
commit("addWsData", {
id: id,
action: payload.action,
params: payload.params || {},
actionPreload: payload.actionPreload || null,
})
state.socket.instance.send(JSON.stringify({
jsonrpc: '2.0',
method: payload.method,
params: payload.params || {},
id: id
}))
}
},
disconnectKlippy({ commit }) {
commit("setData", { print_stats: { state: "error" }})
},
initPrinter({ commit, dispatch }) {
commit("resetData")
dispatch("sendObj", {
method: "printer.objects.list",
action: "getObjectsList",
})
dispatch("sendObj", {
method: "server.files.list",
action: "getConfigDir",
params: { root: "config"}
})
},
getObjectsList({ dispatch }, payload) {
const allowed = [
'webhooks',
'print_stats',
'virtual_sdcard',
'display_status',
'heaters',
'heater_bed',
'heater_fan',
'fan',
'temperature_fan',
'temperature_sensor',
'idle_timeout',
'toolhead'
]
let subscripts = {}
payload.objects.forEach((object) => {
const splits = object.split(" ")
const objectName = splits[0]
if (
allowed.includes(objectName) ||
objectName.startsWith("extruder")
) {
subscripts = {...subscripts, [object]: null }
}
})
if (subscripts !== {})
dispatch("sendObj", {
method: 'printer.objects.subscribe',
params: { objects: subscripts },
action: "getData"
});
},
getData({ commit }, payload) {
commit("setData", payload)
},
getMetadataCurrentFile({ commit }, payload) {
commit("setCurrentFile", payload)
},
getConfigDir({ commit }, payload) {
commit("setConfigDir", payload)
},
}
+250
View File
@@ -0,0 +1,250 @@
import {themeDir} from "@/store/variables";
export default {
getSocketUrl: (state) => {
return state.socket.protocol+"://"+state.socket.hostname+":"+state.socket.port+"/websocket"
},
getSocketData: (state) => {
return state.socket
},
isCurrentPrinter: (state, getters, rootState) => {
return (
rootState.socket.hostname === state.socket.hostname &&
rootState.socket.port === state.socket.port
)
},
getPrinterName: (state) => {
if (
'gui' in state.data &&
'general' in state.data.gui &&
'printername' in state.data.gui.general &&
state.data.gui.general.printername !== ""
) return state.data.gui.general.printername
return parseInt(state.socket.port) !== 80 ? state.socket.hostname+':'+state.socket.port : state.socket.hostname
},
getStatus: (state, getters) => {
if (!state.socket.isConnected) {
return state.socket.isConnecting ? "Connecting..." : "Disconnected"
} else if (state.data.print_stats && state.data.print_stats.state) {
if (state.data.print_stats.state === "printing") {
const percent = getters["getPrintPercent"]
return Math.round(percent*100)+"% Printing"
}
return state.data.print_stats.state.charAt(0).toUpperCase() + state.data.print_stats.state.slice(1)
}
return "Unknown"
},
getCurrentFilename: (state) => {
if (
'print_stats' in state.data &&
'filename' in state.data.print_stats
) {
return state.data.print_stats.filename
}
return ""
},
getPrintPercent: (state) => {
if (
'filename' in state.current_file &&
'gcode_start_byte' in state.current_file &&
'gcode_end_byte' in state.current_file &&
state.current_file.filename === state.data.print_stats.filename
) {
if (state.data.virtual_sdcard.file_position <= state.current_file.gcode_start_byte) return 0
if (state.data.virtual_sdcard.file_position >= state.current_file.gcode_end_byte) return 1
let currentPosition = state.data.virtual_sdcard.file_position - state.current_file.gcode_start_byte
let maxPosition = state.current_file.gcode_end_byte - state.current_file.gcode_start_byte
if (currentPosition > 0 && maxPosition > 0) return 1 / maxPosition * currentPosition
}
return state.data.virtual_sdcard.progress
},
getImage: state => {
if (
'gui' in state.data &&
'webcam' in state.data.gui.webcam &&
'url' in state.data.gui.webcam &&
state.data.gui.webcam.url !== "" &&
'bool' in state.data.gui.webcam &&
state.data.gui.webcam.bool &&
'dashbaord' in state.data.gui &&
'boolWebcam' in state.data.gui.dashboard &&
state.data.gui.dashboard.boolWebcam
) {
return state.data.gui.webcam.url
} else if (
state.current_file &&
"thumbnails" in state.current_file &&
state.current_file.thumbnails.find((element) => element.width === 400 && element.height === 300)
) {
return 'data:image/gif;base64,'+state.current_file.thumbnails.find((element) => element.width === 400 && element.height === 300).data
} else return "/img/sidebar-background.png"
},
getLogo: state => {
let file = state.theme_files.find(element =>
element === themeDir+'/sidebar-logo.svg' ||
element === themeDir+'/sidebar-logo.jpg' ||
element === themeDir+'/sidebar-logo.png' ||
element === themeDir+'/sidebar-logo.gif'
)
if (file) return "//"+state.socket.hostname+":"+state.socket.port+'/server/files/config/'+file
return '/img/logo.svg'
},
getPosition: state => {
if (
'toolhead' in state.data &&
'position' in state.data.toolhead
) return state.data.toolhead.position
return []
},
getPrinterPreview: (state, getters) => {
const output = []
Object.keys(state.data).filter((key) => key.startsWith("extruder")).forEach((key) => {
if (
'temperature' in state.data[key] &&
'target' in state.data[key]
) {
output.push({
name: key,
value: state.data[key].temperature.toFixed(0)+"° / "+state.data[key].target.toFixed(0)+"°",
})
}
})
if (
'heater_bed' in state.data &&
'temperature' in state.data.heater_bed &&
'target' in state.data.heater_bed
) {
output.push({
name: 'heater_bed',
value: state.data.heater_bed.temperature.toFixed(0)+"° / "+state.data.heater_bed.target.toFixed(0)+"°"
})
}
if (
'temperature_fan chamber' in state.data &&
'temperature' in state.data['temperature_fan chamber'] &&
'target' in state.data['temperature_fan chamber']
) {
output.push({
name: 'chamber',
value: state.data['temperature_fan chamber'].temperature.toFixed(0)+"° / "+state.data['temperature_fan chamber'].target.toFixed(0)+"°"
})
}
if ('temperature_sensor chamber' in state.data) {
output.push({
name: 'chamber',
value: state.data['temperature_sensor chamber'].temperature.toFixed(0)+"°"
})
}
if (
'print_stats' in state.data &&
'state' in state.data.print_stats &&
state.data.print_stats.state === "printing" &&
getters["getPrintPercent"] > 0
) {
const eta = new Date(getters.estimated_time_eta)
const h = eta.getHours() >= 10 ? eta.getHours() : "0"+eta.getHours()
const m = eta.getMinutes() >= 10 ? eta.getMinutes() : "0"+eta.getMinutes()
output.push({
name: "ETA",
value: h+":"+m,
file: getters.estimated_time_file,
filament: getters.estimated_time_filament,
slicer: getters.estimated_time_slicer,
eta: getters.estimated_time_eta,
})
}
return output
},
estimated_time_file: (state, getters) => {
if (
'print_stats' in state.data &&
'print_duration' in state.data.print_stats &&
state.data.print_stats.print_duration > 0 && getters.getPrintPercent > 0) {
return (state.data.print_stats.print_duration / getters.getPrintPercent - state.data.print_stats.print_duration).toFixed(0)
}
return 0
},
estimated_time_filament: (state) => {
if (
'print_stats' in state.data &&
'print_duration' in state.data.print_stats &&
'filament_used' in state.data.print_stats &&
'filament_total' in state.current_file &&
state.data.print_stats.filament_used > 0 &&
state.current_file.filament_total > state.data.print_stats.filament_used) {
return (state.data.print_stats.print_duration / (state.data.print_stats.filament_used / state.current_file.filament_total) - state.data.print_stats.print_duration).toFixed(0)
}
return 0
},
estimated_time_slicer: (state) => {
if (
'print_stats' in state.data &&
'print_duration' in state.data.print_stats &&
'estimated_time' in state.current_file &&
state.current_file.estimated_time > state.data.print_stats.print_duration) {
return (state.current_file.estimated_time - state.data.print_stats.print_duration).toFixed(0)
}
return 0
},
estimated_time_eta: (state, getters) => {
let time = 0
let timeCount = 0
if (getters.estimated_time_file > 0) {
time += parseInt(getters.estimated_time_file)
timeCount++
}
if (getters.estimated_time_filament > 0) {
time += parseInt(getters.estimated_time_filament)
timeCount++
}
if (getters.estimated_time_slicer > 0) {
time += parseInt(getters.estimated_time_slicer)
timeCount++
}
if (time && timeCount) return Date.now() + (time / timeCount) * 1000
return 0
},
}
+40
View File
@@ -0,0 +1,40 @@
import actions from './actions'
import mutations from './mutations'
import getters from './getters'
export function getDefaultState() {
return {
_namespace: "",
socket: {
instance: null,
hostname: "",
port: 7125,
webPort: 80,
protocol: 'ws',
isConnected: false,
isConnecting: false,
reconnects: 0,
maxReconnects: 2,
reconnectInterval: 1000,
wsData: [],
},
data: {
},
current_file: {},
theme_files: []
}
}
// initial state
const state = () => {
return getDefaultState()
}
export default {
namespaced: true,
state,
getters,
actions,
mutations
}
+88
View File
@@ -0,0 +1,88 @@
import Vue from 'vue'
import { getDefaultState } from './index'
export default {
reset(state) {
Object.assign(state, getDefaultState())
},
resetData(state) {
Object.assign(state.data, getDefaultState().data)
},
setSocketData (state, payload) {
if ("status" in payload) payload = payload.status;
if ("requestParams" in payload) delete payload.requestParams
if ("_namespace" in payload) {
Vue.set(state, "_namespace", payload._namespace)
delete payload._namespace
}
Object.entries(payload).forEach(([key, value]) => {
Vue.set(state.socket, key, value)
})
},
setData(state, payload) {
if ("status" in payload) payload = payload.status
if ("requestParams" in payload) delete payload.requestParams
Object.entries(payload).forEach(([key, value]) => {
if (key === "print_stats" && 'filename' in value) {
this.dispatch("farm/"+state._namespace+"/sendObj", {
method: "server.files.metadata",
params: {filename: value.filename},
action: "getMetadataCurrentFile"
});
}
if (typeof (value) === "object") {
Vue.set(state.data, key, {
...state.data[key],
...value
})
} else Vue.set(state.data, key, value)
})
},
addWsData(state, payload) {
state.socket.wsData.push(payload)
},
setCurrentFile(state, payload) {
if ("requestParams" in payload) delete payload.requestParams
Vue.set(state, 'current_file', payload)
},
setConfigDir(state, payload) {
for (const [, file] of Object.entries(payload)) {
if ("filename" in file) {
if (file.filename.startsWith(".theme/")) {
state.theme_files.push(file.filename)
} else if (file.filename === ".mainsail.json") {
fetch('//'+state.socket.hostname+':'+state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit("farm/"+state._namespace+"/setMainsailJson", file)
})
}
}
}
},
setMainsailJson(state, payload) {
Vue.set(state.data, 'gui', payload.state)
},
notifyFilelistChanged( state, payload) {
if (
payload.action === "upload_file" &&
payload.item.root === "config" &&
payload.item.path === ".mainsail.json"
) {
fetch('//'+state.socket.hostname+':'+state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit("farm/"+state._namespace+"/setMainsailJson", file)
})
}
}
}
+9
View File
@@ -7,6 +7,15 @@ export default {
getDirectory({ commit }, payload) {
commit('setDirectory', payload)
if (
'requestParams' in payload &&
'path' in payload.requestParams &&
'disk_usage' in payload
) commit('setDiskUsage', {
disk_usage: payload.disk_usage,
path: payload.requestParams.path
})
},
getMetadata({ commit, rootState }, payload) {
+15 -2
View File
@@ -48,11 +48,11 @@ export default {
let favicon16 = configDir.find(element => element.filename !== undefined && element.filename === 'favicon-16x16.png')
if (favicon16) favicon16 = rootGetters["socket/getUrl"]+'/server/files/config/'+themeDir+'/'+favicon16.filename
let favicon16Default = '/img/favicon-16x16.png'
let favicon16Default = '/img/icons/favicon-16x16.png'
let favicon32 = configDir.find(element => element.filename !== undefined && element.filename === 'favicon-32x32.png')
if (favicon32) favicon32 = rootGetters["socket/getUrl"]+'/server/files/config/'+themeDir+'/'+favicon32.filename
let favicon32Default = '/img/favicon-32x32.png'
let favicon32Default = '/img/icons/favicon-32x32.png'
if (favicon16 && favicon32) return [favicon16, favicon32]
else if (favicon16) return [favicon16, favicon16]
@@ -60,4 +60,17 @@ export default {
return [favicon16Default, favicon32Default]
},
getDiskUsage: (state) => (path) => {
if (path.indexOf('/') !== -1) path = path.substr(0, path.indexOf('/'))
const dir = state.filetree.find(dir => dir.filename === path)
if (dir && 'disk_usage' in dir) return dir.disk_usage
return {
free: 0,
total: 0,
used: 0,
}
}
}
+13 -3
View File
@@ -9,19 +9,29 @@ export function getDefaultState() {
isDirectory: true,
filename: 'gcodes',
modified: new Date(),
childrens: []
childrens: [],
disk_usage: {}
},
{
isDirectory: true,
filename: 'config_examples',
modified: new Date(),
childrens: []
childrens: [],
disk_usage: {}
},
{
isDirectory: true,
filename: 'config',
modified: new Date(),
childrens: []
childrens: [],
disk_usage: {}
},
{
isDirectory: true,
filename: 'docs',
modified: new Date(),
childrens: [],
disk_usage: {}
}
],
}
+26 -23
View File
@@ -1,8 +1,6 @@
import Vue from 'vue'
import { getDefaultState } from './index'
import { findDirectory } from "@/plugins/helpers"
import store from "@/store";
import axios from "axios";
export default {
reset(state) {
@@ -22,7 +20,7 @@ export default {
for (const [key, item] of Object.entries(parent)) {
if (
item.isDirectory &&
payload.dirs !== undefined &&
'dirs' in payload &&
payload.dirs.length > 0 &&
payload.dirs.findIndex(element => element.dirname === item.filename) < 0
) parent.splice(key, 1)
@@ -47,7 +45,21 @@ export default {
if (payload.files && payload.files.length) {
for (let file of payload.files) {
if (!parent.find(element => (element.isDirectory === false && element.filename === file.filename))) {
const existingFile = parent.find(element => (element.isDirectory === false && element.filename === file.filename))
if (
existingFile && (
existingFile.size !== file.size ||
existingFile.modified.getTime() !== new Date(file.modified*1000).getTime()
)
) {
Vue.set(existingFile, 'modified', new Date(file.modified*1000))
Vue.set(existingFile, 'size', file.size)
if (existingFile.metadataPulled) {
Vue.prototype.$socket.sendObj("server.files.metadata", { filename: payload.requestParams.path+'/'+file.filename }, "files/getMetadata")
}
} else if (!existingFile) {
parent.push({
isDirectory: false,
filename: file.filename,
@@ -56,23 +68,6 @@ export default {
metadataPulled: false,
})
}
if (file.filename === ".mainsail.json" && payload.requestParams.path === "config") {
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit('gui/setData', file, { root: true })
})
}
if (file.filename === "gui.json" && payload.requestParams.path === "config") {
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/gui.json?time='+Date.now())
.then(res => res.json()).then(file => {
this.commit('gui/setData', file, { root: true })
this.dispatch('gui/upload', {}, { root: true })
axios.delete('//'+ store.state.socket.hostname+':'+store.state.socket.port +'/server/files/config/gui.json');
})
}
}
}
},
@@ -117,7 +112,7 @@ export default {
let parent = findDirectory(state.filetree, (payload.item.root+"/"+path).split("/"));
if (parent) {
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) < 0) {
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) === -1) {
let modified = new Date(payload.item.modified * 1000);
parent.push({
@@ -127,7 +122,7 @@ export default {
size: payload.item.size,
metadataPulled: false,
});
}
} else Vue.prototype.$socket.sendObj("server.files.metadata", { filename: payload.item.path }, "files/getMetadata")
}
},
@@ -181,4 +176,12 @@ export default {
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setDiskUsage(state, payload) {
let path = payload.path
if (path.indexOf('/') !== -1) path = path.substr(0, path.indexOf('/'))
const dir = state.filetree.find(dir => dir.filename === path)
if (dir && 'disk_usage' in dir) Vue.set(dir, "disk_usage", payload.disk_usage)
}
}
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff. Show more