modify nginx config in README;

Settings > Machine > Endstop Status
Settings > Machine > Runout Sensor
This commit is contained in:
Stefan Dej 2020-04-18 03:13:44 +02:00
parent d0f78196c5
commit 6bc72dcb8c
24 changed files with 472 additions and 93 deletions

View File

@ -6,6 +6,7 @@ At first install Arksine klipper-api fork/branch -> [install manual](https://git
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
@ -20,6 +21,9 @@ trusted_clients:
192.168.1.0/24
127.0.0.1
allow_file_ops_when_printing: true
[virtual_sdcard]
path: /home/pi/sdcard
```
Example Klipper macros:
@ -67,7 +71,7 @@ gcode:
BASE_RESUME
```
## Installation lighttpd & haproxy
## Installation lighttpd & haproxy (out-dated)
```bash
sudo apt install lighttpd haproxy
```
@ -118,6 +122,16 @@ backend websocket
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
```
@ -144,13 +158,13 @@ server {
root /home/pi/kwc;
index index.html;
server_name _;
#max upload size for gcodes
client_max_body_size 128M;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
try_files $uri $uri/ /index.html;
}
location /printer {
@ -181,4 +195,4 @@ 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
```
and update your macros
and update your macros & nginx config.

View File

@ -1,8 +1,7 @@
{
"socket": {
"hostname": "voron250.local",
"port": 8080,
"reconnectInterval": 3000,
"hostname": "kossel.local",
"reconnectInterval": 5000,
"reconnectAttempts": 1000
}
}

View File

@ -27,6 +27,21 @@ export default {
filter: function(item) {
return !item.text.includes('_target');
}
},
onClick: function(e, legendItem) {
let ci = this.chart;
let index = legendItem.datasetIndex;
let index_target = ci.data.datasets.findIndex(dataset => dataset.label === legendItem.text+'_target');
let meta = ci.getDatasetMeta(index);
// See controller.isDatasetVisible comment
meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
if (index_target) {
let meta_target = ci.getDatasetMeta(index_target);
meta_target.hidden = meta.hidden;
}
ci.update();
}
},
tooltips: {

View File

@ -8,8 +8,6 @@
<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-if="config.hasOwnProperty('quad_gantry_level')"><v-btn @click="doQGL" :loading="loadingQGL" color="primary">QGL</v-btn></div>
<div class="d-none d-sm-inline-block mx-2 my-1"><v-btn @click="doRestart" :loading="loadingRestart" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn></div>
<div class="d-inline-block mx-2 my-1"><v-btn @click="doRestartFirmware" :loading="loadingRestartFirmware" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon><span class="d-none d-sm-block">Firmware Restart</span></v-btn></div>
</v-col>
</v-row>
<v-row class="mt-3">
@ -80,8 +78,6 @@
loadingHomeY: state => state.socket.loadingHomeY,
loadingHomeZ: state => state.socket.loadingHomeZ,
loadingQGL: state => state.socket.loadingQGL,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.config,
}),
@ -91,8 +87,6 @@
'setLoadingHomeY',
'setLoadingHomeZ',
'setLoadingQGL',
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
...mapGetters([
'getMacros',
@ -129,14 +123,6 @@
doSend(gcode) {
this.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
},
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
},
}
}
</script>

View File

@ -1,45 +0,0 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>fa-cogs</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Macros</v-list-item-title>
<v-list-item-subtitle>
{{ getMacros.length }} Macros
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content text-center">
<div v-for="(macro, index) in getMacros" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
<v-btn color="primary" class="ml-3" @click="doSend(macro.name)">{{ macro.name }}</v-btn>
</div>
</v-card-text>
</v-card>
</template>
<script>
import {mapGetters} from 'vuex'
export default {
components: {
},
data: function() {
return {
}
},
computed: {
...mapGetters([
'getMacros',
]),
},
methods: {
doSend(gcode) {
this.$socket.sendObj('post_printer_gcode', { script: gcode }, "sendGcode");
},
},
}
</script>

View File

@ -0,0 +1,81 @@
<style>
.minievent-table {
max-height: 250px;
overflow-y: auto;
}
</style>
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-console-line</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Console</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="mt-2"></v-divider>
<v-card-text class="px-0 py-0 content">
<v-data-table
:headers="headers"
:options="options"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items="events"
item-key="date"
hide-default-footer
disable-pagination
class="minievent-table"
>
<template #no-data>
<div class="text-center">empty</div>
</template>
<template #item="{ item }">
<tr>
<td class="log-cell title-cell">
{{ item.date.toLocaleString() }}
</td>
<td class="log-cell content-cell" colspan="2">
<span v-if="item.message" class="message" v-html="formatMessage(item.message)"></span>
</td>
</tr>
</template>
</v-data-table>
</v-card-text>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
data: function() {
return {
sortBy: 'date',
sortDesc: true,
headers: [
],
options: {
},
}
},
computed: {
...mapState({
events: state => state.events,
})
},
methods: {
formatMessage(message) {
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
return message;
},
}
}
</script>

View File

@ -17,7 +17,7 @@
<template>
<div>
<v-card class="mt-4" v-if="bool_fan">
<v-card v-if="bool_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>
@ -28,7 +28,7 @@
<tool-slider :target="fan_speed" :multi="100" command="M106" attribute-name="S" :attribute-scale="2.55" ></tool-slider>
</v-card-text>
</v-card>
<v-card class="mt-4" v-if="is_printing">
<v-card class="mt-6" v-if="is_printing">
<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-4" v-if="is_printing">
<v-card class="mt-6" v-if="is_printing">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-texture" left></v-icon>Extrusion Factor</span>

View File

@ -19,6 +19,11 @@
<v-switch v-model="boolShowTempchartOnDashboard" label="Tempchart"></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-col>
</v-row>
</v-card-text>
</v-card>
</template>
@ -50,6 +55,14 @@
return this.$store.dispatch('setSettings', { gui: { dashboard: { boolTempchart: status } } });
}
},
boolShowConsoleOnDashboard: {
get() {
return this.$store.state.gui.dashboard.boolConsole;
},
set(status) {
return this.$store.dispatch('setSettings', { gui: { dashboard: { boolConsole: status } } });
}
},
},
methods: {

View File

@ -0,0 +1,73 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-arrow-expand-vertical</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Endstops</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<div v-for="(status, index) of sortEndstops" v-bind:key="index">
<v-row class="px-6" >
<v-col sm-12>
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
<v-chip class="float-right" :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
</v-col>
</v-row>
</div>
<v-row class="px-6" v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
<v-col sm-12>
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn icon @click="syncEndstops" :loading="loading">
<v-icon>mdi-sync</v-icon>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import { mapState } from 'vuex'
export default {
components: {
},
data: function() {
return {
sortEndstops: {}
}
},
computed: {
...mapState({
loading: state => state.socket.loadingEndstopStatus,
endstops: state => state.printer.endstops,
})
},
methods: {
syncEndstops() {
this.$store.commit('setLoadingEndstopStatus', true);
this.$socket.sendObj('get_printer_endstops', { }, "responseEndstopStatus");
}
},
watch: {
endstops: function() {
this.sortEndstops = {};
let keys = Object.keys(this.endstops);
keys.sort();
for (let i = 0; i < keys.length; i++) {
let k = keys[i];
this.sortEndstops[k] = this.endstops[k];
}
}
}
}
</script>

View File

@ -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" :target="max_velocity" :max="300" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" class="mt-5" ></toolSlider>
<toolSlider label="ACCEL" :target="max_accel" :max="5000" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" class="mt-5" ></toolSlider>
<toolSlider label="DECEL" :target="max_accel_to_decel" :max="2500" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" class="mt-5" ></toolSlider>
<toolSlider label="SCV" :target="square_corner_velocity" :max="10" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" class="mt-5" ></toolSlider>
<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>
</v-col>
</v-row>
</v-card-text>
@ -22,7 +22,7 @@
<script>
import { mapState } from 'vuex'
import toolSlider from '../../inputs/ToolSlider'
import toolSlider from '../../../inputs/ToolSlider'
export default {
components: {

View File

@ -0,0 +1,42 @@
<template>
<div>
<div v-for="(runout, index) of getFilamentSwitchSensors" v-bind:key="index">
<v-card class="mt-6">
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-printer-3d-nozzle-alert</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">{{ runout.name }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
<settings-runout-switch :name="runout.name "></settings-runout-switch>
</v-card-text>
</v-card>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import SettingsRunoutSwitch from "../../../inputs/SettingsRunoutSwitch";
export default {
components: {
SettingsRunoutSwitch
},
data: function() {
return {
}
},
computed: {
...mapGetters([
'getFilamentSwitchSensors'
])
},
methods: {
}
}
</script>

View File

@ -0,0 +1,53 @@
<template>
<v-card>
<v-list-item>
<v-list-item-avatar color="grey"><v-icon dark>mdi-cpu-64-bit</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">System</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-divider class="my-2"></v-divider>
<v-card-text class="">
<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 @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>
</v-card-text>
</v-card>
</template>
<script>
import {mapMutations, mapState} from 'vuex'
export default {
components: {
},
data: function() {
return {
}
},
computed: {
...mapState({
hostname: state => state.socket.hostname,
port: state => state.socket.port,
loadingRestart: state => state.socket.loadingRestart,
loadingRestartFirmware: state => state.socket.loadingRestartFirmware,
}),
...mapMutations([
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
},
methods: {
doRestart() {
this.$store.commit('setLoadingRestart', true);
this.$socket.sendObj('post_printer_restart', { }, "responseRestart");
},
doRestartFirmware() {
this.$store.commit('setLoadingRestartFirmware', true);
this.$socket.sendObj('post_printer_firmware_restart', { }, "responseRestartFirmware");
},
}
}
</script>

View File

@ -3,10 +3,18 @@ import Vue from 'vue'
import WebcamPanel from './WebcamPanel.vue'
import DashboardPanel from "./DashboardPanel";
import MacrosPanel from "./MacrosPanel";
import EndstopPanel from "./EndstopPanel";
import LimitsPanel from "./LimitsPanel";
import RunoutPanel from "./RunoutPanel";
import SystemPanel from "./SystemPanel";
Vue.component('settings-webcam-panel', WebcamPanel);
Vue.component('settings-dashboard-panel', DashboardPanel);
Vue.component('settings-macros-panel', MacrosPanel);
Vue.component('settings-endstop-panel', EndstopPanel);
Vue.component('settings-limits-panel', LimitsPanel);
Vue.component('settings-runout-panel', RunoutPanel);
Vue.component('settings-system-panel', SystemPanel);
export default {

View File

@ -5,9 +5,8 @@ import ToolsPanel from './ToolsPanel.vue'
import TempchartPanel from './TempchartPanel.vue'
import ControlPanel from "./ControlPanel";
import Peripherie from "./PeripheriePanel";
import MacrosPanel from "./MacrosPanel";
import LimitsPanel from "./LimitsPanel";
import WebcamPanel from "./WebcamPanel";
import MiniconsolePanel from "./MiniconsolePanel";
import Settings from "./Settings/";
Vue.component('status-panel', StatusPanel);
@ -15,9 +14,8 @@ Vue.component('tools-panel', ToolsPanel);
Vue.component('tempchart-panel', TempchartPanel);
Vue.component('control-panel', ControlPanel);
Vue.component('peripherie-panel', Peripherie);
Vue.component('macros-panel', MacrosPanel);
Vue.component('limits-panel', LimitsPanel);
Vue.component('webcam-panel', WebcamPanel);
Vue.component('miniconsole-panel', MiniconsolePanel);
export default {
Settings

View File

@ -0,0 +1,67 @@
<style>
.settingsRunoutSwitchInput .v-messages {
display: none;
}
</style>
<template>
<div>
<v-row class="px-6" >
<v-col sm-12>
<v-switch v-model="enabled" :label="enabled ? 'enabled' : 'disabled'" @change="changeSensor()" class="settingsRunoutSwitchInput my-0"></v-switch>
</v-col>
</v-row>
<v-row class="px-6" v-if="enabled" >
<v-col sm-12>
<label class="mt-1 d-inline-block">Filament:</label>
<v-chip class="float-right" :color="filament_detected ? 'green' : 'red' " text-color="white">{{ filament_detected ? 'detected' : 'empty' }}</v-chip>
</v-col>
</v-row>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
data: function() {
return {
value: false,
enabled: false,
filament_detected: false,
}
},
props: {
name: String,
},
computed: {
...mapGetters([
'getFilamentSwitchSensors'
])
},
methods: {
changeSensor() {
this.$socket.sendObj('post_printer_gcode', { script: 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 0 : 1) });
}
},
watch: {
getFilamentSwitchSensors: function() {
let sensor = this.getFilamentSwitchSensors.find(sensor => sensor.name === this.name);
if (sensor) {
this.enabled = sensor.enabled;
this.filament_detected = sensor.filament_detected;
}
}
},
created() {
let sensor = this.getFilamentSwitchSensors.find(sensor => sensor.name === this.name);
if (sensor) {
this.enabled = sensor.enabled;
this.filament_detected = sensor.filament_detected;
}
}
}
</script>

View File

@ -15,7 +15,8 @@
export default {
data: function() {
return {
value: this.target * this.multi
value: this.target * this.multi,
variableMax: 0,
}
},
props: {
@ -52,6 +53,11 @@
required: false,
default: 100
},
extenderSteps: {
type: Number,
required: false,
default: 100
},
multi: {
type: Number,
required: false,
@ -77,7 +83,24 @@
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;
}
}
}*/
},
/*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;
}*/
}
</script>

View File

@ -7,16 +7,20 @@
</v-col>
<v-col class="col-sm-12 col-md-5">
<tools-panel></tools-panel>
<peripherie-panel></peripherie-panel>
<peripherie-panel class="mt-6"></peripherie-panel>
<miniconsole-panel class="mt-6" v-if="showDashboardConsole"></miniconsole-panel>
</v-col>
</v-row>
</template>
<script>
import { mapGetters } from 'vuex'
import { mapState, mapGetters } from 'vuex'
export default {
computed: {
...mapState({
showDashboardConsole: state => state.gui.dashboard.boolConsole,
}),
...mapGetters([
'showDashboardWebcam'
])

View File

@ -1,15 +1,13 @@
<template>
<div>
<v-row>
<v-col class="col-6">
<v-col class="col-12 col-md-6 col-lg-4">
<settings-dashboard-panel></settings-dashboard-panel>
</v-col>
<v-col class="col-6">
<v-col class="col-12 col-md-6 col-lg-4">
<settings-webcam-panel></settings-webcam-panel>
</v-col>
</v-row>
<v-row>
<v-col class="col-6">
<v-col class="col-12 col-md-6 col-lg-4">
<settings-macros-panel></settings-macros-panel>
</v-col>
</v-row>

View File

@ -2,7 +2,14 @@
<div>
<v-row>
<v-col class="col-sm-12 col-md-6">
<limits-panel></limits-panel>
<settings-limits-panel></settings-limits-panel>
</v-col>
<v-col class="col-sm-12 col-md-3">
<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>
</v-row>
</div>

View File

@ -23,7 +23,7 @@ const routes = [
{
title: "Console",
path: '/console',
icon: 'code-tags',
icon: 'console-line',
component: Console,
},
/*{
@ -41,6 +41,7 @@ const routes = [
{
title: "Settings",
path: '/settings',
redirect: '/settings/interface',
icon: 'wrench',
component: Settings,
children: [

View File

@ -210,6 +210,11 @@ export default {
commit('setLoadingRestartFirmware', false);
},
responseEndstopStatus({ commit }, data) {
commit('setLoadingEndstopStatus', false);
commit('setEndstopStatus', data);
},
switchToDashboard() {
router.push("/");
},

View File

@ -153,6 +153,32 @@ export default {
});
},
getFilamentSwitchSensors: state => {
let sensors = [];
for (let [key, value] of Object.entries(state.printer)) {
let nameSplit = key.split(" ");
if (nameSplit[0] === "filament_switch_sensor") {
sensors.push({
name: nameSplit[1],
enabled: value.enabled,
filament_detected: value.filament_detected,
});
}
}
return sensors.sort((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";

View File

@ -29,6 +29,7 @@ export default new Vuex.Store({
loadingRestart: false,
loadingRestartFirmware: false,
loadingSaveGuiConfig: false,
loadingEndstopStatus: false,
},
webcam: {
url: ""
@ -37,6 +38,7 @@ export default new Vuex.Store({
dashboard: {
boolWebcam: true,
boolTempchart: true,
boolConsole: false,
hiddenMacros: [],
},
webcam: {
@ -86,7 +88,8 @@ export default new Vuex.Store({
},
fan: {
speed: 0,
}
},
endstops: {},
},
object: {
heater: {

View File

@ -10,7 +10,7 @@ export default {
},
setDisconnected (state) {
state.socket.isConnected = false
state.socket.isConnected = false;
Vue.prototype.$socket.reconnect();
},
@ -162,6 +162,10 @@ export default {
}
},
setEndstopStatus(state, data) {
Vue.set(state.printer, 'endstops', data);
},
setLoadingSendGcode(state, value) {
state.socket.loadingSendGcode = value;
},
@ -230,6 +234,10 @@ export default {
state.socket.loadingSaveGuiConfig = value;
},
setLoadingEndstopStatus(state, value) {
state.socket.loadingEndstopStatus = value;
},
reportError(state, data) {
//Vue.$toast.error(data.message);
window.console.log(data);