Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bfb20766a | ||
|
|
616c7aa7f4 | ||
|
|
d6cd1c81fb | ||
|
|
74f104f1a4 | ||
|
|
9ccc3f69a3 | ||
|
|
0d2f9bd8d8 | ||
|
|
28aa03a55f | ||
|
|
d891ec0800 | ||
|
|
767a9403fd | ||
|
|
6fb8d16143 | ||
|
|
0cffe5f235 | ||
|
|
f634872297 | ||
|
|
91014a7349 | ||
|
|
850eecd600 | ||
|
|
fff66f0c3b | ||
|
|
3749b76162 | ||
|
|
88ac7a5cae | ||
|
|
eb123ffc01 | ||
|
|
411087434c | ||
|
|
8db37259e1 | ||
|
|
3a03d93fef | ||
|
|
42071ae422 | ||
|
|
aeb6ae1ec9 | ||
|
|
837f6641d0 | ||
|
|
7a139d68c5 | ||
|
|
24bfb8bc58 | ||
|
|
390bb40c69 | ||
|
|
84470463fe | ||
|
|
f9c989793c | ||
|
|
b0044f3d2b | ||
|
|
e2e496c31e | ||
|
|
8363932ae9 | ||
|
|
f958027671 | ||
|
|
4b678468ab | ||
|
|
9090c60038 | ||
|
|
35955d4899 | ||
|
|
4a58f0c3e2 | ||
|
|
4003166000 | ||
|
|
9888d796bd | ||
|
|
8a8587786a | ||
|
|
64c6790d3a | ||
|
|
28998090e6 | ||
|
|
87e1ccb384 | ||
|
|
e5469b47ca | ||
|
|
a72af00c0a | ||
|
|
576f3ee4fa | ||
|
|
2ee53b26bb | ||
|
|
414a05bf7b | ||
|
|
bb83dcda11 | ||
|
|
4f34b63fc0 | ||
|
|
ae058ca2d0 | ||
|
|
53e394eddd | ||
|
|
25221ca6cb | ||
|
|
e7999d5577 | ||
|
|
9545fc76bb | ||
|
|
3e0607fc9b | ||
|
|
f6eb37928b | ||
|
|
e16694eae8 | ||
|
|
d786d88348 | ||
|
|
bce06f0e1b | ||
|
|
294f48124f | ||
|
|
cc77c47d54 | ||
|
|
6a0f19926e | ||
|
|
45198d7d93 | ||
|
|
54c78e2735 | ||
|
|
659504f77e | ||
|
|
e81ba35909 | ||
|
|
feb9579ae1 | ||
|
|
35013e755c | ||
|
|
4b5f03b886 | ||
|
|
7dc16da940 | ||
|
|
08bd7440a9 | ||
|
|
2e0ba91e50 | ||
|
|
ca79e3b63e | ||
|
|
9429e11645 | ||
|
|
7b90c32b96 | ||
|
|
f2809d304c | ||
|
|
1d86c22126 | ||
|
|
d767f50bbb | ||
|
|
a6c4dd75f1 | ||
|
|
bd44c5608a | ||
|
|
97012256f6 | ||
|
|
5ee8e69d81 | ||
|
|
d05fa70832 | ||
|
|
edf1507359 | ||
|
|
bb831cd22f | ||
|
|
423d2eaa88 | ||
|
|
92679b001a | ||
|
|
21c01b0de7 | ||
|
|
0ae1b32a56 | ||
|
|
7cda0f7058 | ||
|
|
fe246393ea | ||
|
|
a512743038 | ||
|
|
645084700d | ||
|
|
b784b3f277 | ||
|
|
c5999221bc | ||
|
|
d1cb7f2def | ||
|
|
6927ce6038 | ||
|
|
4579129a4f | ||
|
|
5fd89c2600 | ||
|
|
354f6e9250 | ||
|
|
9e6e8c1290 | ||
|
|
7164dd7c3c | ||
|
|
b38b052004 | ||
|
|
ff366ee966 | ||
|
|
dc1a7dfe03 | ||
|
|
d2d5d3da0c | ||
|
|
03322739d5 | ||
|
|
31b4d4cb3d | ||
|
|
d2d8546bc9 | ||
|
|
93c952cabb | ||
|
|
02f9f9a1d4 | ||
|
|
e3607c8f3d | ||
|
|
2b08e34ba7 | ||
|
|
747722ec2c | ||
|
|
0befcea658 | ||
|
|
ff3cf167ad | ||
|
|
c8cff6d3d8 | ||
|
|
397d9b8a7c | ||
|
|
84f2b6a473 | ||
|
|
b6d20f20ee | ||
|
|
13859d3832 | ||
|
|
b88ebf38c7 | ||
|
|
5831e43fba | ||
|
|
21669f11f7 | ||
|
|
7b20b47d21 | ||
|
|
8d15e59e35 | ||
|
|
8ee93d1c4a | ||
|
|
0b23e512e6 | ||
|
|
7ff060edff | ||
|
|
0bfc856606 | ||
|
|
3c78c5af58 | ||
|
|
efbbbb0142 | ||
|
|
d57f68b511 | ||
|
|
64f473e0c6 | ||
|
|
a2863f2141 | ||
|
|
ef3b179339 | ||
|
|
2bceb2b24f | ||
|
|
aaf934eaae | ||
|
|
e44e3bc540 | ||
|
|
6856c9a99f | ||
|
|
d74e38d0ba | ||
|
|
4ec5ab0f53 | ||
|
|
8226c32bb3 | ||
|
|
99f963df26 | ||
|
|
07072ce2a1 | ||
|
|
983c5c9bda | ||
|
|
a8ea45d53c | ||
|
|
595e5bb4a0 | ||
|
|
2e7290210f | ||
|
|
9152934f9d | ||
|
|
02eab15fe5 | ||
|
|
8d12bac8c8 |
No files matched your search
@@ -6,6 +6,8 @@ Mainsail is a lightweight & responsive web interface for the [Klipper](https://g
|
||||
|
||||
To begin using Mainsail start by [installing](https://meteyou.github.io/mainsail/setup/) it or read the [pages](https://meteyou.github.io/mainsail/) for more informations.
|
||||
|
||||
For support join our discord server -> [https://discord.gg/skWTwTD](https://discord.gg/skWTwTD)
|
||||
|
||||
## Credit, sources and inspiration
|
||||
* [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
|
||||
* [Eric Callahan (arksine)](https://github.com/Arksine) for [Moonraker (Klipper API)](https://github.com/Arksine/moonraker). Without Moonraker, Mainsail would not be possible.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
docs.mainsail.xyz
|
||||
@@ -1,6 +1,15 @@
|
||||
title: "Mainsail"
|
||||
tagline: A web interface for Klipper
|
||||
description: Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
|
||||
logo: "/assets/img/logo-mainsail.png"
|
||||
description: A web interface for Klipper
|
||||
theme: just-the-docs
|
||||
remote_theme: pmarsceill/just-the-docs
|
||||
color_scheme: "mainsail"
|
||||
search_enabled: true
|
||||
|
||||
defaults:
|
||||
-
|
||||
scope:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
image: assets/img/rtfm.png
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Support
|
||||
nav_order: 5
|
||||
has_children: true
|
||||
permalink: /additional
|
||||
---
|
||||
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 180 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 647 KiB |
@@ -0,0 +1,16 @@
|
||||
---
|
||||
layout: default
|
||||
title: Custom CSS
|
||||
parent: Customizing
|
||||
nav_order: 99
|
||||
permalink: /customizing/custom-css
|
||||
---
|
||||
|
||||
## Custom-CSS
|
||||
|
||||
The custom.css file allows you to customize the appearance of Mainsail
|
||||
without the need of rebuilding it. All you need to do is to place a file
|
||||
named "custom.css" into the configuration directory ".theme" and define
|
||||
your css rules in there.
|
||||
|
||||

|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
layout: default
|
||||
title: Favicons
|
||||
parent: Customizing
|
||||
nav_order: 3
|
||||
permalink: /customizing/favicons
|
||||
---
|
||||
|
||||
## Custom favicon
|
||||
Upload the images with the name "favicon-16x16.png" and "favicon-32x32.png"
|
||||
to the .theme folder. Allowed extension is only .png. The "favicon-32x32.png"
|
||||
is required. The "favicon-16x16.png" is optional. Maybe a hard refresh is
|
||||
necessary (CTRL+SHIFT+F5 on windows or CMD+SHIFT+R on mac).
|
||||
|
||||

|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
layout: default
|
||||
title: Customizing
|
||||
nav_order: 6
|
||||
has_children: true
|
||||
permalink: /customizing
|
||||
---
|
||||
|
||||
# Customizing
|
||||
|
||||
Feel free to customize Mainsail to your preferences. At the moment there
|
||||
are not many possibilities, but i will expand them continuously. If some features
|
||||
are not yet listed below, please create a FR (feature request) on Github.
|
||||
|
||||
### currently supported functions
|
||||
- [change sidebar logo](sidebar.md)
|
||||
- [change sidebar background](sidebar.md)
|
||||
- [change favicon](favicon.md)
|
||||
- [upload custom.css](custom-css.md)
|
||||
|
||||
### cooming soon
|
||||
- change primary color (all blue buttons atm)
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
layout: default
|
||||
title: Prepare
|
||||
parent: Customizing
|
||||
nav_order: 1
|
||||
permalink: /customizing/prepare
|
||||
---
|
||||
|
||||
## Prepare theme
|
||||
|
||||
To prepare mainsail to use themes, you only have to create the ".theme" directory. Go into
|
||||
"Settings" > "Machine" and check if you have enabled "Hidden files". Then you can create a
|
||||
directory with the name ".theme". Important is the "." on the beginning. All further customizing
|
||||
files, will be placed in this directory.
|
||||
|
||||

|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
layout: default
|
||||
title: Sidebar
|
||||
parent: Customizing
|
||||
nav_order: 2
|
||||
permalink: /customizing/sidebar
|
||||
---
|
||||
|
||||
## Sidebar customizing
|
||||
|
||||
### Change sidebar logo
|
||||
Upload an image with the name "sidebar-logo" to the .theme folder.
|
||||
Allowed file extensions for the image are: .svg, .jpg, .png and .gif.
|
||||
|
||||

|
||||
|
||||
### Change sidebar background image
|
||||
Upload an image with the name "sidebar-background" to the .theme folder.
|
||||
Allowed file extensions for the image are: .jpg, .png and .gif. The
|
||||
recommended image size is 300x1000px.
|
||||
|
||||

|
||||
@@ -9,7 +9,15 @@ has_children: false
|
||||
|
||||
Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
|
||||
|
||||
[Setup Guide](/setup-guide/index.md){: .btn}
|
||||
[Setup Guide](/setup){: .btn}
|
||||
[Release Notes](https://github.com/meteyou/mainsail/releases){: .btn}{:target="_blank"}
|
||||
|
||||
For support join us on Discord, or open an issue on Github.
|
||||
|
||||
[Discord](https://discord.gg/skWTwTD){: .btn}{:target="_blank"}
|
||||
[Github](https://github.com/meteyou/mainsail){: .btn}{:target="_blank"}
|
||||
|
||||
|
||||
|
||||
## Screenshots
|
||||

|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Necessary Configuration
|
||||
nav_order: 4
|
||||
nav_order: 5
|
||||
has_children: false
|
||||
permalink: /necessary-configuration
|
||||
---
|
||||
@@ -13,7 +13,7 @@ Mainsail requires a minimum configuration to function properly. It should give y
|
||||
This allows gcode file uploads.
|
||||
```yaml
|
||||
[virtual_sdcard]
|
||||
path: ~/sdcard
|
||||
path: ~/gcode_files
|
||||
```
|
||||
|
||||
### display_status
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Sensors
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/additional-sensors
|
||||
description: >-
|
||||
Integrate additional sensors into the temperature graph. For example Raspberry Pi, MCU, BMExxx, HTU21D, LM75 and more..
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Raspberry Pi temperature sensor
|
||||
|
||||
Append the following section to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[temperature_sensor raspberry_pi]
|
||||
sensor_type: rpi_temperature
|
||||
min_temp: 10
|
||||
max_temp: 100
|
||||
```
|
||||
|
||||
## ATSAM, ATAMD, and STM32 temperature sensor
|
||||
|
||||
Append the following section to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[temperature_sensor mcu_temp]
|
||||
sensor_type: temperature_mcu
|
||||
min_temp: 0
|
||||
max_temp: 100
|
||||
```
|
||||
|
||||
For more information on this topic and how to add additional sensors, please refer to [Klipper documentation](https://www.klipper3d.org/Config_Reference.html#builtin-micro-controller-temperature-sensor){:target="_blank"}.
|
||||
{: .info}
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
layout: default
|
||||
title: Console Shortcuts
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/console-shortcuts
|
||||
description: >-
|
||||
Similar to a terminal of your OS, there are some keyboard shortcuts in Mainsail that make your everyday life easier.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Help command
|
||||
|
||||
Issue a `HELP` command to get a list of possible commands.
|
||||
|
||||
## Autocomplete
|
||||
|
||||
You can start typing a command and then complete it with the tab-key. If there are several possibilities, you will get a list of choices.
|
||||
|
||||

|
||||
|
||||
## Scroll through commands
|
||||
|
||||
Using the ↑ up / ↓ down arrow keys you can scroll through previous commands.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: default
|
||||
title: Disable Octoprint LCD menu
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/disable-octoprint-lcd-menu
|
||||
description: >-
|
||||
Klipper is shipped with an Octoprint entry in the LCD menu. These menu points don't work with Mainsail.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Modify printer.cfg
|
||||
Just add the following entry to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[menu __main __octoprint]
|
||||
type: disabled
|
||||
```
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
layout: default
|
||||
title: Hide macros, outputs or fans
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/hide-gcode_macros
|
||||
description: >-
|
||||
As you probably already noticed, you can show and hide the gcode macros in the interface settings, but there is more...
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
Did you know, that you can also hide gcode macros by prefixing the name with an underscore?
|
||||
|
||||
```yaml
|
||||
[gcode_macro MY_AWESOME_GCODE]
|
||||
gcode:
|
||||
_MY_HELPER_CODE
|
||||
```
|
||||
|
||||
```yaml
|
||||
[gcode_macro _MY_HELPER_CODE]
|
||||
gcode:
|
||||
M300
|
||||
```
|
||||
|
||||
`MY_AWESOME_GCODE` appears in your interface settings, `_MY_HELPER_CODE` not.
|
||||
|
||||

|
||||
|
||||
By the way, this also works for other configuration sections like, **fans and outputs.**
|
||||
{: .info}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: default
|
||||
title: Quicktips
|
||||
nav_order: 10
|
||||
has_children: true
|
||||
permalink: /quicktips
|
||||
description: quick tips, without much explanation
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
@@ -0,0 +1,31 @@
|
||||
---
|
||||
layout: default
|
||||
title: Presets
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/presets
|
||||
description: >-
|
||||
Mainsail supports so-called presets. They are often used for preheat & cooldown, but also execute normal gcode.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
In Mainsails interface settings you will find a section called "Preheat Presets". There you can set your presets via "ADD PRESET" and the following dialog.
|
||||
|
||||
### Preheat
|
||||
|
||||
Enter a name \(e.g. name, color and type of filament\) and the temperatures obtained. You can disable individual heaters and even specify a custom gcode for the preheat phase.
|
||||
|
||||

|
||||
|
||||
### Further Examples
|
||||
|
||||
#### Z-Offset
|
||||
|
||||
To quickly switch between different Z-offsets \(flexplates with smooth and textured surfaces\), you can create presets and deactivate the heaters.
|
||||
|
||||
As G-Code you simply enter `SET_GCODE_OFFSET Z=0.2`, of course with your determined offset.
|
||||
|
||||

|
||||
@@ -1,17 +1,19 @@
|
||||
---
|
||||
layout: default
|
||||
title: Slicer upload
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/slicer-upload
|
||||
title: Slicer Upload
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/slicer-upload
|
||||
description: >-
|
||||
It is possible to upload G-Code from your slicer and have it start printing.
|
||||
---
|
||||
|
||||
## Upload from Slicer
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
Moonraker has compatibility with Octoprint's legacy file upload API.
|
||||
|
||||
### PrusaSlicer/SuperSlicer (prior to v2.3.0)
|
||||
|
||||
You can upload your GCode-files from your Slicer. Moonraker simulates the octoprint-upload function.
|
||||
|
||||
If not already been done, switch to advanced or expert mode and set the options under "Printer Settings / General" as shown in the screenshot below.
|
||||
If not already been done, switch to advanced or expert mode and set the options under `Printer Settings / General` as shown in the screenshot below.
|
||||
For "API Key" you can type anything.
|
||||
|
||||

|
||||
@@ -1,20 +1,27 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/thumbnails
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/thumbnails
|
||||
description: >-
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
---
|
||||
|
||||
## Thumbnails
|
||||
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer (since v2.3.0)
|
||||
|
||||
In "Expert" mode PrusaSlicer has an option in the "Printer Settings" tab to activate previews.
|
||||
Under `General / Firmware`, enter `32x32,400x300` as "G-code thumbnails".
|
||||
|
||||

|
||||
|
||||
### SuperSlicer (since v2.2.54.0)
|
||||
|
||||
In "Expert" mode SuperSlicer has some very convenient options in the "printer settings" tab to activate and customize the previews.
|
||||
In "Expert" mode SuperSlicer has some very convenient options in the "Printer Settings" tab to activate and customize the previews.
|
||||
|
||||

|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
layout: default
|
||||
title: Update Manager
|
||||
parent: Quicktips
|
||||
has_children: false
|
||||
permalink: /quicktips/update-manager
|
||||
description: >-
|
||||
Perform updates of Mainsail, Klipper, Moonraker and your system from within Mainsail.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Moonraker.conf
|
||||
|
||||
Add the following section to your printers moonraker.conf:
|
||||
|
||||
```yaml
|
||||
[update_manager]
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
Once you have restarted the moonraker service, the Update Manager will appear in Mainsails machine settings.
|
||||
|
||||

|
||||
|
||||
|
||||
You can find further information on this topic by checking out the [Moonraker documentation](https://github.com/Arksine/moonraker/blob/master/docs/configuration.md#update_manager){:target="_blank"}.
|
||||
{: .info}
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Remote Mode
|
||||
nav_order: 4
|
||||
has_children: false
|
||||
permalink: /remotemode
|
||||
description: >-
|
||||
description in progress
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
The description will follow soon.
|
||||
@@ -1,8 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Setup Guide
|
||||
title: Setup Guides
|
||||
nav_order: 2
|
||||
has_children: true
|
||||
permalink: /setup/
|
||||
has_toc: false
|
||||
---
|
||||
This is a guide to setting up Klipper, Moonraker & Mainsail on a Raspberry Pi with Raspberry Pi OS. Other SBCs and/or Linux distributions might work, but may require a customized installation script or configs.
|
||||
# Setup Guides
|
||||
There are different ways to install Mainsail.
|
||||
|
||||
- [MainsailOS (recommend)](mainsail-os.md)
|
||||
- [Kiauh (Klipper Install And Update Helper)](kiauh.md)
|
||||
- [Manual Setup](manual-setup/index.md)
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
layout: default
|
||||
title: Kiauh Guide
|
||||
parent: Setup Guides
|
||||
nav_order: 2
|
||||
has_children: false
|
||||
permalink: /setup/kiauh
|
||||
---
|
||||
# Installing Mainsail with Kiauh
|
||||
|
||||
Kiauh is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail and various
|
||||
other extensions easily and comfortably.
|
||||
|
||||
For more informations and get to the guide click [here](https://github.com/th33xitus/kiauh).
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
layout: default
|
||||
title: MainsailOS Guide
|
||||
parent: Setup Guides
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
permalink: /setup/mainsail-os
|
||||
---
|
||||
# Installing Mainsail with MainsailOS
|
||||
|
||||
The recommended way to install Mainsail on a Raspberry Pi is to use [MainsailOS](https://github.com/raymondh2/MainsailOS),
|
||||
a pre-packaged disk image. If you are building a custom configuration, you may need to skip
|
||||
these instructions and install Mainsail [manually](manual-setup/index.md).
|
||||
|
||||
1. Download the latest mainsailOS [Release](https://github.com/raymondh2/MainsailOS/releases)
|
||||
2. Unzip the .img file from your download.
|
||||
3. Use [BalenaEtcher](https://www.balena.io/etcher/) to write the .img on to an 8GB, or larger SDcard. *THIS WILL DESTROY ALL DATA ON YOUR CARD*.
|
||||
|
||||
_note: It is a good idea to use a premium SDcard from a reputable manufacturer such as Sandisk, Kingston or Samsung. Low end cards will often fail quickly when used in this application_
|
||||
|
||||
4. If you will be using wifi, edit the file `mainsailos-wpa-supplicant.txt` with your Wifi information. If you are having trouble seeing this file on the sdcard, try removing it and re-inserting it into your card reader.
|
||||
5. Make sure that your MCU(s) is connected to your pi, If you will be using wired networking, also make sure your ethernet cable is connected.
|
||||
5. Insert the SDcard into your Pi, and power on the Pi.
|
||||
6. Find your pi on the network, and ssh into it, (Using PuTTY on Windows or the terminal on MacOS)
|
||||
* If your network supports bonjour, the pi should show up as `mainsailos.local`
|
||||
* If your network automatically assigns DNS hostnames, it may simply show up as `mainsailos`
|
||||
* Failing these two options, you may need to check your router's DHCP server, and find out what IP address as been assigned to the device.
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: Manual Setup Guide
|
||||
parent: Setup Guides
|
||||
nav_order: 3
|
||||
has_children: true
|
||||
permalink: /setup/manual-setup
|
||||
---
|
||||
This is a guide to setting up Klipper, Moonraker & Mainsail on a Raspberry Pi with Raspberry Pi OS. Other SBCs and/or Linux distributions might work, but may require a customized installation script or configs.
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: Klipper
|
||||
parent: Setup Guide
|
||||
parent: Manual Setup Guide
|
||||
grand_parent: Setup Guides
|
||||
nav_order: 3
|
||||
permalink: /setup/klipper
|
||||
permalink: /setup/manual-setup/klipper
|
||||
---
|
||||
|
||||
## Klipper
|
||||
@@ -38,14 +39,14 @@ You have to create the directories for your klipper configuration and the virtua
|
||||
|
||||
```bash
|
||||
mkdir ~/klipper_config
|
||||
mkdir ~/sdcard
|
||||
mkdir ~/gcode_files
|
||||
```
|
||||
|
||||
Move your printer.cfg to ~/klipper_config and check if the following entries are present in the config.
|
||||
```ini
|
||||
[virtual_sdcard]
|
||||
# for gcode upload
|
||||
path: ~/sdcard
|
||||
path: ~/gcode_files
|
||||
|
||||
[display_status]
|
||||
# for display messages in status panel
|
||||
@@ -55,7 +56,7 @@ path: ~/sdcard
|
||||
# Mainsail needs gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT` to make the buttons work.
|
||||
```
|
||||
> ℹ️ **These entries are very important.**
|
||||
For the full functionality of mainsail, you should also define gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT`. You'll find further information in [this](../necessary-cfg.md){: target="_blank"} document.
|
||||
For the full functionality of mainsail, you should also define gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT`. You'll find further information in [this](../../necessary-cfg.md){: target="_blank"} document.
|
||||
|
||||
After your config is in place, restart klipper with `sudo service klipper restart`. Check the `/tmp/klippy.log` for errors, if Klipper starts correctly you can continue the guide.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: Mainsail
|
||||
parent: Setup Guide
|
||||
parent: Manual Setup Guide
|
||||
grand_parent: Setup Guides
|
||||
nav_order: 5
|
||||
permalink: /setup/mainsail
|
||||
permalink: /setup/manual-setup/mainsail
|
||||
---
|
||||
|
||||
|
||||
@@ -31,15 +32,15 @@ Each file can be filled with the following content:
|
||||
# /etc/nginx/conf.d/upstreams.conf
|
||||
|
||||
upstream apiserver {
|
||||
#edit your api port here
|
||||
#if you need to change your api port, edit it here
|
||||
ip_hash;
|
||||
server 127.0.0.1:7125;
|
||||
}
|
||||
|
||||
upstream mjpgstreamer {
|
||||
#edit your webcam port here
|
||||
#if you need to change your webcam port, edit it here
|
||||
ip_hash;
|
||||
server 127.0.0.1:8081;
|
||||
server 127.0.0.1:8080;
|
||||
}
|
||||
```
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
@@ -85,35 +86,15 @@ server {
|
||||
index index.html;
|
||||
server_name _;
|
||||
|
||||
#max upload size for gcodes
|
||||
client_max_body_size 200M;
|
||||
#disable max upload size
|
||||
client_max_body_size 0;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /printer {
|
||||
proxy_pass http://apiserver/printer;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://apiserver/api;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /access {
|
||||
proxy_pass http://apiserver/access;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
||||
}
|
||||
|
||||
location /websocket {
|
||||
@@ -127,16 +108,8 @@ server {
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location /machine {
|
||||
proxy_pass http://apiserver/machine;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /server {
|
||||
proxy_pass http://apiserver/server;
|
||||
location ~ ^/(printer|api|access|machine|server)/ {
|
||||
proxy_pass http://apiserver$request_uri;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
@@ -159,7 +132,7 @@ sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
|
||||
sudo service nginx restart
|
||||
```
|
||||
|
||||
Now you can check again the API if it works with the reverse proxy. Open the url http://<printer-ip>/printer/info in your browser. if you see a content like this:
|
||||
Now you can check again the API if it works with the reverse proxy. Open the url http://\<printer-ip\>/printer/info in your browser. if you see a content like this:
|
||||
|
||||
```
|
||||
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-479-gd586fb06", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
|
||||
@@ -182,7 +155,7 @@ Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
|
||||
if you want to get the full experience with mainsail and klipper virtual_sdcard print, you should use these macros, or use them as templates for your own.
|
||||
|
||||
[Macro Link](../necessary-cfg.md){: .btn target="_blank"}
|
||||
[Macro Link](../../necessary-cfg.md){: .btn target="_blank"}
|
||||
|
||||
|
||||
### Change the Hostname (optional)
|
||||
@@ -195,7 +168,7 @@ and you can config your hostname:
|
||||
|
||||
`sudo raspi-config`
|
||||
|
||||
in 2 Network Options > N1 Hostname you can edit your hostname of your raspberry pi. After a reboot you can use http://<hostname>.local/ to open the webinterface.
|
||||
in 2 Network Options > N1 Hostname you can edit your hostname of your raspberry pi. After a reboot you can use http://\<hostname\>.local/ to open the webinterface.
|
||||
|
||||
|
||||
---
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: Moonraker
|
||||
parent: Setup Guide
|
||||
parent: Manual Setup Guide
|
||||
grand_parent: Setup Guides
|
||||
nav_order: 4
|
||||
permalink: /setup/moonraker
|
||||
permalink: /setup/manual-setup/moonraker
|
||||
---
|
||||
## Moonraker
|
||||
Moonraker is a web server that exposes APIs which lets Mainsail interact with Klipper.
|
||||
@@ -21,9 +22,6 @@ cd ~/moonraker/scripts
|
||||
./install-moonraker.sh -c /home/pi/klipper_config/moonraker.conf
|
||||
```
|
||||
|
||||
Once the script is finished, both Moonraker and Klipper should be started.
|
||||
In `/tmp/klippy.log` the following entry should appear: `Moonraker: server connection detected`
|
||||
|
||||
### Configuration
|
||||
> ⚠️ **Please pay attention to the following steps!**
|
||||
Misconfigured trusted_clients are a very common source of failure.
|
||||
@@ -47,6 +45,7 @@ config_path: ~/klipper_config
|
||||
enabled: true
|
||||
trusted_clients:
|
||||
192.168.1.0/24
|
||||
2a02:810d:9340:33f6::/64
|
||||
|
||||
[update_manager]
|
||||
client_repo: meteyou/mainsail
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: Operating System
|
||||
parent: Setup Guide
|
||||
parent: Manual Setup Guide
|
||||
grand_parent: Setup Guides
|
||||
nav_order: 2
|
||||
permalink: /setup/operating-systen
|
||||
permalink: /setup/manual-setup/operating-systen
|
||||
---
|
||||
## Operation System
|
||||
> ⚠️ **Please don't use an OctoPi image!**
|
||||
@@ -1,43 +1,47 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "0.4.0",
|
||||
"version": "1.2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
"build": "vue-cli-service build && npm run build.zip",
|
||||
"lint": "vue-cli-service lint",
|
||||
"build.zip": "cd ./dist && zip -r mainsail.zip ./ && cd .."
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.21.0",
|
||||
"core-js": "^3.7.0",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.8.2",
|
||||
"object-assign-deep": "^0.4.0",
|
||||
"prismjs": "^1.22.0",
|
||||
"prismjs": "^1.23.0",
|
||||
"vue": "^2.6.12",
|
||||
"vue-context": "^6.0.0",
|
||||
"vue-github-api": "^0.1.7",
|
||||
"vue-headful": "^2.1.0",
|
||||
"vue-i18n": "^8.22.4",
|
||||
"vue-plotly": "^1.1.0",
|
||||
"vue-prism-editor": "^1.2.2",
|
||||
"vue-resource": "^1.5.1",
|
||||
"vue-simple-upload": "^0.1.6",
|
||||
"vue-toast-notification": "^0.6.0",
|
||||
"vuetify": "^2.3.18",
|
||||
"vuex": "^3.5.1"
|
||||
"vuetify": "^2.4.2",
|
||||
"vuex": "^3.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "^5.8.55",
|
||||
"@vue/cli-plugin-babel": "^4.5.9",
|
||||
"@vue/cli-plugin-babel": "^4.5.10",
|
||||
"@vue/cli-plugin-eslint": "^4.5.3",
|
||||
"@vue/cli-plugin-pwa": "^4.5.9",
|
||||
"@vue/cli-service": "^4.5.9",
|
||||
"@vue/cli-plugin-pwa": "^4.5.10",
|
||||
"@vue/cli-service": "^4.5.10",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"css-loader": "^5.0.1",
|
||||
"eslint": "^7.13.0",
|
||||
"eslint-plugin-vue": "^7.1.0",
|
||||
"sass": "^1.29.0",
|
||||
"sass-loader": "^10.1.0",
|
||||
"eslint": "^7.17.0",
|
||||
"eslint-plugin-vue": "^7.4.1",
|
||||
"generate-file-webpack-plugin": "^1.0.1",
|
||||
"sass": "^1.32.4",
|
||||
"sass-loader": "^10.1.1",
|
||||
"sw-precache-webpack-plugin": "^1.0.0",
|
||||
"vue-cli-plugin-route": "0.0.7",
|
||||
"vue-cli-plugin-vuetify": "^2.0.7",
|
||||
"vue-cli-plugin-vuetify": "^2.0.9",
|
||||
"vue-router": "^3.4.9",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuetify-loader": "^1.6.0"
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -25,15 +25,17 @@
|
||||
:src="sidebarBackground"
|
||||
>
|
||||
<div id="nav-header">
|
||||
<img :src="require('./assets/logo.svg')" />
|
||||
<img :src="sidebarLogo" />
|
||||
<v-toolbar-title>{{ printername !== "" ? printername : hostname }}</v-toolbar-title>
|
||||
</div>
|
||||
<ul class="navi" :expand="$vuetify.breakpoint.mdAndUp">
|
||||
<printer-selecter></printer-selecter>
|
||||
<li v-for="(category, index) in routes" :key="index" :prepend-icon="category.icon"
|
||||
:class="[category.path !== '/' && currentPage.includes(category.path) ? 'active' : '', 'nav-item']"
|
||||
:value="true"
|
||||
>
|
||||
<router-link
|
||||
style="position: relative;"
|
||||
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
|
||||
v-if="
|
||||
(category.title === 'Webcam' && boolNaviWebcam) ||
|
||||
@@ -44,7 +46,19 @@
|
||||
)
|
||||
">
|
||||
<v-icon>mdi-{{ category.icon }}</v-icon>
|
||||
<span class="nav-title">{{ category.title }}</span>
|
||||
<v-icon
|
||||
small
|
||||
color="warning"
|
||||
style="
|
||||
top: 11px;
|
||||
left: 32px;
|
||||
position: absolute;
|
||||
"
|
||||
v-if="category.title === 'Settings' && isUpdateAvailable"
|
||||
>mdi-progress-upload</v-icon>
|
||||
<span class="nav-title">
|
||||
{{ $t(`Router.${category.title}`) }}
|
||||
</span>
|
||||
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
|
||||
</router-link>
|
||||
|
||||
@@ -52,7 +66,7 @@
|
||||
<li v-for="(page, pageIndex) in category.children" class="nav-item" v-bind:key="`${index}-${pageIndex}`">
|
||||
<router-link :to="page.path" class="nav-link" @click.prevent v-if="klippy_state !== 'error' || page.alwaysShow">
|
||||
<v-icon>mdi-{{ page.icon }}</v-icon>
|
||||
<span class="nav-title">{{ page.title }}</span>
|
||||
<span class="nav-title">{{ $t(`Router.${page.title}`) }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -66,14 +80,16 @@
|
||||
<v-app-bar app elevate-on-scroll>
|
||||
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">SAVE CONFIG</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
|
||||
<input type="file" ref="fileUploadAndStart" accept=".gcode, .ufp" style="display: none" @change="uploadAndStart" />
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">{{ $t("App.SAVECONFIG")}}</v-btn>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && ['standby', 'complete'].includes(printer_state)" :loading="loadings.includes['btnUploadAndStart']" @click="btnUploadAndStart"><v-icon class="mr-2">mdi-file-upload</v-icon>{{ $t("App.UploadPrint")}}</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">{{ $t("App.EmergencyStop")}}</span></v-btn>
|
||||
<top-corner-menu></top-corner-menu>
|
||||
</v-app-bar>
|
||||
|
||||
<v-main id="content">
|
||||
<v-scroll-y-transition>
|
||||
<v-container fluid id="page-container" class="container px-sm-6 px-3 mx-auto">
|
||||
<v-container fluid id="page-container" class="container px-3 px-sm-6 py-sm-6 mx-auto">
|
||||
<keep-alive>
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
@@ -81,44 +97,75 @@
|
||||
</v-scroll-y-transition>
|
||||
</v-main>
|
||||
|
||||
<v-dialog v-model="overlayDisconnect" persistent width="300">
|
||||
<v-card color="primary" dark >
|
||||
<v-card-text class="pt-2">
|
||||
Connecting...
|
||||
<v-progress-linear indeterminate color="white" class="mb-0 mt-2"></v-progress-linear>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-snackbar
|
||||
:timeout="-1"
|
||||
:value="true"
|
||||
fixed
|
||||
right
|
||||
bottom
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<strong>{{ $t("App.Uploading")}} {{ uploadSnackbar.filename }}</strong><br />
|
||||
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
|
||||
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
|
||||
<template v-slot:action="{ attrs }">
|
||||
<v-btn
|
||||
color="red"
|
||||
text
|
||||
v-bind="attrs"
|
||||
@click="cancelUpload"
|
||||
style="min-width: auto;"
|
||||
>
|
||||
<v-icon class="0">mdi-close</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-snackbar>
|
||||
|
||||
<v-dialog :value="!updateStatus" persistent width="500">
|
||||
<v-card color="primary" dark >
|
||||
<v-card-text class="pt-2">
|
||||
{{ updateMessage}}
|
||||
<v-progress-linear indeterminate color="white" class="mb-0 mt-2"></v-progress-linear>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<select-printer-dialog v-if="remoteMode"></select-printer-dialog>
|
||||
<connecting-dialog v-if="!remoteMode"></connecting-dialog>
|
||||
<update-dialog></update-dialog>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import routes from './routes'
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import TopCornerMenu from "@/components/TopCornerMenu";
|
||||
import TopCornerMenu from "@/components/TopCornerMenu"
|
||||
import UpdateDialog from "@/components/UpdateDialog"
|
||||
import ConnectingDialog from "@/components/ConnectingDialog";
|
||||
import SelectPrinterDialog from "@/components/SelectPrinterDialog";
|
||||
import PrinterSelecter from "@/components/PrinterSelecter"
|
||||
import axios from "axios";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
source: String,
|
||||
},
|
||||
components: {
|
||||
TopCornerMenu
|
||||
PrinterSelecter,
|
||||
ConnectingDialog,
|
||||
SelectPrinterDialog,
|
||||
UpdateDialog,
|
||||
TopCornerMenu,
|
||||
},
|
||||
data: () => ({
|
||||
overlayDisconnect: true,
|
||||
drawer: null,
|
||||
activeClass: 'active',
|
||||
routes: routes,
|
||||
routes: routes.filter((element) => element.title !== "Printers"),
|
||||
boolNaviHeightmap: false,
|
||||
uploadSnackbar: {
|
||||
status: false,
|
||||
filename: "",
|
||||
percent: 0,
|
||||
speed: 0,
|
||||
total: 0,
|
||||
cancelTokenSource: "",
|
||||
lastProgress: {
|
||||
time: 0,
|
||||
loaded: 0
|
||||
}
|
||||
}
|
||||
}),
|
||||
created () {
|
||||
this.$vuetify.theme.dark = true;
|
||||
@@ -131,6 +178,8 @@ export default {
|
||||
...mapState({
|
||||
isConnected: state => state.socket.isConnected,
|
||||
hostname: state => state.printer.hostname,
|
||||
apiHost: state => state.socket.hostname,
|
||||
apiPort: state => state.socket.port,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
loadings: state => state.socket.loadings,
|
||||
@@ -144,9 +193,7 @@ export default {
|
||||
save_config_pending: state => state.printer.configfile.save_config_pending,
|
||||
|
||||
klipperVersion: state => state.printer.software_version,
|
||||
|
||||
updateStatus: state => state.server.updateManager.updateResponse.complete,
|
||||
updateMessage: state => state.server.updateManager.updateResponse.message,
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
}),
|
||||
...mapGetters([
|
||||
'getTitle',
|
||||
@@ -157,6 +204,16 @@ export default {
|
||||
return this.$store.getters["printer/getPrintPercent"]
|
||||
}
|
||||
},
|
||||
defaultFavicons: {
|
||||
get() {
|
||||
return this.$store.getters["files/getFavicons"]
|
||||
}
|
||||
},
|
||||
sidebarLogo: {
|
||||
get() {
|
||||
return this.$store.getters["files/getSidebarLogo"]
|
||||
}
|
||||
},
|
||||
sidebarBackground: {
|
||||
get() {
|
||||
return this.$store.getters["files/getSidebarBackground"]
|
||||
@@ -167,6 +224,11 @@ export default {
|
||||
return this.$store.getters["files/getCustomStylesheet"]
|
||||
}
|
||||
},
|
||||
isUpdateAvailable: {
|
||||
get() {
|
||||
return this.$store.getters["server/updateManager/isUpdateAvailable"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEmergencyStop: function() {
|
||||
@@ -174,10 +236,90 @@ export default {
|
||||
this.$socket.sendObj('printer.emergency_stop', {}, 'socket/removeLoading',{ name: 'topbarEmergencyStop' });
|
||||
},
|
||||
clickSaveConfig: function() {
|
||||
this.$store.commit('server/addEvent', "SAVE_CONFIG");
|
||||
this.$store.commit('server/addEvent', { message: "SAVE_CONFIG", type: "command" });
|
||||
this.$store.commit('socket/addLoading', { name: 'topbarSaveConfig' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" }, 'socket/removeLoading', { name: 'topbarSaveConfig' });
|
||||
},
|
||||
btnUploadAndStart: function() {
|
||||
this.$refs.fileUploadAndStart.click()
|
||||
},
|
||||
async uploadAndStart() {
|
||||
if (this.$refs.fileUploadAndStart.files.length) {
|
||||
this.$store.commit('socket/addLoading', { name: 'btnUploadAndStart' })
|
||||
let successFiles = []
|
||||
for (const file of this.$refs.fileUploadAndStart.files) {
|
||||
const result = await this.doUploadAndStart(file)
|
||||
successFiles.push(result)
|
||||
}
|
||||
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
|
||||
for(const file of successFiles) {
|
||||
this.$toast.success("Upload of "+file+" successful!")
|
||||
}
|
||||
|
||||
this.$refs.fileUploadAndStart.value = ''
|
||||
this.$router.push("/");
|
||||
}
|
||||
},
|
||||
doUploadAndStart(file) {
|
||||
let toast = this.$toast
|
||||
let formData = new FormData()
|
||||
let filename = file.name.replace(" ", "_")
|
||||
|
||||
this.uploadSnackbar.filename = filename
|
||||
this.uploadSnackbar.status = true
|
||||
this.uploadSnackbar.percent = 0
|
||||
this.uploadSnackbar.speed = 0
|
||||
this.uploadSnackbar.lastProgress.loaded = 0
|
||||
this.uploadSnackbar.lastProgress.time = 0
|
||||
|
||||
formData.append('file', file, filename)
|
||||
formData.append('print', true)
|
||||
|
||||
return new Promise(resolve => {
|
||||
this.uploadSnackbar.cancelTokenSource = axios.CancelToken.source();
|
||||
axios.post('//' + this.apiHost + ':' + this.apiPort + '/server/files/upload',
|
||||
formData, {
|
||||
cancelToken: this.uploadSnackbar.cancelTokenSource.token,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
onUploadProgress: (progressEvent) => {
|
||||
this.uploadSnackbar.percent = (progressEvent.loaded * 100) / progressEvent.total
|
||||
if (this.uploadSnackbar.lastProgress.time) {
|
||||
const time = progressEvent.timeStamp - this.uploadSnackbar.lastProgress.time
|
||||
const data = progressEvent.loaded - this.uploadSnackbar.lastProgress.loaded
|
||||
|
||||
if (time) this.uploadSnackbar.speed = data / (time / 1000)
|
||||
}
|
||||
|
||||
this.uploadSnackbar.lastProgress.time = progressEvent.timeStamp
|
||||
this.uploadSnackbar.lastProgress.loaded = progressEvent.loaded
|
||||
this.uploadSnackbar.total = progressEvent.total
|
||||
}
|
||||
}
|
||||
).then((result) => {
|
||||
this.uploadSnackbar.status = false
|
||||
resolve(result.data.result)
|
||||
}).catch(() => {
|
||||
this.uploadSnackbar.status = false
|
||||
this.$store.commit('socket/removeLoading', { name: 'btnUploadAndStart' })
|
||||
toast.error("Cannot upload the file!")
|
||||
})
|
||||
})
|
||||
},
|
||||
cancelUpload: function() {
|
||||
this.uploadSnackbar.cancelTokenSource.cancel()
|
||||
this.uploadSnackbar.status = false
|
||||
},
|
||||
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]
|
||||
},
|
||||
drawFavicon(val) {
|
||||
let favicon16 = document.querySelector("link[rel*='icon'][sizes='16x16']")
|
||||
let favicon32 = document.querySelector("link[rel*='icon'][sizes='32x32']")
|
||||
@@ -192,7 +334,7 @@ export default {
|
||||
let centerX = canvas.width / 2;
|
||||
let centerY = canvas.height / 2;
|
||||
let radius = 32;
|
||||
let percent = val * 100;
|
||||
let percent = (val * 100).toFixed(0);
|
||||
|
||||
/* draw the grey circle */
|
||||
context.beginPath();
|
||||
@@ -223,8 +365,9 @@ export default {
|
||||
favicon16.href = canvas.toDataURL('image/png')
|
||||
favicon32.href = canvas.toDataURL('image/png')
|
||||
} else {
|
||||
favicon16.href = "/img/icons/favicon-16x16.png"
|
||||
favicon32.href = "/img/icons/favicon-32x32.png"
|
||||
const [favicon16Default, favicon32Default] = this.defaultFavicons
|
||||
favicon16.href = favicon16Default
|
||||
favicon32.href = favicon32Default
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -240,9 +383,6 @@ export default {
|
||||
config() {
|
||||
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
|
||||
},
|
||||
isConnected(newVal) {
|
||||
this.overlayDisconnect = !newVal;
|
||||
},
|
||||
customStylesheet(newVal) {
|
||||
if (newVal !== null) {
|
||||
let style = document.getElementById("customStylesheet")
|
||||
@@ -259,6 +399,9 @@ export default {
|
||||
let style = document.getElementById("customStylesheet")
|
||||
if (style) style.remove()
|
||||
}
|
||||
},
|
||||
defaultFavicons() {
|
||||
this.drawFavicon(this.print_percent);
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -311,7 +454,7 @@ export default {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
nav ul.navi a.nav-link {
|
||||
nav ul.navi .nav-link {
|
||||
display: block;
|
||||
color: white;
|
||||
border-radius: .5em;
|
||||
@@ -325,25 +468,25 @@ export default {
|
||||
margin: 0.5em 1em;
|
||||
}
|
||||
|
||||
nav ul.navi a.nav-link:hover,
|
||||
nav ul.navi li.active>a.nav-link,
|
||||
nav ul.navi a.nav-link.router-link-active {
|
||||
nav ul.navi .nav-link:hover,
|
||||
nav ul.navi li.active>.nav-link,
|
||||
nav ul.navi .nav-link.router-link-active {
|
||||
background: rgba(255,255,255,.3);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
nav ul.navi li.active>a.nav-link i.nav-arrow ,
|
||||
nav ul.navi a.nav-link.router-link-active i.nav-arrow {
|
||||
nav ul.navi li.active>.nav-link i.nav-arrow ,
|
||||
nav ul.navi .nav-link.router-link-active i.nav-arrow {
|
||||
transform: rotate(0);
|
||||
}
|
||||
|
||||
nav ul.navi a.nav-link>i.v-icon {
|
||||
nav ul.navi .nav-link>i.v-icon {
|
||||
color: white;
|
||||
font-size: 1.7em;
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
nav ul.navi a.nav-link>span.nav-title {
|
||||
nav ul.navi .nav-link>span.nav-title {
|
||||
line-height: 30px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
@@ -351,12 +494,15 @@ export default {
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
nav ul.navi a.nav-link>i.nav-arrow {
|
||||
nav ul.navi .nav-link>.nav-arrow {
|
||||
float: right;
|
||||
margin-top: 5px;
|
||||
margin-right: 0;
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
nav ul.navi .nav-link>.nav-arrow.right {
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
nav ul.navi>li>ul.child {
|
||||
display: none;
|
||||
@@ -370,16 +516,16 @@ export default {
|
||||
display: block;
|
||||
}
|
||||
|
||||
nav ul.navi>li>ul.child a.nav-link {
|
||||
nav ul.navi>li>ul.child .nav-link {
|
||||
padding: 5px 15px 5px 15px;
|
||||
}
|
||||
|
||||
nav ul.navi>li>ul.child a.nav-link:hover,
|
||||
nav ul.navi>li>ul.child a.nav-link.router-link-active {
|
||||
nav ul.navi>li>ul.child .nav-link:hover,
|
||||
nav ul.navi>li>ul.child .nav-link.router-link-active {
|
||||
background: rgba(255,255,255,.2);
|
||||
}
|
||||
|
||||
nav ul.navi>li>ul.child a.nav-link>span.nav-title {
|
||||
nav ul.navi>li>ul.child .nav-link>span.nav-title {
|
||||
text-transform: capitalize;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="showDialog" persistent :width="400">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>{{ $t("App.Connecting") }}<span v-if="connectingFailed"> {{ $t("App.Failed") }}</span><span v-if="isConnecting"> {{ $t("App.To") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}</span>
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-5" v-if="isConnecting">
|
||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
|
||||
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
showDialog: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
isConnected: state => state.socket.isConnected,
|
||||
isConnecting: state => state.socket.isConnecting,
|
||||
connectingFailed: state => state.socket.connectingFailed,
|
||||
}),
|
||||
protocol: {
|
||||
get() {
|
||||
return this.$store.state.socket.protocol
|
||||
}
|
||||
},
|
||||
hostname: {
|
||||
get() {
|
||||
return this.$store.state.socket.hostname
|
||||
},
|
||||
set(newName) {
|
||||
return this.$store.dispatch('socket/setData', { hostname: newName });
|
||||
}
|
||||
},
|
||||
port: {
|
||||
get() {
|
||||
return this.$store.state.socket.port
|
||||
},
|
||||
set(newName) {
|
||||
return this.$store.dispatch('socket/setData', { port: newName });
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
connect() {
|
||||
window.console.log("save connection")
|
||||
Vue.prototype.$socket.setUrl(this.protocol+"://"+this.hostname+":"+this.port+"/websocket")
|
||||
Vue.prototype.$socket.connect()
|
||||
},
|
||||
reconnect() {
|
||||
this.$store.dispatch('socket/setData', { connectingFailed: false })
|
||||
Vue.prototype.$socket.connect()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.tmpHostname = this.hostname+":"+this.port
|
||||
},
|
||||
watch: {
|
||||
isConnected(newVal) {
|
||||
this.showDialog = !newVal
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,84 @@
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div v-if="(remoteMode && countPrinters > 1) || (!remoteMode && countPrinters)">
|
||||
<li :class="currentPage === '/allPrinters' ? 'nav-item active' : 'nav-item '">
|
||||
<div
|
||||
class="nav-link "
|
||||
@click.prevent
|
||||
@click="switchToPrinters"
|
||||
role="button"
|
||||
>
|
||||
<v-icon>mdi-view-dashboard-outline</v-icon>
|
||||
<span class="nav-title">Printers</span>
|
||||
|
||||
<v-menu bottom :offset-x="true">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon class="nav-arrow right" v-bind="attrs" v-on="on" >mdi-chevron-down</v-icon>
|
||||
</template>
|
||||
|
||||
<v-list dense>
|
||||
<v-list-item two-line v-for="printer in printers" v-bind:key="printer._namespace" @click="changePrinter(printer)" :disabled="!printer.socket.isConnected" link>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ getPrinterName(printer._namespace) }}</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ getPrinterDescription(printer)}}</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</div>
|
||||
<v-item-group class="v-btn-toggle mx-4 d-block row" name="printers" v-if="false">
|
||||
<v-btn class="col" color="primary" @click="switchToPrinters">Printers</v-btn>
|
||||
|
||||
</v-item-group>
|
||||
</li>
|
||||
<v-divider class="my-4"></v-divider>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import router from "@/plugins/router";
|
||||
|
||||
export default {
|
||||
name: "PrinterSelecter.vue",
|
||||
computed: {
|
||||
...mapState({
|
||||
remoteMode: state => state.socket.remoteMode
|
||||
}),
|
||||
countPrinters: {
|
||||
get() {
|
||||
return this.$store.getters["farm/countPrinters"]
|
||||
}
|
||||
},
|
||||
printers: {
|
||||
get() {
|
||||
return this.$store.getters["farm/getPrinters"]
|
||||
}
|
||||
},
|
||||
currentPage: function() {
|
||||
return this.$route.fullPath;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
switchToPrinters() {
|
||||
router.push("/allPrinters");
|
||||
},
|
||||
getPrinterName(namespace) {
|
||||
return this.$store.getters["farm/"+namespace+"/getPrinterName"]
|
||||
},
|
||||
getPrinterDescription(printer) {
|
||||
return this.$store.getters["farm/"+printer._namespace+"/getStatus"]
|
||||
},
|
||||
changePrinter(printer) {
|
||||
if (printer.socket.isConnected) {
|
||||
if (this.remoteMode) this.$store.dispatch('changePrinter', { printer: printer._namespace })
|
||||
else window.location.href = "//"+printer.socket.hostname+(parseInt(printer.socket.webPort) !== 80 ? ':'+printer.socket.webPort : '')
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,283 @@
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-dialog v-model="showDialog" persistent :width="400">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
<span v-if="isConnecting">{{ $t("App.ConnectionTo") }}{{ parseInt(port) !== 80 ? hostname+':'+port : hostname }}</span>
|
||||
<span v-if="connectingFailed">{{ $t("App.ConnectionFailed") }}</span>
|
||||
<span v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">{{ $t("App.SelectPrinter") }}</span>
|
||||
<span v-if="dialogAddPrinter.bool">{{ $t("App.AddPrinter") }}</span>
|
||||
<span v-if="dialogEditPrinter.bool">{{ $t("App.EditPrinter") }}</span>
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool && this['farm/countPrinters'] > 0" small class="minwidth-0" @click="checkPrinters"><v-icon small>mdi-sync</v-icon></v-btn>
|
||||
<v-btn small class="minwidth-0" v-if="!isConnecting && !connectingFailed && dialogAddPrinter.bool" @click="dialogAddPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
<v-btn small class="minwidth-0" v-if="!isConnecting && !connectingFailed && dialogEditPrinter.bool" @click="dialogEditPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-5" v-if="isConnecting">
|
||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
|
||||
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="switchToChangePrinter" color="white" outlined class="mr-3">{{ $t("App.ChangePrinter") }}</v-btn>
|
||||
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-3" v-if="!isConnecting && dialogAddPrinter.bool">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-8">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-4">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.port"
|
||||
:rules="[v => !!v || 'Port is required']"
|
||||
label="Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t("App.AddPrinter") }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-3" v-if="!isConnecting && dialogEditPrinter.bool">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-8">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-4">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.port"
|
||||
:rules="[v => !!v || 'Port is required']"
|
||||
label="Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="">
|
||||
<v-btn
|
||||
color="red"
|
||||
outlined
|
||||
class="middle minwidth-0"
|
||||
@click="delPrinter"
|
||||
>
|
||||
<v-icon small>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t("App.UpdatePrinter") }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-3" v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">
|
||||
<v-container class="px-0 pb-0">
|
||||
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;" @click="connect(printer)">
|
||||
<v-row align="center">
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
color="primary"
|
||||
v-if="printer.socket.isConnecting"
|
||||
></v-progress-circular>
|
||||
<v-icon
|
||||
:color="printer.socket.isConnected ? 'green' : 'red'"
|
||||
v-if="!printer.socket.isConnecting"
|
||||
>mdi-{{ printer.socket.isConnected ? 'checkbox-marked-circle' : 'cancel' }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>{{ printer.socket.hostname }}{{ parseInt(printer.socket.port) !== 80 ? ":"+printer.socket.port : "" }}</v-col>
|
||||
<v-col class="col-auto"><v-btn small class="minwidth-0" v-on:click.stop.prevent="editPrinter(index)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="showCorsInfo">
|
||||
<v-col>
|
||||
<p class="text-center" v-if="this['farm/countPrinters'] === 0">{{ $t("App.Hello") }}</p>
|
||||
<p class="text-center">{{ $t("App.PleaseRememberToAdd") }}<code>{{ currentUrl }}</code> {{ $t("App.InMoonrakerConf") }}</p>
|
||||
<p class="text-center">{{ $t("App.YouCanFindMore") }}<a href="https://docs.mainsail.xyz/remotemode" target="_blank">{{ $t("App.Remotemode") }}</a>.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="dialogAddPrinter.bool = true">{{ $t("App.AddPrinter") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters, mapActions } from "vuex";
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
showDialog: true,
|
||||
dialogAddPrinter: {
|
||||
bool: false,
|
||||
hostname: "",
|
||||
port: 7125
|
||||
},
|
||||
dialogEditPrinter: {
|
||||
bool: false,
|
||||
index: 0,
|
||||
hostname: "",
|
||||
port: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
isConnected: state => state.socket.isConnected,
|
||||
isConnecting: state => state.socket.isConnecting,
|
||||
connectingFailed: state => state.socket.connectingFailed,
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
protocol: state => state.socket.protocol,
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
}),
|
||||
...mapGetters([
|
||||
"farm/countPrinters",
|
||||
"farm/getPrinters"
|
||||
]),
|
||||
...mapActions({
|
||||
readPrinters: "farm/readStoredPrinters"
|
||||
}),
|
||||
currentUrl: {
|
||||
get() {
|
||||
return "http://"+window.location.hostname+(window.location.port !== 80 && window.location.port !== '' ? ':'+window.location.port : '')
|
||||
}
|
||||
},
|
||||
showCorsInfo: {
|
||||
get() {
|
||||
if (this["farm/countPrinters"]) {
|
||||
for (const [ ,printer] of Object.entries(this["farm/getPrinters"])) {
|
||||
if (!printer.socket.isConnected) return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
addPrinter() {
|
||||
this.$store.commit('farm/addPrinter',{
|
||||
hostname: this.dialogAddPrinter.hostname,
|
||||
port: this.dialogAddPrinter.port,
|
||||
protocol: this.protocol
|
||||
})
|
||||
|
||||
this.dialogAddPrinter.hostname = ""
|
||||
this.dialogAddPrinter.bool = false
|
||||
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
},
|
||||
editPrinter(index) {
|
||||
this.dialogEditPrinter.hostname = this["farm/getPrinters"][index].socket.hostname
|
||||
this.dialogEditPrinter.port = this["farm/getPrinters"][index].socket.port
|
||||
this.dialogEditPrinter.index = index
|
||||
this.dialogEditPrinter.bool = true
|
||||
},
|
||||
updatePrinter() {
|
||||
this.$store.commit("farm/"+this.dialogEditPrinter.index+"/setSocketData", {
|
||||
hostname: this.dialogEditPrinter.hostname,
|
||||
port: this.dialogEditPrinter.port,
|
||||
isConnecting: true,
|
||||
})
|
||||
this.$store.dispatch("farm/"+this.dialogEditPrinter.index+"/reconnect")
|
||||
this.dialogEditPrinter.bool = false
|
||||
|
||||
this.checkPrinters()
|
||||
},
|
||||
delPrinter() {
|
||||
this.$store.commit("farm/removePrinter", { name: this.dialogEditPrinter.index })
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
this.dialogEditPrinter.bool = false
|
||||
},
|
||||
connect(printer) {
|
||||
this.$store.dispatch('socket/setData', {
|
||||
hostname: printer.socket.hostname,
|
||||
port: printer.socket.port
|
||||
})
|
||||
Vue.prototype.$socket.setUrl(this.protocol+"://"+printer.socket.hostname+":"+printer.socket.port+"/websocket")
|
||||
Vue.prototype.$socket.connect()
|
||||
},
|
||||
reconnect() {
|
||||
this.$store.dispatch('socket/setData', { connectingFailed: false })
|
||||
Vue.prototype.$socket.connect()
|
||||
},
|
||||
switchToChangePrinter() {
|
||||
this.$store.dispatch('socket/setData', { connectingFailed: false })
|
||||
},
|
||||
checkPrinters() {
|
||||
Object.entries(this['farm/getPrinters']).forEach(([key, printer]) => {
|
||||
if (!printer.socket.isConnected && !printer.socket.isConnecting) {
|
||||
this.$store.dispatch('farm/'+key+'/connect')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("farm/readStoredPrinters")
|
||||
},
|
||||
watch: {
|
||||
isConnected(newVal) {
|
||||
this.showDialog = !newVal
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-menu bottom left :offset-y="true" :close-on-content-click="false">
|
||||
<v-menu bottom left :offset-y="true" :close-on-content-click="false" v-model="showMenu">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark icon v-bind="attrs" v-on="on">
|
||||
<v-icon>mdi-dots-vertical</v-icon>
|
||||
@@ -13,37 +13,37 @@
|
||||
</template>
|
||||
|
||||
<v-list dense>
|
||||
<v-subheader class="" style="height: auto;">Klipper Control</v-subheader>
|
||||
<v-subheader class="" style="height: auto;">{{ $t("App.KlipperControl") }}</v-subheader>
|
||||
<v-list-item class="minheight30" link @click="doRestart()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Restart</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Restart") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30" link @click="doFirmwareRestart()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Firmware Restart</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.FirmwareRestart") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">Restart Services</v-subheader>
|
||||
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.RestartServices") }}</v-subheader>
|
||||
<v-list-item class="minheight30" link @click="doServiceRestartKlipper()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Klipper</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Klipper") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30" link @click="doServiceRestartMoonraker()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-sync</v-icon>Moonraker</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-restart</v-icon>{{ $t("App.Moonraker") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<div v-if="countPowerDevices">
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">Power Devices</v-subheader>
|
||||
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error')">
|
||||
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.PowerDevices") }}</v-subheader>
|
||||
<v-list-item v-for="(device, index) in devices" v-bind:key="index" class="minheight30" @click="changeSwitch(device, device.status)" :disabled="(device.status === 'error' || device.locked_while_printing && ['printing', 'paused'].includes(printer_state))">
|
||||
<v-list-item-title>
|
||||
<v-icon class="mr-2">mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}</v-icon>{{ device.device }}
|
||||
<v-icon class="mr-2" :color="device.status === 'on' ? '' : 'grey darken-2'">mdi-{{ device.status === 'on' ? 'toggle-switch' : 'toggle-switch-off' }}</v-icon>{{ device.device }}
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</div>
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">Host Control</v-subheader>
|
||||
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.HostControl") }}</v-subheader>
|
||||
<v-list-item class="minheight30" link @click="doHostReboot()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Reboot</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Reboot") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30" link @click="doHostShutdown()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Shutdown</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Shutdown") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -55,8 +55,14 @@ import Vue from "vue";
|
||||
|
||||
export default {
|
||||
name: "TopCornerMenu.vue",
|
||||
data: function () {
|
||||
return {
|
||||
showMenu: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
devices: (state) => state.server.power.devices,
|
||||
}),
|
||||
countPowerDevices: {
|
||||
@@ -74,23 +80,29 @@ export default {
|
||||
Vue.prototype.$socket.sendObj(rpc,{ [device.device]: null },"server/power/responseToggle")
|
||||
},
|
||||
doRestart: function() {
|
||||
this.$store.commit('server/addEvent', "RESTART")
|
||||
this.showMenu = false
|
||||
this.$store.commit('server/addEvent', { message: "RESTART", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "RESTART" })
|
||||
},
|
||||
doFirmwareRestart: function() {
|
||||
this.$store.commit('server/addEvent', "FIRMWARE_RESTART")
|
||||
this.showMenu = false
|
||||
this.$store.commit('server/addEvent', { message: "FIRMWARE_RESTART", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" })
|
||||
},
|
||||
doServiceRestartKlipper: function() {
|
||||
this.showMenu = false
|
||||
this.$socket.sendObj('machine.services.restart', { service: "klipper" })
|
||||
},
|
||||
doServiceRestartMoonraker: function() {
|
||||
this.showMenu = false
|
||||
this.$socket.sendObj('machine.services.restart', { service: "moonraker" })
|
||||
},
|
||||
doHostReboot: function() {
|
||||
this.showMenu = false
|
||||
this.$socket.sendObj('machine.reboot', { })
|
||||
},
|
||||
doHostShutdown: function() {
|
||||
this.showMenu = false
|
||||
this.$socket.sendObj('machine.shutdown', { })
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
<style scoped>
|
||||
.updaterLog {
|
||||
height: 350px;
|
||||
max-height: 350px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.updaterLog .title-cell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.updaterLog.v-data-table > .v-data-table__wrapper > table > tbody > tr > td {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-dialog :value="application !== ''" persistent width="60%" max-width="800">
|
||||
<v-card
|
||||
dark
|
||||
:loading="!complete"
|
||||
>
|
||||
<template slot="progress">
|
||||
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
||||
</template>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t("App.Updating")}} {{ application }}{{ complete ? " done!" : "..." }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-6">
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:options="options"
|
||||
:items="messages"
|
||||
item-key="date"
|
||||
hide-default-footer
|
||||
hide-default-header
|
||||
disable-pagination
|
||||
class="updaterLog"
|
||||
ref="updaterLog"
|
||||
:custom-sort="customSort"
|
||||
sort-by="date"
|
||||
:sort-desc="true"
|
||||
color="primary"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="py-2">{{ $t("App.Empty")}}</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr>
|
||||
<td class="log-cell title-cell py-2">
|
||||
{{ formatTime(item.date)}}
|
||||
</td>
|
||||
<td class="log-cell content-cell pl-0 py-2" colspan="2" style="width:100%;">
|
||||
<span v-if="item.message" class="message" v-html="item.message"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-row>
|
||||
<v-col class="text-center pt-5">
|
||||
<v-btn @click="close" :disabled="!complete" color="primary">{{ $t("App.Close")}}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "UpdateDialog.vue",
|
||||
data: function() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: 'Date',
|
||||
value: 'date',
|
||||
width: '1%',
|
||||
dateType: 'Date',
|
||||
}, {
|
||||
text: 'Message',
|
||||
sortable: false,
|
||||
value: 'message',
|
||||
width: '99%'
|
||||
},
|
||||
],
|
||||
options: {
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
application: state => state.server.updateManager.updateResponse.application,
|
||||
complete: state => state.server.updateManager.updateResponse.complete,
|
||||
messages: state => state.server.updateManager.updateResponse.messages,
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
formatTime(date) {
|
||||
let hours = date.getHours();
|
||||
if (hours < 10) hours = "0"+hours.toString();
|
||||
let minutes = date.getMinutes();
|
||||
if (minutes < 10) minutes = "0"+minutes.toString();
|
||||
let seconds = date.getSeconds();
|
||||
if (seconds < 10) seconds = "0"+seconds.toString();
|
||||
|
||||
return hours+":"+minutes+":"+seconds;
|
||||
},
|
||||
customSort: function(items, index, isDesc) {
|
||||
items.sort((a, b) => {
|
||||
if (index[0] === 'date') {
|
||||
if (!isDesc[0]) return new Date(b[index]) - new Date(a[index]);
|
||||
else return new Date(a[index]) - new Date(b[index]);
|
||||
} else {
|
||||
if(typeof a[index] !== 'undefined'){
|
||||
if (!isDesc[0]) return a[index].toLowerCase().localeCompare(b[index].toLowerCase());
|
||||
else return b[index].toLowerCase().localeCompare(a[index].toLowerCase());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return items;
|
||||
},
|
||||
close() {
|
||||
if (this.application !== null && this.complete && ["client", "mainsail"].includes(this.application.toLowerCase())) window.location.reload(true)
|
||||
else {
|
||||
this.$store.commit('server/updateManager/resetUpdateResponse')
|
||||
this.$socket.sendObj('machine.update.status', { refresh: false }, 'server/updateManager/getStatus')
|
||||
}
|
||||
}
|
||||
},
|
||||
updated(){
|
||||
if (this.$refs.updaterLog) this.$refs.updaterLog.$el.scrollTop = this.$refs.updaterLog.$el.scrollHeight
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,8 +1,9 @@
|
||||
<template>
|
||||
<div id="tempchart" style="height: 270px; width: 100%;"></div>
|
||||
<div id="tempchart" style="height: 300px; width: 100%;"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
|
||||
|
||||
export default {
|
||||
@@ -11,10 +12,13 @@ export default {
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
chart : null,
|
||||
tempchartDisplayMinutes: 10,
|
||||
timer: '',
|
||||
timerChart: '',
|
||||
timerDataset: '',
|
||||
chartOptions: {
|
||||
theme: "dark1",
|
||||
zoomEnabled: true,
|
||||
backgroundColor: 'transparent',
|
||||
animationEnabled: true,
|
||||
legend: {
|
||||
@@ -22,8 +26,52 @@ export default {
|
||||
verticalAlign: "top",
|
||||
},
|
||||
toolTip:{
|
||||
content: "{name}: {y}",
|
||||
yValueFormatString: "#,###.00",
|
||||
shared: true,
|
||||
borderColor: "#ffffff30",
|
||||
content: (e) => {
|
||||
let output = ""
|
||||
|
||||
if (e.entries[0].dataPoint.x) {
|
||||
const date = new Date(e.entries[0].dataPoint.x)
|
||||
const hours = "0" + date.getHours();
|
||||
const minutes = "0" + date.getMinutes();
|
||||
const seconds = "0" + date.getSeconds();
|
||||
output += "<strong>"+hours.substr(-2) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2)+"</strong>"
|
||||
}
|
||||
|
||||
const mainEntries = e.entries.filter(dataset => dataset.dataSeries.showInLegend && dataset.dataSeries.visible).sort((a,b) => {
|
||||
if (a.dataSeries.legendText > b.dataSeries.legendText) return 1
|
||||
if (a.dataSeries.legendText < b.dataSeries.legendText) return -1
|
||||
|
||||
return 0
|
||||
})
|
||||
|
||||
if (mainEntries.length) {
|
||||
mainEntries.forEach(dataset => {
|
||||
output += "<br />"
|
||||
output += dataset.dataSeries.legendText+": "+dataset.dataPoint.y.toFixed(1)
|
||||
|
||||
const datasetTarget = e.entries.find(datasetTarget => datasetTarget.dataSeries.name === dataset.dataSeries.name+"_target")
|
||||
if (datasetTarget) {
|
||||
output += " / "+datasetTarget.dataPoint.y.toFixed(1)
|
||||
}
|
||||
|
||||
output += "°C"
|
||||
|
||||
const datasetPower = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_power")
|
||||
if (datasetPower) {
|
||||
output += " at "+datasetPower.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
|
||||
const datasetSpeed = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_speed")
|
||||
if (datasetSpeed) {
|
||||
output += " at "+datasetSpeed.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
},
|
||||
axisX:{
|
||||
valueFormatString: "HH:mm" ,
|
||||
@@ -40,16 +88,44 @@ export default {
|
||||
minimum: 0,
|
||||
maximum: 300,
|
||||
interval: 50,
|
||||
suffix: '°C'
|
||||
},
|
||||
axisY2: {
|
||||
gridThickness: 0,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
interval: 25,
|
||||
suffix: '%'
|
||||
},
|
||||
data: [ ]
|
||||
},
|
||||
chart : null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
intervalChartUpdate: state => state.gui.tempchart.intervalChartUpdate,
|
||||
intervalDatasetUpdate: state => state.gui.tempchart.intervalDatasetUpdate,
|
||||
}),
|
||||
datasets: {
|
||||
get () {
|
||||
return this.$store.state.printer.tempHistory.datasets
|
||||
const datasets = this.$store.state.printer.tempHistory.datasets
|
||||
|
||||
return datasets.sort((a,b) => {
|
||||
if ('name' in a && 'name' in b) {
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_power")) return -1
|
||||
if (a.name.endsWith("_power") < b.name.endsWith("_target")) return 1
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_target")) return -1
|
||||
if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
})
|
||||
}
|
||||
},
|
||||
autoscale: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
}
|
||||
},
|
||||
maxTemp: {
|
||||
@@ -69,8 +145,7 @@ export default {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.timerChart = setInterval(() => {
|
||||
if (
|
||||
document.getElementById("tempchart") &&
|
||||
this.chart &&
|
||||
@@ -79,10 +154,15 @@ export default {
|
||||
this.chartOptions.data = this.datasets
|
||||
this.chartOptions.axisX.minimum = new Date() - 60* this.tempchartDisplayMinutes *1000
|
||||
this.chartOptions.axisX.maximum = new Date()
|
||||
this.chartOptions.axisY.maximum = this.maxTemp
|
||||
this.chartOptions.axisY.maximum = this.autoscale ? null : this.maxTemp
|
||||
//this.chartOptions.axisY.interval = this.autoscale ? 25 : 50
|
||||
this.chart.render()
|
||||
}
|
||||
}, 1000);
|
||||
}, this.intervalChartUpdate)
|
||||
|
||||
this.timerDataset = setInterval(() => {
|
||||
this.$store.dispatch("printer/tempHistory/updateDatasets")
|
||||
}, this.intervalDatasetUpdate)
|
||||
},
|
||||
mounted: function() {
|
||||
this.createChart()
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
|
||||
import panels from './panels'
|
||||
import topCornerMenu from './TopCornerMenu'
|
||||
import updateDialog from './UpdateDialog'
|
||||
import connectingDialog from './ConnectingDialog'
|
||||
import selectPrinterDialog from './SelectPrinterDialog'
|
||||
import printerSelecter from './PrinterSelecter'
|
||||
|
||||
export default {
|
||||
panels,
|
||||
topCornerMenu
|
||||
topCornerMenu,
|
||||
updateDialog,
|
||||
connectingDialog,
|
||||
selectPrinterDialog,
|
||||
printerSelecter,
|
||||
}
|
||||
@@ -11,59 +11,47 @@
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-row class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 pb-0 text-center">
|
||||
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn>
|
||||
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">QGL</v-btn>
|
||||
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">Z Tilt</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('X-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Y-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Z-25')" dense class="btnMinWidthAuto col"><span class="body-2">-25</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-1')" dense class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-0.1')" dense class="btnMinWidthAuto col"><span class="body-2">-0.1</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+0.1')" dense class="btnMinWidthAuto col"><span class="body-2">+0.1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+1')" dense class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+25')" dense class="btnMinWidthAuto col"><span class="body-2">+25</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="" v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="col-12 px-4 py-2 text-center">
|
||||
<div v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
|
||||
<v-btn small color="primary" class="mx-1 my-1" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container class="pt-0">
|
||||
<v-row no-gutters class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 mt-3 pb-0 text-center">
|
||||
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">{{ $t("Dashboard.Home")}} </span>{{ $t("Dashboard.All")}}</v-btn>
|
||||
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">{{ $t("Dashboard.QGL")}}</v-btn>
|
||||
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">{{ $t("Dashboard.ZTilt")}}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="text-center">
|
||||
<v-btn v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" small color="primary" class="mx-1 mt-3" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -85,59 +73,84 @@
|
||||
homedAxes: state => state.printer.toolhead.homed_axes,
|
||||
config: state => state.printer.configfile.config,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
|
||||
feedrateXY: state => state.gui.dashboard.control.feedrateXY,
|
||||
stepsXY: state => state.gui.dashboard.control.stepsXY,
|
||||
feedrateZ: state => state.gui.dashboard.control.feedrateZ,
|
||||
stepsZ: state => state.gui.dashboard.control.stepsZ,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getMacros',
|
||||
])
|
||||
]),
|
||||
stepsXYsorted: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return b-a })
|
||||
}
|
||||
},
|
||||
stepsXYsortedReverse: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsXY].sort(function(a, b) { return a-b })
|
||||
}
|
||||
},
|
||||
stepsZsorted: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return b-a })
|
||||
}
|
||||
},
|
||||
stepsZsortedReverse: {
|
||||
get() {
|
||||
return [...this.$store.state.gui.dashboard.control.stepsZ].sort(function(a, b) { return a-b })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doHome() {
|
||||
this.$store.commit('server/addEvent', "G28");
|
||||
this.$store.commit('server/addEvent', { message: "G28", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'homeAll' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' });
|
||||
},
|
||||
doHomeX() {
|
||||
this.$store.commit('server/addEvent', "G28 X");
|
||||
this.$store.commit('server/addEvent', { message: "G28 X", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'homeX' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "socket/removeLoading", { name: 'homeX' });
|
||||
},
|
||||
doHomeY() {
|
||||
this.$store.commit('server/addEvent', "G28 Y");
|
||||
this.$store.commit('server/addEvent', { message: "G28 Y", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'homeY' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "socket/removeLoading", { name: 'homeY' });
|
||||
},
|
||||
doHomeZ() {
|
||||
this.$store.commit('server/addEvent', "G28 Z");
|
||||
this.$store.commit('server/addEvent', { message: "G28 Z", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'homeZ' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "socket/removeLoading", { name: 'homeZ' });
|
||||
},
|
||||
doQGL() {
|
||||
this.$store.commit('server/addEvent', "QUAD_GANTRY_LEVEL");
|
||||
this.$store.commit('server/addEvent', { message: "QUAD_GANTRY_LEVEL", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'qgl' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "socket/removeLoading", { name: 'qgl' });
|
||||
},
|
||||
doZtilt() {
|
||||
this.$store.commit('server/addEvent', "Z_TILT_ADJUST");
|
||||
this.$store.commit('server/addEvent', { message: "Z_TILT_ADJUST", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'zTilt' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
doSendMove(gcode, feedrate) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F6000" + "\n" +
|
||||
"G1 " + gcode + " F"+feedrate*60 + "\n" +
|
||||
"G90";
|
||||
|
||||
this.doSend(gcode);
|
||||
},
|
||||
doSend(gcode) {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "server/getGcodeRespond");
|
||||
},
|
||||
doSendMacro(gcode) {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -4,26 +4,28 @@
|
||||
|
||||
<template>
|
||||
<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>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<v-label>Feedrate in mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="px-3">
|
||||
<v-col class="col-12 text-center">
|
||||
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> Retract</v-btn>
|
||||
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> Extrude</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container>
|
||||
<v-row class="">
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>{{ $t("Dashboard.FeedAmountIn") }} mm:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>{{ $t("Dashboard.FeedrateIn") }} mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="">
|
||||
<v-col class="col text-center">
|
||||
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t("Dashboard.Retract") }}</v-btn>
|
||||
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t("Dashboard.Extrude") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -38,9 +40,7 @@
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
feedrate: 5
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -48,11 +48,23 @@
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
extruder: state => state.printer.extruder,
|
||||
config: state => state.printer.configfile.config
|
||||
config: state => state.printer.configfile.config,
|
||||
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
|
||||
feedrates: state => state.gui.dashboard.extruder.feedrates,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
feedamountsSorted: {
|
||||
get() {
|
||||
return [...this.feedamounts].sort((a,b) => { return b-a })
|
||||
}
|
||||
},
|
||||
feedratesSorted: {
|
||||
get() {
|
||||
return [...this.feedrates].sort((a,b) => { return b-a })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
@@ -63,13 +75,13 @@
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
|
||||
},
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<style>
|
||||
.v-card.disabledPrinter {
|
||||
opacity: 0.6;
|
||||
filter: grayscale(70%);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card
|
||||
:class="(!printer.socket.isConnected && !printer.socket.isConnecting ? 'disabledPrinter' : '')"
|
||||
:loading="printer.socket.isConnecting"
|
||||
@click="clickPrinter"
|
||||
>
|
||||
<v-toolbar flat dense :color="isCurrentPrinter ? 'primary' : ''">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ printer_name }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-img
|
||||
height="200px"
|
||||
:src="printer_image"
|
||||
class="d-flex align-end"
|
||||
>
|
||||
<v-card-title class="white--text py-2" style="background-color: rgba(0,0,0,0.3); backdrop-filter: blur(3px);">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0 d-flex align-center" style="width: 58px">
|
||||
<img class="my-auto" :src="printer_logo" style="width: 100%;" />
|
||||
</v-col>
|
||||
<v-col class="col" style="width: 100px">
|
||||
<h3 class="font-weight-regular">{{ printer_status }}</h3>
|
||||
<span class="subtitle-2 text-truncate px-0 text--disabled d-block" v-if="printer_current_filename !== ''"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ printer_current_filename }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-title>
|
||||
</v-img>
|
||||
<v-card-text class="px-0 py-2" v-if="printer_preview.length">
|
||||
<v-container class="py-0">
|
||||
<v-row>
|
||||
<v-col :class="object.name === 'ETA' ? 'col-auto' : 'col' + ' px-2'" v-for="object in printer_preview" v-bind:key="object.name">
|
||||
<strong class="d-block text-center">{{ object.name }}</strong>
|
||||
<span class="d-block text-center">{{ object.value }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
props: {
|
||||
printer: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
remoteMode: state => state.socket.remoteMode
|
||||
}),
|
||||
isCurrentPrinter: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/isCurrentPrinter"]
|
||||
}
|
||||
},
|
||||
printer_name: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterName"]
|
||||
}
|
||||
},
|
||||
printer_status: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getStatus"]
|
||||
}
|
||||
},
|
||||
printer_current_filename: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getCurrentFilename"]
|
||||
}
|
||||
},
|
||||
printer_image: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getImage"]
|
||||
}
|
||||
},
|
||||
printer_logo: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getLogo"]
|
||||
}
|
||||
},
|
||||
printer_position: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getPosition"]
|
||||
}
|
||||
},
|
||||
printer_preview: {
|
||||
get() {
|
||||
return this.$store.getters["farm/"+this.printer._namespace+"/getPrinterPreview"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickPrinter() {
|
||||
if (this.printer.socket.isConnected) this.changePrinter()
|
||||
else this.reconnectPrinter()
|
||||
},
|
||||
changePrinter() {
|
||||
if (this.remoteMode) this.$store.dispatch('changePrinter', { printer: this.printer._namespace })
|
||||
else window.location.href = "//"+this.printer.socket.hostname+(parseInt(this.printer.socket.webPort) !== 80 ? ':'+this.printer.socket.webPort : '')
|
||||
},
|
||||
reconnectPrinter() {
|
||||
this.$store.dispatch("farm/"+this.printer._namespace+"/reconnect")
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,21 +2,21 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>Klippy-State: {{ klippy_state}}</span>
|
||||
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>{{ $t('Setting.KlippyState')}}{{ klippy_state}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left" v-if="klippy_connected"><pre style="white-space: pre-wrap;">{{ klippy_message }}</pre></v-flex>
|
||||
<v-flex col class="text-left" v-if="!klippy_connected">
|
||||
<p>Moonraker can't connect to Klippy!<br />Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.</p>
|
||||
<p style="white-space:pre-wrap">{{ $t('Setting.KlippyInfo') }}</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
|
||||
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE Restart</v-btn>
|
||||
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.Restart') }}</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.FIRMWARERestart') }}</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -9,23 +9,25 @@
|
||||
!boolMacroResume ||
|
||||
!boolMacroCancelPrint
|
||||
">
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar flat dense color="orange darken-2">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>Missing configuration
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MissingConfiguration") }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left">
|
||||
<p v-if="!boolVirtualSdcard"><code>virtual_sdcard</code> is not defined in config.</p>
|
||||
<p v-if="!boolPauseResume"><code>pause_resume</code> is not defined in config.</p>
|
||||
<p v-if="!boolDisplayStatus"><code>display_status</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroPause"><code>gcode_macro PAUSE</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroResume"><code>gcode_macro RESUME</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroCancelPrint"><code>gcode_macro CANCEL_PRINT</code> is not defined in config.</p>
|
||||
<p class="mb-0"><a href="https://meteyou.github.io/mainsail/necessary-configuration" target="_blank">Here you will find more information.</a></p>
|
||||
<p v-if="!boolVirtualSdcard" class="orange--text"><code>virtual_sdcard</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<div class="text-center">
|
||||
<v-btn href="https://docs.mainsail.xyz/necessary-configuration" target="_blank" color="white" outlined small><v-icon small class="mr-1">mdi-information</v-icon>{{ $t("Dashboard.MoreInformation") }}</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
@@ -23,46 +23,48 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t("Dashboard.Console") }}</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupConsole')">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Dashboard.HideTemperatures')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Dashboard.CustomFilters')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
label="Send code..."
|
||||
ref="gcodeCommandField"
|
||||
solo
|
||||
hide-details
|
||||
autocomplete="off"
|
||||
v-model="gcode"
|
||||
v-on:keyup.enter="doSend"
|
||||
v-on:keyup.up="onKeyUp"
|
||||
v-on:keyup.down="onKeyDown"
|
||||
:items="items"
|
||||
v-on:keydown.tab="getAutocomplete"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
|
||||
<v-icon class="mr-2">mdi-send</v-icon> send
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text>
|
||||
<v-container class="py-0 px-0">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
:label="$t('Dashboard.SendCode')"
|
||||
ref="gcodeCommandField"
|
||||
solo
|
||||
hide-details
|
||||
autocomplete="off"
|
||||
v-model="gcode"
|
||||
v-on:keyup.enter="doSend"
|
||||
v-on:keyup.up="onKeyUp"
|
||||
v-on:keyup.down="onKeyDown"
|
||||
:items="items"
|
||||
v-on:keydown.tab="getAutocomplete"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
|
||||
<v-icon class="mr-2">mdi-send</v-icon> {{ $t("Dashboard.Send") }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<v-divider></v-divider>
|
||||
@@ -79,7 +81,7 @@
|
||||
sort-by="date"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="py-2">empty</div>
|
||||
<div class="py-2">{{ $t("Dashboard.Empty") }}</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
@@ -163,7 +165,7 @@ import {mapState} from 'vuex'
|
||||
methods: {
|
||||
doSend() {
|
||||
this.$store.commit('socket/addLoading', { name: 'sendGcode' });
|
||||
this.$store.commit('server/addEvent', this.gcode);
|
||||
this.$store.commit('server/addEvent', { message: this.gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "socket/removeLoading", { name: 'sendGcode' });
|
||||
this.lastCommands.push(this.gcode);
|
||||
this.gcode = "";
|
||||
@@ -198,7 +200,7 @@ import {mapState} from 'vuex'
|
||||
let output = "";
|
||||
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
|
||||
|
||||
this.$store.commit('server/addEvent', output);
|
||||
this.$store.commit('server/addEvent', { message: output, type: 'command' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,22 @@
|
||||
<v-card class="mt-6" v-if="['printing', 'paused'].includes(printer_state)">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</span>
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>{{ $t("Dashboard.PrintSettings") }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" command="M220" attribute-name="S" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Extrusion factor" :target="extrude_factor" :max="200" :multi="100" :step="1" command="M221" attribute-name="S" ></tool-slider>
|
||||
</v-card>
|
||||
<v-card class="mt-6" v-if="this['printer/getFans'].length">
|
||||
<v-card class="mt-6" v-if="this['printer/getMiscellaneous'].length">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon :class="'mdi mdi-fan '+(this['printer/getPartFanSpeed'] ? 'icon-rotate' : '')" left></v-icon>Fans</span>
|
||||
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>{{ $t("Dashboard.Miscellaneous") }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<div v-for="(fan, index) of this['printer/getFans']" v-bind:key="index">
|
||||
<div v-for="(object, index) of this['printer/getMiscellaneous']" v-bind:key="index">
|
||||
<v-divider v-if="index"></v-divider>
|
||||
<fan-slider :name="fan.name" :type="fan.type" :target="fan.speed" :controllable="fan.controllable" :multi="100" class="py-0" ></fan-slider>
|
||||
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)" ></miscellaneous-slider>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
@@ -43,12 +43,12 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import FanSlider from '../../inputs/FanSlider'
|
||||
import ToolSlider from '../../inputs/ToolSlider'
|
||||
import MiscellaneousSlider from "@/inputs/MiscellaneousSlider";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FanSlider,
|
||||
MiscellaneousSlider,
|
||||
ToolSlider
|
||||
},
|
||||
data () {
|
||||
@@ -63,8 +63,7 @@
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getFans',
|
||||
'printer/getPartFanSpeed',
|
||||
'printer/getMiscellaneous',
|
||||
]),
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<template>
|
||||
<v-card
|
||||
class="mb-6">
|
||||
<v-toolbar flat dense color="orange darken-2">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MoonrakerFailedPlugins") }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left">
|
||||
<p class="orange--text">{{ $t("Dashboard.MoonrakerErrorInfo") }}</p>
|
||||
<p class="mb-2 orange--text">{{ $t("Dashboard.FollowingPluginHasAnError") }}</p>
|
||||
<ul class="mt-0 pt-0">
|
||||
<li v-for="plugin in failedPlugins" v-bind:key="plugin" class="orange--text"><code>{{ plugin }}</code></li>
|
||||
</ul>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left">
|
||||
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Dashboard.DownloadLog") }}</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
...mapState({
|
||||
failedPlugins: state => state.server.failed_plugins,
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
}),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -25,158 +25,188 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
Config Files
|
||||
<v-spacer class="d-none d-sm-block"></v-spacer>
|
||||
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0">
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="uploadFileButton" :loading="loadings.includes['configFileUpload']"><v-icon>mdi-file-upload</v-icon></v-btn>
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn class="flex-grow-1" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" title="Setup current list">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" label="Hidden files"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</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.sync="countPerPage"
|
||||
:footer-props="{
|
||||
itemsPerPageText: 'Files'
|
||||
}"
|
||||
mobile-breakpoint="0"
|
||||
item-key="name">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
{{ $t('Setting.ConfigFiles') }}
|
||||
<v-spacer class="d-none d-sm-block"></v-spacer>
|
||||
<input type="file" ref="fileUpload" style="display: none" multiple @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0">
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="uploadFileButton" :loading="loadings.includes['configFileUpload']"><v-icon>mdi-file-upload</v-icon></v-btn>
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
|
||||
<v-btn v-if="currentPath !== '' && currentPath !== '/config_examples'" class="flex-grow-1" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn class="flex-grow-1" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" title="Setup current list">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Setting.HiddenFiles')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>{{ $t('Setting.CurrentPath') }} {{ 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.sync="countPerPage"
|
||||
:footer-props="{
|
||||
itemsPerPageText: $t('Setting.Files')
|
||||
}"
|
||||
mobile-breakpoint="0"
|
||||
item-key="name">
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
<template #no-data>
|
||||
<div class="text-center">{{ $t('Setting.Empty') }}</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== '')">
|
||||
<tr
|
||||
class="file-list-cursor"
|
||||
@click="clickRowGoBack">
|
||||
<td class=" "><v-icon>mdi-folder-upload</v-icon></td>
|
||||
<td class=" " colspan="8">..</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template slot="body.prepend" v-if="(currentPath !== '')">
|
||||
<tr
|
||||
class="file-list-cursor"
|
||||
@click="clickRowGoBack">
|
||||
<td class="pr-0 text-center" style="width: 32px;"><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="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> Edit file
|
||||
</v-list-item>
|
||||
<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-rename-box</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>
|
||||
<template #item="{ item }">
|
||||
<tr
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor"
|
||||
:data-name="item.filename">
|
||||
<td class="pr-0 text-center" style="width: 32px;">
|
||||
<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-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-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item @click="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> {{ $t('Setting.EditFile') }}
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Setting.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-rename-box</v-icon> {{ $t('Setting.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> {{ $t('Setting.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> {{ $t('Setting.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>
|
||||
{{ $t('Setting.PleaseStandBy') }}
|
||||
<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 href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>{{ $t('Setting.ConfigReference') }}</v-btn>
|
||||
<v-divider white vertical v-if="currentPath !== '/config_examples'" class="d-none d-md-flex"></v-divider>
|
||||
<v-btn dark text @click="saveFile(false)" v-if="currentPath !== '/config_examples'"><v-icon small class="mr-1">mdi-content-save</v-icon><span class="d-none d-sm-inline">{{ $t('Setting.Save') }}</span></v-btn>
|
||||
<v-divider white vertical v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"></v-divider>
|
||||
<v-btn dark text @click="saveFile(true)" v-if="currentPath !== '/config_examples' && !['printing', 'paused'].includes(printer_state)" class="d-none d-sm-flex"><v-icon small class="mr-1">mdi-restart</v-icon>{{ $t('Setting.SaveRestart') }}</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">{{ $t('Setting.RenameFile') }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Setting.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">{{ $t('Setting.CreateFile') }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createFileAction">{{ $t('Setting.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">{{ $t('Setting.CreateFolder') }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createFolderAction">{{ $t('Setting.Create') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-snackbar
|
||||
:timeout="-1"
|
||||
:value="true"
|
||||
fixed
|
||||
right
|
||||
bottom
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t('Setting.Uploading') }} {{ uploadSnackbar.filename }}</strong><br />
|
||||
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
|
||||
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
|
||||
<template v-slot:action="{ attrs }">
|
||||
<v-btn
|
||||
color="red"
|
||||
text
|
||||
v-bind="attrs"
|
||||
@click="cancelUpload"
|
||||
style="min-width: auto;"
|
||||
>
|
||||
<v-icon class="0">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>
|
||||
</v-snackbar>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -204,9 +234,9 @@
|
||||
selected: [],
|
||||
headers: [
|
||||
{ text: '', value: '', },
|
||||
{ text: 'Name', value: 'filename', },
|
||||
{ text: 'Filesize', value: 'size', align: 'right', },
|
||||
{ text: 'Last modified', value: 'modified', align: 'right', },
|
||||
{ text: this.$t('Setting.Name'), value: 'filename', },
|
||||
{ text: this.$t('Setting.Filesize'), value: 'size', align: 'right', },
|
||||
{ text: this.$t('Setting.LastModified'), value: 'modified', align: 'right', },
|
||||
],
|
||||
options: {
|
||||
},
|
||||
@@ -243,6 +273,20 @@
|
||||
show: false,
|
||||
name: "",
|
||||
},
|
||||
uploadSnackbar: {
|
||||
status: false,
|
||||
filename: "",
|
||||
percent: 0,
|
||||
speed: 0,
|
||||
total: 0,
|
||||
number: 0,
|
||||
max: 0,
|
||||
cancelTokenSource: "",
|
||||
lastProgress: {
|
||||
time: 0,
|
||||
loaded: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -251,6 +295,7 @@
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
countPerPage: {
|
||||
get: function() {
|
||||
@@ -337,7 +382,7 @@
|
||||
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
if (dirArray.length === 1 && this.currentPath === "") {
|
||||
this.files = this.files.filter(element => element.filename !== "gcodes");
|
||||
this.files = this.files.filter(element => !["gcodes", "docs"].includes(element.filename))
|
||||
}
|
||||
|
||||
if (!this.showHiddenFiles) {
|
||||
@@ -367,7 +412,7 @@
|
||||
clickRowGoBack: function() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
|
||||
},
|
||||
saveFile: function() {
|
||||
saveFile: function(boolRestart = false) {
|
||||
let file = new File([this.editor.sourcecode], this.editor.item.filename);
|
||||
|
||||
let formData = new FormData();
|
||||
@@ -383,6 +428,13 @@
|
||||
this.$toast.success("File '"+this.editor.item.filename+"' successfully saved.");
|
||||
this.editor.show = false;
|
||||
this.editor.sourcecode = "";
|
||||
|
||||
if (boolRestart && this.editor.item.filename === "moonraker.conf") {
|
||||
this.$socket.sendObj('machine.services.restart', { service: "moonraker" })
|
||||
} else if (boolRestart) {
|
||||
this.$store.commit('server/addEvent', { message: "FIRMWARE_RESTART", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" })
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error save "+this.editor.item.filename);
|
||||
});
|
||||
@@ -401,7 +453,7 @@
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
link.download = name;
|
||||
link.href = '//' + this.hostname + ':' + this.port + '/server/files/' + filename;
|
||||
link.href = '//' + this.hostname + ':' + this.port + '/server/files' + filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
@@ -453,14 +505,7 @@
|
||||
}, 'files/getMove');
|
||||
},
|
||||
removeFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
axios.delete(
|
||||
'//'+ 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.");
|
||||
});
|
||||
this.$socket.sendObj('server.files.delete_file', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteFile');
|
||||
},
|
||||
deleteDirectoryAction: function() {
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteDir');
|
||||
@@ -468,30 +513,75 @@
|
||||
uploadFileButton: function() {
|
||||
this.$refs.fileUpload.click()
|
||||
},
|
||||
uploadFile: function() {
|
||||
async uploadFile() {
|
||||
if (this.$refs.fileUpload.files.length) {
|
||||
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
|
||||
this.$refs.fileUpload.value = ''
|
||||
})
|
||||
this.$store.commit('socket/addLoading', { name: 'configFileUpload' })
|
||||
let successFiles = []
|
||||
this.uploadSnackbar.number = 0
|
||||
this.uploadSnackbar.max = this.$refs.fileUpload.files.length
|
||||
for (const file of this.$refs.fileUpload.files) {
|
||||
this.uploadSnackbar.number++
|
||||
const result = await this.doUploadFile(file)
|
||||
successFiles.push(result)
|
||||
}
|
||||
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' })
|
||||
for(const file of successFiles) {
|
||||
this.$toast.success("Upload of "+file+" successful!")
|
||||
}
|
||||
|
||||
this.$refs.fileUpload.value = ''
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
let toast = this.$toast;
|
||||
let formData = new FormData();
|
||||
let filename = file.name.replace(" ", "_");
|
||||
|
||||
this.uploadSnackbar.filename = filename
|
||||
this.uploadSnackbar.status = true
|
||||
this.uploadSnackbar.percent = 0
|
||||
this.uploadSnackbar.speed = 0
|
||||
this.uploadSnackbar.lastProgress.loaded = 0
|
||||
this.uploadSnackbar.lastProgress.time = 0
|
||||
|
||||
formData.append('root', 'config');
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7));
|
||||
this.$store.commit('socket/addLoading', { name: 'configFileUpload' });
|
||||
|
||||
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, { headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
).then((result) => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' });
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
}).catch(() => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' });
|
||||
toast.error("Cannot upload the file!");
|
||||
});
|
||||
return new Promise(resolve => {
|
||||
this.uploadSnackbar.cancelTokenSource = axios.CancelToken.source();
|
||||
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
cancelToken: this.uploadSnackbar.cancelTokenSource.token,
|
||||
onUploadProgress: (progressEvent) => {
|
||||
this.uploadSnackbar.percent = (progressEvent.loaded * 100) / progressEvent.total
|
||||
if (this.uploadSnackbar.lastProgress.time) {
|
||||
const time = progressEvent.timeStamp - this.uploadSnackbar.lastProgress.time
|
||||
const data = progressEvent.loaded - this.uploadSnackbar.lastProgress.loaded
|
||||
|
||||
if (time) this.uploadSnackbar.speed = data / (time / 1000)
|
||||
}
|
||||
|
||||
this.uploadSnackbar.lastProgress.time = progressEvent.timeStamp
|
||||
this.uploadSnackbar.lastProgress.loaded = progressEvent.loaded
|
||||
this.uploadSnackbar.total = progressEvent.total
|
||||
}
|
||||
}
|
||||
).then((result) => {
|
||||
this.uploadSnackbar.status = false
|
||||
resolve(result.data.result)
|
||||
}).catch(() => {
|
||||
this.uploadSnackbar.status = false
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' });
|
||||
toast.error("Cannot upload the file!");
|
||||
})
|
||||
})
|
||||
},
|
||||
cancelUpload: function() {
|
||||
this.uploadSnackbar.cancelTokenSource.cancel()
|
||||
this.uploadSnackbar.status = false
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -6,30 +6,33 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t('Setting.Console') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="hideWaitTemperatures" label="Hide temperatures" hide-details class="mt-1"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolCustomFilters" label="Custom filter" hide-details class="mt-1"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="boolCustomFilters">
|
||||
<v-col class="">
|
||||
<v-textarea
|
||||
outlined
|
||||
label="Rules"
|
||||
v-model="customFilters"
|
||||
hide-details
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="hideWaitTemperatures" :label="$t('Setting.HideTemperatures')" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolCustomFilters" :label="$t('Setting.CustomFilter')" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="boolCustomFilters">
|
||||
<v-col class="py-2">
|
||||
<v-textarea
|
||||
outlined
|
||||
:label="$t('Setting.Rules')"
|
||||
v-model="customFilters"
|
||||
hide-details
|
||||
class="mb-2"
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<style>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Setting.ControlExtruder') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
:label="$t('Setting.FeedrateXY')"
|
||||
v-model="feedrateXY"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
></v-text-field>
|
||||
<v-text-field
|
||||
:label="$t('Setting.FeedrateZ')"
|
||||
v-model="feedrateZ"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
feedrateXY: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateXY
|
||||
},
|
||||
set(value) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: value } } })
|
||||
}
|
||||
},
|
||||
feedrateZ: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateZ
|
||||
},
|
||||
set(value) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateZ: value } } })
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,32 +1,32 @@
|
||||
<style>
|
||||
.settings_dashboard_switch .v-messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>Dashbaord</span>
|
||||
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>{{ $t('Setting.Dashboard') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowWebcamOnDashboard" label="Webcam" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowTempchartOnDashboard" label="Tempchart" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowConsoleOnDashboard" label="Console" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolShowWebcamOnDashboard" :label="$t('Setting.Webcam')" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolShowTempchartOnDashboard" :label="$t('Setting.Tempchart')" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolShowConsoleOnDashboard" :label="$t('Setting.Console')" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -2,23 +2,23 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>Endstops</span>
|
||||
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>{{ $t('Setting.Endstops')}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pb-0">
|
||||
<div v-for="(status, index) of sortEndstops" v-bind:key="index">
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
|
||||
<v-container px-0 py-0>
|
||||
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
|
||||
<v-col>
|
||||
<label class="mt-1 d-inline-block">{{ $t('Setting.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 v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
||||
<v-col class="py-0">
|
||||
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
||||
<v-col>
|
||||
<p>{{ $t('Setting.EndstopInfo')}}</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
@@ -8,18 +8,14 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-cog</v-icon>General</span>
|
||||
<span class="subheading"><v-icon left>mdi-cog</v-icon>{{ $t('Setting.General') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-row>
|
||||
<v-col class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
v-model="printerName"
|
||||
label="Printer Name"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
v-model="printerName"
|
||||
:label="$t('Setting.PrinterName')"
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-translate</v-icon>{{ $t('Setting.Language') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-select
|
||||
v-model="lang"
|
||||
@change="changeLanguage"
|
||||
:items="items"
|
||||
:label="$t('Setting.Language')"
|
||||
></v-select>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
items: [
|
||||
{
|
||||
text: "English",
|
||||
value: "en"
|
||||
},
|
||||
{
|
||||
text: "简体中文",
|
||||
value: "zh"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lang: {
|
||||
get() {
|
||||
return localStorage.getItem("lang")
|
||||
},
|
||||
set(newName){
|
||||
return localStorage.setItem("lang",newName)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeLanguage(val){
|
||||
this.$i18n.locale = this.lang = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,16 +2,16 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</span>
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Setting.MachineLimits')}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||
<tool-slider :label="$t('Setting.Velocity')" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||
<tool-slider :label="$t('Setting.Acceleration')" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<tool-slider :label="$t('Setting.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
<tool-slider :label="$t('Setting.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>Logfiles</span>
|
||||
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>{{ $t("Setting.Logfiles")}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text :class="'text-center text-lg-left py-0'">
|
||||
<v-row>
|
||||
<v-col :class="'col-12' +(klippy_state !== 'ready' ? 'col-md-6' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper</v-btn>
|
||||
</v-col>
|
||||
<v-col :class="'col-12 pt-0 ' +(klippy_state !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container pb-0 px-0>
|
||||
<v-row>
|
||||
<v-col :class="'col-12' +(klippy_state !== 'ready' ? 'col-md-6' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper</v-btn>
|
||||
</v-col>
|
||||
<v-col :class="'col-12 pt-0 ' +(klippy_state !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -3,17 +3,17 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>Macros</span>
|
||||
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Setting.Macros') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<div v-for="(macro, index) in this['printer/getAllMacros']" v-bind:key="index">
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-container px-0 py-0>
|
||||
<v-row v-for="(macro, index) in this['printer/getAllMacros']" v-bind:key="index">
|
||||
<v-col class="py-2">
|
||||
<settings-macro-switch :name="macro.name"></settings-macro-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,345 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-fire</v-icon>{{ $t('Setting.PreheatPresets') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-container>
|
||||
<v-row v-for="(preset, index) in this['gui/getPreheatPresets']" v-bind:key="index">
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
|
||||
<v-row align="center">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ preset.name }}</strong>
|
||||
</v-col>
|
||||
<v-col class="col-6">
|
||||
<div v-for="[key, value] in Object.entries(preset.values)" v-bind:key="key">
|
||||
<span class="text-no-wrap" v-if="value.bool" >{{ convertPresetName(key, value) }}: {{ value.value }}°C</span>
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col class="col-auto text-right"><v-btn small class="minwidth-0 float-right" v-on:click.stop.prevent="editPreset(preset)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
|
||||
<v-row align="center">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ $t('Setting.Cooldown')}}</strong>
|
||||
</v-col>
|
||||
<v-col class="col-auto text-right"><v-btn small class="minwidth-0 float-right" v-on:click.stop.prevent="editCooldown"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="createPreset">{{ $t('Setting.AddPreset')}}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="dialog.bool" persistent :width="600">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-fire" left></v-icon>
|
||||
{{ dialog.index === null ? $t('Setting.Create') : $t('Setting.Edit') }} {{ $t('Setting.Preset') }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="dialog.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-3">
|
||||
<v-container class="pb-0">
|
||||
<v-form
|
||||
v-model="dialog.valid"
|
||||
@submit.prevent="savePreset"
|
||||
>
|
||||
<template v-if="dialog.bool">
|
||||
<v-row>
|
||||
<v-col class="col-6">
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-text-field
|
||||
v-model="dialog.name"
|
||||
:label="$t('Setting.Name')"
|
||||
hide-details="auto"
|
||||
:rules="[rules.required, rules.unique]"
|
||||
dense
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-2 mx-0 mb-2" v-for="(heater) of this['printer/getHeaters']" v-bind:key="heater.name" align="center">
|
||||
<v-checkbox
|
||||
v-model="dialog.values[heater.name].bool"
|
||||
hide-details
|
||||
class="shrink mt-0"
|
||||
></v-checkbox>
|
||||
<v-text-field
|
||||
v-model="dialog.values[heater.name].value"
|
||||
:label="convertName(heater.name)"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
suffix="°C"
|
||||
></v-text-field>
|
||||
</v-row>
|
||||
<v-row class="mt-2 mx-0 mb-2" v-for="(fan) of this['printer/getTemperatureFans']" v-bind:key="'temperature_fan '+fan.name" align="center">
|
||||
<v-checkbox
|
||||
v-model="dialog.values['temperature_fan '+fan.name].bool"
|
||||
hide-details
|
||||
class="shrink mt-0"
|
||||
></v-checkbox>
|
||||
<v-text-field
|
||||
v-model="dialog.values['temperature_fan '+fan.name].value"
|
||||
:label="convertName(fan.name)"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
suffix="°C"
|
||||
></v-text-field>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="col-6">
|
||||
<v-textarea
|
||||
outlined
|
||||
name="input-7-4"
|
||||
:label="$t('Setting.CustomGCode')"
|
||||
v-model="dialog.gcode"
|
||||
hide-details="auto"
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="dialog.boolInvalidMin">
|
||||
<v-col class="py-0">
|
||||
<v-alert dense text type="error">{{ $t('Setting.PresetInfo')}}</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3">
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
color="red"
|
||||
outlined
|
||||
class="float-left minwidth-0"
|
||||
@click="deletePreset"
|
||||
v-if="this.dialog.index !== null"
|
||||
>
|
||||
<v-icon>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
:class="dialog.index !== null ? 'float-right' : '' "
|
||||
type="submit"
|
||||
>
|
||||
{{ dialog.index === null ? $t('Setting.Store') : $t('Setting.Update') }} {{ $t('Setting.Preset') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-form>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="cooldownDialog.bool" persistent :width="300">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-fire" left></v-icon> {{ $t('Setting.EditCooldown')}}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="cooldownDialog.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-3">
|
||||
<v-container class="pb-0">
|
||||
<v-form
|
||||
v-model="cooldownDialog.valid"
|
||||
@submit.prevent="saveCooldown"
|
||||
>
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-textarea
|
||||
outlined
|
||||
name="input-7-4"
|
||||
:label="$t('Setting.CustomGCode')"
|
||||
v-model="cooldownDialog.gcode"
|
||||
:rules="[rules.required]"
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
type="submit"
|
||||
>
|
||||
{{ $t('Setting.UpdateCooldown')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-form>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import {convertName} from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
dialog: {
|
||||
bool: false,
|
||||
valid: false,
|
||||
name: "",
|
||||
gcode: "",
|
||||
index: null,
|
||||
boolInvalidMin: false,
|
||||
values: {},
|
||||
},
|
||||
rules: {
|
||||
required: (value) => value !== '' || 'required',
|
||||
unique: (value) => !this.existsPresetName(value) || 'Name already exists',
|
||||
},
|
||||
cooldownDialog: {
|
||||
bool: false,
|
||||
gcode: "",
|
||||
valid: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
orgState: state => state.gui.presets,
|
||||
cooldownGcode: state => state.gui.cooldownGcode,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getHeaters',
|
||||
'printer/getTemperatureFans',
|
||||
'gui/getPreheatPresets',
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
this.clearDialog()
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
convertPresetName(name, value) {
|
||||
if (value.type === "temperature_fan") name = name.replace("temperature_fan ", "")
|
||||
|
||||
return this.convertName(name)
|
||||
},
|
||||
existsPresetName(name) {
|
||||
return (this["gui/getPreheatPresets"].findIndex((preset) => preset.name === name && preset.index !== this.dialog.index) >= 0)
|
||||
},
|
||||
createPreset() {
|
||||
this.clearDialog()
|
||||
this.dialog.bool = true
|
||||
},
|
||||
clearDialog() {
|
||||
this.dialog.bool = false
|
||||
this.dialog.index = null
|
||||
this.dialog.name = ""
|
||||
this.dialog.gcode = ""
|
||||
this.dialog.boolInvalidMin = false
|
||||
this.dialog.values = {}
|
||||
|
||||
for(const heater of this["printer/getHeaters"]) {
|
||||
this.dialog.values[heater.name] = {
|
||||
bool: true,
|
||||
value: 0,
|
||||
type: 'heater',
|
||||
}
|
||||
}
|
||||
|
||||
for(const fan of this["printer/getTemperatureFans"]) {
|
||||
this.dialog.values['temperature_fan '+fan.name] = {
|
||||
bool: true,
|
||||
value: 0,
|
||||
type: 'temperature_fan',
|
||||
}
|
||||
}
|
||||
},
|
||||
editPreset(preset) {
|
||||
this.dialog.name = preset.name
|
||||
this.dialog.index = preset.index
|
||||
this.dialog.gcode = preset.gcode
|
||||
this.dialog.values = {}
|
||||
|
||||
for(const heater of this["printer/getHeaters"]) {
|
||||
if (heater.name in preset.values) {
|
||||
this.dialog.values[heater.name] = {...preset.values[heater.name]}
|
||||
} else {
|
||||
this.dialog.values[heater.name] = {
|
||||
bool: false,
|
||||
value: 0,
|
||||
type: 'heater',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(const fan of this["printer/getTemperatureFans"]) {
|
||||
if ('temperature_fan '+fan.name in preset.values) {
|
||||
this.dialog.values['temperature_fan '+fan.name] = {...preset.values['temperature_fan '+fan.name]}
|
||||
} else {
|
||||
this.dialog.values['temperature_fan '+fan.name] = {
|
||||
bool: false,
|
||||
value: 0,
|
||||
type: 'temperature_fan',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.dialog.bool = true
|
||||
},
|
||||
savePreset() {
|
||||
let setValues = 0
|
||||
for (const key of Object.keys(this.dialog.values)) {
|
||||
if (this.dialog.values[key].bool) setValues++
|
||||
}
|
||||
if (this.dialog.gcode.length) setValues++
|
||||
|
||||
if (setValues === 0) this.dialog.boolInvalidMin = true
|
||||
else if (this.dialog.valid) {
|
||||
for (const key of Object.keys(this.dialog.values)) {
|
||||
this.dialog.values[key].value = parseInt(this.dialog.values[key].value)
|
||||
}
|
||||
|
||||
if (this.dialog.index) {
|
||||
this.$store.dispatch('gui/updatePreset', this.dialog )
|
||||
} else this.$store.dispatch('gui/addPreset', this.dialog )
|
||||
|
||||
this.clearDialog()
|
||||
}
|
||||
},
|
||||
deletePreset() {
|
||||
this.$store.dispatch('gui/deletePreset', this.dialog )
|
||||
this.clearDialog()
|
||||
},
|
||||
editCooldown() {
|
||||
this.cooldownDialog.gcode = this.cooldownGcode
|
||||
this.cooldownDialog.bool = true
|
||||
},
|
||||
saveCooldown() {
|
||||
if (this.cooldownDialog.valid) {
|
||||
this.$store.dispatch("gui/setSettings", {cooldownGcode: this.cooldownDialog.gcode})
|
||||
this.cooldownDialog.bool = false
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,339 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ $t('Setting.RemotePrinters') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-container>
|
||||
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
|
||||
<v-row align="center">
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
color="primary"
|
||||
v-if="printer.socket.isConnecting"
|
||||
></v-progress-circular>
|
||||
<v-icon
|
||||
:color="printer.socket.isConnected ? 'green' : 'red'"
|
||||
v-if="!printer.socket.isConnecting"
|
||||
>mdi-{{ printer.socket.isConnected ? 'checkbox-marked-circle' : 'cancel' }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>{{ printer.socket.hostname }}{{ parseInt(printer.socket.port) !== 80 ? ":"+printer.socket.port : "" }}</v-col>
|
||||
<v-col class="col-auto"><v-btn small class="minwidth-0" v-on:click.stop.prevent="editPrinter(index)"><v-icon small>mdi-pencil</v-icon></v-btn></v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="dialogAddPrinter.bool = true">{{ $t('Setting.AddPrinter')}}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="dialogAddPrinter.bool" persistent :width="400">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="dialogAddPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-3" v-if="remoteMode">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-8">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-4">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.port"
|
||||
:rules="[v => !!v || 'Port is required']"
|
||||
label="Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-3" v-if="!remoteMode">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-6">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.webPort"
|
||||
:rules="[v => !!v || 'Web-Port is required']"
|
||||
label="Web-Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-6">
|
||||
<v-text-field
|
||||
v-model="dialogAddPrinter.port"
|
||||
:rules="[v => !!v || 'API-Port is required']"
|
||||
label="API-Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogEditPrinter.bool" persistent :width="400">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
{{ $t('Setting.EditPrinter')}}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="dialogEditPrinter.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-3" v-if="remoteMode">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-8">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-4">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.port"
|
||||
:rules="[v => !!v || 'Port is required']"
|
||||
label="Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="">
|
||||
<v-btn
|
||||
color="red"
|
||||
outlined
|
||||
class="middle minwidth-0"
|
||||
@click="delPrinter"
|
||||
>
|
||||
<v-icon small>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t('Setting.UpdatePrinter')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-3" v-if="!remoteMode">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.hostname"
|
||||
:rules="[
|
||||
v => !!v || 'Hostname is required',
|
||||
v => !v.startsWith('http:') || 'invalid hostname/IP',
|
||||
v => !v.startsWith('https:') || 'invalid hostname/IP',
|
||||
]"
|
||||
label="Hostname/IP"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-6">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.webPort"
|
||||
:rules="[v => !!v || 'Web-Port is required']"
|
||||
label="Web-Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="col-6">
|
||||
<v-text-field
|
||||
v-model="dialogEditPrinter.port"
|
||||
:rules="[v => !!v || 'API-Port is required']"
|
||||
label="API-Port"
|
||||
required
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="">
|
||||
<v-btn
|
||||
color="red"
|
||||
outlined
|
||||
class="middle minwidth-0"
|
||||
@click="delPrinter"
|
||||
>
|
||||
<v-icon small>mdi-delete</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col class="text-right">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t('Setting.UpdatePrinter')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
dialogAddPrinter: {
|
||||
bool: false,
|
||||
hostname: "",
|
||||
port: "7125",
|
||||
webPort: "80"
|
||||
},
|
||||
dialogEditPrinter: {
|
||||
bool: false,
|
||||
hostname: "",
|
||||
port: "",
|
||||
webPort: "80",
|
||||
index: ""
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
protocol: state => state.socket.protocol,
|
||||
}),
|
||||
...mapGetters([
|
||||
'farm/getPrinters',
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
addPrinter() {
|
||||
this.$store.commit('farm/addPrinter',{
|
||||
hostname: this.dialogAddPrinter.hostname,
|
||||
port: this.dialogAddPrinter.port,
|
||||
webPort: this.dialogAddPrinter.webPort,
|
||||
protocol: this.protocol
|
||||
})
|
||||
|
||||
this.dialogAddPrinter.hostname = ""
|
||||
this.dialogAddPrinter.port = "7125"
|
||||
this.dialogAddPrinter.webPort = "80"
|
||||
this.dialogAddPrinter.bool = false
|
||||
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
},
|
||||
editPrinter(index) {
|
||||
this.dialogEditPrinter.hostname = this["farm/getPrinters"][index].socket.hostname
|
||||
this.dialogEditPrinter.port = this["farm/getPrinters"][index].socket.port
|
||||
this.dialogEditPrinter.webPort = this["farm/getPrinters"][index].socket.webPort
|
||||
this.dialogEditPrinter.index = index
|
||||
this.dialogEditPrinter.bool = true
|
||||
},
|
||||
updatePrinter() {
|
||||
this.$store.commit("farm/"+this.dialogEditPrinter.index+"/setSocketData", {
|
||||
hostname: this.dialogEditPrinter.hostname,
|
||||
port: this.dialogEditPrinter.port,
|
||||
webPort: this.dialogEditPrinter.webPort,
|
||||
isConnecting: true,
|
||||
})
|
||||
this.$store.dispatch("farm/"+this.dialogEditPrinter.index+"/reconnect")
|
||||
this.dialogEditPrinter.bool = false
|
||||
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
},
|
||||
delPrinter() {
|
||||
this.$store.commit("farm/removePrinter", { name: this.dialogEditPrinter.index })
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
this.dialogEditPrinter.bool = false
|
||||
|
||||
this.$store.dispatch("farm/savePrinters")
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -10,7 +10,7 @@
|
||||
<v-switch v-model="runout.enabled" hide-details @change="changeSensor(runout)" class="settingsRunoutSwitchInput my-0"></v-switch>
|
||||
</v-toolbar>
|
||||
<v-card-text v-if="runout.enabled">
|
||||
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? 'detected' : 'empty' }}</v-chip>
|
||||
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? $t('Setting.detected') : $t('Setting.Empty') }}</v-chip>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
@@ -37,7 +37,7 @@
|
||||
methods: {
|
||||
changeSensor(runout) {
|
||||
const gcode = 'SET_FILAMENT_SENSOR SENSOR='+runout.name+' ENABLE='+(runout.enabled ? 1 : 0)
|
||||
this.$store.commit('server/addEvent', gcode)
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,92 +2,66 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Update</span>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Setting.UpdateManager')}}</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
</template>
|
||||
<span>Check for updates</span>
|
||||
<span>{{ $t('Setting.CheckForUpdates')}}</span>
|
||||
</v-tooltip>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 pt-0 pb-0 content">
|
||||
<v-row v-if="'version' in klipper">
|
||||
<v-col class="pl-6 py-2 text-no-wrap">
|
||||
<strong>Klipper</strong><br />
|
||||
{{ klipper.version }}
|
||||
</v-col>
|
||||
<v-col class="pr-6 py-2 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getColor(klipper)"
|
||||
@click="updateKlipper"
|
||||
:disabled="is_disabled(klipper)"
|
||||
class="minwidth-0 mt-2 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getIcon(klipper) }}</v-icon>{{ getText(klipper) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<div v-if="'version' in moonraker">
|
||||
<v-divider class="mt-0 mb-0" ></v-divider>
|
||||
<v-row>
|
||||
<v-col class="pl-6 py-2 text-no-wrap">
|
||||
<strong>Moonraker</strong><br />
|
||||
{{ moonraker.version }}
|
||||
</v-col>
|
||||
<v-col class="pr-6 py-2 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getColor(moonraker)"
|
||||
@click="updateMoonraker"
|
||||
:disabled="is_disabled(moonraker)"
|
||||
class="minwidth-0 mt-2 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getIcon(moonraker) }}</v-icon>{{ getText(moonraker) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-if="mainsail !== false && 'version' in mainsail">
|
||||
<v-divider class="mt-0 mb-0" ></v-divider>
|
||||
<v-row>
|
||||
<v-col class="pl-6 py-2 text-no-wrap">
|
||||
<strong>Mainsail</strong><br />
|
||||
{{ 'v'+package_version }}
|
||||
<span v-if="!is_disabled(mainsail)"> > {{ mainsail.remote_version.replace('Version ', 'v') }}</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 py-2 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getColor(mainsail)"
|
||||
@click="updateMainsail"
|
||||
:disabled="is_disabled(mainsail)"
|
||||
class="minwidth-0 mt-2 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getIcon(mainsail) }}</v-icon>{{ getText(mainsail) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-divider class="mt-0 mb-0 border-top-2" ></v-divider>
|
||||
<v-row>
|
||||
<v-col class="pl-6 py-2 text-no-wrap">
|
||||
<strong>System</strong><br />
|
||||
OS-Packages
|
||||
</v-col>
|
||||
<v-col class="pr-6 py-2 text-right">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
color="gray"
|
||||
@click="updateSystem"
|
||||
class="minwidth-0 mt-2 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-progress-upload</v-icon>upgrade</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
|
||||
<div v-for="(value, key) of updateableSoftwares" v-bind:key="key">
|
||||
<v-divider class="my-0" ></v-divider>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
{{ 'name' in value ? value.name : key }}<br />
|
||||
{{ getVersionOutput(value) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
<strong>{{ $t('Setting.System')}}</strong><br />
|
||||
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} {{ $t('Setting.PackagesCanBeUpgraded')}}</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">{{ $t('Setting.OSPackages')}}</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
|
||||
@click="updateSystem"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -107,16 +81,14 @@
|
||||
computed: {
|
||||
...mapState({
|
||||
package_version: state => state.packageVersion,
|
||||
klipper: state => state.server.updateManager.klipper,
|
||||
moonraker: state => state.server.updateManager.moonraker,
|
||||
loadings: state => state.socket.loadings,
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
version_info: state => state.server.updateManager.version_info
|
||||
}),
|
||||
mainsail:{
|
||||
updateableSoftwares: {
|
||||
get() {
|
||||
if ('name' in this.$store.state.server.updateManager.client)
|
||||
return this.$store.state.server.updateManager.client
|
||||
|
||||
return false
|
||||
return this.$store.getters["server/updateManager/getUpdateableSoftwares"]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -125,82 +97,76 @@
|
||||
this.$store.commit('socket/addLoading', { name: 'loadingBtnSyncUpdateManager' });
|
||||
this.$socket.sendObj('machine.update.status', { refresh: true }, 'server/updateManager/getStatus')
|
||||
},
|
||||
getColor(object) {
|
||||
getBtnColor(object) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('detached' in object && object.detached) return 'orange'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'orange'
|
||||
if ('is_valid' in object && !object.is_valid) return 'red'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'red'
|
||||
|
||||
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'primary'
|
||||
|
||||
if ('name' in object && object.name === "mainsail") {
|
||||
let remote_version = object.remote_version.split(' ')
|
||||
remote_version = (remote_version.length > 1) ? remote_version[1] : remote_version[0]
|
||||
|
||||
if (this.package_version !== remote_version) return 'primary'
|
||||
}
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'primary'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
|
||||
return 'red'
|
||||
},
|
||||
getText(object) {
|
||||
getBtnText(object) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('detached' in object && object.detached) return 'detached'
|
||||
if ('is_valid' in object && !object.is_valid) return 'invalid'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'dirty'
|
||||
|
||||
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'update'
|
||||
|
||||
if ('name' in object && object.name === "mainsail") {
|
||||
let remote_version = object.remote_version.split(' ')
|
||||
remote_version = (remote_version.length > 1) ? remote_version[1] : remote_version[0]
|
||||
|
||||
if (this.package_version !== remote_version) return 'update'
|
||||
}
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'update'
|
||||
|
||||
return 'up-to-date'
|
||||
}
|
||||
|
||||
return 'ERROR'
|
||||
},
|
||||
getIcon(object) {
|
||||
getBtnIcon(object) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('detached' in object && object.detached) return 'alert-circle'
|
||||
if ('is_valid' in object && !object.is_valid) return 'alert-circle'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'alert-circle'
|
||||
|
||||
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return 'progress-upload'
|
||||
|
||||
if ('name' in object && object.name === "mainsail") {
|
||||
let remote_version = object.remote_version.split(' ')
|
||||
remote_version = (remote_version.length > 1) ? remote_version[1] : remote_version[0]
|
||||
|
||||
if (this.package_version !== remote_version) return 'progress-upload'
|
||||
}
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'progress-upload'
|
||||
|
||||
return 'check'
|
||||
}
|
||||
|
||||
return 'ERROR'
|
||||
},
|
||||
is_disabled(object) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('current_hash' in object && 'remote_hash' in object && object.current_hash !== object.remote_hash) return false
|
||||
getBtnDisabled(object) {
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return true
|
||||
if ('detached' in object && object.detached) return true
|
||||
|
||||
if ('name' in object && object.name === "mainsail") {
|
||||
if ('v'+this.package_version !== object.remote_version.replace('Version ', 'v')) return false
|
||||
}
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('is_valid' in object && !object.is_valid) return true
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return false
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
updateKlipper() {
|
||||
this.$socket.sendObj('machine.update.klipper', { })
|
||||
getVersionOutput(object) {
|
||||
const local_version = 'version' in object ? object.version : '?'
|
||||
const remote_version = 'remote_version' in object ? object.remote_version : '?'
|
||||
|
||||
let output = ""
|
||||
if ('remote_alias' in object && object.remote_alias !== "origin") output += object.remote_alias
|
||||
if ('branch' in object && object.branch !== "master") {
|
||||
if (output !== "") output += "/"
|
||||
|
||||
output += object.branch
|
||||
}
|
||||
if (output !== "") output += ": "
|
||||
|
||||
output += local_version !== remote_version ? local_version+" > "+remote_version : local_version
|
||||
|
||||
return output
|
||||
},
|
||||
updateMoonraker() {
|
||||
this.$socket.sendObj('machine.update.moonraker', { })
|
||||
},
|
||||
updateMainsail() {
|
||||
this.$socket.sendObj('machine.update.client', { })
|
||||
updateModule(key) {
|
||||
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
|
||||
else this.$socket.sendObj('machine.update.client', { name: key })
|
||||
},
|
||||
updateSystem() {
|
||||
this.$socket.sendObj('machine.update.system', { })
|
||||
|
||||
@@ -1,47 +1,49 @@
|
||||
<style>
|
||||
.content { overflow: hidden; }
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-text-field
|
||||
v-model="webcamUrl"
|
||||
hide-details
|
||||
label="Webcam URL"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="rotationEnabled">
|
||||
<v-col class="py-0" col-auto>
|
||||
<v-switch v-model="rotate" hide-details label="Rotate"></v-switch>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="flipX" hide-details label="Flip webcam horizontally"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="flipY" hide-details label="Flip webcam vertically"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolNavi" hide-details label="Show in navigation"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="pt-2 mb-1">
|
||||
<v-text-field
|
||||
v-model="webcamUrl"
|
||||
hide-details
|
||||
:label="$t('Setting.WebcamURL')"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="rotationEnabled">
|
||||
<v-col class="py-2" col-auto>
|
||||
<v-switch v-model="rotate" hide-details :label="$t('Setting.Rotate')" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="flipX" hide-details :label="$t('Setting.FlipWebcamHorizontally')" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="flipY" hide-details :label="$t('Setting.FlipWebcamVertically')" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolNavi" hide-details :label="$t('Setting.ShowInNavigation')" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
import GeneralPanel from './GeneralPanel'
|
||||
import ControlPanel from './ControlPanel'
|
||||
import WebcamPanel from './WebcamPanel'
|
||||
import DashboardPanel from "./DashboardPanel";
|
||||
import ConsolePanel from "./ConsolePanel";
|
||||
@@ -11,8 +12,12 @@ import ConfigFilesPanel from "./ConfigFilesPanel";
|
||||
import RunoutPanel from "./RunoutPanel";
|
||||
import LogfilesPanel from "./LogfilesPanel";
|
||||
import UpdatePanel from "./UpdatePanel";
|
||||
import RemotePrintersPanel from "./RemotePrintersPanel";
|
||||
import PresetsPanel from "./PresetsPanel";
|
||||
import LanguagePanel from "./LanguagePanel";
|
||||
|
||||
Vue.component('settings-general-panel', GeneralPanel);
|
||||
Vue.component('settings-control-panel', ControlPanel);
|
||||
Vue.component('settings-webcam-panel', WebcamPanel);
|
||||
Vue.component('settings-dashboard-panel', DashboardPanel);
|
||||
Vue.component('settings-console-panel', ConsolePanel);
|
||||
@@ -23,6 +28,9 @@ Vue.component('settings-runout-panel', RunoutPanel);
|
||||
Vue.component('settings-logfiles-panel', LogfilesPanel);
|
||||
Vue.component('settings-config-files-panel', ConfigFilesPanel);
|
||||
Vue.component('settings-update-panel', UpdatePanel);
|
||||
Vue.component('settings-remote-printers-panel', RemotePrintersPanel);
|
||||
Vue.component('settings-presets-panel', PresetsPanel);
|
||||
Vue.component('settings-language-panel', LanguagePanel);
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
@@ -17,114 +17,203 @@
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading align-baseline">
|
||||
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown") }}
|
||||
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : $t("Dashboard.Unknown")) }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')" title="Pause print"><v-icon small>mdi-pause</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob" title="Cancel print"><v-icon small>mdi-stop</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob" title="Resume job"><v-icon small>mdi-play</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'error')" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob" title="Clear job"><v-icon small>mdi-close</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="(printer_state === 'complete')" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob" title="Reprint job"><v-icon small>mdi-autorenew</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-pause</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.PausePrint") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.CancelPrint") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-play</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ResumePrint") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-broom</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ClearPrintStats") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-printer</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ReprintJob") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-row v-if="current_filename" class="mx-0">
|
||||
<v-col class="col-auto py-3 pr-0">
|
||||
<v-progress-circular
|
||||
:rotate="-90"
|
||||
:size="50"
|
||||
:width="7"
|
||||
:value="printPercent * 100"
|
||||
color="red"
|
||||
>
|
||||
</v-progress-circular>
|
||||
</v-col>
|
||||
<v-col class="col py-3" style="width: 100px;">
|
||||
<h3 class="font-weight-regular">{{ Math.round(printPercent * 100)+"%" }}{{ display_message ? " - "+display_message : "" }}</h3>
|
||||
<span class="subtitle-2 text-truncate d-block px-0 text--disabled"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ current_filename }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="mt-0 mb-0" ></v-divider>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-container v-if="current_filename ">
|
||||
<v-row>
|
||||
<v-col
|
||||
class="col-12 col-sm-4 pl-sm-3 pt-0 pr-sm-0 pb-0"
|
||||
v-if="
|
||||
['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400)
|
||||
">
|
||||
<img
|
||||
class="statusPanel-image-preview"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
|
||||
/>
|
||||
<v-col class="col-auto pr-0 py-2">
|
||||
<v-progress-circular
|
||||
:rotate="-90"
|
||||
:size="50"
|
||||
:width="7"
|
||||
:value="Math.round(printPercent * 100)"
|
||||
color="red"
|
||||
>
|
||||
</v-progress-circular>
|
||||
</v-col>
|
||||
<v-col
|
||||
:class="
|
||||
(['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 py-0 col-sm-8 pl-sm-0' : 'col-12 py-0'
|
||||
">
|
||||
<v-row class="text-center pt-2" align="center">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-axis-arrow</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>X</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Y</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Z</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[2].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="my-2" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)"></v-divider>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-poll</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ filament_used > 1000 ? (filament_used / 1000).toFixed(2)+"m" : filament_used.toFixed(2)+"mm" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Print</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time) }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Total</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time_total) }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="my-2" v-if="['printing', 'paused', 'error'].includes(printer_state)"></v-divider>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-clock-outline</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>File</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ print_time > 0 && printPercent > 0 ? formatTime(print_time / printPercent - print_time) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ (filament_used > 0 && 'filament_total' in current_file && current_file.filament_total > filament_used) ? formatTime(print_time / (filament_used / current_file.filament_total) - print_time) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Slicer</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ 'estimated_time' in current_file && current_file.estimated_time > print_time ? formatTime(current_file.estimated_time - print_time) : '--'}}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-col class="col py-2" style="width: 100px;">
|
||||
<h3 class="font-weight-regular">{{ Math.round(printPercent * 100)+"%" }}{{ printer_state !== "error" ? (display_message ? " - "+display_message : "") : print_stats_message }}</h3>
|
||||
<span class="subtitle-2 text-truncate d-block px-0 text--disabled"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ current_filename }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<v-divider v-if="current_filename " class="mt-0 mb-0" ></v-divider>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col
|
||||
class="col-12 col-sm-4 pl-sm-0 pt-0 pr-sm-0 pb-0"
|
||||
v-if="
|
||||
['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400)
|
||||
">
|
||||
<img
|
||||
class="statusPanel-image-preview"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
:class="
|
||||
(['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 col-sm-8' : 'col-12'
|
||||
">
|
||||
<v-row class="text-center" align="center">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-icon>mdi-axis-arrow</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>X</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>Y</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>Z</strong></v-col></v-row>
|
||||
<v-row>
|
||||
<v-col class="px-0 pt-1">
|
||||
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ position.length ? position[2].toFixed(2) : "--" }}</span>
|
||||
</template>
|
||||
<span v-if="gcode_position !== undefined && gcode_position.length >= 3">G-Code: {{ gcode_position[2].toFixed(2) }}mm</span>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-icon>mdi-poll</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
|
||||
<v-row>
|
||||
<v-col class="px-0 pt-1">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on" v-if="filament_used >= 1000" class=" text-no-wrap">{{ (filament_used / 1000).toFixed(2) }} m</span>
|
||||
<span v-bind="attrs" v-on="on" v-if="filament_used < 1000" class=" text-no-wrap">{{ filament_used.toFixed(2) }} mm</span>
|
||||
</template>
|
||||
<span v-if="'filament_total' in current_file">{{ (filament_used / 1000).toFixed(2) }} / {{ (current_file.filament_total / 1000).toFixed(2) }}m = {{ ( 100 / current_file.filament_total * filament_used).toFixed(0) }}% </span>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Print") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time) }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Total") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time_total) }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) && 'filament_total' in current_file ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-icon>mdi-printer-3d</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Speed") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ (requested_speed / 60).toFixed(0) }} mm/s</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Layer") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.ETA") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-icon>mdi-clock-outline</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2 ">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.File") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Slicer") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -142,6 +231,8 @@
|
||||
...mapState({
|
||||
toolhead: state => state.printer.toolhead,
|
||||
position: state => state.printer.toolhead.position,
|
||||
gcode_position: state => state.printer.gcode_move.gcode_position,
|
||||
requested_speed: state => state.printer.gcode_move.speed,
|
||||
|
||||
printProgress: state => state.printer.virtual_sdcard.progress,
|
||||
file_position: state => state.printer.virtual_sdcard.file_position,
|
||||
@@ -152,6 +243,7 @@
|
||||
filament_used: state => state.printer.print_stats.filament_used,
|
||||
current_filename: state => state.printer.print_stats.filename,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
print_stats_message: state => state.printer.print_stats.message,
|
||||
|
||||
display_message: state => state.printer.display_status.message,
|
||||
loadings: state => state.socket.loadings,
|
||||
@@ -160,6 +252,90 @@
|
||||
get() {
|
||||
return this.$store.getters["printer/getPrintPercent"];
|
||||
}
|
||||
},
|
||||
max_layers: {
|
||||
get() {
|
||||
if (
|
||||
'first_layer_height' in this.current_file &&
|
||||
'layer_height' in this.current_file &&
|
||||
'object_height' in this.current_file
|
||||
) {
|
||||
const max = Math.ceil((this.current_file.object_height - this.current_file.first_layer_height) / this.current_file.layer_height + 1)
|
||||
return max > 0 ? max : 0
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
current_layer: {
|
||||
get() {
|
||||
if (
|
||||
this.print_time > 0 &&
|
||||
'first_layer_height' in this.current_file &&
|
||||
'layer_height' in this.current_file &&
|
||||
this.gcode_position !== undefined &&
|
||||
this.gcode_position.length >= 3
|
||||
) {
|
||||
let current_layer = Math.ceil((this.gcode_position[2] - this.current_file.first_layer_height) / this.current_file.layer_height + 1)
|
||||
current_layer = (current_layer <= this.max_layers) ? current_layer : this.max_layers
|
||||
|
||||
return current_layer > 0 ? current_layer : 0
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
estimated_time_file: {
|
||||
get() {
|
||||
if (this.print_time > 0 && this.printPercent > 0) {
|
||||
return (this.print_time / this.printPercent - this.print_time).toFixed(0)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
estimated_time_filament: {
|
||||
get() {
|
||||
if (this.filament_used > 0 && 'filament_total' in this.current_file && this.current_file.filament_total > this.filament_used) {
|
||||
return (this.print_time / (this.filament_used / this.current_file.filament_total) - this.print_time).toFixed(0)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
estimated_time_slicer: {
|
||||
get() {
|
||||
if ('estimated_time' in this.current_file && this.current_file.estimated_time > this.print_time) {
|
||||
return (this.current_file.estimated_time - this.print_time).toFixed(0)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
},
|
||||
eta: {
|
||||
get() {
|
||||
let time = 0
|
||||
let timeCount = 0
|
||||
|
||||
if (this.estimated_time_file > 0) {
|
||||
time += parseInt(this.estimated_time_file)
|
||||
timeCount++
|
||||
}
|
||||
|
||||
if (this.estimated_time_filament > 0) {
|
||||
time += parseInt(this.estimated_time_filament)
|
||||
timeCount++
|
||||
}
|
||||
|
||||
if (this.estimated_time_slicer > 0) {
|
||||
time += parseInt(this.estimated_time_slicer)
|
||||
timeCount++
|
||||
}
|
||||
|
||||
if (time && timeCount) return Date.now() + (time / timeCount) * 1000
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -191,6 +367,13 @@
|
||||
|
||||
return h+':'+m+':'+s;
|
||||
},
|
||||
formatDateTime(msec) {
|
||||
const date = new Date(msec)
|
||||
const h = date.getHours() >= 10 ? date.getHours() : "0"+date.getHours()
|
||||
const m = date.getMinutes() >= 10 ? date.getMinutes() : "0"+date.getMinutes()
|
||||
|
||||
return h+":"+m
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -6,88 +6,235 @@
|
||||
.colHeaterIcons {
|
||||
width: 68px;
|
||||
}
|
||||
|
||||
.canvasjs-chart-tooltip>div {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-row align="center">
|
||||
<v-col class="py-0 font-weight-bold" style="padding-left: 68px;">Name</v-col>
|
||||
<v-col class="py-0 text-center font-weight-bold d-none d-sm-block">State</v-col>
|
||||
<v-col class="py-0 text-center font-weight-bold">Current</v-col>
|
||||
<v-col class="text-center py-0 pr-8 font-weight-bold">Target</v-col>
|
||||
</v-row>
|
||||
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-0 font-weight-bold">{{ heater.name }}</v-col>
|
||||
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
|
||||
<v-col class="py-0 text-center">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</v-col>
|
||||
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(fan, index) in this['printer/getTemperatureFans']" v-bind:key="index+99" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-0 font-weight-bold">{{ fan.name }}</v-col>
|
||||
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-0 text-center">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</v-col>
|
||||
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(sensor,index) in this['printer/getTemperatureSensors']" v-bind:key="index+999">
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon color="grey darken-2" :title="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-0 font-weight-bold">{{ sensor.name }}</v-col>
|
||||
<v-col class="py-0 d-none d-sm-block"><span> </span></v-col>
|
||||
<v-col class="py-0 text-center">
|
||||
<v-tooltip top>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Dashboard.Temperatures") }}</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].length">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span
|
||||
style="cursor: default;"
|
||||
class=" px-0"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Dashboard.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
|
||||
</template>
|
||||
<span>min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
<v-col class="text-center py-0 pr-8 vertical_align_center"><span> </span></v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
|
||||
<v-row v-if="boolTempchart">
|
||||
<v-col class="px-8">
|
||||
<temp-chart ></temp-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item v-for="preset of this['gui/getPreheatPresets']" v-bind:key="preset.index" link @click="preheat(preset)">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>mdi-fire</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title v-text="preset.name"></v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-divider></v-divider>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="cooldown()">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>mdi-snowflake</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t("Dashboard.Cooldown") }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Dashboard.Cooldown") }}</v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupTemperatures')">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Dashboard.ShowChart')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Dashboard.AutoscaleChart')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-container class="px-0">
|
||||
<v-row align="center">
|
||||
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Dashboard.Name") }}</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Dashboard.State") }}</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold">{{ $t("Dashboard.Current") }}</v-col>
|
||||
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Dashboard.Target") }}</v-col>
|
||||
</v-row>
|
||||
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="pl-8 pr-0 flex-grow-0 py-2 colHeaterIcons">
|
||||
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(heater)">{{ convertName(heater.name) }}</span></v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</span>
|
||||
<span v-for="(values, key) of heater.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" :items="heater.presets" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(fan, index) in temperatureFans" v-bind:key="index+99" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(fan)">{{ convertName(fan.name) }}</span></v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span>
|
||||
<span v-for="(values, key) of fan.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" :items="fan.presets" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(sensor,index) in temperatureSensors" v-bind:key="index+999">
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon color="grey darken-2" :title="$t('Dashboard.Min')+sensor.min_temp+'° / ' + $t('Dashboard.Max')+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold">
|
||||
<span style="cursor: pointer;" @click="openHeater(sensor)">{{ convertName(sensor.name) }}</span>
|
||||
</v-col>
|
||||
<v-col class="py-2 d-none d-sm-block"><span> </span></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span
|
||||
style="cursor: default;"
|
||||
class="d-block px-0"
|
||||
v-bind="attrs"
|
||||
v-on="on"
|
||||
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
</template>
|
||||
<span>{{ $t('Dashboard.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />{{ $t('Dashboard.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
</v-tooltip>
|
||||
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center"><span> </span></v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
|
||||
<v-row v-if="boolTempchart">
|
||||
<v-col class="px-8 pt-6">
|
||||
<temp-chart ></temp-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="editHeater.bool" persistent :width="400">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon left>mdi-{{ 'icon' in editHeater.object ? editHeater.object.icon : "info" }}</v-icon>
|
||||
{{ 'name' in editHeater.object ? convertName(editHeater.object.name) : "UNKNOWN" }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="editHeater.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-3">
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row v-if="'chartTemperature' in editHeater.object && editHeater.object.chartTemperature">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTemperature"
|
||||
:label="$t('Dashboard.ShowCurrentTemperatureInChart')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('temperature')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartTarget' in editHeater.object && editHeater.object.chartTarget">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTarget"
|
||||
:label="$t('Dashboard.ShowTargetTemperatureInChart')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('target')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartPower' in editHeater.object && editHeater.object.chartPower">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolPower"
|
||||
:label="$t('Dashboard.ShowPWMPowerInChart')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('power')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="'chartSpeed' in editHeater.object && editHeater.object.chartSpeed">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolSpeed"
|
||||
:label="$t('Dashboard.ShowPWMPowerInChart')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('speed')"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-for="key in Object.keys(editHeater.additionSensors)" v-bind:key="key">
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.additionSensors[key]"
|
||||
:label="$t('Dashboard.Show')+key+$t('Dashboard.InList')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisibleAdditionalSensor(key)"
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 text-center">
|
||||
<v-color-picker
|
||||
hide-canvas
|
||||
hide-mode-switch
|
||||
mode="hexa"
|
||||
v-model="editHeater.color"
|
||||
@input="setChartColor"
|
||||
class="mx-auto"
|
||||
></v-color-picker>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import toolInput from '../../inputs/ToolInput'
|
||||
import TempChart from '@/components/charts/TempChart'
|
||||
import {convertName} from "@/plugins/helpers"
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -96,52 +243,132 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
extruderTemps: [250,215,195,0],
|
||||
editHeater: {
|
||||
bool: false,
|
||||
object: {},
|
||||
boolTemperature: false,
|
||||
boolTarget: false,
|
||||
boolPower: false,
|
||||
boolSpeed: false,
|
||||
additionSensors: {},
|
||||
color: "",
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
datasets: state => state.printer.tempHistory.datasets,
|
||||
boolTempchart: state => state.gui.dashboard.boolTempchart,
|
||||
printer: state => state.printer,
|
||||
cooldownGcode: state => state.gui.cooldownGcode,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getTemperatureFans',
|
||||
'printer/getTemperatureSensors',
|
||||
'gui/getPreheatPresets'
|
||||
]),
|
||||
heaters: {
|
||||
get () {
|
||||
return this.$store.getters["printer/getHeaters"]
|
||||
}
|
||||
},
|
||||
temperatureFans: {
|
||||
get () {
|
||||
return this.$store.getters["printer/getTemperatureFans"]
|
||||
}
|
||||
},
|
||||
temperatureSensors: {
|
||||
get () {
|
||||
return this.$store.getters["printer/getTemperatureSensors"]
|
||||
}
|
||||
},
|
||||
boolTempchart: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.boolTempchart
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { dashboard: { boolTempchart: newVal } })
|
||||
}
|
||||
},
|
||||
autoscaleTempchart: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { tempchart: { autoscale: newVal } })
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
cssBorderLeftColor(color) {
|
||||
return {
|
||||
"border-left-color": color
|
||||
}
|
||||
},
|
||||
preheat(preset) {
|
||||
for (const [name, attributes] of Object.entries(preset.values)) {
|
||||
if (attributes.bool) {
|
||||
let gcode = "SET_HEATER_TEMPERATURE HEATER="+name+" TARGET="+attributes.value
|
||||
|
||||
},
|
||||
mounted () {
|
||||
if (attributes.type === "temperature_fan") {
|
||||
const fanName = name.replace("temperature_fan ", "")
|
||||
gcode = "SET_TEMPERATURE_FAN_TARGET temperature_fan="+fanName+" TARGET="+attributes.value
|
||||
}
|
||||
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
|
||||
if (preset.gcode !== "") {
|
||||
setTimeout(() => {
|
||||
this.$store.commit('server/addEvent', { message: preset.gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: preset.gcode })
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
cooldown() {
|
||||
this.$store.commit('server/addEvent', { message: this.cooldownGcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: this.cooldownGcode })
|
||||
},
|
||||
openHeater(object) {
|
||||
this.editHeater.object = object
|
||||
|
||||
this.editHeater.color = object.chartColor
|
||||
this.editHeater.boolTemperature = 'chartTemperature' in object && object.chartTemperature !== undefined && 'visible' in object.chartTemperature ? object.chartTemperature.visible : false
|
||||
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'visible' in object.chartTarget ? object.chartTarget.visible : false
|
||||
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'visible' in object.chartPower ? object.chartPower.visible : false
|
||||
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'visible' in object.chartSpeed ? object.chartSpeed.visible : false
|
||||
|
||||
let additionalSensors = {}
|
||||
Object.keys(object.additionValues).forEach(sensor => {
|
||||
additionalSensors[sensor] = object.additionValues[sensor]['gui']['boolList']
|
||||
})
|
||||
this.editHeater.additionSensors = Object.assign(additionalSensors)
|
||||
|
||||
this.editHeater.bool = true
|
||||
},
|
||||
setVisible(type) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
this.$store.commit('printer/tempHistory/setVisible', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
|
||||
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: type, value: this.editHeater['bool'+type.charAt(0).toUpperCase() + type.slice(1)] })
|
||||
}
|
||||
},
|
||||
setVisibleAdditionalSensor(sensor) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
this.$store.dispatch('gui/setTempchartDatasetAdditionalSensorSetting', { name: this.editHeater.object.name, sensor: sensor, value: this.editHeater.additionSensors[sensor] })
|
||||
}
|
||||
},
|
||||
setChartColor(value) {
|
||||
if ("name" in this.editHeater.object) {
|
||||
if (typeof value === "object" && 'hex' in value) value = value.hex
|
||||
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.object.name, value: value })
|
||||
this.$store.dispatch('gui/setTempchartDatasetSetting', { name: this.editHeater.object.name, type: 'color', value: value })
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.equal-width {
|
||||
flex-basis: 0;
|
||||
}
|
||||
|
||||
.category-header {
|
||||
flex: 0 0 100px;
|
||||
}
|
||||
a:not(:hover) {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.content span,
|
||||
.content strong {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
</script>
|
||||
@@ -8,11 +8,11 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam')}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<img :src="webcamConfig.url" class="webcamImage" :style="webcamStyle" />
|
||||
<img :src="url" class="webcamImage" :style="webcamStyle" :alt="$t('Setting.Webcam')"/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -21,6 +21,15 @@
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
refresh: Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
document.addEventListener("focus", () => this.handleRefreshChange(), false);
|
||||
document.addEventListener("visibilitychange", this.handleRefreshChange, false);
|
||||
},
|
||||
components: {
|
||||
|
||||
},
|
||||
@@ -28,8 +37,16 @@
|
||||
...mapState({
|
||||
'webcamConfig': state => state.gui.webcam
|
||||
}),
|
||||
url() {
|
||||
let basicUrl = this.webcamConfig.url
|
||||
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
|
||||
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+this.refresh)
|
||||
return decodeURIComponent(params.toString())
|
||||
},
|
||||
webcamStyle() {
|
||||
var transforms = '';
|
||||
let transforms = '';
|
||||
if (this.webcamConfig.flipX) {
|
||||
transforms += ' scaleX(-1)'
|
||||
}
|
||||
@@ -47,5 +64,12 @@
|
||||
return '';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleRefreshChange() {
|
||||
if (!document.hidden) {
|
||||
this.refresh = Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -6,28 +6,30 @@
|
||||
<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>
|
||||
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>{{ $t("Dashboard.ZBabyStepping") }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card-text class="py-1">
|
||||
<v-row class="">
|
||||
<v-col class="col-12 pb-0 text-center">
|
||||
<p>Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 pt-0 text-center d-flex flex-column align-center flex-sm-row justify-center">
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
|
||||
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
|
||||
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container>
|
||||
<v-row class="py-0">
|
||||
<v-col class="col text-center">
|
||||
<p class="mb-0">{{ $t("Dashboard.CurrentOffset") }} {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col text-center d-flex flex-column align-center flex-sm-row justify-center">
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mt-3 mt-sm-0 order-last flex-nowrap order-sm-first" >
|
||||
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
<v-btn-toggle dense no-gutters class="mx-2 order-first flex-nowrap order-sm-last" >
|
||||
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -57,25 +59,25 @@
|
||||
sendBabySteppingDownFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingDownFine' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDownFine' });
|
||||
},
|
||||
sendBabySteppingDown() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingDown' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDown' });
|
||||
},
|
||||
sendBabySteppingUpFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingUpFine' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUpFine' });
|
||||
},
|
||||
sendBabySteppingUp() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingUp' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUp' });
|
||||
},
|
||||
}
|
||||
|
||||
@@ -3,11 +3,12 @@ import Vue from 'vue'
|
||||
import StatusPanel from './StatusPanel.vue'
|
||||
import KlippyStatePanel from './KlippyStatePanel.vue'
|
||||
import MinSettingsPanel from './MinSettingsPanel.vue'
|
||||
import MoonrakerFailedPluginsPanel from './MoonrakerFailedPluginsPanel.vue'
|
||||
import ToolsPanel from './ToolsPanel.vue'
|
||||
import ControlPanel from "./ControlPanel";
|
||||
import ExtruderPanel from "./ExtruderPanel";
|
||||
import ZOffsetPanel from "./ZOffsetPanel";
|
||||
import Peripherie from "./PeripheriePanel";
|
||||
import Miscellaneous from "./MiscellaneousPanel";
|
||||
import WebcamPanel from "./WebcamPanel";
|
||||
import MiniconsolePanel from "./MiniconsolePanel";
|
||||
import Settings from "./Settings/";
|
||||
@@ -16,11 +17,12 @@ import PowerControlPanel from "./PowerControlPanel.vue";
|
||||
Vue.component('status-panel', StatusPanel);
|
||||
Vue.component('klippy-state-panel', KlippyStatePanel);
|
||||
Vue.component('min-settings-panel', MinSettingsPanel);
|
||||
Vue.component('moonraker-failed-plugins-panel', MoonrakerFailedPluginsPanel);
|
||||
Vue.component('tools-panel', ToolsPanel);
|
||||
Vue.component('control-panel', ControlPanel);
|
||||
Vue.component('extruder-panel', ExtruderPanel);
|
||||
Vue.component('zoffset-panel', ZOffsetPanel);
|
||||
Vue.component('peripherie-panel', Peripherie);
|
||||
Vue.component('miscellaneous-panel', Miscellaneous);
|
||||
Vue.component('webcam-panel', WebcamPanel);
|
||||
Vue.component('miniconsole-panel', MiniconsolePanel);
|
||||
Vue.component('power-control-panel', PowerControlPanel);
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
<style>
|
||||
._fan-slider-subheader {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col :class="controllable ? 'pb-1 pt-3' : 'py-2'">
|
||||
<v-subheader class="_fan-slider-subheader">
|
||||
<span>{{ convertName }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ Math.round(value) }} %</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0" v-if="controllable">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
controllable: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
multi: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
convertName() {
|
||||
let tmp = this.name;
|
||||
tmp = tmp.replaceAll("_", " ");
|
||||
tmp = tmp.charAt(0).toUpperCase() + tmp.slice(1);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = "";
|
||||
|
||||
if (this.type === "fan") gcode = "M106 S"+(this.value * 2.55).toFixed(0);
|
||||
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value/100);
|
||||
|
||||
if (gcode !== "") {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
}
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > 0 ? (this.value - 1).toFixed(0) : 0;
|
||||
this.sendCmd();
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < 100 ? (this.value + 1).toFixed(0) : 100;
|
||||
this.sendCmd();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal * this.multi;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,120 @@
|
||||
<style>
|
||||
._fan-slider-subheader {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-container class="px-0 py-2">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-subheader class="_fan-slider-subheader">
|
||||
<v-icon small :class="'mr-2 '+(value ? 'icon-rotate' : '')" v-if="type !== 'output_pin'">mdi-fan</v-icon>
|
||||
<span>{{ convertName(this.name) }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold" v-if="!controllable || (controllable && pwm)">{{ Math.round(value*100) }} %</span>
|
||||
<v-icon v-if="controllable && !pwm" @click="switchOutputPin">{{ value ? "mdi-toggle-switch" : "mdi-toggle-switch-off-outline" }}</v-icon>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0" v-if="controllable && pwm">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:step="0.01"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {convertName} from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
controllable: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
pwm: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
multi: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
sendCmd() {
|
||||
let gcode = "";
|
||||
|
||||
if (this.type === "fan") gcode = "M106 S"+(this.value * this.multi).toFixed(0)
|
||||
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value*this.multi)
|
||||
if (this.type === "output_pin") gcode = "SET_PIN PIN="+this.name+" VALUE="+(this.value*this.multi).toFixed(2)
|
||||
|
||||
if (gcode !== "") {
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
},
|
||||
switchOutputPin() {
|
||||
this.value = this.value ? 0 : 1
|
||||
const gcode = "SET_PIN PIN="+this.name+" VALUE="+(this.value*this.multi).toFixed(2)
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > 0 ? (this.value - 0.01).toFixed(2) : 0;
|
||||
this.sendCmd();
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < 1 ? (this.value + 0.01).toFixed(2) : 100;
|
||||
this.sendCmd();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,11 +1,9 @@
|
||||
<style>
|
||||
.settings_macro_switch .v-messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-switch v-model="value" :label="name.toUpperCase()" @change="setValue" class="settings_macro_switch mt-0"></v-switch>
|
||||
<v-switch v-model="value" :label="name.toUpperCase()" @change="setValue" hide-details class="mt-0"></v-switch>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
@@ -19,14 +19,27 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-text-field type="number" min="0" :max="max_temp" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps" onClick="this.select();">
|
||||
</v-text-field>
|
||||
<v-combobox
|
||||
dense
|
||||
hide-details
|
||||
onClick="this.select();"
|
||||
v-model="value"
|
||||
:items="items"
|
||||
item-text="value"
|
||||
@change="setTemps"
|
||||
></v-combobox>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import Vue from "vue";
|
||||
|
||||
/*
|
||||
<v-text-field v-if="false" type="number" min="0" :max="max_temp" step="any" ref="toolField" class="tool-input">
|
||||
</v-text-field>
|
||||
*/
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
@@ -40,19 +53,27 @@
|
||||
max_temp: Number,
|
||||
command: String,
|
||||
attributeName: String,
|
||||
items: Array,
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
setTemps() {
|
||||
if (typeof this.value === 'object' && this.value !== null) this.value = this.value.value
|
||||
if (parseFloat(this.value) === 0) this.value = 0
|
||||
|
||||
if (this.max_temp !== undefined && this.value > this.max_temp) {
|
||||
this.value = this.target;
|
||||
Vue.$toast.error("Temperature too high for "+this.name+"! (max: "+this.max_temp+")");
|
||||
} else if (this.min_temp !== undefined && this.value < this.min_temp && parseFloat(this.value) !== 0) {
|
||||
this.value = this.target;
|
||||
Vue.$toast.error("Temperature too low for "+this.name+"! (min: "+this.min_temp+")");
|
||||
} else this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value });
|
||||
} else {
|
||||
const gcode = this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -5,32 +5,34 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="pb-1 pt-3">
|
||||
<v-subheader class="_tool-slider-subheader">
|
||||
<span>{{ label }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
<v-container class="px-0 py-2">
|
||||
<v-row>
|
||||
<v-col class="pb-1 pt-3">
|
||||
<v-subheader class="_tool-slider-subheader">
|
||||
<span>{{ label }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -96,7 +98,7 @@
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', gcode)
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
},
|
||||
decrement() {
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
{
|
||||
"App": {
|
||||
"SAVECONFIG": "SAVE CONFIG",
|
||||
"UploadPrint": "Upload & Print",
|
||||
"EmergencyStop": "Emergency Stop",
|
||||
"Uploading": "Uploading",
|
||||
"Connecting": "Connecting",
|
||||
"To": "to",
|
||||
"Failed": "failed",
|
||||
"CannotNotConnectTo": "Cannot not connect to",
|
||||
"TryAgain": "try again",
|
||||
"ConnectionTo": "Connection to",
|
||||
"ConnectionFailed": "Connection failed",
|
||||
"SelectPrinter": "Select Printer",
|
||||
"AddPrinter": "Add Printer",
|
||||
"EditPrinter": "Edit Printer",
|
||||
"UpdatePrinter": "Update Printer",
|
||||
"ChangePrinter": "Change Printer",
|
||||
"Hello": "Hello and welcome to the remote mode of Mainsail!",
|
||||
"PleaseRememberToAdd": "Please remember to add",
|
||||
"InMoonrakerConf": "in moonraker.conf within 'cors_domains'.",
|
||||
"YouCanFindMore": "You can find more details at",
|
||||
"Remotemode": "docs.mainsail.xyz/remotemode",
|
||||
"Empty": "Empty",
|
||||
"Close": "Close",
|
||||
"KlipperControl": "Klipper Control",
|
||||
"Restart": "Restart",
|
||||
"FirmwareRestart": "Firmware Restart",
|
||||
"RestartServices": "Restart Services",
|
||||
"Klipper": "Klipper",
|
||||
"Moonraker": "Moonraker",
|
||||
"PowerDevices": "Power Devices",
|
||||
"HostControl": "Host Control",
|
||||
"Reboot": "Reboot",
|
||||
"Shutdown": "Shutdown"
|
||||
},
|
||||
"Router" : {
|
||||
"Dashboard": "Dashboard",
|
||||
"Printers": "Printers",
|
||||
"Settings": "Settings",
|
||||
"Webcam": "Webcam",
|
||||
"Console": "Console",
|
||||
"Heightmap": "Heightmap",
|
||||
"G-Code Files": "G-Code Files",
|
||||
"Machine": "Machine",
|
||||
"Interface": "Interface"
|
||||
},
|
||||
"Dashboard": {
|
||||
"MissingConfiguration": "Missing configuration",
|
||||
"IsNotDefinedInConfig": "is not defined in config.",
|
||||
"MoreInformation": "more information",
|
||||
"MoonrakerFailedPlugins": "Moonraker Failed Plugins",
|
||||
"MoonrakerErrorInfo": "An error was detected while loading the moonraker plugins. Please check the logfile and fix the issue.",
|
||||
"FollowingPluginHasAnError": "Following plugin has an error:",
|
||||
"DownloadLog": "Download Log",
|
||||
"PausePrint": "Pause print",
|
||||
"CancelPrint": "Cancel print",
|
||||
"ResumePrint": "Resume print",
|
||||
"ClearPrintStats": "Clear print stats",
|
||||
"ReprintJob": "Reprint job",
|
||||
"Filament": "Filament",
|
||||
"Print": "Print",
|
||||
"Total": "Total",
|
||||
"Speed": "Speed",
|
||||
"Layer": "Layer",
|
||||
"ETA": "ETA",
|
||||
"File": "File",
|
||||
"Slicer": "Slicer",
|
||||
"ZBabyStepping": "Z Baby Stepping",
|
||||
"CurrentOffset": "Current Offset: ",
|
||||
"Home": "Home",
|
||||
"All": "All",
|
||||
"QGL": "QGL",
|
||||
"ZTilt": "Z Tilt",
|
||||
"FeedAmountIn": "Feed amount in",
|
||||
"FeedrateIn": "Feedrate in",
|
||||
"Retract": "Retract",
|
||||
"Extrude": "Extrude",
|
||||
"PrintSettings": "Print Settings",
|
||||
"Miscellaneous": "Miscellaneous",
|
||||
"Temperatures": "Temperatures",
|
||||
"Presets": "Presets",
|
||||
"Cooldown": "Cooldown",
|
||||
"Name": "Name",
|
||||
"State": "State",
|
||||
"Current": "Current",
|
||||
"Target": "Target",
|
||||
"Min": "min: ",
|
||||
"Max": "max: ",
|
||||
"ShowCurrentTemperatureInChart": "Show current temperature in chart",
|
||||
"ShowTargetTemperatureInChart": "Show target temperature in chart",
|
||||
"ShowPWMPowerInChart": "Show PWM-power in chart",
|
||||
"Show": "Show",
|
||||
"InList": "in list",
|
||||
"SetupTemperatures": "Setup Temperatures",
|
||||
"ShowChart": "Show Chart",
|
||||
"AutoscaleChart": "Autoscale Chart",
|
||||
"Console": "Console",
|
||||
"SendCode": "Send code...",
|
||||
"Send": "Send",
|
||||
"Empty": "Empty",
|
||||
"Setup Console": "Setup Console",
|
||||
"Hide temperatures": "Hide temperatures",
|
||||
"Custom filters": "Custom filters",
|
||||
"Unknown": "Unknown"
|
||||
},
|
||||
"Files": {
|
||||
"GCodeFiles": "G-Code Files",
|
||||
"UploadNewGcode": "Upload new Gcode",
|
||||
"CreateNewDirectory": "Create new Directory",
|
||||
"RefreshCurrentDirectory":"Refresh current Directory",
|
||||
"SetupCurrentList":"Setup current list",
|
||||
"HiddenFiles":"Hidden files",
|
||||
"FreeDisk":"Free disk: ",
|
||||
"Used":"Used: ",
|
||||
"Free":"Free: ",
|
||||
"Total":"Total: ",
|
||||
"Files": "Files",
|
||||
"Search":"Search",
|
||||
"Empty": "Empty",
|
||||
"blabla": "bla bla",
|
||||
"DropFilesToAddGcode": "Drop files to add gcode.",
|
||||
"PrintStart": "Print start",
|
||||
"Preheat": "Preheat",
|
||||
"Download": "Download",
|
||||
"Rename": "Rename",
|
||||
"Delete": "Delete",
|
||||
"StartJob": "Start Job",
|
||||
"DoYouWantToStart": "Do you want to start",
|
||||
"No": "No",
|
||||
"Yes": "Yes",
|
||||
"NewDirectory": "New Directory",
|
||||
"PleaseEnterANewDirectoryName": "Please enter a new directory name:",
|
||||
"RenameFile": "Rename File",
|
||||
"Name": "Name",
|
||||
"Cancel": "Cancel",
|
||||
"Create": "Create",
|
||||
"RenameDirectory": "Rename Directory",
|
||||
"Uploading": "Uploading",
|
||||
"CurrentPath": "Current path",
|
||||
"Filesize": "Filesize",
|
||||
"LastModified": "Last modified",
|
||||
"ObjectHeight": "Object Height",
|
||||
"LayerHeight": "Layer Height",
|
||||
"FilamentUsage": "Filament Usage",
|
||||
"PrintTime": "Print Time",
|
||||
"Slicer": "Slicer"
|
||||
},
|
||||
"Console": {
|
||||
"send": "send",
|
||||
"SetupConsole": "Setup Console",
|
||||
"SendCode": "Send code...",
|
||||
"Empty": "Empty",
|
||||
"HideTemperatures": "Hide temperatures",
|
||||
"CustomFilters": "Custom filters",
|
||||
"Date": "Date",
|
||||
"Event": "Event"
|
||||
},
|
||||
"Setting": {
|
||||
"Language": "Language",
|
||||
"General": "General",
|
||||
"PrinterName": "Printer Name",
|
||||
"ControlExtruder": "Control & Extruder",
|
||||
"PreheatPresets": "Preheat Presets",
|
||||
"Webcam": "Webcam",
|
||||
"Tempchart": "Tempchart",
|
||||
"Macros": "Macros",
|
||||
"Dashboard": "Dashboard",
|
||||
"Console": "Console",
|
||||
"RemotePrinters": "Remote Printers",
|
||||
"ConfigFiles": "Config Files",
|
||||
"SetupCurrentList": "Setup current list",
|
||||
"HiddenFiles": "Hidden files",
|
||||
"CurrentPath: ": "Current path: ",
|
||||
"Empty": "Empty",
|
||||
"EditFile": "Edit file",
|
||||
"Download": "Download",
|
||||
"Rename": "Rename",
|
||||
"Delete": "Delete",
|
||||
"PleaseStandBy": "Please stand by",
|
||||
"ConfigReference": "Config Reference",
|
||||
"Save": "Save",
|
||||
"SaveRestart": "Save & restart",
|
||||
"RenameFile": "Rename File",
|
||||
"Name": "Name",
|
||||
"Cancel": "Cancel",
|
||||
"Create": "Create",
|
||||
"Edit": "Edit",
|
||||
"CreateFile": "Create File",
|
||||
"CreateFolder": "Create Folder",
|
||||
"Uploading": "Uploading",
|
||||
"Files": "Files",
|
||||
"Filesize": "Filesize",
|
||||
"LastModified": "Last modified",
|
||||
"MachineLimits": "Machine Limits",
|
||||
"Velocity": "Velocity",
|
||||
"Acceleration": "Acceleration",
|
||||
"Deceleration": "Deceleration",
|
||||
"SquareCornerVelocity": "Square corner velocity",
|
||||
"KlippyState": "Klippy-State: ",
|
||||
"KlippyInfo": "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.",
|
||||
"Restart": "Restart",
|
||||
"FIRMWARERestart": "FIRMWARE Restart",
|
||||
"UpdateManager": "Update Manager",
|
||||
"CheckForUpdates": "Check for updates",
|
||||
"System": "System",
|
||||
"PackagesCanBeUpgraded": "packages can be upgraded",
|
||||
"OSPackages": "OS-Packages",
|
||||
"Endstops": "Endstops",
|
||||
"Endstop": "Endstop",
|
||||
"EndstopInfo": "Press the sync-button on the right-bottom to load the current endstop status.",
|
||||
"Logfiles": "Logfiles",
|
||||
"WebcamURL": "Webcam URL",
|
||||
"Rotate": "Rotate",
|
||||
"FlipWebcamHorizontally": "Flip webcam horizontally",
|
||||
"FlipWebcamVertically": "Flip webcam vertically",
|
||||
"ShowInNavigation": "Show in navigation",
|
||||
"HideTemperatures": "Hide temperatures",
|
||||
"CustomFilter": "Custom filter",
|
||||
"Rules": "Rules",
|
||||
"FeedrateXY": "Feedrate XY",
|
||||
"FeedrateZ": "Feedrate Z",
|
||||
"Cooldown": "Cooldown",
|
||||
"AddPreset": "add preset",
|
||||
"Preset": "Preset",
|
||||
"CustomGCode": "Custom G-Code",
|
||||
"PresetInfo": "You have to set minimum a target temperature or a custom gcode.",
|
||||
"Store": "Store",
|
||||
"Update": "Update",
|
||||
"EditCooldown": "Edit Cooldown",
|
||||
"UpdateCooldown": "Update Cooldown",
|
||||
"AddPrinter": "Add Printer",
|
||||
"EditPrinter": "Edit Printer",
|
||||
"UpdatePrinter": "Update Printer",
|
||||
"detected": "detected"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
{
|
||||
"App": {
|
||||
"SAVECONFIG": "保存配置",
|
||||
"UploadPrint": "上传并打印",
|
||||
"EmergencyStop": "紧急停止",
|
||||
"Uploading": "上传",
|
||||
"Connecting": "连接",
|
||||
"To": "到",
|
||||
"Failed": "失败",
|
||||
"CannotNotConnectTo": "无法连接到",
|
||||
"TryAgain": "重试",
|
||||
"ConnectionTo": "连接到",
|
||||
"ConnectionFailed": "连接失败",
|
||||
"SelectPrinter": "选择打印机",
|
||||
"AddPrinter": "添加打印机",
|
||||
"EditPrinter": "编辑打印机",
|
||||
"UpdatePrinter": "更新打印机",
|
||||
"ChangePrinter": "更换打印机",
|
||||
"Hello": "大家好,欢迎来到主帆遥控模式!",
|
||||
"PleaseRememberToAdd": "请记得添加",
|
||||
"InMoonrakerConf": "在 moonraker.conf 的 'cors_domains' 中.",
|
||||
"YouCanFindMore": "详情请浏览",
|
||||
"Remotemode": "docs.mainsail.xyz/remotemode",
|
||||
"Empty": "空的",
|
||||
"Close": "关闭",
|
||||
"KlipperControl": "Klipper 控制",
|
||||
"Restart": "重启",
|
||||
"FirmwareRestart": "固件重启",
|
||||
"RestartServices": "重启服务",
|
||||
"Klipper": "Klipper",
|
||||
"Moonraker": "Moonraker",
|
||||
"PowerDevices": "电力设备",
|
||||
"HostControl": "主机控制",
|
||||
"Reboot": "重启",
|
||||
"Shutdown": "关机"
|
||||
},
|
||||
"Router" : {
|
||||
"Dashboard": "仪表盘",
|
||||
"Printers": "打印机",
|
||||
"Settings": "设置",
|
||||
"Webcam": "摄像头",
|
||||
"Console": "控制台",
|
||||
"Heightmap": "Heightmap",
|
||||
"G-Code Files": "G-Code 文件",
|
||||
"Machine": "机器",
|
||||
"Interface": "界面"
|
||||
},
|
||||
"Dashboard": {
|
||||
"MissingConfiguration": "缺少配置",
|
||||
"IsNotDefinedInConfig": "未在配置中定义.",
|
||||
"MoreInformation": "更多信息",
|
||||
"MoonrakerFailedPlugins": "Moonraker 失败的插件",
|
||||
"MoonrakerErrorInfo": "加载moonraker插件时检测到一个错误. 请检查日志文件并修复这个问题.",
|
||||
"FollowingPluginHasAnError": "以下插件有一个错误:",
|
||||
"DownloadLog": "下载日志",
|
||||
"PausePrint": "暂停打印",
|
||||
"CancelPrint": "取消打印",
|
||||
"ResumePrint": "继续打印",
|
||||
"ClearPrintStats": "清除打印统计信息",
|
||||
"ReprintJob": "重新打印工作",
|
||||
"Filament": "Filam耗材ent",
|
||||
"Print": "打印",
|
||||
"Total": "总计",
|
||||
"Speed": "速度",
|
||||
"Layer": "层",
|
||||
"ETA": "ETA",
|
||||
"File": "文件",
|
||||
"Slicer": "切片",
|
||||
"ZBabyStepping": "Z Baby Stepping",
|
||||
"CurrentOffset": "当前偏移量: ",
|
||||
"Home": "Home",
|
||||
"All": "All",
|
||||
"QGL": "QGL",
|
||||
"ZTilt": "Z 倾斜",
|
||||
"FeedAmountIn": "进料量",
|
||||
"FeedrateIn": "输入",
|
||||
"Retract": "回抽",
|
||||
"Extrude": "挤出",
|
||||
"PrintSettings": "打印设置",
|
||||
"Miscellaneous": "其他",
|
||||
"Temperatures": "温度",
|
||||
"Presets": "预设",
|
||||
"Cooldown": "冷却",
|
||||
"Name": "名称",
|
||||
"State": "状态",
|
||||
"Current": "当前",
|
||||
"Target": "目标",
|
||||
"Min": "最小: ",
|
||||
"Max": "最大: ",
|
||||
"ShowCurrentTemperatureInChart": "在图表中显示当前温度",
|
||||
"ShowTargetTemperatureInChart": "在图表中显示目标温度",
|
||||
"ShowPWMPowerInChart": "在图表中显示PWM功率",
|
||||
"Show": "显示",
|
||||
"InList": "在列表中",
|
||||
"SetupTemperatures": "设置温度",
|
||||
"ShowChart": "显示图表",
|
||||
"AutoscaleChart": "自动缩放图表",
|
||||
"Console": "控制台",
|
||||
"SendCode": "发送代码...",
|
||||
"Send": "发送",
|
||||
"Empty": "空的",
|
||||
"SetupConsole": "设置控制台",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilters": "自定义筛选器",
|
||||
"Unknown": "未知"
|
||||
},
|
||||
"Files": {
|
||||
"GCodeFiles": "G-Code 文件",
|
||||
"UploadNewGcode": "上传新 Gcode",
|
||||
"CreateNewDirectory": "创建新目录",
|
||||
"RefreshCurrentDirectory":"刷新当前目录",
|
||||
"SetupCurrentList":"设置当前列表",
|
||||
"HiddenFiles":"隐藏文件",
|
||||
"FreeDisk":"可用磁盘: ",
|
||||
"Used":"使用: ",
|
||||
"Free":"空闲: ",
|
||||
"Total":"总共: ",
|
||||
"Files": "文件",
|
||||
"Search":"搜索",
|
||||
"Empty": "空的",
|
||||
"blabla": "巴拉巴拉",
|
||||
"DropFilesToAddGcode": "Drop files to add gcode.",
|
||||
"PrintStart": "开始打印",
|
||||
"Preheat": "预热",
|
||||
"Download": "下载",
|
||||
"Rename": "重命名",
|
||||
"Delete": "删除",
|
||||
"StartJob": "开始作业",
|
||||
"DoYouWantToStart": "你想开始吗",
|
||||
"No": "否",
|
||||
"Yes": "是",
|
||||
"NewDirectory": "新建目录",
|
||||
"PleaseEnterANewDirectoryName": "请输入新的目录名称:",
|
||||
"RenameFile": "重命名文件",
|
||||
"Name": "名称",
|
||||
"Cancel": "取消",
|
||||
"Create": "创建",
|
||||
"RenameDirectory": "重命名目录",
|
||||
"Uploading": "上传",
|
||||
"CurrentPath": "当前路径",
|
||||
"Filesize": "文件大小",
|
||||
"LastModified": "上次修改",
|
||||
"ObjectHeight": "对象高度",
|
||||
"LayerHeight": "层高",
|
||||
"FilamentUsage": "耗材使用",
|
||||
"PrintTime": "打印时间",
|
||||
"Slicer": "切片"
|
||||
},
|
||||
"Console": {
|
||||
"send": "发送",
|
||||
"SetupConsole": "设置控制台",
|
||||
"SendCode": "发送代码...",
|
||||
"Empty": "空的",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilters": "自定义筛选器",
|
||||
"Date": "时间",
|
||||
"Event": "事件"
|
||||
},
|
||||
"Setting": {
|
||||
"Language": "语言",
|
||||
"General": "一般",
|
||||
"PrinterName": "打印机名称",
|
||||
"ControlExtruder": "控制 & 挤出机",
|
||||
"PreheatPresets": "预热预设",
|
||||
"Webcam": "摄像头",
|
||||
"Tempchart": "温度图",
|
||||
"Macros": "宏",
|
||||
"Dashboard": "仪表盘",
|
||||
"Console": "控制台",
|
||||
"RemotePrinters": "远程打印机",
|
||||
"ConfigFiles": "配置文件",
|
||||
"SetupCurrentList": "设置当前列表",
|
||||
"HiddenFiles": "隐藏文件",
|
||||
"CurrentPath": "当前路径: ",
|
||||
"Empty": "空的",
|
||||
"EditFile": "编辑文件",
|
||||
"Download": "下载",
|
||||
"Rename": "重命名",
|
||||
"Delete": "删除",
|
||||
"PleaseStandBy": "请等待",
|
||||
"ConfigReference": "配置参考",
|
||||
"Save": "保存",
|
||||
"SaveRestart": "保存 & 重启",
|
||||
"RenameFile": "重命名文件",
|
||||
"Name": "名称",
|
||||
"Cancel": "取消",
|
||||
"Create": "创建",
|
||||
"Edit": "编辑",
|
||||
"CreateFile": "创建文件",
|
||||
"CreateFolder": "创建文件夹",
|
||||
"Uploading": "上传",
|
||||
"Files": "文件",
|
||||
"Filesize": "文件大小",
|
||||
"LastModified": "上次修改",
|
||||
"MachineLimits": "机器限制",
|
||||
"Velocity": "速度",
|
||||
"Acceleration": "加速",
|
||||
"Deceleration": "减速",
|
||||
"SquareCornerVelocity": "直角速度",
|
||||
"KlippyState": "Klippy 状态: ",
|
||||
"KlippyInfo": "Moonraker 不能连接到 Klippy! \n请检查Klipper服务是否正在运行, 并且是否配置了UDS (Unix域套接字). ",
|
||||
"Restart": "重启",
|
||||
"FIRMWARERestart": "固件重启",
|
||||
"UpdateManager": "更新管理器",
|
||||
"CheckForUpdates": "检查更新",
|
||||
"System": "系统",
|
||||
"PackagesCanBeUpgraded": "软件包可以升级",
|
||||
"OSPackages": "OS包",
|
||||
"Endstops": "限位开关",
|
||||
"Endstop": "限位",
|
||||
"EndstopInfo": "按右下角的同步按钮加载当前的限位状态。",
|
||||
"Logfiles": "日志文件",
|
||||
"WebcamURL": "摄像头链接",
|
||||
"Rotate": "旋转",
|
||||
"FlipWebcamHorizontally": "水平翻转摄像头 ",
|
||||
"FlipWebcamVertically": "垂直翻转摄像头",
|
||||
"ShowInNavigation": "在导航中显示 ",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilter": "自定义筛选器",
|
||||
"Rules": "规则",
|
||||
"FeedrateXY": "XY 步进速度",
|
||||
"FeedrateZ": "Z 步进速度",
|
||||
"Cooldown": "冷却",
|
||||
"AddPreset": "添加预设",
|
||||
"Preset": "预设",
|
||||
"CustomGCode": "自定义 G-Code",
|
||||
"PresetInfo": "您必须设置最低目标温度或自定义gcode.",
|
||||
"Store": "储存",
|
||||
"Update": "更新",
|
||||
"EditCooldown": "编辑冷却",
|
||||
"UpdateCooldown": "更新冷却",
|
||||
"AddPrinter": "添加打印机",
|
||||
"EditPrinter": "编辑打印机",
|
||||
"UpdatePrinter": "更新打印机",
|
||||
"detected": "发现"
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,14 @@ import Vue from 'vue'
|
||||
import WebSocketClient from './plugins/wsClient'
|
||||
import App from './App.vue'
|
||||
import vuetify from './plugins/vuetify'
|
||||
import i18n from './plugins/i18n'
|
||||
import VueResource from 'vue-resource'
|
||||
import './components'
|
||||
import store from './store'
|
||||
import router from './plugins/router'
|
||||
import vueHeadful from 'vue-headful';
|
||||
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
Vue.use(VueResource);
|
||||
@@ -19,26 +21,29 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO
|
||||
|
||||
Vue.component('vue-headful', vueHeadful);
|
||||
|
||||
|
||||
fetch('/config.json')
|
||||
.then(res => res.json())
|
||||
.then(file => {
|
||||
store.commit('socket/setData', file);
|
||||
|
||||
const websocketProtocol = document.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||
const socketClient = new WebSocketClient(websocketProtocol + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
|
||||
const socketClient = new WebSocketClient(store.state.socket.protocol + '://' + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
|
||||
store: store,
|
||||
reconnectEnabled: true,
|
||||
reconnectInterval: store.state.socket.reconnectInterval,
|
||||
});
|
||||
socketClient.connect();
|
||||
|
||||
if (!store.state.socket.remoteMode) socketClient.connect()
|
||||
Vue.prototype.$socket = socketClient;
|
||||
|
||||
new Vue({
|
||||
vuetify,
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
let p = document.createElement("p");
|
||||
@@ -47,3 +52,5 @@ fetch('/config.json')
|
||||
document.getElementById('app').append(p);
|
||||
window.console.error('Error:', error);
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<v-text-field
|
||||
v-model="gcode"
|
||||
:items="items"
|
||||
label="Send code..."
|
||||
:label="$t('Console.SendCode')"
|
||||
solo
|
||||
class="gcode-command-field"
|
||||
ref="gcodeCommandField"
|
||||
@@ -48,21 +48,21 @@
|
||||
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
|
||||
<v-icon class="mr-2">mdi-send</v-icon> send
|
||||
<v-icon class="mr-2">mdi-send</v-icon> {{ $t('Console.send')}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Console.SetupConsole')">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="gcode-command-btn px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Console.HideTemperatures')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Console.CustomFilters')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -83,7 +83,7 @@
|
||||
mobile-breakpoint="0"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
<div class="text-center">{{ $t("Console.Empty")}}</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
@@ -116,13 +116,13 @@
|
||||
sortBy: 'date',
|
||||
headers: [
|
||||
{
|
||||
text: 'Date',
|
||||
text: this.$t('Console.Date'),
|
||||
value: 'date',
|
||||
width: '15%',
|
||||
dateType: 'Date',
|
||||
},
|
||||
{
|
||||
text: 'Event',
|
||||
text: this.$t('Console.Event'),
|
||||
sortable: false,
|
||||
value: 'message',
|
||||
width: '85%'
|
||||
@@ -171,7 +171,7 @@
|
||||
methods: {
|
||||
doSend() {
|
||||
this.$store.commit('socket/addLoading', { name: 'sendGcode' });
|
||||
this.$store.commit('server/addEvent', this.gcode);
|
||||
this.$store.commit('server/addEvent', { message: this.gcode, type: 'command' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "socket/removeLoading", { name: 'sendGcode' });
|
||||
this.lastCommands.push(this.gcode);
|
||||
this.gcode = "";
|
||||
@@ -185,7 +185,6 @@
|
||||
let seconds = date.getSeconds();
|
||||
if (seconds < 10) seconds = "0"+seconds.toString();
|
||||
|
||||
|
||||
return hours+":"+minutes+":"+seconds;
|
||||
},
|
||||
colorConsoleMessage: colorConsoleMessage,
|
||||
@@ -219,7 +218,7 @@
|
||||
let output = "";
|
||||
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
|
||||
|
||||
this.$store.commit('server/addEvent', output);
|
||||
this.$store.commit('server/addEvent', { message: output, type: 'command' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
<v-row>
|
||||
<v-col class="col-sm-12 col-md-5">
|
||||
<min-settings-panel v-if="klippy_state === 'ready' && existsPrinterConfig"></min-settings-panel>
|
||||
<status-panel v-if="klippy_state === 'ready'"></status-panel>
|
||||
<moonraker-failed-plugins-panel v-if="moonrakerFailedPlugins.length"></moonraker-failed-plugins-panel>
|
||||
<klippy-state-panel v-if="socket_connected && klippy_state !== 'ready'"></klippy-state-panel>
|
||||
<webcam-panel v-if="showDashboardWebcam" class="mt-6"></webcam-panel>
|
||||
<status-panel v-if="klippy_state === 'ready'"></status-panel>
|
||||
<webcam-panel class="mt-6" v-if="showDashboardWebcam"></webcam-panel>
|
||||
<z-offset-panel class="mt-6" v-if="klippy_state === 'ready'"></z-offset-panel>
|
||||
<control-panel class="mt-6" v-if="klippy_state === 'ready'"></control-panel>
|
||||
<extruder-panel class="mt-6" v-if="klippy_state === 'ready'"></extruder-panel>
|
||||
<peripherie-panel v-if="klippy_state === 'ready'"></peripherie-panel>
|
||||
<miscellaneous-panel v-if="klippy_state === 'ready'"></miscellaneous-panel>
|
||||
</v-col>
|
||||
<v-col class="col-sm-12 col-md-7" v-if="klippy_connected">
|
||||
<tools-panel v-if="socket_connected && klippy_connected"></tools-panel>
|
||||
@@ -31,6 +32,7 @@
|
||||
socket_connected: state => state.socket.isConnected,
|
||||
klippy_connected: state => state.server.klippy_connected,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
moonrakerFailedPlugins: state => state.server.failed_plugins,
|
||||
|
||||
showDashboardWebcam: state => state.gui.dashboard.boolWebcam,
|
||||
showDashboardConsole: state => state.gui.dashboard.boolConsole,
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col
|
||||
v-for="(printer,key) in printers"
|
||||
v-bind:key="key"
|
||||
class="col-12 col-sm-6 col-md-4"
|
||||
>
|
||||
<farm-printer-panel v-bind:printer="printer"></farm-printer-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<script>
|
||||
import FarmPrinterPanel from "@/components/panels/FarmPrinterPanel";
|
||||
|
||||
export default {
|
||||
components: { FarmPrinterPanel },
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
printers: {
|
||||
get() {
|
||||
return this.$store.getters["farm/getPrinters"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -51,20 +51,20 @@
|
||||
<div>
|
||||
<v-card class="fileupload-card my-3" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
|
||||
<v-card-title>
|
||||
G-Code Files
|
||||
{{ $t("Files.GCodeFiles")}}
|
||||
<v-spacer class="d-none d-sm-block"></v-spacer>
|
||||
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
|
||||
<input type="file" ref="fileUpload" accept=".gcode, .ufp" style="display: none" multiple @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0" name="controllers">
|
||||
<v-btn @click="clickUploadButton" title="Upload new Gcode" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" title="Create new Directory" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn @click="refreshFileList" title="Refresh current Directory" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup current list">
|
||||
<v-btn @click="clickUploadButton" :title="$t('Files.UploadNewGcode')" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" :title="$t('Files.CreateNewDirectory')" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn @click="refreshFileList" :title="$t('Files.RefreshCurrentDirectory')" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Files.SetupCurrentList')">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" label="Hidden files"></v-checkbox>
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Files.HiddenFiles')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item class="minHeight36" v-for="header of configHeaders" v-bind:key="header.key">
|
||||
@@ -74,12 +74,26 @@
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}</v-card-subtitle>
|
||||
<v-card-subtitle>
|
||||
{{ $t("Files.CurrentPath") }} {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}<br />
|
||||
<div v-if="this.disk_usage !== null">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ $t('Files.FreeDisk') + formatFilesize(disk_usage.free) }}</span>
|
||||
</template>
|
||||
<span>
|
||||
{{ $t('Files.Used') + formatFilesize(this.disk_usage.used) }}<br />
|
||||
{{ $t('Files.Free') + formatFilesize(this.disk_usage.free) }}<br />
|
||||
{{ $t('Files.Total') + formatFilesize(this.disk_usage.total) }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
append-icon="mdi-magnify"
|
||||
label="Search"
|
||||
:label="$t('Files.Search')"
|
||||
single-line
|
||||
hide-details
|
||||
></v-text-field>
|
||||
@@ -94,7 +108,7 @@
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items-per-page.sync="countPerPage"
|
||||
:footer-props="{
|
||||
itemsPerPageText: 'Files'
|
||||
itemsPerPageText: $t('Files.Files')
|
||||
}"
|
||||
item-key="name"
|
||||
:search="search"
|
||||
@@ -107,7 +121,7 @@
|
||||
</template>
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
<div class="text-center">{{ $t('Files.empty') }}</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== 'gcodes')">
|
||||
@@ -116,7 +130,7 @@
|
||||
@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="pr-0 text-center" style="width: 32px;"><v-icon>mdi-folder-upload</v-icon></td>
|
||||
<td class=" " colspan="8">..</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -132,10 +146,16 @@
|
||||
@dragover="dragOverFilelist($event, item)" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, item)"
|
||||
:data-name="item.filename"
|
||||
>
|
||||
<td class="pr-0" style="width: 32px;">
|
||||
<td class="pr-0 text-center" style="width: 32px;">
|
||||
<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 : '--')" />
|
||||
<v-icon v-if="!item.isDirectory && !(existsSmallThumbnail(item))">mdi-file</v-icon>
|
||||
<v-tooltip v-if="!item.isDirectory && existsSmallThumbnail(item) && existsBigThumbnail(item)" top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<img :src="'data:image/gif;base64,'+getSmallThumbnail(item)" width="32" height="32" v-bind="attrs" v-on="on" />
|
||||
</template>
|
||||
<span><img :src="'data:image/gif;base64,'+getBigThumbnail(item)" width="250" /></span>
|
||||
</v-tooltip>
|
||||
<img v-if="!item.isDirectory && existsSmallThumbnail(item) && !existsBigThumbnail(item)" :src="'data:image/gif;base64,'+getSmallThumbnail(item)" width="32" height="32" />
|
||||
</td>
|
||||
<td class=" ">{{ item.filename }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'size')[0].visible">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
|
||||
@@ -147,90 +167,126 @@
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'slicer')[0].visible">{{ item.slicer ? item.slicer : '--' }}<br /><small v-if="item.slicer_version">{{ item.slicer_version}}</small></td>
|
||||
</tr>
|
||||
</template>
|
||||
<v-data-footer>{{ $t('Files.blabla')}}</v-data-footer>
|
||||
</v-data-table>
|
||||
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
|
||||
<div class="textnode">Drop files to add gcode.</div>
|
||||
<div class="textnode">{{ $t('Files.DropFilesToAddGcode')}}</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="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> Print start
|
||||
<v-icon class="mr-1">mdi-play</v-icon> {{ $t("Files.PrintStart")}}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
@click="preheat"
|
||||
v-if="
|
||||
'first_layer_extr_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_extr_temp > 0 &&
|
||||
'first_layer_bed_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_bed_temp > 0
|
||||
"
|
||||
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
|
||||
>
|
||||
<v-icon class="mr-1">mdi-fire</v-icon> {{ $t('Files.Preheat')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Filse.Download')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
|
||||
</v-list-item>
|
||||
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogPrintFile.show" max-width="400">
|
||||
<v-dialog v-model="dialogPrintFile.show" :max-width="getThumbnailWidth(dialogPrintFile.item)">
|
||||
<v-card>
|
||||
<v-img
|
||||
contain
|
||||
v-if="dialogPrintFile.item.thumbnails && dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400)"
|
||||
:src="'data:image/gif;base64,'+(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400).data : '')"
|
||||
:height="(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 400 || element.width === 300).height : '')+'px'"
|
||||
v-if="existsBigThumbnail(dialogPrintFile.item)"
|
||||
:src="'data:image/gif;base64,'+getBigThumbnail(dialogPrintFile.item)"
|
||||
></v-img>
|
||||
<v-card-title class="headline">Start Job</v-card-title>
|
||||
<v-card-text>Do you want to start {{ dialogPrintFile.item.filename }}?</v-card-text>
|
||||
<v-card-title class="headline">{{ $t('Files.StartJob') }}</v-card-title>
|
||||
<v-card-text>{{ $t('Files.DoYouWantToStart') + dialogPrintFile.item.filename }}?</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">No</v-btn>
|
||||
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">Yes</v-btn>
|
||||
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">{{ $t('Files.No')}}</v-btn>
|
||||
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">{{$t('Files.Yes')}}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">New Directory</v-card-title>
|
||||
<v-card-title class="headline">{{ $t('Files.NewDirectory') }}</v-card-title>
|
||||
<v-card-text>
|
||||
Please enter a new directory name:
|
||||
{{ $t('Files.PleaseEnterANewDirectoryName') }}
|
||||
<v-text-field label="Name" :rules="input_rules" @keypress.enter="createDirectoryAction" required v-model="dialogCreateDirectory.name"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">create</v-btn>
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">{{ $t('Files.Create') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</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-title class="headline">{{ $t('Files.RenameFile')}}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></v-text-field>
|
||||
<v-text-field :label="$t('Files.Name')" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></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-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">Rename Directory</v-card-title>
|
||||
<v-card-title class="headline">{{ $t('Files.RenameDirectory') }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogRenameDirectory.newName"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">rename</v-btn>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-snackbar
|
||||
:timeout="-1"
|
||||
:value="true"
|
||||
fixed
|
||||
right
|
||||
bottom
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t("Files.Uploading") + uploadSnackbar.filename }}</strong><br />
|
||||
{{ Math.round(uploadSnackbar.percent) }} % @ {{ formatFilesize(Math.round(uploadSnackbar.speed)) }}/s<br />
|
||||
<v-progress-linear class="mt-2" :value="uploadSnackbar.percent"></v-progress-linear>
|
||||
<template v-slot:action="{ attrs }">
|
||||
<v-btn
|
||||
color="red"
|
||||
text
|
||||
v-bind="attrs"
|
||||
@click="cancelUpload"
|
||||
style="min-width: auto;"
|
||||
>
|
||||
<v-icon class="0">mdi-close</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-snackbar>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -266,14 +322,14 @@
|
||||
},
|
||||
headers: [
|
||||
{ text: '', value: '', align: 'left', configable: false, visible: true, filterable: false },
|
||||
{ text: 'Name', value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: 'Filesize', value: 'size', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Last modified', value: 'modified', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Object Height', value: 'object_height', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Layer Height', value: 'layer_height', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Filament Usage', value: 'filament_total', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Print Time', value: 'estimated_time', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Slicer', value: 'slicer', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.Name'), value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: this.$t('Files.Filesize'), value: 'size', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.LastModified'), value: 'modified', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.ObjectHeight'), value: 'object_height', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.LayerHeight'), value: 'layer_height', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.FilamentUsage'), value: 'filament_total', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.PrintTime'), value: 'estimated_time', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.Slicer'), value: 'slicer', align: 'right', configable: true, visible: true },
|
||||
],
|
||||
options: {
|
||||
|
||||
@@ -298,7 +354,21 @@
|
||||
},
|
||||
input_rules: [
|
||||
value => value.indexOf(" ") === -1 || 'Name contain spaces!'
|
||||
]
|
||||
],
|
||||
uploadSnackbar: {
|
||||
status: false,
|
||||
filename: "",
|
||||
percent: 0,
|
||||
speed: 0,
|
||||
total: 0,
|
||||
number: 0,
|
||||
max: 0,
|
||||
cancelTokenSource: "",
|
||||
lastProgress: {
|
||||
time: 0,
|
||||
loaded: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -307,6 +377,7 @@
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
|
||||
displayMetadata: state => state.gui.gcodefiles.showMetadata,
|
||||
}),
|
||||
@@ -343,6 +414,11 @@
|
||||
return this.$store.dispatch("gui/setSettings", { gcodefiles: { hideMetadataColums: newVal } })
|
||||
}
|
||||
},
|
||||
disk_usage: {
|
||||
get: function() {
|
||||
return this.$store.getters["files/getDiskUsage"](this.currentPath)
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadPath()
|
||||
@@ -354,11 +430,24 @@
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
uploadFile: function() {
|
||||
async uploadFile() {
|
||||
if (this.$refs.fileUpload.files.length) {
|
||||
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
|
||||
this.$refs.fileUpload.value = ''
|
||||
})
|
||||
this.$store.commit('socket/addLoading', { name: 'gcodeUpload' })
|
||||
let successFiles = []
|
||||
this.uploadSnackbar.number = 0
|
||||
this.uploadSnackbar.max = this.$refs.fileUpload.files.length
|
||||
for (const file of this.$refs.fileUpload.files) {
|
||||
this.uploadSnackbar.number++
|
||||
const result = await this.doUploadFile(file)
|
||||
successFiles.push(result)
|
||||
}
|
||||
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
|
||||
for(const file of successFiles) {
|
||||
this.$toast.success("Upload of "+file+" successful!")
|
||||
}
|
||||
|
||||
this.$refs.fileUpload.value = ''
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
@@ -366,22 +455,52 @@
|
||||
let formData = new FormData()
|
||||
let filename = file.name.replace(" ", "_")
|
||||
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7))
|
||||
this.$store.commit('socket/addLoading', { name: 'gcodeUpload' })
|
||||
this.uploadSnackbar.filename = filename
|
||||
this.uploadSnackbar.status = true
|
||||
this.uploadSnackbar.percent = 0
|
||||
this.uploadSnackbar.speed = 0
|
||||
this.uploadSnackbar.lastProgress.loaded = 0
|
||||
this.uploadSnackbar.lastProgress.time = 0
|
||||
|
||||
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, { headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
).then((result) => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
}).catch(() => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
|
||||
toast.error("Cannot upload the file!")
|
||||
});
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7))
|
||||
|
||||
return new Promise(resolve => {
|
||||
this.uploadSnackbar.cancelTokenSource = axios.CancelToken.source();
|
||||
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, {
|
||||
cancelToken: this.uploadSnackbar.cancelTokenSource.token,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
onUploadProgress: (progressEvent) => {
|
||||
this.uploadSnackbar.percent = (progressEvent.loaded * 100) / progressEvent.total
|
||||
if (this.uploadSnackbar.lastProgress.time) {
|
||||
const time = progressEvent.timeStamp - this.uploadSnackbar.lastProgress.time
|
||||
const data = progressEvent.loaded - this.uploadSnackbar.lastProgress.loaded
|
||||
|
||||
if (time) this.uploadSnackbar.speed = data / (time / 1000)
|
||||
}
|
||||
|
||||
this.uploadSnackbar.lastProgress.time = progressEvent.timeStamp
|
||||
this.uploadSnackbar.lastProgress.loaded = progressEvent.loaded
|
||||
this.uploadSnackbar.total = progressEvent.total
|
||||
}
|
||||
}
|
||||
).then((result) => {
|
||||
this.uploadSnackbar.status = false
|
||||
resolve(result.data.result)
|
||||
}).catch(() => {
|
||||
this.uploadSnackbar.status = false
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' })
|
||||
toast.error("Cannot upload the file!")
|
||||
})
|
||||
})
|
||||
},
|
||||
clickUploadButton: function() {
|
||||
this.$refs.fileUpload.click()
|
||||
},
|
||||
cancelUpload: function() {
|
||||
this.uploadSnackbar.cancelTokenSource.cancel()
|
||||
this.uploadSnackbar.status = false
|
||||
},
|
||||
refreshFileList: function() {
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'files/getDirectory')
|
||||
},
|
||||
@@ -433,6 +552,26 @@
|
||||
this.contextMenu.item = item
|
||||
this.$nextTick(() => { this.contextMenu.shown = true })
|
||||
},
|
||||
preheat() {
|
||||
if (
|
||||
'first_layer_extr_temp' in this.contextMenu.item &&
|
||||
'first_layer_bed_temp' in this.contextMenu.item &&
|
||||
!['error', 'printing', 'paused'].includes(this.printer_state)
|
||||
) {
|
||||
let gcode = ""
|
||||
if (this.contextMenu.item.first_layer_extr_temp > 0) {
|
||||
gcode = "M104 S"+this.contextMenu.item.first_layer_extr_temp
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
if (this.contextMenu.item.first_layer_bed_temp > 0) {
|
||||
gcode = "M140 S"+this.contextMenu.item.first_layer_bed_temp
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
@@ -467,14 +606,7 @@
|
||||
}, 'files/getMove');
|
||||
},
|
||||
removeFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
axios.delete(
|
||||
'//'+ this.hostname + ':' + this.port +'/server/files/' + encodeURI(filename)
|
||||
).then((result) => {
|
||||
this.$toast.success(result.data.result+" successfully deleted.");
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error! Cannot delete file.");
|
||||
});
|
||||
this.$socket.sendObj('server.files.delete_file', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteFile');
|
||||
},
|
||||
createDirectory: function() {
|
||||
this.dialogCreateDirectory.name = "";
|
||||
@@ -539,7 +671,7 @@
|
||||
this.dropzone.visibility = 'hidden';
|
||||
this.dropzone.opacity = 0;
|
||||
|
||||
if (!this.is_printing && e.dataTransfer.files.length) {
|
||||
if (e.dataTransfer.files.length) {
|
||||
await this.doUploadFile(e.dataTransfer.files[0]);
|
||||
}
|
||||
}
|
||||
@@ -646,6 +778,50 @@
|
||||
this.$store.dispatch("gui/setGcodefilesMetadata", {name: name, value: value});
|
||||
}
|
||||
},
|
||||
existsSmallThumbnail(item) {
|
||||
return (
|
||||
'thumbnails' in item &&
|
||||
item.thumbnails !== undefined &&
|
||||
item.thumbnails.findIndex(thumb => thumb.width >= 32 && thumb.width <= 64 && thumb.height >= 32 && thumb.height <= 64) !== -1
|
||||
)
|
||||
},
|
||||
getSmallThumbnail(item) {
|
||||
if (this.existsSmallThumbnail(item)) {
|
||||
const thumbnail = item.thumbnails.find(thumb =>
|
||||
thumb.width >= 32 && thumb.width <= 64 &&
|
||||
thumb.height >= 32 && thumb.height <= 64
|
||||
)
|
||||
|
||||
if (thumbnail) return thumbnail.data
|
||||
}
|
||||
|
||||
return ""
|
||||
},
|
||||
existsBigThumbnail(item) {
|
||||
return (
|
||||
'thumbnails' in item &&
|
||||
item.thumbnails !== undefined &&
|
||||
item.thumbnails.findIndex(thumb => thumb.width >= 300 && thumb.width <= 400) !== -1
|
||||
)
|
||||
},
|
||||
getBigThumbnail(item) {
|
||||
if (this.existsBigThumbnail(item)) {
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
|
||||
|
||||
if (thumbnail) return thumbnail.data
|
||||
}
|
||||
|
||||
return ""
|
||||
},
|
||||
getThumbnailWidth(item) {
|
||||
if (this.existsBigThumbnail(item)) {
|
||||
const thumbnail = item.thumbnails.find(thumb => thumb.width >= 300 && thumb.width <= 400)
|
||||
|
||||
if (thumbnail) return thumbnail.width
|
||||
}
|
||||
|
||||
return 400
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filetree: {
|
||||
@@ -672,11 +848,13 @@
|
||||
displayMetadata: {
|
||||
deep: true,
|
||||
handler(newVal) {
|
||||
Object.entries(newVal).forEach(value => {
|
||||
if (this.headers.filter(header => header.value === value[0]).length) {
|
||||
this.headers.filter(header => header.value === value[0])[0].visible = value[1];
|
||||
}
|
||||
});
|
||||
if (newVal !== undefined && typeof(newVal) === 'object') {
|
||||
Object.entries(newVal).forEach(value => {
|
||||
if (this.headers.filter(header => header.value === value[0]).length) {
|
||||
this.headers.filter(header => header.value === value[0])[0].visible = value[1];
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
showHiddenFiles: function() {
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
class=" d-sm-none"
|
||||
@click="openRenameProfile()">{{ this.bed_mesh && this.bed_mesh.profile_name ? this.bed_mesh.profile_name : "" }}</v-btn>
|
||||
<v-item-group class="v-btn-toggle d-none d-sm-flex" name="controllers">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="homePrinter" :loading="loadings.includes('homeAll')" title="Home All"><v-icon small>mdi-home</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="clearBedMesh" :loading="loadings.includes('bedMeshClear')" v-if="this.bed_mesh && this.bed_mesh.profile_name" title="Clear bed mesh">Clear</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="calibrateDialog = true" :loading="loadings.includes('bedMeshCalibrate')" :disabled="is_printing" title="Calibrate new bed mesh">Calibrate</v-btn>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-card-text class="d-sm-none text-center pb-0">
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="homePrinter" :loading="loadings.includes('homeAll')" title="Home All"><v-icon small>mdi-home</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="clearBedMesh" :loading="loadings.includes('bedMeshClear')" v-if="this.bed_mesh && this.bed_mesh.profile_name" title="Clear bed mesh">Clear</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="calibrateDialog = true" :loading="loadings.includes('bedMeshCalibrate')" :disabled="is_printing" title="Calibrate new bed mesh">Calibrate</v-btn>
|
||||
</v-item-group>
|
||||
@@ -40,11 +42,13 @@
|
||||
No bed_mesh has been loaded yet.
|
||||
</v-card-text>
|
||||
<v-card-text class="px-0 py-0 content" v-if="this.bed_mesh && this.bed_mesh.profile_name">
|
||||
<v-row>
|
||||
<v-col class="pb-0 pt-5">
|
||||
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-container class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col class="pb-0 pt-5">
|
||||
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions v-if="this.bed_mesh && this.bed_mesh.profile_name" class="py-0">
|
||||
<v-spacer></v-spacer>
|
||||
@@ -62,26 +66,22 @@
|
||||
<span class="subheading"><v-icon left>mdi-stack-overflow</v-icon>Profile</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-row>
|
||||
<v-col class="px-0 py-1">
|
||||
<v-simple-table>
|
||||
<template v-slot:default>
|
||||
<tbody>
|
||||
<tr v-for="(profile, index) in profiles" :key="index" >
|
||||
<td>{{ profile.name }}<small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
|
||||
<td class="text-right">
|
||||
<v-btn-toggle dense no-gutters>
|
||||
<v-btn class="btnMinWidthAuto" @click="loadProfile(profile.name)" :loading="loadings.includes('bedMeshLoad_'+profile.name)" :disabled="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) || 'deleted' in profile.data" ><v-icon small>mdi-view-grid-plus</v-icon></v-btn>
|
||||
<v-btn class="btnMinWidthAuto" @click="openRemoveProfile(profile.name)" :loading="loadings.includes('bedMeshRemove_'+profile.name)" :disabled="'deleted' in profile.data" ><v-icon small>mdi-delete</v-icon></v-btn>
|
||||
</v-btn-toggle>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
</v-simple-table>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text class="py-0 px-0">
|
||||
<v-simple-table>
|
||||
<template v-slot:default>
|
||||
<tbody>
|
||||
<tr v-for="(profile, index) in profiles" :key="index" >
|
||||
<td>{{ profile.name }}<small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
|
||||
<td class="text-right">
|
||||
<v-btn-toggle dense no-gutters>
|
||||
<v-btn class="btnMinWidthAuto" @click="loadProfile(profile.name)" :loading="loadings.includes('bedMeshLoad_'+profile.name)" :disabled="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) || 'deleted' in profile.data" ><v-icon small>mdi-view-grid-plus</v-icon></v-btn>
|
||||
<v-btn class="btnMinWidthAuto" @click="openRemoveProfile(profile.name)" :loading="loadings.includes('bedMeshRemove_'+profile.name)" :disabled="'deleted' in profile.data" ><v-icon small>mdi-delete</v-icon></v-btn>
|
||||
</v-btn-toggle>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
</v-simple-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
@@ -324,7 +324,7 @@
|
||||
},
|
||||
loadProfile: function(name) {
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshLoad_'+name })
|
||||
this.$store.commit('server/addEvent', "BED_MESH_PROFILE LOAD="+name)
|
||||
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE LOAD="+name, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+name }, "socket/removeLoading", { name: 'bedMeshLoad_'+name })
|
||||
},
|
||||
openRenameProfile: function() {
|
||||
@@ -334,7 +334,7 @@
|
||||
renameProfile: function() {
|
||||
this.renameDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshRename' })
|
||||
this.$store.commit('server/addEvent', "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase())
|
||||
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase(), type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "socket/removeLoading", { name: 'bedMeshRename' })
|
||||
},
|
||||
openRemoveProfile: function(name) {
|
||||
@@ -344,19 +344,24 @@
|
||||
removeProfile: function() {
|
||||
this.removeDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshRemove_'+this.newName })
|
||||
this.$store.commit('server/addEvent', "BED_MESH_PROFILE REMOVE="+this.newName)
|
||||
this.$store.commit('server/addEvent', { message: "BED_MESH_PROFILE REMOVE="+this.newName, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.newName }, "printer/removeBedMeshProfile", { name: this.newName })
|
||||
this.removeDialogProfile = ""
|
||||
},
|
||||
homePrinter: function() {
|
||||
this.$store.commit('socket/addLoading', { name: 'homeAll' })
|
||||
this.$store.commit('server/addEvent', { message: "G28", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' })
|
||||
},
|
||||
clearBedMesh: function() {
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshClear' })
|
||||
this.$store.commit('server/addEvent', "BED_MESH_CLEAR")
|
||||
this.$store.commit('server/addEvent', { message: "BED_MESH_CLEAR", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "socket/removeLoading", { name: 'bedMeshClear' })
|
||||
},
|
||||
calibrateMesh: function() {
|
||||
this.calibrateDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshCalibrate' });
|
||||
this.$store.commit('server/addEvent', "BED_MESH_CALIBRATE")
|
||||
this.$store.commit('server/addEvent', { message: "BED_MESH_CALIBRATE", type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
<v-container fluid class="px-0 py-0">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<router-view></router-view>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-general-panel></settings-general-panel>
|
||||
<settings-language-panel class="mt-6"></settings-language-panel>
|
||||
<settings-webcam-panel class="mt-6"></settings-webcam-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-dashboard-panel></settings-dashboard-panel>
|
||||
<settings-dashboard-panel class="mt-6"></settings-dashboard-panel>
|
||||
<settings-console-panel class="mt-6"></settings-console-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-macros-panel></settings-macros-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-presets-panel></settings-presets-panel>
|
||||
<settings-remote-printers-panel class="mt-6"></settings-remote-printers-panel>
|
||||
<settings-control-panel class="mt-6"></settings-control-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,35 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-container fluid py-0 px-0>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-sm-6">
|
||||
<settings-config-files-panel></settings-config-files-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-sm-6">
|
||||
<v-row v-if="klippy_state === 'ready'">
|
||||
<v-col class="col-12 pt-0">
|
||||
<settings-limits-panel></settings-limits-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="klippy_state !== 'ready'">
|
||||
<v-col class="col-12 pt-0">
|
||||
<klippy-state-panel></klippy-state-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<settings-limits-panel v-if="klippy_state === 'ready'"></settings-limits-panel>
|
||||
<klippy-state-panel v-if="klippy_state !== 'ready'"></klippy-state-panel>
|
||||
<settings-update-panel v-if="updateManager" class="mt-6"></settings-update-panel>
|
||||
<v-row class="mt-6">
|
||||
<v-col class="col-md-6" v-if="klippy_state === 'ready'">
|
||||
<settings-endstop-panel></settings-endstop-panel>
|
||||
<settings-runout-panel></settings-runout-panel>
|
||||
</v-col>
|
||||
<v-col :class="(klippy_state !== 'ready' ? 'col-md-12' : 'col-md-6')">
|
||||
<settings-update-panel v-if="updateManager"></settings-update-panel>
|
||||
<settings-logfiles-panel :class="updateManager ? 'mt-6' : ''"></settings-logfiles-panel>
|
||||
<settings-logfiles-panel></settings-logfiles-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</template>
|
||||
<script>
|
||||
import {mapState} from "vuex";
|
||||
|
||||
@@ -24,7 +24,7 @@ export function caseInsensitiveNameSort(a, b) {
|
||||
|
||||
export function colorConsoleMessage(item) {
|
||||
if (item.message.startsWith('!! ')) return "red--text"
|
||||
if ('send' in item && item.send) return "blue--text"
|
||||
if ('type' in item && item.type === 'command') return "blue--text"
|
||||
|
||||
return '';
|
||||
}
|
||||
@@ -36,4 +36,15 @@ export function formatConsoleMessage(message) {
|
||||
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>')
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
export function convertName(name) {
|
||||
let output = ""
|
||||
name = name.replaceAll("_", " ")
|
||||
name.split(" ").forEach(split => {
|
||||
output += " "+split.charAt(0).toUpperCase() + split.slice(1)
|
||||
})
|
||||
output = output.slice(1)
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n'
|
||||
Vue.use(VueI18n)
|
||||
|
||||
function loadLocaleMessages () {
|
||||
const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
||||
const messages = {}
|
||||
locales.keys().forEach(key => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||
if (matched && matched.length > 1) {
|
||||
const locale = matched[1]
|
||||
messages[locale] = locales(key)
|
||||
}
|
||||
})
|
||||
return messages
|
||||
}
|
||||
|
||||
let lang = localStorage.getItem("lang") || 'en'
|
||||
|
||||
localStorage.setItem("lang",lang);
|
||||
|
||||
export default new VueI18n({
|
||||
locale: process.env.VUE_APP_I18N_LOCALE || lang,
|
||||
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || lang,
|
||||
messages: loadLocaleMessages()
|
||||
})
|
||||
@@ -1,26 +1,32 @@
|
||||
export default class WebSocketClient {
|
||||
|
||||
constructor (url, options) {
|
||||
this.instance = null;
|
||||
this.url = url;
|
||||
this.reconnectInterval = options.reconnectInterval;
|
||||
this.store = options.store;
|
||||
this.wsData = [];
|
||||
this.timerId = 0;
|
||||
this.keepAliveTimeout = 1000;
|
||||
this.instance = null
|
||||
this.url = url
|
||||
this.reconnects = 0
|
||||
this.maxReconnects = options.maxReconnects || 10
|
||||
this.reconnectInterval = options.reconnectInterval || 1000
|
||||
this.store = options.store
|
||||
this.wsData = []
|
||||
this.timerId = 0
|
||||
this.keepAliveTimeout = 1000
|
||||
|
||||
this.onOpen = null;
|
||||
this.onMessage = null;
|
||||
this.onClose = null;
|
||||
this.onError = null;
|
||||
this.onOpen = null
|
||||
this.onMessage = null
|
||||
this.onClose = null
|
||||
this.onError = null
|
||||
this.blacklistMessages = [
|
||||
"Metadata not available for",
|
||||
"Klippy Request Timed Out",
|
||||
"Klippy Host not connected",
|
||||
];
|
||||
]
|
||||
this.blacklistFunctions = [
|
||||
"getPowerDevices",
|
||||
];
|
||||
]
|
||||
}
|
||||
|
||||
setUrl(url) {
|
||||
this.url = url
|
||||
}
|
||||
|
||||
createMessage (method, params, id) {
|
||||
@@ -42,26 +48,36 @@ export default class WebSocketClient {
|
||||
}
|
||||
|
||||
connect () {
|
||||
this.instance = new WebSocket(this.url);
|
||||
this.store.dispatch("socket/setData", { isConnecting: true })
|
||||
this.instance = new WebSocket(this.url)
|
||||
|
||||
this.instance.onopen = () => {
|
||||
if (this.store) this.passToStore('socket/onOpen', event);
|
||||
};
|
||||
this.reconnects = 0
|
||||
if (this.store) this.passToStore('socket/onOpen', event)
|
||||
}
|
||||
|
||||
this.instance.onclose = (e) => {
|
||||
this.passToStore('socket/onClose', e);
|
||||
this.passToStore('socket/onClose', e)
|
||||
|
||||
setTimeout(() => {
|
||||
this.connect();
|
||||
}, this.reconnectInterval);
|
||||
};
|
||||
if (!e.wasClean && this.reconnects < this.maxReconnects) {
|
||||
this.reconnects++
|
||||
setTimeout(() => {
|
||||
this.connect()
|
||||
}, this.reconnectInterval)
|
||||
} else {
|
||||
this.store.dispatch("socket/setData", {
|
||||
isConnecting: false,
|
||||
connectingFailed: true
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.instance.onerror = () => {
|
||||
this.instance.close();
|
||||
};
|
||||
this.instance.close()
|
||||
}
|
||||
|
||||
this.instance.onmessage = (msg) => {
|
||||
let data = JSON.parse(msg.data);
|
||||
let data = JSON.parse(msg.data)
|
||||
if (this.store) {
|
||||
if (this.wsData.filter(item => item.id === data.id).length > 0 &&
|
||||
this.wsData.filter(item => item.id === data.id)[0].action !== "") {
|
||||
@@ -79,11 +95,12 @@ export default class WebSocketClient {
|
||||
error: data.error,
|
||||
requestParams: tmpWsData.params
|
||||
})
|
||||
);
|
||||
)
|
||||
}
|
||||
} else {
|
||||
let result = data.result
|
||||
if (result === "ok") result = { result: result }
|
||||
if (typeof(result) === "string") result = { result: result }
|
||||
|
||||
let preload = {}
|
||||
let wsData = this.wsData.filter(item => item.id === data.id)[0]
|
||||
@@ -94,7 +111,11 @@ export default class WebSocketClient {
|
||||
}
|
||||
} else this.passToStore('socket/onMessage', data)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
close() {
|
||||
if (this.instance) this.instance.close()
|
||||
}
|
||||
|
||||
sendObj (method, params, action = '', actionPreload = null) {
|
||||
@@ -106,7 +127,7 @@ export default class WebSocketClient {
|
||||
params: params,
|
||||
actionPreload: actionPreload,
|
||||
})
|
||||
this.instance.send(this.createMessage(method, params, id));
|
||||
this.instance.send(this.createMessage(method, params, id))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import Dashboard from '../pages/Dashboard.vue'
|
||||
import Webcam from '../pages/Webcam.vue'
|
||||
import Farm from '../pages/Farm.vue'
|
||||
import Console from '../pages/Console.vue'
|
||||
import Heightmap from '../pages/Heightmap.vue'
|
||||
import Files from '../pages/Files.vue'
|
||||
@@ -11,10 +12,16 @@ const routes = [
|
||||
{
|
||||
title: "Dashboard",
|
||||
path: '/',
|
||||
icon: 'view-dashboard',
|
||||
icon: 'monitor-dashboard',
|
||||
component: Dashboard,
|
||||
alwaysShow: true,
|
||||
},
|
||||
{
|
||||
title: "Printers",
|
||||
path: '/allPrinters',
|
||||
component: Farm,
|
||||
alwaysShow: false,
|
||||
},
|
||||
{
|
||||
title: "Webcam",
|
||||
path: '/cam',
|
||||
|
||||