Compare commits

..
15 Commits
Author SHA1 Message Date
Stefan Dej 1daf1b07aa Update installation.md -> STRG to CTRL. Thx DocGalaxyBlock
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 01:35:12 +02:00
Stefan Dej 9bdcec01ca Update Mainsail to the Moonraker 0.1
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-15 01:23:09 +02:00
Stefan Dej 717408592d Merge remote-tracking branch 'origin/master' 2020-08-14 22:50:02 +02:00
Stefan Dej 00319167a4 update guides to outdated
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 22:49:44 +02:00
meteyou beb52f2290 Merge pull request #24 from meteyou/dependabot/npm_and_yarn/websocket-extensions-0.1.4
Bump websocket-extensions from 0.1.3 to 0.1.4
2020-08-14 10:38:30 +02:00
meteyou 8d45767e14 Merge pull request #29 from meteyou/dependabot/npm_and_yarn/lodash-4.17.19
build(deps): bump lodash from 4.17.15 to 4.17.19
2020-08-14 10:38:17 +02:00
Stefan Dej ffa2ea9b08 bugfix: min_extrude_temp at ExtruderPanel.vue (fix #35)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 10:24:38 +02:00
Stefan Dej 41f855d9c4 upload update-0.1.x.md preview
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-14 10:04:49 +02:00
Stefan Dej f4a514cb67 bugfix: machine limits auto extend
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-12 22:33:20 +02:00
Stefan Dej 29d5b81b47 feature: add config editor
bugfix: new file named "e" after upload in root directory

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-08 18:26:27 +02:00
Stefan Dej c322edba72 bugfix: fix filament runout sensor -> on/off
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-05 00:06:49 +02:00
Stefan Dej 43d832cd33 bugfix: fix load metadata load after upload (delay to short for the moonraker)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 21:53:17 +02:00
Stefan Dej 981b2e854c update docs
Signed-off-by: Stefan Dej <meteyou@gmail.com>
2020-08-04 00:28:59 +02:00
dependabot[bot] e9fc463e4a build(deps): bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 19:27:38 +00:00
dependabot[bot] 4937f02673 Bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-07 22:59:23 +00:00
23 changed files with 2360 additions and 1932 deletions

No files matched your search

+41 -29
View File
@@ -21,29 +21,47 @@ sudo apt install git dfu-util
```
## Install Klipper
Moonraker is still in alpha development, and thus some of its dependencies
in Klipper have yet to be merged. Until this has been done it will be
necessary to add a remote and work off a developmental branch of Klipper
to correctly run Moonraker.
In this step, we install klipper and change to the development branch of Klipper.
In this step, we install klipper.
```
cd ~
git clone https://github.com/KevinOConnor/klipper
cd ~/klipper
git remote add arksine https://github.com/arksine/klipper
git fetch arksine
git reset --hard arksine/dev-moonraker-testing
./scripts/install-octopi.sh
```
Note that you are now in a detached head state and you cannot pull. Any
time you want to update to the latest version of this branch you have to
`git fetch arksine` and `git reset --hard arksine/dev-moonraker-testing`.
After you install Klipper with its dependencies you have to change the location
of the `printer.cfg`. This is definied in the `/etc/default/klipper` file. To edit
this file type:
```
sudo nano /etc/default/klipper
```
and then change:
```
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log"
```
to:
```
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /tmp/klippy.log"
```
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
Now you can copy your `printer.cfg` in your home directory and restart klipper.
Please check the `klippy.log`, if Klipper starts correctly and then continue
the guide.
At least you have to create the config and the virtual_sdcard directory with:
```
mkdir ~/klipper_config
mkdir ~/sdcard
```
and copy your `printer.cfg` in the `~/klipper_config` directory and restart klipper with
`sudo service klipper restart`. Please check the `klippy.log`, if Klipper starts
correctly and then continue the guide.
and check if you have following lines in your `printer.cfg`:
```
[virtual_sdcard]
path: ~/sdcard
[pause_resume]
[display_status]
```
## Install Moonraker (API)
You can now install the Moonraker application:
@@ -67,24 +85,18 @@ All other configuration is sent to the server via Klippy, thus it is done
in printer.cfg. A basic configuration that authorizes clients on a range
from 192.168.1.1 - 192.168.1.254 is as follows.
Edit your printer.cfg with nano ~/printer.cfg and add the following lines:
Create the configfile with `nano ~/moonraker.conf` and add the following lines:
```
[moonraker]
[server]
host: 0.0.0.0
config_path: ~/klipper_config
[authorization]
enabled: true
trusted_clients:
192.168.1.0/24
```
We also need a `virtual_sdcard` for store the gcode files:
```
[virtual_sdcard]
path: /home/pi/sdcard
```
Finally, we create the virtual_sdcard directory:
```
mkdir ~/sdcard
```
Restart klipper (sudo service klipper restart`) and check your klippy.log if klipper is starting correct again.
When klipper is running, open the url `http://<printer-ip>:7125/printer/info` in your browser. If you see a content like this
@@ -231,7 +243,7 @@ Now we can install Mainsail (static httpdocs).
Now you can download the current mainsail static data
```
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.3/mainsail-beta-0.1.3.zip && unzip mainsail.zip && rm mainsail.zip
```
Now it should be possible to open the interface: `http://<printer-ip>/`.
+1 -1
View File
@@ -16,7 +16,7 @@ gcode:
M141 S0
M106 S0
CLEAR_PAUSE
RESET_SD
SDCARD_RESET_FILE
BASE_CANCEL_PRINT
[gcode_macro PAUSE]
+1 -1
View File
@@ -43,5 +43,5 @@ Restart nginx with `sudo service nginx restart`
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.2/mainsail-beta-0.1.2.zip && unzip mainsail.zip && rm mainsail.zip
```
+38 -4
View File
@@ -8,17 +8,51 @@ git pull
sudo service moonraker restart
```
create a new file ~/moonraker.conf
```
[server]
host: 0.0.0.0
config_path: ~/klipper_config
[authorization]
enabled: true
trusted_clients:
192.168.0.0/24
```
## Update Klipper
```
cd ~/klipper
git fetch arksine
git checkout arksine/dev-moonraker-testing
sudo service klipper restart
git fetch
git checkout origin/master
```
### Move klipper config files to the subdirectory
create the new subdirectory and move `printer.cfg` in `~/klipper_config`:
```
mkdir ~/klipper_config/
mv ~/printer.cfg ~/klipper_config/
```
move also included klipper config files to this directory.
### Change Klipper default printer.cfg location
edit file `/etc/default/klipper` and change `/home/pi/printer.cfg`to `/home/pi/klipper_config/printer.cfg`.
### Modify printer.cfg
now you have to remove the `[moonraker]` section from `~/klipper_config/printer.cfg` and check if there are the following sections in it:
```
[virtual_sdcard]
path: ~/sdcard
[pause_resume]
[display_status]
```
and rename `RESET_SD` in your cancel print macro to `SDCARD_RESET_FILE`.
## Update static files from Mainsail
```
rm -R ~/mainsail/*
cd ~/mainsail
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.1/mainsail-beta-0.1.1.zip && unzip mainsail.zip && rm mainsail.zip
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/v0.1.2/mainsail-beta-0.1.2.zip && unzip mainsail.zip && rm mainsail.zip
```
+1554 -1649
View File
File diff suppressed because it is too large. Load diff
+13 -11
View File
@@ -12,31 +12,33 @@
"chart.js": "^2.9.3",
"core-js": "^3.6.5",
"object-assign-deep": "^0.4.0",
"prismjs": "^1.21.0",
"vue": "^2.6.11",
"vue-chartjs": "^3.5.0",
"vue-context": "^5.2.0",
"vue-context": "^6.0.0",
"vue-headful": "^2.1.0",
"vue-plotly": "^1.1.0",
"vue-prism-editor": "^1.2.0",
"vue-resource": "^1.5.1",
"vue-simple-upload": "^0.1.6",
"vue-toast-notification": "^0.4.1",
"vuetify": "^2.3.4",
"vue-toast-notification": "^0.5.0",
"vuetify": "^2.3.8",
"vuex": "^3.5.1"
},
"devDependencies": {
"@mdi/font": "^5.3.45",
"@vue/cli-plugin-babel": "^4.4.6",
"@vue/cli-plugin-eslint": "^4.4.6",
"@vue/cli-service": "^4.4.6",
"@mdi/font": "^5.5.55",
"@vue/cli-plugin-babel": "^4.5.3",
"@vue/cli-plugin-eslint": "^4.5.3",
"@vue/cli-service": "^4.5.3",
"babel-eslint": "^10.1.0",
"css-loader": "^3.6.0",
"eslint": "^7.5.0",
"css-loader": "^4.2.1",
"eslint": "^7.6.0",
"eslint-plugin-vue": "^6.2.2",
"sass": "^1.26.10",
"sass-loader": "^9.0.2",
"sass-loader": "^9.0.3",
"vue-cli-plugin-route": "0.0.7",
"vue-cli-plugin-vuetify": "^2.0.7",
"vue-router": "^3.3.4",
"vue-router": "^3.4.3",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.6.0"
},
+1 -1
View File
@@ -118,7 +118,7 @@ export default {
isConnected: state => state.socket.isConnected,
isConnecting: state => !state.socket.isConnected,
virtual_sdcard: state => state.printer.virtual_sdcard,
current_file: state => state.printer.virtual_sdcard.filename,
current_file: state => state.printer.print_stats.filename,
boolNaviWebcam: state => state.gui.webcam.bool,
klippy_state: state => state.socket.klippy_state,
is_ready: state => state.socket.is_ready,
+5 -5
View File
@@ -4,14 +4,14 @@
<template>
<v-card>
<v-row class="" v-if="!is_printing">
<v-row class="" v-if="['standby', 'complete'].includes(printer_state)">
<v-col class="col-12 pb-0 text-center">
<div class="d-inline-block mx-2 my-1"><v-btn @click="doHome" :loading="loadingHomeAll" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'" class=""><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('quad_gantry_level')"><v-btn @click="doQGL" :loading="loadingQGL" color="primary">QGL</v-btn></div>
<div class="d-inline-block mx-2 my-1" v-if="config.hasOwnProperty('z_tilt')"><v-btn @click="doZtilt" :loading="loadingZTilt" color="primary">Z Tilt</v-btn></div>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
<v-row class="mt-3" v-if="['standby', 'complete'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSendMove('X-100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><v-icon left class="d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">X-100</span></v-btn>
@@ -24,7 +24,7 @@
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
<v-row class="mt-3" v-if="['standby', 'complete'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSendMove('Y-100')" cols="1" class="flex-grow-1 flex-shrink-0 d-none d-sm-flex"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Y-100</span></v-btn>
@@ -37,7 +37,7 @@
</v-btn-toggle>
</v-col>
</v-row>
<v-row class="mt-3" v-if="!is_printing">
<v-row class="mt-3" v-if="['standby', 'complete'].includes(printer_state)">
<v-col class="col-12 py-0 px-6 text-center">
<v-btn-toggle borderless no-gutters style="flex-wrap: nowrap; width: 100%;" >
<v-btn @click="doSendMove('Z-25')" cols="1" class="flex-grow-1 flex-shrink-0"><v-icon left class="d-none d-sm-flex">mdi-chevron-left</v-icon><span class="body-2">Z-25</span></v-btn>
@@ -83,10 +83,10 @@
homedAxes: state => state.printer.toolhead.homed_axes,
config: state => state.config,
loadings: state => state.loadings,
printer_state: state => state.printer.print_stats.state
}),
...mapGetters([
'getMacros',
'is_printing'
])
},
methods: {
+4 -7
View File
@@ -3,7 +3,7 @@
</style>
<template>
<v-card v-if="!(printer_state === 'Printing' && printer_is_printing)">
<v-card v-if="(['standby', 'paused', 'complete'].includes(printer_state))">
<v-row class="px-3">
<v-col class="col-12 col-md-6">
<v-label>Feed amount in mm:</v-label>
@@ -29,8 +29,8 @@
</v-row>
<v-row class="px-3">
<v-col class="col-12 text-center">
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && extruder.config.min_extrude_temp < extruder.status.temperature)"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && extruder.config.min_extrude_temp < extruder.status.temperature)"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
<v-btn @click="sendRetract()" class="mx-2" :loading="loadingRetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && (extruder.config.min_extrude_temp < extruder.status.temperature || !extruder.config.min_extrude_temp))"><v-icon>mdi-arrow-up-bold</v-icon> Retract</v-btn>
<v-btn @click="sendDetract()" class="mx-2" :loading="loadingDetract" :disabled="!(extruder !== undefined && extruder.config !== null && extruder.status !== null && (extruder.config.min_extrude_temp < extruder.status.temperature || !extruder.config.min_extrude_temp))"><v-icon>mdi-arrow-down-bold</v-icon> Extrude</v-btn>
</v-col>
</v-row>
</v-card>
@@ -56,14 +56,11 @@
...mapState({
config: state => state.config,
loadings: state => state.loadings,
printer_state: state => state.printer.idle_timeout.state,
printer_is_paused: state => state.printer.pause_resume.is_paused,
printer_is_printing: state => state.printer.virtual_sdcard.is_active,
printer_state: state => state.printer.print_stats.state,
}),
...mapGetters([
'getMacros',
'getCurrentExtruder',
'is_printing'
]),
extruder: {
get: function() {
@@ -0,0 +1,457 @@
<style>
.my-editor {
background: #2d2d2d;
color: #ccc;
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
font-size: 14px;
line-height: 1.5;
padding: 5px;
}
.prism-editor__textarea:focus {
outline: none;
}
.config-editor-overlay div.v-card {
position: relative;
padding-top: 64px !important;
}
.config-editor-overlay div.v-card header {
position: fixed;
top: 0;
width: 100%;
z-index: 1;
}
</style>
<template>
<div>
<v-card>
<v-card-title>
Configfiles
<v-spacer></v-spacer>
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
<v-btn color=" ml-4" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
<v-btn color="primary ml-4" :loading="loadingConfigRefresh" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
</v-card-title>
<v-card-subtitle>Current path: {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:page.sync="currentPage"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page="countPerPage"
item-key="name">
<template #no-data>
<div class="text-center">empty</div>
</template>
<template v-slot:body.prepend>
<tr
v-if="(currentPath !== '')"
class="file-list-cursor"
@click="clickRowGoBack">
<td class=" "><v-icon>mdi-folder-upload</v-icon></td>
<td class=" " colspan="8">..</td>
</tr>
</template>
<template #item="{ item }">
<tr
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
:data-name="item.filename">
<td class=" ">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory">mdi-file</v-icon>
</td>
<td class=" ">{{ item.filename }}</td>
<td class="text-no-wrap text-right">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
<td class="text-right">{{ formatDate(item.modified) }}</td>
</tr>
</template>
</v-data-table>
</v-card>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
</v-list-item>
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-pencil</v-icon> Rename
</v-list-item>
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
</v-list-item>
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory && currentPath !== '' && currentPath !== '/config_examples'">
<v-icon class="mr-1">mdi-delete</v-icon> Delete
</v-list-item>
</v-list>
</v-menu>
<v-dialog v-model="editor.showLoader" hide-overlay persistent width="300" >
<v-card color="primary" dark >
<v-card-text>
Please stand by
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
</v-card-text>
</v-card>
</v-dialog>
<v-dialog v-model="editor.show" fullscreen hide-overlay transition="dialog-bottom-transition" content-class="config-editor-overlay">
<v-card d-flex>
<v-toolbar dark color="primary">
<v-btn icon dark @click="editor.show = false">
<v-icon>mdi-close</v-icon>
</v-btn>
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
<v-btn dark text @click="saveFile" v-if="currentPath !== '/config_examples'">Save</v-btn>
</v-toolbar-items>
</v-toolbar>
<prism-editor class="my-editor" v-model="editor.sourcecode" :readonly="editor.readonly" :highlight="highlighter" line-numbers></prism-editor>
</v-card>
</v-dialog>
<v-dialog v-model="dialogRenameFile.show" max-width="400">
<v-card>
<v-card-title class="headline">Rename File</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogRenameFile.newName"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogRenameFile.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="renameFileAction">rename</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFile.show" max-width="400">
<v-card>
<v-card-title class="headline">Create File</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogCreateFile.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFile.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="createFileAction">create</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogCreateFolder.show" max-width="400">
<v-card>
<v-card-title class="headline">Create Folder</v-card-title>
<v-card-text>
<v-text-field label="Name" required v-model="dialogCreateFolder.name"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="" text @click="dialogCreateFolder.show = false">Cancel</v-btn>
<v-btn color="primary" text @click="createFolderAction">create</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex'
import {findDirectory} from "@/plugins/helpers";
import { PrismEditor } from 'vue-prism-editor';
import 'vue-prism-editor/dist/prismeditor.min.css'; // import the styles somewhere
// import highlighting library (you can use any library you want just return html string)
import { highlight, languages } from 'prismjs/components/prism-core';
import 'prismjs/components/prism-editorconfig';
import 'prismjs/components/prism-ini';
import 'prismjs/themes/prism-okaidia.css';
import axios from "axios"; // import syntax highlighting styles
export default {
components: {
PrismEditor,
},
data: function() {
return {
sortBy: 'filename',
sortDesc: false,
selected: [],
headers: [
{ text: '', value: '', },
{ text: 'Name', value: 'filename', },
{ text: 'Filesize', value: 'size', align: 'right', },
{ text: 'Last modified', value: 'modified', align: 'right', },
],
options: {
},
currentPage: 1,
files: [],
currentPath: '',
loadingConfigRefresh: false,
editor: {
show: false,
showLoader: false,
readonly: false,
item: {
filename: "",
},
sourcecode: ''
},
contextMenu: {
shown: false,
isDirectory: false,
touchTimer: undefined,
x: 0,
y: 0,
item: {}
},
dialogRenameFile: {
show: false,
newName: "",
item: {}
},
dialogCreateFile: {
show: false,
name: "",
},
dialogCreateFolder: {
show: false,
name: "",
},
}
},
computed: {
...mapState({
config_examples: state => state.filetree.config_examples,
config: state => state.filetree.config,
filetree: state => state.filetree,
countPerPage: state => state.gui.settings.configfiles.countPerPage,
hostname: state => state.socket.hostname,
port: state => state.socket.port,
})
},
created() {
this.loadPath();
},
methods: {
highlighter(code) {
//return highlight(code, languages.editorconfig); //returns html
return highlight(code, languages.ini); //returns html
},
refreshFileList: function() {
window.console.log(this.currentPath.substring(1));
this.$store.commit('setLoading', { name: 'loadingConfigRefresh' });
if (this.currentPath === "") {
this.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory');
this.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
} else this.$socket.sendObj('get_directory', { path: this.currentPath.substring(1) }, 'getDirectory');
},
formatDate(date) {
let tmp2 = new Date(date);
return tmp2.toLocaleString().replace(',', '');
},
formatFilesize(fileSizeInBytes) {
let i = -1;
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
do {
fileSizeInBytes = fileSizeInBytes / 1024;
i++;
} while (fileSizeInBytes > 1024);
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
},
sortFiles(items, sortBy, sortDesc) {
sortBy = sortBy.length ? sortBy[0] : 'filename';
sortDesc = sortDesc[0];
if (items !== undefined) {
// Sort by index
items.sort(function(a, b) {
if (a[sortBy] === b[sortBy]) {
return 0;
}
if (a[sortBy] === null || a[sortBy] === undefined) {
return -1;
}
if (b[sortBy] === null || b[sortBy] === undefined) {
return 1;
}
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
}
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
return reducedA - reducedB;
}
return a[sortBy] - b[sortBy];
});
// Deal with descending order
if (sortDesc) items.reverse();
// Then make sure directories come first
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
}
return items;
},
loadPath: function() {
let dirArray = this.currentPath.substring(1).split("/");
this.files = findDirectory(this.filetree, dirArray);
if (dirArray.length === 1 && this.currentPath === "") {
this.files = this.files.filter(element => element.filename !== "gcodes");
}
},
clickRow: function(item) {
if (!item.isDirectory) {
this.editor.showLoader = true;
this.editor.sourcecode = "";
this.editor.item = item;
let url = 'http://'+this.hostname+':'+this.port+'/server/files'+this.currentPath+'/'+item.filename+'?time='+Date.now();
fetch(url, { cache: "no-cache" }).then(res => res.text()).then(file => {
this.editor.sourcecode = file;
this.editor.show = true;
this.editor.showLoader = false;
this.editor.readonly = false;
if (this.currentPath === '/config_examples') this.editor.readonly = true;
});
} else {
this.currentPath += "/"+item.filename;
this.currentPage = 1;
}
},
clickRowGoBack: function() {
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
},
saveFile: function() {
let file = new File([this.editor.sourcecode], this.editor.item.filename);
let formData = new FormData();
formData.append('file', file);
formData.append('root', 'config');
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
axios.post('http://' + this.hostname + ':' + this.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
this.$toast.success("File '"+this.editor.item.filename+"' successfully saved.");
this.editor.show = false;
this.editor.sourcecode = "";
}).catch(() => {
this.$toast.error("Error save "+this.editor.item.filename);
});
},
showContextMenu (e, item) {
e.preventDefault();
this.contextMenu.shown = true;
this.contextMenu.x = e.clientX;
this.contextMenu.y = e.clientY;
this.contextMenu.item = item;
this.$nextTick(() => {
this.contextMenu.shown = true
});
},
downloadFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
let link = document.createElement("a");
link.download = name;
link.href = 'http://' + this.hostname + ':' + this.port + '/server/files/' + filename;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},
createFolder() {
this.dialogCreateFolder.name = "";
this.dialogCreateFolder.show = true;
},
createFolderAction() {
this.dialogCreateFolder.show = false;
this.$socket.sendObj('post_directory', {
path: this.currentPath.substring(1)+"/"+this.dialogCreateFolder.name
}, 'getPostDirectory');
},
createFile() {
this.dialogCreateFile.name = "";
this.dialogCreateFile.show = true;
},
createFileAction() {
let file = new File([""], this.dialogCreateFile.name);
let formData = new FormData();
formData.append('file', file);
formData.append('root', 'config');
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
axios.post('http://' + this.hostname + ':' + this.port + '/server/files/upload',
formData, {
headers: { 'Content-Type': 'multipart/form-data' }
}
).then(() => {
this.dialogCreateFile.show = false;
this.dialogCreateFile.name = "";
}).catch(() => {
window.console.error("Error save "+this.editor.item.filename);
});
},
renameFile(item) {
this.dialogRenameFile.item = item;
this.dialogRenameFile.newName = item.filename;
this.dialogRenameFile.show = true;
},
renameFileAction() {
this.dialogRenameFile.show = false;
this.$socket.sendObj('post_file_move', {
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
dest: this.currentPath+"/"+this.dialogRenameFile.newName
}, 'getPostFileMove');
},
removeFile() {
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
axios.delete(
'http://'+ this.hostname + ':' + this.port +'/server/files/'+filename
).then((result) => {
this.$toast.success(result.data.result+" successfully deleted.");
}).catch(() => {
this.$toast.error("Error! Cannot delete file.");
});
},
deleteDirectoryAction: function() {
this.$socket.sendObj('delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'getDeleteDirectory');
},
},
watch: {
config: {
deep: true,
handler() {
this.loadPath();
}
},
config_examples: {
deep: true,
handler() {
this.loadPath();
}
},
currentPath: {
handler() {
this.loadPath();
}
},
}
}
</script>
@@ -10,7 +10,7 @@
<v-card-text class="px-0 pt-0 pb-2 content">
<v-row class="px-6" >
<v-col sm-12>
<toolSlider label="VELOCITY" v-bind:target="max_velocity" :max="500" :extender-steps="100" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" class="mt-5" ></toolSlider>
<toolSlider label="VELOCITY" v-bind:target="max_velocity" :max="200" :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>
+2
View File
@@ -6,6 +6,7 @@ import DashboardPanel from "./DashboardPanel";
import MacrosPanel from "./MacrosPanel";
import EndstopPanel from "./EndstopPanel";
import LimitsPanel from "./LimitsPanel";
import ConfigFilesPanel from "./ConfigFilesPanel";
import RunoutPanel from "./RunoutPanel";
import SystemPanel from "./SystemPanel";
@@ -17,6 +18,7 @@ Vue.component('settings-endstop-panel', EndstopPanel);
Vue.component('settings-limits-panel', LimitsPanel);
Vue.component('settings-runout-panel', RunoutPanel);
Vue.component('settings-system-panel', SystemPanel);
Vue.component('settings-config-files-panel', ConfigFilesPanel);
export default {
+15 -16
View File
@@ -10,11 +10,11 @@
<v-list-item-avatar color="grey"><v-icon dark>mdi-information-variant</v-icon></v-list-item-avatar>
<v-list-item-content>
<v-list-item-title class="headline">Status</v-list-item-title>
<v-list-item-subtitle class="mr-3">{{ printer_is_paused ? "Pause" : printer_state }}{{ printer_is_printing || printer_is_paused ? " - "+current_file : "" }}</v-list-item-subtitle>
<v-list-item-subtitle class="mr-3">{{ printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown" }}{{ ['printing', 'paused', 'complete'].includes(printer_state) ? " - "+current_file : "" }}</v-list-item-subtitle>
</v-list-item-content>
<v-btn class="orange" v-if="printer_state === 'Printing' && printer_is_printing && !printer_is_paused" @click="btnPauseJob" :loading="btnStatusPause">pause job</v-btn>
<v-btn class="red" v-if="(is_printing && printer_is_paused)" :loading="btnStatusCancel" @click="btnCancelJob">cancel job</v-btn>
<v-btn class="orange ml-2" v-if="(is_printing && printer_is_paused)" :loading="btnStatusResume" @click="btnResumeJob">resume job</v-btn>
<v-btn class="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="btnStatusPause">pause job</v-btn>
<v-btn class="red" v-if="(printer_state === 'paused')" :loading="btnStatusCancel" @click="btnCancelJob">cancel job</v-btn>
<v-btn class="orange ml-2" v-if="(printer_state === 'paused')" :loading="btnStatusResume" @click="btnResumeJob">resume job</v-btn>
</v-list-item>
<v-divider class="my-2" ></v-divider>
<v-card-text class="px-0 pt-0 pb-2 content">
@@ -48,8 +48,8 @@
</v-layout>
</v-flex>
</v-layout>
<v-divider class="my-2" v-if="is_printing"></v-divider>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-divider class="my-2" v-if="['printing', 'paused', 'compleded'].includes(printer_state)"></v-divider>
<v-layout wrap class=" text-center" v-if="['printing', 'paused', 'compleded'].includes(printer_state)">
<v-flex col tag="strong" class="category-header">
Printstatus
</v-flex>
@@ -72,8 +72,8 @@
</v-layout>
</v-flex>
</v-layout>
<v-divider class="my-2" v-if="is_printing"></v-divider>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-divider class="my-2" v-if="['printing', 'paused'].includes(printer_state)"></v-divider>
<v-layout wrap class=" text-center" v-if="['printing', 'paused'].includes(printer_state)">
<v-flex col tag="strong" class="category-header py-0">
Estimations<br />based on
</v-flex>
@@ -96,7 +96,7 @@
</v-layout>
</v-flex>
</v-layout>
<v-layout wrap class=" text-center" v-if="is_printing">
<v-layout wrap class=" text-center" v-if="['printing', 'paused'].includes(printer_state)">
<v-layout column class="mt-2" >
<v-progress-linear
:value="printProgress * 100"
@@ -127,14 +127,13 @@
estimated_print_time: state => state.printer.toolhead.estimated_print_time,
printProgress: state => state.printer.virtual_sdcard.progress,
print_time: state => state.printer.virtual_sdcard.print_duration,
print_time_total: state => state.printer.virtual_sdcard.total_duration,
filament_used: state => state.printer.virtual_sdcard.filament_used,
file_position: state => state.printer.virtual_sdcard.file_position,
current_file: state => state.printer.virtual_sdcard.filename,
printer_state: state => state.printer.idle_timeout.state,
printer_is_paused: state => state.printer.pause_resume.is_paused,
printer_is_printing: state => state.printer.virtual_sdcard.is_active,
print_time: state => state.printer.print_stats.print_duration,
print_time_total: state => state.printer.print_stats.total_duration,
filament_used: state => state.printer.print_stats.filament_used,
current_file: state => state.printer.print_stats.filename,
printer_state: state => state.printer.print_stats.state,
display_message: state => state.printer.display_status.message,
}),
+2 -4
View File
@@ -3,7 +3,7 @@
</style>
<template>
<v-card v-if="(printer_state === 'Printing' && printer_is_printing)">
<v-card v-if="(['printing', 'paused'].includes(printer_state))">
<v-toolbar flat dense >
<v-toolbar-title>
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>Z Baby Stepping</span>
@@ -52,9 +52,7 @@
...mapState({
loadings: state => state.loadings,
base_zpos: state => state.printer.gcode.base_zpos,
printer_state: state => state.printer.idle_timeout.state,
printer_is_paused: state => state.printer.pause_resume.is_paused,
printer_is_printing: state => state.printer.virtual_sdcard.is_active,
printer_state: state => state.printer.print_stats.state,
homed_axis: state => state.printer.toolhead.homed_axes,
}),
},
+2 -1
View File
@@ -42,7 +42,8 @@
},
methods: {
changeSensor() {
this.$socket.sendObj('post_printer_gcode_script', { script: 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 0 : 1) });
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.enabled ? 1 : 0);
this.$socket.sendObj('post_printer_gcode_script', { script: gcode });
}
},
watch: {
+25 -19
View File
@@ -5,7 +5,7 @@
<template>
<v-row>
<v-col class="col-auto"><v-icon @click="decrement">mdi-minus</v-icon></v-col>
<v-col class="col"><v-slider v-model="value" thumb-label="always" :label="label" :min="min" :max="max" @change="sendCmd" hide-details></v-slider></v-col>
<v-col class="col"><v-slider v-model="value" thumb-label="always" :label="label" :min="min" :max="variableMax" @change="sendCmd" hide-details></v-slider></v-col>
<v-col class="col-auto"><v-icon @click="increment">mdi-plus</v-icon></v-col>
</v-row>
</template>
@@ -16,7 +16,7 @@
data: function() {
return {
value: this.target * this.multi,
variableMax: 0,
variableMax: this.max,
}
},
props: {
@@ -79,28 +79,34 @@
this.value++;
this.sendCmd();
},
checkExpand() {
if (this.value > 0) {
if (this.value > this.variableMax) {
let tmpMulti = Math.ceil((this.value - this.variableMax) / this.extenderSteps);
this.variableMax += tmpMulti * this.extenderSteps;
} else if (this.value > (this.variableMax - this.extenderSteps)) {
this.variableMax += this.extenderSteps;
}
}
}
},
watch: {
target: function() {
this.value = this.target * this.multi;
},
/*value: function() {
if (this.value > 0) {
if (this.value > (this.variableMax - this.extenderSteps) && this.value < (this.variableMax + this.extenderSteps)) this.variableMax += this.extenderSteps;
else if (this.value > (this.variableMax - this.extenderSteps)) {
this.variableMax = (this.value / this.extenderSteps).toFixed(0) * this.extenderSteps;
if (this.variableMax < this.max) this.variableMax = this.max;
}
}
}*/
value: function() {
setTimeout(() => {
this.checkExpand();
}, 1000);
}
},
/*created: function() {
/!*window.console.log("Test");
window.console.log(this.target+' * '+this.multi);
this.value = this.target * this.multi;*!/
window.console.log(this.target+' * '+this.multi);
this.variableMax = (this.value / this.extenderSteps + 1).toFixed(0) * this.extenderSteps;
if (this.variableMax < this.max) this.variableMax = this.max;
}*/
created: function() {
if (this.value > this.variableMax) {
let tmpMulti = Math.ceil((this.value - this.variableMax) / this.extenderSteps);
this.variableMax += tmpMulti * this.extenderSteps;
if (this.variableMax === this.value) this.variableMax += this.extenderSteps;
}
}
}
</script>
+99 -99
View File
@@ -45,108 +45,108 @@
<template>
<div>
<v-card class="fileupload-card" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
<v-card-title>
G-Code Files
<v-spacer></v-spacer>
<v-btn :loading="loadingMakeDirectory" @click="createDirectory"><v-icon class="mr-1">mdi-folder-plus</v-icon> new Directory</v-btn>
<v-btn color="primary ml-4" :loading="loadingGcodeRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
<v-btn color="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
</v-card-title>
<v-card-subtitle>
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}
</v-card-subtitle>
<v-card-text>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="Search"
single-line
hide-details
></v-text-field>
</v-card-text>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page="countPerPage"
item-key="name"
:search="search"
:custom-filter="advancedSearch"
@pagination="refreshMetadata">
<v-card class="fileupload-card" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
<v-card-title>
G-Code Files
<v-spacer></v-spacer>
<v-btn :loading="loadingMakeDirectory" @click="createDirectory"><v-icon class="mr-1">mdi-folder-plus</v-icon> new Directory</v-btn>
<v-btn color="primary ml-4" :loading="loadingGcodeRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
<v-btn color="primary ml-4 " :loading="loadingGcodeUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
</v-card-title>
<v-card-subtitle>
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}
</v-card-subtitle>
<v-card-text>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="Search"
single-line
hide-details
></v-text-field>
</v-card-text>
<v-data-table
:items="files"
class="files-table"
:headers="headers"
:options="options"
:custom-sort="sortFiles"
:sort-by.sync="sortBy"
:sort-desc.sync="sortDesc"
:items-per-page="countPerPage"
item-key="name"
:search="search"
:custom-filter="advancedSearch"
@pagination="refreshMetadata">
<template #no-data>
<div class="text-center">empty</div>
</template>
<template #no-data>
<div class="text-center">empty</div>
</template>
<template v-slot:body.prepend>
<tr
v-if="(currentPath !== 'gcodes')"
class="file-list-cursor"
@click="clickRowGoBack"
@dragover="dragOverFilelist($event, {isDirectory: true, filename: '..'})" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, {isDirectory: true, filename: '..'})"
>
<td class=" ">
<v-icon>mdi-folder-upload</v-icon>
</td>
<td class=" " colspan="8">
..
</td>
</tr>
</template>
<template v-slot:body.prepend>
<tr
v-if="(currentPath !== 'gcodes')"
class="file-list-cursor"
@click="clickRowGoBack"
@dragover="dragOverFilelist($event, {isDirectory: true, filename: '..'})" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, {isDirectory: true, filename: '..'})"
>
<td class=" ">
<v-icon>mdi-folder-upload</v-icon>
</td>
<td class=" " colspan="8">
..
</td>
</tr>
</template>
<template #item="{ item }">
<tr
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
draggable="true"
@drag="dragFile($event, item)"
@dragend="dragendFile($event)"
@dragover="dragOverFilelist($event, item)" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, item)"
:data-name="item.filename"
>
<td class=" ">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory && !(item.thumbnails && item.thumbnails.length > 0)">mdi-file</v-icon>
<img v-if="!item.isDirectory && item.thumbnails && item.thumbnails.length > 0" :src="'data:image/gif;base64,'+(item.thumbnails.length ? item.thumbnails[0].data : '--')" />
</td>
<td class=" ">
{{ item.filename }}
</td>
<td class="text-no-wrap text-right">
{{ item.isDirectory ? '--' : formatFilesize(item.size) }}
</td>
<td class="text-right">
{{ formatDate(item.modified) }}
</td>
<td class="text-no-wrap text-right">
{{ item.object_height ? item.object_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.layer_height ? item.layer_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.filament_total ? item.filament_total.toFixed()+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ formatPrintTime(item.estimated_time) }}
</td>
<td class="text-no-wrap text-right">
{{ item.slicer ? item.slicer : '--' }}
</td>
</tr>
</template>
</v-data-table>
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
<div class="textnode">Drop files to add gcode.</div>
</div>
</v-card>
<template #item="{ item }">
<tr
@contextmenu="showContextMenu($event, item)"
@click="clickRow(item)"
class="file-list-cursor"
draggable="true"
@drag="dragFile($event, item)"
@dragend="dragendFile($event)"
@dragover="dragOverFilelist($event, item)" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, item)"
:data-name="item.filename"
>
<td class=" ">
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
<v-icon v-if="!item.isDirectory && !(item.thumbnails && item.thumbnails.length > 0)">mdi-file</v-icon>
<img v-if="!item.isDirectory && item.thumbnails && item.thumbnails.length > 0" :src="'data:image/gif;base64,'+(item.thumbnails.length ? item.thumbnails[0].data : '--')" />
</td>
<td class=" ">
{{ item.filename }}
</td>
<td class="text-no-wrap text-right">
{{ item.isDirectory ? '--' : formatFilesize(item.size) }}
</td>
<td class="text-right">
{{ formatDate(item.modified) }}
</td>
<td class="text-no-wrap text-right">
{{ item.object_height ? item.object_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.layer_height ? item.layer_height.toFixed(2)+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ item.filament_total ? item.filament_total.toFixed()+' mm' : '--' }}
</td>
<td class="text-no-wrap text-right">
{{ formatPrintTime(item.estimated_time) }}
</td>
<td class="text-no-wrap text-right">
{{ item.slicer ? item.slicer : '--' }}
</td>
</tr>
</template>
</v-data-table>
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
<div class="textnode">Drop files to add gcode.</div>
</div>
</v-card>
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
<v-list>
<v-list-item @click="downloadFile" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
+19 -8
View File
@@ -1,17 +1,28 @@
<template>
<div>
<v-row>
<v-col class="col-sm-12 col-md-6" v-if="is_ready">
<settings-limits-panel></settings-limits-panel>
<v-col class="col-sm-12 col-md-6">
<settings-config-files-panel></settings-config-files-panel>
</v-col>
<v-col class="col-sm-12 col-md-3" v-if="is_ready">
<settings-endstop-panel></settings-endstop-panel>
<settings-runout-panel></settings-runout-panel>
</v-col>
<v-col class="col-sm-12 col-md-3">
<settings-system-panel></settings-system-panel>
<v-col class="col-sm-12 col-md-6">
<v-row>
<v-col class="col-sm-12 pt-0" v-if="is_ready">
<settings-limits-panel></settings-limits-panel>
</v-col>
</v-row>
<v-row>
<v-col class="col-sm-12 col-md-6" v-if="is_ready">
<settings-endstop-panel></settings-endstop-panel>
<settings-runout-panel></settings-runout-panel>
</v-col>
<v-col class="col-sm-12 col-md-6">
<settings-system-panel></settings-system-panel>
</v-col>
</v-row>
</v-col>
</v-row>
<v-row>
</v-row>
</div>
</template>
<script>
+12 -9
View File
@@ -39,23 +39,23 @@ export default {
case 'notify_filelist_changed':
switch(data.params[0].action) {
case 'added':
commit('setFileChangeAdded', data.params[0]);
case 'upload_file':
commit('setFileChangeUploadFile', data.params[0]);
break;
case 'removed':
commit('setFileChangeRemoved', data.params[0]);
case 'delete_file':
commit('setFileChangeDeleteFile', data.params[0]);
break;
case 'file_move':
commit('setFileChangeFileMove', data.params[0]);
case 'move_item':
commit('setFileChangeMoveItem', data.params[0]);
break;
case 'add_directory':
commit('setFileChangeAddDirectory', data.params[0]);
case 'create_dir':
commit('setFileChangeCreateDirectory', data.params[0]);
break;
case 'delete_directory':
case 'delete_dir':
commit('setFileChangeDeleteDirectory', data.params[0]);
break;
@@ -114,6 +114,7 @@ export default {
gcode: [],
toolhead: [],
virtual_sdcard: [],
print_stats: [],
heaters: [],
fan: [],
pause_resume: [],
@@ -121,6 +122,8 @@ export default {
display_status: [],
});
Vue.prototype.$socket.sendObj('get_directory', { path: 'gcodes' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_directory', { path: 'config' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_directory', { path: 'config_examples' }, 'getDirectory');
Vue.prototype.$socket.sendObj('get_printer_gcode_help', {}, 'getHelpList');
}
+3 -3
View File
@@ -102,7 +102,7 @@ export default {
},
current_file_size: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.size;
}
@@ -114,7 +114,7 @@ export default {
},
current_file_estimated_time: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.estimated_time;
}
@@ -122,7 +122,7 @@ export default {
},
current_file_filament_total: state => {
if (state.printer.virtual_sdcard.filename === state.printer.current_file.filename) {
if (state.printer.print_stats.filename === state.printer.current_file.filename) {
return state.printer.current_file.filament_total;
}
+23 -3
View File
@@ -51,6 +51,11 @@ export default new Vuex.Store({
},
gcodefiles: {
countPerPage: 10,
},
settings: {
configfiles: {
countPerPage: 10,
}
}
},
loadings: [],
@@ -86,12 +91,16 @@ export default new Vuex.Store({
},
virtual_sdcard: {
progress: 0,
filename: "",
is_active: false,
filament_used: 0,
file_position: 0,
},
print_stats: {
print_duration: 0,
filament_used: 0,
total_duration: 0,
filename: "",
state: "",
message: ""
},
current_file: {
@@ -116,7 +125,6 @@ export default new Vuex.Store({
temperaturChart: {
labels: [],
datasets: [],
updateTicks: []
},
helplist: [],
filetree: [
@@ -125,6 +133,18 @@ export default new Vuex.Store({
filename: 'gcodes',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config_examples',
modified: new Date(),
childrens: []
},
{
isDirectory: true,
filename: 'config',
modified: new Date(),
childrens: []
}
],
events: []
+41 -60
View File
@@ -40,7 +40,6 @@ export default {
setPrinterData(state, data) {
if (data.requestParams) delete data.requestParams;
let now = Date.now();
let updateTicks = false;
Object.entries(data).forEach(([key, value]) => {
Vue.set(state.printer, key, value);
@@ -57,20 +56,6 @@ export default {
else if (keySplit[0] === "temperature_sensor") key = keySplit[1];
else if (keySplit[0] === "temperature_probe") key = "probe";
// increment update ticks array only 1 time per setPrinterData with heaters/sensors
if (!updateTicks) {
for (let index in state.temperaturChart.updateTicks) {
state.temperaturChart.updateTicks[index] += 1;
}
updateTicks = true;
}
// add object to update ticks array if it doesn't exists
if (state.temperaturChart.updateTicks[key] === undefined) {
state.temperaturChart.updateTicks[key] = 1;
}
this.commit('addTemperatureChartValue', { name: key, value: value, time: now });
}
}
@@ -125,23 +110,11 @@ export default {
}
let index_target = state.temperaturChart.datasets.findIndex(element => element.label === payload.name+'_target');
let ticks = 1;
// find missing ticks in update ticks array and reset it
if (state.temperaturChart.updateTicks[payload.name] !== undefined) {
ticks = state.temperaturChart.updateTicks[payload.name];
state.temperaturChart.updateTicks[payload.name] = 0;
}
// update current temp in temperature chart
if (index >= 0) {
for (let i = 0; i < ticks; i++) state.temperaturChart.datasets[index].data.push(payload.value.temperature.toFixed(1));
}
if (index >= 0) state.temperaturChart.datasets[index].data.push(payload.value.temperature.toFixed(1));
// update target temp in temperature chart
if (index_target >= 0 && payload.value.target !== undefined) {
for (let i = 0; i < ticks; i++) state.temperaturChart.datasets[index_target].data.push(payload.value.target.toFixed(1));
}
if (index_target >= 0 && payload.value.target !== undefined) 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)
@@ -215,61 +188,67 @@ export default {
if (data.configfile) Vue.set(state, 'config', data.configfile.config);
},
setFileChangeAdded(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/")).replace("/", "");
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
setFileChangeUploadFile(state, data) {
let filename = data.item.path;
if (data.item.path.lastIndexOf("/") >= 0) filename = data.item.path.substr(data.item.path.lastIndexOf("/")).replace("/", "");
let path = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.item.root+"/"+path).split("/"));
if (parent) {
parent.push({
isDirectory: false,
filename: filename,
modified: new Date(),
size: 0,
metadataPulled: false,
});
if (parent.findIndex(element => (!element.isDirectory && element.filename === filename)) < 0) {
let modified = new Date(data.item.modified);
parent.push({
isDirectory: false,
filename: filename,
modified: modified,
size: data.item.size,
metadataPulled: false,
});
}
setTimeout(function() {
Vue.prototype.$socket.sendObj("get_file_metadata", { filename: data.filename }, "getMetadata");
}, 500);
}, 1000);
}
},
setFileChangeRemoved(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
setFileChangeDeleteFile(state, data) {
let currentPath = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let delPath = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.item.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
},
setFileChangeFileMove(state, data) {
let oldPath = data.prev_file.substr(0, data.prev_file.lastIndexOf("/") + 1);
let newPath = data.filename.substr(0, data.filename.lastIndexOf("/") + 1);
let filenameOld = data.prev_file.substr(data.prev_file.lastIndexOf("/")+1);
let filenameNew = data.filename.substr(data.filename.lastIndexOf("/")+1);
setFileChangeMoveItem(state, data) {
let filenameOld = data.source_item.path.substr(data.source_item.path.lastIndexOf("/")+1);
let oldPath = data.source_item.path.substr(0, data.source_item.path.lastIndexOf("/") + 1);
oldPath = findDirectory(state.filetree, (data.root+"/"+oldPath).split("/"));
let filenameNew = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
let newPath = data.item.path.substr(0, data.item.path.lastIndexOf("/") + 1);
oldPath = findDirectory(state.filetree, (data.source_item.root+"/"+oldPath).split("/"));
let indexFile = oldPath.findIndex(element => element.filename === filenameOld);
if (indexFile >= 0 && oldPath[indexFile]) {
let file = oldPath.splice(indexFile, 1)[0];
file.filename = filenameNew;
newPath = findDirectory(state.filetree, (data.root+"/"+newPath).split("/"));
newPath = findDirectory(state.filetree, (data.item.root+"/"+newPath).split("/"));
newPath.push(file);
}
},
setFileChangeAddDirectory(state, data) {
let filename = data.filename.substr(data.filename.lastIndexOf("/") + 1);
let path = data.filename.substr(0, data.filename.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.root+"/"+path).split("/"));
setFileChangeCreateDirectory(state, data) {
let dirname = data.item.path.substr(data.item.path.lastIndexOf("/") + 1);
let path = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let parent = findDirectory(state.filetree, (data.item.root+"/"+path).split("/"));
if (parent) {
parent.push({
isDirectory: true,
filename: filename,
filename: dirname,
modified: new Date(),
childrens: [],
});
@@ -277,9 +256,9 @@ export default {
},
setFileChangeDeleteDirectory(state, data) {
let currentPath = data.filename.substr(0, data.filename.lastIndexOf("/"));
let delPath = data.filename.substr(data.filename.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.root+"/"+currentPath).split("/"));
let currentPath = data.item.path.substr(0, data.item.path.lastIndexOf("/"));
let delPath = data.item.path.substr(data.item.path.lastIndexOf("/")+1);
currentPath = findDirectory(state.filetree, (data.item.root+"/"+currentPath).split("/"));
let index = currentPath.findIndex(element => element.filename === delPath);
if (index >= 0 && currentPath[index]) currentPath.splice(index, 1);
@@ -317,6 +296,8 @@ export default {
modified: Date.parse(dir.modified),
childrens: [],
});
Vue.prototype.$socket.sendObj('get_directory', { path: data.requestParams.path+'/'+dir.dirname }, 'getDirectoryRoot');
}
}
}
+1 -1
View File
@@ -14,4 +14,4 @@ export const colorArray = [
export const colorHeaterBed = '#2196F3';
export const colorChamber = '#4CAF50';
export const temperaturChartSampleLength = 600;
export const temperaturChartSampleLength = 1200;