Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ea4caf28d | ||
|
|
cc20cf4128 | ||
|
|
27a3c17ec8 | ||
|
|
55ae82e4cf | ||
|
|
e864356f26 | ||
|
|
30875ffb5d | ||
|
|
a966c41561 | ||
|
|
9325e9d93a | ||
|
|
437f459b94 | ||
|
|
0430eee826 | ||
|
|
0825d85000 | ||
|
|
42c353df20 | ||
|
|
78549ef587 | ||
|
|
f16d80745a | ||
|
|
70903ae3cf | ||
|
|
309fc4eee2 | ||
|
|
fed5956500 | ||
|
|
cfaae9831e | ||
|
|
526c1800f2 | ||
|
|
2bf8f8e8e2 | ||
|
|
7750a897e2 | ||
|
|
80c53494f9 | ||
|
|
4ee0f4bd46 | ||
|
|
6d90d320d8 | ||
|
|
b1345d09fa | ||
|
|
b0ebc2eee1 | ||
|
|
9856f5d4db | ||
|
|
00574006b3 | ||
|
|
1854c04d7a | ||
|
|
ab6e0c07dc | ||
|
|
3850d6773a | ||
|
|
e22a88d397 | ||
|
|
08b783c160 | ||
|
|
a9d82f547d | ||
|
|
b009aa17ed | ||
|
|
50767fdd44 | ||
|
|
f203cfed0e | ||
|
|
4ed0ec9c52 | ||
|
|
ad56a0e223 | ||
|
|
dd3ef0f81f | ||
|
|
54205d940a | ||
|
|
893a903ce7 | ||
|
|
68b1863ca1 | ||
|
|
ba6700b80c | ||
|
|
a861e74183 | ||
|
|
0ba6455513 | ||
|
|
b0ae84e54c | ||
|
|
64f62c575e | ||
|
|
7eaf8a492a | ||
|
|
281385bf41 | ||
|
|
40cc81077f | ||
|
|
ba7454da11 | ||
|
|
be12d53c0e | ||
|
|
b84fc03c91 | ||
|
|
1736a5163b | ||
|
|
d470d42b6d | ||
|
|
5fc2d5c775 | ||
|
|
29869b47e3 | ||
|
|
3c7dc54bea | ||
|
|
b51eae1740 | ||
|
|
9dffb3079e | ||
|
|
dc0fb853bc | ||
|
|
91dc42e47e | ||
|
|
402ea9f1cd | ||
|
|
d6c73ce012 | ||
|
|
becef8f1ea | ||
|
|
f4656c7150 | ||
|
|
79b529eb1e | ||
|
|
16efdc6042 | ||
|
|
36a29eb629 | ||
|
|
07094a52dd | ||
|
|
5363322681 | ||
|
|
48403d09cc | ||
|
|
80ded1b9ff | ||
|
|
c4ccfce216 | ||
|
|
f2ea6c039f | ||
|
|
1a18af1569 | ||
|
|
d953cab29c | ||
|
|
222bd60d9e | ||
|
|
85bd5279f5 | ||
|
|
a0d21f6664 | ||
|
|
8b7756aea7 | ||
|
|
fe1f659c51 | ||
|
|
c2eeabe165 | ||
|
|
fbdacef932 | ||
|
|
c22d0c2040 | ||
|
|
c63fd161c2 | ||
|
|
eac1d69cf7 | ||
|
|
01df98b8ec | ||
|
|
fa01bfac39 | ||
|
|
8bce2467a0 | ||
|
|
626d76e852 | ||
|
|
0895026c02 | ||
|
|
0b2d17d633 | ||
|
|
e2125f3c0d | ||
|
|
12a89c93a9 | ||
|
|
b8e7bab442 | ||
|
|
be821f913d | ||
|
|
8047b7703c | ||
|
|
baa4d9b416 | ||
|
|
2be28ab463 | ||
|
|
cbd9d6ea75 | ||
|
|
b204373dd9 | ||
|
|
5b2dad6c32 | ||
|
|
14195daa5a | ||
|
|
389c162878 | ||
|
|
1217927fae | ||
|
|
306d510719 | ||
|
|
a3d4497577 | ||
|
|
46728ded75 | ||
|
|
7c07db946d | ||
|
|
a167a14f12 | ||
|
|
9a84111fb3 | ||
|
|
81541d33f7 | ||
|
|
7e471ab995 | ||
|
|
7b1ff60adc | ||
|
|
c00da9bae3 | ||
|
|
a2fae98f28 | ||
|
|
cb6706415e | ||
|
|
e872c3e975 | ||
|
|
be52358121 | ||
|
|
2db574effd | ||
|
|
0128831423 | ||
|
|
ab79857fbe | ||
|
|
93f71e1f18 | ||
|
|
184d2430c4 | ||
|
|
a37eb272ac | ||
|
|
7e48b08f81 | ||
|
|
d1d84953a1 | ||
|
|
502b5ac7c1 | ||
|
|
d8dff1affa | ||
|
|
6aa99bc75f | ||
|
|
ac24c8a47a | ||
|
|
8ccd018c21 | ||
|
|
2634b37755 | ||
|
|
aaf50a403d | ||
|
|
5f06da45cf | ||
|
|
33bc3673ae | ||
|
|
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
@@ -9,5 +9,12 @@ temp
|
||||
.version
|
||||
.versions
|
||||
.changelog
|
||||
.idea
|
||||
package-lock.json
|
||||
*.local
|
||||
*.local
|
||||
docker/gcode
|
||||
docker/logs
|
||||
docker/config/*.cfg
|
||||
docker/config/*.conf
|
||||
docker/config/.mainsail.json
|
||||
docker/config/.theme
|
||||
@@ -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.
|
||||
@@ -13,4 +15,4 @@ To begin using Mainsail start by [installing](https://meteyou.github.io/mainsail
|
||||
* [Vue.js](https://vuejs.org/): The Progressive JavaScript Framework
|
||||
* [Vuetify](https://vuetifyjs.com/): Material Design Component Framework for Vue.js
|
||||
|
||||
Massive thanks to the whole [Voron Design](http://vorondesign.com/) community. Without them such a project would not be possible.
|
||||
Massive thanks to the whole [Voron Design](http://vorondesign.com/) community. Without them such a project would not be possible.
|
||||
@@ -0,0 +1,33 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
api:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: api/Dockerfile
|
||||
image: mainsail-stack-api/1
|
||||
volumes:
|
||||
- ./docker/config:/home/node/printer_config
|
||||
- ./docker/logs:/tmp/logs
|
||||
- ./docker/gcode:/home/node/gcode
|
||||
container_name: ${APP_NAME}-stack-api
|
||||
ports:
|
||||
- 7125:7125
|
||||
networks:
|
||||
- dev_net
|
||||
application:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: Dockerfile
|
||||
image: mainsail-stack-npm/1
|
||||
volumes:
|
||||
- ./:/home/node/mainsail
|
||||
container_name: ${APP_NAME}-stack-npm
|
||||
ports:
|
||||
- 8080:8080
|
||||
depends_on:
|
||||
- api
|
||||
networks:
|
||||
- dev_net
|
||||
networks:
|
||||
dev_net:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,15 @@
|
||||
FROM node:buster AS base
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y zip
|
||||
|
||||
COPY start-npm /usr/local/bin/start-npm
|
||||
RUN chmod +x /usr/local/bin/start-npm
|
||||
|
||||
USER node
|
||||
|
||||
WORKDIR /home/node/mainsail
|
||||
|
||||
ENTRYPOINT ["start-npm"]
|
||||
@@ -0,0 +1,66 @@
|
||||
FROM debian:buster AS base
|
||||
|
||||
RUN groupadd --force -g 1000 node
|
||||
RUN useradd -ms /bin/bash --no-user-group -g 1000 -u 1000 node
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y sudo wget cmake swig git virtualenv python-dev libffi-dev build-essential libncurses-dev libusb-dev avrdude gcc-avr binutils-avr avr-libc dfu-util libnewlib-arm-none-eabi gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0
|
||||
RUN mkdir /src
|
||||
WORKDIR /src
|
||||
RUN wget http://download.savannah.nongnu.org/releases/simulavr/libsim_1.1.0_amd64.deb
|
||||
RUN apt install /src/libsim_1.1.0_amd64.deb
|
||||
|
||||
#prebuild files for simulavr, not needed currently, because we just build the python lib later
|
||||
#RUN wget http://download.savannah.nongnu.org/releases/simulavr/simulavr_1.1.0_amd64.deb
|
||||
#RUN apt install /src/simulavr_1.1.0_amd64.deb
|
||||
#RUN wget http://download.savannah.nongnu.org/releases/simulavr/python3-simulavr_1.1.0_amd64.deb
|
||||
#RUN apt install /src/python3-simulavr_1.1.0_amd64.deb
|
||||
|
||||
RUN cat /etc/passwd
|
||||
|
||||
RUN echo 'node ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/node && \
|
||||
chown node:node -R ./
|
||||
#if systemd is installed, we need to backup the current systemctl command
|
||||
#RUN mv /bin/systemctl /bin/systemctl.bak
|
||||
RUN ln -s /bin/true /bin/systemctl
|
||||
|
||||
USER node
|
||||
|
||||
WORKDIR /home/node
|
||||
RUN git clone https://github.com/KevinOConnor/klipper
|
||||
WORKDIR /home/node/klipper
|
||||
COPY api/simulavr.config /home/node/klipper/.config
|
||||
RUN make
|
||||
RUN cp /home/node/klipper/out/klipper.elf /home/node/klipper/simulavr.elf
|
||||
RUN rm /home/node/klipper/.config
|
||||
COPY api/linux.config /home/node/klipper/.config
|
||||
RUN make clean
|
||||
RUN make
|
||||
RUN chmod +x /home/node/klipper/scripts/install-debian.sh
|
||||
RUN /home/node/klipper/scripts/install-debian.sh
|
||||
|
||||
WORKDIR /home/node
|
||||
RUN git clone https://github.com/Arksine/moonraker
|
||||
WORKDIR /home/node/moonraker
|
||||
RUN sed -E 's/check_klipper\(\)/check_klipper() { return 0; }\nold()/' /home/node/moonraker/scripts/install-moonraker.sh > /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
RUN chmod +x /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
RUN /home/node/moonraker/scripts/install-moonraker2.sh
|
||||
|
||||
RUN sudo rm -f /bin/systemctl
|
||||
#restore backed up systemctl command
|
||||
#RUN sudo mv /bin/systemctl.bak /bin/systemctl
|
||||
|
||||
WORKDIR /home/node/
|
||||
RUN git clone https://git.savannah.nongnu.org/git/simulavr.git
|
||||
WORKDIR /home/node/simulavr
|
||||
RUN make python
|
||||
RUN make build
|
||||
|
||||
USER root
|
||||
|
||||
COPY api/run-api /usr/local/bin/run-api
|
||||
RUN chmod +x /usr/local/bin/run-api
|
||||
|
||||
USER node
|
||||
|
||||
ENTRYPOINT ["run-api"]
|
||||
@@ -0,0 +1,25 @@
|
||||
CONFIG_LOW_LEVEL_OPTIONS=y
|
||||
# CONFIG_MACH_AVR is not set
|
||||
# CONFIG_MACH_ATSAM is not set
|
||||
# CONFIG_MACH_ATSAMD is not set
|
||||
# CONFIG_MACH_LPC176X is not set
|
||||
# CONFIG_MACH_STM32 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
CONFIG_MACH_LINUX=y
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_STEP_DELAY=2
|
||||
CONFIG_BOARD_DIRECTORY="linux"
|
||||
CONFIG_CLOCK_FREQ=50000000
|
||||
CONFIG_LINUX_SELECT=y
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
CONFIG_USB_SERIAL_NUMBER="12345"
|
||||
# CONFIG_CUSTOM_STEP_DELAY is not set
|
||||
CONFIG_INITIAL_PINS=""
|
||||
CONFIG_HAVE_GPIO=y
|
||||
CONFIG_HAVE_GPIO_ADC=y
|
||||
CONFIG_HAVE_GPIO_SPI=y
|
||||
CONFIG_HAVE_GPIO_I2C=y
|
||||
CONFIG_HAVE_GPIO_HARD_PWM=y
|
||||
CONFIG_HAVE_GPIO_BITBANGING=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
PYTHONPATH="/home/node/simulavr/build/pysimulavr/" /home/node/klipper/scripts/avrsim.py -m atmega644 -s 20000000 -b 250000 /home/node/klipper/simulavr.elf &
|
||||
/home/node/klippy-env/bin/python /home/node/klipper/klippy/klippy.py /home/node/printer_config/printer.cfg -l /tmp/logs/klippy.log -a /tmp/klippy_uds &
|
||||
/home/node/moonraker-env/bin/python /home/node/moonraker/moonraker/moonraker.py -l /tmp/logs/moonraker.log -c /home/node/printer_config/moonraker.conf &
|
||||
echo "Starting ..." >> /tmp/logs/klippy.log
|
||||
tail -f /tmp/logs/klippy.log
|
||||
@@ -0,0 +1,50 @@
|
||||
CONFIG_LOW_LEVEL_OPTIONS=y
|
||||
CONFIG_MACH_AVR=y
|
||||
# CONFIG_MACH_ATSAM is not set
|
||||
# CONFIG_MACH_ATSAMD is not set
|
||||
# CONFIG_MACH_LPC176X is not set
|
||||
# CONFIG_MACH_STM32 is not set
|
||||
# CONFIG_MACH_PRU is not set
|
||||
# CONFIG_MACH_LINUX is not set
|
||||
# CONFIG_MACH_SIMU is not set
|
||||
CONFIG_AVR_SELECT=y
|
||||
CONFIG_STEP_DELAY=-1
|
||||
CONFIG_BOARD_DIRECTORY="avr"
|
||||
# CONFIG_MACH_atmega2560 is not set
|
||||
# CONFIG_MACH_atmega1280 is not set
|
||||
# CONFIG_MACH_at90usb1286 is not set
|
||||
# CONFIG_MACH_at90usb646 is not set
|
||||
# CONFIG_MACH_atmega32u4 is not set
|
||||
# CONFIG_MACH_atmega1284p is not set
|
||||
CONFIG_MACH_atmega644p=y
|
||||
# CONFIG_MACH_atmega328p is not set
|
||||
# CONFIG_MACH_atmega328 is not set
|
||||
# CONFIG_MACH_atmega168 is not set
|
||||
CONFIG_MCU="atmega644p"
|
||||
CONFIG_AVRDUDE_PROTOCOL="arduino"
|
||||
# CONFIG_AVR_FREQ_16000000 is not set
|
||||
CONFIG_AVR_FREQ_20000000=y
|
||||
# CONFIG_AVR_FREQ_8000000 is not set
|
||||
CONFIG_CLOCK_FREQ=20000000
|
||||
CONFIG_AVR_CLKPR=-1
|
||||
CONFIG_AVR_STACK_SIZE=256
|
||||
CONFIG_AVR_WATCHDOG=y
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_AVR_SERIAL_UART0=y
|
||||
# CONFIG_AVR_SERIAL_UART1 is not set
|
||||
CONFIG_SERIAL_PORT=0
|
||||
CONFIG_SIMULAVR=y
|
||||
CONFIG_SERIAL_BAUD=250000
|
||||
CONFIG_USB_VENDOR_ID=0x1d50
|
||||
CONFIG_USB_DEVICE_ID=0x614e
|
||||
CONFIG_USB_SERIAL_NUMBER="12345"
|
||||
# CONFIG_CUSTOM_STEP_DELAY is not set
|
||||
CONFIG_INITIAL_PINS=""
|
||||
CONFIG_HAVE_GPIO=y
|
||||
CONFIG_HAVE_GPIO_ADC=y
|
||||
CONFIG_HAVE_GPIO_SPI=y
|
||||
CONFIG_HAVE_GPIO_I2C=y
|
||||
CONFIG_HAVE_GPIO_HARD_PWM=y
|
||||
CONFIG_HAVE_GPIO_BITBANGING=y
|
||||
CONFIG_HAVE_STRICT_TIMING=y
|
||||
CONFIG_INLINE_STEPPER_HACK=y
|
||||
@@ -0,0 +1,14 @@
|
||||
# moonraker.conf
|
||||
|
||||
[server]
|
||||
host: 0.0.0.0
|
||||
port: 7125
|
||||
enable_debug_logging: True
|
||||
config_path: /home/node/printer_config/
|
||||
|
||||
[authorization]
|
||||
enabled: True
|
||||
trusted_clients:
|
||||
0.0.0.0/0
|
||||
cors_domains:
|
||||
*
|
||||
@@ -0,0 +1,179 @@
|
||||
[virtual_sdcard]
|
||||
path: ~/gcode
|
||||
|
||||
[pause_resume]
|
||||
[display_status]
|
||||
|
||||
[mcu]
|
||||
serial: /tmp/pseudoserial
|
||||
pin_map: arduino
|
||||
baud: 250000
|
||||
|
||||
[stepper_x]
|
||||
step_pin: PD7
|
||||
dir_pin: !PC5
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 40
|
||||
endstop_pin: ^PC2
|
||||
position_endstop: 0
|
||||
position_max: 235
|
||||
homing_speed: 50
|
||||
homing_retract_dist: 0
|
||||
|
||||
[stepper_y]
|
||||
step_pin: PC6
|
||||
dir_pin: !PC7
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 40
|
||||
endstop_pin: ^PC3
|
||||
position_endstop: 0
|
||||
position_max: 235
|
||||
homing_speed: 50
|
||||
homing_retract_dist: 0
|
||||
|
||||
[stepper_z]
|
||||
step_pin: PB3
|
||||
dir_pin: PB2
|
||||
enable_pin: !PA5
|
||||
microsteps: 16
|
||||
rotation_distance: 8
|
||||
endstop_pin: ^PC4
|
||||
position_endstop: 0.0
|
||||
position_max: 250
|
||||
homing_retract_dist: 0
|
||||
|
||||
[extruder]
|
||||
max_extrude_only_distance: 100.0
|
||||
step_pin: PB1
|
||||
dir_pin: !PB0
|
||||
enable_pin: !PD6
|
||||
microsteps: 16
|
||||
rotation_distance: 33.683
|
||||
nozzle_diameter: 0.400
|
||||
filament_diameter: 1.750
|
||||
heater_pin: PD5
|
||||
sensor_type: EPCOS 100K B57560G104F
|
||||
sensor_pin: PA7
|
||||
control: watermark
|
||||
min_temp: 0
|
||||
max_temp: 250
|
||||
min_extrude_temp: 50
|
||||
|
||||
[heater_bed]
|
||||
heater_pin: PD4
|
||||
sensor_type: EPCOS 100K B57560G104F
|
||||
sensor_pin: PA6
|
||||
control: watermark
|
||||
min_temp: 0
|
||||
max_temp: 130
|
||||
|
||||
[fan]
|
||||
pin: PB4
|
||||
|
||||
[heater_fan nozzle_fan]
|
||||
pin: PB5
|
||||
off_below: 0.0
|
||||
shutdown_speed: 1.0
|
||||
max_power: 1.0
|
||||
|
||||
[controller_fan mcu_fan]
|
||||
pin: PB6
|
||||
off_below: 0.2
|
||||
shutdown_speed: 1.0
|
||||
max_power: 1.0
|
||||
|
||||
[printer]
|
||||
kinematics: cartesian
|
||||
max_velocity: 300
|
||||
max_accel: 3000
|
||||
max_z_velocity: 5
|
||||
max_z_accel: 100
|
||||
|
||||
#[display]
|
||||
#lcd_type: st7920
|
||||
#cs_pin: PA3
|
||||
#sclk_pin: PA1
|
||||
#sid_pin: PC1
|
||||
#encoder_pins: ^PD2, ^PD3
|
||||
#click_pin: ^!PC0
|
||||
|
||||
# The print bed can move so far to the front, that the nozzle can reach the
|
||||
# plastic cover of the print bed heater cable (only when the bed is moved by
|
||||
# hand). By homing the Y axis before the X axis, it is ensured the nozzle will
|
||||
# not melt through the plastic part.
|
||||
# BEWARE: You will lose the ability to home axes individually. The printer will
|
||||
# always home all axes for every G28 command.
|
||||
#[homing_override]
|
||||
#gcode:
|
||||
# G28 Y0
|
||||
# G28 X0
|
||||
# G28 Z0
|
||||
|
||||
[gcode_macro PAUSE]
|
||||
rename_existing: BASE_PAUSE
|
||||
default_parameter_X: 230 #edit to your park position
|
||||
default_parameter_Y: 230 #edit to your park position
|
||||
default_parameter_Z: 10 #edit to your park position
|
||||
default_parameter_E: 1 #edit to your retract length
|
||||
gcode:
|
||||
SAVE_GCODE_STATE NAME=PAUSE_state
|
||||
BASE_PAUSE
|
||||
G91
|
||||
G1 E-{E} F2100
|
||||
G1 Z{Z}
|
||||
G90
|
||||
G1 X{X} Y{Y} F6000
|
||||
[gcode_macro RESUME]
|
||||
rename_existing: BASE_RESUME
|
||||
default_parameter_E: 1 #edit to your retract length
|
||||
gcode:
|
||||
G91
|
||||
G1 E{E} F2100
|
||||
G90
|
||||
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1
|
||||
BASE_RESUME
|
||||
[gcode_macro CANCEL_PRINT]
|
||||
rename_existing: BASE_CANCEL_PRINT
|
||||
gcode:
|
||||
TURN_OFF_HEATERS
|
||||
CLEAR_PAUSE
|
||||
SDCARD_RESET_FILE
|
||||
BASE_CANCEL_PRINT
|
||||
|
||||
[gcode_macro START_PRINT]
|
||||
default_parameter_BED_TEMP: 103.3
|
||||
default_parameter_EXTRUDER_TEMP: 103.3
|
||||
gcode:
|
||||
# Start bed heating
|
||||
M140 S103.3
|
||||
# Use absolute coordinates
|
||||
G90
|
||||
# Reset the G-Code Z offset (adjust Z offset if needed)
|
||||
SET_GCODE_OFFSET Z=0.0
|
||||
# Home the printer
|
||||
G28
|
||||
# Move the nozzle near the bed
|
||||
G1 Z5 F3000
|
||||
# Move the nozzle very close to the bed
|
||||
G1 Z0.15 F300
|
||||
# Wait for bed to reach temperature
|
||||
M190 S103.3
|
||||
# Set and wait for nozzle to reach temperature
|
||||
M109 S103.3
|
||||
|
||||
[gcode_macro END_PRINT]
|
||||
gcode:
|
||||
# Turn off bed, extruder, and fan
|
||||
M140 S0
|
||||
M104 S0
|
||||
M106 S0
|
||||
# Move nozzle away from print while retracting
|
||||
G91
|
||||
G1 X-2 Y-2 E-3 F300
|
||||
# Raise nozzle by 10mm
|
||||
G1 Z10 F3000
|
||||
G90
|
||||
# Disable steppers
|
||||
M84
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export APP_NAME=mainsail
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
if [ "$1" == "restart" ]; then
|
||||
docker-compose restart "$2"
|
||||
elif [ "$1" == "bash" ]; then
|
||||
docker exec -it "$APP_NAME-stack-$2" bash
|
||||
elif [ "$1" == "npm-build" ]; then
|
||||
docker exec "$APP_NAME-stack-npm" npm run build
|
||||
else
|
||||
docker-compose "$@"
|
||||
fi
|
||||
else
|
||||
docker-compose ps
|
||||
fi
|
||||
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
if [ ! -d 'node_modules' ]; then
|
||||
npm ci
|
||||
fi
|
||||
npm run serve
|
||||
@@ -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 +1,49 @@
|
||||
$link-color: $red-300;
|
||||
|
||||
.success {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(38, 203, 124);
|
||||
}
|
||||
|
||||
.info {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(56, 132, 255);
|
||||
}
|
||||
|
||||
.warning {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(247, 125, 5);
|
||||
}
|
||||
|
||||
.alert {
|
||||
margin: 32px 0px;
|
||||
padding: 25px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
width: 100%;
|
||||
display: block;
|
||||
background-color: #f5f6fa;
|
||||
border-left: 4px solid;
|
||||
border-color: rgb(255, 70, 66);
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Support
|
||||
nav_order: 5
|
||||
has_children: true
|
||||
permalink: /additional
|
||||
---
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Slicer upload
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/slicer-upload
|
||||
---
|
||||
|
||||
## Upload from Slicer
|
||||
### 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.
|
||||
For "API Key" you can type anything.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer (since v2.3.0)
|
||||
A "Physical Printer" must be defined to configure the settings from above.
|
||||
More detailed instructions will follow.
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/thumbnails
|
||||
---
|
||||
|
||||
## Thumbnails
|
||||
|
||||
Mainsail can display thumbnails in the file browser and as previews in the print status.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer
|
||||
|
||||
To enable thumbnails, click on `Help > Show Configuration Folder` and navigate to your printer profiles inside the `printer` folder.
|
||||
Open your printer profile in a text editor and find `thumbnails =` and add the resolutions `32x32,400x300`. Save the file and restart your Slicer.
|
||||
|
||||

|
||||
|
||||
From now on the gcode files contain thumbnails displayed by mainsail.
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 9.0 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
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 |
|
Before Width: | Height: | Size: 382 KiB After Width: | Height: | Size: 336 KiB |
@@ -0,0 +1,54 @@
|
||||
---
|
||||
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.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
### How to CSS
|
||||
|
||||
You need to be familiar with the CSS (**C**ascading **S**tyle **S**heets) syntax.
|
||||
There are many resources to learn CSS online, for example:
|
||||
- https://www.w3schools.com/css/default.asp
|
||||
|
||||
#### find the Element selector (example based on Chrome Browser)
|
||||
|
||||
Use your browser's built-in developer tools to find the right selector of the element you want to add your own flair to.
|
||||
|
||||
Open the developer tools:
|
||||
|
||||
right click anywhere on the page and select "inspect" (or F12 on the keyboard)
|
||||
|
||||

|
||||
|
||||
1. Activate the "inspector"
|
||||
2. Select the desired element
|
||||
3. Find the selector
|
||||
4. Use the style editor and fiddle arround
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
When you have achieved your desired appearance copy the full "section" including selector and curly braces
|
||||
|
||||

|
||||
|
||||
Then copy it to the "custom.css" file (you can keep everything or only what you have added)
|
||||
|
||||

|
||||
|
||||
NOTE: After saving, your browser may need a uncached reload to show the change (https://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache#Bypassing_cache)
|
||||
@@ -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)
|
||||
|
||||
### coming 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.
|
||||
|
||||

|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
layout: default
|
||||
title: Docker
|
||||
parent: Development
|
||||
has_children: false
|
||||
permalink: /development/docker
|
||||
description: >-
|
||||
Setup docker and docker-compose for quick full stack mainsail development with simulavr without any real printer
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
Install docker and docker-compose on your desired machine.
|
||||
|
||||
### Debian/Ubuntu
|
||||
```shell
|
||||
sudo apt install docker docker-compose
|
||||
```
|
||||
### Mac
|
||||
https://docs.docker.com/docker-for-mac/install/
|
||||
### Windows
|
||||
https://docs.docker.com/docker-for-windows/install/
|
||||
|
||||
## Start
|
||||
1. Look into the docker/config folder. Copy the ".example" without the "example ending".
|
||||
2. Edit the configs to your likings. They are inital setup for a minimal setup environment with simulavr.
|
||||
3. In the root directory of mainsail run
|
||||
```shell
|
||||
docker/run up
|
||||
```
|
||||
|
||||
## Development
|
||||
### Commands
|
||||
```shell
|
||||
docker/run ps # showing running containers
|
||||
docker/run restart <api/npm> # restarting container
|
||||
# api: restarting complete api container with simulavr/moonraker/klipper services,
|
||||
# npm: restarting nodejs container with running 'npm run serve'
|
||||
docker/run bash <api/npm> # spawning bash shell inside container
|
||||
```
|
||||
Restarting the api container will happen a lot, because simulavr WILL crash a lot! Timings within simulavr are not precise and klipper will bug alot about that.
|
||||
## Todo
|
||||
1. The current implementation of simulavr/moonraker/klipper is kinda naiv, because docker wont run with systemd.
|
||||
I will fix that in later versions of the docker container, so you can restart specific containers and omit simulavr and bind a real connected printer for example.
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
layout: default
|
||||
title: Development
|
||||
nav_order: 15
|
||||
has_children: true
|
||||
permalink: /development
|
||||
description: development guide
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
@@ -0,0 +1,43 @@
|
||||
---
|
||||
layout: default
|
||||
title: Standalone
|
||||
parent: Development
|
||||
has_children: false
|
||||
permalink: /development/standalone
|
||||
description: >-
|
||||
Setup the project and start developing with your local printer(s)
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
|
||||
## Setup
|
||||
Make a copy of the '.env.development.local.example' and omit the .example.
|
||||
In the new file edit it to refect your desired printer:
|
||||
```dotenv
|
||||
VUE_APP_HOSTNAME=192.168.0.15 #for your printer with moonraker running on 192.168.0.15
|
||||
```
|
||||
In moonraker you need to add your local ip at the cors_domains:
|
||||
```yaml
|
||||
cors_domains:
|
||||
http://<your local ip>:<local port>
|
||||
```
|
||||
access the local running dev environment with `http://<your local ip>:<local port>`.
|
||||
|
||||
### Nodejs Environment >= v15.9.0
|
||||
Linux
|
||||
```shell
|
||||
curl -sL https://deb.nodesource.com/setup_15.x | sudo -E bash -
|
||||
```
|
||||
Debian/Ubuntu
|
||||
```shell
|
||||
sudo apt-get install -y nodejs
|
||||
```
|
||||
For other package-managers look here:
|
||||
https://nodejs.org/en/download/package-manager/
|
||||
|
||||
## Start
|
||||
```shell
|
||||
npm install # only once and if you updated/installed packages
|
||||
npm run serve # starting current build with hot module reloading
|
||||
```
|
||||
@@ -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: temperature_host
|
||||
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. The gcode will be executed after the selected temperatures are set.
|
||||
|
||||

|
||||
|
||||
### 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.
|
||||
|
||||

|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
layout: default
|
||||
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.
|
||||
---
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
Moonraker has compatibility with Octoprint's API. To enable octoprint api compatibility,
|
||||
add the following to your `moonraker.conf and restart Moonraker.
|
||||
|
||||
```
|
||||
[octoprint_compat]
|
||||
```
|
||||
|
||||
|
||||
### PrusaSlicer/SuperSlicer (prior to v2.3.0)
|
||||
|
||||
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.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer (since v2.3.0)
|
||||
A "Physical Printer" must be defined to configure the settings from above.
|
||||
More detailed instructions will follow.
|
||||
|
||||
### Cura with OctoPrint-Connect
|
||||
Install the OctoPrint-Connection plugin via Marketplace. In `Settings > Printer > Manage Printers...`
|
||||
you can find the Button `Connect OctoPrint`. Add your printer and type anything in the `API Key` field.
|
||||
|
||||

|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
layout: default
|
||||
title: Thumbnails
|
||||
parent: Quicktips
|
||||
permalink: /quicktips/thumbnails
|
||||
description: >-
|
||||
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.
|
||||
|
||||

|
||||
|
||||
### PrusaSlicer/SuperSlicer
|
||||
|
||||
To enable thumbnails, click on `Help > Show Configuration Folder` and navigate to your printer profiles inside the `printer` folder.
|
||||
Open your printer profile in a text editor and find `thumbnails =` and add the resolutions `32x32,400x300`. Save the file and restart your Slicer.
|
||||
|
||||

|
||||
|
||||
From now on the gcode files contain thumbnails displayed by mainsail.
|
||||
|
||||
### Cura
|
||||
|
||||
The Cura plugin "Cura2Moonraker" is required for this. You can find this plugin and a install guide
|
||||
here: [https://github.com/emtrax-ltd/Cura2MoonrakerPlugin](https://github.com/emtrax-ltd/Cura2MoonrakerPlugin)
|
||||
|
||||

|
||||
@@ -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,10 +45,14 @@ config_path: ~/klipper_config
|
||||
enabled: true
|
||||
trusted_clients:
|
||||
192.168.1.0/24
|
||||
2a02:810d:9340:33f6::/64
|
||||
|
||||
[update_manager]
|
||||
client_repo: meteyou/mainsail
|
||||
client_path: ~/mainsail
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
> 🔥 **trusted_clients - read carefully** 🔥
|
||||
@@ -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!**
|
||||
@@ -23,8 +23,11 @@ If you see a content like this
|
||||
To use the update manager in Mainsail you have to add this in your moonraker.conf:
|
||||
```
|
||||
[update_manager]
|
||||
client_repo: meteyou/mainsail
|
||||
client_path: ~/mainsail
|
||||
|
||||
[update_manager client mainsail]
|
||||
type: web
|
||||
repo: meteyou/mainsail
|
||||
path: ~/mainsail
|
||||
```
|
||||
|
||||
### Change Moonraker to systemd service (December 6th 2020)
|
||||
|
||||
@@ -1,46 +1,54 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "0.4.0",
|
||||
"version": "1.4.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",
|
||||
"echarts": "^5.0.2",
|
||||
"echarts-gl": "^2.0.1",
|
||||
"object-assign-deep": "^0.4.0",
|
||||
"prismjs": "^1.22.0",
|
||||
"plotly.js": "^1.58.4",
|
||||
"prismjs": "^1.23.0",
|
||||
"semver": "^7.3.4",
|
||||
"vue": "^2.6.12",
|
||||
"vue-context": "^6.0.0",
|
||||
"vue-github-api": "^0.1.7",
|
||||
"vue-headful": "^2.1.0",
|
||||
"vue-observe-visibility": "^1.0.0",
|
||||
"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.5",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"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"
|
||||
"vuetify-loader": "^1.7.2"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -1,6 +1,8 @@
|
||||
<style>
|
||||
@import './assets/styles/fonts.css';
|
||||
@import './assets/styles/toastr.css';
|
||||
@import './assets/styles/page.scss';
|
||||
@import './assets/styles/utils.scss';
|
||||
|
||||
.button-min-width-auto {
|
||||
min-width: auto !important;
|
||||
@@ -25,15 +27,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 +48,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">
|
||||
{{ category.title }}
|
||||
</span>
|
||||
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
|
||||
</router-link>
|
||||
|
||||
@@ -66,14 +82,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>
|
||||
<input type="file" ref="fileUploadAndStart" :accept="validGcodeExtensions.join(', ')" 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">SAVE CONFIG</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>Upload & Print</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>
|
||||
<top-corner-menu></top-corner-menu>
|
||||
</v-app-bar>
|
||||
|
||||
<v-main id="content">
|
||||
<v-main id="content" v-bind:style="{background:mainBackground,backgroundAttachment:'fixed',backgroundSize: 'cover',backgroundRepeat: 'no-repeat'}">
|
||||
<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 +99,77 @@
|
||||
</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>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"
|
||||
import { validGcodeExtensions } from "@/store/variables"
|
||||
|
||||
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
|
||||
}
|
||||
},
|
||||
validGcodeExtensions: validGcodeExtensions
|
||||
}),
|
||||
created () {
|
||||
this.$vuetify.theme.dark = true;
|
||||
@@ -131,6 +182,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 +197,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,16 +208,36 @@ 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"]
|
||||
}
|
||||
},
|
||||
mainBackground: {
|
||||
get() {
|
||||
return this.$store.getters["files/getMainBackground"]
|
||||
}
|
||||
},
|
||||
customStylesheet: {
|
||||
get() {
|
||||
return this.$store.getters["files/getCustomStylesheet"]
|
||||
}
|
||||
},
|
||||
isUpdateAvailable: {
|
||||
get() {
|
||||
return this.$store.getters["server/updateManager/isUpdateAvailable"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEmergencyStop: function() {
|
||||
@@ -174,10 +245,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 +343,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 +374,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 +392,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 +408,9 @@ export default {
|
||||
let style = document.getElementById("customStylesheet")
|
||||
if (style) style.remove()
|
||||
}
|
||||
},
|
||||
defaultFavicons() {
|
||||
this.drawFavicon(this.print_percent);
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -311,7 +463,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 +477,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 +503,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 +525,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,35 @@
|
||||
.fill-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mb-fix-2 {
|
||||
margin-bottom: -8px!important;
|
||||
}
|
||||
.mr-fix-2 {
|
||||
margin-right: -8px!important;
|
||||
}
|
||||
.mr-fix-1 {
|
||||
margin-right: -4px!important;
|
||||
}
|
||||
|
||||
.gutter-2 {
|
||||
margin: -2px!important;
|
||||
}
|
||||
.gutter-2 > .col, .gutter-2 > [class*=col-] {
|
||||
padding: 1px!important;
|
||||
}
|
||||
|
||||
.w-100 {
|
||||
width: 100%!important;
|
||||
}
|
||||
.h-100 {
|
||||
height: 100%!important;
|
||||
}
|
||||
|
||||
.p-abs {
|
||||
position: absolute!important;
|
||||
}
|
||||
|
||||
.p-rel {
|
||||
position: relative!important;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
@mixin no-select {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.user-select-none {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<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>Connecting<span v-if="connectingFailed"> failed</span><span v-if="isConnecting"> 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>Cannot not connect to {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="reconnect" color="primary">try again</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() {
|
||||
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">Connection to {{ parseInt(port) !== 80 ? hostname+':'+port : hostname }}</span>
|
||||
<span v-if="connectingFailed">Connection failed</span>
|
||||
<span v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">Select Printer</span>
|
||||
<span v-if="dialogAddPrinter.bool">Add Printer</span>
|
||||
<span v-if="dialogEditPrinter.bool">Edit Printer</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>Cannot not connect to {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="switchToChangePrinter" color="white" outlined class="mr-3">change printer</v-btn>
|
||||
<v-btn @click="reconnect" color="primary">try again</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"
|
||||
>
|
||||
add printer
|
||||
</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"
|
||||
>
|
||||
update printer
|
||||
</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-2" 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">Hello and welcome to the remote mode of Mainsail!</p>
|
||||
<p class="text-center">Please remember to add <code>{{ currentUrl }}</code> in moonraker.conf within "cors_domains".</p>
|
||||
<p class="text-center mb-0">You can find more details at <a href="https://docs.mainsail.xyz/remotemode" target="_blank">docs.mainsail.xyz/remotemode</a>.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="dialogAddPrinter.bool = true">add printer</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>
|
||||
@@ -15,25 +15,25 @@
|
||||
<v-list dense>
|
||||
<v-subheader class="" style="height: auto;">Klipper Control</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>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>Firmware Restart</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-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>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>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-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>
|
||||
@@ -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>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">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">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,9 +1,11 @@
|
||||
<template>
|
||||
<div id="tempchart" style="height: 270px; width: 100%;"></div>
|
||||
<div id="tempchart" style="height: 250px; width: 100%;" v-observe-visibility="visibilityChanged"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
|
||||
import { mapState } from 'vuex'
|
||||
import * as echarts from 'echarts'
|
||||
import { convertName } from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -11,81 +13,306 @@ export default {
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
tempchartDisplayMinutes: 10,
|
||||
timer: '',
|
||||
chart : null,
|
||||
timerChart: '',
|
||||
timerDataset: '',
|
||||
isVisable: true,
|
||||
chartOptions: {
|
||||
theme: "dark1",
|
||||
backgroundColor: 'transparent',
|
||||
animationEnabled: true,
|
||||
legend: {
|
||||
horizontalAlign: "center",
|
||||
verticalAlign: "top",
|
||||
darkMode: true,
|
||||
animation: false,
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(0,0,0,0.9)',
|
||||
borderWidth: 0,
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontSize: '14px'
|
||||
},
|
||||
padding: 15,
|
||||
formatter: (datasets) => {
|
||||
let output = ""
|
||||
|
||||
if (datasets.length) {
|
||||
let outputTime = datasets[0]['axisValueLabel']
|
||||
outputTime = outputTime.substr(outputTime.indexOf(" "))
|
||||
|
||||
output += "<div class=\"row\">" +
|
||||
"<div class=\"col py-1\" style='border-bottom: 1px solid rgba(255, 255, 255, 0.24);'>" +
|
||||
"<span class='v-icon mdi mdi-clock theme-dark' style='font-size: 14px; margin-right: 5px;'></span>" +
|
||||
"<span class='font-weight-bold'>"+outputTime+"</span>" +
|
||||
"</div>" +
|
||||
"</div>"
|
||||
}
|
||||
|
||||
datasets.forEach(dataset => {
|
||||
if (
|
||||
!dataset.seriesName.endsWith('_target') &&
|
||||
!dataset.seriesName.endsWith('_power') &&
|
||||
!dataset.seriesName.endsWith('_speed')
|
||||
) {
|
||||
output += "<div class=\"row\">"
|
||||
output += "<div class=\"col-auto py-0\">"
|
||||
|
||||
const mainDataset = this.series.find(tmpDataset => tmpDataset.name === dataset.seriesName)
|
||||
if (mainDataset)
|
||||
output += "<span style=\"" +
|
||||
"display:inline-block;" +
|
||||
"margin-right:10px;" +
|
||||
"width:8px;" +
|
||||
"height:8px;" +
|
||||
"border-radius: 50%;" +
|
||||
"background-color:"+mainDataset.lineStyle.color+"CC;" +
|
||||
"\"></span>"
|
||||
|
||||
output += convertName(dataset.seriesName)+":"
|
||||
|
||||
output += "</div>"
|
||||
output += "<div class=\"col text-right py-0 font-weight-bold\">"
|
||||
|
||||
if (dataset.value[1]) output += dataset.value[1].toFixed(1)
|
||||
|
||||
const target = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_target")
|
||||
if (target) output += " / "+target.value[1].toFixed(1)
|
||||
|
||||
output += "°C"
|
||||
|
||||
const power = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_power")
|
||||
if (power) output += " [ "+power.value[1].toFixed(0)+"% ]"
|
||||
|
||||
const speed = datasets.find(tmpDataset => tmpDataset.seriesName === dataset.seriesName+"_speed")
|
||||
if (speed) output += " [ "+speed.value[1].toFixed(0)+"% ]"
|
||||
|
||||
output += "</div>"
|
||||
output += "</div>"
|
||||
}
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
},
|
||||
toolTip:{
|
||||
content: "{name}: {y}",
|
||||
yValueFormatString: "#,###.00",
|
||||
grid: {
|
||||
top: 35,
|
||||
right: 25,
|
||||
bottom: 30,
|
||||
left: 25,
|
||||
},
|
||||
axisX:{
|
||||
valueFormatString: "HH:mm" ,
|
||||
//labelAngle: -50
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: new Date() - 60*10,
|
||||
maximum: new Date(),
|
||||
margin: 15,
|
||||
dataZoom: [{
|
||||
type: 'inside',
|
||||
}],
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
min: new Date() - 60*10,
|
||||
max: new Date(),
|
||||
splitNumber: 5,
|
||||
minInterval: 60*1000,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.06)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
margin: 10,
|
||||
},
|
||||
},
|
||||
axisY: {
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 300,
|
||||
interval: 50,
|
||||
},
|
||||
data: [ ]
|
||||
yAxis: [
|
||||
{
|
||||
name: 'Temperature [°C]',
|
||||
type: 'value',
|
||||
min: 0,
|
||||
max: 300,
|
||||
minInterval: 10,
|
||||
maxInterval: 100,
|
||||
nameLocation: 'end',
|
||||
nameGap: 5,
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
align: 'left',
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
formatter: '{value}',
|
||||
rotate: 90,
|
||||
//showMaxLabel: false,
|
||||
showMinLabel: true,
|
||||
margin: 5,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
}
|
||||
}, {
|
||||
name: 'PWM [%]',
|
||||
min: 0,
|
||||
max: 100,
|
||||
minInterval: 100,
|
||||
type: 'value',
|
||||
nameLocation: 'end',
|
||||
nameGap: 5,
|
||||
nameTextStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
align: 'right',
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
formatter: '{value}',
|
||||
showMinLabel: true,
|
||||
rotate: 90,
|
||||
margin: 5,
|
||||
},
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.12)',
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
series: [],
|
||||
},
|
||||
chart : null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
intervalChartUpdate: state => state.gui.tempchart.intervalChartUpdate,
|
||||
intervalDatasetUpdate: state => state.gui.tempchart.intervalDatasetUpdate,
|
||||
boolTempchart: state => state.gui.dashboard.boolTempchart,
|
||||
}),
|
||||
maxHistory: {
|
||||
get() {
|
||||
return this.$store.getters["server/getConfig"]('server', 'temperature_store_size') || 1200
|
||||
}
|
||||
},
|
||||
series: {
|
||||
get () {
|
||||
return this.$store.state.printer.tempHistory.series
|
||||
}
|
||||
},
|
||||
datasets: {
|
||||
get () {
|
||||
return this.$store.state.printer.tempHistory.datasets
|
||||
}
|
||||
},
|
||||
autoscale: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.autoscale
|
||||
}
|
||||
},
|
||||
maxTemp: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getMaxTemp"]
|
||||
}
|
||||
},
|
||||
currentMaxTemp: {
|
||||
get() {
|
||||
return this.$store.getters["printer/tempHistory/getCurrentMaxTemp"]
|
||||
}
|
||||
},
|
||||
boolDisplayPwmAxis: {
|
||||
get() {
|
||||
return this.$store.getters["printer/tempHistory/getBoolDisplayPwmAxis"]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
createChart() {
|
||||
if (document.getElementById("tempchart")) {
|
||||
this.chart = new CanvasJS.Chart("tempchart", this.chartOptions)
|
||||
if (document.getElementById("tempchart") && this.chart === null) {
|
||||
this.chart = echarts.init(document.getElementById("tempchart"), null, {renderer: 'canvas'})
|
||||
this.chart.setOption(this.chartOptions)
|
||||
} else setTimeout(() => {
|
||||
this.createChart()
|
||||
}, 500)
|
||||
}
|
||||
|
||||
},
|
||||
visibilityChanged (isVisible) {
|
||||
this.isVisible = isVisible
|
||||
if(isVisible) this.chart.resize()
|
||||
},
|
||||
},
|
||||
created() {
|
||||
|
||||
this.timer = setInterval(() => {
|
||||
this.timerChart = setInterval(() => {
|
||||
if (
|
||||
document.getElementById("tempchart") &&
|
||||
this.chart &&
|
||||
this.chart._toolBar
|
||||
this.boolTempchart &&
|
||||
this.isVisable
|
||||
) {
|
||||
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.chart.render()
|
||||
this.chart.setOption({
|
||||
series: this.series,
|
||||
grid: {
|
||||
left: 25,
|
||||
right: this.boolDisplayPwmAxis ? 25 : 15,
|
||||
},
|
||||
xAxis: {
|
||||
min: new Date() - this.maxHistory * 1000,
|
||||
max: new Date(),
|
||||
},
|
||||
yAxis: [{
|
||||
axisLabel: {
|
||||
rotate: 90,
|
||||
showMinLabel: true,
|
||||
margin: 5,
|
||||
},
|
||||
max: this.autoscale ? this.currentMaxTemp : this.maxTemp,
|
||||
}, {
|
||||
show: this.boolDisplayPwmAxis,
|
||||
axisLabel: {
|
||||
showMinLabel: true,
|
||||
rotate: 90,
|
||||
margin: 5,
|
||||
}
|
||||
}],
|
||||
media: [{
|
||||
query: {
|
||||
minWidth: 500,
|
||||
},
|
||||
option: {
|
||||
grid: {
|
||||
right: this.boolDisplayPwmAxis ? 40 : 15,
|
||||
left: 40,
|
||||
},
|
||||
yAxis: [
|
||||
{
|
||||
maxInterval: 50,
|
||||
axisLabel: {
|
||||
showMinLabel: false,
|
||||
showMaxLabel: true,
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
{
|
||||
maxInterval: 25,
|
||||
axisLabel: {
|
||||
showMinLabel: false,
|
||||
rotate: 0
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
}],
|
||||
})
|
||||
}
|
||||
}, 1000);
|
||||
}, this.intervalChartUpdate)
|
||||
|
||||
this.timerDataset = setInterval(() => {
|
||||
this.$store.dispatch("printer/tempHistory/updateDatasets")
|
||||
}, this.intervalDatasetUpdate)
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.chart) this.chart.resize()
|
||||
})
|
||||
},
|
||||
mounted: function() {
|
||||
this.createChart()
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -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,
|
||||
}
|
||||
@@ -1,70 +1,280 @@
|
||||
<style>
|
||||
.btnHomeAxis {
|
||||
width: 36px;
|
||||
min-width: 36px !important;
|
||||
}
|
||||
<style lang="scss">
|
||||
.btnHomeAxis {
|
||||
width: 36px;
|
||||
min-width: 36px !important;
|
||||
}
|
||||
|
||||
.btnMinWidthAuto {
|
||||
min-width: auto !important;
|
||||
.btnMinWidthAuto {
|
||||
min-width: auto !important;
|
||||
}
|
||||
|
||||
.steps {
|
||||
width: 100%;
|
||||
> div {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
> button {
|
||||
flex-grow: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<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-card>
|
||||
<div>
|
||||
<v-card class="mb-4" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-gamepad</v-icon>Controls</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Controls" left>
|
||||
<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 v-model="useCross" class="mt-0" hide-details label="Alternate controls"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36" v-if="useCross">
|
||||
<v-checkbox v-model="reverseZ" class="mt-0" hide-details label="Invert Z"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-toolbar>
|
||||
<v-container>
|
||||
<template v-if="useCross">
|
||||
<v-row>
|
||||
<v-col :cols="homeCols">
|
||||
<v-row dense class="mb-1">
|
||||
<v-col cols="3"></v-col>
|
||||
<v-col cols="3">
|
||||
<v-btn class="btnMinWidthAuto fill-width"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('Y+'+stepsReversed[selectedCrossStep], feedrateXY)"
|
||||
>
|
||||
<v-icon>mdi-chevron-up</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="3"></v-col>
|
||||
<v-col cols="3">
|
||||
<v-btn class="btnMinWidthAuto fill-width"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('Z'+(reverseZ ? '-' : '+')+stepsReversed[selectedCrossStep], feedrateZ)"
|
||||
>
|
||||
<v-icon>mdi-chevron-up</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row dense>
|
||||
<v-col cols="3" class="p-rel">
|
||||
<v-btn class="btnMinWidthAuto fill-width p-abs" style="top: -50%; width: calc(100% - 8px);"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('X-'+stepsReversed[selectedCrossStep], feedrateXY)"
|
||||
>
|
||||
<v-icon>mdi-chevron-left</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="3">
|
||||
<v-btn class="btnMinWidthAuto fill-width"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('Y-'+stepsReversed[selectedCrossStep], feedrateXY)"
|
||||
>
|
||||
<v-icon>mdi-chevron-down</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="3" class="p-rel">
|
||||
<v-btn class="btnMinWidthAuto fill-width p-abs" style="top: -50%; width: calc(100% - 8px);"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('X+'+stepsReversed[selectedCrossStep], feedrateXY)"
|
||||
>
|
||||
<v-icon>mdi-chevron-right</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="3">
|
||||
<v-btn class="btnMinWidthAuto fill-width"
|
||||
:disabled="selectedCrossStep === null || selectedCrossStep === undefined"
|
||||
@click="doSendMove('Z'+(reverseZ ? '+' : '-')+stepsReversed[selectedCrossStep], feedrateZ)"
|
||||
>
|
||||
<v-icon>mdi-chevron-down</v-icon>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col :cols="homeCols" class="d-flex align-center">
|
||||
<div class="flex-grow-1" style="border-radius: 4px; overflow: hidden;">
|
||||
<v-row dense class="" style="margin-bottom: -2px!important;">
|
||||
<v-col :cols="'quad_gantry_level' in config || 'z_tilt' in config ? 6 : 12">
|
||||
<v-btn class="w-100"
|
||||
tile
|
||||
@click="doHome"
|
||||
height="30"
|
||||
:loading="loadings.includes('homeAll')"
|
||||
:color="homedAxes.includes('xyz') ? 'primary' : 'warning'"
|
||||
>
|
||||
<div class="d-flex align-center">
|
||||
<v-icon>mdi-home</v-icon>
|
||||
<span class="ml-1">ALL</span>
|
||||
</div>
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col v-if="'quad_gantry_level' in config || 'z_tilt' in config" cols="6" class="d-flex">
|
||||
<v-btn v-if="'quad_gantry_level' in config"
|
||||
class="btnMinWidthAuto flex-grow-1 px-0"
|
||||
tile
|
||||
dense
|
||||
color="primary"
|
||||
height="30"
|
||||
:loading="loadings.includes('qgl')"
|
||||
@click="doQGL"
|
||||
>QGL</v-btn>
|
||||
<v-btn v-if="'z_tilt' in config"
|
||||
class="btnMinWidthAuto flex-grow-1 px-0"
|
||||
tile
|
||||
dense
|
||||
color="primary"
|
||||
height="30"
|
||||
:loading="loadings.includes('zTilt')"
|
||||
@click="doZtilt"
|
||||
>Z-Tilt</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row dense class="">
|
||||
<v-col cols="4" class="flex-grow-1">
|
||||
<v-btn class="btnMinWidthAuto w-100"
|
||||
tile
|
||||
height="30"
|
||||
:loading="loadings.includes('homeX')"
|
||||
:color="homedAxes.includes('x') ? 'primary' : 'warning'"
|
||||
@click="doHomeX"
|
||||
>
|
||||
X
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="4" class="flex-grow-1">
|
||||
<v-btn class="btnMinWidthAuto w-100"
|
||||
tile
|
||||
height="30"
|
||||
:loading="loadings.includes('homeY')"
|
||||
:color="homedAxes.includes('y') ? 'primary' : 'warning'"
|
||||
@click="doHomeY"
|
||||
>
|
||||
Y
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col cols="4" class="flex-grow-1">
|
||||
<v-btn class="btnMinWidthAuto w-100"
|
||||
tile
|
||||
height="30"
|
||||
:loading="loadings.includes('homeZ')"
|
||||
:color="homedAxes.includes('z') ? 'primary' : 'warning'"
|
||||
@click="doHomeZ"
|
||||
>
|
||||
Z
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters>
|
||||
<v-col class="col-12">
|
||||
<v-btn-toggle v-if="stepsReversed.length > 0" dense no-gutters style="flex-wrap: nowrap; width: 100%;" v-model="selectedCrossStep">
|
||||
<v-btn dense class="btnMinWidthAuto flex-grow-1 px-0" v-for="steps of stepsReversed" :key="'all-'+steps">
|
||||
<span class="body-2">{{ steps }}</span>
|
||||
</v-btn>
|
||||
</v-btn-toggle>
|
||||
<div class="font-weight-bold warning rounded pa-2" v-else>
|
||||
Please configure steps<br>
|
||||
<router-link style="color: white;" to="/settings/interface">Settings > Interface > Control</router-link>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row no-gutters>
|
||||
<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 no-gutters class="mt-2">
|
||||
<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-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-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>
|
||||
</template>
|
||||
<v-row>
|
||||
<v-col class="pa-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="">
|
||||
<v-col class="col col-md-6 pt-2">
|
||||
<span class="text--disabled" style="font-size: .9em">Feed amount [mm]</span>
|
||||
<v-btn-toggle class="mt-1" 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 === currentFeedAmount ? '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 pt-2">
|
||||
<span class="text--disabled" style="font-size: .9em">Feedrate [mm/s]</span>
|
||||
<v-btn-toggle class="mt-1" 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="(rate === currentFeedRate ? '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 pt-0">
|
||||
<v-btn small @click="sendRetract()" class="mx-3" :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-3" :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-card>
|
||||
<v-card class="mt-6" v-if="this['printer/getMacros'].length > 0">
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>Macros</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-container>
|
||||
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="text-center mr-fix-2 mb-fix-2">
|
||||
<v-btn v-for="(macro, index) in this['printer/getMacros']"
|
||||
:key="index+99"
|
||||
small
|
||||
color="primary"
|
||||
class="mr-2 mb-2"
|
||||
:loading="loadings.includes('macro_'+macro.name)"
|
||||
@click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -75,9 +285,11 @@
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
data() {
|
||||
return {
|
||||
|
||||
crossWidth: 40,
|
||||
crossHeight: 40,
|
||||
homeCols: 6
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -85,59 +297,191 @@
|
||||
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,
|
||||
extruder: state => state.printer.extruder,
|
||||
absolute_coordinates: state => state.printer.gcode_move.absolute_coordinates,
|
||||
|
||||
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
|
||||
feedrates: state => state.gui.dashboard.extruder.feedrates,
|
||||
|
||||
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,
|
||||
stepsAll: state => state.gui.dashboard.control.stepsAll,
|
||||
useCross: state => state.gui.dashboard.control.useCross,
|
||||
reverseZ: state => state.gui.dashboard.control.reverseZ,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getMacros',
|
||||
])
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
reverseZ: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.reverseZ;
|
||||
},
|
||||
set(reverseZ) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { reverseZ } } })
|
||||
}
|
||||
},
|
||||
useCross: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.useCross;
|
||||
},
|
||||
set(useCross) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { useCross } } })
|
||||
}
|
||||
},
|
||||
selectedCrossStep: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.selectedCrossStep;
|
||||
},
|
||||
set(selectedCrossStep) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { selectedCrossStep } } })
|
||||
}
|
||||
},
|
||||
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 })
|
||||
}
|
||||
},
|
||||
steps: {
|
||||
get() {
|
||||
return Array.from(new Set([
|
||||
...(this.stepsAll ?? [])
|
||||
])).entries().sort((a, b) => b-a)
|
||||
}
|
||||
},
|
||||
stepsReversed: {
|
||||
get() {
|
||||
return Array.from(new Set([
|
||||
...(this.stepsAll ?? []),
|
||||
])).sort((a, b) => a-b)
|
||||
}
|
||||
},
|
||||
feedamountsSorted: {
|
||||
get() {
|
||||
return [...this.feedamounts].sort((a,b) => { return b-a })
|
||||
}
|
||||
},
|
||||
feedratesSorted: {
|
||||
get() {
|
||||
return [...this.feedrates].sort((a,b) => { return b-a })
|
||||
}
|
||||
},
|
||||
currentFeedAmount: {
|
||||
get() {
|
||||
return parseFloat(this.$store.state.gui.dashboard.extruder.feedamount)
|
||||
},
|
||||
set(newVal) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamount: newVal } } })
|
||||
}
|
||||
},
|
||||
currentFeedRate: {
|
||||
get() {
|
||||
return parseFloat(this.$store.state.gui.dashboard.extruder.feedrate)
|
||||
},
|
||||
set(newVal) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrate: newVal } } })
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
window.addEventListener('resize', this.onResize);
|
||||
},
|
||||
mounted() {
|
||||
if (window.screen.width < 330) {
|
||||
this.homeCols = 12;
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
window.removeEventListener('resize', this.onResize);
|
||||
},
|
||||
methods: {
|
||||
onResize() {
|
||||
this.homeCols = window.screen.width < 360 ? 12 : 6;
|
||||
},
|
||||
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) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F6000" + "\n" +
|
||||
"G90";
|
||||
doSendMove(gcode, feedrate) {
|
||||
if (this.absolute_coordinates) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F"+feedrate*60 + "\n" +
|
||||
"G90"
|
||||
} else gcode = "G1 " + gcode + " F"+feedrate*60
|
||||
|
||||
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 });
|
||||
},
|
||||
}
|
||||
setFeedAmount(value) {
|
||||
this.currentFeedAmount = value;
|
||||
},
|
||||
setFeedrate(value) {
|
||||
this.currentFeedRate = value;
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.currentFeedAmount+" F"+(this.currentFeedRate * 60);
|
||||
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.currentFeedAmount+" F"+(this.currentFeedRate * 60);
|
||||
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' });
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -1,78 +0,0 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<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-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
extruder: state => state.printer.extruder,
|
||||
config: state => state.printer.configfile.config
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
this.feedAmount = value;
|
||||
},
|
||||
setFeedrate(value) {
|
||||
this.feedrate = value;
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
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('socket/addLoading', { name: 'btnDetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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>
|
||||
@@ -15,8 +15,8 @@
|
||||
</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>Restart</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>FIRMWARE Restart</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
!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
|
||||
@@ -19,13 +19,15 @@
|
||||
<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> is not defined in config.</p>
|
||||
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> is not defined in config.</p>
|
||||
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> is not defined in config.</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>more information</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
|
||||
<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">
|
||||
@@ -40,29 +40,31 @@
|
||||
</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="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-container>
|
||||
</v-card-text>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<v-divider></v-divider>
|
||||
@@ -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' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,19 +23,29 @@
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</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>
|
||||
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" :dynamic-range="true" 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>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"
|
||||
:rpm="object.rpm"
|
||||
:controllable="object.controllable"
|
||||
:pwm="object.pwm"
|
||||
:off_below="object.off_below"
|
||||
:max="object.max_power"
|
||||
:multi="parseInt(object.scale)"
|
||||
></miscellaneous-slider>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
@@ -43,12 +53,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,9 +73,8 @@
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getFans',
|
||||
'printer/getPartFanSpeed',
|
||||
'printer/getMiscellaneous',
|
||||
]),
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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>Moonraker Failed Plugins
|
||||
</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">An error was detected while loading the moonraker plugins. Please check the logfile and fix the issue.</p>
|
||||
<p class="mb-2 orange--text">Following plugin has an error:</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>Download Log</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,189 @@
|
||||
</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>
|
||||
Config Files
|
||||
<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="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">
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
<template #no-data>
|
||||
<div class="text-center">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
|
||||
v-longpress:600="(e) => showContextMenu(e, item)"
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor user-select-none"
|
||||
: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, true)" 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>
|
||||
</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>Config Reference</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">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>Save & restart</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>
|
||||
<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>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>
|
||||
@@ -243,6 +274,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 +296,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() {
|
||||
@@ -276,7 +322,7 @@
|
||||
highlighter(code) {
|
||||
return highlight(code, languages.ini); //returns html
|
||||
},
|
||||
refreshFileList: function() {
|
||||
refreshFileList() {
|
||||
if (this.currentPath === "") {
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config' }, 'files/getDirectory');
|
||||
this.$socket.sendObj('server.files.get_directory', { path: 'config_examples' }, 'files/getDirectory');
|
||||
@@ -332,42 +378,47 @@
|
||||
}
|
||||
return items;
|
||||
},
|
||||
loadPath: function() {
|
||||
loadPath() {
|
||||
let dirArray = this.currentPath.substring(1).split("/");
|
||||
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
if (dirArray.length === 1 && this.currentPath === "") {
|
||||
this.files = this.files.filter(element => element.filename !== "gcodes");
|
||||
this.files = this.files.filter(element => !["gcodes", "docs"].includes(element.filename))
|
||||
}
|
||||
|
||||
if (!this.showHiddenFiles) {
|
||||
this.files = this.files.filter(file => file.filename.substr(0, 1) !== ".");
|
||||
}
|
||||
},
|
||||
clickRow: function(item) {
|
||||
if (!item.isDirectory) {
|
||||
this.editor.showLoader = true;
|
||||
this.editor.sourcecode = "";
|
||||
this.editor.item = item;
|
||||
clickRow(item, force = false) {
|
||||
if (!this.contextMenu.shown || force) {
|
||||
if (force) {
|
||||
this.contextMenu.shown = false;
|
||||
}
|
||||
if (!item.isDirectory) {
|
||||
this.editor.showLoader = true;
|
||||
this.editor.sourcecode = "";
|
||||
this.editor.item = item;
|
||||
|
||||
let url = '//'+this.hostname+':'+this.port+'/server/files'+this.currentPath+'/'+item.filename+'?time='+Date.now();
|
||||
fetch(url, { cache: "no-cache" }).then(res => res.text()).then(file => {
|
||||
this.editor.sourcecode = file;
|
||||
this.editor.show = true;
|
||||
this.editor.showLoader = false;
|
||||
this.editor.readonly = false;
|
||||
if (this.currentPath === '/config_examples') this.editor.readonly = true;
|
||||
});
|
||||
let url = '//' + this.hostname + ':' + this.port + '/server/files' + this.currentPath + '/' + item.filename + '?time=' + Date.now();
|
||||
fetch(url, {cache: "no-cache"}).then(res => res.text()).then(file => {
|
||||
this.editor.sourcecode = file;
|
||||
this.editor.show = true;
|
||||
this.editor.showLoader = false;
|
||||
this.editor.readonly = false;
|
||||
if (this.currentPath === '/config_examples') this.editor.readonly = true;
|
||||
});
|
||||
|
||||
} else {
|
||||
this.currentPath += "/"+item.filename;
|
||||
this.currentPage = 1;
|
||||
} else {
|
||||
this.currentPath += "/" + item.filename;
|
||||
this.currentPage = 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
clickRowGoBack: function() {
|
||||
clickRowGoBack() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
|
||||
},
|
||||
saveFile: function() {
|
||||
saveFile(boolRestart = false) {
|
||||
let file = new File([this.editor.sourcecode], this.editor.item.filename);
|
||||
|
||||
let formData = new FormData();
|
||||
@@ -383,25 +434,34 @@
|
||||
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);
|
||||
});
|
||||
},
|
||||
showContextMenu (e, item) {
|
||||
e.preventDefault();
|
||||
this.contextMenu.shown = true;
|
||||
this.contextMenu.x = e.clientX;
|
||||
this.contextMenu.y = e.clientY;
|
||||
this.contextMenu.item = item;
|
||||
this.$nextTick(() => {
|
||||
this.contextMenu.shown = true
|
||||
});
|
||||
if (!this.contextMenu.shown) {
|
||||
e?.preventDefault();
|
||||
this.contextMenu.shown = true;
|
||||
this.contextMenu.x = e?.clientX || e?.pageX || window.screenX / 2;
|
||||
this.contextMenu.y = e?.clientY || e?.pageY || window.screenY / 2;
|
||||
this.contextMenu.item = item;
|
||||
this.$nextTick(() => {
|
||||
this.contextMenu.shown = true
|
||||
});
|
||||
}
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
link.download = name;
|
||||
link.href = '//' + 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,45 +513,83 @@
|
||||
}, '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() {
|
||||
deleteDirectoryAction() {
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteDir');
|
||||
},
|
||||
uploadFileButton: function() {
|
||||
uploadFileButton() {
|
||||
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) {
|
||||
doUploadFile(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() {
|
||||
this.uploadSnackbar.cancelTokenSource.cancel()
|
||||
this.uploadSnackbar.status = false
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -10,26 +10,29 @@
|
||||
</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="Hide temperatures" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolCustomFilters" label="Custom filter" 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="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,281 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-form ref="formControlExtruder">
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>Control</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-0">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Speed XY"
|
||||
v-model="feedrateXY"
|
||||
@blur="blurFeedrateXY"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v > 0 || 'Minimum speed is 1'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Speed Z"
|
||||
v-model="feedrateZ"
|
||||
@blur="blurFeedrateZ"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
hide-details="auto"
|
||||
ref="feedrateZ"
|
||||
:rules="[
|
||||
v => v > 1 || 'Minimum speed is 1'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="useCross" label="Enable movement cross" hide-details="auto" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<template v-if="useCross">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances in mm"
|
||||
v-model="stepsAll"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 9 || 'For narrow screens it is recommended to enter max. 3 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="pt-0">
|
||||
<v-switch v-model="reverseZ" label="Reverse Z movement" hide-details="auto" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances XY in mm"
|
||||
v-model="stepsXY"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances Z in mm"
|
||||
v-model="stepsZ"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 4 || 'For narrow screens it is recommended to enter max. 3 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-card class="mt-6">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>Extruder</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pa-0">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Move distances E in mm"
|
||||
v-model="feedamountsE"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-combobox
|
||||
label="Speed E in mm/s"
|
||||
v-model="feedratesE"
|
||||
hide-selected
|
||||
hide-details="auto"
|
||||
multiple
|
||||
small-chips
|
||||
:deletable-chips="true"
|
||||
append-icon=""
|
||||
type="number"
|
||||
:rules="[
|
||||
v => v.length > 0 || 'Minimum 1 value',
|
||||
v => v.length < 6 || 'For narrow screens it is recommended to enter max. 5 values.',
|
||||
]"
|
||||
></v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
reverseZ: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.reverseZ;
|
||||
},
|
||||
set(reverseZ) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { reverseZ } } })
|
||||
}
|
||||
},
|
||||
useCross: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.useCross;
|
||||
},
|
||||
set(useCross) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { useCross } } })
|
||||
}
|
||||
},
|
||||
feedrateXY: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateXY
|
||||
},
|
||||
set(feedrate) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: feedrate } } })
|
||||
}
|
||||
},
|
||||
stepsAll: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.control.stepsAll
|
||||
return (steps ?? []).sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(steps) {
|
||||
const absSteps = []
|
||||
for(const value of steps) absSteps.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsAll: absSteps } } })
|
||||
}
|
||||
},
|
||||
stepsXY: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.control.stepsXY
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(steps) {
|
||||
const absSteps = []
|
||||
for(const value of steps) absSteps.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsXY: absSteps } } })
|
||||
}
|
||||
},
|
||||
feedrateZ: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.control.feedrateZ
|
||||
},
|
||||
set(value) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateZ: value } } })
|
||||
}
|
||||
},
|
||||
stepsZ: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.control.stepsZ
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(steps) {
|
||||
const absSteps = []
|
||||
for(const value of steps) absSteps.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { stepsZ: absSteps } } })
|
||||
}
|
||||
},
|
||||
feedamountsE: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.extruder.feedamounts
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(amounts) {
|
||||
const absAmounts = []
|
||||
for(const value of amounts) absAmounts.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedamounts: absAmounts } } })
|
||||
}
|
||||
},
|
||||
feedratesE: {
|
||||
get() {
|
||||
const steps = this.$store.state.gui.dashboard.extruder.feedrates
|
||||
return steps.sort(function (a,b) { return b-a })
|
||||
},
|
||||
set(rates) {
|
||||
const absRates = []
|
||||
for(const value of rates) absRates.push(Math.abs(value))
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { extruder: { feedrates: absRates } } })
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.formControlExtruder.validate()
|
||||
},
|
||||
methods: {
|
||||
blurFeedrateXY() {
|
||||
if (!(this.feedrateXY > 0)) this.feedrateXY = 100
|
||||
},
|
||||
blurFeedrateZ() {
|
||||
if (!(this.feedrateZ > 0)) this.feedrateZ = 25
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,32 +1,60 @@
|
||||
<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>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="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="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="Console" hide-details class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-2">
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Chart update interval"
|
||||
v-model="intervalChartUpdate"
|
||||
@blur="blurIntervalChartUpdate"
|
||||
type="number"
|
||||
suffix="ms"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v >= 500 || 'Minimum is 500ms'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col col-6>
|
||||
<v-text-field
|
||||
label="Datapoint interval"
|
||||
type="number"
|
||||
v-model="intervalDatasetUpdate"
|
||||
@blur="blurIntervalDatasetUpdate"
|
||||
suffix="ms"
|
||||
hide-details="auto"
|
||||
:rules="[
|
||||
v => v >= 500 || 'Minimum is 500ms'
|
||||
]"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -55,7 +83,7 @@
|
||||
return this.$store.state.gui.dashboard.boolTempchart;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolTempchart: status } });
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolTempchart: status } })
|
||||
}
|
||||
},
|
||||
boolShowConsoleOnDashboard: {
|
||||
@@ -63,12 +91,33 @@
|
||||
return this.$store.state.gui.dashboard.boolConsole;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolConsole: status } });
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolConsole: status } })
|
||||
}
|
||||
},
|
||||
intervalChartUpdate: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.intervalChartUpdate
|
||||
},
|
||||
set(newVal) {
|
||||
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { tempchart: { intervalChartUpdate: newVal } })
|
||||
}
|
||||
},
|
||||
intervalDatasetUpdate: {
|
||||
get() {
|
||||
return this.$store.state.gui.tempchart.intervalDatasetUpdate
|
||||
},
|
||||
set(newVal) {
|
||||
if (newVal >= 500) return this.$store.dispatch('gui/setSettings', { tempchart: { intervalDatasetUpdate: newVal } })
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
blurIntervalDatasetUpdate() {
|
||||
if (this.intervalDatasetUpdate < 500) this.intervalDatasetUpdate = 500
|
||||
},
|
||||
blurIntervalChartUpdate() {
|
||||
if (this.intervalChartUpdate < 500) this.intervalChartUpdate = 500
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -6,19 +6,19 @@
|
||||
</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">
|
||||
<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">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>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
@@ -1,27 +1,78 @@
|
||||
<style>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-cog</v-icon>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>
|
||||
</v-card>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-cog</v-icon>General</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model="printerName"
|
||||
label="Printer Name"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="displayCancelPrint" hide-details class="mt-0">
|
||||
<template v-slot:label>
|
||||
Display CANCEL_PRINT
|
||||
<v-tooltip right>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon class="text--secondary ml-2" v-bind="attrs" v-on="on">mdi mdi-information</v-icon>
|
||||
</template>
|
||||
<span>Shows the CANCEL_PRINT button permanently - no second layer confirmation needed.</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
</v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn @click="dialogResetMainsail=true" >factory reset</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="dialogResetMainsail" persistent :width="300">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-help-circle" left></v-icon> Factory reset
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" @click="dialogResetMainsail = 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-row>
|
||||
<v-col>
|
||||
<p class="text-center mb-0">Do you really want to reset mainsail to factory settings?</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
color="red"
|
||||
@click="resetMainsail"
|
||||
>
|
||||
reset mainsail
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -31,21 +82,32 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
dialogResetMainsail: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
printerName: {
|
||||
get() {
|
||||
return this.$store.state.gui.general.printername;
|
||||
return this.$store.state.gui.general.printername
|
||||
},
|
||||
set(newName) {
|
||||
return this.$store.dispatch('gui/setSettings', { general: { printername: newName } });
|
||||
return this.$store.dispatch('gui/setSettings', { general: { printername: newName } })
|
||||
}
|
||||
},
|
||||
displayCancelPrint: {
|
||||
get() {
|
||||
return this.$store.state.gui.general.displayCancelPrint;
|
||||
},
|
||||
set(displayCancelPrint) {
|
||||
return this.$store.dispatch('gui/setSettings', { general: { displayCancelPrint: displayCancelPrint } });
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
resetMainsail() {
|
||||
this.$store.dispatch('gui/resetMoonrakerDB')
|
||||
this.dialogResetMainsail = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -5,13 +5,13 @@
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</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="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" :default-value="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="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" :default-value="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="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" :default-value="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="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" :default-value="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
current_accel: state => state.printer.toolhead.max_accel,
|
||||
current_accel_to_decel: state => state.printer.toolhead.max_accel_to_decel,
|
||||
current_square_corner_velocity: state => state.printer.toolhead.square_corner_velocity,
|
||||
config: state => state.printer.configfile.config,
|
||||
max_velocity: state => parseInt(state.printer.configfile.config.printer.max_velocity) || 0,
|
||||
max_accel: state => parseInt(state.printer.configfile.config.printer.max_accel) || 0,
|
||||
max_accel_to_decel: state => parseInt(state.printer.configfile.config.printer.max_accel_to_decel) || parseInt(state.printer.configfile.config.printer.max_accel) / 2,
|
||||
max_square_corner_velocity: state => parseInt(state.printer.configfile.config.printer.square_corner_velocity) || 5,
|
||||
config: state => state.printer.configfile.settings,
|
||||
max_velocity: state => state.printer.configfile.settings.printer.max_velocity || 0,
|
||||
max_accel: state => state.printer.configfile.settings.printer.max_accel || 0,
|
||||
max_accel_to_decel: state => state.printer.configfile.settings.printer.max_accel_to_decel || 0,
|
||||
max_square_corner_velocity: state => state.printer.configfile.settings.printer.square_corner_velocity || 0,
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
</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>
|
||||
|
||||
@@ -7,13 +7,18 @@
|
||||
</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-row v-if="this['printer/getAllMacros'].length === 0">
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">No macros found...</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,346 @@
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-fire</v-icon>Preheat Presets</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-3" 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-2" style="cursor: pointer;">
|
||||
<v-row align="center">
|
||||
<v-col class="pl-6">
|
||||
<strong>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">add preset</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 ? "Create" : "Edit" }} 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="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="Custom G-Code"
|
||||
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">You have to set minimum a target temperature or a custom gcode.</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 ? "store" : "update" }} 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> Edit Cooldown
|
||||
</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="Custom G-Code"
|
||||
v-model="cooldownDialog.gcode"
|
||||
:rules="[rules.required]"
|
||||
hide-details="auto"
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
color="white"
|
||||
outlined
|
||||
type="submit"
|
||||
>
|
||||
update cooldown
|
||||
</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.cooldown_gcode,
|
||||
}),
|
||||
...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", { cooldown_gcode: 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>Remote Printers</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-3" 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">add printer</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>
|
||||
Add Printer
|
||||
</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"
|
||||
>
|
||||
add printer
|
||||
</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"
|
||||
>
|
||||
add printer
|
||||
</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>
|
||||
Edit Printer
|
||||
</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"
|
||||
>
|
||||
update printer
|
||||
</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"
|
||||
>
|
||||
update printer
|
||||
</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>
|
||||