From 6bc72dcb8ca20d8e2e8093687f28a6bfb2fc45ca Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 18 Apr 2020 03:13:44 +0200 Subject: [PATCH] modify nginx config in README; Settings > Machine > Endstop Status Settings > Machine > Runout Sensor --- README.md | 26 ++++-- public/config.json | 5 +- src/charts/LineChart.js | 15 ++++ src/components/panels/ControlPanel.vue | 14 ---- src/components/panels/MacrosPanel.vue | 45 ----------- src/components/panels/MiniconsolePanel.vue | 81 +++++++++++++++++++ src/components/panels/PeripheriePanel.vue | 6 +- .../panels/Settings/DashboardPanel.vue | 13 +++ .../panels/Settings/EndstopPanel.vue | 73 +++++++++++++++++ .../panels/{ => Settings}/LimitsPanel.vue | 10 +-- .../panels/Settings/RunoutPanel.vue | 42 ++++++++++ .../panels/Settings/SystemPanel.vue | 53 ++++++++++++ src/components/panels/Settings/index.js | 8 ++ src/components/panels/index.js | 6 +- src/inputs/SettingsRunoutSwitch.vue | 67 +++++++++++++++ src/inputs/ToolSlider.vue | 27 ++++++- src/pages/Dashboard.vue | 8 +- src/pages/settings/interface.vue | 8 +- src/pages/settings/machine.vue | 9 ++- src/routes/index.js | 3 +- src/store/actions.js | 5 ++ src/store/getters.js | 26 ++++++ src/store/index.js | 5 +- src/store/mutations.js | 10 ++- 24 files changed, 472 insertions(+), 93 deletions(-) delete mode 100644 src/components/panels/MacrosPanel.vue create mode 100644 src/components/panels/MiniconsolePanel.vue create mode 100644 src/components/panels/Settings/EndstopPanel.vue rename src/components/panels/{ => Settings}/LimitsPanel.vue (59%) create mode 100644 src/components/panels/Settings/RunoutPanel.vue create mode 100644 src/components/panels/Settings/SystemPanel.vue create mode 100644 src/inputs/SettingsRunoutSwitch.vue diff --git a/README.md b/README.md index 5b7fba078..c535c2146 100644 --- a/README.md +++ b/README.md @@ -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 \ No newline at end of file +and update your macros & nginx config. \ No newline at end of file diff --git a/public/config.json b/public/config.json index bfab5638e..6e2bd60c1 100644 --- a/public/config.json +++ b/public/config.json @@ -1,8 +1,7 @@ { "socket": { - "hostname": "voron250.local", - "port": 8080, - "reconnectInterval": 3000, + "hostname": "kossel.local", + "reconnectInterval": 5000, "reconnectAttempts": 1000 } } \ No newline at end of file diff --git a/src/charts/LineChart.js b/src/charts/LineChart.js index 842d81485..283d140f7 100644 --- a/src/charts/LineChart.js +++ b/src/charts/LineChart.js @@ -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: { diff --git a/src/components/panels/ControlPanel.vue b/src/components/panels/ControlPanel.vue index 77aafed5c..2348e7e05 100644 --- a/src/components/panels/ControlPanel.vue +++ b/src/components/panels/ControlPanel.vue @@ -8,8 +8,6 @@
mdi-homeHome all
QGL
-
mdi-cachedRestart
-
mdi-cachedFirmware Restart
@@ -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"); - }, } } \ No newline at end of file diff --git a/src/components/panels/MacrosPanel.vue b/src/components/panels/MacrosPanel.vue deleted file mode 100644 index 9e2b4894e..000000000 --- a/src/components/panels/MacrosPanel.vue +++ /dev/null @@ -1,45 +0,0 @@ - - - \ No newline at end of file diff --git a/src/components/panels/MiniconsolePanel.vue b/src/components/panels/MiniconsolePanel.vue new file mode 100644 index 000000000..fb36e2f49 --- /dev/null +++ b/src/components/panels/MiniconsolePanel.vue @@ -0,0 +1,81 @@ + + + + + \ No newline at end of file diff --git a/src/components/panels/PeripheriePanel.vue b/src/components/panels/PeripheriePanel.vue index 389988d83..398f0063d 100644 --- a/src/components/panels/PeripheriePanel.vue +++ b/src/components/panels/PeripheriePanel.vue @@ -17,7 +17,7 @@ @@ -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: { diff --git a/src/components/panels/Settings/EndstopPanel.vue b/src/components/panels/Settings/EndstopPanel.vue new file mode 100644 index 000000000..f5045de05 --- /dev/null +++ b/src/components/panels/Settings/EndstopPanel.vue @@ -0,0 +1,73 @@ + + + \ No newline at end of file diff --git a/src/components/panels/LimitsPanel.vue b/src/components/panels/Settings/LimitsPanel.vue similarity index 59% rename from src/components/panels/LimitsPanel.vue rename to src/components/panels/Settings/LimitsPanel.vue index 8715ef533..78ccf06df 100644 --- a/src/components/panels/LimitsPanel.vue +++ b/src/components/panels/Settings/LimitsPanel.vue @@ -10,10 +10,10 @@ - - - - + + + + @@ -22,7 +22,7 @@ \ No newline at end of file diff --git a/src/components/panels/Settings/SystemPanel.vue b/src/components/panels/Settings/SystemPanel.vue new file mode 100644 index 000000000..7a74e6a96 --- /dev/null +++ b/src/components/panels/Settings/SystemPanel.vue @@ -0,0 +1,53 @@ + + + \ No newline at end of file diff --git a/src/components/panels/Settings/index.js b/src/components/panels/Settings/index.js index 4db511498..79ce0b1af 100644 --- a/src/components/panels/Settings/index.js +++ b/src/components/panels/Settings/index.js @@ -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 { diff --git a/src/components/panels/index.js b/src/components/panels/index.js index b6284eb3b..08aebe466 100644 --- a/src/components/panels/index.js +++ b/src/components/panels/index.js @@ -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 diff --git a/src/inputs/SettingsRunoutSwitch.vue b/src/inputs/SettingsRunoutSwitch.vue new file mode 100644 index 000000000..2ace6ed42 --- /dev/null +++ b/src/inputs/SettingsRunoutSwitch.vue @@ -0,0 +1,67 @@ + + + + + + \ No newline at end of file diff --git a/src/inputs/ToolSlider.vue b/src/inputs/ToolSlider.vue index 6d62f285b..2140202c1 100644 --- a/src/inputs/ToolSlider.vue +++ b/src/inputs/ToolSlider.vue @@ -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; + }*/ } \ No newline at end of file diff --git a/src/pages/Dashboard.vue b/src/pages/Dashboard.vue index f047cc186..0f20aee65 100644 --- a/src/pages/Dashboard.vue +++ b/src/pages/Dashboard.vue @@ -7,16 +7,20 @@ - + +