Compare commits

..
43 Commits
Author SHA1 Message Date
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
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
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
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
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
39 changed files with 2857 additions and 2416 deletions

No files matched your search

+1 -2
View File
@@ -1,8 +1,7 @@
# Overview
- [Installation](installation.md)
- [Update from 0.1.x to latest](update-0.1.x.md)
- [Update from 0.0.x to 0.1.x](update-0.0.x.md)
- [Update](update.md)
- [Macros](macros.md)
- [Slicer upload](slicer-upload.md)
- [Gcode thumbnails (PrusaSlicer & SuperSlicer only)](gcode-thumbnails.md)
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 617 KiB

After

Width:  |  Height:  |  Size: 734 KiB

+44 -34
View File
@@ -21,29 +21,47 @@ sudo apt install git dfu-util
```
## Install Klipper
Moonraker is still in alpha development, and thus some of its dependencies
in Klipper have yet to be merged. Until this has been done it will be
necessary to add a remote and work off a developmental branch of Klipper
to correctly run Moonraker.
In this step, we install klipper and change to the development branch of Klipper.
In this step, we install klipper.
```
cd ~
git clone https://github.com/KevinOConnor/klipper
cd ~/klipper
git remote add arksine https://github.com/arksine/klipper
git fetch arksine
git reset --hard arksine/dev-moonraker-testing
./scripts/install-octopi.sh
```
Note that you are now in a detached head state and you cannot pull. Any
time you want to update to the latest version of this branch you have to
`git fetch arksine` and `git reset --hard arksine/dev-moonraker-testing`.
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`.
Now you can copy your `printer.cfg` in your home directory and restart klipper.
Please check the `klippy.log`, if Klipper starts correctly and then continue
the guide.
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:
@@ -63,32 +81,24 @@ When the script completes it should start both Moonraker and Klipper. In
`Moonraker: server connection detected`
### Configure Moonraker
All other configuration is sent to the server via Klippy, thus it is done
in printer.cfg. A basic configuration that authorizes clients on a range
A basic configuration that authorizes clients on a range
from 192.168.1.1 - 192.168.1.254 is as follows.
Edit your printer.cfg with nano ~/printer.cfg and add the following lines:
Create the configfile with `nano ~/moonraker.conf` and add the following lines:
```
[moonraker]
[server]
host: 0.0.0.0
config_path: ~/klipper_config
[authorization]
enabled: true
trusted_clients:
192.168.1.0/24
```
We also need a `virtual_sdcard` for store the gcode files:
```
[virtual_sdcard]
path: /home/pi/sdcard
```
Finally, we create the virtual_sdcard directory:
```
mkdir ~/sdcard
```
Restart klipper (sudo service klipper restart`) and check your klippy.log if klipper is starting correct again.
When klipper is running, open the url `http://<printer-ip>:7125/printer/info` in your browser. If you see a content like this
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)"}}
```
@@ -231,7 +241,7 @@ Now we can install Mainsail (static 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.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.2.1/mainsail-beta-0.2.1.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
+1 -1
View File
@@ -16,7 +16,7 @@ gcode:
M141 S0
M106 S0
CLEAR_PAUSE
RESET_SD
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
-47
View File
@@ -1,47 +0,0 @@
# Update from 0.0.x to 0.1.x
Between 0.0.x and 0.1.x was a big rebuild of Moonraker. Thats the reason for the separate guide.
## Change Klipper branch
```
cd ~/klipper
git fetch arksine
git checkout arksine/dev-moonraker-testing
```
## Install new Moonraker branch
```
cd ~
git clone https://github.com/Arksine/moonraker.git
```
we have to remove the old moonraker service and install the new version:
```
cd ~/moonraker/scripts
./uninstall-moonraker.sh
./install-moonraker.sh
```
Finally, we have to change the `printer.cfg`. The section `\[api_server\]` is now called `\[moonraker\]`.
## Update the nginx configuration
The nginx configuration (`/etc/nginx/sites-available/mainsail`) will need the following additional section:
```
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;
}
```
Restart nginx with `sudo service nginx restart`
## Update static files from Mainsail
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
```
-24
View File
@@ -1,24 +0,0 @@
# Update from 0.1.x to latest
Updates after 0.1.x are easier than 0.0.x to 0.1.x.
## Update Moonraker
```
cd ~/moonraker
git pull
sudo service moonraker restart
```
## Update Klipper
```
cd ~/klipper
git fetch arksine
git checkout arksine/dev-moonraker-testing
sudo service klipper restart
```
## Update static files from Mainsail
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
```
+41
View File
@@ -0,0 +1,41 @@
# 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.1/mainsail-beta-0.2.1.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
+1554 -1649
View File
File diff suppressed because it is too large. Load diff
+13 -11
View File
@@ -12,31 +12,33 @@
"chart.js": "^2.9.3",
"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.2.0",
"vue-context": "^6.0.0",
"vue-headful": "^2.1.0",
"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.4.1",
"vuetify": "^2.3.4",
"vue-toast-notification": "^0.5.0",
"vuetify": "^2.3.8",
"vuex": "^3.5.1"
},
"devDependencies": {
"@mdi/font": "^5.3.45",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@mdi/font": "^5.5.55",
"@vue/cli-plugin-babel": "^4.5.3",
"@vue/cli-plugin-eslint": "^4.5.3",
"@vue/cli-service": "^4.5.3",
"babel-eslint": "^10.1.0",
"css-loader": "^3.6.0",
"eslint": "^7.5.0",
"css-loader": "^4.2.1",
"eslint": "^7.6.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.10",
"sass-loader": "^9.0.2",
"sass-loader": "^9.0.3",
"vue-cli-plugin-route": "0.0.7",
"vue-cli-plugin-vuetify": "^2.0.7",
"vue-router": "^3.3.4",
"vue-router": "^3.4.3",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.6.0"
},
+3 -2
View File
@@ -1,6 +1,7 @@
{
"socket": {
"hostname": "kossel.local",
"port": 80
"hostname": "voron250.local",
"port": 80,
"metadataRequestDelay": 2000
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

+11 -12
View File
@@ -28,7 +28,7 @@
(
category.title !== 'Webcam' &&
category.title !== 'Heightmap' &&
(is_ready || category.alwaysShow)
(klippy_state !== 'error' || category.alwaysShow)
)
">
<v-icon>mdi-{{ category.icon }}</v-icon>
@@ -38,7 +38,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 v-if="is_ready || page.alwaysShow">
<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>
@@ -76,8 +76,9 @@
</v-dialog>
<v-footer app class="d-block">
<span v-if="version">{{ version }}</span>
<span class="float-right">Made with <img src="/img/heard.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>
<span>v0.2.1</span>
<span v-if="version"> - {{ 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>
@@ -113,16 +114,15 @@ export default {
toolhead: state => state.printer.toolhead,
hostname: state => state.printer.hostname,
printername: state => state.gui.general.printername,
version: state => state.printer.version,
version: state => state.printer.software_version,
loadingEmergencyStop: state => state.socket.loadingEmergencyStop,
isConnected: state => state.socket.isConnected,
isConnecting: state => !state.socket.isConnected,
virtual_sdcard: state => state.printer.virtual_sdcard,
current_file: state => state.printer.virtual_sdcard.filename,
current_file: state => state.printer.print_stats.filename,
boolNaviWebcam: state => state.gui.webcam.bool,
klippy_state: state => state.socket.klippy_state,
is_ready: state => state.socket.is_ready,
config: state => state.config,
klippy_state: state => state.printer.webhooks.state,
config: state => state.printer.configfile.config,
}),
...mapGetters([
'getTitle'
@@ -135,8 +135,7 @@ export default {
},
drawFavicon(val) {
let favicon = document.getElementById('favicon');
if (val === 0) favicon.href = "/favicon.ico";
else {
if (val > 0 && val < 100) {
let faviconSize = 64;
let canvas = document.createElement('canvas');
@@ -175,7 +174,7 @@ export default {
context.fill();
favicon.href = canvas.toDataURL('image/png');
}
} else favicon.href = "/favicon.ico"
}
},
watch: {
+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

+43 -37
View File
@@ -12,15 +12,26 @@ export default {
props: ['chartData'],
data() {
return {
timer: '',
options: {
events: ['onHover'],
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)',
@@ -49,16 +60,19 @@ export default {
},
tooltips: {
enabled: true,
mode: 'nearest',
caretPadding: 20,
intersect: false,
callbacks: {
title: function (tooltipItem) {
let date = new Date(tooltipItem[0].label);
return date.getHours()+":"+date.getMinutes()+":"+date.getSeconds();
return date.getHours()+":"+(date.getMinutes() < 10 ? "0" : "")+date.getMinutes()+":"+(date.getSeconds() < 10 ? "0" : "")+date.getSeconds();
},
label: function (tooltipItem, data) {
let label_target = data['datasets'][tooltipItem.datasetIndex].label+"_target";
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) return tooltipItem.value+" / "+target_dataset.data[tooltipItem.index];
if (target_dataset !== undefined && target_dataset.data[tooltipItem.index] !== undefined) return tooltipItem.value+" / "+target_dataset.data[tooltipItem.index].y;*/
return tooltipItem.value;
},
}
@@ -67,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: {
@@ -120,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() {
@@ -131,9 +142,4 @@ export default {
this.$data._chart.update();
}
},
watch: {
chartData () {
this.update();
}
}
}
+6 -6
View File
@@ -4,14 +4,14 @@
<template>
<v-card>
<v-row class="" v-if="!is_printing">
<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="!is_printing">
<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="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>
@@ -24,7 +24,7 @@
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
<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="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>
@@ -37,7 +37,7 @@
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
<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="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>
@@ -81,12 +81,12 @@
computed: {
...mapState({
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
}),
...mapGetters([
'getMacros',
'is_printing'
])
},
methods: {
+12 -13
View File
@@ -3,7 +3,7 @@
</style>
<template>
<v-card v-if="!(printer_state === 'Printing' && printer_is_printing)">
<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>
@@ -29,8 +29,8 @@
</v-row>
<v-row class="px-3">
<v-col class="col-12 text-center">
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && extruder.config.min_extrude_temp < extruder.status.temperature)"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && extruder.config.min_extrude_temp < extruder.status.temperature)"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && (extruder.config.min_extrude_temp < extruder.status.temperature || !extruder.config.min_extrude_temp))"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && (extruder.config.min_extrude_temp < extruder.status.temperature || !extruder.config.min_extrude_temp))"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
</v-col>
</v-row>
</v-card>
@@ -50,26 +50,19 @@
feedrate: 5,
loadingRetract: false,
loadingDetract: false,
extruder: null,
}
},
computed: {
...mapState({
config: state => state.config,
loadings: state => state.loadings,
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,
printer_state: state => state.printer.print_stats.state,
config: state => state.printer.configfile.config,
}),
...mapGetters([
'getMacros',
'getCurrentExtruder',
'is_printing'
]),
extruder: {
get: function() {
return this.$store.getters.getCurrentExtruder;
}
}
},
methods: {
setFeedAmount(value) {
@@ -96,6 +89,12 @@
this.loadingRetract = loadings.includes('extruderRetract');
this.loadingDetract = loadings.includes('extruderDetract');
},
config: {
handler() {
this.extruder = this.getCurrentExtruder;
},
immediate: true
}
}
}
</script>
+5 -5
View File
@@ -2,17 +2,17 @@
<v-card>
<v-list-item>
<v-list-item-avatar color="grey">
<v-icon dark v-if="error_detected">mdi-alert-circle</v-icon>
<v-icon dark v-if="!error_detected">mdi-information-variant</v-icon>
<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"><pre>{{ klippy_message }}</pre></v-flex>
<v-flex col class="text-left"><pre>{{ state_message }}</pre></v-flex>
</v-layout>
</v-card-text>
<v-divider class="my-2" ></v-divider>
@@ -29,8 +29,8 @@
export default {
computed: {
...mapState({
error_detected: state => state.socket.error_detected,
klippy_message: state => state.socket.klippy_message,
state: state => state.printer.webhooks.state,
state_message: state => state.printer.webhooks.state_message,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
}),
+9 -9
View File
@@ -17,18 +17,18 @@
<template>
<div>
<v-card 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>
<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-6" 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>
@@ -39,7 +39,7 @@
<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-6" 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-texture" left></v-icon>Extrusion Factor</span>
@@ -68,12 +68,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'
])
},
@@ -0,0 +1,456 @@
<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>
Configfiles
<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="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-pencil</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('get_directory', { path: 'config' }, 'getDirectory');
this.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
} else this.$socket.sendObj('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 = 'http://'+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('http://' + 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 = 'http://' + 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('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('http://' + 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('post_file_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(
'http://'+ 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('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>
@@ -1,3 +1,8 @@
<style>
.settings_dashboard_switch .v-messages {
display: none;
}
</style>
<template>
<v-card>
@@ -8,20 +13,20 @@
</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-card-text class="px-0 pt-3 content">
<v-row>
<v-col class="px-10 py-0">
<v-switch v-model="boolShowWebcamOnDashboard" label="Webcam"></v-switch>
<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"></v-switch>
<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"></v-switch>
<v-switch v-model="boolShowConsoleOnDashboard" label="Console" class="settings_dashboard_switch mt-0"></v-switch>
</v-col>
</v-row>
</v-card-text>
@@ -10,10 +10,10 @@
<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="max_velocity" :max="500" :extender-steps="100" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" class="mt-5" ></toolSlider>
<toolSlider label="ACCEL" v-bind:target="max_accel" :max="5000" :extender-steps="500" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" class="mt-5" ></toolSlider>
<toolSlider label="DECEL" v-bind:target="max_accel_to_decel" :max="5000" :extender-steps="500" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" class="mt-5" ></toolSlider>
<toolSlider label="SCV" v-bind:target="square_corner_velocity" :max="10" :extender-steps="5" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" class="mt-5" ></toolSlider>
<toolSlider label="VELOCITY" v-bind:target="max_velocity" :max="200" :extender="true" :extender-steps="100" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" class="mt-5" ></toolSlider>
<toolSlider label="ACCEL" v-bind:target="max_accel" :max="5000" :extender="true" :extender-steps="500" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" class="mt-5" ></toolSlider>
<toolSlider label="DECEL" v-bind:target="max_accel_to_decel" :max="5000" :extender="true" :extender-steps="500" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" class="mt-5" ></toolSlider>
<toolSlider label="SCV" v-bind:target="square_corner_velocity" :max="10" :extender="true" :extender-steps="5" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" class="mt-5" ></toolSlider>
</v-col>
</v-row>
</v-card-text>
+18 -6
View File
@@ -8,12 +8,12 @@
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class=" text-center text-lg-left">
<div><v-btn :href="'http://'+hostname+':'+port+'/server/files/klippy.log'" color="primary"><v-icon class="mr-sm-2">mdi-download</v-icon>Klipper Log</v-btn></div>
<div><v-btn :href="'http://'+hostname+':'+port+'/server/files/moonraker.log'" color="mt-3 primary"><v-icon class="mr-sm-2">mdi-download</v-icon>Moonraker Log</v-btn></div>
<div><v-btn @click="doRestart" :loading="loadingRestart" color="error" class="mt-3"><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn></div>
<div><v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FW <span class="d-none d-sm-block">Restart</span></v-btn></div>
<div><v-btn @click="doRebootHost" :loading="loadingRebootHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Host <span class="d-none d-sm-block">Reboot</span></v-btn></div>
<div><v-btn @click="doShutdownHost" :loading="loadingShutdownHost" class="mt-3" color="error"><v-icon class="mr-sm-2">mdi-power</v-icon>Host <span class="d-none d-sm-block">Shutdown</span></v-btn></div>
<div><v-btn :href="'http://'+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="'http://'+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>
@@ -47,10 +47,22 @@
methods: {
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$store.commit('setPrinterData', {
webhooks: {
state: 'shutdown',
state_message: 'RESTART'
}
});
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$store.commit('setPrinterData', {
webhooks: {
state: 'shutdown',
state_message: 'FIRMWARE RESTART'
}
});
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
},
doRebootHost() {
+2
View File
@@ -6,6 +6,7 @@ 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";
@@ -17,6 +18,7 @@ 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 {
+161 -106
View File
@@ -2,6 +2,10 @@
.vertical_align_center {
margin: auto 0;
}
.statusPanel-image-preview {
width: 100%;
}
</style>
<template>
@@ -10,104 +14,131 @@
<v-list-item-avatar color="grey"><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 class="mr-3">{{ printer_is_paused ? "Pause" : printer_state }}{{ printer_is_printing || printer_is_paused ? " - "+current_file : "" }}</v-list-item-subtitle>
<v-list-item-subtitle class="mr-3">{{ printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown" }}{{ ['printing', 'paused', 'complete', 'error'].includes(printer_state) ? " - "+current_file : "" }}</v-list-item-subtitle>
</v-list-item-content>
<v-btn class="orange" v-if="printer_state === 'Printing' && printer_is_printing && !printer_is_paused" @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 class="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadingStatusPause">pause job</v-btn>
<v-btn class="red" v-if="(printer_state === 'paused')" :loading="loadingStatusCancel" @click="btnCancelJob">cancel job</v-btn>
<v-btn class="orange ml-2" v-if="(printer_state === 'paused')" :loading="loadingStatusResume" @click="btnResumeJob">resume job</v-btn>
<v-btn class="orange ml-2" v-if="(printer_state === 'error')" :loading="loadingStatusClear" @click="btnClearJob">clear job</v-btn>
<v-btn class="primary ml-2" v-if="(printer_state === 'complete')" :loading="loadingStatusReprint" @click="btnReprintJob">reprint job</v-btn>
</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-if="display_message">
<v-flex col tag="strong" class="category-header">Message</v-flex>
<v-flex grow class="equal-width text-left vertical_align_center">
<v-flex tag="span">{{ display_message }}</v-flex>
</v-flex>
</v-layout>
<v-divider class="my-2" v-if="display_message" ></v-divider>
<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 pv-0 col-sm-4 pr-sm-0"
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 pv-0 col-sm-8 pl-sm-0' : 'col-12 pv-0'
">
<v-layout wrap class=" text-center" v-if="display_message">
<v-flex col tag="strong" class="category-header">Message</v-flex>
<v-flex grow class="equal-width text-left vertical_align_center">
<v-flex tag="span">{{ display_message }}</v-flex>
</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="display_message" ></v-divider>
<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-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">Z</v-flex>
<v-flex tag="span">{{ position.length ? position[2].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">
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 > 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-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 > 1000 ? (filament_used / 1000).toFixed(2)+"m" : filament_used.toFixed(2)+"mm" }}</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 py-0">
Estimations<br />based on
</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-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 wrap class=" text-center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
<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-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">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-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>
@@ -116,25 +147,33 @@
import { mapState, mapGetters } from 'vuex';
export default {
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.filename,
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,
}),
@@ -144,21 +183,28 @@
'current_file_metadata',
'current_file_estimated_time',
'current_file_filament_total',
'is_printing',
]),
},
methods: {
btnPauseJob() {
this.$store.commit('setLoadingPrintPause', true);
this.$socket.sendObj('post_printer_print_pause', { }, 'setLoadingPrintPause');
this.$store.commit('setLoading', { name: 'statusPrintPause' });
this.$socket.sendObj('post_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('post_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('post_printer_print_cancel', { }, 'respondPrintCancel');
},
btnClearJob() {
this.$store.commit('setLoading', {name: 'statusPrintClear'});
this.$socket.sendObj('post_printer_gcode_script', {script: 'SDCARD_RESET_FILE'}, 'respondPrintClear');
},
btnReprintJob() {
this.$store.commit('setLoading', {name: 'statusPrintReprint'});
this.$socket.sendObj('post_printer_print_start', { filename: this.current_file }, 'respondPrintReprint');
},
formatTime(seconds) {
let h = Math.floor(seconds / 3600);
@@ -169,6 +215,15 @@
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>
+5 -13
View File
@@ -37,7 +37,7 @@
<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" :min_temp="heater.min_temp" :max_temp="heater.max_temp" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
</v-col>
@@ -50,7 +50,7 @@
<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>
@@ -63,8 +63,8 @@
<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.toFixed(1)+'° / max: '+sensor.measured_max_temp.toFixed(1)+'°'">{{ sensor.temperature.toFixed(1) }}°C</span><br />
<small style="cursor: default;" :title="'min: '+sensor.measured_min_temp.toFixed(1)+'° / max: '+sensor.measured_max_temp.toFixed(1)+'°'">{{ sensor.name }}</small>
<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>
@@ -93,15 +93,13 @@
extruderTemps: [250,215,195,0],
loaded: false,
chartdata: {
labels: [],
datasets: []
}
}
},
computed: {
...mapState({
labels: state => state.temperaturChart.labels,
datasets: state => state.temperaturChart.datasets,
datasets: state => state.temperaturChart,
boolTempchart: state => state.gui.dashboard.boolTempchart,
}),
...mapGetters([
@@ -118,7 +116,6 @@
fillData () {
this.loaded = true;
this.chartdata = {
labels: this.labels,
datasets: this.datasets
}
}
@@ -126,11 +123,6 @@
mounted () {
this.fillData();
},
watch: {
labels() {
this.fillData();
}
}
}
</script>
+4 -6
View File
@@ -3,7 +3,7 @@
</style>
<template>
<v-card v-if="(printer_state === 'Printing' && printer_is_printing)">
<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>
@@ -13,7 +13,7 @@
<v-card-text class="py-1">
<v-row class="">
<v-col class="col-12 pb-0 text-center">
<p>Current Offset: {{ base_zpos.toFixed(2) }}mm</p>
<p>Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
</v-col>
</v-row>
<v-row>
@@ -51,10 +51,8 @@
computed: {
...mapState({
loadings: state => state.loadings,
base_zpos: state => state.printer.gcode.base_zpos,
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,
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,
}),
},
+2 -1
View File
@@ -42,7 +42,8 @@
},
methods: {
changeSensor() {
this.$socket.sendObj('post_printer_gcode_script', { script: 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 0 : 1) });
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 1 : 0);
this.$socket.sendObj('post_printer_gcode_script', { script: gcode });
}
},
watch: {
+32 -18
View File
@@ -5,7 +5,7 @@
<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" :label="label" :min="min" :max="max" @change="sendCmd" hide-details></v-slider></v-col>
<v-col class="col"><v-slider v-model="value" thumb-label="always" :label="label" :min="min" :max="variableMax" @change="sendCmd" hide-details></v-slider></v-col>
<v-col class="col-auto"><v-icon @click="increment">mdi-plus</v-icon></v-col>
</v-row>
</template>
@@ -16,7 +16,7 @@
data: function() {
return {
value: this.target * this.multi,
variableMax: 0,
variableMax: this.max,
}
},
props: {
@@ -58,6 +58,11 @@
required: false,
default: 100
},
extender: {
type: Boolean,
required: false,
default: false
},
multi: {
type: Number,
required: false,
@@ -79,28 +84,37 @@
this.value++;
this.sendCmd();
},
checkExpand() {
if (this.value > 0) {
if (this.value > this.variableMax) {
let tmpMulti = Math.ceil((this.value - this.variableMax) / this.extenderSteps);
this.variableMax += tmpMulti * this.extenderSteps;
} else if (this.value > (this.variableMax - this.extenderSteps)) {
this.variableMax += this.extenderSteps;
}
}
}
},
watch: {
target: function() {
this.value = this.target * this.multi;
},
/*value: function() {
if (this.value > 0) {
if (this.value > (this.variableMax - this.extenderSteps) && this.value < (this.variableMax + this.extenderSteps)) this.variableMax += this.extenderSteps;
else if (this.value > (this.variableMax - this.extenderSteps)) {
this.variableMax = (this.value / this.extenderSteps).toFixed(0) * this.extenderSteps;
if (this.variableMax < this.max) this.variableMax = this.max;
}
value: function() {
if (this.extender) {
setTimeout(() => {
this.checkExpand();
}, 1000);
}
}*/
}
},
/*created: function() {
/!*window.console.log("Test");
window.console.log(this.target+' * '+this.multi);
this.value = this.target * this.multi;*!/
window.console.log(this.target+' * '+this.multi);
this.variableMax = (this.value / this.extenderSteps + 1).toFixed(0) * this.extenderSteps;
if (this.variableMax < this.max) this.variableMax = this.max;
}*/
created: function() {
if (this.extender && this.value > this.variableMax) {
let tmpMulti = Math.ceil((this.value - this.variableMax) / this.extenderSteps);
this.variableMax += tmpMulti * this.extenderSteps;
if (this.variableMax === this.value) this.variableMax += this.extenderSteps;
}
}
}
</script>
+8 -9
View File
@@ -1,17 +1,17 @@
<template>
<v-row>
<v-col class="col-sm-12 col-md-7">
<status-panel v-if="is_ready"></status-panel>
<klippy-state-panel v-if="!is_ready"></klippy-state-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="is_ready"></z-offset-panel>
<control-panel class="mt-6" v-if="is_ready"></control-panel>
<extruder-panel class="mt-6" v-if="is_ready"></extruder-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>
<peripherie-panel class="mt-6" v-if="is_ready"></peripherie-panel>
<miniconsole-panel class="mt-6" v-if="is_ready && showDashboardConsole"></miniconsole-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>
</v-col>
</v-row>
</template>
@@ -28,8 +28,7 @@
computed: {
...mapState({
showDashboardConsole: state => state.gui.dashboard.boolConsole,
klippy_state: state => state.socket.klippy_state,
is_ready: state => state.socket.is_ready,
klippy_state: state => state.printer.webhooks.state,
}),
...mapGetters([
'showDashboardWebcam'
+111 -102
View File
@@ -45,108 +45,108 @@
<template>
<div>
<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">
<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 #no-data>
<div class="text-center">empty</div>
</template>
<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 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 : '--' }}
</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 #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 : '--' }}
</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" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
@@ -311,8 +311,9 @@
])
},
created() {
let dirArray = this.currentPath.split("/");
this.files = findDirectory(this.filetree, dirArray);
/*let dirArray = this.currentPath.split("/");
this.files = findDirectory(this.filetree, dirArray);*/
this.loadPath();
},
methods: {
uploadFile: function() {
@@ -367,11 +368,19 @@
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";
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";
+16 -1
View File
@@ -214,7 +214,7 @@
},
computed: {
...mapState({
config: state => state.config,
config: state => state.printer.configfile.config,
bed_mesh: state => state.printer.bed_mesh,
loadings: state => state.loadings,
}),
@@ -242,14 +242,23 @@
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);
@@ -262,6 +271,11 @@
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;
@@ -304,6 +318,7 @@
},
watch: {
config: function() {
window.console.log(this.config);
this.profiles = this.$store.getters.getBedMeshProfiles;
},
profile: function() {
+20 -9
View File
@@ -1,17 +1,28 @@
<template>
<div>
<v-row>
<v-col class="col-sm-12 col-md-6" v-if="is_ready">
<settings-limits-panel></settings-limits-panel>
<v-col class="col-12 col-sm-6">
<settings-config-files-panel></settings-config-files-panel>
</v-col>
<v-col class="col-sm-12 col-md-3" v-if="is_ready">
<settings-endstop-panel></settings-endstop-panel>
<settings-runout-panel></settings-runout-panel>
</v-col>
<v-col class="col-sm-12 col-md-3">
<settings-system-panel></settings-system-panel>
<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>
@@ -23,7 +34,7 @@
}),
computed: {
...mapState({
is_ready: state => state.socket.is_ready,
klippy_state: state => state.printer.webhooks.state,
}),
},
created() {
+53 -83
View File
@@ -7,13 +7,12 @@ import axios from "axios";
export default {
socket_on_open ({ commit }) {
commit('setConnected');
Vue.prototype.$socket.sendObj('get_printer_objects_status', { }, 'getHelpData');
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectoryRoot');
Vue.prototype.$socket.sendObj('get_directory', { path: '/gcodes' }, 'getDirectoryRoot');
Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
},
socket_on_close ({ commit }, event) {
commit('setDisconnect');
commit('setDisconnected');
if (event.wasClean) window.console.log('Socket closed clear')
else window.console.error('Connection failure')
@@ -22,6 +21,7 @@ export default {
socket_on_message ({ commit, state }, data) {
if (!state.socket.isConnected) commit('setConnected');
switch(data.method) {
case 'notify_status_update':
commit('setPrinterData', data.params[0]);
@@ -31,31 +31,30 @@ export default {
commit('addGcodeResponse', data.params[0]);
break;
case 'notify_klippy_state_changed':
window.console.log('notify_klippy_state_changed');
window.console.log(data.params[0]);
commit('setKlippyStatus', data.params[0]);
case 'notify_klippy_disconnected':
commit('setKlippyDisconnected');
commit('resetPrinter');
break;
case 'notify_filelist_changed':
switch(data.params[0].action) {
case 'added':
commit('setFileChangeAdded', data.params[0]);
case 'upload_file':
commit('setFileChangeUploadFile', data.params[0]);
break;
case 'removed':
commit('setFileChangeRemoved', data.params[0]);
case 'delete_file':
commit('setFileChangeDeleteFile', data.params[0]);
break;
case 'file_move':
commit('setFileChangeFileMove', data.params[0]);
case 'move_item':
commit('setFileChangeMoveItem', data.params[0]);
break;
case 'add_directory':
commit('setFileChangeAddDirectory', data.params[0]);
case 'create_dir':
commit('setFileChangeCreateDirectory', data.params[0]);
break;
case 'delete_directory':
case 'delete_dir':
commit('setFileChangeDeleteDirectory', data.params[0]);
break;
@@ -99,77 +98,44 @@ export default {
});
},
getKlipperInfo({ commit, state }, data) {
if (data !== undefined && data.is_ready && !state.socket.is_ready) {
commit('resetPrinter');
commit('setPrinterData', {
hostname: data.hostname,
version: data.version
});
getKlipperInfo({ commit }, data) {
commit('setPrinterData', {
hostname: data.hostname,
software_version: data.software_version,
cpu_info: data.cpu_info,
webhooks: {
state: data.state,
state_message: data.state_message,
}
});
Vue.prototype.$socket.sendObj('get_printer_objects_list', {}, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_objects_status', { heaters: [] }, 'getHeatersInfo');
Vue.prototype.$socket.sendObj('get_printer_objects_status', { configfile: ['config'] }, 'getPrinterConfig');
Vue.prototype.$socket.sendObj('post_printer_objects_subscription', {
gcode: [],
toolhead: [],
virtual_sdcard: [],
heaters: [],
fan: [],
pause_resume: [],
idle_timeout: [],
display_status: [],
});
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
}
commit('setPrinterStatusDetails', data);
setTimeout(function() {
if (state.socket.is_ready) Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
}, 5000);
Vue.prototype.$socket.sendObj('get_printer_objects_list', {}, 'getObjectsList');
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
},
getObjectInfo({ commit }, data) {
commit('setObjectData', data);
getObjectsList({ commit }, data) {
commit('setObjectData', data.objects);
let subscripts = {}
for (let key of Object.keys(data)) {
for (let key of data.objects) {
let nameSplit = key.split(" ");
if (
nameSplit[0] === "temperature_fan" ||
nameSplit[0] === "temperature_probe" ||
nameSplit[0] === "temperature_sensor" ||
nameSplit[0] === "filament_switch_sensor" ||
nameSplit[0] === "bed_mesh"
) subscripts = {...subscripts, [key]: []}
nameSplit[0] !== "gcode_macro" &&
nameSplit[0] !== "menu"
) subscripts = {...subscripts, [key]: null }
}
if (subscripts !== {}) Vue.prototype.$socket.sendObj('post_printer_objects_subscription', subscripts);
if (subscripts.bed_mesh) Vue.prototype.$socket.sendObj('get_printer_objects_status', { bed_mesh: [] }, 'getPrinterData');
if (subscripts !== {}) Vue.prototype.$socket.sendObj('post_printer_objects_subscribe', { objects: subscripts }, "getPrinterData");
Vue.prototype.$socket.sendObj("get_server_temperature_store", {}, "getHeatersHistory");
},
getPrinterData({ commit }, data) {
commit('setPrinterData', data);
},
getHeatersInfo({ commit }, data) {
commit('setObjectData', data);
if (data.heaters && data.heaters.available_heaters && data.heaters.available_heaters.length) {
let subscripts = {};
data.heaters.available_heaters.forEach(function(heater) {
subscripts = {...subscripts, [heater]: []}
});
Vue.prototype.$socket.sendObj('post_printer_objects_subscription', subscripts );
Vue.prototype.$socket.sendObj("get_server_temperature_store", {}, "getHeatersHistory");
}
if (data.status) commit('setPrinterData', data.status);
},
getHeatersHistory({ commit }, data) {
@@ -242,16 +208,24 @@ export default {
commit('setLoadingEmergencyStop', false);
},
setLoadingPrintPause({commit}) {
commit('setLoadingPrintPause', false);
respondPrintPause({commit}) {
commit('removeLoading', { name: 'statusPrintPause' });
},
setLoadingPrintResume({commit}) {
commit('setLoadingPrintResume', false);
respondPrintResume({commit}) {
commit('removeLoading', { name: 'statusPrintResume' });
},
setLoadingPrintCancel({commit}) {
commit('setLoadingPrintCancel', false);
respondPrintCancel({commit}) {
commit('removeLoading', { name: 'statusPrintCancel' });
},
respondPrintClear({commit}) {
commit('removeLoading', { name: 'statusPrintClear' });
},
respondPrintReprint({commit}) {
commit('removeLoading', { name: 'statusPrintReprint' });
},
sendGcode({commit}, data) {
@@ -344,10 +318,6 @@ export default {
router.push("/");
},
getHelpData({ commit }, data) {
commit('voidMutation', data);
},
setSettings({ commit }, data) {
commit('setSettings', data);
},
+22 -22
View File
@@ -1,16 +1,12 @@
export default {
toolhead(state) {
return (state.socket.isConnected) ? state.printer.toolhead : null;
},
heaters: state => {
let heaters = [];
if (state.object.heaters.available_heaters) {
if (state.printer.heaters.available_heaters) {
for (let [key, value] of Object.entries(state.printer)) {
if (state.object.heaters.available_heaters.includes(key)) {
if (state.printer.heaters.available_heaters.includes(key)) {
heaters.push({
name: key,
target: value.target,
@@ -102,7 +98,7 @@ export default {
},
current_file_size: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.size;
}
@@ -114,7 +110,7 @@ export default {
},
current_file_estimated_time: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.estimated_time;
}
@@ -122,19 +118,19 @@ export default {
},
current_file_filament_total: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.filament_total;
}
return 0;
},
bool_fan: state => {
return Object.entries(state.object).indexOf('fan');
fan: state => {
return Object.entries(state.object).indexOf('fan') ? state.printer.fan : false;
},
is_printing: state => {
return (state.printer.virtual_sdcard.filename !== "");
return (state.printer.print_stats.filename !== "");
},
getMacros: state => {
@@ -144,9 +140,9 @@ export default {
hiddenMacros[index] = item.toLowerCase();
});
for (let prop in state.config) {
for (let prop in state.printer.configfile.config) {
if (prop.startsWith('gcode_macro') &&
!Object.hasOwnProperty.call(state.config[prop], 'rename_existing') &&
!Object.hasOwnProperty.call(state.printer.configfile.config[prop], 'rename_existing') &&
!(hiddenMacros.indexOf(prop.replace('gcode_macro ', '').toLowerCase()) > -1)
) {
array.push({
@@ -170,12 +166,12 @@ export default {
getAllMacros: state => {
let array = [];
for (let prop in state.config) {
for (let prop in state.printer.configfile.config) {
if (prop.startsWith('gcode_macro') &&
!Object.hasOwnProperty.call(state.config[prop], 'rename_existing')) {
!Object.hasOwnProperty.call(state.printer.configfile.config[prop], 'rename_existing')) {
array.push({
'name': prop.replace('gcode_macro ', ''),
'prop': state.config[prop]
'prop': state.printer.configfile.config[prop]
});
}
}
@@ -224,7 +220,7 @@ export default {
currentProfile = state.printer.bed_mesh.profile_name;
}
for (let [key, value] of Object.entries(state.config)) {
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) {
@@ -249,8 +245,10 @@ export default {
getTitle: state => {
if (state.socket.isConnected) {
if (state.printer.pause_resume && state.printer.pause_resume.is_paused) return "Pause Print";
else if (state.printer.virtual_sdcard && state.printer.virtual_sdcard.is_active) return (state.printer.virtual_sdcard.progress * 100).toFixed(0)+"% Printing - "+state.printer.virtual_sdcard.filename;
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.gui.general.printername ? state.gui.general.printername : state.printer.hostname;
} else return "Mainsail";
@@ -261,6 +259,8 @@ export default {
},
getCurrentExtruder: state => {
if (state.printer.configfile.config === null) return null;
let extruder = {
name: "",
status: null,
@@ -269,8 +269,8 @@ export default {
let extruderName = state.printer.toolhead.extruder;
extruder.name = extruderName;
if (state.config[extruderName]) {
extruder.config = state.config[extruderName];
if (state.printer.configfile.config[extruderName]) {
extruder.config = state.printer.configfile.config[extruderName];
}
if (state.printer[extruderName]) {
+45 -26
View File
@@ -15,22 +15,15 @@ export default new Vuex.Store({
port: window.location.port,
reconnectInterval: 3000,
isConnected: false,
loadingGcodeUpload: false,
loadingGcodeRefresh: false,
metadataRequestDelay: 1000,
loadingEmergencyStop: false,
loadingPrintPause: false,
loadingPrintResume: false,
loadingRestart: false,
loadingRestartFirmware: false,
loadingRebootHost: false,
loadingShutdownHost: false,
loadingSaveGuiConfig: false,
loadingEndstopStatus: false,
printer_state: "",
klippy_state: "disconnect",
klippy_message: "",
is_ready: false,
error_detected: false,
},
webcam: {
url: ""
@@ -51,6 +44,11 @@ export default new Vuex.Store({
},
gcodefiles: {
countPerPage: 10,
},
settings: {
configfiles: {
countPerPage: 10,
}
}
},
loadings: [],
@@ -58,11 +56,20 @@ export default new Vuex.Store({
},
printer: {
software_version: '',
hostname: '',
version: '',
cpu_info: '',
webhooks: {
state: '',
state_message: '',
},
heaters: {
available_heaters: [],
},
toolhead: {
position: [],
homed_axes: [],
homed_axes: "",
extruder: "",
status: "",
print_time: 0,
@@ -86,38 +93,38 @@ export default new Vuex.Store({
},
virtual_sdcard: {
progress: 0,
filename: "",
is_active: false,
filament_used: 0,
file_position: 0,
},
print_stats: {
print_duration: 0,
filament_used: 0,
total_duration: 0,
filename: "",
state: "",
message: ""
},
current_file: {
},
gcode: {
gcode_move: {
extrude_factor: 1,
speed_factor: 1,
base_zpos: 0,
homing_origin: [0,0,0,0],
absolute_coordinates: true,
absolute_extrude: true,
},
fan: {
speed: 0,
},
/*fan: {
speed: 0,
},*/
endstops: {},
},
object: {
heaters: {
available_heaters: []
configfile: {
config: {}
}
},
temperaturChart: {
labels: [],
datasets: [],
updateTicks: []
},
object: [],
temperaturChart: [],
helplist: [],
filetree: [
{
@@ -125,6 +132,18 @@ export default new Vuex.Store({
filename: 'gcodes',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config_examples',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config',
modified: new Date(),
childrens: []
}
],
events: []
+144 -132
View File
@@ -1,7 +1,8 @@
import Vue from "vue";
const objectAssignDeep = require(`object-assign-deep`);
import { findDirectory } from '../plugins/helpers';
import { colorArray, colorChamber, colorHeaterBed, temperaturChartSampleLength } from './variables';
import { colorArray, colorChamber, colorHeaterBed/*, temperaturChartSampleLength*/ } from './variables';
export default {
@@ -15,6 +16,15 @@ export default {
state.socket.isConnected = false;
},
setKlippyDisconnected(state) {
Vue.set(state, '', {
webhooks: {
state: 'disconnected',
state_message: 'Disconnected...'
}
});
},
resetPrinter(state) {
//TODO check reset in storage
Vue.set(state, '', {
@@ -26,12 +36,34 @@ export default {
available_heaters: []
}
},
temperaturChart: {
labels: [],
datasets: [],
},
temperaturChart: [],
helplist: [],
filetree: [],
printer: {
print_stats: {
print_duration: 0,
filament_used: 0,
total_duration: 0,
filename: "",
state: "",
message: ""
},
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,
},
}
}
}
);
@@ -40,37 +72,31 @@ export default {
setPrinterData(state, data) {
if (data.requestParams) delete data.requestParams;
let now = Date.now();
let updateTicks = false;
Object.entries(data).forEach(([key, value]) => {
Vue.set(state.printer, key, value);
if (typeof(value) === "object") {
Vue.set(state.printer, key, {
...state.printer[key],
...value
});
} else Vue.set(state.printer, key, value);
if (Array.isArray(state.object.heaters.available_heaters) && state.object.heaters.available_heaters.length) {
if (
Array.isArray(state.printer.heaters.available_heaters) &&
state.printer.heaters.available_heaters.length
) {
let keySplit = key.split(" ");
if (
state.object.heaters.available_heaters.includes(key) ||
state.printer.heaters.available_heaters.includes(key) ||
keySplit[0] === "temperature_fan" ||
keySplit[0] === "temperature_sensor" ||
keySplit[0] === "temperature_probe") {
if (keySplit[0] === "temperature_fan") key = keySplit[1];
else if (keySplit[0] === "temperature_sensor") key = keySplit[1];
else if (keySplit[0] === "temperature_probe") key = "probe";
// increment update ticks array only 1 time per setPrinterData with heaters/sensors
if (!updateTicks) {
for (let index in state.temperaturChart.updateTicks) {
state.temperaturChart.updateTicks[index] += 1;
}
updateTicks = true;
}
// add object to update ticks array if it doesn't exists
if (state.temperaturChart.updateTicks[key] === undefined) {
state.temperaturChart.updateTicks[key] = 1;
}
this.commit('addTemperatureChartValue', { name: key, value: value, time: now });
}
}
@@ -107,48 +133,67 @@ export default {
},
addTemperatureChartValue(state, payload) {
if (state.temperaturChart.labels.map(Number).indexOf(+payload.time) < 0) {
state.temperaturChart.labels.push(payload.time);
// 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 = state.temperaturChart.labels.splice(state.temperaturChart.labels.length - temperaturChartSampleLength)
}
}
let index = state.temperaturChart.datasets.findIndex(element => element.label === payload.name);
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.datasets.findIndex(element => element.label === payload.name);
}
let index_target = state.temperaturChart.datasets.findIndex(element => element.label === payload.name+'_target');
let ticks = 1;
// find missing ticks in update ticks array and reset it
if (state.temperaturChart.updateTicks[payload.name] !== undefined) {
ticks = state.temperaturChart.updateTicks[payload.name];
state.temperaturChart.updateTicks[payload.name] = 0;
index = state.temperaturChart.findIndex(element => element.label === payload.name);
}
let index_target = state.temperaturChart.findIndex(element => element.label === payload.name+'_target');
// update current temp in temperature chart
if (index >= 0) {
for (let i = 0; i < ticks; i++) state.temperaturChart.datasets[index].data.push(payload.value.temperature.toFixed(1));
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.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 && payload.value.target !== undefined) {
for (let i = 0; i < ticks; i++) state.temperaturChart.datasets[index_target].data.push(payload.value.target.toFixed(1));
}
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 (index >= 0 && state.temperaturChart.datasets[index].data.length > temperaturChartSampleLength) {
state.temperaturChart.datasets[index].data = state.temperaturChart.datasets[index].data.splice(state.temperaturChart.datasets[index].data.length - temperaturChartSampleLength)
}
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.length === 0
) {
state.temperaturChart[index_target].data.push({
x: payload.time,
y: target
});
}
if (index_target >= 0 && state.temperaturChart.datasets[index_target].data.length > temperaturChartSampleLength) {
state.temperaturChart.datasets[index_target].data = state.temperaturChart.datasets[index_target].data.splice(state.temperaturChart.datasets[index_target].data.length - temperaturChartSampleLength)
// delete old entries
while ((deletedIndex = state.temperaturChart[index_target].data.findIndex(item => item.x < timeOld)) > -1) {
state.temperaturChart[index_target].data.splice(deletedIndex, 1);
}
}
},
@@ -158,39 +203,29 @@ export default {
switch (payload.name) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.datasets.filter(element => !element.label.endsWith("_target") && element.label !== "heater_bed" && element.label !== "chamber").length]; 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.datasets.push({
state.temperaturChart.push({
label: payload.name,
data: [],
borderColor: color,
backgroundColor: color,
fill: false,
borderDash: undefined,
borderWidth: 2,
pointRadius: 0,
pointHitRadius: 5,
showLine: true,
lineTension: 0,
hidden: hidden,
});
if (payload.type !== "temperature_sensor") {
state.temperaturChart.datasets.push({
state.temperaturChart.push({
label: payload.name+"_target",
data: [],
borderColor: color,
backgroundColor: color+'20',
fill: true,
borderDash: undefined,
borderWidth: 0,
pointRadius: 0,
pointHitRadius: 0,
showLine: true,
lineTension: 0,
hidden: hidden,
});
}
@@ -215,61 +250,70 @@ export default {
if (data.configfile) Vue.set(state, 'config', data.configfile.config);
},
setFileChangeAdded(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/")).replace("/", "");
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).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 (parent) {
parent.push({
isDirectory: false,
filename: filename,
modified: new Date(),
size: 0,
metadataPulled: false,
});
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) < 0) {
let modified = new Date(data.item.modified);
setTimeout(function() {
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.filename }, "getMetadata");
}, 500);
parent.push({
isDirectory: false,
filename: filename,
modified: modified,
size: data.item.size,
metadataPulled: false,
});
}
let extension = filename.substring(filename.lastIndexOf("."));
if (extension.toLowerCase() === ".gcode") {
setTimeout(function() {
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.item.path }, "getMetadata");
}, state.socket.metadataRequestDelay);
}
}
},
setFileChangeRemoved(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
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);
},
setFileChangeFileMove(state, data) {
let oldPath = data.prev_file.substr(0, data.prev_file.lastIndexOf("/") + 1);
let newPath = data.filename.substr(0, data.filename.lastIndexOf("/") + 1);
let filenameOld = data.prev_file.substr(data.prev_file.lastIndexOf("/")+1);
let filenameNew = data.filename.substr(data.filename.lastIndexOf("/")+1);
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);
oldPath = findDirectory(state.filetree, (data.root+"/"+oldPath).split("/"));
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.root+"/"+newPath).split("/"));
newPath = findDirectory(state.filetree, (data.item.root+"/"+newPath).split("/"));
newPath.push(file);
}
},
setFileChangeAddDirectory(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/") + 1);
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
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: filename,
filename: dirname,
modified: new Date(),
childrens: [],
});
@@ -277,9 +321,9 @@ export default {
},
setFileChangeDeleteDirectory(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
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);
@@ -317,6 +361,8 @@ export default {
modified: Date.parse(dir.modified),
childrens: [],
});
Vue.prototype.$socket.sendObj('get_directory', { path: data.requestParams.path+'/'+dir.dirname }, 'getDirectoryRoot');
}
}
}
@@ -369,6 +415,7 @@ export default {
setMetadataCurrentFile(state, data) {
if (data !== undefined && data.filename !== "") {
state.printer.current_file.thumbnails = [];
Vue.set(state.printer, 'current_file', data);
}
},
@@ -442,17 +489,6 @@ export default {
state.loadings = state.loadings.filter(function(ele){ return ele !== data.name; });
},
setKlippyStatus(state, value) {
if (value !== undefined) {
state.socket.klippy_state = value;
if (value === "disconnect") {
state.socket.is_ready = false;
state.socket.klippy_message = "";
} else if (value === "ready") Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
}
},
setPrinterStatusDetails(state, data) {
if (data !== undefined && data.is_ready !== undefined) {
state.socket.error_detected = data.error_detected;
@@ -461,34 +497,10 @@ export default {
}
},
setLoadingGcodeUpload(state, value) {
state.socket.loadingGcodeUpload = value;
},
setLoadingGcodeRefresh(state, value) {
state.socket.loadingGcodeRefresh = value;
},
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;
},
setLoadingQGL(state, value) {
state.socket.loadingQGL = value;
},
setLoadingRestart(state, value) {
state.socket.loadingRestart = value;
},
+1 -1
View File
@@ -14,4 +14,4 @@ export const colorArray = [
export const colorHeaterBed = '#2196F3';
export const colorChamber = '#4CAF50';
export const temperaturChartSampleLength = 600;
export const temperaturChartSampleLength = 1200;