Compare commits

..
215 Commits
Author SHA1 Message Date
Stefan Dej f94402b94b update version number, installation.md, update.md to 0.2.6
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-27 23:06:48 +01:00
Stefan Dej 91f2e9b6d8 feature: modify dashboard console for more message space
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-27 23:05:42 +01:00
Stefan Dej 0f955fbeb4 bugfix: machine-limits expander
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-27 22:44:11 +01:00
Randell L Hodges 6282356ddd clear fileupload after uploading 2020-10-27 19:50:27 +01:00
Randell L Hodges 9057bea653 Modified times now come as unix times 2020-10-27 19:45:21 +01:00
Stefan Dej d19bf2ee05 Update update.md and installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-25 00:21:46 +02:00
Stefan Dej f35cf70301 feature: rework the StatusPanel.vue
feature: add Sys Commands to the topbar

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-24 23:14:34 +02:00
meteyou 27308e44ab Merge pull request #108 from randellhodges/handle-gcode-response
handle gcode_store data format changes from moonraker
2020-10-24 16:10:56 +02:00
Randell L Hodges 0a5b664ded removed backwards handling of gcode_store 2020-10-24 09:07:40 -05:00
Randell L Hodges ece599595b handle gcode_store data format changes from moonraker 2020-10-24 08:52:41 -05:00
Stefan Dej c8f847ccc8 bugfix: generic heater in tool panel dont work
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-18 15:48:24 +02:00
Stefan Dej ca1fd5d04e update update.md for MainsailOS
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-17 13:38:20 +02:00
Stefan Dej 470a7633c5 bugfix: fix typo for gpio power devices
update update.md to 0.2.4

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-16 22:58:37 +02:00
Stefan Dej 01da938a79 update update.md to v0.2.3
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-15 21:25:12 +02:00
Stefan Dej b27390133a feature: read version from package.json
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-15 21:09:49 +02:00
Stefan Dej 231ef16da1 bugfix: save_config_pending rename
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-13 22:41:34 +02:00
Stefan Dej 906e738151 bugfix: dynamic favicon error of pwa
feature: display klippy_disconnected status
feature: load gcode_store on startup

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-13 22:38:48 +02:00
meteyou 4b6bcd7ad4 Merge pull request #101 from meteyou/add-license
Create LICENSE
2020-10-10 14:40:44 +02:00
meteyou 959869b64f Create LICENSE 2020-10-10 14:40:19 +02:00
Stefan Dej fe19bddb54 Merge remote-tracking branch 'origin/master' 2020-10-09 23:56:30 +02:00
Stefan Dej 59db2ca55b bugfix: remove old cancel print commands / default parameters
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-09 23:56:17 +02:00
meteyou 1691a2cbfe Merge pull request #94 from cadriel/master
refactor: docs move upstreams and common vars to independent conf
2020-10-05 21:29:22 +02:00
Craig Bassett 257b792aee refactor: docs move upstreams and common vars to independent conf 2020-10-05 10:05:16 -05:00
Stefan Dej 1457f86764 bugfix: remove comment in same line as a config
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-04 23:43:56 +02:00
Stefan Dej 3670d4cc63 bugfix: add heater_generic to tools (fix #87)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-04 23:42:15 +02:00
meteyou d397ccf804 Merge pull request #70 from cadriel/feature/static-app-bar
feature: ensures app bar doesn't scroll off page
2020-10-04 18:38:41 +02:00
Stefan Dej 1b3636864d bugfix: startscreen from PWA settings
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-04 18:36:49 +02:00
meteyou ce8608f7db Merge pull request #84 from translucentfocus/InitialPWASupport
Feature: Initial PWA Support (Service workers disabled)
2020-10-04 18:01:13 +02:00
Stefan Dej 0b276168b9 add description for gzip and pi zero
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-10-04 17:48:53 +02:00
meteyou ea5f61761b Merge pull request #83 from translucentfocus/patch-1
Enhancement: Add enabling Gzip for mainsail nginx config
2020-10-04 17:44:51 +02:00
meteyou 260be4ae24 Merge pull request #91 from th33xitus/work-docs
Update installation.md
2020-10-04 13:29:09 +02:00
th33xitus 0b14108a6a Update installation.md
Adding a note to make users aware that the IP in the example configuration must be replaced with a valid IP from their own local network.
2020-10-04 12:01:50 +02:00
translucentfocus 7442908405 Initial PWA Support & favicons moved to /img/icons
Inital Commit

Favicon file path fixes & use relative pathing
2020-09-27 22:22:18 -05:00
translucentfocus bb50aa690d Gzip config for mainsail 2020-09-27 21:17:58 -05:00
Stefan Dej facd18543e bugfix: install unzip on a non raspberry pi os image (fix #85)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-28 00:12:25 +02:00
Stefan Dej c3e3c6e567 bugfix: hide klipper version in footer on smarthphone
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-28 00:06:55 +02:00
Stefan Dej 0977cb39c6 feature: SAVE_CONFIG button, if klipper needs a "SAVE_CONFIG"
bugfix: temp chart bug after loosing connection (fix #82)
bugfix: clear mainsail store after klipper restart
bugfix: heater min/max temp input field

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-28 00:00:17 +02:00
Stefan Dej e2273ecfaf bugfix: hide power plugin error message
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-26 00:22:03 +02:00
Stefan Dej a011510098 bugfix: move gui.json from virtual_sdcard directory to config directory
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-25 22:26:51 +02:00
Stefan Dej 08a106d945 bugfix: extruder amounts and feedrates in a array
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-23 22:25:08 +02:00
Stefan Dej e6c19065b9 bugfix: navipoint webcam and nginx redirect use the same url (fix #81)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-23 21:14:11 +02:00
Stefan Dej c9e0278b26 Merge remote-tracking branch 'origin/master' 2020-09-21 00:04:42 +02:00
Stefan Dej 8220642774 bugfix: replace underline of macro name (only first underline replaced)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-20 23:48:56 +02:00
meteyou c48f8321d5 Update bug_report.md
fixed line breaks
2020-09-20 19:59:14 +02:00
meteyou 789c1d2a5b Update bug_report.md
wrap test
2020-09-20 19:53:45 +02:00
meteyou 294d21e47c Update bug_report.md
typo fix
2020-09-20 19:48:25 +02:00
meteyou d235c434f4 Merge pull request #72 from kageurufu/ssl-support
Support mainsail through an SSL proxy
2020-09-19 23:11:12 +02:00
meteyou ce8df80d1c Merge pull request #71 from yanfali/safe-default-helper
Small helper function for DRY code
2020-09-19 23:09:02 +02:00
Stefan Dej 0672caa6fd Merge remote-tracking branch 'origin/master' 2020-09-19 23:04:25 +02:00
Stefan Dej bc0d1ed6df update install doc with link zu macros and update macros.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-19 22:59:28 +02:00
meteyou 676fdaede5 Update issue templates 2020-09-19 21:00:36 +02:00
Stefan Dej 75d742acbe bugfix: hide temps in tempchart (fixed #61)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-19 14:39:15 +02:00
Franklyn c386375e53 Support mainsail through an SSL proxy
I like to run all my web services proxied through a single
 internet-accessible server, secured through SSL and authenticated
 against a single proxy server (nginx, in my case)

I found that mainsail hardcoded ws:// and many http:// addresses, so
 I've updated them to detect ws:// vs ws:///, and just use the protocol
 agnostic // prefix, which then sends the request over the same protocol
 the page is loaded under, either http or https.

Now i've got a nice SSL secured but publicly accessible URL for remote
 printer monitoring
2020-09-15 07:40:00 +01:00
meteyou 98f7ceebd7 Merge pull request #65 from yanfali/share-sorting-function
Share the sort function in getters between functions
2020-09-15 08:18:24 +02:00
Yan-Fa Li c14f9d8deb Small helper function for DRY code
Adds small helper function, to avoid repeating pattern.
2020-09-14 13:17:28 -07:00
Craig Bassett 8aef278a03 feature: ensures app bar doesn't scroll off page
Added benefit of the emergency stop button being always available.
2020-09-14 14:32:37 -05:00
Yan-Fa Li bd938a5d02 Share the sort function in getters between functions
- factor out sort into a named function and share it among common
   callers
 - add a suggested .editorconfig to avoid changing indents and line
   endings
 - add a suggested .pretterrc which honors original formatting as much
   as possible
2020-09-14 09:47:27 -07:00
Stefan Dej 76a93ccb45 feature: add slicer version in g-codes files
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-14 00:29:19 +02:00
meteyou 5a20f9dcad Merge pull request #69 from translucentfocus/master
Separated some words
2020-09-13 23:05:44 +02:00
translucentfocus 5fed21320f Add spacing 2020-09-13 14:18:25 -05:00
translucentfocus 8d620ba522 Add spacing 2020-09-13 14:17:28 -05:00
meteyou 9074d28d9f Merge pull request #38 from Birkemosen/PowerControl
Initial development of Power Control Panel
2020-09-12 23:24:41 +02:00
meteyou a60603e360 Merge pull request #67 from kageurufu/disable-autocomplete
Disable browser autocomplete in console
2020-09-12 23:23:11 +02:00
meteyou b216ead36d Merge pull request #64 from cadriel/feature/webcam_flip
feature: allows flipping the webcam horizontally and vertically
2020-09-12 22:33:16 +02:00
Franklyn 330e78828d Disable browser autocomplete in console
This stops chrome from breaking the cnonsole history feature
2020-09-12 18:36:56 +01:00
Craig Bassett b0b25839ca feature: allows flipping the webcam horizontally and vertically 2020-09-11 14:14:24 -05:00
Stefan Dej 5caaf20ee1 Merge remote-tracking branch 'origin/master' 2020-09-10 22:16:50 +02:00
Stefan Dej afb62ca393 credits upload
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-10 22:16:32 +02:00
meteyou c971e80074 Merge pull request #58 from kageurufu/fix-encoded-filenames
Use encodeURI instead of encodeURIComponent for paths+filename
2020-09-06 22:53:26 +02:00
Franklyn f53cd00cc1 Use encodeURI for paths
Moonraker expects file paths to use un-escaped file paths,
 such as gcodes/some%20file.gcode, but encodeURIComponent
 will always escape the slash. Using encodeURI here will not.
2020-09-06 20:36:24 +01:00
Birkemosen 59efbfa369 Update to latest moonraker api changes 2020-09-06 21:31:17 +02:00
Birkemosen b314e57bfc Update from upstream 2020-09-06 21:16:11 +02:00
Stefan Dej 458444f03a bugfix: delete files with % in filename (fix #55)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-06 00:31:04 +02:00
Stefan Dej 2c093913e8 bugfix: extrude buttons min_extrude_temp dynamic
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-04 23:49:15 +02:00
Stefan Dej c81c491577 update versionnumber
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-03 22:32:33 +02:00
Stefan Dej 5cbed10d44 feature: add "edit file" in context menu of configfiles
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-03 22:07:15 +02:00
Stefan Dej 958358d483 update docs for v0.2.2
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-03 21:40:42 +02:00
Stefan Dej ddc2ab477f Update websocket reqeusts for moonraker update from 03-09-2020
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-03 21:28:47 +02:00
Stefan Dej f351268745 bugfix: Files.vue context menu "print start" -> wrong action
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-03 21:03:24 +02:00
Stefan Dej 25a7e8a33b bugfix: check websocket before send requests
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-02 23:57:37 +02:00
Stefan Dej 8b8f3cf939 feature: switch to meta data notifiy
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-02 23:57:05 +02:00
meteyou 3440d486df Merge pull request #53 from th33xitus/patch-extrude_retract_gcode
bugfix: remove M120/M121 from extrude/retract command
2020-09-02 11:18:57 +02:00
th33xitus 693fcae49a bugfix: remove unnecessary M120/M121
Removes the unnecessary M120 and M121 g-codes when sending an extrude or retract command via the Extrude/Retract button via the Dashboard
2020-09-02 11:06:51 +02:00
Birkemosen c99d4bea7e Change hiding of PowerControlPanel to Dashboard.vue. Update power buttons state from moonraker response. 2020-09-02 10:08:03 +02:00
Stefan Dej ac01dce620 bugfix: fix gcode thumbnail on dashboard
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-02 00:10:34 +02:00
Stefan Dej d3c3113c43 bugfix: show status if no thumbnail exists
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-02 00:02:31 +02:00
Stefan Dej ae30257ee1 update docs to v0.2.1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 23:56:10 +02:00
Stefan Dej b5add6f919 bugfix: sticky toolbar in config editor
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 23:48:09 +02:00
Stefan Dej 90b3419552 increment version number
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 23:30:29 +02:00
Stefan Dej 0100eaad5d bugfix: configfile save button and scrollbar overlap
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 23:29:14 +02:00
Stefan Dej 825d65be9d bugfix: expand min/max in heightmap is lower -1 or higher 1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 23:05:29 +02:00
Stefan Dej 38a0c8f441 bugfix: settings panel system -> responsive view
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 22:50:09 +02:00
Stefan Dej ad6ae1128b feature: show gcode thumbnail in StatusPanel.vue while printing
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 22:45:12 +02:00
Stefan Dej 6094c4f9bd bugfix: show favicon if print process == 100%
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 22:44:23 +02:00
Stefan Dej 65a4e40d39 bugfix: SettingsSystemPanel remove margin top when klipper != ready
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 20:53:37 +02:00
Stefan Dej 39f3cfe824 bugfix: ZOffsetPanel.vue current offset
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 20:42:13 +02:00
Stefan Dej 84c9040e2a bugfix: print pause button reset loading status
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 20:22:47 +02:00
Stefan Dej 890a3e3332 bugfix: min_extrude_temp from config file (extrude/retract buttons on dashboard)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 20:19:53 +02:00
Stefan Dej 16b6ed6000 bugfix: min_extrude_temp from config file (extrude/retract buttons on dashboard)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 19:32:21 +02:00
Birkemosen 2efc961eeb Fix missing upstream update 2020-09-01 13:13:47 +02:00
Birkemosen 70c259bd22 Merge remote-tracking branch 'upstream/master' into PowerControl 2020-09-01 13:00:22 +02:00
Stefan Dej d6eb97ffe1 update guides to 0.2.0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-09-01 00:04:31 +02:00
Stefan Dej fb10211b52 typo heart.png
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 23:35:14 +02:00
Stefan Dej 753efc5104 bugfix: format error onload temperature sensor
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 23:34:37 +02:00
Stefan Dej 543af7032e insert version number
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 23:18:23 +02:00
Stefan Dej 0e21d865b7 bugfix: update heightmap to new klipper/moonraker version
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 22:06:43 +02:00
Stefan Dej 601dd07f85 bugfix: typo mooonraker to moonraker
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 19:21:25 +02:00
Stefan Dej f06ce3e430 bugfix: load metadata after fileupload
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 17:54:12 +02:00
Stefan Dej 1f5f1749fc bugfix: deactivate debug output
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-31 16:26:08 +02:00
Stefan Dej a40701d611 bugfix: macros interface settings -> list all macros
bugfix: margin between dashboard panels

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-30 23:36:38 +02:00
Stefan Dej c0472dfb30 Update all klipper/moonraker communication to Moonraker 'August 16 2020' Version. The Klippy state is more definied and should work better now. This work is not finished!
feature: display print complete with time and filament used + reprint button

bugfix: Fix issue #48. Tempchart need to many load
bugfix: Fix issue #46. Print time > 1 day (was a moonraker bug) + format time to "1d 1h" and not "25h"
bugfix: Fix issue #39. Mainsail title will show filename
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-30 14:58:26 +02:00
Birkemosen 3607a2f6f9 Remove autoformat from js files. 2020-08-17 12:45:24 +02:00
Birkemosen 03610868d1 Revert autoformatting 2020-08-17 12:26:58 +02:00
Stefan Dej f6873bda85 bugfix: toolSlider extend only by machine limits
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-16 21:51:02 +02:00
Stefan Dej bec378d2a0 Update installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 03:38:04 +02:00
Stefan Dej f2a5d1d8ee Update update-0.1.x.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 01:56:17 +02:00
Stefan Dej 1daf1b07aa Update installation.md -> STRG to CTRL. Thx DocGalaxyBlock
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 01:35:12 +02:00
Stefan Dej 9bdcec01ca Update Mainsail to the Moonraker 0.1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 01:23:09 +02:00
Stefan Dej 717408592d Merge remote-tracking branch 'origin/master' 2020-08-14 22:50:02 +02:00
Stefan Dej 00319167a4 update guides to outdated
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 22:49:44 +02:00
meteyou beb52f2290 Merge pull request #24 from meteyou/dependabot/npm_and_yarn/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4
2020-08-14 10:38:30 +02:00
meteyou 8d45767e14 Merge pull request #29 from meteyou/dependabot/npm_and_yarn/lodash-4.17.19
build(deps): bump lodash from 4.17.15 to 4.17.19
2020-08-14 10:38:17 +02:00
Stefan Dej ffa2ea9b08 bugfix: min_extrude_temp at ExtruderPanel.vue (fix #35)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 10:24:38 +02:00
Stefan Dej 41f855d9c4 upload update-0.1.x.md preview
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 10:04:49 +02:00
Stefan Dej f4a514cb67 bugfix: machine limits auto extend
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-12 22:33:20 +02:00
Stefan Dej 29d5b81b47 feature: add config editor
bugfix: new file named "e" after upload in root directory

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-08 18:26:27 +02:00
Stefan Dej c322edba72 bugfix: fix filament runout sensor -> on/off
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-05 00:06:49 +02:00
Stefan Dej 43d832cd33 bugfix: fix load metadata load after upload (delay to short for the moonraker)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 21:53:17 +02:00
Stefan Dej 981b2e854c update docs
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:28:59 +02:00
Stefan Dej 707330e501 bugfix: add timestamp to gui.json for caching problems
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:17:58 +02:00
Stefan Dej 7a75f6f6cc bugfix: remove "move=1" before all axis are homed
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:05:39 +02:00
Stefan Dej 331c0a1e99 add mjpgstreamer to nginx in installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-02 22:36:12 +02:00
Stefan Dej 0c70bd5f23 update installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 21:20:55 +02:00
Stefan Dej bce591e16e update installation.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 21:20:16 +02:00
Stefan Dej d0d36470ba update loadingQGL to generic function
report klippy state in browser console log

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:41:33 +02:00
Stefan Dej 479f2245e3 bugfix: disable heater with value 0
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:38:58 +02:00
Stefan Dej 706803ea5b update update-0.1.x.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 16:27:46 +02:00
Stefan Dej 1efe346cb0 add update-0.1.x.md
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 14:02:53 +02:00
Stefan Dej 20bad7d24c update installation.md and update-0.0.x.md to v0.1.1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 12:17:08 +02:00
Stefan Dej 8494a35adf bugfix: update notify_filelist_changed
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-01 01:07:37 +02:00
Stefan Dej 6766a266e8 feature: rename "Host restart" to "Host reboot"
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-07-31 17:05:42 +02:00
meteyou 75d6cce540 feature: add Z_TILT in ControlPanel.vue
feature: replace "_" in macro names in ControlPanel.vue

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-07-31 15:26:16 +02:00
Stefan Dej e0e3150466 bugfix: babystepping on dashboard 2020-07-28 23:28:38 +02:00
Stefan Dej fcaebc4413 add gcode-thumbnails.md 2020-07-28 23:28:11 +02:00
Stefan Dej 37f1ffb04b feature: fine babystepping (0.01 steps) 2020-07-27 23:39:38 +02:00
Stefan Dej 1b501bb810 bugfix: sensor colors in temp chart 2020-07-27 23:01:02 +02:00
Stefan Dej 7956304f64 fix installation.md and update-0.0.x.md link 2020-07-27 00:09:04 +02:00
Stefan Dej e98d6c0ba9 Update root README.md 2020-07-27 00:03:00 +02:00
Stefan Dej be7abdf254 feature: warning tool input if temp too high or too low 2020-07-26 23:42:02 +02:00
Stefan Dej 0e598f83a6 bugfix: count missing update ticks of temp sensor to compensate temp chart 2020-07-26 22:53:22 +02:00
Stefan Dej ded73fc6a8 bugfix: pause state of StatusPanel.vue; cleanup websocket notifies 2020-07-26 21:34:38 +02:00
Stefan Dej 458a6e8592 feature: update package.json 2020-07-21 00:13:01 +02:00
Stefan Dej 15a5e07dca bugfix: remove dir -> remove dir from state.filetree 2020-07-20 23:20:45 +02:00
Stefan Dej efa15131d8 initial upload of the new docs 2020-07-19 23:35:12 +02:00
dependabot[bot] e9fc463e4a build(deps): bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 19:27:38 +00:00
Stefan Dej 2636311cc1 feature: move files in filemanager
bugfix: update endstop status mutations
2020-07-18 19:38:23 +02:00
Stefan Dej 32daeedcf7 bugfix: reload endstop status by changing the current page
this closes #19
2020-07-18 19:32:12 +02:00
Stefan Dej 98a7292b7b feature: rename files & directories in g-code files
bugfix: message display on dashboard
2020-07-16 00:33:48 +02:00
Stefan Dej 86d9bac54d bugfix: update save config to moonraker .8 2020-07-14 23:37:09 +02:00
Stefan Dej bb0b7b58fa bugfix: heightmap control 2020-07-14 22:50:36 +02:00
Stefan Dej d18355507f bugfix: subscription of special extras 2020-07-14 12:49:51 +02:00
Stefan Dej 316763e92e bugfix: current_file -> update to moonraker 0.8 2020-07-14 03:36:43 +02:00
Stefan Dej 44a381c243 feature: file manager -> create/remove directores
feature: file manager -> show thumbnails (list + printstart)
2020-07-14 02:57:36 +02:00
Stefan Dej c71bc47ab8 feature: file manager -> show/browse directories
feature: file manager -> grab metadata per page
feature: file manager -> search in directory
2020-07-13 03:58:15 +02:00
Stefan Dej 143d9aad7e bugfix: bed_mesh profile loader
feature: load/save/remove bed_mesh_profile
feature: calibrate/clear bed_mesh
feature: change between probe_matrix and mesh_matrix in the visualizer
2020-07-12 03:00:57 +02:00
Stefan Dej f2466b3ad7 bugfix: virtual_sdcard.progress not loaded at startup 2020-07-11 23:30:27 +02:00
Stefan Dej 7f6a1bcabe bugfix: FW restart fixed
feature: Klippy State Panel
2020-07-07 20:51:20 +02:00
Stefan Dej fb242bc5d3 Update to Moonraker .08-alpha (emergency stop) 2020-07-05 23:43:35 +02:00
Stefan Dej accde2227b Update to Moonraker .08-alpha 2020-07-05 23:41:39 +02:00
Stefan Dej e25c10c757 bugfix: sort temp sensors for the tempchart 2020-06-30 23:04:52 +02:00
Stefan Dej 5795fe45d1 feature: show temperature_probe on dashboard 2020-06-30 00:46:43 +02:00
Stefan Dej 1e61749175 feature: babystepping, switch between idle interface & printing interface, first tests with PS thumbnails 2020-06-17 23:39:16 +02:00
dependabot[bot] 4937f02673 Bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-07 22:59:23 +00:00
Stefan Dej 4b13e4c6ce Merge remote-tracking branch 'origin/master' 2020-05-28 00:58:05 +02:00
Stefan Dej b4ee662a4f feature: if Filament used > 1000mm -> convert to m 2020-05-28 00:16:10 +02:00
meteyou 1fd2473e9e Merge pull request #21 from translucentfocus/MachineSettingsTypo
Machine Limits Typo
2020-05-26 14:14:45 +02:00
meteyou 8a203c1def Merge pull request #20 from translucentfocus/renaming
Renaming kwc to mainsail
2020-05-26 14:14:14 +02:00
translucentfocus 57f6d275a3 Machine Settings Typo
Renamed headline to Machine Settings
2020-05-25 14:01:52 -05:00
translucentfocus 78dfbfb131 Renaming kwc to mainsail
Note: package-lock.json still has kwc in the name. I didn't change due to it being build-related
2020-05-25 13:54:36 -05:00
meteyou da844fec63 Merge pull request #17 from translucentfocus/master
Bumped Update Header Text to current version
2020-05-24 10:34:18 +02:00
translucentfocus 35e8470430 Bumped Update Header Text to current version
Your terminal commands are for the latest update V0.0.12, but the header text still said V0.0.11 🙂

Btw, this is amazing work!
2020-05-24 01:59:03 -05:00
Stefan Dej 5cff1fc45a bugfix: control button position z
feature: add extruder control panel
2020-05-23 00:46:02 +02:00
Stefan Dej 7301cecbdf bugfix: console log sort with milliseconds,
feature: add all gcode buttons to event log
2020-05-12 01:13:55 +02:00
Stefan Dej 0478d1aefb rename nginx log from kwc to mainsail 2020-05-11 11:11:12 +02:00
Stefan Dej d9469b3c8b fixed typos in Heightmap.vue 2020-05-11 08:59:39 +02:00
Stefan Dej 0a51b0d255 bugfix: time format in status panel,
update README.md for V0.0.12
2020-05-11 08:40:00 +02:00
Stefan Dej 52afc35fd6 update README.md for V0.0.11 2020-05-11 01:11:27 +02:00
Stefan Dej 9e5266425c feature: select value by focus heater input field 2020-05-11 01:07:29 +02:00
Stefan Dej 86595ab70b feature: temperature_sensor min/max temp by hover 2020-05-11 01:04:59 +02:00
Stefan Dej 0f87e3f28f bugfix: temperature_fans onload & update fix
feature: save hidden sensors from chart in gui.json
2020-05-11 00:54:36 +02:00
Stefan Dej 88305e74cf fixes #9 2020-05-09 02:20:50 +02:00
Stefan Dej abea5d8660 fixes #13 for time > 24h 2020-05-09 02:12:42 +02:00
Stefan Dej d2bccb737e Update README.md 2020-05-09 02:03:19 +02:00
Stefan Dej 0bfde82ee8 add sensor number 2020-05-09 01:58:16 +02:00
Stefan Dej de9485cc84 update README.md, load tempchart history, update to moonraker 2020-05-09 01:47:30 +02:00
Stefan Dej e8d2c71401 update README.md 2020-04-27 21:52:37 +02:00
meteyou 554b25d754 Merge pull request #5 from pusewicz/patch-1
Few tweaks to the README file

thx!
2020-04-27 12:36:51 +02:00
Piotr Usewicz ecf2ee070b Few tweaks to the README file
This is a PR that tweaks some of the README that fixes some of the typos. I did not go much into detail.
2020-04-27 12:14:42 +02:00
meteyou e35d13d446 Merge pull request #1 from meteyou/dependabot/npm_and_yarn/acorn-6.4.1
Bump acorn from 6.3.0 to 6.4.1
2020-04-27 10:52:07 +02:00
Stefan Dej 9f46a502fc finish README.md 2020-04-27 10:31:56 +02:00
Stefan Dej a4436348df finish README.md 2020-04-27 08:40:06 +02:00
Stefan Dej 706515bc84 Update Websocket + README.md 2020-04-27 01:55:01 +02:00
Stefan Dej efc70ca5aa test with new websocket implementation 2020-04-25 21:17:27 +02:00
Stefan Dej 544d5e2db5 update npm packages & change to local dependency 2020-04-19 17:06:31 +02:00
Stefan Dej 70e8ce5687 update README.md for V0.0.8 2020-04-18 03:24:21 +02:00
Stefan Dej 6bc72dcb8c modify nginx config in README;
Settings > Machine > Endstop Status
Settings > Machine > Runout Sensor
2020-04-18 03:13:44 +02:00
Stefan Dej d0f78196c5 modify nginx config in README 2020-04-14 13:48:33 +02:00
Stefan Dej ec827bbea4 add nginx config in README 2020-04-14 13:34:32 +02:00
Stefan Dej beba547031 clean settings and last API corrections 2020-04-14 00:43:32 +02:00
Stefan Dej bb18992f80 add interface settings and save gui.json on virtual_sdcard 2020-04-14 00:08:52 +02:00
Stefan Dej 572fbd7629 edit README.md: including lighttpd and optimize haproxy 2020-04-12 17:42:23 +02:00
Stefan Dej 69fff8fe0e dashboard:
- temp combine table+chart;
- add estimated time by: filament, slicer
- format control buttons

gcode files:
- add meta data
2020-04-12 03:56:32 +02:00
Stefan Dej 101904bd6d console autocomplete;
tempchart target temp;
settings machinelimits
add webcamsupport
2020-04-12 00:13:40 +02:00
Stefan Dej 28177e35a7 update README.md to V0.0.6 2020-03-26 01:50:54 +01:00
dependabot[bot] d57e888133 Bump acorn from 6.3.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.3.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-16 03:31:57 +00:00
96 changed files with 13281 additions and 2772 deletions

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug:**\
A clear and concise description of what the bug is.
**Expected behavior:**\
A clear and concise description of what you expected to happen.
**Screenshots:**\
If applicable, add screenshots to help explain your problem.
**Logfiles:**\
Please upload your Logfiles here or upload them to [pastebin.com](http://pastebin.com) and paste your log links here.
- klippy.log
- moonraker.log
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+12
View File
@@ -0,0 +1,12 @@
node_modules
.DS_Store
design
*.log
packages/test
dist
temp
.vuerc
.version
.versions
.changelog
package-lock.json
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+12 -95
View File
@@ -1,99 +1,16 @@
# Klipper Web Control
KWC is a responsive web interface for [Klipper](https://github.com/KevinOConnor/klipper) 3D printer firmware. It communicates with the klipper-api from [Arksine](https://github.com/arksine).
# Mainsail
Mainsail is a lightweight & responsive web interface for the [Klipper](https://github.com/KevinOConnor/klipper)
3D printer firmware. It communicates with the [Moonraker (Klipper-API)](https://github.com/arksine/moonraker) from [Arksine](https://github.com/arksine).
## Installation
At first install Arksine klipper-api fork/branch -> [install manual](https://github.com/Arksine/klipper/tree/work-web_server-20200131/klippy/extras/web_server)
![screenshot-dashboard](docs/images/screenshot-dashboard.png)
Download and install KWC:
```bash
mkdir -p ~/kwc
cd ~/kwc
wget -q -O kwc.zip https://github.com/meteyou/kwc/releases/download/v0.0.5/kwc-alpha-0.0.5.zip && unzip kwc.zip && rm kwc.zip
```
To begin using Mainsail start by [installing](docs/installation.md) it or read the [documentation](docs/README.md) for more informations.
Configure web_server in printer.cfg:
```
[web_server]
port: 8080
enable_cors: true
trusted_clients:
192.168.1.0/24
127.0.0.1
web_path: ~/kwc
```
## 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.
* [lixxbox](https://github.com/lixxbox) for the Mainsail logo
* [Vue.js](https://vuejs.org/): The Progressive JavaScript Framework
* [Vuetify](https://vuetifyjs.com/): Material Design Component Framework for Vue.js
Example Klipper macros:
```
[pause_resume]
[gcode_macro CANCEL]
default_parameter_X: 230
default_parameter_Y: 230
default_parameter_Z: 10
gcode:
M104 S0
M140 S0
M141 S0
M106 S0
CLEAR_PAUSE
RESET_SD
[gcode_macro CANCEL_PRINT]
gcode:
CANCEL
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_X: 230
default_parameter_Y: 230
default_parameter_Z: 10
gcode:
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-1.7 F2100
G1 Z{Z}
G90
G1 X{X} Y{Y} F6000
G91
[gcode_macro RESUME]
rename_existing: BASE_RESUME
gcode:
G91
G1 E1.7 F2100
G91
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
```
## Installation haproxy
haproxy is necessary to use port 80.
`sudo apt install haproxy`
add following lines at the end of `/etc/haproxy/haproxy.cfg`:
```
frontend public
bind :::80 v4v6
# use_backend webcam if { path_beg /webcam/ }
default_backend kwc
backend kwc
reqrep ^([^\ :]*)\ /(.*)     \1\ /\2
option forwardfor
server kwc1 127.0.0.1:8080
#backend webcam
# reqrep ^([^\ :]*)\ /webcam/(.*) \1\ /\2
# server webcam1 127.0.0.1:8081
```
## Update KWC to V0.0.5
```
rm -R ~/kwc/*
cd ~/kwc
wget -q -O kwc.zip https://github.com/meteyou/kwc/releases/download/v0.0.5/kwc-alpha-0.0.5.zip && unzip kwc.zip && rm kwc.zip
```
and update your macros
Massive thanks to the whole [Voron Design](http://vorondesign.com/) community. Without them such a project would not be possible.
+7
View File
@@ -0,0 +1,7 @@
# Overview
- [Installation](installation.md)
- [Update](update.md)
- [Macros](macros.md)
- [Slicer upload](slicer-upload.md)
- [Gcode thumbnails (PrusaSlicer & SuperSlicer only)](gcode-thumbnails.md)
+11
View File
@@ -0,0 +1,11 @@
# Gcode-thumbnails with PrusaSlicer and SuperSlicer
Mainsail can display these thumbnails in the gcode filemanager. To enable the thumbnails,
open your slicer (PrusaSlicer or SuperSlicer) click on `Help > Show Configuration Folder`
and then inside the `printers` sub-folder you’ll find your printer profiles.
Open your desired printer profile in your favorite text editor and find the `thumbnails =`
section and add the resolutions `32x32,400x300`. Save the file and restart your slicer.
Now you should see a preview in the filemanager and if you will start a new job.
![Screenshot gcode thumbnail](images/screenshot-gcode-thumbnail.png)
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 734 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

+294
View File
@@ -0,0 +1,294 @@
# Installation
This document provides a guide on how to install Moonraker & Mainsail on a Raspberry
Pi running Raspian/Rasperry Pi OS. Other SBCs and/or linux distributions
may work, however they may need a custom install script.
**Please don't use a octopi image!!!**
## Installing operation system image
It's recommend to use a clean Raspberry Pi OS 32-bit Lite (previosly called Raspbian)
image. You can download it [here](https://downloads.raspberrypi.org/raspios_lite_armhf_latest).
More information about the installtion of Raspberry Pi OS are
[here](https://www.raspberrypi.org/documentation/installation/installing-images/).
**If you have finished the installation and connected via ssh, you can continue.**
## Install Requirements
```
sudo apt update && sudo apt upgrade
sudo apt install git dfu-util unzip
```
## Install Klipper
In this step, we install klipper.
```
cd ~
git clone https://github.com/KevinOConnor/klipper
cd ~/klipper
./scripts/install-octopi.sh
```
After you install Klipper with its dependencies you have to change the location
of the `printer.cfg` and add the UDS. This is definied in the `/etc/default/klipper` file.
To edit this file type:
```
sudo nano /etc/default/klipper
```
and then change:
```
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log"
```
to:
```
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /tmp/klippy.log -a /tmp/klippy_uds"
```
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
At least you have to create the config and the virtual_sdcard directory with:
```
mkdir ~/klipper_config
mkdir ~/sdcard
```
and copy your `printer.cfg` in the `~/klipper_config` directory and restart klipper with
`sudo service klipper restart`. Please check the `klippy.log`, if Klipper starts
correctly and then continue the guide.
and check if you have following lines in your `printer.cfg`:
```
[virtual_sdcard]
path: ~/sdcard
[pause_resume]
[display_status]
```
## Install Moonraker (API)
You can now install the Moonraker application:
```
cd ~
git clone https://github.com/Arksine/moonraker.git
```
Finally, run Moonraker's install script:
```
cd ~/moonraker/scripts
./install-moonraker.sh
```
When the script completes it should start both Moonraker and Klipper. In
`klippy.log` you should find the following entry:\
`Moonraker: server connection detected`
### Configure Moonraker
A basic configuration that authorizes clients on a range
from 192.168.1.1 - 192.168.1.254 is as follows.
Create the configfile with `nano ~/moonraker.conf` and add the following lines:
```
[server]
host: 0.0.0.0
config_path: ~/klipper_config
[authorization]
enabled: true
trusted_clients:
192.168.1.0/24
```
Note that the above configuration can differ! Make sure you determine your local IP and replace the IP from the example configuration above with the one from your own network.
Restart Moonraker (`sudo service moonraker restart`) and open the url `http://<printer-ip>:7125/printer/info` in your browser.
If you see a content like this
```
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-643-g528f9f25", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
```
your API is working!
For more informations about the Moonraker installation or configuration
look at the Repository from Arksine:
[Moonraker Repository install Documentation](https://github.com/Arksine/moonraker/blob/master/docs/installation.md)
## Install Mainsail (webinterface)
### Install webserver & reverse proxy (nginx)
nginx is important to mount all components on port 80 and host the static files from Mainsail.
To install nginx you only need to execute:
```
sudo apt install nginx
```
now we create the config files with:
```
sudo touch /etc/nginx/sites-available/mainsail
sudo touch /etc/nginx/conf.d/upstreams.conf
sudo touch /etc/nginx/conf.d/common_vars.conf
```
Each file can be filled with the following content:
`sudo nano /etc/nginx/conf.d/upstreams.conf`
```
# /etc/nginx/conf.d/upstreams.conf
upstream apiserver {
#edit your api port here
ip_hash;
server 127.0.0.1:7125;
}
upstream mjpgstreamer {
#edit your webcam port here
ip_hash;
server 127.0.0.1:8081;
}
```
`sudo nano /etc/nginx/conf.d/common_vars.conf`
```
# /etc/nginx/conf.d/common_vars.conf
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
```
`sudo nano /etc/nginx/sites-available/mainsail`
```
# /etc/nginx/sites-available/mainsail
server {
listen 80 default_server;
listen [::]:80 default_server;
access_log /var/log/nginx/mainsail-access.log;
error_log /var/log/nginx/mainsail-error.log;
#disable this section on smaller hardware like a pi zero
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_proxied expired no-cache no-store private auth;
gzip_comp_level 4;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml;
#web_path from mainsail static files
root /home/pi/mainsail;
index index.html;
server_name _;
#max upload size for gcodes
client_max_body_size 200M;
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 /websocket {
proxy_pass http://apiserver/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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_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;
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 /webcam/ {
proxy_pass http://mjpgstreamer/;
}
}
```
Create directory for static files and active nginx config:
```
mkdir ~/mainsail
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
sudo service nginx restart
```
Now you can check again the API if it works with the reverse proxy.
Open the url `http://<printer-ip>/printer/info` in your browser. if you see a content like this:
```
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-479-gd586fb06", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
```
Now we can install Mainsail (static httpdocs).
### Install httpdocs
Now you can download the current mainsail static data
```
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.6/mainsail-beta-0.2.6.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
### Important macros
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.
[Link to the macros doc](macros.md)
### Change the Hostname (optional)
to use the hostname instate of the ip, you can install the avahi-daemon:
```
sudo apt install avahi-daemon
```
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.
+55
View File
@@ -0,0 +1,55 @@
# Useful macros for Moonraker/Mainsail
## pause / resume / cancel
```
#is required to load the pause_resume module in klipper
[pause_resume]
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
default_parameter_X: 230 #edit to your park position
default_parameter_Y: 230 #edit to your park position
default_parameter_Z: 10 #edit to your park position
default_parameter_E: 1 #edit to your retract length
gcode:
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
G91
G1 E-{E} F2100
G1 Z{Z}
G90
G1 X{X} Y{Y} F6000
[gcode_macro RESUME]
rename_existing: BASE_RESUME
default_parameter_E: 1 #edit to your retract length
gcode:
G91
G1 E{E} F2100
G90
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
BASE_RESUME
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
```
## customize klipper default commands
for example, if you want to adjust the BED_MESH_CALIBRATE command, which will execute under "heightmap > calibrate".
```
[gcode_macro BED_MESH_CALIBRATE]
rename_existing: BASE_BED_MESH_CALIBRATE
gcode:
#before the original gcode
BED_MESH_CLEAR
QUAD_GANTRY_LEVEL
G1 X125 Y125 Z5 F6000
#the original gcode
BASE_BED_MESH_CALIBRATE
#after the original gcode
```
+7
View File
@@ -0,0 +1,7 @@
# Upload Gcodes from your Slicer
You can upload your gcode-files from your slicer. Moonraker simulate the octoprint-upload.
Just set the slicer to octoprint, enter the hostname or ip and fill in the API-Key field
with something.
![superslicer-upload](images/superslicer-upload.png)
+47
View File
@@ -0,0 +1,47 @@
# Update Mainsail
## Update Klipper
```
cd ~/klipper
git fetch
git checkout origin/master
```
Please check the location of the `~/klipper_config/printer.cfg` and the UDS (`-a /tmp/klippy_uds`) in the `/etc/default/klipper` file. This
should look like:
```
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /tmp/klippy.log -a /tmp/klippy_uds"
```
If you have to change the location of `printer.cfg` in `/etc/default/klipper`
please create the directory `~/klipper_config` and move your config files in this directory.
Restart Klipper (`sudo service klipper restart`) and check the `klippy.log`, if Klipper starts
correctly and then continue the guide.
## Update Moonraker (API)
```
cd ~/moonraker
git fetch
git checkout origin/master
```
Restart Moonraker (`sudo service moonraker restart`) and open the url `http://<printer-ip>:7125/printer/info` in your browser.
If you see a content like this
```
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-643-g528f9f25", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
```
## Update Mainsail (webinterface)
```
cd ~/mainsail
rm -R ./*
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.6/mainsail-beta-0.2.6.zip && unzip mainsail.zip && rm mainsail.zip
```
### Move gui.json from gcodes to klipper_config
This is only necessary if you update from 0.2.2 to 0.2.3 or higher. If you use MainsailOS, the virtual_sdcard directory is `gcode_files` instead of `sdcard`.
```
mv ~/sdcard/gui.json ~/klipper_config/
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
+7330 -1532
View File
File diff suppressed because it is too large. Load diff
+24 -23
View File
@@ -1,6 +1,6 @@
{
"name": "kwc",
"version": "0.1.0",
"name": "mainsail",
"version": "0.2.6",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -10,37 +10,38 @@
"dependencies": {
"axios": "^0.19.2",
"chart.js": "^2.9.3",
"core-js": "^3.6.4",
"core-js": "^3.6.5",
"object-assign-deep": "^0.4.0",
"prismjs": "^1.21.0",
"vue": "^2.6.11",
"vue-chartjs": "^3.5.0",
"vue-context": "^5.0.0",
"vue-context": "^6.0.0",
"vue-headful": "^2.1.0",
"vue-json-rpc-websocket": "^1.1.1",
"vue-plotly": "^1.1.0",
"vue-prism-editor": "^1.2.0",
"vue-resource": "^1.5.1",
"vue-simple-upload": "^0.1.6",
"vue-toast-notification": "0.0.3",
"vuetify": "^2.2.17",
"vuetify-toast-snackbar": "^0.6.1",
"vuex": "^3.1.3"
"vue-toast-notification": "^0.5.0",
"vuetify": "^2.3.8",
"vuex": "^3.5.1"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.12.1",
"@mdi/font": "^4.9.95",
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-plugin-eslint": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"@mdi/font": "^5.5.55",
"@vue/cli-plugin-babel": "^4.5.3",
"@vue/cli-plugin-eslint": "^4.5.3",
"@vue/cli-plugin-pwa": "^4.5.6",
"@vue/cli-service": "^4.5.3",
"babel-eslint": "^10.1.0",
"css-loader": "^3.4.2",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"material-design-icons-iconfont": "^5.0.1",
"sass": "^1.26.3",
"sass-loader": "^8.0.2",
"css-loader": "^4.2.1",
"eslint": "^7.6.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.10",
"sass-loader": "^9.0.3",
"vue-cli-plugin-route": "0.0.7",
"vue-cli-plugin-vuetify": "^1.1.2",
"vue-router": "^3.1.6",
"vue-cli-plugin-vuetify": "^2.0.7",
"vue-router": "^3.4.3",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.4.3"
"vuetify-loader": "^1.6.0"
},
"eslintConfig": {
"root": true,
+7
View File
@@ -0,0 +1,7 @@
{
"socket": {
"hostname": "voron250.local",
"port": 80,
"metadataRequestDelay": 2000
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16" height="16" fill="none" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path class="cls-1" d="m9.2411 1.0308a.90423.90423 0 00-.09715.14352.71122.71122 0 01-.08832.13469.76405.76405 0 00-.08832.13248.69069.69069 0 01-.07949.11924.92241.92241 0 00-.07728.11482.9138.9138 0 01-.13027.18989.39392.39392 0 00-.0552.08391 3.9975 3.9975 0 01-.24068.36653.5964.5964 0 00-.0552.08832.88907.88907 0 01-.0552.08832c-.01546.01325-.27159.39524-.28925.43057a2.5009 2.5009 0 01-.1656.24509.88792.88792 0 00-.06624.10378c-.02429.04416-.05078.0817-.05962.0817-.01104 0-.01766.01546-.01766.03312 0 .01767-.0088.03312-.02208.03312a.021784.021784 0 00-.02208.01987c0 .01546-.39082.61604-.41953.64254a.76017.76017 0 00-.08611.14352.21433.21433 0 01-.0552.07507.092211.092211 0 00-.03533.05078.17286.17286 0 01-.04416.06624.16667.16667 0 00-.04416.07728c0 .01546-.0088.02871-.01766.02871-.01987 0-.08832.1104-.08832.14132a.041564.041564 0 01-.02208.03312c-.03091.01987-.18106.24068-.18106.26717a.02006.02006 0 01-.01767.02208c-.0088 0-.03533.03754-.05962.0817a.88791.88791 0 01-.06624.10378 1.2079 1.2079 0 00-.09715.14352 1.3047 1.3047 0 01-.09715.14573c-.02208.02429-.12144.17223-.22522.34004-.09274.14794-.28925.43498-.3025.4394a.017424.017424 0 00-.0044.0287c.0066.01105.0022.01987-.0066.01987-.01104 0-.03754.03533-.05962.07728-.02429.04195-.05078.07728-.06182.07728-.01105 0-.01546.0088-.0066.01987a.028289.028289 0 01-.0088.03533c-.03091.01766-.15677.20756-.15677.23405a.019789.019789 0 01-.01987.01987c-.01104 0-.0287.01987-.03533.04416a.19727.19727 0 01-.03974.07066 1.4846 1.4846 0 00-.10378.15015c-.04195.06624-.0817.12586-.08832.13248-.0066.0066-.04637.06624-.08832.13248a.7894.7894 0 01-.09274.12806.041497.041497 0 00-.01766.03754.041497.041497 0 01-.01766.03754.69037.69037 0 00-.09274.12806c-.04195.06624-.08391.13028-.09495.14352-.0088.01105-.08832.13248-.17664.26717-.33341.51226-.37316.57188-.39303.57851a.034023.034023 0 00-.01987.0287c0 .02429-.1921.32016-.2473.38199a.15037.15037 0 00-.03974.07286.049837.049837 0 01-.03313.04196c-.01766.0088-.02871.02208-.02208.03091.0044.0088-.0088.03312-.03312.0552a.1275.1275 0 00-.04416.07066.027147.027147 0 01-.02429.02871.012177.012177 0 00-.01105.01987.018592.018592 0 01-.0044.02871c-.01105.0022-.10819.14131-.21639.30471-.10819.1634-.20314.3025-.21197.30471a.031827.031827 0 00-.01766.0287.61327.61327 0 01-.07728.13027.55743.55743 0 00-.07728.13248.021809.021809 0 01-.01767.02208c-.01104 0-.03312.0265-.05079.05962a.46019.46019 0 01-.04195.07286c-.0066.0066-.05299.07507-.10598.15456-.05078.07949-.10819.16339-.12365.18768-.09936.13911-.18989.28263-.18989.30029a.020388.020388 0 01-.02208.01987c-.01104 0-.02208.01546-.02208.03312s-.0088.03312-.02208.03312c-.01105 0-.02208.01546-.02208.03312s-.0088.03312-.02208.03312c-.01104 0-.02208.01325-.02208.03091a.047875.047875 0 01-.01545.03974.47797.47797 0 00-.11703.17223.022127.022127 0 01-.02208.02208c-.01104 0-.02208.01546-.02208.03312s-.0088.03312-.02208.03312a.023745.023745 0 00-.02208.02208c0 .02429-.07507.13911-.12586.19431a.10617.10617 0 00-.0287.06182c0 .01766-.0088.03091-.01766.03091-.01104 0-.03754.03533-.06183.07728-.02208.04195-.04858.07728-.05741.07728a.018034.018034 0 00-.01766.01987 1.772 1.772 0 01-.14352.23405 1.6281 1.6281 0 00-.14352.23405.019467.019467 0 01-.01766.01987c-.01104 0-.03312.0265-.05078.05962a.31022.31022 0 01-.04416.07287 1.3771 1.3771 0 00-.15235.24509.020389.020389 0 01-.02208.01987c-.01105 0-.03533.03533-.05299.07728s-.04416.07728-.05741.07728-.01987.0088-.01325.01767c.0066.01104-.01546.04637-.04858.0817s-.05741.06845-.05299.07066a1.358 1.358 0 01-.12807.20535c-.01325.01325-.13911.20093-.15456.23184-.03091.06403-.58513.88322-.60059.88984a.036489.036489 0 00-.01766.0287 1.5134 1.5134 0 01-.12144.19872c-.06845.09936-.11923.18548-.11261.18989.01105.01104 3.2061.03754 3.5152.03091.03091-.0022.05741-.02429.07507-.06845.01546-.03754.03533-.06624.04637-.06624a.021784.021784 0 00.01987-.02208.47797.47797 0 01.11703-.17223.041375.041375 0 00.01546-.03533c0-.02429.01987-.05299.10819-.15898.01104-.01546.01546-.03312.0088-.03974-.0088-.0066-.0022-.01325.01104-.01325a.030189.030189 0 00.0265-.03312.070728.070728 0 01.03533-.05079c.01987-.01104.03533-.0287.03533-.03974a1.1528 1.1528 0 01.12807-.20756.66369.66369 0 00.05299-.08832.88877.88877 0 01.0552-.08832 1.0397 1.0397 0 00.11261-.1634 2.5726 2.5726 0 01.14352-.2208 1.5398 1.5398 0 00.14352-.23184.031825.031825 0 01.01766-.02871.67267.67267 0 00.11482-.16119.10351.10351 0 01.02429-.03974c.01105-.01546.07287-.10598.1369-.20314.06182-.09715.11702-.18106.12586-.18768a.52117.52117 0 00.04195-.07066.45731.45731 0 01.07287-.10378.2209.2209 0 00.03974-.0552c0-.01987.42615-.66241.44823-.67787.01104-.0066.01546-.01987.01104-.0265a.091934.091934 0 01.0287-.0552 1.1468 1.1468 0 00.07728-.1104c.02208-.03974.04858-.07066.05962-.07066.0088 0 .01325-.0088.0044-.01987-.0066-.01104.0022-.03312.01766-.05079.04858-.04858.17002-.23405.17002-.25834a.024184.024184 0 01.022Line truncated

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

+2 -5
View File
@@ -4,14 +4,11 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico" id="favicon" />
<title>KlipperWebControl</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
<title>Mainsail</title>
</head>
<body>
<noscript>
<strong>We're sorry but kwc doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but Mainsail doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
+133 -49
View File
@@ -1,3 +1,11 @@
<style>
@import './assets/styles/fonts.css';
.button-min-width-auto {
min-width: auto !important;
}
</style>
<template>
<v-app>
<vue-headful
@@ -9,11 +17,24 @@
>
<div id="nav-header">
<img :src="require('./assets/logo.svg')" />
<v-toolbar-title>{{ hostname }}</v-toolbar-title>
<v-toolbar-title>{{ printername != "" ? printername : hostname }}</v-toolbar-title>
</div>
<ul class="navi" :expand="$vuetify.breakpoint.mdAndUp">
<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 slot="activator" class="nav-link" exact :to="category.path" @click.prevent>
<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
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
v-if="
(category.title === 'Webcam' && boolNaviWebcam) ||
(category.title === 'Heightmap' && boolNaviHeightmap) ||
(
category.title !== 'Webcam' &&
category.title !== 'Heightmap' &&
(klippy_state !== 'error' || category.alwaysShow)
)
">
<v-icon>mdi-{{ category.icon }}</v-icon>
<span class="nav-title">{{ category.title }}</span>
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
@@ -21,7 +42,7 @@
<ul class="child">
<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>
<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>
</router-link>
@@ -31,15 +52,45 @@
</ul>
</v-navigation-drawer>
<v-app-bar app absolute
elevate-on-scroll>
<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="green" v-if="!isConnected" :loading="loadingEmergencyStop" @click="emergencyStop"><v-icon class="mr-2">mdi-refresh-circle</v-icon> reconnect</v-btn>-->
<v-btn color="error" v-if="isConnected" :loading="loadingEmergencyStop" @click="emergencyStop">Emergency Stop</v-btn>
<v-btn color="primary" class="mr-5" v-if="isConnected && save_config_pending" :loading="loadingConfigChanged" @click="clickSaveConfig">SAVE CONFIG</v-btn>
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadingEmergencyStop" @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>
<v-menu
bottom
left
:offset-y="true"
>
<template v-slot:activator="{ on, attrs }">
<v-btn
dark
icon
v-bind="attrs"
v-on="on"
>
<v-icon>mdi-dots-vertical</v-icon>
</v-btn>
</template>
<v-list dense>
<v-list-item link @click="doRestart()">
<v-list-item-title><v-icon class="mr-3">mdi-sync</v-icon>Restart</v-list-item-title>
</v-list-item>
<v-list-item link @click="doFirmwareRestart()">
<v-list-item-title><v-icon class="mr-3">mdi-sync</v-icon>FW Restart</v-list-item-title>
</v-list-item>
<v-list-item link @click="doHostReboot()">
<v-list-item-title><v-icon class="mr-3">mdi-power</v-icon>Reboot Host</v-list-item-title>
</v-list-item>
<v-list-item link @click="doHostShutdown()">
<v-list-item-title><v-icon class="mr-3">mdi-power</v-icon>Shutdown Host</v-list-item-title>
</v-list-item>
</v-list>
</v-menu>
</v-app-bar>
<v-content id="content">
<v-main id="content">
<v-scroll-y-transition>
<v-container fluid id="page-container" class="container">
<keep-alive>
@@ -47,20 +98,21 @@
</keep-alive>
</v-container>
</v-scroll-y-transition>
</v-content>
</v-main>
<v-dialog v-model="isConnecting" persistent width="300">
<v-card color="primary" dark >
<v-card-text class="pt-2">
Connecting to Klipper
Connecting...
<v-progress-linear indeterminate color="white" class="mb-0"></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
<v-footer app class="d-block">
<span v-if="version">{{ version }}</span>
<span class="float-right">&copy; 2020</span>
<span>v{{ getVersion }}</span>
<span v-if="version" class="d-none d-sm-inline"> - {{ version }}</span>
<span class="float-right">Made with <img src="/img/heart.png" height="15" title="love" alt="heard" /> by <a href="http://www.vorondesign.com/" target="_blank"><img src="/img/voron.png" height="15" title="VoronDesign" alt="Logo - VoronDesign" /></a></span>
</v-footer>
</v-app>
</template>
@@ -79,29 +131,16 @@ export default {
data: () => ({
drawer: null,
activeClass: 'active',
routes: routes
routes: routes,
//is_ready: false,
boolNaviHeightmap: false,
loadingEmergencyStop: false,
loadingConfigChanged: false,
}),
created () {
this.$vuetify.theme.dark = true,
this.$socket.onOpen = () => {
this.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
this.$socket.sendObj('get_printer_objects', {}, 'getObjectInfo');
this.$socket.sendObj('get_printer_status', { heater: [] }, 'getObjectInfo');
this.$socket.sendObj('get_printer_status', { configfile: ['config'] }, 'getPrinterConfig');
this.$socket.sendObj('post_printer_subscriptions', {
gcode: [],
toolhead: [],
virtual_sdcard: [],
heater: [],
heater_bed: [],
extruder: ["temperature", "target"],
fan: [],
pause_resume: [],
idle_timeout: [],
});
this.$socket.sendObj('get_printer_files', {}, 'getFileList');
}
this.$vuetify.theme.dark = true;
//this.is_ready = (this.klippy_state === "ready") ? true : false;
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
},
computed: {
currentPage: function() {
@@ -110,25 +149,51 @@ export default {
...mapState({
toolhead: state => state.printer.toolhead,
hostname: state => state.printer.hostname,
version: state => state.printer.version,
loadingEmergencyStop: state => state.socket.loadingEmergencyStop,
printername: state => state.gui.general.printername,
version: state => state.printer.software_version,
isConnected: state => state.socket.isConnected,
isConnecting: state => !state.socket.isConnected,
progress: state => state.printer.virtual_sdcard.progress,
virtual_sdcard: state => state.printer.virtual_sdcard,
current_file: state => state.printer.print_stats.filename,
boolNaviWebcam: state => state.gui.webcam.bool,
klippy_state: state => state.printer.webhooks.state,
loadings: state => state.loadings,
config: state => state.printer.configfile.config,
save_config_pending: state => state.printer.configfile.save_config_pending,
}),
...mapGetters([
'getTitle'
'getTitle',
'getVersion'
])
},
methods: {
emergencyStop: function() {
this.$store.commit('setLoadingEmergencyStop', true);
this.$socket.sendObj('post_printer_gcode', {script: 'M112'}, 'setLoadingEmergencyStop');
clickEmergencyStop: function() {
this.$store.commit('setLoading', { name: 'btnEmergencyStop' });
this.$socket.sendObj('printer.emergency_stop', {});
},
clickSaveConfig: function() {
this.$store.commit('addGcodeResponse', "SAVE_CONFIG");
this.$store.commit('setLoading', { name: 'btnSaveConfig' });
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" });
},
doRestart: function() {
this.$store.commit('addGcodeResponse', "RESTART");
this.$socket.sendObj('printer.gcode.script', { script: "RESTART" });
},
doFirmwareRestart: function() {
this.$store.commit('addGcodeResponse', "FIRMWARE_RESTART");
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" });
},
doHostReboot: function() {
this.$socket.sendObj('machine.reboot', { });
},
doHostShutdown: function() {
this.$socket.sendObj('machine.shutdown', { });
},
drawFavicon(val) {
let favicon = document.getElementById('favicon');
if (val === 0) favicon.href = "/favicon.ico";
else {
let favicon16 = document.querySelector("link[rel*='icon'][sizes='16x16']");
let favicon32 = document.querySelector("link[rel*='icon'][sizes='32x32']");
if (val > 0 && val < 100) {
let faviconSize = 64;
let canvas = document.createElement('canvas');
@@ -166,17 +231,36 @@ export default {
context.fillStyle = "#e41313";
context.fill();
favicon.href = canvas.toDataURL('image/png');
favicon16.href = canvas.toDataURL('image/png');
favicon32.href = canvas.toDataURL('image/png');
} else {
favicon16.href = "/img/icon/favicon-16x16.png"
favicon32.href = "/img/icon/favicon-32x32.png"
}
}
},
watch: {
progress: {
virtual_sdcard: {
deep: true,
handler: function(val) {
this.drawFavicon(val);
let progress = (val && val.progress) ? val.progress : 0;
this.drawFavicon(progress);
}
},
current_file: {
handler: function(newVal) {
this.$socket.sendObj("server.files.metadata", { filename: newVal }, "getMetadataCurrentFile");
}
},
config() {
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
},
loadings: function(loadings) {
this.loadingEmergencyStop = loadings.includes('btnEmergencyStop');
this.loadingConfigChanged = loadings.includes('btnSaveConfig');
}
}
},
}
</script>
@@ -303,4 +387,4 @@ export default {
}
</style>
</style>
+1 -21
View File
@@ -1,21 +1 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="_x30_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 165 190.5" style="enable-background:new 0 0 165 190.5;" xml:space="preserve">
<style type="text/css">
.st0{fill:#E41313;}
.st1{fill:#FFFFFF;}
</style>
<g id="LWPOLYLINE">
<polygon class="st0" points="82.5,0 0,47.6 0,142.9 82.5,190.5 165,142.9 165,47.6 "/>
</g>
<g id="LWPOLYLINE_1_">
<polygon class="st1" points="58.2,43.5 83.1,43.5 49.1,95.3 24.2,95.3 "/>
</g>
<g id="LWPOLYLINE_2_">
<polygon class="st1" points="36,147 104.1,43.5 129,43.5 60.9,147 "/>
</g>
<g id="LWPOLYLINE_3_">
<polygon class="st1" points="106.8,147 81.9,147 115.9,95.3 140.8,95.3 "/>
</g>
</svg>
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 385.66987 338.2562"><defs><style>.cls-1{fill:#e73d26;}</style></defs><title>logo</title><path class="cls-1" d="M222.75337,1.14007a21.79586,21.79586,0,0,0-2.34182,3.45951,17.14349,17.14349,0,0,1-2.12893,3.24662,18.41685,18.41685,0,0,0-2.12893,3.19339,16.64854,16.64854,0,0,1-1.916,2.87406,22.23421,22.23421,0,0,0-1.86282,2.76761,22.02646,22.02646,0,0,1-3.14017,4.5772,9.49513,9.49513,0,0,0-1.33058,2.02248,96.35724,96.35724,0,0,1-5.80133,8.83506,14.37578,14.37578,0,0,0-1.33058,2.12893,21.43049,21.43049,0,0,1-1.33058,2.12893c-.37257.31934-6.54646,9.527-6.97225,10.37854a60.28212,60.28212,0,0,1-3.99175,5.90778,21.40279,21.40279,0,0,0-1.5967,2.5015c-.58546,1.06446-1.22413,1.96926-1.437,1.96926-.26612,0-.42578.37256-.42578.79834s-.21289.79835-.53223.79835a.52508.52508,0,0,0-.53224.479c0,.37256-9.42052,14.84929-10.11242,15.488a18.32335,18.32335,0,0,0-2.0757,3.45951,5.16638,5.16638,0,0,1-1.33058,1.80959,2.22269,2.22269,0,0,0-.85158,1.22414,4.16658,4.16658,0,0,1-1.06446,1.59669,4.0175,4.0175,0,0,0-1.06447,1.86282c0,.37256-.21289.6919-.42578.6919-.479,0-2.12893,2.66117-2.12893,3.40629a1.00188,1.00188,0,0,1-.53223.79835c-.74512.479-4.36431,5.80133-4.36431,6.44a.48353.48353,0,0,1-.42578.53224c-.21289,0-.85158.90479-1.437,1.96926a21.40243,21.40243,0,0,1-1.5967,2.50149,29.11642,29.11642,0,0,0-2.34182,3.45951,31.44916,31.44916,0,0,1-2.34182,3.51274c-.53223.58546-2.92727,4.15141-5.42877,8.19638-2.23539,3.566-6.97225,10.485-7.2916,10.59142a.42.42,0,0,0-.10645.6919c.15966.26611.05323.479-.15966.479-.26612,0-.90481.85158-1.437,1.86282-.58546,1.01124-1.22413,1.86281-1.49024,1.86281s-.37257.21289-.15967.479a.68189.68189,0,0,1-.21289.85157c-.74512.42578-3.77885,5.003-3.77885,5.64167a.477.477,0,0,1-.479.479c-.26611,0-.6919.479-.85157,1.06446a4.75513,4.75513,0,0,1-.958,1.70315,35.78571,35.78571,0,0,0-2.50149,3.61918c-1.01124,1.5967-1.96926,3.03373-2.12893,3.1934s-1.1177,1.59669-2.12894,3.19339a19.02787,19.02787,0,0,1-2.23537,3.08694,1.00027,1.00027,0,0,0-.42579.90481,1.00025,1.00025,0,0,1-.42579.9048,16.6409,16.6409,0,0,0-2.23537,3.08694c-1.01124,1.5967-2.02249,3.14017-2.2886,3.45951-.21289.26612-2.12893,3.1934-4.25786,6.44-8.03672,12.3478-8.99473,13.78482-9.47375,13.9445a.82011.82011,0,0,0-.479.6919c0,.58546-4.63042,7.71737-5.961,9.20761a3.62456,3.62456,0,0,0-.958,1.75636A1.20128,1.20128,0,0,1,93.208,196.363c-.42579.21289-.69191.53224-.53224.74513.10645.21289-.21289.79834-.79835,1.33058a3.07335,3.07335,0,0,0-1.06446,1.70315.65437.65437,0,0,1-.58546.69189.29353.29353,0,0,0-.26612.479.44816.44816,0,0,1-.10644.6919c-.26612.05322-2.60794,3.40628-5.21588,7.3448s-4.89654,7.29159-5.10944,7.3448a.76717.76717,0,0,0-.42579.6919,14.78244,14.78244,0,0,1-1.86281,3.14017,13.43644,13.43644,0,0,0-1.86281,3.19339.52569.52569,0,0,1-.42579.53224c-.26612,0-.79835.63868-1.22414,1.437A11.09249,11.09249,0,0,1,72.717,227.4453c-.15967.15966-1.27735,1.80959-2.55472,3.72563-1.22413,1.916-2.60793,3.93852-2.9805,4.524-2.395,3.35306-4.5772,6.81257-4.5772,7.23835a.49145.49145,0,0,1-.53223.479c-.26612,0-.53224.37257-.53224.79835s-.21289.79835-.53223.79835c-.26611,0-.53223.37257-.53223.79835s-.2129.79835-.53223.79835c-.26612,0-.53224.31932-.53224.74513a1.154,1.154,0,0,1-.37256.958,11.52107,11.52107,0,0,0-2.82083,4.1514.53335.53335,0,0,1-.53223.53224c-.26612,0-.53224.37257-.53224.79835s-.21289.79834-.53223.79834a.57236.57236,0,0,0-.53223.53224c0,.58544-1.80959,3.35306-3.03373,4.68364a2.55908,2.55908,0,0,0-.6919,1.49024c0,.42578-.21289.74514-.42579.74514-.26611,0-.90479.85156-1.49025,1.86281-.53223,1.01126-1.17091,1.86282-1.38381,1.86282a.43471.43471,0,0,0-.42578.479,42.71364,42.71364,0,0,1-3.45951,5.64165,39.24326,39.24326,0,0,0-3.45952,5.64166.46923.46923,0,0,1-.42578.479c-.26612,0-.79835.63868-1.22414,1.437a7.47774,7.47774,0,0,1-1.06447,1.75636,33.19489,33.19489,0,0,0-3.6724,5.90777.49146.49146,0,0,1-.53223.479c-.26612,0-.85158.85155-1.27736,1.86281s-1.06447,1.86281-1.38381,1.86281-.479.21291-.31934.42578c.15968.26612-.37256,1.11768-1.17091,1.96927s-1.3838,1.64991-1.27736,1.70315a32.7331,32.7331,0,0,1-3.087,4.94976c-.31933.31932-3.35306,4.8433-3.72562,5.58844-.74513,1.54349-14.10417,21.2893-14.47673,21.449a.87955.87955,0,0,0-.42579.69189,36.48,36.48,0,0,1-2.92728,4.7901c-1.64992,2.395-2.874,4.47076-2.71438,4.57718.26611.26612,77.28017.90481,84.73143.74514.74512-.05321,1.3838-.58544,1.80958-1.64991.37257-.9048.85158-1.59669,1.1177-1.59669a.52508.52508,0,0,0,.479-.53224,11.5211,11.5211,0,0,1,2.82084-4.1514.99732.99732,0,0,0,.37256-.85156c0-.58545.479-1.27737,2.60793-3.83208.26612-.37257.37256-.79835.21289-.958-.21289-.15966-.05322-.31932.26612-.31932a.72768.72768,0,0,0,.63868-.79835,1.70485,1.70485,0,0,1,.85157-1.22413c.479-.26612.85158-.6919.85158-.958a27.78833,27.78833,0,0,1,3.087-5.003,15.99793,15.99793,0,0,0,1.27735-2.12893,21.42328,21.42328,0,0,1,1.33059-2.12893,25.061,25.061,0,0,0,2.71438-3.93854,62.00982,62.00982,0,0,1,3.45952-5.32232,37.11582,37.11582,0,0,0,3.45951-5.58845.Line truncated

Before

Width:  |  Height:  |  Size: 851 B

After

Width:  |  Height:  |  Size: 17 KiB

+48
View File
@@ -0,0 +1,48 @@
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(/fonts/roboto-thin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto-light.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto-regular.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto-medium.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto-bold.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 900;
src: local('Roboto Black'), local('Roboto-Black'), url(/fonts/roboto-black.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
+76 -36
View File
@@ -1,3 +1,4 @@
import store from '../store'
import { Line, mixins } from 'vue-chartjs'
const { reactiveProp } = mixins;
@@ -11,29 +12,68 @@ export default {
props: ['chartData'],
data() {
return {
timer: '',
options: {
events: ['click'],
animation: {
duration: 0 // general animation time
},
hover: {
animationDuration: 0 // duration of animations when hovering an item
},
elements: {
line: {
tension: 0 // disable bezier curves
tension: 0.4, // disable bezier curves
borderDash: undefined,
},
point: {
radius: 0,
hoverRadius: 0,
}
},
showLines: true,
legend: {
labels: {
fontColor: 'rgb(203, 203, 203)',
fontFamily: 'Roboto,sans-serif'
fontFamily: 'Roboto,sans-serif',
filter: function(item) {
return !item.text.includes('_target');
}
},
onClick: function(e, legendItem) {
let ci = this.chart;
let index = legendItem.datasetIndex;
let index_target = ci.data.datasets.findIndex(dataset => dataset.label === legendItem.text+'_target');
let meta = ci.getDatasetMeta(index);
// See controller.isDatasetVisible comment
meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
if (index_target !== -1) {
let meta_target = ci.getDatasetMeta(index_target);
meta_target.hidden = meta.hidden;
}
store.dispatch('setHeaterChartVisibility', { name: legendItem.text, hidden: meta.hidden });
ci.update();
}
},
tooltips: {
enabled: true,
enabled: false,
mode: 'nearest',
caretPadding: 20,
intersect: false,
callbacks: {
title: function (tooltipItem, data) {
return data['labels'][tooltipItem[0]['index']];
title: function (tooltipItem) {
let date = new Date(tooltipItem[0].label);
return date.getHours()+":"+(date.getMinutes() < 10 ? "0" : "")+date.getMinutes()+":"+(date.getSeconds() < 10 ? "0" : "")+date.getSeconds();
},
label: function (tooltipItem, data) {
return data['datasets'][0]['data'][tooltipItem['index']];
label: function (tooltipItem/*, data*/) {
/*let label_target = data['datasets'][tooltipItem.datasetIndex].label+"_target";
let target_dataset = data['datasets'].find(dataset => dataset.label === label_target);
if (target_dataset !== undefined && target_dataset.data[tooltipItem.index] !== undefined) return tooltipItem.value+" / "+target_dataset.data[tooltipItem.index].y;*/
return tooltipItem.value;
},
}
},
@@ -41,33 +81,27 @@ export default {
responsive: true,
responsiveAnimationDuration: 0, // animation duration after a resize
scales: {
xAxes: [
{
gridLines: {
color: 'rgba(0,0,0,0.2)',
display: true
xAxes: [{
type: 'time',
time: {
unit: 'minute',
displayFormats: {
second: 'HH:mm:ss',
minute: 'HH:mm'
}
},
ticks: {
minor: {
fontColor: 'rgb(203, 203, 203)',
fontFamily: 'Roboto,sans-serif'
},
ticks: {
minor: {
fontColor: 'rgb(203, 203, 203)',
fontFamily: 'Roboto,sans-serif'
},
major: {
fontColor: 'rgb(203, 203, 203)',
fontFamily: 'Roboto,sans-serif'
},
min: new Date() - maxSampleTime,
max: new Date()
},
time: {
unit: 'minute',
displayFormats: {
minute: 'HH:mm'
}
},
type: 'time',
}
],
min: new Date() - maxSampleTime,
max: new Date(),
},
gridLines: {
color: 'rgba(203,203,203,0.1)',
},
}],
yAxes: [
{
gridLines: {
@@ -94,8 +128,11 @@ export default {
}
}
},
created () {
this.timer = setInterval(this.update, 500);
},
mounted () {
this.renderChart(this.chartData, this.options)
this.renderChart(this.chartData, this.options);
},
methods: {
update() {
@@ -106,8 +143,11 @@ export default {
}
},
watch: {
chartData () {
this.update();
chartData: function(newData, oldData) {
window.console.log("watch chartData");
window.console.log(newData);
window.console.log(oldData);
this.$data._chart.reset();
}
}
}
+93 -71
View File
@@ -4,53 +4,65 @@
<template>
<v-card>
<v-col xs12 md12>
<v-row class="pl-3 pr-3 text-center">
<v-row class="" v-if="['standby', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 pb-0 text-center">
<div class="d-inline-block mx-2 my-1"><v-btn @click="doHome" :loading="loadingHomeAll" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'" class=""><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('quad_gantry_level')"><v-btn @click="doQGL" :loading="loadingQGL" color="primary">QGL</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('z_tilt')"><v-btn @click="doZtilt" :loading="loadingZTilt" color="primary">Z Tilt</v-btn></div>
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSend('X-100')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>X-100</span></v-btn>
<v-btn @click="doSend('X-10')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>X-10</span></v-btn>
<v-btn @click="doSend('X-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>X-1</span></v-btn>
<v-btn @click="doSendMove('X-100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><v-icon left class="d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">X-100</span></v-btn>
<v-btn @click="doSendMove('X-10')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">X-10</span></v-btn>
<v-btn @click="doSendMove('X-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">X-1</span></v-btn>
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadingHomeX"><v-icon class="mdi mdi-home"></v-icon></v-btn>
<v-btn @click="doSend('X+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span>X+1</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('X+10')" cols="1" class="flex-grow-1 flex-shrink-0"><span>X+10</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('X+100')" cols="1" class="flex-grow-1 flex-shrink-0"><span>X+100</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('X+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">X+1</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('X+10')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">X+10</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('X+100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">X+100</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
</v-btn-toggle>
</v-row>
<v-row class="pl-3 pr-3 mt-3 text-center">
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSend('Y-100')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Y-100</span></v-btn>
<v-btn @click="doSend('Y-10')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Y-10</span></v-btn>
<v-btn @click="doSend('Y-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Y-1</span></v-btn>
<v-btn @click="doSendMove('Y-100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Y-100</span></v-btn>
<v-btn @click="doSendMove('Y-10')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Y-10</span></v-btn>
<v-btn @click="doSendMove('Y-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Y-1</span></v-btn>
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadingHomeY"><v-icon class="mdi mdi-home"></v-icon></v-btn>
<v-btn @click="doSend('Y+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Y+1</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('Y+10')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Y+10</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('Y+100')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Y+100</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Y+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">Y+1</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Y+10')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">Y+10</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Y+100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">Y+100</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
</v-btn-toggle>
</v-row>
<v-row class="pl-3 pr-3 mt-3 text-center">
</v-col>
</v-row>
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSend('Z-25')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Z-25</span></v-btn>
<v-btn @click="doSend('Z-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Z-1</span></v-btn>
<v-btn @click="doSend('Z-0.1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left>mdi-chevron-left</v-icon><span>Z-0.1</span></v-btn>
<v-btn @click="doSendMove('Z-25')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Z-25</span></v-btn>
<v-btn @click="doSendMove('Z-1')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Z-1</span></v-btn>
<v-btn @click="doSendMove('Z-0.1')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Z-0.1</span></v-btn>
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadingHomeZ"><v-icon class="mdi mdi-home"></v-icon></v-btn>
<v-btn @click="doSend('Z+0.1')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Z+0.1</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('Z+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Z+1</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSend('Z+25')" cols="1" class="flex-grow-1 flex-shrink-0"><span>Z+25</span><v-icon right>mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Z+0.1')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><span class="body-2">Z+0.1</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Z+1')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">Z+1</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
<v-btn @click="doSendMove('Z+25')" cols="1" class="flex-grow-1 flex-shrink-0"><span class="body-2">Z+25</span><v-icon right class="d-none d-sm-flex">mdi-chevron-right</v-icon></v-btn>
</v-btn-toggle>
</v-row>
<v-row class="px-3 mt-3">
<v-spacer></v-spacer>
<v-btn @click="doHome" :loading="loadingHome" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon left>mdi-home</v-icon>Home all</v-btn>
<v-btn v-if="config.hasOwnProperty('quad_gantry_level')" @click="doQGL" :loading="loadingQGL" color="primary" class="ml-3">QGL</v-btn>
<v-btn @click="doRestart" :loading="loadingRestart" color="error" class="ml-3"><v-icon left>mdi-cached</v-icon>Restart</v-btn>
<v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" color="error" class="ml-3"><v-icon left>mdi-cached</v-icon>Firmware Restart</v-btn>
</v-row>
</v-col>
</v-col>
</v-row>
<v-row class="" v-if="getMacros.length > 0">
<v-col class="col-12 px-4 py-2 text-center">
<div v-for="(macro, index) in getMacros" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
<v-btn color="primary" class="mx-1 my-1" @click="doSend(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
</div>
</v-col>
</v-row>
</v-card>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import { mapState, mapGetters } from 'vuex'
import Vue from "vue";
export default {
components: {
@@ -58,67 +70,77 @@
},
data: function() {
return {
loadingHomeAll: false,
loadingHomeX: false,
loadingHomeY: false,
loadingHomeZ: false,
loadingQGL: false,
loadingZTilt: false,
}
},
computed: {
...mapState({
loadingHome: state => state.socket.loadingHome,
loadingHomeX: state => state.socket.loadingHomeX,
loadingHomeY: state => state.socket.loadingHomeY,
loadingHomeZ: state => state.socket.loadingHomeZ,
loadingQGL: state => state.socket.loadingQGL,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.config,
config: state => state.printer.configfile.config,
loadings: state => state.loadings,
printer_state: state => state.printer.print_stats.state
}),
...mapMutations([
'setLoadingHome',
'setLoadingHomeX',
'setLoadingHomeY',
'setLoadingHomeZ',
'setLoadingQGL',
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
...mapGetters([
'getMacros',
])
},
methods: {
doHome() {
this.$store.commit('setLoadingHome', true);
this.$socket.sendObj('post_printer_gcode', { script: "G28" }, "responseHome");
this.$store.commit('addGcodeResponse', "G28");
this.$store.commit('setLoading', { name: 'controlHomeAll' });
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "responseHome");
},
doHomeX() {
this.$store.commit('setLoadingHomeX', true);
this.$socket.sendObj('post_printer_gcode', { script: "G28 X" }, "responseHomeX");
this.$store.commit('addGcodeResponse', "G28 X");
this.$store.commit('setLoading', { name: 'controlHomeX' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "responseHomeX");
},
doHomeY() {
this.$store.commit('setLoadingHomeY', true);
this.$socket.sendObj('post_printer_gcode', { script: "G28 Y" }, "responseHomeY");
this.$store.commit('addGcodeResponse', "G28 Y");
this.$store.commit('setLoading', { name: 'controlHomeY' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "responseHomeY");
},
doHomeZ() {
this.$store.commit('setLoadingHomeZ', true);
this.$socket.sendObj('post_printer_gcode', { script: "G28 Z" }, "responseHomeZ");
this.$store.commit('addGcodeResponse', "G28 Z");
this.$store.commit('setLoading', { name: 'controlHomeZ' });
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "responseHomeZ");
},
doQGL() {
this.$store.commit('setLoadingQGL', true);
this.$socket.sendObj('post_printer_gcode', { script: "quad_gantry_level" }, "responseQGL");
this.$store.commit('addGcodeResponse', "QUAD_GANTRY_LEVEL");
this.$store.commit('setLoading', { name: 'controlQGL' });
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "responseQGL");
},
doSend(gcode) {
doZtilt() {
this.$store.commit('addGcodeResponse', "Z_TILT_ADJUST");
this.$store.commit('setLoading', { name: 'controlZTilt' });
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "responseZTilt");
},
doSendMove(gcode) {
gcode = "G91" + "\n" +
"G1 " + gcode + " F6000" + "\n" +
"G90";
this.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
this.doSend(gcode);
},
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
doSend(gcode) {
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "sendGcode");
},
},
watch: {
loadings: function(loadings) {
this.loadingHomeAll = loadings.includes('controlHomeAll');
this.loadingHomeX = loadings.includes('controlHomeX');
this.loadingHomeY = loadings.includes('controlHomeY');
this.loadingHomeZ = loadings.includes('controlHomeZ');
this.loadingQGL = loadings.includes('controlQGL');
this.loadingZTilt = loadings.includes('controlZTilt');
}
}
}
</script>
+87
View File
@@ -0,0 +1,87 @@
<style>
</style>
<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" no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" cols="1" :class="(amount === feedAmount ? 'v-btn--active' : '') + ' flex-grow-1'">{{ 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" no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" cols="1" :class="(feedrate === rate ? 'v-btn--active' : '') + ' flex-grow-1'">{{ rate }}</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="px-3">
<v-col class="col-12 text-center">
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!(config !== undefined && config.extruder !== null && (config.extruder.min_extrude_temp < extruder.temperature || !config.extruder.min_extrude_temp))"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!(config !== undefined && config.extruder !== null && (config.extruder.min_extrude_temp < extruder.temperature || !config.extruder.min_extrude_temp))"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
</v-col>
</v-row>
</v-card>
</template>
<script>
import { mapState, mapGetters } from 'vuex'
import Vue from "vue";
export default {
components: {
},
data: function() {
return {
feedAmount: 20,
feedrate: 5,
feedAmounts: [ 100, 50, 20, 10, 5, 1 ],
feedrates: [ 60, 30, 15, 5, 1 ],
loadingRetract: false,
loadingDetract: false,
}
},
computed: {
...mapState({
loadings: state => state.loadings,
printer_state: state => state.printer.print_stats.state,
extruder: state => state.printer.extruder,
config: state => state.printer.configfile.config
}),
...mapGetters([
'getMacros',
'getCurrentExtruder',
]),
},
methods: {
setFeedAmount(value) {
this.feedAmount = value;
},
setFeedrate(value) {
this.feedrate = value;
},
sendRetract() {
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('setLoading', { name: 'extruderRetract' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderRetract");
},
sendDetract() {
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
this.$store.commit('setLoading', { name: 'extruderDetract' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeExtruderDetract");
},
},
watch: {
loadings: function(loadings) {
this.loadingRetract = loadings.includes('extruderRetract');
this.loadingDetract = loadings.includes('extruderDetract');
},
}
}
</script>
@@ -0,0 +1,85 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey">
<v-icon dark>mdi-alert-circle</v-icon>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Klippy-Status</v-list-item-title>
<v-list-item-title class="subtitle-1">{{ state }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2" ></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col class="text-left" v-if="klippy_connected"><pre>{{ state_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>
</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 @click="doRestart" :loading="loadingRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
<v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE_Restart</v-btn>
</v-card-text>
</v-card>
</template>
<script>
import {mapMutations, mapState} from 'vuex';
export default {
computed: {
...mapState({
state: state => state.printer.webhooks.state,
state_message: state => state.printer.webhooks.state_message,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
klippy_connected: state => state.socket.klippy_connected,
}),
...mapMutations([
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
},
methods: {
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$socket.sendObj('printer.restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware");
},
},
}
</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;
}
.probe-span {
border-radius: 5px;
}
.probe-span:not(:last-child) {
margin-right: 8px;
}
</style>
-45
View File
@@ -1,45 +0,0 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Macros</v-list-item-title>
<v-list-item-subtitle>
{{ getMacros.length }} Macros
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content text-center">
<div v-for="(macro, index) in getMacros" v-bind:key="index+99" style="display: inline-block;" class="mx-1 my-1">
<v-btn color="primary" class="ml-3" @click="doSend(macro.name)">{{ macro.name }}</v-btn>
</div>
</v-card-text>
</v-card>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
components: {
},
data: function() {
return {
}
},
computed: {
...mapGetters([
'getMacros',
]),
},
methods: {
doSend(gcode) {
this.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
},
},
}
</script>
+118
View File
@@ -0,0 +1,118 @@
<style>
.minievent-table {
max-height: 250px;
overflow-y: auto;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-console-line</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Console</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="mt-2"></v-divider>
<v-card-text class="px-0 py-0 content">
<v-data-table
:headers="headers"
:options="options"
:items="events"
item-key="date"
hide-default-footer
hide-default-header
disable-pagination
class="minievent-table"
:custom-sort="customSort"
sort-by="date"
>
<template #no-data>
<div class="text-center">empty</div>
</template>
<template #item="{ item }">
<tr>
<td class="log-cell title-cell pr-1 py-2">
<small>{{ formatTime(item.date)}}</small>
</td>
<td class="log-cell content-cell pl-1 py-2" colspan="2">
<span v-if="item.message" class="message" v-html="formatMessage(item.message)"></span>
</td>
</tr>
</template>
</v-data-table>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
data: function() {
return {
headers: [
{
text: 'Date',
value: 'date',
width: '15%',
dateType: 'Date',
},
{
text: 'Event',
sortable: false,
value: 'message',
width: '85%'
},
],
options: {
},
}
},
computed: {
...mapState({
events: state => state.events,
})
},
methods: {
formatTime(date) {
let hours = date.getHours();
if (hours < 10) hours = "0"+hours.toString();
let minutes = date.getMinutes();
if (minutes < 10) minutes = "0"+minutes.toString();
let seconds = date.getSeconds();
if (seconds < 10) seconds = "0"+seconds.toString();
return hours+":"+minutes+":"+seconds;
},
formatMessage(message) {
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
return message;
},
customSort: function(items, index, isDesc) {
items.sort((a, b) => {
if (index[0] === 'date') {
if (!isDesc[0]) return new Date(b[index]) - new Date(a[index]);
else return new Date(a[index]) - new Date(b[index]);
} else {
if(typeof a[index] !== 'undefined'){
if (!isDesc[0]) return a[index].toLowerCase().localeCompare(b[index].toLowerCase());
else return b[index].toLowerCase().localeCompare(a[index].toLowerCase());
}
}
});
return items;
}
}
}
</script>
+23 -24
View File
@@ -10,44 +10,43 @@
from {
transform: rotate(0deg);
} to {
transform: rotate(360deg);
transform: rotate(-360deg);
}
}
</style>
<template>
<div>
<v-card class="mt-4" v-if="bool_fan">
<v-card v-if="fan">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon :class="fan_speed > 0 ? 'mdi mdi-fan icon-rotate' : 'mdi mdi-fan'" left></v-icon>Tool Fan</span>
<span class="subheading"><v-icon :class="fan.speed > 0 ? 'mdi mdi-fan icon-rotate' : 'mdi mdi-fan'" left></v-icon>Tool Fan</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pb-0">
<tool-slider :target="fan_speed" :multi="100" command="M106" attribute-name="S" :attribute-scale="2.55" ></tool-slider>
<v-card-text class="py-2">
<tool-slider :target="fan.speed" :multi="100" command="M106" attribute-name="S" :attribute-scale="2.55" ></tool-slider>
</v-card-text>
</v-card>
<v-card class="mt-4" v-if="is_printing">
<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-timer" left></v-icon>Speed Factor</span>
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pb-0">
<tool-slider :target="speed_factor" :max="200" :multi="100" command="M220" attribute-name="S" ></tool-slider>
</v-card-text>
</v-card>
<v-card class="mt-4" v-if="is_printing">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-texture" left></v-icon>Extrusion Factor</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="py-2">
<v-row>
<v-col class="py-0">
<tool-slider prependIcon="mdi-timer" :target="speed_factor" :max="200" :multi="100" command="M220" attribute-name="S" ></tool-slider>
</v-col>
</v-row>
<v-row>
<v-col class="py-0">
<tool-slider prependIcon="mdi-texture" :target="extrude_factor" :max="200" :multi="100" command="M221" attribute-name="S" ></tool-slider>
</v-col>
</v-row>
<v-card-text class="pb-0">
<tool-slider :target="extrude_factor" :max="200" :multi="100" command="M221" attribute-name="S" ></tool-slider>
</v-card-text>
</v-card>
</div>
@@ -68,12 +67,12 @@
},
computed: {
...mapState({
fan_speed: state => state.printer.fan.speed,
extrude_factor: state => state.printer.gcode.extrude_factor,
speed_factor: state => state.printer.gcode.speed_factor,
extrude_factor: state => state.printer.gcode_move.extrude_factor,
speed_factor: state => state.printer.gcode_move.speed_factor,
printer_state: state => state.printer.print_stats.state,
}),
...mapGetters([
'bool_fan',
'fan',
'is_printing'
])
},
@@ -87,4 +86,4 @@
}
}
</script>
</script>
@@ -0,0 +1,61 @@
<style>
</style>
<template>
<div>
<v-card>
<v-toolbar flat dense>
<v-toolbar-title>
<span class="subheading">
<v-icon class="mdi mdi-power" left></v-icon>Power Control
</span>
</v-toolbar-title>
</v-toolbar>
<v-card-text class="pb-0">
<div v-for="(device, index) in devices" v-bind:key="index">
<v-divider class="my-2" v-if="index > 0"></v-divider>
<v-row class="pl-2 pr-2 pb-2">
<v-col class="col-auto py-0 vertical_align_center col-6">{{ device.name }}</v-col>
<v-col class="col-auto py-0 vertical_align_center col-6">
<v-btn
:disabled="device.status === 1"
v-on="device.status === 0 ? { click: () => setPower(index,1) } : {}"
>On</v-btn>
<v-btn
:disabled="device.status === 0"
v-on="device.status === 1 ? { click: () => setPower(index,0) } : {}"
>Off</v-btn>
</v-col>
</v-row>
</div>
</v-card-text>
</v-card>
</div>
</template>
<script>
import { mapState } from "vuex";
import Vue from "vue";
export default {
components: {},
computed: {
...mapState({
devices: (state) => state.power.devices,
}),
},
methods: {
setPower(index, value) {
let rpc = value === 1 ? "machine.gpio_power.on" : "machine.gpio_power.off";
let deviceId = this.devices[index].id;
Vue.prototype.$socket.sendObj(
rpc,
{ [deviceId]: "" },
"responsePowerToggle"
);
},
},
};
</script>
@@ -0,0 +1,459 @@
<style>
.my-editor {
background: #2d2d2d;
color: #ccc;
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
font-size: 14px;
line-height: 1.5;
padding: 5px;
}
.prism-editor__textarea:focus {
outline: none;
}
.config-editor-overlay div.v-card {
position: relative;
}
.config-editor-overlay div.v-card header {
position: sticky;
top: 0;
width: 100%;
z-index: 1;
}
</style>
<template>
<div>
<v-card>
<v-card-title>
Config Files
<v-spacer></v-spacer>
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn color="primary ml-4" :loading="loadingConfigRefresh" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
</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="countPerPage"
item-key="name">
<template #no-data>
<div class="text-center">empty</div>
</template>
<template v-slot:body.prepend>
<tr
v-if="(currentPath !== '')"
class="file-list-cursor"
@click="clickRowGoBack">
<td class=" "><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=" ">
<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>
</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 @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>
</div>
</template>
<script>
import { mapState } from 'vuex'
import {findDirectory} from "@/plugins/helpers";
import { PrismEditor } from 'vue-prism-editor';
import 'vue-prism-editor/dist/prismeditor.min.css'; // import the styles somewhere
// import highlighting library (you can use any library you want just return html string)
import { highlight, languages } from 'prismjs/components/prism-core';
import 'prismjs/components/prism-editorconfig';
import 'prismjs/components/prism-ini';
import 'prismjs/themes/prism-okaidia.css';
import axios from "axios"; // import syntax highlighting styles
export default {
components: {
PrismEditor,
},
data: function() {
return {
sortBy: 'filename',
sortDesc: false,
selected: [],
headers: [
{ text: '', value: '', },
{ text: 'Name', value: 'filename', },
{ text: 'Filesize', value: 'size', align: 'right', },
{ text: 'Last modified', value: 'modified', align: 'right', },
],
options: {
},
currentPage: 1,
files: [],
currentPath: '',
loadingConfigRefresh: false,
editor: {
show: false,
showLoader: false,
readonly: false,
item: {
filename: "",
},
sourcecode: ''
},
contextMenu: {
shown: false,
isDirectory: false,
touchTimer: undefined,
x: 0,
y: 0,
item: {}
},
dialogRenameFile: {
show: false,
newName: "",
item: {}
},
dialogCreateFile: {
show: false,
name: "",
},
dialogCreateFolder: {
show: false,
name: "",
},
}
},
computed: {
...mapState({
config_examples: state => state.filetree.config_examples,
config: state => state.filetree.config,
filetree: state => state.filetree,
countPerPage: state => state.gui.settings.configfiles.countPerPage,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
})
},
created() {
this.loadPath();
},
methods: {
highlighter(code) {
//return highlight(code, languages.editorconfig); //returns html
return highlight(code, languages.ini); //returns html
},
refreshFileList: function() {
window.console.log(this.currentPath.substring(1));
this.$store.commit('setLoading', { name: 'loadingConfigRefresh' });
if (this.currentPath === "") {
this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'getDirectory');
this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'getDirectory');
} else this.$socket.sendObj('server.files.get_directory', { path: this.currentPath.substring(1) }, 'getDirectory');
},
formatDate(date) {
let tmp2 = new Date(date);
return tmp2.toLocaleString().replace(',', '');
},
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];
},
sortFiles(items, sortBy, sortDesc) {
sortBy = sortBy.length ? sortBy[0] : 'filename';
sortDesc = sortDesc[0];
if (items !== undefined) {
// Sort by index
items.sort(function(a, b) {
if (a[sortBy] === b[sortBy]) {
return 0;
}
if (a[sortBy] === null || a[sortBy] === undefined) {
return -1;
}
if (b[sortBy] === null || b[sortBy] === undefined) {
return 1;
}
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
}
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
return reducedA - reducedB;
}
return a[sortBy] - b[sortBy];
});
// Deal with descending order
if (sortDesc) items.reverse();
// Then make sure directories come first
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
}
return items;
},
loadPath: function() {
let dirArray = this.currentPath.substring(1).split("/");
this.files = findDirectory(this.filetree, dirArray);
if (dirArray.length === 1 && this.currentPath === "") {
this.files = this.files.filter(element => element.filename !== "gcodes");
}
},
clickRow: function(item) {
if (!item.isDirectory) {
this.editor.showLoader = true;
this.editor.sourcecode = "";
this.editor.item = item;
let url = '//'+this.hostname+':'+this.port+'/server/files'+this.currentPath+'/'+item.filename+'?time='+Date.now();
fetch(url, { cache: "no-cache" }).then(res => res.text()).then(file => {
this.editor.sourcecode = file;
this.editor.show = true;
this.editor.showLoader = false;
this.editor.readonly = false;
if (this.currentPath === '/config_examples') this.editor.readonly = true;
});
} else {
this.currentPath += "/"+item.filename;
this.currentPage = 1;
}
},
clickRowGoBack: function() {
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
},
saveFile: function() {
let file = new File([this.editor.sourcecode], this.editor.item.filename);
let formData = new FormData();
formData.append('file', file);
formData.append('root', 'config');
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
this.$toast.success("File '"+this.editor.item.filename+"' successfully saved.");
this.editor.show = false;
this.editor.sourcecode = "";
}).catch(() => {
this.$toast.error("Error save "+this.editor.item.filename);
});
},
showContextMenu (e, item) {
e.preventDefault();
this.contextMenu.shown = true;
this.contextMenu.x = e.clientX;
this.contextMenu.y = e.clientY;
this.contextMenu.item = item;
this.$nextTick(() => {
this.contextMenu.shown = true
});
},
downloadFile() {
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;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
createFolder() {
this.dialogCreateFolder.name = "";
this.dialogCreateFolder.show = true;
},
createFolderAction() {
this.dialogCreateFolder.show = false;
this.$socket.sendObj('server.files.post_directory', {
path: this.currentPath.substring(1)+"/"+this.dialogCreateFolder.name
}, 'getPostDirectory');
},
createFile() {
this.dialogCreateFile.name = "";
this.dialogCreateFile.show = true;
},
createFileAction() {
let file = new File([""], this.dialogCreateFile.name);
let formData = new FormData();
formData.append('file', file);
formData.append('root', 'config');
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
this.dialogCreateFile.show = false;
this.dialogCreateFile.name = "";
}).catch(() => {
window.console.error("Error save "+this.editor.item.filename);
});
},
renameFile(item) {
this.dialogRenameFile.item = item;
this.dialogRenameFile.newName = item.filename;
this.dialogRenameFile.show = true;
},
renameFileAction() {
this.dialogRenameFile.show = false;
this.$socket.sendObj('server.files.move', {
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
dest: this.currentPath+"/"+this.dialogRenameFile.newName
}, 'getPostFileMove');
},
removeFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
axios.delete(
'//'+ this.hostname + ':' + this.port +'/server/files/'+filename
).then((result) => {
this.$toast.success(result.data.result+" successfully deleted.");
}).catch(() => {
this.$toast.error("Error! Cannot delete file.");
});
},
deleteDirectoryAction: function() {
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
},
},
watch: {
config: {
deep: true,
handler() {
this.loadPath();
}
},
config_examples: {
deep: true,
handler() {
this.loadPath();
}
},
currentPath: {
handler() {
this.loadPath();
}
},
}
}
</script>
@@ -0,0 +1,76 @@
<style>
.settings_dashboard_switch .v-messages {
display: none;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-view-dashboard</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Dashboard</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-3 content">
<v-row>
<v-col class="px-10 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="px-10 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="px-10 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-card>
</template>
<script>
export default {
components: {
},
data: function() {
return {
}
},
computed: {
boolShowWebcamOnDashboard: {
get() {
return this.$store.state.gui.dashboard.boolWebcam;
},
set(status) {
return this.$store.dispatch('setSettings', { gui: { dashboard: { boolWebcam: status } } });
}
},
boolShowTempchartOnDashboard: {
get() {
return this.$store.state.gui.dashboard.boolTempchart;
},
set(status) {
return this.$store.dispatch('setSettings', { gui: { dashboard: { boolTempchart: status } } });
}
},
boolShowConsoleOnDashboard: {
get() {
return this.$store.state.gui.dashboard.boolConsole;
},
set(status) {
return this.$store.dispatch('setSettings', { gui: { dashboard: { boolConsole: status } } });
}
},
},
methods: {
}
}
</script>
@@ -0,0 +1,79 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-arrow-expand-vertical</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Endstops</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<div v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-row class="px-6" >
<v-col sm-12>
<label class="mt-1 d-inline-block">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 class="px-6" v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
<v-col sm-12>
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn icon @click="syncEndstops" :loading="loading">
<v-icon>mdi-sync</v-icon>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
data: function() {
return {
sortEndstops: {}
}
},
computed: {
...mapState({
loading: state => state.socket.loadingEndstopStatus,
endstops: state => state.printer.endstops,
})
},
created() {
this.getEndstops();
},
methods: {
syncEndstops() {
this.$store.commit('setLoadingEndstopStatus', true);
this.$socket.sendObj('printer.query_endstops.status', { }, "responseEndstopStatus");
},
getEndstops() {
this.sortEndstops = {};
let keys = Object.keys(this.endstops);
keys.sort();
for (let i = 0; i < keys.length; i++) {
let k = keys[i];
this.sortEndstops[k] = this.endstops[k];
}
}
},
watch: {
endstops: function() {
this.getEndstops();
}
}
}
</script>
@@ -0,0 +1,53 @@
<style>
.webcamImage {
width: 100%;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-cog</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">General</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pb-0 pt-3 content">
<v-row>
<v-col class="px-10 py-0">
<v-text-field
v-model="printerName"
label="Printer Name"
></v-text-field>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
export default {
components: {
},
data: function() {
return {
}
},
computed: {
printerName: {
get() {
return this.$store.state.gui.general.printername;
},
set(newName) {
return this.$store.dispatch('setSettings', { gui: { general: { printername: newName } } });
}
},
},
methods: {
}
}
</script>
@@ -0,0 +1,62 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-exclamation-thick</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Machine Limits</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-row class="px-6" >
<v-col sm-12>
<toolSlider label="VELOCITY" v-bind:target="current_velocity" v-bind:max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></toolSlider>
<toolSlider label="ACCEL" v-bind:target="current_accel" v-bind:max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></toolSlider>
<toolSlider label="DECEL" v-bind:target="current_accel_to_decel" v-bind:max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></toolSlider>
<toolSlider label="SCV" v-bind:target="current_square_corner_velocity" v-bind:max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></toolSlider>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
import toolSlider from '../../../inputs/ToolSlider'
export default {
components: {
toolSlider
},
data: function() {
return {
max_velocity: 200,
max_accel: 5000,
max_accel_to_decel: 2500,
max_square_corner_velocity: 10,
}
},
computed: {
...mapState({
current_velocity: state => state.printer.toolhead.max_velocity,
current_accel: state => state.printer.toolhead.max_accel,
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
config: state => state.printer.configfile.config,
})
},
methods: {
},
watch: {
config: function(value) {
if (value.printer) {
this.max_velocity = parseInt(value.printer.max_velocity);
this.max_accel = parseInt(value.printer.max_accel);
this.max_accel_to_decel = parseInt(value.printer.max_accel_to_decel) || this.max_accel / 2;
this.max_square_corner_velocity = parseInt(value.printer.square_corner_velocity);
}
}
}
}
</script>
@@ -0,0 +1,49 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-code-tags</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Macros</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pb-3 pt-3 content">
<div v-for="(macro, index) in getAllMacros" v-bind:key="index">
<v-row>
<v-col class="px-10 py-0">
<settings-macro-switch :name="macro.name"></settings-macro-switch>
</v-col>
</v-row>
</div>
</v-card-text>
</v-card>
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import SettingsMacroSwitch from "../../../inputs/SettingsMacroSwitch";
export default {
components: {
SettingsMacroSwitch
},
data: function() {
return {
}
},
computed: {
...mapState({
hiddenMacros: state => state.gui.dashboard.hiddenMacros,
}),
...mapGetters([
'getAllMacros',
])
},
methods: {
}
}
</script>
@@ -0,0 +1,42 @@
<template>
<div>
<div v-for="(runout, index) of getFilamentSwitchSensors" v-bind:key="index">
<v-card class="mt-6">
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-printer-3d-nozzle-alert</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">{{ runout.name }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<settings-runout-switch :name="runout.name "></settings-runout-switch>
</v-card-text>
</v-card>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import SettingsRunoutSwitch from "../../../inputs/SettingsRunoutSwitch";
export default {
components: {
SettingsRunoutSwitch
},
data: function() {
return {
}
},
computed: {
...mapGetters([
'getFilamentSwitchSensors'
])
},
methods: {
}
}
</script>
@@ -0,0 +1,78 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-cpu-64-bit</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">System</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class=" text-center text-lg-left">
<div><v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper Log</v-btn></div>
<div><v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="mt-3 primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker Log</v-btn></div>
<div><v-btn @click="doRestart" block :loading="loadingRestart" color="error" class="mt-3"><v-icon class="mr-2">mdi-cached</v-icon>Restart</v-btn></div>
<div><v-btn @click="doRestartFirmware" block :loading="loadingRestartFirmware" class="mt-3" color="error"><v-icon class="mr-2">mdi-cached</v-icon>FW <span class="d-none d-sm-block">Restart</span></v-btn></div>
<div><v-btn @click="doRebootHost" block :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-2">mdi-cached</v-icon><span class="d-none d-sm-block">Host</span> Reboot</v-btn></div>
<div><v-btn @click="doShutdownHost" block :loading="loadingShutdownHost" class="mt-3" color="error"><v-icon class="mr-2">mdi-power</v-icon><span class="d-none d-sm-block">Host</span> Shutdown</v-btn></div>
</v-card-text>
</v-card>
</template>
<script>
import {mapMutations, mapState} from 'vuex'
export default {
components: {
},
data: function() {
return {
}
},
computed: {
...mapState({
hostname: state => state.socket.hostname,
port: state => state.socket.port,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
loadingRebootHost: state => state.socket.loadingRebootHost,
loadingShutdownHost: state => state.socket.loadingShutdownHost,
}),
...mapMutations([
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
},
methods: {
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$store.commit('setPrinterData', {
webhooks: {
state: 'shutdown',
state_message: 'RESTART'
}
});
this.$socket.sendObj('printer.restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$store.commit('setPrinterData', {
webhooks: {
state: 'shutdown',
state_message: 'FIRMWARE RESTART'
}
});
this.$socket.sendObj('printer.firmware_restart', { }, "responseRestartFirmware");
},
doRebootHost() {
this.$store.commit('setLoadingRebootHost', true);
this.$socket.sendObj('machine.reboot', { });
},
doShutdownHost() {
this.$store.commit('setLoadingShutdownHost', true);
this.$socket.sendObj('machine.shutdown', { });
},
}
}
</script>
@@ -0,0 +1,105 @@
<style>
.content { overflow: hidden; }
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-webcam</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Webcam</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-3 content">
<v-row>
<v-col class="px-10 py-0">
<v-text-field
v-model="webcamUrl"
hide-details
label="Webcam URL"
></v-text-field>
<v-row v-if="rotationEnabled">
<v-col sm="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-switch v-model="flipX" hide-details label="Flip webcam horizontally"></v-switch>
<v-switch v-model="flipY" hide-details label="Flip webcam vertically"></v-switch>
<v-switch v-model="boolNavi" hide-details label="Show in navigation"></v-switch>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
export default {
components: {
},
data: function() {
return {
rotationEnabled: false
}
},
computed: {
webcamUrl: {
get() {
return this.$store.state.gui.webcam.url;
},
set(url) {
return this.$store.dispatch('setSettings', { gui: { webcam: { url } } });
}
},
flipX: {
get() {
return this.$store.state.gui.webcam.flipX;
},
set(flipX) {
return this.$store.dispatch('setSettings', { gui: { webcam: { flipX } } });
}
},
flipY: {
get() {
return this.$store.state.gui.webcam.flipY;
},
set(flipY) {
return this.$store.dispatch('setSettings', { gui: { webcam: { flipY } } });
}
},
rotate: {
get() {
return this.$store.state.gui.webcam.rotate;
},
set(rotate) {
return this.$store.dispatch('setSettings', { gui: { webcam: { rotate } } });
}
},
rotateDegrees: {
get() {
return this.$store.state.gui.webcam.rotateDegrees;
},
set(rotateDegrees) {
return this.$store.dispatch('setSettings', { gui: { webcam: { rotateDegrees } } });
}
},
boolNavi: {
get() {
return this.$store.state.gui.webcam.bool;
},
set(showNav) {
return this.$store.dispatch('setSettings', { gui: { webcam: { bool: showNav } } });
}
},
},
methods: {
}
}
</script>
+25
View File
@@ -0,0 +1,25 @@
import Vue from 'vue'
import GeneralPanel from './GeneralPanel'
import WebcamPanel from './WebcamPanel'
import DashboardPanel from "./DashboardPanel";
import MacrosPanel from "./MacrosPanel";
import EndstopPanel from "./EndstopPanel";
import LimitsPanel from "./LimitsPanel";
import ConfigFilesPanel from "./ConfigFilesPanel";
import RunoutPanel from "./RunoutPanel";
import SystemPanel from "./SystemPanel";
Vue.component('settings-general-panel', GeneralPanel);
Vue.component('settings-webcam-panel', WebcamPanel);
Vue.component('settings-dashboard-panel', DashboardPanel);
Vue.component('settings-macros-panel', MacrosPanel);
Vue.component('settings-endstop-panel', EndstopPanel);
Vue.component('settings-limits-panel', LimitsPanel);
Vue.component('settings-runout-panel', RunoutPanel);
Vue.component('settings-system-panel', SystemPanel);
Vue.component('settings-config-files-panel', ConfigFilesPanel);
export default {
}
+178 -111
View File
@@ -1,100 +1,141 @@
<style>
.vertical_align_center {
margin: auto 0;
}
.statusPanel-image-preview {
width: 100%;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-info</v-icon></v-list-item-avatar>
<v-progress-circular
:rotate="-90"
:size="50"
:width="7"
:value="printProgress * 100"
color="red"
class="mr-5 mt-2"
v-if="['printing', 'paused', 'error'].includes(printer_state)"
>
</v-progress-circular>
<v-list-item-avatar color="grey" v-if="!['printing', 'paused', 'error'].includes(printer_state)"><v-icon dark>mdi-information-variant</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Status</v-list-item-title>
<v-list-item-subtitle>{{ printer_state }}{{ printer_is_printing ? " - "+current_file : "" }}</v-list-item-subtitle>
<v-list-item-title class="headline">{{ ['printing', 'paused', 'error'].includes(printer_state) ? Math.round(printProgress * 100)+"% - " : "" }}{{ display_message ? display_message : (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown") }}</v-list-item-title>
<v-list-item-subtitle class="mr-3" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)">{{ "File: "+current_file }}</v-list-item-subtitle>
</v-list-item-content>
<v-btn class="orange" v-if="printer_state === 'Printing' && printer_is_printing" @click="btnPauseJob" :loading="btnStatusPause">pause job</v-btn>
<v-btn class="red" v-if="(is_printing && printer_is_paused)" :loading="btnStatusCancel" @click="btnCancelJob">cancel job</v-btn>
<v-btn class="orange ml-2" v-if="(is_printing && printer_is_paused)" :loading="btnStatusResume" @click="btnResumeJob">resume job</v-btn>
<v-btn-toggle
color="primary"
dense
multiple
>
<v-btn class="button-min-width-auto orange px-2" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadingStatusPause" title="Pause print"><v-icon>mdi-pause</v-icon></v-btn>
<v-btn class="button-min-width-auto red" v-if="(printer_state === 'paused')" :loading="loadingStatusCancel" @click="btnCancelJob" title="Cancel print"><v-icon>mdi-stop</v-icon></v-btn>
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'paused')" :loading="loadingStatusResume" @click="btnResumeJob" title="Resume job"><v-icon>mdi-play</v-icon></v-btn>
<v-btn class="button-min-width-auto orange" v-if="(printer_state === 'error')" :loading="loadingStatusClear" @click="btnClearJob" title="Clear job"><v-icon>mdi-close</v-icon></v-btn>
<v-btn class="button-min-width-auto primary" v-if="(printer_state === 'complete')" :loading="loadingStatusReprint" @click="btnReprintJob" title="Reprint job"><v-icon>mdi-autorenew</v-icon></v-btn>
</v-btn-toggle>
</v-list-item>
<v-divider class="my-2" ></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<v-layout wrap class=" text-center">
<v-flex col tag="strong" class="category-header">
Position
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">X</v-flex>
<v-flex tag="span">{{ position.length ? position[0].toFixed(2) : "--" }}</v-flex>
<v-row>
<v-col
class="col-12 col-sm-4 pl-sm-5 pr-sm-2"
v-if="
['printing', 'paused', 'complete'].includes(printer_state) &&
current_file_metadata &&
current_file_metadata.thumbnails &&
current_file_metadata.thumbnails.length &&
current_file_metadata.thumbnails.find(element => element.width === 400)
">
<img
class="statusPanel-image-preview"
:src="'data:image/gif;base64,'+(current_file_metadata.thumbnails ? current_file_metadata.thumbnails.find(element => element.width === 400).data : '')"
/>
</v-col>
<v-col
:class="
(['printing', 'paused', 'complete'].includes(printer_state) &&
current_file_metadata &&
current_file_metadata.thumbnails &&
current_file_metadata.thumbnails.length &&
current_file_metadata.thumbnails.find(element => element.width === 400)) ? 'col-12 py-0 col-sm-8 pl-sm-0' : 'col-12 py-0'
">
<v-layout wrap class=" text-center">
<v-flex col tag="strong" class="category-header col-auto">
<v-icon>mdi-axis-arrow</v-icon>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">X</v-flex>
<v-flex tag="span">{{ position.length ? position[0].toFixed(2) : "--" }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Y</v-flex>
<v-flex tag="span">{{ position.length ? position[1].toFixed(2) : "--" }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Z</v-flex>
<v-flex tag="span">{{ position.length ? position[2].toFixed(2) : "--" }}</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Y</v-flex>
<v-flex tag="span">{{ position.length ? position[1].toFixed(2) : "--" }}</v-flex>
<v-divider class="my-2" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)"></v-divider>
<v-layout wrap class=" text-center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)">
<v-flex col tag="strong" class="category-header col-auto">
<v-icon>mdi-poll</v-icon>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Filament used</v-flex>
<v-flex tag="span">{{ filament_used > 1000 ? (filament_used / 1000).toFixed(2)+"m" : filament_used.toFixed(2)+"mm" }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Print Time</v-flex>
<v-flex tag="span">{{ formatTime(print_time) }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Total Time</v-flex>
<v-flex tag="span">{{ formatTime(print_time_total) }}</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Z</v-flex>
<v-flex tag="span">{{ position.length ? position[2].toFixed(2) : "--" }}</v-flex>
<v-divider class="my-2" v-if="['printing', 'paused', 'error'].includes(printer_state)"></v-divider>
<v-layout wrap class=" text-center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
<v-flex col tag="strong" class="category-header col-auto">
<v-icon>mdi-clock-outline</v-icon>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">File</v-flex>
<v-flex tag="span">{{ print_time > 0 && printProgress > 0 ? formatTime(print_time / printProgress - print_time) : '--' }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Filament</v-flex>
<v-flex tag="span">{{ (filament_used > 0 && current_file_filament_total > filament_used) ? formatTime(print_time / (filament_used / current_file_filament_total) - print_time) : '--' }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Slicer</v-flex>
<v-flex tag="span">{{ current_file_estimated_time > print_time ? formatTime(current_file_estimated_time - print_time) : '--'}}</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-divider class="my-2" v-if="is_printing"></v-divider>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-flex col tag="strong" class="category-header">
Printstatus
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Filament used</v-flex>
<v-flex tag="span">{{ filament_used.toFixed(2) }}mm</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Print Time</v-flex>
<v-flex tag="span">{{ formatTime(print_time) }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Total Time</v-flex>
<v-flex tag="span">{{ formatTime(print_time_total) }}</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-divider class="my-2" v-if="is_printing"></v-divider>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-flex col tag="strong" class="category-header py-0">
Estimations<br />based on
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Time</v-flex>
<v-flex tag="span">{{ print_time > 0 && printProgress > 0 ? formatTime(print_time / printProgress - print_time) : '--' }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">File Progress</v-flex>
<v-flex tag="span">{{ print_time > 0 && file_position > 0 ? formatTime(print_time / (file_position / current_file_size) - print_time) : '--' }}</v-flex>
</v-layout>
</v-flex>
<v-flex grow class="equal-width">
<v-layout column>
<v-flex tag="strong">Slicer</v-flex>
<v-flex tag="span"><i>coming soon</i></v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-layout column class="mt-2" >
<v-progress-linear
:value="printProgress * 100"
height="25"
>
<template>
<strong>{{ Math.ceil(printProgress * 100) }}%</strong>
</template>
</v-progress-linear>
</v-layout>
</v-layout>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
@@ -103,57 +144,83 @@
import { mapState, mapGetters } from 'vuex';
export default {
data: () => ({
}),
data: function() {
return {
loadingStatusCancel: false,
loadingStatusResume: false,
loadingStatusPause: false,
loadingStatusClear: false,
loadingStatusReprint: false,
}
},
computed: {
...mapState({
toolhead: state => state.printer.toolhead,
position: state => state.printer.toolhead.position,
btnStatusPause: state => state.socket.loadingPrintPause,
btnStatusResume: state => state.socket.loadingPrintResume,
btnStatusCancel: state => state.socket.loadingPrintCancel,
loadings: state => state.loadings,
estimated_print_time: state => state.printer.toolhead.estimated_print_time,
printProgress: state => state.printer.virtual_sdcard.progress,
print_time: state => state.printer.virtual_sdcard.print_duration,
print_time_total: state => state.printer.virtual_sdcard.total_duration,
filament_used: state => state.printer.virtual_sdcard.filament_used,
file_position: state => state.printer.virtual_sdcard.file_position,
current_file: state => state.printer.virtual_sdcard.current_file,
printer_state: state => state.printer.idle_timeout.state,
printer_is_paused: state => state.printer.pause_resume.is_paused,
printer_is_printing: state => state.printer.virtual_sdcard.is_active,
print_time: state => state.printer.print_stats.print_duration,
print_time_total: state => state.printer.print_stats.total_duration,
filament_used: state => state.printer.print_stats.filament_used,
current_file: state => state.printer.print_stats.filename,
printer_state: state => state.printer.print_stats.state,
klippy_state: state => state.printer.webhooks.state,
klippy_state_message: state => state.printer.webhooks.state_message,
display_message: state => state.printer.display_status.message,
}),
...mapGetters([
'current_file_size',
'current_file_metadata',
'is_printing',
'current_file_estimated_time',
'current_file_filament_total',
]),
},
methods: {
btnPauseJob() {
this.$store.commit('setLoadingPrintPause', true);
this.$socket.sendObj('post_printer_print_pause', { }, 'setLoadingPrintPause');
this.$store.commit('setLoading', { name: 'statusPrintPause' });
this.$socket.sendObj('printer.print.pause', { }, 'respondPrintPause');
},
btnResumeJob() {
this.$store.commit('setLoadingPrintResume', true);
this.$socket.sendObj('post_printer_print_resume', { }, 'setLoadingPrintResume');
this.$store.commit('setLoading', { name: 'statusPrintResume' });
this.$socket.sendObj('printer.print.resume', { }, 'respondPrintResume');
},
btnCancelJob() {
this.$store.commit('setLoadingPrintCancel', true);
this.$socket.sendObj('post_printer_print_cancel', { }, 'setLoadingPrintCancel');
this.$store.commit('setLoading', { name: 'statusPrintCancel' });
this.$socket.sendObj('printer.print.cancel', { }, 'respondPrintCancel');
},
btnClearJob() {
this.$store.commit('setLoading', {name: 'statusPrintClear'});
this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear');
},
btnReprintJob() {
this.$store.commit('setLoading', {name: 'statusPrintReprint'});
this.$socket.sendObj('printer.print.start', { filename: this.current_file }, 'respondPrintReprint');
},
formatTime(seconds) {
let date = new Date(null);
date.setSeconds(seconds);
let h = Math.floor(seconds / 3600);
seconds %= 3600;
let m = ("0" + Math.floor(seconds / 60)).slice(-2);
let s = ("0" + (seconds % 60).toFixed(0)).slice(-2);
return date.toISOString().substr(11,8);
return h+':'+m+':'+s;
},
},
watch: {
loadings: function(loadings) {
this.loadingStatusCancel = loadings.includes('statusPrintCancel');
this.loadingStatusResume = loadings.includes('statusPrintResume');
this.loadingStatusPause = loadings.includes('statusPrintPause');
this.loadingStatusClear = loadings.includes('statusPrintClear');
this.loadingStatusReprint = loadings.includes('statusPrintReprint');
}
}
}
</script>
@@ -182,4 +249,4 @@
.probe-span:not(:last-child) {
margin-right: 8px;
}
</style>
</style>
-72
View File
@@ -1,72 +0,0 @@
<style>
#line-chart {
height: 250px;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Temperature Chart</v-list-item-title>
<v-list-item-subtitle>
<span>{{ heatersCount }} heaters</span>
<span v-if="temperature_fans.length === 1">, {{ temperature_fans.length }} fan</span>
<span v-if="temperature_fans.length > 1">, {{ temperature_fans.length }} fans</span>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="pt-0 pb-2 content">
<line-chart :chart-data="chartdata" v-if="loaded"></line-chart>
</v-card-text>
</v-card>
</template>
<script>
import LineChart from '../../charts/LineChart.js'
import { mapGetters, mapState } from 'vuex'
export default {
components: {
LineChart
},
data () {
return {
loaded: false,
chartdata: {
labels: [],
datasets: []
}
}
},
computed: {
...mapState({
labels: state => state.temperaturChart.labels,
datasets: state => state.temperaturChart.datasets,
}),
...mapGetters([
'heatersCount',
'temperature_fans'
])
},
methods: {
fillData () {
this.loaded = true;
this.chartdata = {
labels: this.labels,
datasets: this.datasets
}
}
},
mounted () {
this.fillData();
},
watch: {
labels() {
this.fillData();
}
}
}
</script>
+57 -11
View File
@@ -2,18 +2,24 @@
.heater-row .vertical_align_center {
margin: auto 0;
}
#line-chart {
height: 250px;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
<v-list-item-avatar color="grey"><v-icon dark>mdi-thermometer</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Heaters</v-list-item-title>
<v-list-item-title class="headline">Temperatures</v-list-item-title>
<v-list-item-subtitle>
{{ heatersCount }} heaters
<span v-if="temperature_fans.length === 1">, {{ temperature_fans.length }} fan</span>
<span v-if="temperature_fans.length > 1">, {{ temperature_fans.length }} fans</span>
<span v-if="temperature_sensors.length === 1">, {{ temperature_sensors.length }} sensor</span>
<span v-if="temperature_sensors.length > 1">, {{ temperature_sensors.length }} sensors</span>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
@@ -31,9 +37,9 @@
<b>{{ heater.name }}</b><br />
<small>{{ heater.target > 0 ? "active" : "off" }}</small>
</v-col>
<v-col class="text-center py-0 vertical_align_center"><span>{{ heater.temperature.toFixed(1) }}°C</span></v-col>
<v-col class="text-center py-0 vertical_align_center"><span>{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</span></v-col>
<v-col class="text-center py-0 vertical_align_center">
<toolInput :name="heater.name" :target="heater.target" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
<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>
@@ -44,39 +50,79 @@
<b>{{ fan.name }}</b><br />
<small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small>
</v-col>
<v-col class="text-center py-0 vertical_align_center"><span>{{ fan.temperature.toFixed(1) }}°C</span></v-col>
<v-col class="text-center py-0 vertical_align_center"><span>{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span></v-col>
<v-col class="text-center py-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-if="temperature_sensors.length" >
<v-divider class="my-2"></v-divider>
<v-row class="pl-3 pr-3 heater-row">
<v-col class="text-center py-0">
<b>Temperature<br />Sensors</b>
</v-col>
<v-col class="text-center py-0 vertical_align_center" v-for="(sensor,index) in temperature_sensors" v-bind:key="index+999" >
<span style="cursor: default;" :title="'min: '+(sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0)+'° / max: '+(sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0)+'°'">{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span><br />
<small style="cursor: default;" :title="'min: '+( sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0)+'° / max: '+(sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0)+'°'">{{ sensor.name }}</small>
</v-col>
</v-row>
</div>
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
<v-row v-if="boolTempchart">
<v-col>
<line-chart :chart-data="chartdata" v-if="loaded"></line-chart>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters, mapState } from 'vuex'
import toolInput from '../../inputs/ToolInput'
import LineChart from '../../charts/LineChart.js'
export default {
components: {
toolInput
toolInput,
LineChart
},
data: function() {
return {
extruderTemps: [250,215,195,0]
extruderTemps: [250,215,195,0],
loaded: false,
chartdata: {
datasets: []
}
}
},
computed: {
...mapState({
datasets: state => state.temperaturChart,
boolTempchart: state => state.gui.dashboard.boolTempchart,
}),
...mapGetters([
'heaters',
'heatersCount',
'temperature_fans'
'temperature_fans',
'temperature_sensors',
])
},
methods: {
created() {
}
},
methods: {
fillData () {
this.loaded = true;
this.chartdata = {
datasets: this.datasets
}
}
},
mounted () {
this.fillData();
},
}
</script>
+53
View File
@@ -0,0 +1,53 @@
<style>
.webcamImage {
width: 100%;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-webcam</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Webcam</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 py-0 content">
<img :src="webcamConfig.url" class="webcamImage" :style="webcamStyle" />
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
computed: {
...mapState({
'webcamConfig': state => state.gui.webcam
}),
webcamStyle() {
var transforms = '';
if (this.webcamConfig.flipX) {
transforms += ' scaleX(-1)'
}
if (this.webcamConfig.flipY) {
transforms += ' scaleY(-1)'
}
if (this.webcamConfig.rotate && this.webcamConfig.rotateDegrees) {
transforms += ` rotate(${this.webcamConfig.rotateDegrees}deg)`
}
if (transforms.trimLeft().length) {
return {
transform: transforms.trimLeft(),
}
}
return '';
}
},
}
</script>
+94
View File
@@ -0,0 +1,94 @@
<style>
</style>
<template>
<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>
</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 borderless no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
<v-btn @click="sendBabySteppingDownFine()" class="" :loading="loadingBabySteppingDownFine" ><v-icon class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
<v-btn @click="sendBabySteppingDown()" class="" :loading="loadingBabySteppingDown" >-0.05mm</v-btn>
</v-btn-toggle>
<v-btn-toggle borderless no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
<v-btn @click="sendBabySteppingUpFine()" class="" :loading="loadingBabySteppingUpFine" ><v-icon class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
<v-btn @click="sendBabySteppingUp()" class="" :loading="loadingBabySteppingUp" >+0.05mm</v-btn>
</v-btn-toggle>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
import Vue from "vue";
export default {
components: {
},
data: function() {
return {
loadingBabySteppingDownFine: false,
loadingBabySteppingDown: false,
loadingBabySteppingUpFine: false,
loadingBabySteppingUp: false,
}
},
computed: {
...mapState({
loadings: state => state.loadings,
homing_origin: state => state.printer.gcode_move.homing_origin,
printer_state: state => state.printer.print_stats.state,
homed_axis: state => state.printer.toolhead.homed_axes,
}),
},
methods: {
sendBabySteppingDownFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingDownFine' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDownFine");
},
sendBabySteppingDown() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingDown' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingDown");
},
sendBabySteppingUpFine() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingUpFine' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUpFine");
},
sendBabySteppingUp() {
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
this.$store.commit('setLoading', { name: 'babySteppingUp' });
this.$store.commit('addGcodeResponse', gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "respondeBabySteppingUp");
},
},
watch: {
loadings: function(loadings) {
this.loadingBabySteppingDownFine = loadings.includes('babySteppingDownFine');
this.loadingBabySteppingDown = loadings.includes('babySteppingDown');
this.loadingBabySteppingUpFine = loadings.includes('babySteppingUpFine');
this.loadingBabySteppingUp = loadings.includes('babySteppingUp');
},
}
}
</script>
+14 -5
View File
@@ -1,19 +1,28 @@
import Vue from 'vue'
import StatusPanel from './StatusPanel.vue'
import KlippyStatePanel from './KlippyStatePanel.vue'
import ToolsPanel from './ToolsPanel.vue'
import TempchartPanel from './TempchartPanel.vue'
import ControlPanel from "./ControlPanel";
import ExtruderPanel from "./ExtruderPanel";
import ZOffsetPanel from "./ZOffsetPanel";
import Peripherie from "./PeripheriePanel";
import MacrosPanel from "./MacrosPanel";
import WebcamPanel from "./WebcamPanel";
import MiniconsolePanel from "./MiniconsolePanel";
import Settings from "./Settings/";
import PowerControlPanel from "./PowerControlPanel.vue";
Vue.component('status-panel', StatusPanel);
Vue.component('klippy-state-panel', KlippyStatePanel);
Vue.component('tools-panel', ToolsPanel);
Vue.component('tempchart-panel', TempchartPanel);
Vue.component('control-panel', ControlPanel);
Vue.component('extruder-panel', ExtruderPanel);
Vue.component('zoffset-panel', ZOffsetPanel);
Vue.component('peripherie-panel', Peripherie);
Vue.component('macros-panel', MacrosPanel);
Vue.component('webcam-panel', WebcamPanel);
Vue.component('miniconsole-panel', MiniconsolePanel);
Vue.component('power-control-panel', PowerControlPanel);
export default {
StatusPanel,
Settings
}
+46
View File
@@ -0,0 +1,46 @@
<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>
</template>
<script>
import { mapState } from 'vuex';
export default {
data: function() {
return {
value: false
}
},
props: {
name: String,
},
computed: {
...mapState({
hiddenMacros: state => state.gui.dashboard.hiddenMacros
}),
},
methods: {
setValue() {
if (this.value) {
let index = this.hiddenMacros.indexOf(this.name.toUpperCase());
if (index > -1) this.hiddenMacros.splice(index, 1);
} else this.hiddenMacros.push(this.name.toUpperCase());
}
},
watch: {
hiddenMacros: function() {
this.value = !this.hiddenMacros.includes(this.name.toUpperCase());
}
},
created() {
this.value = !this.hiddenMacros.includes(this.name.toUpperCase());
}
}
</script>
+68
View File
@@ -0,0 +1,68 @@
<style>
.settingsRunoutSwitchInput .v-messages {
display: none;
}
</style>
<template>
<div>
<v-row class="px-6" >
<v-col sm-12>
<v-switch v-model="enabled" :label="enabled ? 'enabled' : 'disabled'" @change="changeSensor()" class="settingsRunoutSwitchInput my-0"></v-switch>
</v-col>
</v-row>
<v-row class="px-6" v-if="enabled" >
<v-col sm-12>
<label class="mt-1 d-inline-block">Filament:</label>
<v-chip class="float-right" :color="filament_detected ? 'green' : 'red' " text-color="white">{{ filament_detected ? 'detected' : 'empty' }}</v-chip>
</v-col>
</v-row>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
data: function() {
return {
value: false,
enabled: false,
filament_detected: false,
}
},
props: {
name: String,
},
computed: {
...mapGetters([
'getFilamentSwitchSensors'
])
},
methods: {
changeSensor() {
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 1 : 0);
this.$socket.sendObj('printer.gcode.script', { script: gcode });
}
},
watch: {
getFilamentSwitchSensors: function() {
let sensor = this.getFilamentSwitchSensors.find(sensor => sensor.name === this.name);
if (sensor) {
this.enabled = sensor.enabled;
this.filament_detected = sensor.filament_detected;
}
}
},
created() {
let sensor = this.getFilamentSwitchSensors.find(sensor => sensor.name === this.name);
if (sensor) {
this.enabled = sensor.enabled;
this.filament_detected = sensor.filament_detected;
}
}
}
</script>
+12 -2
View File
@@ -10,12 +10,14 @@
</style>
<template>
<v-text-field type="number" min="-273" max="1999" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps">
<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>
</template>
<script>
import Vue from "vue";
export default {
data: function() {
return {
@@ -25,6 +27,8 @@
props: {
name: String,
target: Number,
min_temp: Number,
max_temp: Number,
command: String,
attributeName: String,
},
@@ -33,7 +37,13 @@
},
methods: {
setTemps() {
this.$socket.sendObj('post_printer_gcode', {script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value});
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});
}
},
watch: {
+49 -15
View File
@@ -4,9 +4,29 @@
<template>
<v-row>
<v-col class="col-auto"><v-icon @click="decrement">mdi-minus</v-icon></v-col>
<v-col class="col"><v-slider v-model="value" thumb-label="always" :min="min" :max="max" @change="sendCmd" hide-details></v-slider></v-col>
<v-col class="col-auto"><v-icon @click="increment">mdi-plus</v-icon></v-col>
<v-col class="py-1">
<v-slider
v-model="value"
:label="label"
:min="min"
:max="max"
@change="sendCmd"
:prepend-icon="prependIcon"
hide-details>
<template v-slot:append>
<v-text-field
v-model="value"
class="mt-0 pt-0"
hide-details
single-line
type="number"
style="width: 80px"
@change="sendCmd"
></v-text-field>
</template>
</v-slider>
</v-col>
</v-row>
</template>
@@ -15,7 +35,7 @@
export default {
data: function() {
return {
value: this.target * this.multi
value: this.target * this.multi,
}
},
props: {
@@ -32,6 +52,16 @@
required: false,
default: ''
},
label: {
type: String,
required: false,
default: ''
},
prependIcon: {
type: String,
required: false,
default: ''
},
attributeScale: {
type: Number,
required: false,
@@ -47,6 +77,16 @@
required: false,
default: 100
},
extenderSteps: {
type: Number,
required: false,
default: 100
},
extender: {
type: Boolean,
required: false,
default: false
},
multi: {
type: Number,
required: false,
@@ -58,21 +98,15 @@
},
methods: {
sendCmd() {
this.$socket.sendObj('post_printer_gcode', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) });
},
decrement() {
this.value--;
this.sendCmd();
},
increment() {
this.value++;
this.sendCmd();
this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0) });
},
},
watch: {
target: function() {
this.value = this.target * this.multi;
}
},
},
created: function() {
}
}
</script>
</script>
+29 -16
View File
@@ -1,22 +1,13 @@
import Vue from 'vue'
import JRPCWS from './plugins/json-rpc-websocket'
import WebSocketClient from './plugins/wsClient'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import VueResource from 'vue-resource'
import './components'
import store from './store'
import router from './plugins/router'
import { hostname } from './store/variables'
import 'vue-toast-notification/dist/index.css';
import vueHeadful from 'vue-headful';
Vue.use(JRPCWS, 'ws://' + hostname + '/websocket', {
store: store,
reconnectEnabled: true,
reconnectInterval: 3000,
recconectAttempts: 1000,
});
Vue.config.productionTip = false;
Vue.use(VueResource);
@@ -28,9 +19,31 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO
Vue.component('vue-headful', vueHeadful);
new Vue({
vuetify,
router,
store,
render: h => h(App)
}).$mount('#app')
fetch('/config.json')
.then(res => res.json())
.then(file => {
store.commit('setSettings', file);
const websocketProtocol = document.location.protocol === 'https:' ? 'wss://' : 'ws://';
const socketClient = new WebSocketClient(websocketProtocol + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
store: store,
reconnectEnabled: true,
reconnectInterval: store.state.socket.reconnectInterval,
});
socketClient.connect();
Vue.prototype.$socket = socketClient;
new Vue({
vuetify,
router,
store,
render: h => h(App)
}).$mount('#app')
})
.catch((error) => {
let p = document.createElement("p");
let content = document.createTextNode("config.json not found or cannot be decoded!");
p.appendChild(content);
document.getElementById('app').append(p);
window.console.error('Error:', error);
});
+56 -26
View File
@@ -28,25 +28,19 @@
<div>
<v-row>
<v-col class="col">
<v-combobox
<v-text-field
v-model="gcode"
:items="items"
label="Send code..."
solo
class="gcode-command-field"
ref="gcodeCommandField"
autocomplete="off"
v-on:keyup.enter="doSend"
v-on:keyup.up="onKeyUp"
v-on:keyup.down="onKeyDown"
></v-combobox>
<!--<v-text-field
v-model="gcode"
label="Send code..."
solo
class="gcode-command-field"
v-on:keyup.enter="doSend"
v-on:keyup.up="onKeyUp"
v-on:keyup.down="onKeyDown"
></v-text-field>-->
v-on:keydown.tab="getAutocomplete"
></v-text-field>
</v-col>
<v-col class="col-auto align-content-center">
@@ -61,12 +55,12 @@
:headers="headers"
:options="options"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items="events"
item-key="date"
hide-default-footer
disable-pagination
class="event-table"
:custom-sort="customSort"
>
<template #no-data>
<div class="text-center">empty</div>
@@ -89,18 +83,19 @@
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import Vue from "vue";
export default {
data () {
return {
gcode: "",
sortBy: 'date',
sortDesc: true,
headers: [
{
text: 'Date',
value: 'date',
width: '15%'
width: '15%',
dateType: 'Date',
},
{
text: 'Event',
@@ -116,35 +111,31 @@
],
lastCommandNumber: null,
items: []
items: [],
loadingSendGcode: false,
}
},
computed: {
...mapState({
events: state => state.events,
helplist: state => state.helplist,
loadings: state => state.loadings,
}),
...mapGetters([
'getMacros'
]),
loadingSendGcode: {
get() {
return this.$store.state.socket.loadingSendGcode
},
set(value) {
return this.$store.dispatch('setLoadingSendGcode', value)
}
}
},
methods: {
doSend() {
this.loadingSendGcode = true;
this.$socket.sendObj('post_printer_gcode', { script: this.gcode }, "sendGcode");
this.$store.commit('setLoading', { name: 'loadingSendGcode' });
this.$store.commit('addGcodeResponse', this.gcode);
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "sendGcode");
this.lastCommands.push(this.gcode);
this.gcode = "";
this.lastCommandNumber = null;
},
formatMessage(message) {
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
if (typeof message === "string") message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
return message;
},
@@ -165,6 +156,45 @@
this.lastCommandNumber = null;
this.gcode = "";
}
},
getAutocomplete(e) {
e.preventDefault();
if (this.gcode.length) {
let commands = this.helplist.filter((element) => element.commandLow.indexOf(this.gcode.toLowerCase()) === 0);
if (commands && commands.length === 1) this.gcode = commands[0].command;
else {
let commands = this.helplist.filter((element) => element.commandLow.includes(this.gcode.toLowerCase()));
if (commands && commands.length) {
let output = "";
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
this.$store.commit('addGcodeResponse', output);
}
}
}
this.$refs.gcodeCommandField.focus();
},
customSort: function(items, index, isDesc) {
items.sort((a, b) => {
if (index[0] === 'date') {
if (!isDesc[0]) return new Date(b[index]) - new Date(a[index]);
else return new Date(a[index]) - new Date(b[index]);
} else {
if(typeof a[index] !== 'undefined'){
if (!isDesc[0]) return a[index].toLowerCase().localeCompare(b[index].toLowerCase());
else return b[index].toLowerCase().localeCompare(a[index].toLowerCase());
}
}
});
return items;
}
},
watch: {
loadings: {
handler: function(newVal) {
this.loadingSendGcode = newVal.includes('loadingSendGcode');
}
}
}
}
+34 -6
View File
@@ -1,20 +1,48 @@
<template>
<v-row>
<v-col class="col-sm-12 col-md-7">
<status-panel></status-panel>
<control-panel class="mt-6"></control-panel>
<macros-panel class="mt-6"></macros-panel>
<status-panel v-if="klippy_state === 'ready'"></status-panel>
<klippy-state-panel v-if="klippy_state !== 'ready'"></klippy-state-panel>
<webcam-panel v-if="showDashboardWebcam" class="mt-6"></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>
</v-col>
<v-col class="col-sm-12 col-md-5">
<tools-panel></tools-panel>
<tempchart-panel class="mt-6"></tempchart-panel>
<peripherie-panel></peripherie-panel>
<peripherie-panel class="mt-6" v-if="klippy_state === 'ready'"></peripherie-panel>
<miniconsole-panel class="mt-6" v-if="klippy_state === 'ready' && showDashboardConsole"></miniconsole-panel>
<power-control-panel class="mt-6" v-if="powerDevicesCount > 0"></power-control-panel>
</v-col>
</v-row>
</template>
<script>
export default {
import { mapState, mapGetters } from 'vuex'
import ZOffsetPanel from "../components/panels/ZOffsetPanel";
export default {
components: {ZOffsetPanel},
data: () => ({
//is_ready: false
}),
computed: {
...mapState({
showDashboardConsole: state => state.gui.dashboard.boolConsole,
klippy_state: state => state.printer.webhooks.state,
}),
...mapGetters([
'showDashboardWebcam',
'powerDevicesCount'
])
},
/*created() {
//this.is_ready = (this.klippy_state === "ready") ? true : false;
},
watch: {
klippy_state() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
}
}*/
}
</script>
+461 -146
View File
@@ -3,8 +3,8 @@
margin-left: 7px;
}
.v-data-table th:last-child .v-data-table-header__icon {
float: right;
.v-data-table th {
white-space: nowrap;
}
.v-data-table .file-list-cursor:hover {
@@ -45,64 +45,184 @@
<template>
<div>
<v-card class="fileupload-card" @dragover="dragOver" @dragleave="dragLeave" @drop.prevent.stop="dragDrop">
<v-card-title>
G-Code Files
<v-spacer></v-spacer>
<v-btn :loading="loadingRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
<v-btn color="primary ml-4 " v-if="!is_printing" :loading="loadingUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
</v-card-title>
<v-data-table
:headers="headers"
:options="options"
:custom-sort="sort"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items="files"
item-key="date"
class="files-table"
>
<template #no-data>
<div class="text-center">empty</div>
</template>
<v-card class="fileupload-card" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
<v-card-title>
G-Code Files
<v-spacer></v-spacer>
<v-btn :loading="loadingMakeDirectory" @click="createDirectory"><v-icon class="mr-1">mdi-folder-plus</v-icon> new Directory</v-btn>
<v-btn color="primary ml-4" :loading="loadingGcodeRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
<v-btn color="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
</v-card-title>
<v-card-subtitle>
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}
</v-card-subtitle>
<v-card-text>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="Search"
single-line
hide-details
></v-text-field>
</v-card-text>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page="countPerPage"
item-key="name"
:search="search"
:custom-filter="advancedSearch"
@pagination="refreshMetadata">
<template #item="{ item }">
<tr @contextmenu="showContextMenu($event, item)" @click="dialog.show = true, dialog.filename = item.filename" class="file-list-cursor">
<td class=" ">
{{ item.filename }}
</td>
<td class=" ">
{{ formatFilesize(item.size) }}
</td>
<td class="text-end ">
{{ formatDate(item.modified) }}
</td>
</tr>
</template>
</v-data-table>
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
<div class="textnode">Drop files to add gcode.</div>
</div>
</v-card>
<template #no-data>
<div class="text-center">empty</div>
</template>
<template v-slot:body.prepend>
<tr
v-if="(currentPath !== 'gcodes')"
class="file-list-cursor"
@click="clickRowGoBack"
@dragover="dragOverFilelist($event, {isDirectory: true, filename: '..'})" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, {isDirectory: true, filename: '..'})"
>
<td class=" ">
<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"
draggable="true"
@drag="dragFile($event, item)"
@dragend="dragendFile($event)"
@dragover="dragOverFilelist($event, item)" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, item)"
:data-name="item.filename"
>
<td class=" ">
<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 : '--')" />
</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>
<td class="text-no-wrap text-right">
{{ item.object_height ? item.object_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.layer_height ? item.layer_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.filament_total ? item.filament_total.toFixed()+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ formatPrintTime(item.estimated_time) }}
</td>
<td class="text-no-wrap text-right">
{{ item.slicer ? item.slicer : '--' }}<br />
<small v-if="item.slicer_version">{{ item.slicer_version}}</small>
</td>
</tr>
</template>
</v-data-table>
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
<div class="textnode">Drop files to add gcode.</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="downloadFile">
<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-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="removeFile">
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-rename-box</v-icon> 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-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-delete</v-icon> 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-list-item>
</v-list>
</v-menu>
<v-dialog v-model="dialog.show" max-width="400">
<v-dialog v-model="dialogPrintFile.show" max-width="400">
<v-card>
<v-img
v-if="dialogPrintFile.item.thumbnails && dialogPrintFile.item.thumbnails.find(element => element.width === 400)"
:src="'data:image/gif;base64,'+(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 400).data : '')"
:height="(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 400).height : '')+'px'"
></v-img>
<v-card-title class="headline">Start Job</v-card-title>
<v-card-text>Do you want to start {{ dialog.filename }}?</v-card-text>
<v-card-text>Do you want to start {{ dialogPrintFile.item.filename }}?</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="red darken-1" text @click="dialog.show = false">No</v-btn>
<v-btn color="green darken-1" text @click="startPrint(dialog.filename)">Yes</v-btn>
<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-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-text>
Please enter a new directory name:
<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-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-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="dialogRenameDirectory.show" max-width="400">
<v-card>
<v-card-title class="headline">Rename Directory</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-card-actions>
</v-card>
</v-dialog>
@@ -111,100 +231,132 @@
<script>
import { mapState, mapGetters } from 'vuex';
import axios from 'axios';
import { hostname } from '../store/variables';
import { findDirectory } from "../plugins/helpers";
/*import Vue from "vue";*/
export default {
data () {
return {
search: '',
sortBy: 'modified',
sortDesc: true,
dialog: {
selected: [],
dialogPrintFile: {
show: false,
filename: ""
item: {}
},
dialogCreateDirectory: {
show: false,
name: ""
},
dialogRenameFile: {
show: false,
newName: "",
item: {}
},
dialogRenameDirectory: {
show: false,
newName: "",
item: {}
},
headers: [
{
text: 'Name',
value: 'filename',
width: '50%'
},
{
text: 'Filesize',
value: 'size',
},
{
text: 'last modified',
value: 'modified',
align: 'end'
},
{ text: '', value: '', },
{ text: 'Name', value: 'filename', },
{ text: 'Filesize', value: 'size', align: 'right', },
{ text: 'Last modified', value: 'modified', align: 'right', },
{ text: 'Object Height', value: 'object_height', align: 'right', },
{ text: 'Layer Height', value: 'layer_height', align: 'right', },
{ text: 'Filament Usage', value: 'filament_total', align: 'right', },
{ text: 'Print Time', value: 'estimated_time', align: 'right', },
{ text: 'Generated by', value: 'slicer', align: 'right', },
],
options: {
},
contextMenu: {
shown: false,
isDirectory: false,
touchTimer: undefined,
x: 0,
y: 0,
item: {}
},
hostname: hostname,
dropzone: {
visibility: 'hidden',
opacity: 0,
}
},
files: [],
currentPath: 'gcodes',
loadingGcodeUpload: false,
loadingGcodeRefresh: false,
loadingMakeDirectory: false,
draggingFile: {
status: false,
item: {}
},
input_rules: [
value => value.indexOf(" ") === -1 || 'Name contain spaces!'
]
}
},
computed: {
...mapState({
files: state => state.files,
loadingUpload: state => state.socket.loadingGcodeUpload,
loadingRefresh: state => state.socket.loadingGcodeRefresh,
filetree: state => state.filetree,
countPerPage: state => state.gui.gcodefiles.countPerPage,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
loadings: state => state.loadings,
}),
...mapGetters([
'is_printing'
])
},
created() {
/*let dirArray = this.currentPath.split("/");
this.files = findDirectory(this.filetree, dirArray);*/
this.loadPath();
},
methods: {
uploadFile: function() {
if (this.$refs.fileUpload.files.length) {
this.doUploadFile(this.$refs.fileUpload.files[0]);
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
this.$refs.fileUpload.value = '';
});
}
},
doUploadFile: function(file) {
let toast = this.$toast;
let formData = new FormData();
formData.append('file', file);
this.$store.commit('setLoadingGcodeUpload', true);
let filename = file.name.replace(" ", "_");
axios.post('http://' + hostname + '/printer/files/upload',
formData.append('file', file, (this.currentPath+"/"+filename).substring(7));
this.$store.commit('setLoading', { name: 'loadingGcodeUpload' });
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then((result) => {
this.$store.commit('setLoadingGcodeUpload', false);
toast.success("Upload of "+result.data.result+" successful!", {
icon: 'fa-check'
});
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
toast.success("Upload of "+result.data.result+" successful!");
})
.catch(() => {
this.$store.commit('setLoadingGcodeUpload', false);
toast.error("Cannot upload the file!", {
icon: 'fa-exclamation-triangle'
});
this.$store.commit('removeLoading', { name: 'loadingGcodeUpload' });
toast.error("Cannot upload the file!");
});
},
clickUploadButton: function() {
this.$refs.fileUpload.click();
},
refreshFileList: function() {
this.$store.commit('setLoadingGcodeRefresh', true);
this.$socket.sendObj('get_printer_files', {}, 'getFileList');
this.$store.commit('setLoading', { name: 'loadingGcodeRefresh' });
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory');
},
formatDate(date) {
let tmp2 = new Date(date);
return tmp2.toLocaleString();
return tmp2.toLocaleString().replace(',', '');
},
formatFilesize(fileSizeInBytes) {
let i = -1;
@@ -216,6 +368,31 @@
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
},
formatPrintTime(totalSeconds) {
if (totalSeconds) {
let output = "";
let days = Math.floor(totalSeconds / (3600 * 24));
if (days) {
totalSeconds %= (3600 * 24);
output += days+"d";
}
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
if (hours) output += " "+hours+"h";
let minutes = Math.floor(totalSeconds / 60);
if (minutes) output += " "+minutes+"m";
let seconds = totalSeconds % 60;
if (seconds) output += " "+seconds.toFixed(0)+"s";
return output;
}
return '--';
},
showContextMenu (e, item) {
e.preventDefault();
this.contextMenu.shown = true;
@@ -227,89 +404,227 @@
});
},
downloadFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
let link = document.createElement("a");
link.download = name;
link.href = 'http://' + hostname + '/printer/files/' + this.contextMenu.item.filename;
link.href = '//' + this.hostname + ':' + this.port + '/server/files/' + encodeURI(filename);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
renameFile(item) {
this.dialogRenameFile.item = item;
this.dialogRenameFile.newName = item.filename;
this.dialogRenameFile.show = true;
},
renameFileAction() {
this.dialogRenameFile.show = false;
this.$socket.sendObj('server.files.move', {
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
dest: this.currentPath+"/"+this.dialogRenameFile.newName
}, 'getPostFileMove');
},
renameDirectory(item) {
this.dialogRenameDirectory.item = item;
this.dialogRenameDirectory.newName = item.filename;
this.dialogRenameDirectory.show = true;
},
renameDirectoryAction() {
this.dialogRenameDirectory.show = false;
this.$socket.sendObj('server.files.move', {
source: this.currentPath+"/"+this.dialogRenameDirectory.item.filename,
dest: this.currentPath+"/"+this.dialogRenameDirectory.newName
}, 'getPostFileMove');
},
removeFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
axios.delete(
'http://'+hostname+'/printer/files/'+this.contextMenu.item.filename
).then(() => {
this.$toast(this.contextMenu.item.filename+" successfully deleted.", {
icon: 'fa-trash'
});
'//'+ this.hostname + ':' + this.port +'/server/files/' + encodeURI(filename)
).then((result) => {
this.$toast.success(result.data.result+" successfully deleted.");
}).catch(() => {
this.$toast.error("Error! Cannot delete file.", {
icon: 'fa-warning'
});
this.$toast.error("Error! Cannot delete file.");
});
},
createDirectory: function() {
this.dialogCreateDirectory.name = "";
this.dialogCreateDirectory.show = true;
},
createDirectoryAction: function() {
if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(" ") === -1) {
this.dialogCreateDirectory.show = false;
this.$socket.sendObj('server.files.post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'getPostDirectory');
}
},
deleteDirectoryAction: function() {
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
},
clickRow: function(item) {
if (!item.isDirectory) {
this.dialogPrintFile.show = true;
this.dialogPrintFile.item = item;
} else {
this.currentPath += "/"+item.filename;
this.loadPath();
}
},
clickRowGoBack: function() {
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
},
loadPath: function() {
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'getDirectory');
let dirArray = this.currentPath.split("/");
this.files = findDirectory(this.filetree, dirArray);
},
startPrint(filename = "") {
this.dialog.show = false;
this.$socket.sendObj('post_printer_print_start', { filename: filename }, 'switchToDashboard');
filename = (this.currentPath+"/"+filename).substring(7);
this.dialogPrintFile.show = false;
this.$socket.sendObj('printer.print.start', { filename: filename }, 'switchToDashboard');
},
dragOver(e) {
e.preventDefault();
e.stopPropagation();
dragOverUpload(e) {
if (!this.draggingFile.status) {
e.preventDefault();
e.stopPropagation();
this.dropzone.visibility = 'visible';
this.dropzone.opacity = 1;
},
dragLeave(e) {
e.preventDefault();
e.stopPropagation();
this.dropzone.visibility = 'hidden';
this.dropzone.opacity = 0;
},
async dragDrop(e) {
e.preventDefault();
this.dropzone.visibility = 'hidden';
this.dropzone.opacity = 0;
if (!this.is_printing && e.dataTransfer.files.length) {
await this.doUploadFile(e.dataTransfer.files[0]);
this.dropzone.visibility = 'visible';
this.dropzone.opacity = 1;
}
},
sort(items, sortBy, sortDesc) {
sortBy = sortBy.length ? sortBy[0] : 'name';
dragLeaveUpload(e) {
if (!this.draggingFile.status) {
e.preventDefault();
e.stopPropagation();
this.dropzone.visibility = 'hidden';
this.dropzone.opacity = 0;
}
},
async dragDropUpload(e) {
if (!this.draggingFile.status) {
e.preventDefault();
this.dropzone.visibility = 'hidden';
this.dropzone.opacity = 0;
if (!this.is_printing && e.dataTransfer.files.length) {
await this.doUploadFile(e.dataTransfer.files[0]);
}
}
},
dragFile(e, item) {
e.preventDefault();
this.draggingFile.status = true;
this.draggingFile.item = item;
},
dragendFile(e) {
e.preventDefault();
this.draggingFile.status = false;
this.draggingFile.item = { };
},
dragOverFilelist(e, row) {
if (this.draggingFile.status) {
e.preventDefault();
//e.stopPropagation();
if (row.isDirectory) {
e.target.parentElement.style.backgroundColor = '#43A04720';
}
}
},
dragLeaveFilelist(e) {
if (this.draggingFile.status) {
e.preventDefault();
e.stopPropagation();
e.target.parentElement.style.backgroundColor = 'transparent';
}
},
async dragDropFilelist(e, row) {
if (this.draggingFile.status) {
e.preventDefault();
e.target.parentElement.style.backgroundColor = 'transparent';
let dest = "";
if (row.filename === '..') {
dest = this.currentPath.substring(0, this.currentPath.lastIndexOf("/") + 1)+this.draggingFile.item.filename;
} else dest = this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename;
this.$socket.sendObj('server.files.move', {
source: this.currentPath+"/"+this.draggingFile.item.filename,
dest: dest
}, 'getPostFileMove');
}
},
sortFiles(items, sortBy, sortDesc) {
sortBy = sortBy.length ? sortBy[0] : 'filename';
sortDesc = sortDesc[0];
// Sort by index
items.sort(function(a, b) {
if (a[sortBy] === b[sortBy]) {
return 0;
}
if (a[sortBy] === null || a[sortBy] === undefined) {
return -1;
}
if (b[sortBy] === null || b[sortBy] === undefined) {
return 1;
}
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
}
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
return reducedA - reducedB;
}
return a[sortBy] - b[sortBy];
});
if (items !== undefined) {
// Sort by index
items.sort(function(a, b) {
if (a[sortBy] === b[sortBy]) {
return 0;
}
if (a[sortBy] === null || a[sortBy] === undefined) {
return -1;
}
if (b[sortBy] === null || b[sortBy] === undefined) {
return 1;
}
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
}
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
return reducedA - reducedB;
}
return a[sortBy] - b[sortBy];
});
// Deal with descending order
if (sortDesc) {
items.reverse();
// Deal with descending order
if (sortDesc) items.reverse();
// Then make sure directories come first
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
}
// Then make sure directories come first
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
return items;
},
refreshMetadata: function(data) {
let items = this.sortFiles(this.files, [this.sortBy], [this.sortDesc]);
for (let i = data.pageStart; i < data.pageStop; i++) {
if (items[i] && !items[i].isDirectory && !items[i].metadataPulled) {
let filename = (this.currentPath+"/"+items[i].filename).substring(7);
this.$socket.sendObj("server.files.metadata", { filename: filename }, "getMetadata");
}
}
},
advancedSearch: function(value, search) {
return value != null &&
search != null &&
typeof value === 'string' &&
value.toString().toLowerCase().indexOf(search.toLowerCase()) !== -1
}
},
watch: {
filetree: {
deep: true,
handler(newVal) {
let dirArray = this.currentPath.split("/");
this.files = findDirectory(newVal, dirArray);
}
},
currentPath: {
handler(newVal) {
let dirArray = newVal.split("/");
this.files = findDirectory(this.filetree, dirArray);
}
},
loadings: function(loadings) {
this.loadingGcodeRefresh = loadings.includes('loadingGcodeRefresh');
this.loadingGcodeUpload = loadings.includes('loadingGcodeUpload');
}
}
}
</script>
</script>
+367
View File
@@ -0,0 +1,367 @@
<style>
</style>
<template>
<div>
<v-row>
<v-col class="col-12 col-md-8">
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-grid</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Heightmap</v-list-item-title>
<v-list-item-subtitle class="mr-3" v-if="boolShowBedMesh">Current profile: {{ this.bed_mesh ? this.bed_mesh.profile_name : "unknown" }}</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 py-0 content" v-if="boolShowBedMesh">
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
</v-card-text>
<v-card-text v-if="!boolShowBedMesh">
No bed_mesh has been loaded yet.
</v-card-text>
<v-card-actions v-if="boolShowBedMesh">
<v-spacer></v-spacer>
<v-btn text :color="(this.showMeshType === 'probed' ? 'primary accent-4' : 'grey lighten-2')" @click="switchToProbed">Probed</v-btn>
<v-btn text :color="(this.showMeshType === 'mesh' ? 'primary accent-4' : 'grey lighten-2')" @click="switchToMesh">Mesh</v-btn>
<v-spacer></v-spacer>
</v-card-actions>
</v-card>
</v-col>
<v-col class="col-12 col-md-4">
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-cogs</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Profile</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text>
<v-row>
<v-col class="col-12">
<v-select
:items="profiles"
v-model="profile"
item-text="name"
item-value="name"
label="Profile"
outlined
></v-select>
</v-col>
</v-row>
<v-row>
<v-col class="col-12">
<v-btn color="primary" class="mr-3" @click="loadProfile" :loading="loadingLoad" :disabled="disabledLoad">LOAD</v-btn>
<v-btn color="primary" class="mr-3" @click="saveDialog = true; newName = profile" :loading="loadingSave" :disabled="disabledSave">SAVE</v-btn>
<v-btn color="primary" class="mr-3" @click="removeDialog = true" :loading="loadingRemove" :disabled="disabledRemove">REMOVE</v-btn>
</v-col>
</v-row>
<v-row>
<v-col class="col-12">
<v-btn color="primary" class="mr-3" @click="clearBedMesh" :loading="loadingClear" :disabled="disabledClear">CLEAR</v-btn>
<v-btn color="primary" class="mr-3" @click="calibrateDialog = true" :loading="loadingCalibrate" :disabled="is_printing">Calibrate</v-btn>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-col>
</v-row>
<v-dialog v-model="saveDialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Mesh Profile</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12">
<v-text-field label="Name" required v-model="newName"></v-text-field>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="waring darken-1" text @click="saveDialog = false">abort</v-btn>
<v-btn color="blue darken-1" text @click="saveProfile">save</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="calibrateDialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Bed Mesh Calibrate</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12">
<p>Do you really want to start the bed calibration?</p>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="waring darken-1" text @click="calibrateDialog = false">abort</v-btn>
<v-btn color="blue darken-1" text @click="calibrateMesh">calibrate</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="removeDialog" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Bed Mesh Profile</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12">
<p>Do you really want to delete the profile "{{ this.profile }}"?</p>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="waring darken-1" text @click="removeDialog = false">abort</v-btn>
<v-btn color="blue darken-1" text @click="removeProfile">remove</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import {mapGetters, mapState} from 'vuex';
import { Plotly } from 'vue-plotly'
export default {
components: {
Plotly
},
data () {
return {
data:[
{
x: [],
y: [],
z: [],
type:"surface",
intensity: [0, .05, .1],
cmin: -0.1,
cmax: 0.1,
showscale: true,
autocolorscale: true,
colorbar: {
tickfont: {
color: '#fff'
},
}
}
],
layout:{
showScale: true,
plot_bgcolor: 'transparent',
paper_bgcolor: 'transparent',
margin: {
l: 0,
r: 100,
b: 0,
t: 0
},
scene: {
camera: {
eye: {
x: -1.25,
y: -1.25,
z: 0.5
}
},
xaxis: {
color: '#fff',
range: [0,200]
},
yaxis: {
color: '#fff',
range: [0,200]
},
zaxis: {
color: '#fff',
range: [-1,1]
}
}
},
profiles: [],
profile: {},
boolShowBedMesh: false,
loadingLoad: false,
disabledLoad: true,
loadingSave: false,
disabledSave: true,
loadingRemove: false,
disabledRemove: true,
loadingClear: false,
disabledClear: true,
loadingCalibrate: false,
showMeshType: 'probed',
saveDialog: false,
removeDialog: false,
calibrateDialog: false,
newName: '',
}
},
computed: {
...mapState({
config: state => state.printer.configfile.config,
bed_mesh: state => state.printer.bed_mesh,
loadings: state => state.loadings,
}),
...mapGetters([
'is_printing',
]),
},
methods: {
showBedMesh: function() {
this.data[0].x = [];
this.data[0].y = [];
this.data[0].z = [];
if (this.bed_mesh && this.bed_mesh.profile_name !== "") {
if (this.config.stepper_x !== undefined && this.config.stepper_y !== undefined) {
this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max];
this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max];
} else {
this.layout.scene.xaxis.range = [this.bed_mesh.mesh_min[0], this.bed_mesh.mesh_max[0]];
this.layout.scene.yaxis.range = [this.bed_mesh.mesh_min[1], this.bed_mesh.mesh_max[1]];
}
let x_count = 0;
let y_count = 0;
let min = -1;
let max = 1;
if (this.showMeshType === 'probed') {
x_count = this.bed_mesh.probed_matrix[0].length;
y_count = this.bed_mesh.probed_matrix.length;
this.data[0].z = this.bed_mesh.probed_matrix;
min = Math.min.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.min.apply(Math, row); }));
max = Math.max.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.max.apply(Math, row); }));
} else if (this.showMeshType === 'mesh') {
x_count = this.bed_mesh.mesh_matrix[0].length;
y_count = this.bed_mesh.mesh_matrix.length;
this.data[0].z = this.bed_mesh.mesh_matrix;
min = Math.min.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.min.apply(Math, row); }));
max = Math.max.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.max.apply(Math, row); }));
}
let x_step = (this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / (x_count - 1);
for(let i = 0; i < x_count; i++) {
this.data[0].x.push(parseFloat(this.bed_mesh.mesh_min[0]) + parseFloat(x_step) * i);
}
let y_step = (this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / (y_count - 1);
for(let i = 0; i < y_count; i++) {
this.data[0].y.push(parseFloat(this.bed_mesh.mesh_min[1]) + parseFloat(y_step) * i);
}
if (min > -1) min = -1;
if (max < 1) max = 1;
this.layout.scene.zaxis.range = [min, max];
this.boolShowBedMesh = true;
} else this.boolShowBedMesh = false;
//this.$refs.heightmap.update();
},
switchToProbed: function() {
this.showMeshType = 'probed';
this.showBedMesh();
},
switchToMesh: function() {
this.showMeshType = 'mesh';
this.showBedMesh();
},
loadProfile: function() {
this.$store.commit('setLoading', { name: 'bedMeshLoad' });
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "responseBedMeshLoad");
},
saveProfile: function() {
this.saveDialog = false;
this.$store.commit('setLoading', { name: 'bedMeshSave' });
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "responseBedMeshSave");
},
removeProfile: function() {
this.removeDialog = false;
this.$store.commit('setLoading', { name: 'bedMeshRemove' });
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "responseBedMeshRemove");
},
clearBedMesh: function() {
this.$store.commit('setLoading', { name: 'bedMeshClear' });
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "responseBedMeshClear");
},
calibrateMesh: function() {
this.calibrateDialog = false;
this.$store.commit('setLoading', { name: 'bedMeshCalibrate' });
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "responseBedMeshCalibrate");
}
},
created: function() {
this.profiles = this.$store.getters.getBedMeshProfiles;
},
watch: {
config: function() {
this.profiles = this.$store.getters.getBedMeshProfiles;
},
profile: function() {
if (this.profile !== "" && this.bed_mesh !== undefined && this.profile === this.bed_mesh.profile_name) {
this.disabledLoad = true;
this.disabledRemove = false;
} else if (this.profile !== "") {
this.disabledLoad = false;
this.disabledRemove = false;
} else {
this.disabledLoad = true;
this.disabledRemove = true;
}
},
bed_mesh: {
deep: false,
handler(newVal) {
if (newVal !== undefined) {
this.profiles = this.$store.getters.getBedMeshProfiles;
this.showBedMesh();
if (this.profile !== "" && this.profile === this.bed_mesh.profile_name) this.disabledLoad = true;
else if (this.profile !== "") this.disabledLoad = false;
else this.disabledLoad = true;
if (
this.bed_mesh.probed_matrix.length &&
this.bed_mesh.probed_matrix[0].length) {
this.disabledClear = false;
this.disabledSave = false;
} else {
this.disabledClear = true;
this.disabledSave = true;
}
}
}
},
loadings: function(loadings) {
this.loadingLoad = loadings.includes('bedMeshLoad');
this.loadingClear = loadings.includes('bedMeshClear');
this.loadingSave = loadings.includes('bedMeshSave');
this.loadingRemove = loadings.includes('bedMeshRemove');
this.loadingCalibrate = loadings.includes('bedMeshCalibrate');
}
}
}
</script>
@@ -1,6 +1,8 @@
<template>
<div>
Settings - General
<router-view></router-view>
</div>
</template>
<script>
-10
View File
@@ -1,10 +0,0 @@
<template>
<div>
Current Job
</div>
</template>
<script>
export default {
}
</script>
+28
View File
@@ -0,0 +1,28 @@
<style>
</style>
<template>
<div>
<v-row>
<v-col col-12>
<webcam-panel></webcam-panel>
</v-col>
</v-row>
</div>
</template>
<script>
export default {
data () {
return {
}
},
computed: {
},
methods: {
}
}
</script>
+37
View File
@@ -0,0 +1,37 @@
<template>
<div>
<v-row>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-general-panel></settings-general-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>
</v-col>
<v-col class="col-12 col-md-6 col-lg-4">
<settings-macros-panel></settings-macros-panel>
</v-col>
</v-row>
<v-fab-transition>
<v-btn fab fixed large bottom right :loading="loadingUpload" @click="saveGuiSettings">
<v-icon>mdi-check</v-icon>
</v-btn>
</v-fab-transition>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
export default {
computed: {
...mapState({
loadingUpload: state => state.socket.loadingSaveGuiConfig,
}),
},
methods: {
...mapActions([
'saveGuiSettings'
]),
}
}
</script>
+39 -2
View File
@@ -1,10 +1,47 @@
<template>
<div>
Settings - Machine
<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-col class="col-12 pt-0" v-if="klippy_state === 'ready'">
<settings-limits-panel></settings-limits-panel>
</v-col>
</v-row>
<v-row>
<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="'col-md-6 '+(klippy_state !== 'ready' ? 'pt-0' : '')">
<settings-system-panel></settings-system-panel>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row>
</v-row>
</div>
</template>
<script>
export default {
import {mapState} from "vuex";
export default {
data: () => ({
}),
computed: {
...mapState({
klippy_state: state => state.printer.webhooks.state,
}),
},
created() {
},
watch: {
}
}
</script>
+13
View File
@@ -0,0 +1,13 @@
export function findDirectory (folder, dirArray) {
if (dirArray.length) {
if (folder.childrens) folder = folder.childrens;
let parent = folder.find(element => (element.isDirectory && element.filename === dirArray[0]));
if (parent) {
dirArray.shift();
if (dirArray.length) {
return findDirectory(parent, dirArray);
} else return parent.childrens;
} else return folder;
}
}
-9
View File
@@ -1,9 +0,0 @@
import WebSocketClient from './wsClient'
export default {
install (Vue, url, options) {
const socketClient = new WebSocketClient(url, options)
socketClient.connect()
Vue.prototype.$socket = socketClient
}
}
-122
View File
@@ -1,122 +0,0 @@
export default class WebSocketClient {
constructor (url, options) {
this.instance = null
this.url = url
this.options = options || this.defaultOptions()
if (this.options) {
if (options.reconnectEnabled) {
this.reconnectEnabled = options.reconnectEnabled
if (this.reconnectEnabled) {
this.reconnectInterval = options.reconnectInterval
this.reconnectAttempts = options.recconectAttempts
this.reconnectCount = 1
}
}
if (options.store) {
this.store = options.store
}
}
this.wsData = []
this.onOpen = null
this.onMessage = null
this.onClose = null
this.onError = null
}
createMessage (method, params, id) {
let msg = {
jsonrpc: '2.0', method: method, params: params, id: id
};
return JSON.stringify(msg)
}
defaultOptions () {
return {
reconnectEnabled: false,
reconnectInterval: 0,
recconectAttempts: 0,
store: undefined
}
}
passToStore (eventName, event) {
if (!eventName.startsWith('socket_')) { return }
let method = 'dispatch'
let target = eventName
let msg = event
if (event.data) {
msg = JSON.parse(event.data)
}
this.store[method](target, msg)
}
connect () {
this.instance = new WebSocket(this.url);
this.instance.onopen = () => {
if (this.reconnectEnabled) this.reconnectCount = 1;
if (typeof this.onOpen === 'function') this.onOpen();
if (this.store) this.passToStore('socket_on_open', event);
};
this.instance.onmessage = (msg) => {
let data = JSON.parse(msg.data);
if (typeof this.onMessage === 'function') {
this.onMessage(data)
} else if (this.store) {
if ('error' in data) {
this.passToStore('socket_on_error', data.error)
} else if (this.wsData.filter(item => item.id === data.id).length > 0 &&
this.wsData.filter(item => item.id === data.id)[0].action !== "") {
this.store.dispatch(
this.wsData.filter(item => item.id === data.id)[0].action,
data.result
)
} else this.passToStore('socket_on_message', data)
}
}
this.instance.onclose = (e) => {
if (typeof this.onClose === 'function') {
this.onClose(e)
} else if (this.store) {
this.passToStore('socket_on_close', e)
}
if (!e.wasClean && this.reconnectEnabled) {
this.reconnect()
}
}
this.instance.onerror = (e) => {
if (typeof this.onError === 'function') {
this.onError(e)
} else if (this.store) {
this.passToStore('socket_on_error', e)
}
}
}
reconnect () {
if (this.reconnectCount <= this.reconnectAttempts) {
this.reconnectCount++
delete this.instance
setTimeout(() => {
this.connect()
if (this.store) { this.passToStore('socket_reconnect', this.reconnectCount) }
}, this.reconnectInterval)
} else {
if (this.store) { this.passToStore('socket_reconnect_error', true) }
}
}
sendObj (method, params, action = '') {
let id = Math.floor(Math.random() * 10000) + 1
this.wsData.push({
id: id,
action: action
})
this.instance.send(this.createMessage(method, params, id))
}
}
+17 -10
View File
@@ -1,7 +1,14 @@
import '@fortawesome/fontawesome-free/css/all.css'
import '@mdi/font/css/materialdesignicons.css'
import Vue from 'vue';
import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib';
import VuetifyToast from 'vuetify-toast-snackbar'
//vue-toast-notification
import VueToast from 'vue-toast-notification';
import 'vue-toast-notification/dist/theme-sugar.css';
Vue.use(VueToast, {
duration: 3000,
});
Vue.use(Vuetify,{
@@ -12,15 +19,15 @@ Vue.use(Vuetify,{
}
});
Vue.use(VuetifyToast, {
x: 'right',
y: 'bottom',
timeout: 3000,
});
export default new Vuetify({
theme: {
themes: {
dark: {
red: '#f7240a'
}
}
},
icons: {
iconfont: 'fa',
iconfont: 'mdi',
},
});
+106
View File
@@ -0,0 +1,106 @@
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.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",
];
}
createMessage (method, params, id) {
let msg = {
jsonrpc: '2.0', method: method, params: params, id: id
};
return JSON.stringify(msg)
}
passToStore (eventName, event) {
if (!eventName.startsWith('socket_')) { return }
let method = 'dispatch'
let target = eventName
let msg = event
if (event && event.data) {
msg = JSON.parse(event.data)
}
this.store[method](target, msg);
}
connect () {
this.instance = new WebSocket(this.url);
this.instance.onopen = () => {
if (this.store) this.passToStore('socket_on_open', event);
};
this.instance.onclose = (e) => {
window.console.log("Websocket Closed, reconnecting in "+this.reconnectInterval+"ms: ", e.reason);
this.passToStore('socket_on_close', e);
setTimeout(() => {
this.connect();
}, this.reconnectInterval);
};
this.instance.onerror = (err) => {
console.log("Websocket Error: ", err);
this.instance.close();
};
this.instance.onmessage = (msg) => {
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 !== "") {
if (data.error && data.error.message) {
if (
!this.blacklistMessages.find(element => data.error.message.startsWith(element)) &&
!this.blacklistFunctions.find(element => this.wsData.filter(item => item.id === data.id)[0].action.startsWith(element))
) {
window.console.error("Response Error: "+this.wsData.filter(item => item.id === data.id)[0].action+" > "+data.error.message);
this.store.dispatch(
this.wsData.filter(item => item.id === data.id)[0].action,
Object.assign({requestParams: this.wsData.filter(item => item.id === data.id)[0].params }, {error: data.error})
);
}
} else {
let result = data.result;
if (result === "ok") result = { result: result };
this.store.dispatch(
this.wsData.filter(item => item.id === data.id)[0].action,
Object.assign({requestParams: this.wsData.filter(item => item.id === data.id)[0].params }, result)
)
}
} else this.passToStore('socket_on_message', data)
}
};
}
sendObj (method, params, action = '') {
if (this.instance.readyState === WebSocket.OPEN) {
let id = Math.floor(Math.random() * 10000) + 1
this.wsData.push({
id: id,
action: action,
params: params
})
this.instance.send(this.createMessage(method, params, id));
}
}
}
+39 -17
View File
@@ -1,22 +1,40 @@
import Dashboard from '../pages/Dashboard.vue'
//import Status from '../pages/Status.vue'
import Webcam from '../pages/Webcam.vue'
import Console from '../pages/Console.vue'
import Heightmap from '../pages/Heightmap.vue'
import Files from '../pages/Files.vue'
//import SettingsGeneral from '../pages/settings/general.vue'
//import SettingsMachine from '../pages/settings/machine.vue'
import Settings from '../pages/Settings.vue'
import SettingsInterface from '../pages/settings/interface.vue'
import SettingsMachine from '../pages/settings/machine.vue'
const routes = [
{
title: "Dashboard",
path: '/',
icon: 'view-dashboard',
component: Dashboard
component: Dashboard,
alwaysShow: true,
},
{
title: "Webcam",
path: '/cam',
icon: 'webcam',
component: Webcam,
alwaysShow: false,
},
{
title: "Console",
path: '/console',
icon: 'code-tags',
component: Console
icon: 'console-line',
component: Console,
alwaysShow: true,
},
{
title: "Heightmap",
path: '/heightmap',
icon: 'grid',
component: Heightmap,
alwaysShow: false,
},
/*{
title: "Current Job",
@@ -28,27 +46,31 @@ const routes = [
title: "G-Code Files",
path: '/files',
icon: 'printer-3d-nozzle',
component: Files
component: Files,
alwaysShow: false,
},
/*{
{
title: "Settings",
path: '/settings',
redirect: '/settings/machine',
icon: 'wrench',
component: Settings,
alwaysShow: true,
children: [
{
title: 'General',
path: '/settings/general',
icon: 'settings',
component: SettingsGeneral
},
{
title: 'Machine',
path: '/settings/machine',
icon: 'settings-box',
component: SettingsMachine
component: SettingsMachine,
alwaysShow: true,
},
{
title: 'Interface',
path: '/settings/interface',
component: SettingsInterface,
alwaysShow: true,
},
]
},*/
},
];
+294 -60
View File
@@ -1,28 +1,26 @@
import Vue from 'vue'
import router from "../plugins/router";
import store from "./index";
import axios from "axios";
export default {
socket_on_open ({ commit }) {
socket_on_open ({ commit, dispatch }) {
commit('setConnected');
window.console.log('Socket connected');
dispatch('initServer');
},
socket_on_close ({ commit }, event) {
commit('setDisconnected')
if (event.wasClean) {
window.console.log('Socket closed clear')
} else {
window.console.error('Connection failure')
}
window.console.error('Code: ' + event.code)
},
commit('setDisconnected');
if (event.wasClean) window.console.log('Socket closed clear')
else window.console.error('Connection failure')
socket_on_error ({ commit }, data) {
commit('reportError', data);
window.console.error('Code: ' + event.code)
},
socket_on_message ({ commit, state }, data) {
if (!state.socket.isConnected) commit('setConnected');
switch(data.method) {
case 'notify_status_update':
commit('setPrinterData', data.params[0]);
@@ -32,109 +30,288 @@ export default {
commit('addGcodeResponse', data.params[0]);
break;
case 'notify_printer_state_changed':
commit('setPrinterStatus', data.params[0]);
case 'notify_klippy_disconnected':
commit('setKlippyDisconnected');
break;
/*case 'notify_klippy_state_changed':
commit('setPrinterStatus', data.params[0]);
break;*/
case 'notify_filelist_changed':
commit('setFileList', data.params[0].filelist);
switch(data.params[0].action) {
case 'upload_file':
commit('setFileChangeUploadFile', data.params[0]);
break;
case 'delete_file':
commit('setFileChangeDeleteFile', data.params[0]);
break;
case 'move_item':
commit('setFileChangeMoveItem', data.params[0]);
break;
case 'create_dir':
commit('setFileChangeCreateDirectory', data.params[0]);
break;
case 'delete_dir':
commit('setFileChangeDeleteDirectory', data.params[0]);
break;
default:
window.console.error("Unknown filelist_changed action: "+data.params[0].action);
break;
}
break;
case 'notify_paused_state_changed':
commit('setPausedState', data.params[0]);
case 'notify_metadata_update':
commit('setMetadata', data.params[0]);
break;
default:
if (data.result !== "ok") {
window.console.log("Default return");
if (data.error) window.console.error("JSON-RPC: " + data.error.message);
else window.console.log(data);
if (
data.error &&
data.error.message !== "Klippy Request Timed Out" &&
data.error.message !== "Klippy Disconnected"
) window.console.error("JSON-RPC: " + data.error.message);
else if (!data.error) window.console.log(data);
}
}
},
socket_reconnect ({ commit }, count) {
commit('setConnected');
window.console.log(count)
initServer() {
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: '/config' }, 'getDirectoryRoot');
Vue.prototype.$socket.sendObj('server.info', {}, 'getServerInfo');
Vue.prototype.$socket.sendObj('server.gcode_store', {}, 'getGcodeStore');
},
socket_reconnect_error ({ commit }) {
commit('setDisconnected');
window.console.error('Socket disconnected')
initPrinter() {
Vue.prototype.$socket.sendObj('printer.info', {}, 'getKlipperInfo');
// only available with klipper is ready
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'gcodes' }, 'getDirectory');
},
getDirectoryRoot({ commit }, data) {
if (data.files && data.files.filter((file) => file.filename === "gui.json").length) {
fetch('//'+store.state.socket.hostname+':'+store.state.socket.port+'/server/files/config/gui.json?time='+Date.now())
.then(res => res.json()).then(file => {
commit('setSettings', file);
});
}
},
saveGuiSettings({ commit, state }) {
commit('setLoadingSaveGuiConfige', true);
let file = new File([JSON.stringify({ webcam: state.webcam, gui: state.gui })], 'gui.json');
let formData = new FormData();
formData.append('file', file);
formData.append('root', 'config');
axios.post('//' + state.socket.hostname + ':' + state.socket.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
commit('setLoadingSaveGuiConfige', false);
}).catch(() => {
window.console.error("Error save gui.json!");
});
},
getServerInfo({ commit, dispatch }, data) {
commit('setServerInfo', {
klippy_connected: data.klippy_connected,
})
if (data.klippy_connected) {
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'getDirectory');
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'getDirectory');
//load plug data
if (data.plugins.includes("power") !== false) Vue.prototype.$socket.sendObj('machine.gpio_power.devices', {}, 'getPowerDevices');
dispatch('initPrinter');
} else {
setTimeout(function(){
Vue.prototype.$socket.sendObj('server.info', {}, 'getServerInfo');
}, 1000);
}
},
getGcodeStore({ commit }, data) {
commit('setGcodeStore', data);
},
getKlipperInfo({ commit }, data) {
commit('setPrinterData', {
hostname: data.hostname,
version: data.version
software_version: data.software_version,
cpu_info: data.cpu_info,
webhooks: {
state: data.state,
state_message: data.state_message,
}
});
Vue.prototype.$socket.sendObj('printer.objects.list', {}, 'getObjectsList');
Vue.prototype.$socket.sendObj('printer.gcode.help', {}, 'getHelpList');
},
getObjectInfo({ commit }, data) {
commit('setObjectData', data);
getObjectsList({ commit }, data) {
commit('setObjectData', data.objects);
let subscripts = {}
for (let key of data.objects) {
let nameSplit = key.split(" ");
if (
nameSplit[0] !== "gcode_macro" &&
nameSplit[0] !== "menu"
) subscripts = {...subscripts, [key]: null }
}
if (subscripts !== {}) Vue.prototype.$socket.sendObj('printer.objects.subscribe', { objects: subscripts }, "getPrinterData");
Vue.prototype.$socket.sendObj("server.temperature_store", {}, "getHeatersHistory");
},
getPrinterConfig({commit}, data) {
commit('setPrinterConfig', data);
getPrinterData({ commit }, data) {
if (data.status) commit('setPrinterData', data.status);
},
addSubscription(state, data) {
window.console.log(state);
window.console.log(data);
getHeatersHistory({ commit }, data) {
commit('setHeaterHistory', data);
},
getFileList({ commit }, data) {
commit('setFileList', data);
commit('setLoadingGcodeRefresh', false);
getDirectory({ commit }, data) {
commit('setDirectory', data);
commit('removeLoading', { name: 'loadingGcodeRefresh' });
},
setLoadingSendGcode({commit}, value) {
commit('setLoadingSendGcode', value);
getMetadata({ commit }, data) {
commit('setMetadata', data);
},
setLoadingEmergencyStop({commit}) {
commit('setLoadingEmergencyStop', false);
getMetadataCurrentFile({ commit }, data) {
commit('setMetadataCurrentFile', data);
},
setLoadingPrintPause({commit}) {
commit('setLoadingPrintPause', false);
getPostDirectory({ commit }, data) {
if (data.error) {
Vue.$toast.error(data.error.message);
} else if (data.result === "ok") {
let newPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
Vue.$toast.success("Successfully created "+newPath);
commit('voidMutation');
}
},
setLoadingPrintResume({commit}) {
commit('setLoadingPrintResume', false);
getDeleteDirectory({ commit }, data) {
if (data.error) {
Vue.$toast.error(data.error.message);
} else if (data.result === "ok") {
let delPath = data.requestParams.path.substr(data.requestParams.path.lastIndexOf("/")+1);
Vue.$toast.success("Successfully deleted "+delPath);
commit('voidMutation');
}
},
setLoadingPrintCancel({commit}) {
commit('setLoadingPrintCancel', false);
getPostFileMove({ commit }, data) {
if (data.error) {
Vue.$toast.error(data.error.message);
} else if (data.result === "ok") {
let filename = data.requestParams.dest.substr(data.requestParams.dest.lastIndexOf("/")).replace("/", "");
let sourceDir = data.requestParams.dest.substr(0, data.requestParams.dest.lastIndexOf("/"));
let destDir = data.requestParams.dest.substr(0, data.requestParams.dest.lastIndexOf("/"));
if (sourceDir === destDir) Vue.$toast.success("Successfully renamed "+filename);
else Vue.$toast.success("Successfully moved "+filename);
commit('voidMutation');
}
},
getHelpList({ commit }, data) {
commit('setHelpList', data);
},
getPowerDevices({ commit }, data) {
if (data.error) {
if (data.error.code !== -32601) {
Vue.$toast.error(data.error.message);
}
} else {
commit('setPowerDevices', data.devices);
Vue.prototype.$socket.sendObj('machine.gpio_power.status', {}, 'getPowerDevicesStatus');
}
},
getPowerDevicesStatus({ commit }, data) {
if (data.error) {
if (data.error.code !== -32601) {
Vue.$toast.error(data.error.message);
}
} else {
commit('setPowerDevicesStatus', data);
}
},
setHeaterChartVisibility({ commit, dispatch }, data) {
commit('setHeaterChartVisibility', data);
dispatch('saveGuiSettings');
},
respondPrintPause({commit}) {
commit('removeLoading', { name: 'statusPrintPause' });
},
respondPrintResume({commit}) {
commit('removeLoading', { name: 'statusPrintResume' });
},
respondPrintCancel({commit}) {
commit('removeLoading', { name: 'statusPrintCancel' });
},
respondPrintClear({commit}) {
commit('removeLoading', { name: 'statusPrintClear' });
},
respondPrintReprint({commit}) {
commit('removeLoading', { name: 'statusPrintReprint' });
},
sendGcode({commit}, data) {
commit('setLoadingSendGcode', false);
commit('sendGcode', data);
commit('removeLoading', { name: 'loadingSendGcode' });
commit('addGcodeResponse', data);
},
responseHome({commit}) {
commit('setLoadingHome', false);
commit('removeLoading', { name: 'controlHomeAll' });
},
responseHomeX({commit}) {
commit('setLoadingHomeX', false);
commit('removeLoading', { name: 'controlHomeX' });
},
responseHomeY({commit}) {
commit('setLoadingHomeY', false);
commit('removeLoading', { name: 'controlHomeY' });
},
responseHomeZ({commit}) {
commit('setLoadingHomeZ', false);
commit('removeLoading', { name: 'controlHomeZ' });
},
responseQGL({commit}) {
commit('setLoadingQGL', false);
commit('removeLoading', { name: 'controlQGL' });
},
responseZTilt({commit}) {
commit('removeLoading', { name: 'controlZTilt' });
},
responseRestart({commit}) {
@@ -145,7 +322,64 @@ export default {
commit('setLoadingRestartFirmware', false);
},
responseEndstopStatus({ commit }, data) {
commit('setLoadingEndstopStatus', false);
commit('setEndstopStatus', data);
},
respondeExtruderRetract({commit}) {
commit('removeLoading', { name: 'extruderRetract' });
},
respondeExtruderDetract({commit}) {
commit('removeLoading', { name: 'extruderDetract' });
},
respondeBabySteppingDownFine({commit}) {
commit('removeLoading', { name: 'babySteppingDownFine' });
},
respondeBabySteppingDown({commit}) {
commit('removeLoading', { name: 'babySteppingDown' });
},
respondeBabySteppingUpFine({commit}) {
commit('removeLoading', { name: 'babySteppingUpFine' });
},
respondeBabySteppingUp({commit}) {
commit('removeLoading', { name: 'babySteppingUp' });
},
responseBedMeshLoad({commit}) {
commit('removeLoading', { name: 'bedMeshLoad' });
},
responseBedMeshClear({commit}) {
commit('removeLoading', { name: 'bedMeshClear' });
},
responseBedMeshCalibrate({commit}) {
commit('removeLoading', { name: 'bedMeshCalibrate' });
},
responseBedMeshSave({commit}) {
commit('removeLoading', { name: 'bedMeshSave' });
},
responseBedMeshRemove({commit}) {
commit('removeLoading', { name: 'bedMeshRemove' });
},
responsePowerToggle({ commit }, data) {
commit('setPowerDevicesStatus', data);
},
switchToDashboard() {
router.push("/");
}
}
},
setSettings({ commit }, data) {
commit('setSettings', data);
},
}
+184 -43
View File
@@ -1,32 +1,41 @@
function caseInsensitiveNameSort(a, b) {
let nameA = a.name.toUpperCase();
let nameB = b.name.toUpperCase();
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
return 0;
}
export default {
toolhead(state) {
return (state.socket.isConnected) ? state.printer.toolhead : null;
getVersion: state => {
return state.packageVersion
},
heaters: state => {
let heaters = [];
if (state.object.heater.available_heaters) {
if (state.printer.heaters.available_heaters) {
for (let [key, value] of Object.entries(state.printer)) {
if (state.object.heater.available_heaters.includes(key)) {
if (state.printer.heaters.available_heaters.includes(key)) {
let name = key;
let nameSplit = key.split(" ");
if (nameSplit.length > 1 && nameSplit[0] === "heater_generic") name = nameSplit[1];
heaters.push({
name: key,
name: name,
target: value.target,
temperature: value.temperature,
min_temp: state.printer.configfile.config[key] !== undefined ? parseFloat(state.printer.configfile.config[key].min_temp) : undefined,
max_temp: state.printer.configfile.config[key] !== undefined ? parseFloat(state.printer.configfile.config[key].max_temp) : undefined,
});
}
}
}
return heaters.sort((a, b) => {
let nameA = a.name.toUpperCase();
let nameB = b.name.toUpperCase();
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
return 0;
});
return heaters.sort(caseInsensitiveNameSort);
},
heatersCount: (state, getters) => {
@@ -49,62 +58,194 @@ export default {
}
}
return fans.sort((a, b) => {
let nameA = a.name.toUpperCase();
let nameB = b.name.toUpperCase();
return fans.sort(caseInsensitiveNameSort);
},
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
temperature_sensors: state => {
let sensors = [];
return 0;
});
for (let [key, value] of Object.entries(state.printer)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "temperature_sensor") {
sensors.push({
name: nameSplit[1],
temperature: value.temperature,
measured_min_temp: value.measured_min_temp,
measured_max_temp: value.measured_max_temp,
});
}
if (nameSplit[0] === "temperature_probe") {
sensors.push({
name: "Probe",
temperature: value.temperature,
//TODO: update measured_temps
measured_min_temp: 0,
measured_max_temp: 0,
});
}
}
return sensors.sort(caseInsensitiveNameSort);
},
current_file_size: state => {
let file = state.files.filter((file) => file.filename === state.printer.virtual_sdcard.current_file);
if (file.length) return file[0]['size'];
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.size;
}
return 0;
},
current_file_metadata: state => {
let file = state.files.filter((file) => file.filename === state.printer.virtual_sdcard.current_file);
if (file.length) return file[0];
return []
return state.printer.current_file;
},
bool_fan: state => {
return Object.entries(state.object).indexOf('fan');
current_file_estimated_time: state => {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.estimated_time;
}
return 0;
},
current_file_filament_total: state => {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.filament_total;
}
return 0;
},
fan: state => {
return Object.entries(state.printer).indexOf("fan") ? state.printer.fan : false;
},
is_printing: state => {
return (state.printer.virtual_sdcard.current_file !== "");
return (["printing", "paused"].includes(state.printer.print_stats.state));
},
getMacros: state => {
let array = [];
let hiddenMacros = [];
state.gui.dashboard.hiddenMacros.forEach(function(item,index) {
hiddenMacros[index] = item.toLowerCase();
});
for (let prop in state.config) {
if (prop.startsWith('gcode_macro') && !state.config[prop].hasOwnProperty('rename_existing')) {
for (let prop in state.printer.configfile.config) {
if (prop.startsWith("gcode_macro") &&
!Object.hasOwnProperty.call(state.printer.configfile.config[prop], "rename_existing") &&
!(hiddenMacros.indexOf(prop.replace("gcode_macro ", "").toLowerCase()) > -1)
) {
array.push({
'name': prop.replace('gcode_macro ', ''),
'prop': state.config[prop]
"name": prop.replace("gcode_macro ", ""),
"prop": state.printer.configfile.config[prop]
});
}
}
return array;
return array.sort(caseInsensitiveNameSort);
},
getAllMacros: state => {
let array = [];
for (let prop in state.printer.configfile.config) {
if (prop.startsWith("gcode_macro") &&
!Object.hasOwnProperty.call(state.printer.configfile.config[prop], "rename_existing")) {
array.push({
"name": prop.replace("gcode_macro ", ""),
"prop": state.printer.configfile.config[prop]
});
}
}
return array.sort(caseInsensitiveNameSort);
},
getFilamentSwitchSensors: state => {
let sensors = [];
for (let [key, value] of Object.entries(state.printer)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "filament_switch_sensor") {
sensors.push({
name: nameSplit[1],
enabled: value.enabled,
filament_detected: value.filament_detected,
});
}
}
return sensors.sort(caseInsensitiveNameSort);
},
getBedMeshProfiles: state => {
let profiles = [];
let currentProfile = "";
if (state.printer.bed_mesh) {
currentProfile = state.printer.bed_mesh.profile_name;
}
for (let [key, value] of Object.entries(state.printer.configfile.config)) {
let nameSplit = key.split(" ");
if (nameSplit.length > 1 && nameSplit[0] === "bed_mesh" && nameSplit[1] !== undefined) {
profiles.push({
name: nameSplit[1],
data: value,
is_active: (currentProfile === nameSplit[1] ? true: false),
});
}
}
return profiles.sort(caseInsensitiveNameSort);
},
getTitle: state => {
if (state.socket.isConnected) {
if (state.printer.pause_resume.is_paused) return "Pause Print";
else if (state.printer.virtual_sdcard.is_active) return (state.printer.virtual_sdcard.progress * 100).toFixed(0)+"% Printing - "+state.printer.virtual_sdcard.current_file;
if (state.printer.webhooks.state !== "ready") return "ERROR";
else if (state.printer.print_stats.state === "paused") return "Pause Print";
else if (state.printer.print_stats.state === "printing") return (state.printer.virtual_sdcard.progress * 100).toFixed(0)+"% Printing - "+state.printer.print_stats.filename;
else if (state.printer.print_stats.state === "complete") return "Complete - "+state.printer.print_stats.filename;
return state.printer.hostname;
} else return "KlipperWebControl";
}
}
return state.gui.general.printername ? state.gui.general.printername : state.printer.hostname;
} else return "Mainsail";
},
showDashboardWebcam: state => {
return (state.gui.webcam.url !== "" && state.gui.dashboard.boolWebcam);
},
getCurrentExtruder: state => {
if (state.printer.configfile.config === null) return null;
let extruder = {
name: "",
status: null,
config: null,
};
let extruderName = state.printer.toolhead.extruder;
extruder.name = extruderName;
if (state.printer.configfile.config[extruderName]) {
extruder.config = state.printer.configfile.config[extruderName];
}
if (state.printer[extruderName]) {
extruder.status = state.printer[extruderName];
}
return extruder;
},
powerDevices: state => {
return state.power.devices;
},
powerDevicesCount: (state, getters) => {
return getters.powerDevices.length;
},
}
+61 -52
View File
@@ -4,79 +4,88 @@ import VueToast from 'vue-toast-notification';
import actions from './actions'
import mutations from './mutations'
import getters from './getters'
import printer from './printer'
Vue.use(Vuex);
Vue.use(VueToast);
export default new Vuex.Store({
state: {
packageVersion: process.env.PACKAGE_VERSION || '0.0.0',
socket: {
hostname: window.location.hostname,
port: window.location.port,
reconnectInterval: 3000,
isConnected: false,
loadingGcodeUpload: false,
loadingGcodeRefresh: false,
loadingEmergencyStop: false,
loadingPrintPause: false,
loadingPrintResume: false,
loadingHome: false,
loadingHomeX: false,
loadingHomeY: false,
loadingHomeZ: false,
loadingQGL: false,
klippy_conntected: null,
loadingRestart: false,
loadingRestartFirmware: false,
loadingRebootHost: false,
loadingShutdownHost: false,
loadingSaveGuiConfig: false,
loadingEndstopStatus: false,
},
printer: {
hostname: '',
version: '',
toolhead: {
position: [],
homed_axes: [],
status: "",
print_time: 0,
printing_time: 0,
estimated_print_time: 0,
gui: {
general: {
printername: "",
},
pause_resume: {
is_paused: false
dashboard: {
boolWebcam: true,
boolTempchart: true,
boolConsole: false,
hiddenMacros: [],
hiddenTempChart: [],
},
idle_timeout: {
printing_time: 0,
state: "",
webcam: {
url: "",
rotate: false,
rotateDegrees: 90,
flipX: false,
flipY: false,
bool: false,
},
virtual_sdcard: {
progress: 0,
current_file: "",
is_active: false,
filament_used: 0,
file_position: 0,
print_duration: 0,
total_duration: 0,
gcodefiles: {
countPerPage: 10,
},
gcode: {
extrude_factor: 1,
speed_factor: 1,
},
fan: {
speed: 0,
settings: {
configfiles: {
countPerPage: 10,
}
}
},
object: {
heater: {
available_heaters: []
loadings: [],
printer: printer,
object: [],
temperaturChart: [],
power: {
devices: []
},
helplist: [],
filetree: [
{
isDirectory: true,
filename: 'gcodes',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config_examples',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config',
modified: new Date(),
childrens: []
}
},
config: {
},
temperaturChart: {
labels: [],
datasets: [],
},
files: [],
],
events: []
},
getters: getters,
mutations: mutations,
actions: actions
});
});
+466 -128
View File
@@ -1,173 +1,514 @@
import Vue from "vue";
import { colorArray, colorChamber, colorHeaterBed, temperaturChartSampleInterval, temperaturChartSampleLength } from './variables';
const objectAssignDeep = require(`object-assign-deep`);
import { findDirectory } from '../plugins/helpers';
import { colorArray, colorChamber, colorHeaterBed/*, temperaturChartSampleLength*/ } from './variables';
import defaultPrinter from './printer';
export default {
setConnected (state) {
state.socket.isConnected = true;
//TODO reset store
},
setDisconnected (state) {
state.socket.isConnected = false
Vue.prototype.$socket.reconnect();
state.socket.isConnected = false;
},
setKlippyDisconnected(state) {
Vue.set(state, '', {
webhooks: {
state: 'disconnected',
state_message: 'Disconnected...'
}
});
},
resetPrinter(state) {
//TODO check reset in storage
let printer = { ...defaultPrinter };
Object.assign(printer, { webhooks: state.printer.webhooks });
Vue.set(state, "printer", printer);
Vue.set(state, "helplist", []);
Vue.set(state, "loadings", []);
this.dispatch("initPrinter");
},
setServerInfo(state, data) {
Object.entries(data).forEach(([key, value]) => {
Vue.set(state.socket, key, value);
});
},
setPrinterData(state, data) {
Object.assign(state.printer, data);
if (data.requestParams) delete data.requestParams;
let now = Date.now();
if (Array.isArray(state.object.heater.available_heaters) && state.object.heater.available_heaters.length) {
let boolAddValues = false;
let now = new Date();
Object.entries(data).forEach(([key, value]) => {
if (state.temperaturChart.labels.length === 0 || now - state.temperaturChart.labels[state.temperaturChart.labels.length - 1] > temperaturChartSampleInterval) {
for (let [key, value] of Object.entries(data)) {
let keySplit = key.split(" ");
//update/restart printer state
if (
key === "webhooks" &&
state.printer.webhooks.state !== "ready" &&
state.printer.webhooks.state !== "" &&
value.state === "ready"
) {
this.commit("resetPrinter");
}
if (state.object.heater.available_heaters.includes(key) || keySplit[0] === "temperature_fan") {
if (keySplit[0] === "temperature_fan") key = keySplit[1];
//update printer state
if (typeof(value) === "object") {
Vue.set(state.printer, key, {
...state.printer[key],
...value
});
} else Vue.set(state.printer, key, value);
let index = state.temperaturChart.datasets.findIndex(element => element.label === key);
//update heaters
if (
Array.isArray(state.printer.heaters.available_heaters) &&
state.printer.heaters.available_heaters.length
) {
let keySplit = key.split(" ");
if (index >= 0) state.temperaturChart.datasets[index].data.push(value.temperature.toFixed(1));
else {
let color = '#f87979';
if (
state.printer.heaters.available_heaters.includes(key) ||
keySplit[0] === "temperature_fan" ||
keySplit[0] === "temperature_sensor" ||
keySplit[0] === "temperature_probe") {
switch (key) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.datasets.length]; break;
}
if (keySplit[0] === "temperature_fan") key = keySplit[1];
else if (keySplit[0] === "temperature_sensor") key = keySplit[1];
else if (keySplit[0] === "heater_generic") key = keySplit[1];
else if (keySplit[0] === "temperature_probe") key = "probe";
state.temperaturChart.datasets.push({
label: key,
data: [value.temperature.toFixed(1)],
borderColor: color,
backgroundColor: color,
fill: false,
borderDash: undefined,
borderWidth: 2,
pointRadius: 0,
pointHitRadius: 0,
showLine: true
});
}
this.commit('addTemperatureChartValue', { name: key, value: value, time: now });
}
}
});
},
boolAddValues = true;
setHeaterHistory(state, data) {
let now = new Date();
if (data !== undefined) {
Object.entries(data).sort().forEach(([key, datasets]) => {
let keySplit = key.split(" ");
if (keySplit.length > 1) key = keySplit[1];
if (keySplit[0] === "temperature_probe") key = "probe";
if (datasets.temperatures) {
let max = datasets.temperatures.length;
for (let i = 0; i < max; i++) {
let time = new Date(now.getTime() - 1000 * (max - i));
this.commit('addTemperatureChartValue', {
name: key,
value: {
temperature: datasets.temperatures[i],
target: datasets.targets[i],
},
type: keySplit[0],
time: time
});
}
}
});
}
},
if (boolAddValues) {
state.temperaturChart.labels.push(now);
addTemperatureChartValue(state, payload) {
// definations for delete old entries
let timeOld = new Date().getTime() - (1000 * 60 * 10);
let minResolution = 1000; // value in ms
let deletedIndex;
if (state.temperaturChart.labels.length > temperaturChartSampleLength) {
state.temperaturChart.labels.splice(0, state.temperaturChart.labels.length-temperaturChartSampleLength)
}
}
let index = state.temperaturChart.findIndex(element => element.label === payload.name);
if (index < 0) {
this.commit('addTemperatureChartHeater', {
name: payload.name,
type: payload.type,
});
index = state.temperaturChart.findIndex(element => element.label === payload.name);
}
let index_target = state.temperaturChart.findIndex(element => element.label === payload.name+'_target');
for (let [key, dataset] of Object.entries(state.temperaturChart.datasets)) {
if (dataset.data.length > temperaturChartSampleLength) {
state.temperaturChart.datasets[key].data.splice(0, dataset.data.length-temperaturChartSampleLength)
}
}
// update current temp in temperature chart
if (index >= 0) {
let temperature = 0;
if (payload.value.temperature !== undefined) temperature = payload.value.temperature.toFixed(1);
else if (state.temperaturChart[index].data.length) temperature = state.temperaturChart[index].data[state.temperaturChart[index].data.length - 1].y;
if (
(state.temperaturChart[index].data.length && (
(
state.temperaturChart[index].data[state.temperaturChart[index].data.length - 1].y !== temperature ||
payload.time-state.temperaturChart[index].data[state.temperaturChart[index].data.length - 1].x > minResolution
) && state.temperaturChart[index].data[state.temperaturChart[index].data.length - 1].x < payload.time
)) || state.temperaturChart[index].data.length === 0
) {
state.temperaturChart[index].data.push({
x: payload.time,
y: temperature
});
}
// delete old entries
while ((deletedIndex = state.temperaturChart[index].data.findIndex(item => item.x < timeOld)) > -1) {
state.temperaturChart[index].data.splice(deletedIndex, 1);
}
}
// update target temp in temperature chart
if (index_target >= 0) {
let target = 0;
if (payload.value.target !== undefined) target = payload.value.target.toFixed(1);
else if (state.temperaturChart[index_target].data.length) target = state.temperaturChart[index_target].data[state.temperaturChart[index_target].data.length - 1].y;
if (
(state.temperaturChart[index_target].data.length && (
(
state.temperaturChart[index_target].data[state.temperaturChart[index_target].data.length - 1].y !== target ||
payload.time-state.temperaturChart[index_target].data[state.temperaturChart[index_target].data.length - 1].x > minResolution
) && state.temperaturChart[index_target].data[state.temperaturChart[index_target].data.length - 1].x < payload.time
)) || state.temperaturChart[index_target].data.length === 0
) {
state.temperaturChart[index_target].data.push({
x: payload.time,
y: target
});
}
// delete old entries
while ((deletedIndex = state.temperaturChart[index_target].data.findIndex(item => item.x < timeOld)) > -1) {
state.temperaturChart[index_target].data.splice(deletedIndex, 1);
}
}
},
addTemperatureChartHeater(state, payload) {
let color = '';
switch (payload.name) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.filter(element => !element.label.endsWith("_target") && element.label !== "heater_bed" && element.label !== "chamber").length]; break;
}
let hidden = state.gui.dashboard.hiddenTempChart.indexOf(payload.name.toUpperCase()) >= 0 ? true : null;
state.temperaturChart.push({
label: payload.name,
data: [],
borderColor: color,
backgroundColor: color,
pointBackgroundColor: color,
fill: false,
borderWidth: 2,
hidden: hidden,
});
if (payload.type !== "temperature_sensor") {
state.temperaturChart.push({
label: payload.name+"_target",
data: [],
borderColor: color,
backgroundColor: color+'20',
pointBackgroundColor: color,
fill: true,
borderWidth: 0,
hidden: hidden,
});
}
},
setHeaterChartVisibility(state, data) {
let index = state.gui.dashboard.hiddenTempChart.indexOf(data.name.toUpperCase());
if (data.hidden && index === -1) state.gui.dashboard.hiddenTempChart.push(data.name.toUpperCase())
else if (data.hidden !== true && index > -1) state.gui.dashboard.hiddenTempChart.splice(index, 1);
},
setSettings(state, data) {
state = objectAssignDeep(state, data);
},
setObjectData(state, data) {
Object.assign(state.object, data);
},
for (let key of Object.keys(data)) {
let nameSplit = key.split(" ");
setFileChangeUploadFile(state, data) {
let filename = data.item.path;
if (data.item.path.lastIndexOf("/") >= 0) filename = data.item.path.substr(data.item.path.lastIndexOf("/")).replace("/", "");
let path = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.item.root+"/"+path).split("/"));
if (nameSplit[0] === "temperature_fan") {
Vue.prototype.$socket.sendObj('post_printer_subscriptions', { [key]: [] });
if (parent) {
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) < 0) {
let modified = new Date(data.item.modified * 1000);
parent.push({
isDirectory: false,
filename: filename,
modified: modified,
size: data.item.size,
metadataPulled: false,
});
}
}
},
setPrinterConfig(state, data) {
Vue.set(state, 'config', data.configfile.config);
setFileChangeDeleteFile(state, data) {
let currentPath = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let delPath = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.item.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setFileList(state, data) {
state.files = [];
setFileChangeMoveItem(state, data) {
let filenameOld = data.source_item.path.substr(data.source_item.path.lastIndexOf("/")+1);
let oldPath = data.source_item.path.substr(0, data.source_item.path.lastIndexOf("/") + 1);
for (let [key, file] of Object.entries(data)) {
state.files.push({
number: key,
filename: file.filename,
modified: Date.parse(file.modified),
size: file.size,
let filenameNew = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
let newPath = data.item.path.substr(0, data.item.path.lastIndexOf("/") + 1);
oldPath = findDirectory(state.filetree, (data.source_item.root+"/"+oldPath).split("/"));
let indexFile = oldPath.findIndex(element => element.filename === filenameOld);
if (indexFile >= 0 && oldPath[indexFile]) {
let file = oldPath.splice(indexFile, 1)[0];
file.filename = filenameNew;
newPath = findDirectory(state.filetree, (data.item.root+"/"+newPath).split("/"));
newPath.push(file);
}
},
setFileChangeCreateDirectory(state, data) {
let dirname = data.item.path.substr(data.item.path.lastIndexOf("/") + 1);
let path = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.item.root+"/"+path).split("/"));
if (parent) {
parent.push({
isDirectory: true,
filename: dirname,
modified: new Date(),
childrens: [],
});
}
//state.files = data;
},
setFileChangeDeleteDirectory(state, data) {
let currentPath = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let delPath = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.item.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setDirectory(state, data) {
let parent = undefined;
//let parentPath = "";
if (data && data.requestParams && data.requestParams.path) {
let arrayPath = data.requestParams.path.split("/");
parent = findDirectory(state.filetree, arrayPath);
//parentPath = data.requestParams.path;
}
if (parent === undefined) parent = state.filetree;
if (Array.isArray(parent) && parent.length) {
for (const [key, item] of Object.entries(parent)) {
if (
item.isDirectory &&
data.dirs !== undefined &&
data.dirs.length > 0 &&
data.dirs.findIndex(element => element.dirname === item.filename) < 0
) parent.splice(key, 1);
else if (!item.isDirectory && data.files.findIndex(element => element.filename === item.filename) < 0) parent.splice(key, 1);
}
}
if (data.dirs && data.dirs.length) {
for (let dir of data.dirs) {
if (!parent.find(element => (element.isDirectory === true && element.filename === dir.dirname))) {
parent.push({
isDirectory: true,
filename: dir.dirname,
modified: new Date(dir.modified * 1000),
childrens: [],
});
Vue.prototype.$socket.sendObj('server.files.get_directory', { path: data.requestParams.path+'/'+dir.dirname }, 'getDirectory');
}
}
}
if (data.files && data.files.length) {
for (let file of data.files) {
if (file.filename === "gui.json") continue;
if (!parent.find(element => (element.isDirectory === false && element.filename === file.filename))) {
parent.push({
isDirectory: false,
filename: file.filename,
modified: new Date(file.modified * 1000),
size: parseInt(file.size),
metadataPulled: false,
});
}
}
}
},
setMetadata(state, data) {
if (data !== undefined && data.filename !== "") {
if (data.filename === state.printer.print_stats.filename) {
this.commit('setMetadataCurrentFile', { data: data });
}
let filename = "gcodes/"+data.filename;
let dirArray = filename.split("/");
filename = dirArray[dirArray.length-1];
let path = findDirectory(state.filetree, dirArray);
let index = path.findIndex(element => element.filename === filename);
if (index >= 0 && path[index]) {
const safeDefault = (value, def = undefined) => value ? value : def;
let newData = {
estimated_time: safeDefault(data.estimated_time),
filament_total: safeDefault(data.filament_total),
first_layer_height: safeDefault(data.first_layer_height),
first_layer_bed_temp: safeDefault(data.first_layer_bed_temp),
first_layer_extr_temp: safeDefault(data.first_layer_extr_temp),
layer_height: safeDefault(data.layer_height),
object_height: safeDefault(data.object_height),
slicer: safeDefault(data.slicer),
slicer_version: safeDefault(data.slicer_version),
thumbnails: safeDefault(data.thumbnails),
metadataPulled: true,
modified: new Date(data.modified * 1000),
size: parseInt(data.size),
};
let newObject = Object.assign(path[index], newData);
Vue.set(path, index, newObject);
}
}
},
setMetadataCurrentFile(state, data) {
if (data !== undefined && data.filename !== "") {
state.printer.current_file.thumbnails = [];
Vue.set(state.printer, 'current_file', data);
}
},
renameMetadataFilename(state, data) {
let sourceDirArray = data.source.split("/");
let sourceFilename = sourceDirArray[sourceDirArray.length-1];
sourceDirArray.splice(-1,1);
let sourcePath = findDirectory(state.filetree, sourceDirArray);
let destDirArray = data.dest.split("/");
let destFilename = destDirArray[destDirArray.length-1];
let index = sourcePath.findIndex(element => element.filename === sourceFilename);
if (destFilename === sourceFilename) {
destDirArray.splice(-1,1);
if (destDirArray[destDirArray.length-1] === "..") destDirArray.splice(-2,2);
let destPath = findDirectory(state.filetree, destDirArray);
destPath.push(sourcePath[index]);
sourcePath.splice(index, 1);
} else if (index >= 0 && sourcePath[index]) {
let newObject = Object.assign(sourcePath[index], { filename: destFilename });
Vue.set(sourcePath, index, newObject);
}
},
setHelpList(state, data) {
state.helplist = [];
for (let [command, description] of Object.entries(data)) {
state.helplist.push({
'commandLow': command.toLowerCase(),
'command': command,
'description': description,
});
}
},
setGcodeStore(state, data) {
data.gcode_store.forEach(message => {
state.events.push({
date: new Date(message.time * 1000),
message: message.message
});
});
},
addGcodeResponse(state, data) {
let message = data;
if (message.result !== undefined) message = message.result;
else if (message.error !== undefined) message = message.error.message;
state.events.push({
date: new Date(),
message: data
message: message
});
if (data.substring(0,2) === "!!") {
Vue.$toast.error(data);
if (message !== undefined && message.substring(0,2) === "!!") {
Vue.$toast.error(message);
}
},
setLoadingSendGcode(state, value) {
state.socket.loadingSendGcode = value;
setEndstopStatus(state, data) {
delete data.requestParams;
Vue.set(state.printer, 'endstops', data);
},
sendGcode(state) {
state.socket.loadingSendGcode = false;
setLoading(state, data) {
if (!state.loadings.includes(data.name)) {
state.loadings.push(data.name);
}
},
setPrinterStatus(state, value) {
state.printer.toolhead.status = value;
removeLoading(state, data) {
state.loadings = state.loadings.filter(function(ele){ return ele !== data.name; });
},
setLoadingGcodeUpload(state, value) {
state.socket.loadingGcodeUpload = value;
setPrinterStatusDetails(state, data) {
if (data !== undefined && data.is_ready !== undefined) {
state.socket.error_detected = data.error_detected;
state.socket.is_ready = data.is_ready;
state.socket.klippy_message = data.message;
}
},
setLoadingGcodeRefresh(state, value) {
state.socket.loadingGcodeRefresh = value;
setPowerDevices(state, data) {
Vue.set(state.power, 'devices', data);
},
setLoadingEmergencyStop(state, value) {
state.socket.loadingEmergencyStop = value;
},
setLoadingPrintPause(state, value) {
state.socket.loadingPrintPause = value;
},
setLoadingPrintResume(state, value) {
state.socket.loadingPrintResume = value;
},
setLoadingPrintCancel(state, value) {
state.socket.loadingPrintCancel = value;
},
setLoadingHome(state, value) {
state.socket.loadingHome = value;
},
setLoadingHomeX(state, value) {
state.socket.loadingHomeX = value;
},
setLoadingHomeY(state, value) {
state.socket.loadingHomeY = value;
},
setLoadingHomeZ(state, value) {
state.socket.loadingHomeZ = value;
},
setLoadingQGL(state, value) {
state.socket.loadingQGL = value;
setPowerDevicesStatus(state, data) {
for (let key in data) {
let devIdx = state.power.devices.findIndex(device => device.id === key);
if (devIdx >= 0) {
Vue.set(state.power.devices[devIdx], 'status', data[key] === 'off' ? 0 : 1);
}
}
},
setLoadingRestart(state, value) {
@@ -178,31 +519,28 @@ export default {
state.socket.loadingRestartFirmware = value;
},
setLoadingRebootHost(state, value) {
state.socket.loadingRebootHost = value;
},
setLoadingShutdownHost(state, value) {
state.socket.loadingShutdownHost = value;
},
setLoadingSaveGuiConfige(state, value) {
state.socket.loadingSaveGuiConfig = value;
},
setLoadingEndstopStatus(state, value) {
state.socket.loadingEndstopStatus = value;
},
reportError(state, data) {
//Vue.$toast.error(data.message);
window.console.log(data);
},
setPausedState(state, data) {
switch (data) {
case 'paused':
state.printer.pause_resume.is_paused = true;
break;
case 'resumed':
state.printer.pause_resume.is_paused = false;
break;
case 'cleared':
state.printer.pause_resume.is_paused = false;
break;
default:
window.console.log('setPausedState -> Default: '+data);
}
},
voidMutation() {
},
}
}
+65
View File
@@ -0,0 +1,65 @@
export default {
software_version: '',
hostname: '',
cpu_info: '',
webhooks: {
state: '',
state_message: '',
},
heaters: {
available_heaters: [],
},
toolhead: {
position: [],
homed_axes: "",
extruder: "",
status: "",
print_time: 0,
printing_time: 0,
estimated_print_time: 0,
max_velocity: 0,
max_accel: 0,
max_accel_to_decel: 0,
square_corner_velocity: 0,
},
pause_resume: {
is_paused: false
},
idle_timeout: {
printing_time: 0,
state: "",
},
display_status: {
message: null,
progress: 0,
},
virtual_sdcard: {
progress: 0,
is_active: false,
file_position: 0,
},
print_stats: {
print_duration: 0,
filament_used: 0,
total_duration: 0,
filename: "",
state: "",
message: ""
},
current_file: {
},
gcode_move: {
extrude_factor: 1,
speed_factor: 1,
homing_origin: [0,0,0,0],
absolute_coordinates: true,
absolute_extrude: true,
speed: 0,
},
endstops: {},
configfile: {
config: {},
config_changed: false,
}
}
+4 -5
View File
@@ -1,18 +1,17 @@
export const hostname = window.location.host;
//export const hostname = "voron250.local:8080";
//export const hostname = window.location.host;
export const hostname = "voron250.local:8080";
//export const hostname = "kossel.local:8080";
export const colorArray = [
'#F44336',
'#E91E63',
'#9C27B0',
'#673AB7',
'#3F51B5',
'#00BCD4',
'#009688',
'#E91E63',
];
export const colorHeaterBed = '#2196F3';
export const colorChamber = '#4CAF50';
export const temperaturChartSampleInterval = 1000;
export const temperaturChartSampleLength = 600;
export const temperaturChartSampleLength = 1200;
+128 -2
View File
@@ -1,5 +1,131 @@
const webpack = require('webpack')
const fs = require('fs')
const packageJson = fs.readFileSync('./package.json')
const version = JSON.parse(packageJson).version || 0
module.exports = {
"transpileDependencies": [
"vuetify"
]
}
],
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
'process.env': {
PACKAGE_VERSION: '"' + version + '"'
}
})
]
},
pwa: {
serviceWorker:false,
iconPaths: {
favicon16: 'img/icons/favicon-16x16.png',
favicon32: 'img/icons/favicon-32x32.png',
appleTouchIcon: 'img/icons/apple-touch-icon-180x180.png',
maskIcon: 'img/icons/safari-pinned-tab.svg',
msTileImage: 'img/icons/mstile-150x150.png'
},
manifestPath: 'manifest.json',
name: 'Mainsail',
themeColor: '#000000',
msTileColor: '#000000',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
manifestOptions: {
"name": "Mainsail",
"short_name": "Mainsail",
"start_url": "/",
"prefer_related_applications": false,
"display": "standalone",
"theme_color": "#000000",
"background_color": "#000000",
"icons": [
{
"src": "./img/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/android-chrome-maskable-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "./img/icons/android-chrome-maskable-512x512",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "./img/icons/apple-touch-icon-60x60.png",
"sizes": "60x60",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/apple-touch-icon-76x76.png",
"sizes": "76x768",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/apple-touch-icon-120x120.png",
"sizes": "120x120",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/apple-touch-icon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/apple-touch-icon-180x180.png",
"sizes": "180x180",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/favicon-16x16.png",
"sizes": "16x16",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/favicon-32x32.png",
"sizes": "32x32",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/msapplication-icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/mstile-150x150.png",
"sizes": "150x150",
"type": "image/png",
"purpose": "any"
},
{
"src": "./img/icons/safari-pinned-tab.svg",
"sizes": "150x150",
"type": "image/svg+xml",
"purpose": "any"
}
]
}
}
}