Skip to content

Commit

Permalink
modify nginx config in README;
Browse files Browse the repository at this point in the history
Settings > Machine > Endstop Status
Settings > Machine > Runout Sensor
  • Loading branch information
meteyou committed Apr 18, 2020
1 parent d0f7819 commit 6bc72dc
Show file tree
Hide file tree
Showing 24 changed files with 472 additions and 93 deletions.
26 changes: 20 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -67,7 +71,7 @@ gcode:
BASE_RESUME
```

## Installation lighttpd & haproxy
## Installation lighttpd & haproxy (out-dated)
```bash
sudo apt install lighttpd haproxy
```
Expand Down Expand Up @@ -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
```
Expand All @@ -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 {
Expand Down Expand Up @@ -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.
5 changes: 2 additions & 3 deletions public/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"socket": {
"hostname": "voron250.local",
"port": 8080,
"reconnectInterval": 3000,
"hostname": "kossel.local",
"reconnectInterval": 5000,
"reconnectAttempts": 1000
}
}
15 changes: 15 additions & 0 deletions src/charts/LineChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
14 changes: 0 additions & 14 deletions src/components/panels/ControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down Expand Up @@ -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,
}),
Expand All @@ -91,8 +87,6 @@
'setLoadingHomeY',
'setLoadingHomeZ',
'setLoadingQGL',
'setLoadingRestart',
'setLoadingRestartFirmware',
]),
...mapGetters([
'getMacros',
Expand Down Expand Up @@ -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>
45 changes: 0 additions & 45 deletions src/components/panels/MacrosPanel.vue

This file was deleted.

81 changes: 81 additions & 0 deletions src/components/panels/MiniconsolePanel.vue
Original file line number Diff line number Diff line change
@@ -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>
6 changes: 3 additions & 3 deletions src/components/panels/PeripheriePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand All @@ -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>
Expand Down
13 changes: 13 additions & 0 deletions src/components/panels/Settings/DashboardPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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: {
Expand Down
Loading

0 comments on commit 6bc72dc

Please sign in to comment.