Compare commits

...
20 Commits
Author SHA1 Message Date
Stefan Dej 52afc35fd6 update README.md for V0.0.11 2020-05-11 01:11:27 +02:00
Stefan Dej 9e5266425c feature: select value by focus heater input field 2020-05-11 01:07:29 +02:00
Stefan Dej 86595ab70b feature: temperature_sensor min/max temp by hover 2020-05-11 01:04:59 +02:00
Stefan Dej 0f87e3f28f bugfix: temperature_fans onload & update fix
feature: save hidden sensors from chart in gui.json
2020-05-11 00:54:36 +02:00
Stefan Dej 88305e74cf fixes #9 2020-05-09 02:20:50 +02:00
Stefan Dej abea5d8660 fixes #13 for time > 24h 2020-05-09 02:12:42 +02:00
Stefan Dej d2bccb737e Update README.md 2020-05-09 02:03:19 +02:00
Stefan Dej 0bfde82ee8 add sensor number 2020-05-09 01:58:16 +02:00
Stefan Dej de9485cc84 update README.md, load tempchart history, update to moonraker 2020-05-09 01:47:30 +02:00
Stefan Dej e8d2c71401 update README.md 2020-04-27 21:52:37 +02:00
meteyou 554b25d754 Merge pull request #5 from pusewicz/patch-1
Few tweaks to the README file

thx!
2020-04-27 12:36:51 +02:00
Piotr Usewicz ecf2ee070b Few tweaks to the README file
This is a PR that tweaks some of the README that fixes some of the typos. I did not go much into detail.
2020-04-27 12:14:42 +02:00
meteyou e35d13d446 Merge pull request #1 from meteyou/dependabot/npm_and_yarn/acorn-6.4.1
Bump acorn from 6.3.0 to 6.4.1
2020-04-27 10:52:07 +02:00
Stefan Dej 9f46a502fc finish README.md 2020-04-27 10:31:56 +02:00
Stefan Dej a4436348df finish README.md 2020-04-27 08:40:06 +02:00
Stefan Dej 706515bc84 Update Websocket + README.md 2020-04-27 01:55:01 +02:00
Stefan Dej efc70ca5aa test with new websocket implementation 2020-04-25 21:17:27 +02:00
Stefan Dej 544d5e2db5 update npm packages & change to local dependency 2020-04-19 17:06:31 +02:00
Stefan Dej 70e8ce5687 update README.md for V0.0.8 2020-04-18 03:24:21 +02:00
dependabot[bot] d57e888133 Bump acorn from 6.3.0 to 6.4.1
Bumps [acorn](https://github.com/acornjs/acorn) from 6.3.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.3.0...6.4.1)

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

No files matched your search

+191 -141
View File
@@ -1,32 +1,195 @@
# Klipper Web Control
KWC is a responsive web interface for [Klipper](https://github.com/KevinOConnor/klipper) 3D printer firmware. It communicates with the klipper-api from [Arksine](https://github.com/arksine).
# Mainsail
Mainsail is a responsive web interface for the [Klipper](https://github.com/KevinOConnor/klipper) 3D printer firmware. It communicates with the Moonraker (Klipper-API) from [Arksine](https://github.com/arksine).
## Installation
At first install Arksine klipper-api fork/branch -> [install manual](https://github.com/Arksine/klipper/tree/work-web_server-20200131/klippy/extras/web_server)
## Automatic Install Scripts
* [Installer from ArmyAg08](https://github.com/ArmyAg08/mainsail-installer) (recommended)
* [Installer from BlackStump](https://github.com/BlackStump/mainsail-install) (untested)
## Manual installation of Mainsail
Mainsail requires a working Klipper instance. Please head over to the official Klipper [installation documentation](https://www.klipper3d.org/Installation.html).
The installation is split into several sections:
- [Change branch for Klipper-API](#change-branch-for-moonraker)
- [Configure Klipper-API](#configure-moonraker)
- [Install the Webserver & Reverse Proxy (NGINX)](#install-webserver--reverse-proxy-nginx)
- [Install & Configure Mainsail](#install--configure-mainsail)
- [Change the Hostname](#change-the-hostname-optional)
### Change branch for Moonraker
The Klipper-API isn't merged in Klipper at the moment, so you have to change the Repository to [Arksine's Fork](https://github.com/Arksine/klipper/tree/work-web_server-20200131/klippy/extras/remote_api) with the Klipper-API.
Download and install KWC:
```bash
mkdir -p ~/sdcard
mkdir -p ~/kwc
cd ~/kwc
wget -q -O kwc.zip https://github.com/meteyou/kwc/releases/download/v0.0.7/kwc-alpha-0.0.7.zip && unzip kwc.zip && rm kwc.zip
cd ~/klipper
git remote add arksine https://github.com/Arksine/klipper.git
git fetch arksine
git checkout arksine/work-web_server-20200131
~/klipper/scripts/install-moonraker.sh
```
Configure web_server in printer.cfg:
### Configure Moonraker
Edit your `printer.cfg` with `nano ~/printer.cfg` and add the following lines:
```
[web_server]
port: 8080
enable_cors: true
trusted_clients:
192.168.1.0/24
127.0.0.1
allow_file_ops_when_printing: true
[virtual_sdcard]
path: /home/pi/sdcard
[api_server]
trusted_clients:
192.168.0.0/24
127.0.0.1
```
Edit the first line of `trusted_clients` (192.168.0.0/24) to your network. The second line (127.0.0.0/24) is for reverse proxy later.
If you need other options in your API you can find all options with descriptions on [Arksine's Fork](https://github.com/Arksine/klipper/tree/work-web_server-20200131/moonraker).
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
```
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-479-gd586fb06", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
```
your API is working!
### install webserver & reverse proxy (nginx)
nginx is important to mount all components on port 80 and host the static files from Mainsail.
If you have installed lighttpd & haproxy before you have to stop & disable it:
```bash
sudo service haproxy stop
sudo service lighttpd stop
sudo apt remove haproxy lighttpd
```
Example Klipper macros:
After disable all other webserver you can install nginx now:
```bash
sudo apt install nginx
```
now we create the config file with
```bash
sudo nano /etc/nginx/sites-available/mainsail
```
and fill it with the following content:
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream apiserver {
#edit your api port here
ip_hash;
server 127.0.0.1:7125;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
access_log /var/log/nginx/kwc-access.log;
error_log /var/log/nginx/kwc-error.log;
#web_path from mainsail static files
root /home/pi/mainsail;
index index.html;
server_name _;
#max upload size for gcodes
client_max_body_size 200M;
location / {
try_files $uri $uri/ /index.html;
}
location /printer {
proxy_pass http://apiserver/printer;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /api {
proxy_pass http://apiserver/api;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /access {
proxy_pass http://apiserver/access;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /websocket {
proxy_pass http://apiserver/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 86400;
}
location /machine {
proxy_pass http://apiserver/machine;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
location /server {
proxy_pass http://apiserver/server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
}
```
Create directory for static files and active nginx config:
```bash
mkdir ~/mainsail
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
sudo service nginx restart
```
Now you can check again the API if it works with the reverse proxy. Open the url `http://<printer-ip>/printer/info` in your browser. if you see a content like this:
```
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-479-gd586fb06", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
```
Now we can install Mainsail.
### Install & Configure Mainsail
Now you can download the current mainsail static data
```bash
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.0.11/mainsail-alpha-0.0.11.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
### Change the Hostname (Optional)
to use the hostname instate of the ip, you can install the avahi-daemon:
```bash
sudo apt install avahi-daemon
```
and you can config your hostname (if you use a raspberry pi):
```bash
sudo raspi-config
```
in `2 Network Options` > `N1 Hostname` you can edit your hostname of your raspberry pi. After a reboot you can use `http://<hostname>.local/` to open the webinterface.
## Klipper example macros for Mainsail
These macros are important to start/pause/cancel prints.
```
[pause_resume]
@@ -71,128 +234,15 @@ gcode:
BASE_RESUME
```
## Installation lighttpd & haproxy (out-dated)
```bash
sudo apt install lighttpd haproxy
## Update Mainsail to V0.0.11
```
edit configfile `/etc/lighttpd/lighttpd.conf` and edit following lines:
```
server.document-root = "/home/pi/kwc"
server.bind = "127.0.0.1"
server.port = 81
```
```bash
sudo usermod -a -G www-data pi
```
add following lines at the end of `/etc/haproxy/haproxy.cfg`:
```
frontend public
bind :::80 v4v6
default_backend lighttpd
use_backend printer if { path_beg /printer/ }
# use_backend webcam if { path_beg /webcam1/ }
acl is_websocket path_beg /websocket
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
use_backend websocket if is_websocket
backend lighttpd
reqrep ^([^\ :]*)\ /(.*) \1\ /\2
option forwardfor
server lighttpd1 127.0.0.1:81
backend printer
reqrep ^([^\ :]*)\ /(.*) \1\ /\2
option forwardfor
server printer1 127.0.0.1:8080
backend websocket
reqrep ^([^\ :]*)\ /(.*) \1\ /\2
option forwardfor
server websocket1 127.0.0.1:8080
#backend webcam
# reqrep ^([^\ :]*)\ /webcam1/(.*) \1\ /\2
# server webcam1 127.0.0.1:8081
```
all comments are for webcam support. You can install MJPEG-Streamer with this [tutorial](https://github.com/cncjs/cncjs/wiki/Setup-Guide:-Raspberry-Pi-%7C-MJPEG-Streamer-Install-&-Setup-&-FFMpeg-Recording).
## Installation nginx
If you have installed lighttpd & haproxy before:
```bash
sudo service haproxy stop
sudo update-rc.d -f haproxy remove
sudo service lighttpd stop
sudo update-rc.d -f lighttpd remove
```
and now install nginx:
```bash
sudo apt install nginx
```
create configfile `/etc/nginx/sites-available/kwc`:
```
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream apiserver {
#edit your api port here
server 127.0.0.1:8080;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
access_log /var/log/nginx/kwc-access.log;
error_log /var/log/nginx/kwc-error.log;
#web_path from kwc static files
root /home/pi/kwc;
index index.html;
server_name _;
#max upload size for gcodes
client_max_body_size 128M;
location / {
try_files $uri $uri/ /index.html;
}
location /printer {
proxy_pass http://apiserver/printer;
}
location /websocket {
proxy_pass http://apiserver/websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
}
```
change api port & root path.
```bash
sudo rm /etc/nginx/sites-enabled/default
sudo ln -s /etc/nginx/sites-available/kwc /etc/nginx/sites-enabled/
sudo service nginx restart
```
## Update KWC to V0.0.7
```
rm -R ~/kwc/*
cd ~/kwc
wget -q -O kwc.zip https://github.com/meteyou/kwc/releases/download/v0.0.7/kwc-alpha-0.0.7.zip && unzip kwc.zip && rm kwc.zip
sudo service klipper stop
cd ~/klipper
git clean -x -d -i
git fetch arksine && git checkout arksine/work-web_server-20200131
~/klipper/scripts/install-moonraker.sh #optional: only for the first installation of moonraker
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.0.11/mainsail-alpha-0.0.11.zip && unzip mainsail.zip && rm mainsail.zip
```
and update your macros & nginx config.
+4819 -538
View File
File diff suppressed because it is too large. Load diff
+14 -17
View File
@@ -10,35 +10,32 @@
"dependencies": {
"axios": "^0.19.2",
"chart.js": "^2.9.3",
"core-js": "^3.6.4",
"core-js": "^3.6.5",
"object-assign-deep": "^0.4.0",
"vue": "^2.6.11",
"vue-chartjs": "^3.5.0",
"vue-context": "^5.0.0",
"vue-context": "^5.1.0",
"vue-headful": "^2.1.0",
"vue-json-rpc-websocket": "^1.1.1",
"vue-plotly": "^1.1.0",
"vue-resource": "^1.5.1",
"vue-simple-upload": "^0.1.6",
"vue-toast-notification": "0.0.3",
"vuetify": "^2.2.17",
"vuetify-toast-snackbar": "^0.6.1",
"vuex": "^3.1.3"
"vue-toast-notification": "^0.2.0",
"vuetify": "^2.2.22",
"vuex": "^3.2.0"
},
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.12.1",
"@mdi/font": "^4.9.95",
"@vue/cli-plugin-babel": "^4.2.3",
"@vue/cli-plugin-eslint": "^4.2.3",
"@vue/cli-service": "^4.2.3",
"@mdi/font": "^5.1.45",
"@vue/cli-plugin-babel": "^4.3.1",
"@vue/cli-plugin-eslint": "^4.3.1",
"@vue/cli-service": "^4.3.1",
"babel-eslint": "^10.1.0",
"css-loader": "^3.4.2",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"material-design-icons-iconfont": "^5.0.1",
"css-loader": "^3.5.2",
"eslint": "^6.8.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.3",
"sass-loader": "^8.0.2",
"vue-cli-plugin-route": "0.0.7",
"vue-cli-plugin-vuetify": "^1.1.2",
"vue-cli-plugin-vuetify": "^2.0.5",
"vue-router": "^3.1.6",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.4.3"
+2 -2
View File
@@ -1,7 +1,7 @@
{
"socket": {
"hostname": "kossel.local",
"reconnectInterval": 5000,
"reconnectAttempts": 1000
"port": 80,
"reconnectInterval": 3000
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

-2
View File
@@ -6,8 +6,6 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico" id="favicon" />
<title>KlipperWebControl</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<noscript>
+33 -9
View File
@@ -1,3 +1,7 @@
<style>
@import './assets/styles/fonts.css';
</style>
<template>
<v-app>
<vue-headful
@@ -14,8 +18,19 @@
<ul class="navi" :expand="$vuetify.breakpoint.mdAndUp">
<li v-for="(category, index) in routes" :key="index" :prepend-icon="category.icon"
:class="[category.path !== '/' && currentPage.includes(category.path) ? 'active' : '', 'nav-item']"
:value="true">
<router-link slot="activator" class="nav-link" exact :to="category.path" @click.prevent v-if="(category.title === 'Webcam' && boolNaviWebcam) || category.title !== 'Webcam'">
:value="true"
>
<router-link
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
v-if="
(category.title === 'Webcam' && boolNaviWebcam) ||
(category.title === 'Heightmap' && boolNaviHeightmap) ||
(
category.title !== 'Webcam' &&
category.title !== 'Heightmap' &&
(is_ready || category.alwaysShow)
)
">
<v-icon>mdi-{{ category.icon }}</v-icon>
<span class="nav-title">{{ category.title }}</span>
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
@@ -23,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>
<router-link :to="page.path" class="nav-link" @click.prevent v-if="is_ready || page.alwaysShow">
<v-icon>mdi-{{ page.icon }}</v-icon>
<span class="nav-title">{{ page.title }}</span>
</router-link>
@@ -62,7 +77,7 @@
<v-footer app class="d-block">
<span v-if="version">{{ version }}</span>
<span class="float-right">&copy; 2020</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>
</v-footer>
</v-app>
</template>
@@ -81,13 +96,14 @@ export default {
data: () => ({
drawer: null,
activeClass: 'active',
routes: routes
routes: routes,
is_ready: false,
boolNaviHeightmap: false,
}),
created () {
this.$vuetify.theme.dark = true;
this.$socket.onOpen = () => {
}
this.is_ready = (this.klippy_state === "ready") ? true : false;
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
},
computed: {
currentPage: function() {
@@ -102,6 +118,8 @@ export default {
isConnecting: state => !state.socket.isConnected,
progress: state => state.printer.virtual_sdcard.progress,
boolNaviWebcam: state => state.gui.webcam.bool,
klippy_state: state => state.socket.klippy_state,
config: state => state.config,
}),
...mapGetters([
'getTitle'
@@ -162,8 +180,14 @@ export default {
handler: function(val) {
this.drawFavicon(val);
}
},
klippy_state() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
},
config() {
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
}
}
},
}
</script>
+48
View File
@@ -0,0 +1,48 @@
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 100;
src: local('Roboto Thin'), local('Roboto-Thin'), url(/fonts/roboto-thin.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 300;
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto-light.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 400;
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto-regular.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 500;
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto-medium.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 700;
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto-bold.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Roboto';
font-style: normal;
font-weight: 900;
src: local('Roboto Black'), local('Roboto-Black'), url(/fonts/roboto-black.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
+4 -1
View File
@@ -1,3 +1,4 @@
import store from '../store'
import { Line, mixins } from 'vue-chartjs'
const { reactiveProp } = mixins;
@@ -36,11 +37,13 @@ export default {
// See controller.isDatasetVisible comment
meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
if (index_target) {
if (index_target !== -1) {
let meta_target = ci.getDatasetMeta(index_target);
meta_target.hidden = meta.hidden;
}
store.dispatch('setHeaterChartVisibility', { name: legendItem.text, hidden: meta.hidden });
ci.update();
}
},
+20 -15
View File
@@ -6,7 +6,7 @@
<v-card>
<v-row class="">
<v-col class="col-12 pb-0 text-center">
<div class="d-inline-block mx-2 my-1"><v-btn @click="doHome" :loading="loadingHome" :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-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>
</v-col>
</v-row>
@@ -61,6 +61,7 @@
<script>
import { mapState, mapGetters, mapMutations } from 'vuex'
import Vue from "vue";
export default {
components: {
@@ -68,24 +69,20 @@
},
data: function() {
return {
loadingHomeAll: false,
loadingHomeX: false,
loadingHomeY: false,
loadingHomeZ: false,
}
},
computed: {
...mapState({
loadingHome: state => state.socket.loadingHome,
loadingHomeX: state => state.socket.loadingHomeX,
loadingHomeY: state => state.socket.loadingHomeY,
loadingHomeZ: state => state.socket.loadingHomeZ,
loadingQGL: state => state.socket.loadingQGL,
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.config,
loadings: state => state.loadings,
}),
...mapMutations([
'setLoadingHome',
'setLoadingHomeX',
'setLoadingHomeY',
'setLoadingHomeZ',
'setLoadingQGL',
]),
...mapGetters([
@@ -94,19 +91,19 @@
},
methods: {
doHome() {
this.$store.commit('setLoadingHome', true);
this.$store.commit('setLoading', { name: 'controlHomeAll' });
this.$socket.sendObj('post_printer_gcode', { script: "G28" }, "responseHome");
},
doHomeX() {
this.$store.commit('setLoadingHomeX', true);
this.$store.commit('setLoading', { name: 'controlHomeX' });
this.$socket.sendObj('post_printer_gcode', { script: "G28 X" }, "responseHomeX");
},
doHomeY() {
this.$store.commit('setLoadingHomeY', true);
this.$store.commit('setLoading', { name: 'controlHomeY' });
this.$socket.sendObj('post_printer_gcode', { script: "G28 Y" }, "responseHomeY");
},
doHomeZ() {
this.$store.commit('setLoadingHomeZ', true);
this.$store.commit('setLoading', { name: 'controlHomeZ' });
this.$socket.sendObj('post_printer_gcode', { script: "G28 Z" }, "responseHomeZ");
},
doQGL() {
@@ -121,8 +118,16 @@
this.doSend(gcode);
},
doSend(gcode) {
this.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
Vue.prototype.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
},
},
watch: {
loadings: function(loadings) {
this.loadingHomeAll = loadings.includes('controlHomeAll');
this.loadingHomeX = loadings.includes('controlHomeX');
this.loadingHomeY = loadings.includes('controlHomeY');
this.loadingHomeZ = loadings.includes('controlHomeZ');
}
}
}
</script>
@@ -1,7 +1,7 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-exclamation</v-icon></v-list-item-avatar>
<v-list-item-avatar color="grey"><v-icon dark>mdi-exclamation-thick</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Machinelimits</v-list-item-title>
</v-list-item-content>
+14 -1
View File
@@ -8,9 +8,12 @@
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="">
<div><v-btn :href="'http://'+hostname+':'+port+'/printer/log'" color="primary"><v-icon class="mr-sm-2">mdi-download</v-icon>Download Log</v-btn></div>
<div><v-btn :href="'http://'+hostname+':'+port+'/printer/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/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><span class="d-none d-sm-block">FW 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><span class="d-none d-sm-block">Host Restart</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><span class="d-none d-sm-block">Host Shutdown</span></v-btn></div>
</v-card-text>
</v-card>
</template>
@@ -33,6 +36,8 @@
port: state => state.socket.port,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
loadingRebootHost: state => state.socket.loadingRebootHost,
loadingShutdownHost: state => state.socket.loadingShutdownHost,
}),
...mapMutations([
'setLoadingRestart',
@@ -48,6 +53,14 @@
this.$store.commit('setLoadingRestartFirmware', true);
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
},
doRebootHost() {
this.$store.commit('setLoadingRebootHost', true);
this.$socket.sendObj('post_machine_reboot', { });
},
doShutdownHost() {
this.$store.commit('setLoadingShutdownHost', true);
this.$socket.sendObj('post_machine_shutdown', { });
},
}
}
</script>
+16 -11
View File
@@ -1,7 +1,7 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-info</v-icon></v-list-item-avatar>
<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_state }}{{ printer_is_printing ? " - "+current_file : "" }}</v-list-item-subtitle>
@@ -12,6 +12,11 @@
</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 col class="text-left">{{ display_message }}</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
@@ -73,13 +78,13 @@
<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_used > 0 ? formatTime(print_time / (filament_used / current_file_filament_used) - print_time) : '--' }}</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) : formatTime(0) }}</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>
@@ -103,10 +108,6 @@
import { mapState, mapGetters } from 'vuex';
export default {
data: () => ({
}),
computed: {
...mapState({
toolhead: state => state.printer.toolhead,
@@ -126,13 +127,15 @@
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,
display_message: state => state.printer.display_status.message,
}),
...mapGetters([
'current_file_size',
'current_file_metadata',
'current_file_estimated_time',
'current_file_filament_used',
'current_file_filament_total',
'is_printing',
]),
},
@@ -150,10 +153,12 @@
this.$socket.sendObj('post_printer_print_cancel', { }, 'setLoadingPrintCancel');
},
formatTime(seconds) {
let date = new Date(null);
date.setSeconds(seconds);
let h = Math.floor(seconds / 3600);
seconds %= 3600;
let m = Math.floor(seconds / 60);
let s = seconds % 60;
return date.toISOString().substr(11,8);
return h+':'+m+':'+s;
},
},
}
+1 -1
View File
@@ -7,7 +7,7 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
<v-list-item-avatar color="grey"><v-icon dark>mdi-thermometer</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Temperature Chart</v-list-item-title>
<v-list-item-subtitle>
+21 -3
View File
@@ -7,13 +7,15 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
<v-list-item-avatar color="grey"><v-icon dark>mdi-thermometer</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Heaters</v-list-item-title>
<v-list-item-title class="headline">Temperatures</v-list-item-title>
<v-list-item-subtitle>
{{ heatersCount }} heaters
<span v-if="temperature_fans.length === 1">, {{ temperature_fans.length }} fan</span>
<span v-if="temperature_fans.length > 1">, {{ temperature_fans.length }} fans</span>
<span v-if="temperature_sensors.length === 1">, {{ temperature_sensors.length }} sensor</span>
<span v-if="temperature_sensors.length > 1">, {{ temperature_sensors.length }} sensors</span>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
@@ -50,6 +52,18 @@
</v-col>
</v-row>
</div>
<div v-if="temperature_sensors.length" >
<v-divider class="my-2"></v-divider>
<v-row class="pl-3 pr-3 heater-row">
<v-col class="text-center py-0">
<b>Temperature<br />Sensors</b>
</v-col>
<v-col class="text-center py-0 vertical_align_center" v-for="(sensor,index) in temperature_sensors" v-bind:key="index+999" >
<span style="cursor: default;" :title="'min: '+sensor.measured_min_temp.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>
</v-col>
</v-row>
</div>
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
<v-row v-if="boolTempchart">
<v-col>
@@ -61,7 +75,7 @@
</template>
<script>
import {mapGetters, mapState} from 'vuex'
import { mapGetters, mapState } from 'vuex'
import toolInput from '../../inputs/ToolInput'
import LineChart from '../../charts/LineChart.js'
@@ -90,7 +104,11 @@
'heaters',
'heatersCount',
'temperature_fans',
'temperature_sensors',
])
},
created() {
},
methods: {
fillData () {
+1 -1
View File
@@ -10,7 +10,7 @@
</style>
<template>
<v-text-field type="number" min="-273" max="1999" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps">
<v-text-field type="number" min="-273" max="1999" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps" onClick="this.select();">
</v-text-field>
</template>
+14 -12
View File
@@ -1,12 +1,11 @@
import Vue from 'vue'
import JRPCWS from './plugins/json-rpc-websocket'
import WebSocketClient from './plugins/wsClient'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import VueResource from 'vue-resource'
import './components'
import store from './store'
import router from './plugins/router'
import 'vue-toast-notification/dist/index.css';
import vueHeadful from 'vue-headful';
Vue.config.productionTip = false;
@@ -20,15 +19,18 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO
Vue.component('vue-headful', vueHeadful);
fetch('/config.json').then(res => res.json())
.then(file => {
fetch('/config.json')
.then(res => res.json())
.then(file => {
store.commit('setSettings', file);
Vue.use(JRPCWS, 'ws://' + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
store: store,
reconnectEnabled: true,
reconnectInterval: store.state.socket.reconnectInterval,
reconnectAttempts: store.state.socket.reconnectAttempts,
const socketClient = new WebSocketClient('ws://' + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
store: store,
reconnectEnabled: true,
reconnectInterval: store.state.socket.reconnectInterval,
});
socketClient.connect();
Vue.prototype.$socket = socketClient;
new Vue({
vuetify,
@@ -36,11 +38,11 @@ fetch('/config.json').then(res => res.json())
store,
render: h => h(App)
}).$mount('#app')
})
.catch((error) => {
})
.catch((error) => {
let p = document.createElement("p");
let content = document.createTextNode("config.json not found or cannot be decoded!");
p.appendChild(content);
document.getElementById('app').append(p);
window.console.error('Error:', error);
});
});
+2 -1
View File
@@ -82,6 +82,7 @@
</template>
<script>
import { mapState, mapGetters } from 'vuex';
import Vue from "vue";
export default {
data () {
@@ -132,7 +133,7 @@
methods: {
doSend() {
this.loadingSendGcode = true;
this.$socket.sendObj('post_printer_gcode', { script: this.gcode }, "sendGcode");
Vue.prototype.$socket.sendObj('post_printer_gcode', { script: this.gcode }, "sendGcode");
this.lastCommands.push(this.gcode);
this.gcode = "";
this.lastCommandNumber = null;
+16 -4
View File
@@ -3,12 +3,12 @@
<v-col class="col-sm-12 col-md-7">
<status-panel></status-panel>
<webcam-panel v-if="showDashboardWebcam" class="mt-6"></webcam-panel>
<control-panel class="mt-6"></control-panel>
<control-panel class="mt-6" v-if="is_ready"></control-panel>
</v-col>
<v-col class="col-sm-12 col-md-5">
<tools-panel></tools-panel>
<peripherie-panel class="mt-6"></peripherie-panel>
<miniconsole-panel class="mt-6" v-if="showDashboardConsole"></miniconsole-panel>
<tools-panel v-if="is_ready"></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>
</v-col>
</v-row>
</template>
@@ -17,13 +17,25 @@
import { mapState, mapGetters } from 'vuex'
export default {
data: () => ({
is_ready: false
}),
computed: {
...mapState({
showDashboardConsole: state => state.gui.dashboard.boolConsole,
klippy_state: state => state.socket.klippy_state,
}),
...mapGetters([
'showDashboardWebcam'
])
},
created() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
},
watch: {
klippy_state() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
}
}
}
</script>
+7 -15
View File
@@ -86,7 +86,7 @@
{{ item.layer_height ? item.layer_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.filament_used ? item.filament_used.toFixed()+' mm' : '--' }}
{{ item.filament_total ? item.filament_total.toFixed()+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ formatPrintTime(item.estimated_time) }}
@@ -164,7 +164,7 @@
},
{
text: 'Filament Usage',
value: 'filament_used',
value: 'filament_total',
align: 'right',
},
{
@@ -225,15 +225,11 @@
}
).then((result) => {
this.$store.commit('setLoadingGcodeUpload', false);
toast.success("Upload of "+result.data.result+" successful!", {
icon: 'fa-check'
});
toast.success("Upload of "+result.data.result+" successful!");
})
.catch(() => {
this.$store.commit('setLoadingGcodeUpload', false);
toast.error("Cannot upload the file!", {
icon: 'fa-exclamation-triangle'
});
toast.error("Cannot upload the file!");
});
},
clickUploadButton: function() {
@@ -296,14 +292,10 @@
removeFile() {
axios.delete(
'http://'+ this.hostname + ':' + this.port +'/printer/files/'+this.contextMenu.item.filename
).then(() => {
this.$toast(this.contextMenu.item.filename+" successfully deleted.", {
icon: 'fa-trash'
});
).then((result) => {
this.$toast.success(result.data.result+" successfully deleted.");
}).catch(() => {
this.$toast.error("Error! Cannot delete file.", {
icon: 'fa-warning'
});
this.$toast.error("Error! Cannot delete file.");
});
},
startPrint(filename = "") {
+159
View File
@@ -0,0 +1,159 @@
<style>
</style>
<template>
<div>
<v-row>
<v-col class="col-xl-8">
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-grid</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Heightmap</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 py-0 content">
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
</v-card-text>
</v-card>
</v-col>
<v-col class="col-xl-4">
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-cogs</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Profile</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text>
<v-select
:items="profiles"
v-model="profile"
item-text="name"
item-value="data"
label="Profil"
outlined
></v-select>
</v-card-text>
</v-card>
</v-col>
</v-row>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { Plotly } from 'vue-plotly'
export default {
components: {
Plotly
},
data () {
return {
data:[
{
x: [],
y: [],
z: [],
type:"surface",
intensity: [0, .05, .1],
cmin: -0.1,
cmax: 0.1,
showscale: true,
autocolorscale: true,
colorbar: {
tickfont: {
color: '#fff'
},
}
}
],
layout:{
showScale: true,
plot_bgcolor: 'transparent',
paper_bgcolor: 'transparent',
margin: {
l: 0,
r: 100,
b: 0,
t: 0
},
scene: {
camera: {
eye: {
x: -1.25,
y: -1.25,
z: 0.25
}
},
xaxis: {
color: '#fff',
range: [0,200]
},
yaxis: {
color: '#fff',
range: [0,200]
},
zaxis: {
color: '#fff',
range: [-1,1]
}
}
},
profiles: [],
profile: {}
}
},
computed: {
...mapState({
config: state => state.config,
}),
},
methods: {
},
watch: {
config: function() {
this.profiles = this.$store.getters.getBedMeshProfiles;
if (this.config.stepper_x !== undefined) this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max];
if (this.config.stepper_y !== undefined) this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max];
this.$refs.heightmap.update();
},
profile: function() {
this.data[0].x = [];
let x_step = (this.profile.max_x - this.profile.min_x) / this.profile.x_count;
for(let i = 0; i < this.profile.x_count; i++) {
this.data[0].x.push(parseFloat(this.profile.min_x) + parseFloat(x_step) * i);
}
this.data[0].y = [];
let y_step = (this.profile.max_y - this.profile.min_y) / this.profile.y_count;
for(let i = 0; i < this.profile.y_count; i++) {
this.data[0].y.push(parseFloat(this.profile.min_y) + parseFloat(y_step) * i);
}
this.data[0].z = [];
let rows = this.profile.points.split('\n')
rows.forEach((row) => {
if (row !== "") {
let tmp = [];
let cols = row.split(', ');
cols.forEach((col) => {
tmp.push(parseFloat(col));
});
this.data[0].z.push(tmp);
}
});
//this.$refs.heightmap.plot();
window.console.log(this.$refs);
}
}
}
</script>
+20 -3
View File
@@ -1,10 +1,10 @@
<template>
<div>
<v-row>
<v-col class="col-sm-12 col-md-6">
<v-col class="col-sm-12 col-md-6" v-if="is_ready">
<settings-limits-panel></settings-limits-panel>
</v-col>
<v-col class="col-sm-12 col-md-3">
<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>
@@ -15,7 +15,24 @@
</div>
</template>
<script>
export default {
import {mapState} from "vuex";
export default {
data: () => ({
is_ready: false
}),
computed: {
...mapState({
klippy_state: state => state.socket.klippy_state,
}),
},
created() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
},
watch: {
klippy_state() {
this.is_ready = (this.klippy_state === "ready") ? true : false;
}
}
}
</script>
-9
View File
@@ -1,9 +0,0 @@
import WebSocketClient from './wsClient'
export default {
install (Vue, url, options) {
const socketClient = new WebSocketClient(url, options)
socketClient.connect()
Vue.prototype.$socket = socketClient
}
}
-122
View File
@@ -1,122 +0,0 @@
export default class WebSocketClient {
constructor (url, options) {
this.instance = null
this.url = url
this.options = options || this.defaultOptions()
if (this.options) {
if (options.reconnectEnabled) {
this.reconnectEnabled = options.reconnectEnabled
if (this.reconnectEnabled) {
this.reconnectInterval = options.reconnectInterval
this.reconnectAttempts = options.recconectAttempts
this.reconnectCount = 1
}
}
if (options.store) {
this.store = options.store
}
}
this.wsData = []
this.onOpen = null
this.onMessage = null
this.onClose = null
this.onError = null
}
createMessage (method, params, id) {
let msg = {
jsonrpc: '2.0', method: method, params: params, id: id
};
return JSON.stringify(msg)
}
defaultOptions () {
return {
reconnectEnabled: false,
reconnectInterval: 0,
recconectAttempts: 0,
store: undefined
}
}
passToStore (eventName, event) {
if (!eventName.startsWith('socket_')) { return }
let method = 'dispatch'
let target = eventName
let msg = event
if (event.data) {
msg = JSON.parse(event.data)
}
this.store[method](target, msg)
}
connect () {
this.instance = new WebSocket(this.url);
this.instance.onopen = () => {
if (this.reconnectEnabled) this.reconnectCount = 1;
if (typeof this.onOpen === 'function') this.onOpen();
if (this.store) this.passToStore('socket_on_open', event);
};
this.instance.onmessage = (msg) => {
let data = JSON.parse(msg.data);
if (typeof this.onMessage === 'function') {
this.onMessage(data)
} else if (this.store) {
if ('error' in data) {
this.passToStore('socket_on_error', data.error)
} else if (this.wsData.filter(item => item.id === data.id).length > 0 &&
this.wsData.filter(item => item.id === data.id)[0].action !== "") {
this.store.dispatch(
this.wsData.filter(item => item.id === data.id)[0].action,
data.result
)
} else this.passToStore('socket_on_message', data)
}
}
this.instance.onclose = (e) => {
if (typeof this.onClose === 'function') {
this.onClose(e)
} else if (this.store) {
this.passToStore('socket_on_close', e)
}
if (!e.wasClean && this.reconnectEnabled) {
this.reconnect()
}
}
this.instance.onerror = (e) => {
if (typeof this.onError === 'function') {
this.onError(e)
} else if (this.store) {
this.passToStore('socket_on_error', e)
}
}
}
reconnect () {
if (this.reconnectCount <= this.reconnectAttempts) {
this.reconnectCount++
delete this.instance
setTimeout(() => {
this.connect()
if (this.store) { this.passToStore('socket_reconnect', this.reconnectCount) }
}, this.reconnectInterval)
} else {
if (this.store) { this.passToStore('socket_reconnect_error', true) }
}
}
sendObj (method, params, action = '') {
let id = Math.floor(Math.random() * 10000) + 1
this.wsData.push({
id: id,
action: action
})
this.instance.send(this.createMessage(method, params, id))
}
}
+10 -10
View File
@@ -1,7 +1,14 @@
import '@fortawesome/fontawesome-free/css/all.css'
import '@mdi/font/css/materialdesignicons.css'
import Vue from 'vue';
import Vuetify, { VSnackbar, VBtn, VIcon } from 'vuetify/lib';
import VuetifyToast from 'vuetify-toast-snackbar'
//vue-toast-notification
import VueToast from 'vue-toast-notification';
import 'vue-toast-notification/dist/theme-sugar.css';
Vue.use(VueToast, {
duration: 3000,
});
Vue.use(Vuetify,{
@@ -12,15 +19,8 @@ Vue.use(Vuetify,{
}
});
Vue.use(VuetifyToast, {
x: 'right',
y: 'bottom',
timeout: 3000,
});
export default new Vuetify({
icons: {
iconfont: 'fa',
iconfont: 'mdi',
},
});
+79
View File
@@ -0,0 +1,79 @@
export default class WebSocketClient {
constructor (url, options) {
this.instance = null;
this.url = url;
this.reconnectInterval = options.reconnectInterval;
this.store = options.store;
this.wsData = [];
this.timerId = 0;
this.keepAliveTimeout = 1000;
this.onOpen = null;
this.onMessage = null;
this.onClose = null;
this.onError = null;
}
createMessage (method, params, id) {
let msg = {
jsonrpc: '2.0', method: method, params: params, id: id
};
return JSON.stringify(msg)
}
passToStore (eventName, event) {
if (!eventName.startsWith('socket_')) { return }
let method = 'dispatch'
let target = eventName
let msg = event
if (event && event.data) {
msg = JSON.parse(event.data)
}
this.store[method](target, msg)
}
connect () {
this.instance = new WebSocket(this.url);
this.instance.onopen = () => {
if (this.store) this.passToStore('socket_on_open', event);
};
this.instance.onclose = (e) => {
window.console.log("Websocket Closed, reconnecting in "+this.reconnectInterval+"ms: ", e.reason);
this.passToStore('socket_on_close', e);
setTimeout(() => {
this.connect();
}, this.reconnectInterval);
};
this.instance.onerror = (err) => {
console.log("Websocket Error: ", err);
this.instance.close();
};
this.instance.onmessage = (msg) => {
let data = JSON.parse(msg.data);
if (this.store) {
if (this.wsData.filter(item => item.id === data.id).length > 0 &&
this.wsData.filter(item => item.id === data.id)[0].action !== "") {
this.store.dispatch(
this.wsData.filter(item => item.id === data.id)[0].action,
data.result
)
} else this.passToStore('socket_on_message', data)
}
};
}
sendObj (method, params, action = '') {
let id = Math.floor(Math.random() * 10000) + 1
this.wsData.push({
id: id,
action: action
})
this.instance.send(this.createMessage(method, params, id))
}
}
+22 -7
View File
@@ -2,6 +2,7 @@ import Dashboard from '../pages/Dashboard.vue'
//import Status from '../pages/Status.vue'
import Webcam from '../pages/Webcam.vue'
import Console from '../pages/Console.vue'
import Heightmap from '../pages/Heightmap.vue'
import Files from '../pages/Files.vue'
import Settings from '../pages/Settings.vue'
import SettingsInterface from '../pages/settings/interface.vue'
@@ -13,18 +14,28 @@ const routes = [
path: '/',
icon: 'view-dashboard',
component: Dashboard,
alwaysShow: true,
},
{
title: "Webcam",
path: '/webcam',
icon: 'webcam',
component: Webcam,
alwaysShow: false,
},
{
title: "Console",
path: '/console',
icon: 'console-line',
component: Console,
alwaysShow: false,
},
{
title: "Heightmap",
path: '/heightmap',
icon: 'grid',
component: Heightmap,
alwaysShow: false,
},
/*{
title: "Current Job",
@@ -37,23 +48,27 @@ const routes = [
path: '/files',
icon: 'printer-3d-nozzle',
component: Files,
alwaysShow: false,
},
{
title: "Settings",
path: '/settings',
redirect: '/settings/interface',
redirect: '/settings/machine',
icon: 'wrench',
component: Settings,
alwaysShow: true,
children: [
{
title: 'Interface',
path: '/settings/interface',
component: SettingsInterface
},
{
title: 'Machine',
path: '/settings/machine',
component: SettingsMachine
component: SettingsMachine,
alwaysShow: true,
},
{
title: 'Interface',
path: '/settings/interface',
component: SettingsInterface,
alwaysShow: true,
},
]
},
+58 -60
View File
@@ -17,23 +17,6 @@ export default {
});
Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
Vue.prototype.$socket.sendObj('get_printer_objects', {}, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_status', { heater: [] }, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_status', { configfile: ['config'] }, 'getPrinterConfig');
Vue.prototype.$socket.sendObj('post_printer_subscriptions', {
gcode: [],
toolhead: [],
virtual_sdcard: [],
heater: [],
heater_bed: [],
extruder: ["temperature", "target"],
fan: [],
pause_resume: [],
idle_timeout: [],
});
Vue.prototype.$socket.sendObj('get_printer_files', {}, 'getFileList');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
},
socket_on_close ({ commit }, event) {
@@ -46,10 +29,6 @@ export default {
window.console.error('Code: ' + event.code)
},
socket_on_error ({ commit }, data) {
commit('reportError', data);
},
socket_on_message ({ commit, state }, data) {
if (!state.socket.isConnected) commit('setConnected');
switch(data.method) {
@@ -65,9 +44,9 @@ export default {
commit('setPrinterStatus', data.params[0]);
break;
/*case 'notify_klippy_state_changed':
case 'notify_klippy_state_changed':
commit('setPrinterStatus', data.params[0]);
break;*/
break;
case 'notify_filelist_changed':
commit('setFileList', data.params[0].filelist);
@@ -86,30 +65,6 @@ export default {
}
},
socket_reconnect ({ commit }, count) {
commit('setConnected');
window.console.log(count);
Vue.prototype.$socket.sendObj('get_printer_status', { heater: [] }, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_status', { configfile: ['config'] }, 'getPrinterConfig');
Vue.prototype.$socket.sendObj('post_printer_subscriptions', {
gcode: [],
toolhead: [],
virtual_sdcard: [],
heater: [],
heater_bed: [],
extruder: ["temperature", "target"],
fan: [],
pause_resume: [],
idle_timeout: [],
});
},
socket_reconnect_error ({ commit }) {
commit('setDisconnected');
window.console.error('Socket disconnected')
},
saveGuiSettings({ commit, state }) {
commit('setLoadingSaveGuiConfige', true);
let file = new File([JSON.stringify({ webcam: state.webcam, gui: state.gui })], 'gui.json');
@@ -129,23 +84,60 @@ export default {
},
getKlipperInfo({ commit }, data) {
commit('setPrinterData', {
hostname: data.hostname,
version: data.version
});
if (data !== undefined && data.is_ready) {
commit('setPrinterData', {
hostname: data.hostname,
version: data.version
});
commit('setPrinterStatus', 'ready');
Vue.prototype.$socket.sendObj('get_printer_objects', {}, 'getObjectInfo');
Vue.prototype.$socket.sendObj('get_printer_status', { heaters: [] }, 'getHeatersInfo');
Vue.prototype.$socket.sendObj('get_printer_status', { configfile: ['config'] }, 'getPrinterConfig');
Vue.prototype.$socket.sendObj('post_printer_subscriptions', {
gcode: [],
toolhead: [],
virtual_sdcard: [],
heaters: [],
fan: [],
pause_resume: [],
idle_timeout: [],
display_status: [],
});
Vue.prototype.$socket.sendObj('get_printer_files', {}, 'getFileList');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
} else {
commit('setPrinterStatus', 'disconnected');
setTimeout(function() {
Vue.prototype.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
}, 1000);
}
},
getObjectInfo({ commit }, data) {
commit('setObjectData', data);
},
getPrinterConfig({commit}, data) {
commit('setPrinterConfig', data);
getHeatersInfo({ commit }, data) {
commit('setObjectData', data);
if (data.heaters.available_heaters.length) {
data.heaters.available_heaters.forEach(function(heater) {
Vue.prototype.$socket.sendObj('post_printer_subscriptions', { [heater]: [] });
})
}
Vue.prototype.$socket.sendObj("get_server_temperature_store", {}, "getHeatersHistory");
},
addSubscription(state, data) {
window.console.log(state);
window.console.log(data);
getHeatersHistory({ commit }, data) {
commit('setHeaterHistory', data);
},
getPrinterConfig({commit}, data) {
commit('setPrinterConfig', data);
},
getFileList({ commit }, data) {
@@ -157,6 +149,11 @@ export default {
commit('setHelpList', data);
},
setHeaterChartVisibility({ commit, dispatch }, data) {
commit('setHeaterChartVisibility', data);
dispatch('saveGuiSettings');
},
setLoadingSendGcode({commit}, value) {
commit('setLoadingSendGcode', value);
},
@@ -180,22 +177,23 @@ export default {
sendGcode({commit}, data) {
commit('setLoadingSendGcode', false);
commit('sendGcode', data);
commit('addGcodeResponse', data);
},
responseHome({commit}) {
commit('setLoadingHome', false);
commit('removeLoading', { name: 'controlHomeAll' });
},
responseHomeX({commit}) {
commit('setLoadingHomeX', false);
commit('removeLoading', { name: 'controlHomeX' });
},
responseHomeY({commit}) {
commit('setLoadingHomeY', false);
commit('removeLoading', { name: 'controlHomeY' });
},
responseHomeZ({commit}) {
commit('setLoadingHomeZ', false);
commit('removeLoading', { name: 'controlHomeZ' });
},
responseQGL({commit}) {
+59 -6
View File
@@ -6,9 +6,9 @@ export default {
heaters: state => {
let heaters = [];
if (state.object.heater.available_heaters) {
if (state.object.heaters.available_heaters) {
for (let [key, value] of Object.entries(state.printer)) {
if (state.object.heater.available_heaters.includes(key)) {
if (state.object.heaters.available_heaters.includes(key)) {
heaters.push({
name: key,
target: value.target,
@@ -60,6 +60,33 @@ export default {
});
},
temperature_sensors: state => {
let sensors = [];
for (let [key, value] of Object.entries(state.printer)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "temperature_sensor") {
sensors.push({
name: nameSplit[1],
temperature: value.temperature,
measured_min_temp: value.measured_min_temp,
measured_max_temp: value.measured_max_temp,
});
}
}
return sensors.sort((a, b) => {
let nameA = a.name.toUpperCase();
let nameB = b.name.toUpperCase();
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
return 0;
});
},
current_file_size: state => {
let file = state.files.filter((file) => file.filename === state.printer.virtual_sdcard.current_file);
@@ -84,10 +111,10 @@ export default {
return 0;
},
current_file_filament_used: state => {
current_file_filament_total: state => {
let file = state.files.filter((file) => file.filename === state.printer.virtual_sdcard.current_file);
if (file.length) return file[0]['filament_used'];
if (file.length) return file[0]['filament_total'];
return 0;
},
@@ -109,7 +136,7 @@ export default {
for (let prop in state.config) {
if (prop.startsWith('gcode_macro') &&
!state.config[prop].hasOwnProperty('rename_existing') &&
!Object.hasOwnProperty.call(state.config[prop], 'rename_existing') &&
!(hiddenMacros.indexOf(prop.replace('gcode_macro ', '').toLowerCase()) > -1)
) {
array.push({
@@ -134,7 +161,8 @@ export default {
let array = [];
for (let prop in state.config) {
if (prop.startsWith('gcode_macro') && !state.config[prop].hasOwnProperty('rename_existing')) {
if (prop.startsWith('gcode_macro') &&
!Object.hasOwnProperty.call(state.config[prop], 'rename_existing')) {
array.push({
'name': prop.replace('gcode_macro ', ''),
'prop': state.config[prop]
@@ -179,6 +207,31 @@ export default {
});
},
getBedMeshProfiles: state => {
let profiles = [];
for (let [key, value] of Object.entries(state.config)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "bed_mesh" && nameSplit[1] !== undefined) {
profiles.push({
name: nameSplit[1],
data: value
});
}
}
return profiles.sort((a, b) => {
let nameA = a.name.toUpperCase();
let nameB = b.name.toUpperCase();
if (nameA < nameB) return -1;
if (nameA > nameB) return 1;
return 0;
});
},
getTitle: state => {
if (state.socket.isConnected) {
if (state.printer.pause_resume.is_paused) return "Pause Print";
+10 -6
View File
@@ -14,22 +14,20 @@ export default new Vuex.Store({
hostname: window.location.hostname,
port: window.location.port,
reconnectInterval: 3000,
reconnectAttempts: 1000,
isConnected: false,
loadingGcodeUpload: false,
loadingGcodeRefresh: false,
loadingEmergencyStop: false,
loadingPrintPause: false,
loadingPrintResume: false,
loadingHome: false,
loadingHomeX: false,
loadingHomeY: false,
loadingHomeZ: false,
loadingQGL: false,
loadingRestart: false,
loadingRestartFirmware: false,
loadingRebootHost: false,
loadingShutdownHost: false,
loadingSaveGuiConfig: false,
loadingEndstopStatus: false,
klippy_state: "ready",
},
webcam: {
url: ""
@@ -40,6 +38,7 @@ export default new Vuex.Store({
boolTempchart: true,
boolConsole: false,
hiddenMacros: [],
hiddenTempChart: [],
},
webcam: {
bool: false,
@@ -48,6 +47,7 @@ export default new Vuex.Store({
countPerPage: 10,
}
},
loadings: [],
config: {
},
@@ -73,6 +73,10 @@ export default new Vuex.Store({
printing_time: 0,
state: "",
},
display_status: {
message: null,
progress: 0,
},
virtual_sdcard: {
progress: 0,
current_file: "",
@@ -92,7 +96,7 @@ export default new Vuex.Store({
endstops: {},
},
object: {
heater: {
heaters: {
available_heaters: []
}
},
+147 -97
View File
@@ -1,97 +1,146 @@
import Vue from "vue";
const objectAssignDeep = require(`object-assign-deep`);
import { colorArray, colorChamber, colorHeaterBed, temperaturChartSampleInterval, temperaturChartSampleLength } from './variables';
import { colorArray, colorChamber, colorHeaterBed, temperaturChartSampleLength } from './variables';
export default {
setConnected (state) {
state.socket.isConnected = true;
Vue.prototype.$socket
//reset store
},
setDisconnected (state) {
state.socket.isConnected = false;
Vue.prototype.$socket.reconnect();
//Vue.prototype.$socket.reconnect();
},
setPrinterData(state, data) {
Object.assign(state.printer, data);
if (Array.isArray(state.object.heater.available_heaters) && state.object.heater.available_heaters.length) {
let boolAddValues = false;
let now = new Date();
if (Array.isArray(state.object.heaters.available_heaters) && state.object.heaters.available_heaters.length) {
let now = Date.now();
if (state.temperaturChart.labels.length === 0 || now - state.temperaturChart.labels[state.temperaturChart.labels.length - 1] > temperaturChartSampleInterval) {
for (let [key, value] of Object.entries(data)) {
let keySplit = key.split(" ");
for (let [key, value] of Object.entries(data)) {
let keySplit = key.split(" ");
if (state.object.heater.available_heaters.includes(key) || keySplit[0] === "temperature_fan") {
if (keySplit[0] === "temperature_fan") key = keySplit[1];
if (state.object.heaters.available_heaters.includes(key) || keySplit[0] === "temperature_fan") {
if (keySplit[0] === "temperature_fan") key = keySplit[1];
let index = state.temperaturChart.datasets.findIndex(element => element.label === key);
let index_target = state.temperaturChart.datasets.findIndex(element => element.label === key+'_target');
if (index >= 0) {
state.temperaturChart.datasets[index].data.push(value.temperature.toFixed(1));
state.temperaturChart.datasets[index_target].data.push(value.target.toFixed(1));
} else {
let color = '#f87979';
switch (key) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.datasets.length]; break;
}
state.temperaturChart.datasets.push({
label: key,
data: [value.temperature.toFixed(1)],
borderColor: color,
backgroundColor: color,
fill: false,
borderDash: undefined,
borderWidth: 2,
pointRadius: 0,
pointHitRadius: 5,
showLine: true
});
state.temperaturChart.datasets.push({
label: key+"_target",
data: [value.target.toFixed(1)],
borderColor: color,
backgroundColor: color+'20',
fill: true,
borderDash: undefined,
borderWidth: 0,
pointRadius: 0,
pointHitRadius: 0,
showLine: true
});
}
boolAddValues = true;
}
this.commit('addTemperatureChartValue', { name: key, value: value, time: now });
}
if (boolAddValues) {
state.temperaturChart.labels.push(now);
if (state.temperaturChart.labels.length > temperaturChartSampleLength) {
state.temperaturChart.labels.splice(0, state.temperaturChart.labels.length-temperaturChartSampleLength)
}
}
for (let [key, dataset] of Object.entries(state.temperaturChart.datasets)) {
if (dataset.data.length > temperaturChartSampleLength) {
state.temperaturChart.datasets[key].data.splice(0, dataset.data.length-temperaturChartSampleLength)
}
}
}
}
},
setHeaterHistory(state, data) {
let now = new Date();
if (data !== undefined) {
for (let [key, datasets] of Object.entries(data)) {
let keySplit = key.split(" ");
if (keySplit.length > 1) key = keySplit[1];
let max = datasets.temperatures.length;
for (let i = 0; i < max; i++) {
let time = new Date(now.getTime() - 1000 * (max - i));
this.commit('addTemperatureChartValue', {
name: key,
value: {
temperature: datasets.temperatures[i],
target: datasets.targets[i],
},
type: keySplit[0],
time: time
});
}
}
}
},
addTemperatureChartValue(state, payload) {
if (state.temperaturChart.labels.map(Number).indexOf(+payload.time) < 0) {
state.temperaturChart.labels.push(payload.time);
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);
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');
if (index >= 0) state.temperaturChart.datasets[index].data.push(payload.value.temperature.toFixed(1));
if (index_target >= 0) state.temperaturChart.datasets[index_target].data.push(payload.value.target.toFixed(1));
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 (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)
}
},
addTemperatureChartHeater(state, payload) {
let color = '';
switch (payload.name) {
case 'heater_bed': color = colorHeaterBed; break;
case 'chamber': color = colorChamber; break;
default: color = colorArray[state.temperaturChart.datasets.length]; break;
}
let hidden = state.gui.dashboard.hiddenTempChart.indexOf(payload.name.toUpperCase()) >= 0 ? true : null;
state.temperaturChart.datasets.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({
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,
});
}
},
setHeaterChartVisibility(state, data) {
let index = state.gui.dashboard.hiddenTempChart.indexOf(data.name.toUpperCase());
if (data.hidden && index === -1) state.gui.dashboard.hiddenTempChart.push(data.name.toUpperCase())
else if (data.hidden !== true && index > -1) state.gui.dashboard.hiddenTempChart.splice(index, 1);
},
setSettings(state, data) {
state = objectAssignDeep(state, data);
},
@@ -102,18 +151,16 @@ export default {
for (let key of Object.keys(data)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "temperature_fan") {
Vue.prototype.$socket.sendObj('post_printer_subscriptions', { [key]: [] });
}
if (nameSplit[0] === "filament_switch_sensor") {
Vue.prototype.$socket.sendObj('post_printer_subscriptions', { [key]: [] });
}
if (
nameSplit[0] === "temperature_fan" ||
nameSplit[0] === "temperature_sensors" ||
nameSplit[0] === "filament_switch_sensor"
) Vue.prototype.$socket.sendObj('post_printer_subscriptions', { [key]: [] });
}
},
setPrinterConfig(state, data) {
Vue.set(state, 'config', data.configfile.config);
if (data.configfile) Vue.set(state, 'config', data.configfile.config);
},
setFileList(state, data) {
@@ -128,7 +175,7 @@ export default {
modified: Date.parse(file.modified),
size: file.size,
slicer: file.slicer,
filament_used: file.filament_used,
filament_total: file.filament_total,
estimated_time: file.estimated_time,
layer_height: file.layer_height,
first_layer_height: file.first_layer_height,
@@ -157,7 +204,7 @@ export default {
message: data
});
if (data.substring(0,2) === "!!") {
if (data !== undefined && data.substring(0,2) === "!!") {
Vue.$toast.error(data);
}
},
@@ -174,8 +221,19 @@ export default {
state.socket.loadingSendGcode = false;
},
setLoading(state, data) {
if (!state.loadings.includes(data.name)) {
state.loadings.push(data.name);
}
},
removeLoading(state, data) {
state.loadings = state.loadings.filter(function(ele){ return ele !== data.name; });
},
setPrinterStatus(state, value) {
state.printer.toolhead.status = value;
state.socket.klippy_state = value;
//state.printer.toolhead.status = value;
},
setLoadingGcodeUpload(state, value) {
@@ -202,22 +260,6 @@ export default {
state.socket.loadingPrintCancel = value;
},
setLoadingHome(state, value) {
state.socket.loadingHome = value;
},
setLoadingHomeX(state, value) {
state.socket.loadingHomeX = value;
},
setLoadingHomeY(state, value) {
state.socket.loadingHomeY = value;
},
setLoadingHomeZ(state, value) {
state.socket.loadingHomeZ = value;
},
setLoadingQGL(state, value) {
state.socket.loadingQGL = value;
},
@@ -230,6 +272,14 @@ export default {
state.socket.loadingRestartFirmware = value;
},
setLoadingRebootHost(state, value) {
state.socket.loadingRebootHost = value;
},
setLoadingShutdownHost(state, value) {
state.socket.loadingShutdownHost = value;
},
setLoadingSaveGuiConfige(state, value) {
state.socket.loadingSaveGuiConfig = value;
},
-1
View File
@@ -14,5 +14,4 @@ export const colorArray = [
export const colorHeaterBed = '#2196F3';
export const colorChamber = '#4CAF50';
export const temperaturChartSampleInterval = 1000;
export const temperaturChartSampleLength = 600;