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 |
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
|
||||
@@ -15,4 +15,4 @@ For support join our discord server -> [https://discord.gg/skWTwTD](https://disc
|
||||
* [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
|
||||
@@ -2,7 +2,7 @@ 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"
|
||||
theme: just-the-docs
|
||||
# theme: just-the-docs
|
||||
remote_theme: pmarsceill/just-the-docs
|
||||
color_scheme: "mainsail"
|
||||
search_enabled: true
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
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 |
|
Before Width: | Height: | Size: 382 KiB After Width: | Height: | Size: 336 KiB |
@@ -6,11 +6,49 @@ nav_order: 99
|
||||
permalink: /customizing/custom-css
|
||||
---
|
||||
|
||||
## 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)
|
||||
@@ -18,5 +18,5 @@ are not yet listed below, please create a FR (feature request) on Github.
|
||||
- [change favicon](favicon.md)
|
||||
- [upload custom.css](custom-css.md)
|
||||
|
||||
### cooming soon
|
||||
- change primary color (all blue buttons atm)
|
||||
### coming soon
|
||||
- change primary color (all blue buttons atm)
|
||||
@@ -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
|
||||
```
|
||||
@@ -17,7 +17,7 @@ Append the following section to your printer.cfg:
|
||||
|
||||
```yaml
|
||||
[temperature_sensor raspberry_pi]
|
||||
sensor_type: rpi_temperature
|
||||
sensor_type: temperature_host
|
||||
min_temp: 10
|
||||
max_temp: 100
|
||||
```
|
||||
|
||||
@@ -16,7 +16,7 @@ In Mainsails interface settings you will find a section called "Preheat Presets"
|
||||
|
||||
### 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.
|
||||
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.
|
||||
|
||||

|
||||
|
||||
|
||||
@@ -9,7 +9,13 @@ description: >-
|
||||
|
||||
# {{ page.title }}
|
||||
{{ page.description }}
|
||||
Moonraker has compatibility with Octoprint's legacy file upload API.
|
||||
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)
|
||||
|
||||
@@ -21,3 +27,9 @@ 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.
|
||||
|
||||

|
||||
@@ -17,7 +17,7 @@ description: >-
|
||||
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)
|
||||
|
||||
@@ -33,3 +33,10 @@ Open your printer profile in a text editor and find `thumbnails =` and add the r
|
||||

|
||||
|
||||
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)
|
||||
|
||||

|
||||
@@ -48,8 +48,11 @@ trusted_clients:
|
||||
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** 🔥
|
||||
|
||||
@@ -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,6 +1,6 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "1.2.0",
|
||||
"version": "1.4.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -11,20 +11,24 @@
|
||||
"dependencies": {
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.8.2",
|
||||
"echarts": "^5.0.2",
|
||||
"echarts-gl": "^2.0.1",
|
||||
"object-assign-deep": "^0.4.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-i18n": "^8.22.4",
|
||||
"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.4.2",
|
||||
"vuex": "^3.6.0"
|
||||
"vuetify": "^2.4.5",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "^5.8.55",
|
||||
@@ -44,7 +48,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,
|
||||
|
||||
@@ -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;
|
||||
@@ -57,7 +59,7 @@
|
||||
v-if="category.title === 'Settings' && isUpdateAvailable"
|
||||
>mdi-progress-upload</v-icon>
|
||||
<span class="nav-title">
|
||||
{{ $t(`Router.${category.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,7 +68,7 @@
|
||||
<li v-for="(page, pageIndex) in category.children" class="nav-item" v-bind:key="`${index}-${pageIndex}`">
|
||||
<router-link :to="page.path" class="nav-link" @click.prevent v-if="klippy_state !== 'error' || page.alwaysShow">
|
||||
<v-icon>mdi-{{ page.icon }}</v-icon>
|
||||
<span class="nav-title">{{ $t(`Router.${page.title}`) }}</span>
|
||||
<span class="nav-title">{{ page.title }}</span>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -80,14 +82,14 @@
|
||||
<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=".gcode, .ufp" style="display: none" @change="uploadAndStart" />
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :disabled="['printing', 'paused'].includes(printer_state)" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">{{ $t("App.SAVECONFIG")}}</v-btn>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && ['standby', 'complete'].includes(printer_state)" :loading="loadings.includes['btnUploadAndStart']" @click="btnUploadAndStart"><v-icon class="mr-2">mdi-file-upload</v-icon>{{ $t("App.UploadPrint")}}</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">{{ $t("App.EmergencyStop")}}</span></v-btn>
|
||||
<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-3 px-sm-6 py-sm-6 mx-auto">
|
||||
<keep-alive>
|
||||
@@ -106,7 +108,7 @@
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<strong>{{ $t("App.Uploading")}} {{ uploadSnackbar.filename }}</strong><br />
|
||||
<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 }">
|
||||
@@ -133,10 +135,11 @@
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import TopCornerMenu from "@/components/TopCornerMenu"
|
||||
import UpdateDialog from "@/components/UpdateDialog"
|
||||
import ConnectingDialog from "@/components/ConnectingDialog";
|
||||
import SelectPrinterDialog from "@/components/SelectPrinterDialog";
|
||||
import ConnectingDialog from "@/components/ConnectingDialog"
|
||||
import SelectPrinterDialog from "@/components/SelectPrinterDialog"
|
||||
import PrinterSelecter from "@/components/PrinterSelecter"
|
||||
import axios from "axios";
|
||||
import axios from "axios"
|
||||
import { validGcodeExtensions } from "@/store/variables"
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -165,7 +168,8 @@ export default {
|
||||
time: 0,
|
||||
loaded: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
validGcodeExtensions: validGcodeExtensions
|
||||
}),
|
||||
created () {
|
||||
this.$vuetify.theme.dark = true;
|
||||
@@ -219,6 +223,11 @@ export default {
|
||||
return this.$store.getters["files/getSidebarBackground"]
|
||||
}
|
||||
},
|
||||
mainBackground: {
|
||||
get() {
|
||||
return this.$store.getters["files/getMainBackground"]
|
||||
}
|
||||
},
|
||||
customStylesheet: {
|
||||
get() {
|
||||
return this.$store.getters["files/getCustomStylesheet"]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>{{ $t("App.Connecting") }}<span v-if="connectingFailed"> {{ $t("App.Failed") }}</span><span v-if="isConnecting"> {{ $t("App.To") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}</span>
|
||||
<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>
|
||||
@@ -16,9 +16,9 @@
|
||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
|
||||
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
|
||||
<p>Cannot not connect to {{ parseInt(port) !== 80 && port !== "" ? hostname+":"+port : hostname }}.</p>
|
||||
<div class="text-center">
|
||||
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
|
||||
<v-btn @click="reconnect" color="primary">try again</v-btn>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
@@ -65,7 +65,6 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
connect() {
|
||||
window.console.log("save connection")
|
||||
Vue.prototype.$socket.setUrl(this.protocol+"://"+this.hostname+":"+this.port+"/websocket")
|
||||
Vue.prototype.$socket.connect()
|
||||
},
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
<span v-if="isConnecting">{{ $t("App.ConnectionTo") }}{{ parseInt(port) !== 80 ? hostname+':'+port : hostname }}</span>
|
||||
<span v-if="connectingFailed">{{ $t("App.ConnectionFailed") }}</span>
|
||||
<span v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">{{ $t("App.SelectPrinter") }}</span>
|
||||
<span v-if="dialogAddPrinter.bool">{{ $t("App.AddPrinter") }}</span>
|
||||
<span v-if="dialogEditPrinter.bool">{{ $t("App.EditPrinter") }}</span>
|
||||
<span v-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>
|
||||
@@ -25,10 +25,10 @@
|
||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
<v-card-text class="pt-5" v-if="!isConnecting && connectingFailed">
|
||||
<p>{{ $t("App.CannotNotConnectTo") }} {{ parseInt(port) !== 80 ? hostname+":"+port : hostname }}.</p>
|
||||
<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">{{ $t("App.ChangePrinter") }}</v-btn>
|
||||
<v-btn @click="reconnect" color="primary">{{ $t("App.TryAgain") }}</v-btn>
|
||||
<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">
|
||||
@@ -63,7 +63,7 @@
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t("App.AddPrinter") }}
|
||||
add printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -111,7 +111,7 @@
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t("App.UpdatePrinter") }}
|
||||
update printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -120,7 +120,7 @@
|
||||
<v-card-text class="pt-3" v-if="!isConnecting && !connectingFailed && !dialogAddPrinter.bool && !dialogEditPrinter.bool">
|
||||
<v-container class="px-0 pb-0">
|
||||
<v-row v-for="(printer, index) in this['farm/getPrinters']" v-bind:key="index">
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;" @click="connect(printer)">
|
||||
<v-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
|
||||
@@ -140,14 +140,14 @@
|
||||
</v-row>
|
||||
<v-row v-if="showCorsInfo">
|
||||
<v-col>
|
||||
<p class="text-center" v-if="this['farm/countPrinters'] === 0">{{ $t("App.Hello") }}</p>
|
||||
<p class="text-center">{{ $t("App.PleaseRememberToAdd") }}<code>{{ currentUrl }}</code> {{ $t("App.InMoonrakerConf") }}</p>
|
||||
<p class="text-center">{{ $t("App.YouCanFindMore") }}<a href="https://docs.mainsail.xyz/remotemode" target="_blank">{{ $t("App.Remotemode") }}</a>.</p>
|
||||
<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">{{ $t("App.AddPrinter") }}</v-btn>
|
||||
<v-btn @click="dialogAddPrinter.bool = true">add printer</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
@@ -13,24 +13,24 @@
|
||||
</template>
|
||||
|
||||
<v-list dense>
|
||||
<v-subheader class="" style="height: auto;">{{ $t("App.KlipperControl") }}</v-subheader>
|
||||
<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-restart</v-icon>{{ $t("App.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-restart</v-icon>{{ $t("App.FirmwareRestart") }}</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;">{{ $t("App.RestartServices") }}</v-subheader>
|
||||
<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-restart</v-icon>{{ $t("App.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-restart</v-icon>{{ $t("App.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;">{{ $t("App.PowerDevices") }}</v-subheader>
|
||||
<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' || device.locked_while_printing && ['printing', 'paused'].includes(printer_state))">
|
||||
<v-list-item-title>
|
||||
<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 }}
|
||||
@@ -38,12 +38,12 @@
|
||||
</v-list-item>
|
||||
</div>
|
||||
<v-divider class="mt-0"></v-divider>
|
||||
<v-subheader class="pt-2" style="height: auto;">{{ $t("App.HostControl") }}</v-subheader>
|
||||
<v-subheader class="pt-2" style="height: auto;">Host Control</v-subheader>
|
||||
<v-list-item class="minheight30" link @click="doHostReboot()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Reboot") }}</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Reboot</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="minheight30" link @click="doHostShutdown()">
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>{{ $t("App.Shutdown") }}</v-list-item-title>
|
||||
<v-list-item-title><v-icon class="mr-2" small>mdi-power</v-icon>Shutdown</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
</template>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t("App.Updating")}} {{ application }}{{ complete ? " done!" : "..." }}</span>
|
||||
<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">
|
||||
@@ -45,7 +45,7 @@
|
||||
color="primary"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="py-2">{{ $t("App.Empty")}}</div>
|
||||
<div class="py-2">empty</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
@@ -61,7 +61,7 @@
|
||||
</v-data-table>
|
||||
<v-row>
|
||||
<v-col class="text-center pt-5">
|
||||
<v-btn @click="close" :disabled="!complete" color="primary">{{ $t("App.Close")}}</v-btn>
|
||||
<v-btn @click="close" :disabled="!complete" color="primary">close</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<div id="tempchart" style="height: 300px; width: 100%;"></div>
|
||||
<div id="tempchart" style="height: 250px; width: 100%;" v-observe-visibility="visibilityChanged"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import CanvasJS from '@/assets/canvasjs-3.2.3/canvasjs.min'
|
||||
import * as echarts from 'echarts'
|
||||
import { convertName } from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -13,92 +14,172 @@ export default {
|
||||
data: function() {
|
||||
return {
|
||||
chart : null,
|
||||
tempchartDisplayMinutes: 10,
|
||||
timerChart: '',
|
||||
timerDataset: '',
|
||||
isVisable: true,
|
||||
chartOptions: {
|
||||
theme: "dark1",
|
||||
zoomEnabled: true,
|
||||
backgroundColor: 'transparent',
|
||||
animationEnabled: true,
|
||||
legend: {
|
||||
horizontalAlign: "center",
|
||||
verticalAlign: "top",
|
||||
},
|
||||
toolTip:{
|
||||
shared: true,
|
||||
borderColor: "#ffffff30",
|
||||
content: (e) => {
|
||||
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 (e.entries[0].dataPoint.x) {
|
||||
const date = new Date(e.entries[0].dataPoint.x)
|
||||
const hours = "0" + date.getHours();
|
||||
const minutes = "0" + date.getMinutes();
|
||||
const seconds = "0" + date.getSeconds();
|
||||
output += "<strong>"+hours.substr(-2) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2)+"</strong>"
|
||||
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>"
|
||||
}
|
||||
|
||||
const mainEntries = e.entries.filter(dataset => dataset.dataSeries.showInLegend && dataset.dataSeries.visible).sort((a,b) => {
|
||||
if (a.dataSeries.legendText > b.dataSeries.legendText) return 1
|
||||
if (a.dataSeries.legendText < b.dataSeries.legendText) return -1
|
||||
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\">"
|
||||
|
||||
return 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>"
|
||||
|
||||
if (mainEntries.length) {
|
||||
mainEntries.forEach(dataset => {
|
||||
output += "<br />"
|
||||
output += dataset.dataSeries.legendText+": "+dataset.dataPoint.y.toFixed(1)
|
||||
output += convertName(dataset.seriesName)+":"
|
||||
|
||||
const datasetTarget = e.entries.find(datasetTarget => datasetTarget.dataSeries.name === dataset.dataSeries.name+"_target")
|
||||
if (datasetTarget) {
|
||||
output += " / "+datasetTarget.dataPoint.y.toFixed(1)
|
||||
}
|
||||
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 datasetPower = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_power")
|
||||
if (datasetPower) {
|
||||
output += " at "+datasetPower.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
|
||||
const datasetSpeed = e.entries.find(datasetPower => datasetPower.dataSeries.name === dataset.dataSeries.name+"_speed")
|
||||
if (datasetSpeed) {
|
||||
output += " at "+datasetSpeed.dataPoint.y.toFixed(0)+"%"
|
||||
}
|
||||
})
|
||||
}
|
||||
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
|
||||
}
|
||||
},
|
||||
axisX:{
|
||||
valueFormatString: "HH:mm" ,
|
||||
//labelAngle: -50
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: new Date() - 60*10,
|
||||
maximum: new Date(),
|
||||
margin: 15,
|
||||
grid: {
|
||||
top: 35,
|
||||
right: 25,
|
||||
bottom: 30,
|
||||
left: 25,
|
||||
},
|
||||
axisY: {
|
||||
gridThickness: 1,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 300,
|
||||
interval: 50,
|
||||
suffix: '°C'
|
||||
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,
|
||||
},
|
||||
},
|
||||
axisY2: {
|
||||
gridThickness: 0,
|
||||
gridColor: '#ffffff30',
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
interval: 25,
|
||||
suffix: '%'
|
||||
},
|
||||
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: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -106,21 +187,21 @@ export default {
|
||||
...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 () {
|
||||
const datasets = this.$store.state.printer.tempHistory.datasets
|
||||
|
||||
return datasets.sort((a,b) => {
|
||||
if ('name' in a && 'name' in b) {
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_power")) return -1
|
||||
if (a.name.endsWith("_power") < b.name.endsWith("_target")) return 1
|
||||
if (a.name.endsWith("_target") > b.name.endsWith("_target")) return -1
|
||||
if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
})
|
||||
return this.$store.state.printer.tempHistory.datasets
|
||||
}
|
||||
},
|
||||
autoscale: {
|
||||
@@ -132,40 +213,106 @@ export default {
|
||||
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.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.autoscale ? null : this.maxTemp
|
||||
//this.chartOptions.axisY.interval = this.autoscale ? 25 : 50
|
||||
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
|
||||
}
|
||||
},
|
||||
],
|
||||
}
|
||||
}],
|
||||
})
|
||||
}
|
||||
}, this.intervalChartUpdate)
|
||||
|
||||
this.timerDataset = setInterval(() => {
|
||||
this.$store.dispatch("printer/tempHistory/updateDatasets")
|
||||
}, this.intervalDatasetUpdate)
|
||||
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,58 +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-container class="pt-0">
|
||||
<v-row no-gutters class="" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 mt-3 pb-0 text-center">
|
||||
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">{{ $t("Dashboard.Home")}} </span>{{ $t("Dashboard.All")}}</v-btn>
|
||||
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">{{ $t("Dashboard.QGL")}}</v-btn>
|
||||
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">{{ $t("Dashboard.ZTilt")}}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('X-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'x-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'x+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Y-'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsorted" v-bind:key="'y-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+'+steps, feedrateXY)" class="btnMinWidthAuto col" v-for="steps of stepsXYsortedReverse" v-bind:key="'y+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters class="mt-3" v-if="['standby', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle dense no-gutters class="row no-gutters mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Z-'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsorted" v-bind:key="'z-'+steps"><span class="body-2">-{{ steps }}</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+'+steps, feedrateZ)" class="btnMinWidthAuto col" v-for="steps of stepsZsortedReverse" v-bind:key="'z+'+steps"><span class="body-2">+{{ steps }}</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row no-gutters v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="text-center">
|
||||
<v-btn v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" small color="primary" class="mx-1 mt-3" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
<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>
|
||||
@@ -63,9 +285,11 @@
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
data() {
|
||||
return {
|
||||
|
||||
crossWidth: 40,
|
||||
crossHeight: 40,
|
||||
homeCols: 6
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -74,15 +298,48 @@
|
||||
config: state => state.printer.configfile.config,
|
||||
loadings: state => state.socket.loadings,
|
||||
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 })
|
||||
@@ -102,9 +359,63 @@
|
||||
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', { message: "G28", type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'homeAll' });
|
||||
@@ -136,9 +447,11 @@
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
|
||||
},
|
||||
doSendMove(gcode, feedrate) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F"+feedrate*60 + "\n" +
|
||||
"G90";
|
||||
if (this.absolute_coordinates) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F"+feedrate*60 + "\n" +
|
||||
"G90"
|
||||
} else gcode = "G1 " + gcode + " F"+feedrate*60
|
||||
|
||||
this.doSend(gcode);
|
||||
},
|
||||
@@ -151,6 +464,24 @@
|
||||
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,90 +0,0 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card v-if="(['standby', 'paused', 'complete'].includes(printer_state))">
|
||||
<v-container>
|
||||
<v-row class="">
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>{{ $t("Dashboard.FeedAmountIn") }} mm:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedamountsSorted" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col col-md-6">
|
||||
<v-label>{{ $t("Dashboard.FeedrateIn") }} mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedratesSorted" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="">
|
||||
<v-col class="col text-center">
|
||||
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> {{ $t("Dashboard.Retract") }}</v-btn>
|
||||
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> {{ $t("Dashboard.Extrude") }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5
|
||||
}
|
||||
},
|
||||
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,
|
||||
feedamounts: state => state.gui.dashboard.extruder.feedamounts,
|
||||
feedrates: state => state.gui.dashboard.extruder.feedrates,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
feedamountsSorted: {
|
||||
get() {
|
||||
return [...this.feedamounts].sort((a,b) => { return b-a })
|
||||
}
|
||||
},
|
||||
feedratesSorted: {
|
||||
get() {
|
||||
return [...this.feedrates].sort((a,b) => { return b-a })
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
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', { message: gcode, type: 'command' });
|
||||
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', { 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>
|
||||
@@ -2,21 +2,21 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>{{ $t('Setting.KlippyState')}}{{ klippy_state}}</span>
|
||||
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>Klippy-State: {{ klippy_state}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left" v-if="klippy_connected"><pre style="white-space: pre-wrap;">{{ klippy_message }}</pre></v-flex>
|
||||
<v-flex col class="text-left" v-if="!klippy_connected">
|
||||
<p style="white-space:pre-wrap">{{ $t('Setting.KlippyInfo') }}</p>
|
||||
<p>Moonraker can't connect to Klippy!<br />Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
|
||||
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.Restart') }}</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-restart</v-icon>{{ $t('Setting.FIRMWARERestart') }}</v-btn>
|
||||
<v-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>
|
||||
|
||||
@@ -12,21 +12,21 @@
|
||||
<v-toolbar flat dense color="orange darken-2">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MissingConfiguration") }}
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>Missing configuration
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left">
|
||||
<p v-if="!boolVirtualSdcard" class="orange--text"><code>virtual_sdcard</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolPauseResume" class="orange--text"><code>pause_resume</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolDisplayStatus" class="orange--text"><code>display_status</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroPause" class="orange--text"><code>gcode_macro PAUSE</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroResume" class="orange--text"><code>gcode_macro RESUME</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<p v-if="!boolMacroCancelPrint" class="orange--text"><code>gcode_macro CANCEL_PRINT</code> {{ $t("Dashboard.IsNotDefinedInConfig") }}</p>
|
||||
<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>{{ $t("Dashboard.MoreInformation") }}</v-btn>
|
||||
<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>
|
||||
|
||||
@@ -23,19 +23,19 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t("Dashboard.Console") }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupConsole')">
|
||||
<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="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Dashboard.HideTemperatures')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Dashboard.CustomFilters')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -45,7 +45,7 @@
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
:label="$t('Dashboard.SendCode')"
|
||||
label="Send code..."
|
||||
ref="gcodeCommandField"
|
||||
solo
|
||||
hide-details
|
||||
@@ -60,7 +60,7 @@
|
||||
</v-col>
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
|
||||
<v-icon class="mr-2">mdi-send</v-icon> {{ $t("Dashboard.Send") }}
|
||||
<v-icon class="mr-2">mdi-send</v-icon> send
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -81,7 +81,7 @@
|
||||
sort-by="date"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="py-2">{{ $t("Dashboard.Empty") }}</div>
|
||||
<div class="py-2">empty</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
|
||||
@@ -20,22 +20,32 @@
|
||||
<v-card class="mt-6" v-if="['printing', 'paused'].includes(printer_state)">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>{{ $t("Dashboard.PrintSettings") }}</span>
|
||||
<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/getMiscellaneous'].length">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>{{ $t("Dashboard.Miscellaneous") }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-dip-switch</v-icon>Miscellaneous</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<div v-for="(object, index) of this['printer/getMiscellaneous']" v-bind:key="index">
|
||||
<v-divider v-if="index"></v-divider>
|
||||
<miscellaneous-slider :name="object.name" :type="object.type" :target="object.power" :controllable="object.controllable" :pwm="object.pwm" :multi="parseInt(object.scale)" ></miscellaneous-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>
|
||||
@@ -65,6 +75,6 @@
|
||||
...mapGetters([
|
||||
'printer/getMiscellaneous',
|
||||
]),
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -4,15 +4,15 @@
|
||||
<v-toolbar flat dense color="orange darken-2">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-alert-circle" left></v-icon>{{ $t("Dashboard.MoonrakerFailedPlugins") }}
|
||||
<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">{{ $t("Dashboard.MoonrakerErrorInfo") }}</p>
|
||||
<p class="mb-2 orange--text">{{ $t("Dashboard.FollowingPluginHasAnError") }}</p>
|
||||
<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>
|
||||
@@ -21,7 +21,7 @@
|
||||
</v-card-text>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left">
|
||||
<v-btn small :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" color="primary" class=""><v-icon class="mr-2">mdi-download</v-icon>{{ $t("Dashboard.DownloadLog") }}</v-btn>
|
||||
<v-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>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<v-col>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
{{ $t('Setting.ConfigFiles') }}
|
||||
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">
|
||||
@@ -43,13 +43,13 @@
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Setting.HiddenFiles')"></v-checkbox>
|
||||
<v-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>{{ $t('Setting.CurrentPath') }} {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
|
||||
<v-data-table
|
||||
:items="files"
|
||||
class="files-table"
|
||||
@@ -61,13 +61,13 @@
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items-per-page.sync="countPerPage"
|
||||
:footer-props="{
|
||||
itemsPerPageText: $t('Setting.Files')
|
||||
itemsPerPageText: 'Files'
|
||||
}"
|
||||
mobile-breakpoint="0"
|
||||
item-key="name">
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">{{ $t('Setting.Empty') }}</div>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== '')">
|
||||
@@ -81,9 +81,10 @@
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr
|
||||
v-longpress:600="(e) => showContextMenu(e, item)"
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor"
|
||||
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>
|
||||
@@ -98,27 +99,27 @@
|
||||
</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> {{ $t('Setting.EditFile') }}
|
||||
<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> {{ $t('Setting.Download') }}
|
||||
<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> {{ $t('Setting.Rename') }}
|
||||
<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> {{ $t('Setting.Delete') }}
|
||||
<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> {{ $t('Setting.Delete') }}
|
||||
<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>
|
||||
{{ $t('Setting.PleaseStandBy') }}
|
||||
Please stand by
|
||||
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
@@ -132,11 +133,11 @@
|
||||
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar-items>
|
||||
<v-btn dark text href="https://www.klipper3d.org/Config_Reference.html" target="_blank" class="d-none d-md-flex"><v-icon small class="mr-1">mdi-help</v-icon>{{ $t('Setting.ConfigReference') }}</v-btn>
|
||||
<v-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">{{ $t('Setting.Save') }}</span></v-btn>
|
||||
<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>{{ $t('Setting.SaveRestart') }}</v-btn>
|
||||
<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>
|
||||
@@ -144,40 +145,40 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Setting.RenameFile') }}</v-card-title>
|
||||
<v-card-title class="headline">Rename File</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.Name')" required v-model="dialogRenameFile.newName"></v-text-field>
|
||||
<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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Setting.Rename') }}</v-btn>
|
||||
<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">{{ $t('Setting.CreateFile') }}</v-card-title>
|
||||
<v-card-title class="headline">Create File</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFile.name"></v-text-field>
|
||||
<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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createFileAction">{{ $t('Setting.Create') }}</v-btn>
|
||||
<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">{{ $t('Setting.CreateFolder') }}</v-card-title>
|
||||
<v-card-title class="headline">Create Folder</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Setting.Name')" required v-model="dialogCreateFolder.name"></v-text-field>
|
||||
<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">{{ $t('Setting.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createFolderAction">{{ $t('Setting.Create') }}</v-btn>
|
||||
<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>
|
||||
@@ -190,7 +191,7 @@
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t('Setting.Uploading') }} {{ uploadSnackbar.filename }}</strong><br />
|
||||
<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 }">
|
||||
@@ -234,9 +235,9 @@
|
||||
selected: [],
|
||||
headers: [
|
||||
{ text: '', value: '', },
|
||||
{ text: this.$t('Setting.Name'), value: 'filename', },
|
||||
{ text: this.$t('Setting.Filesize'), value: 'size', align: 'right', },
|
||||
{ text: this.$t('Setting.LastModified'), value: 'modified', align: 'right', },
|
||||
{ text: 'Name', value: 'filename', },
|
||||
{ text: 'Filesize', value: 'size', align: 'right', },
|
||||
{ text: 'Last modified', value: 'modified', align: 'right', },
|
||||
],
|
||||
options: {
|
||||
},
|
||||
@@ -321,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');
|
||||
@@ -377,7 +378,7 @@
|
||||
}
|
||||
return items;
|
||||
},
|
||||
loadPath: function() {
|
||||
loadPath() {
|
||||
let dirArray = this.currentPath.substring(1).split("/");
|
||||
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
@@ -389,30 +390,35 @@
|
||||
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(boolRestart = false) {
|
||||
saveFile(boolRestart = false) {
|
||||
let file = new File([this.editor.sourcecode], this.editor.item.filename);
|
||||
|
||||
let formData = new FormData();
|
||||
@@ -440,14 +446,16 @@
|
||||
});
|
||||
},
|
||||
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);
|
||||
@@ -507,10 +515,10 @@
|
||||
removeFile() {
|
||||
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()
|
||||
},
|
||||
async uploadFile() {
|
||||
@@ -533,7 +541,7 @@
|
||||
this.$refs.fileUpload.value = ''
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
doUploadFile(file) {
|
||||
let toast = this.$toast;
|
||||
let formData = new FormData();
|
||||
let filename = file.name.replace(" ", "_");
|
||||
@@ -579,7 +587,7 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
cancelUpload: function() {
|
||||
cancelUpload() {
|
||||
this.uploadSnackbar.cancelTokenSource.cancel()
|
||||
this.uploadSnackbar.status = false
|
||||
},
|
||||
|
||||
@@ -6,26 +6,26 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>{{ $t('Setting.Console') }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="hideWaitTemperatures" :label="$t('Setting.HideTemperatures')" hide-details class="mt-0"></v-switch>
|
||||
<v-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="$t('Setting.CustomFilter')" hide-details class="mt-0"></v-switch>
|
||||
<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="$t('Setting.Rules')"
|
||||
label="Rules"
|
||||
v-model="customFilters"
|
||||
hide-details
|
||||
class="mb-2"
|
||||
|
||||
@@ -1,31 +1,170 @@
|
||||
<style>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-tune</v-icon>{{ $t('Setting.ControlExtruder') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
:label="$t('Setting.FeedrateXY')"
|
||||
v-model="feedrateXY"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
></v-text-field>
|
||||
<v-text-field
|
||||
:label="$t('Setting.FeedrateZ')"
|
||||
v-model="feedrateZ"
|
||||
type="number"
|
||||
suffix="mm/s"
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<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>
|
||||
@@ -39,12 +178,50 @@
|
||||
}
|
||||
},
|
||||
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(value) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { control: { feedrateXY: value } } })
|
||||
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: {
|
||||
@@ -55,9 +232,50 @@
|
||||
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>
|
||||
</script>
|
||||
@@ -6,24 +6,52 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>{{ $t('Setting.Dashboard') }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>Dashboard</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolShowWebcamOnDashboard" :label="$t('Setting.Webcam')" hide-details class="mt-0"></v-switch>
|
||||
<v-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="$t('Setting.Tempchart')" hide-details class="mt-0"></v-switch>
|
||||
<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="$t('Setting.Console')" hide-details class="mt-0"></v-switch>
|
||||
<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>
|
||||
@@ -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>
|
||||
@@ -2,20 +2,20 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>{{ $t('Setting.Endstops')}}</span>
|
||||
<span class="subheading"><v-icon left>mdi-arrow-expand-vertical</v-icon>Endstops</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pb-0">
|
||||
<v-container px-0 py-0>
|
||||
<v-row v-for="(status, index) of sortEndstops" v-bind:key="index">
|
||||
<v-col>
|
||||
<label class="mt-1 d-inline-block">{{ $t('Setting.Endstop')}} <b>{{ index.toUpperCase() }}</b></label>
|
||||
<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>
|
||||
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
||||
<v-col>
|
||||
<p>{{ $t('Setting.EndstopInfo')}}</p>
|
||||
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
@@ -1,23 +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>{{ $t('Setting.General') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
v-model="printerName"
|
||||
:label="$t('Setting.PrinterName')"
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<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>
|
||||
@@ -27,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>
|
||||
@@ -1,58 +0,0 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-translate</v-icon>{{ $t('Setting.Language') }}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="pt-2 pb-0">
|
||||
<v-select
|
||||
v-model="lang"
|
||||
@change="changeLanguage"
|
||||
:items="items"
|
||||
:label="$t('Setting.Language')"
|
||||
></v-select>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
items: [
|
||||
{
|
||||
text: "English",
|
||||
value: "en"
|
||||
},
|
||||
{
|
||||
text: "简体中文",
|
||||
value: "zh"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lang: {
|
||||
get() {
|
||||
return localStorage.getItem("lang")
|
||||
},
|
||||
set(newName){
|
||||
return localStorage.setItem("lang",newName)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeLanguage(val){
|
||||
this.$i18n.locale = this.lang = val
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,16 +2,16 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>{{ $t('Setting.MachineLimits')}}</span>
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider :label="$t('Setting.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="$t('Setting.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="$t('Setting.Deceleration')" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<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="$t('Setting.SquareCornerVelocity')" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
<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: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>{{ $t("Setting.Logfiles")}}</span>
|
||||
<span class="subheading"><v-icon left>mdi-file-document-edit</v-icon>Logfiles</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text :class="'text-center text-lg-left py-0'">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>{{ $t('Setting.Macros') }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-code-tags</v-icon>Macros</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
@@ -13,6 +13,11 @@
|
||||
<settings-macro-switch :name="macro.name"></settings-macro-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<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>
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-fire</v-icon>{{ $t('Setting.PreheatPresets') }}</span>
|
||||
<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-6" style="cursor: pointer;">
|
||||
<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>
|
||||
@@ -25,10 +25,10 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="rounded transition-swing secondary py-2 px-2 mb-6" style="cursor: pointer;">
|
||||
<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>{{ $t('Setting.Cooldown')}}</strong>
|
||||
<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>
|
||||
@@ -36,7 +36,7 @@
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="createPreset">{{ $t('Setting.AddPreset')}}</v-btn>
|
||||
<v-btn @click="createPreset">add preset</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -48,7 +48,7 @@
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-fire" left></v-icon>
|
||||
{{ dialog.index === null ? $t('Setting.Create') : $t('Setting.Edit') }} {{ $t('Setting.Preset') }}
|
||||
{{ dialog.index === null ? "Create" : "Edit" }} Preset
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -67,7 +67,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-text-field
|
||||
v-model="dialog.name"
|
||||
:label="$t('Setting.Name')"
|
||||
label="Name"
|
||||
hide-details="auto"
|
||||
:rules="[rules.required, rules.unique]"
|
||||
dense
|
||||
@@ -107,7 +107,7 @@
|
||||
<v-textarea
|
||||
outlined
|
||||
name="input-7-4"
|
||||
:label="$t('Setting.CustomGCode')"
|
||||
label="Custom G-Code"
|
||||
v-model="dialog.gcode"
|
||||
hide-details="auto"
|
||||
></v-textarea>
|
||||
@@ -115,7 +115,7 @@
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="dialog.boolInvalidMin">
|
||||
<v-col class="py-0">
|
||||
<v-alert dense text type="error">{{ $t('Setting.PresetInfo')}}</v-alert>
|
||||
<v-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">
|
||||
@@ -135,7 +135,7 @@
|
||||
:class="dialog.index !== null ? 'float-right' : '' "
|
||||
type="submit"
|
||||
>
|
||||
{{ dialog.index === null ? $t('Setting.Store') : $t('Setting.Update') }} {{ $t('Setting.Preset') }}
|
||||
{{ dialog.index === null ? "store" : "update" }} preset
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -150,7 +150,7 @@
|
||||
<v-toolbar flat dense color="primary">
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-fire" left></v-icon> {{ $t('Setting.EditCooldown')}}
|
||||
<v-icon class="mdi mdi-fire" left></v-icon> Edit Cooldown
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -167,9 +167,10 @@
|
||||
<v-textarea
|
||||
outlined
|
||||
name="input-7-4"
|
||||
:label="$t('Setting.CustomGCode')"
|
||||
label="Custom G-Code"
|
||||
v-model="cooldownDialog.gcode"
|
||||
:rules="[rules.required]"
|
||||
hide-details="auto"
|
||||
></v-textarea>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -180,7 +181,7 @@
|
||||
outlined
|
||||
type="submit"
|
||||
>
|
||||
{{ $t('Setting.UpdateCooldown')}}
|
||||
update cooldown
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -225,7 +226,7 @@
|
||||
computed: {
|
||||
...mapState({
|
||||
orgState: state => state.gui.presets,
|
||||
cooldownGcode: state => state.gui.cooldownGcode,
|
||||
cooldownGcode: state => state.gui.cooldown_gcode,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getHeaters',
|
||||
@@ -336,7 +337,7 @@
|
||||
},
|
||||
saveCooldown() {
|
||||
if (this.cooldownDialog.valid) {
|
||||
this.$store.dispatch("gui/setSettings", {cooldownGcode: this.cooldownDialog.gcode})
|
||||
this.$store.dispatch("gui/setSettings", { cooldown_gcode: this.cooldownDialog.gcode })
|
||||
this.cooldownDialog.bool = false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-printer-3d</v-icon>{{ $t('Setting.RemotePrinters') }}</span>
|
||||
<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-6" style="cursor: pointer;">
|
||||
<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
|
||||
@@ -30,7 +30,7 @@
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center mt-0">
|
||||
<v-btn @click="dialogAddPrinter.bool = true">{{ $t('Setting.AddPrinter')}}</v-btn>
|
||||
<v-btn @click="dialogAddPrinter.bool = true">add printer</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -42,7 +42,7 @@
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
Add Printer
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -80,7 +80,7 @@
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
add printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -128,7 +128,7 @@
|
||||
class="middle"
|
||||
@click="addPrinter"
|
||||
>
|
||||
{{ $t('Setting.AddPrinter')}}
|
||||
add printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -142,7 +142,7 @@
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-connection" left></v-icon>
|
||||
{{ $t('Setting.EditPrinter')}}
|
||||
Edit Printer
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -190,7 +190,7 @@
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t('Setting.UpdatePrinter')}}
|
||||
update printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -248,7 +248,7 @@
|
||||
class="middle"
|
||||
@click="updatePrinter"
|
||||
>
|
||||
{{ $t('Setting.UpdatePrinter')}}
|
||||
update printer
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<v-switch v-model="runout.enabled" hide-details @change="changeSensor(runout)" class="settingsRunoutSwitchInput my-0"></v-switch>
|
||||
</v-toolbar>
|
||||
<v-card-text v-if="runout.enabled">
|
||||
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? $t('Setting.detected') : $t('Setting.Empty') }}</v-chip>
|
||||
<v-chip label block :color="runout.filament_detected ? 'green' : 'red' " class="d-block text-center">{{ runout.filament_detected ? 'detected' : 'empty' }}</v-chip>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
|
||||
@@ -1,73 +1,120 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>{{ $t('Setting.UpdateManager')}}</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Setting.CheckForUpdates')}}</span>
|
||||
</v-tooltip>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
<style scoped>
|
||||
.cursor--pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div v-for="(value, key) of updateableSoftwares" v-bind:key="key">
|
||||
<v-divider class="my-0" ></v-divider>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
{{ 'name' in value ? value.name : key }}<br />
|
||||
{{ getVersionOutput(value) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Update Manager</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" :loading="loadings.includes('loadingBtnSyncUpdateManager')" :disabled="['printing', 'paused'].includes(printer_state)" @click="btnSync" v-bind="attrs" v-on="on"><v-icon small>mdi-refresh</v-icon></v-btn>
|
||||
</template>
|
||||
<span>Check for updates</span>
|
||||
</v-tooltip>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
|
||||
<div v-for="(value, key, index) of updateableSoftwares" v-bind:key="key">
|
||||
<v-divider class="my-0" v-if="index" ></v-divider>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ 'name' in value ? value.name : key }}</strong><br />
|
||||
<span @click="openCommitsOverlay(key, value)" :class="getVersionClickable(value) ? 'primary--text cursor--pointer' : ''"><v-icon v-if="getVersionClickable(value)" small color="primary" class="mr-1">mdi mdi-information</v-icon>{{ getVersionOutput(value) }}</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
@click="updateModule(key)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ getBtnIcon(value) }}</v-icon>{{ getBtnText(value) }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
<strong>System</strong><br />
|
||||
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} packages can be upgraded</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">OS-Packages</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
|
||||
@click="updateSystem"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-dialog v-model="commitsOverlay.bool" persistent width="60%" max-width="800">
|
||||
<v-card dark>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-update</v-icon>Commits</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small class="minwidth-0" color="grey darken-3" @click="commitsOverlay.bool = false"><v-icon small>mdi-close-thick</v-icon></v-btn>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-5" v-if="commitsOverlay.loading">
|
||||
<v-row class="pt-0">
|
||||
<v-col>
|
||||
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2" ></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
<strong>{{ $t('Setting.System')}}</strong><br />
|
||||
<v-tooltip top v-if="version_info.system.package_count > 0" :max-width="300">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ version_info.system.package_count }} {{ $t('Setting.PackagesCanBeUpgraded')}}</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">{{ $t('Setting.OSPackages')}}</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!(version_info.system.package_count) || printer_state === 'printing'"
|
||||
@click="updateSystem"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
><v-icon small class="mr-1">mdi-{{ version_info.system.package_count ? 'progress-upload' : 'check' }}</v-icon>{{ version_info.system.package_count ? 'upgrade' : 'up-to-date' }}</v-chip>
|
||||
</v-card-text>
|
||||
<v-card-text class="py-0" v-if="!commitsOverlay.loading" style="max-height: 400px; overflow-y: scroll;">
|
||||
<v-row>
|
||||
<v-col class="pt-3 pl-0">
|
||||
<v-timeline align-top dense >
|
||||
<v-timeline-item color="primary" small v-for="commit of commitsOverlay.outputs" v-bind:key="commit.sha">
|
||||
<v-row class="pt-0">
|
||||
<v-col>
|
||||
<a class="font-weight-bold white--text" :href="commit.url" target="_blank">{{ commit.title }}</a><br />
|
||||
<p v-if="commit.message" class="mb-0" v-html="commit.message.replace(/(?:\r\n|\r|\n)/g, '<br />')"></p>
|
||||
<div class="caption">
|
||||
<strong>{{ commit.author }}</strong> committed at {{ commit.date.toLocaleString() }}
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState } from 'vuex'
|
||||
import semver from 'semver'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -75,12 +122,16 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
commitsOverlay: {
|
||||
bool: false,
|
||||
loading: false,
|
||||
response: [],
|
||||
outputs: [],
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
package_version: state => state.packageVersion,
|
||||
loadings: state => state.socket.loadings,
|
||||
remoteMode: state => state.socket.remoteMode,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
@@ -103,7 +154,13 @@
|
||||
if ('is_dirty' in object && object.is_dirty) return 'orange'
|
||||
if ('is_valid' in object && !object.is_valid) return 'red'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'primary'
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return 'primary'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
@@ -116,7 +173,13 @@
|
||||
if ('is_valid' in object && !object.is_valid) return 'invalid'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'dirty'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'update'
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return 'update'
|
||||
|
||||
return 'up-to-date'
|
||||
}
|
||||
@@ -129,7 +192,13 @@
|
||||
if ('is_valid' in object && !object.is_valid) return 'alert-circle'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'alert-circle'
|
||||
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return 'progress-upload'
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return 'progress-upload'
|
||||
|
||||
return 'check'
|
||||
}
|
||||
@@ -142,7 +211,13 @@
|
||||
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('is_valid' in object && !object.is_valid) return true
|
||||
if ('version' in object && 'remote_version' in object && object.version !== object.remote_version) return false
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
) return false
|
||||
}
|
||||
|
||||
return true
|
||||
@@ -160,10 +235,23 @@
|
||||
}
|
||||
if (output !== "") output += ": "
|
||||
|
||||
output += local_version !== remote_version ? local_version+" > "+remote_version : local_version
|
||||
if (semver.valid(remote_version) && semver.valid(local_version) && semver.gt(remote_version, local_version))
|
||||
output += local_version+" > "+remote_version
|
||||
else
|
||||
output += local_version
|
||||
|
||||
return output
|
||||
},
|
||||
getVersionClickable(object) {
|
||||
return (
|
||||
'branch' in object &&
|
||||
object.branch === "master" &&
|
||||
'current_hash' in object &&
|
||||
'remote_hash' in object &&
|
||||
object.current_hash !== object.remote_hash &&
|
||||
'owner' in object
|
||||
)
|
||||
},
|
||||
updateModule(key) {
|
||||
if (["klipper", "moonraker"].includes(key)) this.$socket.sendObj('machine.update.'+key, { })
|
||||
else this.$socket.sendObj('machine.update.client', { name: key })
|
||||
@@ -171,6 +259,60 @@
|
||||
updateSystem() {
|
||||
this.$socket.sendObj('machine.update.system', { })
|
||||
},
|
||||
openCommitsOverlay(key, object) {
|
||||
if (
|
||||
['klipper', 'moonraker'].includes(key) &&
|
||||
this.getVersionClickable(object) &&
|
||||
'owner' in object
|
||||
) {
|
||||
this.commitsOverlay.bool = true
|
||||
this.commitsOverlay.loading = true
|
||||
|
||||
const apiUrl = "https://api.github.com/repos/"+object.owner+"/"+key+"/commits"
|
||||
if (apiUrl) {
|
||||
axios
|
||||
.get(apiUrl)
|
||||
.then(response => {
|
||||
this.commitsOverlay.response = response
|
||||
this.commitsOverlay.outputs.splice(0, this.commitsOverlay.outputs.length)
|
||||
|
||||
const index = response.data.findIndex(commit => commit.sha === object.current_hash)
|
||||
if (index !== -1) {
|
||||
this.commitsOverlay.response = response.data.splice(0, index).sort((a,b) => {
|
||||
const dataA = new Date(a.commit.author.date)
|
||||
const dataB = new Date(b.commit.author.date)
|
||||
|
||||
return dataB - dataA
|
||||
})
|
||||
|
||||
this.commitsOverlay.response.forEach(commit => {
|
||||
const date = new Date(commit.commit.author.date)
|
||||
const author = commit.commit.author.name
|
||||
|
||||
const firstIndex = commit.commit.message.indexOf('\n\n')
|
||||
let lastIndex = commit.commit.message.lastIndexOf('\n\n')
|
||||
if (firstIndex === lastIndex && commit.commit.message.lastIndexOf('\r') > firstIndex) {
|
||||
lastIndex = commit.commit.message.lastIndexOf('\r')
|
||||
}
|
||||
|
||||
this.commitsOverlay.outputs.push({
|
||||
sha: commit.sha,
|
||||
date: date,
|
||||
author: author,
|
||||
url: commit.html_url,
|
||||
title: commit.commit.message.substr(0, firstIndex),
|
||||
message: (firstIndex+2 < lastIndex-2) ? commit.commit.message.substr(firstIndex+2, lastIndex-firstIndex-2) : "",
|
||||
firstIndex: firstIndex,
|
||||
lastIndex: lastIndex,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.commitsOverlay.loading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -6,23 +6,33 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam') }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-container px-0 py-0>
|
||||
<v-row>
|
||||
<v-col class="pt-2 mb-1">
|
||||
<v-col class="py-2">
|
||||
<v-select v-model="service" :items="serviceItems" hide-details label="Service" class="mt-0"></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="service === 'mjpegstreamer-adaptive'">
|
||||
<v-col class="py-2 mt-2">
|
||||
<v-text-field v-model="targetFps" hide-details label="Target FPS" class="mt-0"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="pt-2 mt-2 mb-1">
|
||||
<v-text-field
|
||||
v-model="webcamUrl"
|
||||
hide-details
|
||||
:label="$t('Setting.WebcamURL')"
|
||||
label="Webcam URL"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="rotationEnabled">
|
||||
<v-col class="py-2" col-auto>
|
||||
<v-switch v-model="rotate" hide-details :label="$t('Setting.Rotate')" class="mt-0"></v-switch>
|
||||
<v-switch v-model="rotate" hide-details label="Rotate" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
|
||||
@@ -30,17 +40,17 @@
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="flipX" hide-details :label="$t('Setting.FlipWebcamHorizontally')" class="mt-0"></v-switch>
|
||||
<v-switch v-model="flipX" hide-details label="Flip webcam horizontally" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="flipY" hide-details :label="$t('Setting.FlipWebcamVertically')" class="mt-0"></v-switch>
|
||||
<v-switch v-model="flipY" hide-details label="Flip webcam vertically" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<v-switch v-model="boolNavi" hide-details :label="$t('Setting.ShowInNavigation')" class="mt-0"></v-switch>
|
||||
<v-switch v-model="boolNavi" hide-details label="Show in navigation" class="mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -55,7 +65,11 @@
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
rotationEnabled: false
|
||||
rotationEnabled: false,
|
||||
serviceItems: [
|
||||
{ value: 'mjpegstreamer', text: 'MJPEG-Streamer' },
|
||||
{ value: 'mjpegstreamer-adaptive', text: 'Adaptive MJPEG-Streamer (experimental)' },
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -64,7 +78,7 @@
|
||||
return this.$store.state.gui.webcam.url;
|
||||
},
|
||||
set(url) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { url } });
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { url: url } })
|
||||
}
|
||||
},
|
||||
flipX: {
|
||||
@@ -72,7 +86,7 @@
|
||||
return this.$store.state.gui.webcam.flipX;
|
||||
},
|
||||
set(flipX) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipX } });
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipX: flipX } });
|
||||
}
|
||||
},
|
||||
flipY: {
|
||||
@@ -80,7 +94,7 @@
|
||||
return this.$store.state.gui.webcam.flipY;
|
||||
},
|
||||
set(flipY) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipY } });
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipY: flipY } });
|
||||
}
|
||||
},
|
||||
rotate: {
|
||||
@@ -96,7 +110,7 @@
|
||||
return this.$store.state.gui.webcam.rotateDegrees;
|
||||
},
|
||||
set(rotateDegrees) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { rotateDegrees } });
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { rotateDegrees: rotateDegrees } });
|
||||
}
|
||||
},
|
||||
boolNavi: {
|
||||
@@ -107,6 +121,22 @@
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { bool: showNav } });
|
||||
}
|
||||
},
|
||||
service: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.service;
|
||||
},
|
||||
set(selectedMethod) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { service: selectedMethod } });
|
||||
}
|
||||
},
|
||||
targetFps: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.targetFps;
|
||||
},
|
||||
set(fps) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { targetFps: fps } });
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ import LogfilesPanel from "./LogfilesPanel";
|
||||
import UpdatePanel from "./UpdatePanel";
|
||||
import RemotePrintersPanel from "./RemotePrintersPanel";
|
||||
import PresetsPanel from "./PresetsPanel";
|
||||
import LanguagePanel from "./LanguagePanel";
|
||||
|
||||
Vue.component('settings-general-panel', GeneralPanel);
|
||||
Vue.component('settings-control-panel', ControlPanel);
|
||||
@@ -30,7 +29,6 @@ Vue.component('settings-config-files-panel', ConfigFilesPanel);
|
||||
Vue.component('settings-update-panel', UpdatePanel);
|
||||
Vue.component('settings-remote-printers-panel', RemotePrintersPanel);
|
||||
Vue.component('settings-presets-panel', PresetsPanel);
|
||||
Vue.component('settings-language-panel', LanguagePanel);
|
||||
|
||||
export default {
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading align-baseline">
|
||||
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : $t("Dashboard.Unknown")) }}
|
||||
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown") }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -27,15 +27,7 @@
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-pause</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.PausePrint") }}</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.CancelPrint") }}</span>
|
||||
<span>Pause print</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob">
|
||||
@@ -43,7 +35,15 @@
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-play</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ResumePrint") }}</span>
|
||||
<span>Resume print</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused' || (displayCancelPrint && printer_state === 'printing'))" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-stop</v-icon>
|
||||
</template>
|
||||
<span>Cancel print</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob">
|
||||
@@ -51,7 +51,7 @@
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-broom</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ClearPrintStats") }}</span>
|
||||
<span>Clear print stats</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="['error', 'complete'].includes(printer_state)" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob">
|
||||
@@ -59,7 +59,7 @@
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-icon v-bind="attrs" v-on="on" small>mdi-printer</v-icon>
|
||||
</template>
|
||||
<span>{{ $t("Dashboard.ReprintJob") }}</span>
|
||||
<span>Reprint job</span>
|
||||
</v-tooltip>
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
@@ -93,11 +93,11 @@
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400)
|
||||
current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400)
|
||||
">
|
||||
<img
|
||||
class="statusPanel-image-preview"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400).data : '')"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
@@ -106,24 +106,24 @@
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 col-sm-8' : 'col-12'
|
||||
current_file.thumbnails.find(element => element.width >= 300 && element.width <= 400)) ? 'col-12 col-sm-8' : 'col-12'
|
||||
">
|
||||
<v-row class="text-center" align="center">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-row class="text-center py-4" align="center">
|
||||
<v-col class="flex-grow-0 py-0">
|
||||
<v-icon>mdi-axis-arrow</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>X</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>X</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>Y</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Y</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>Z</strong></v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Z</strong></v-col></v-row>
|
||||
<v-row>
|
||||
<v-col class="px-0 pt-1">
|
||||
<v-col class="pa-0">
|
||||
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
@@ -136,18 +136,18 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-col class="pa-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-0">
|
||||
<v-icon>mdi-poll</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row>
|
||||
<v-col class="px-0 pt-1">
|
||||
<v-col class="pa-0">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on" v-if="filament_used >= 1000" class=" text-no-wrap">{{ (filament_used / 1000).toFixed(2) }} m</span>
|
||||
@@ -158,57 +158,58 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Print") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time) }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Print</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ formatTime(print_time) }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Total") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ formatTime(print_time_total) }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Total</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ formatTime(print_time_total) }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-col class="pa-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) && 'filament_total' in current_file ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
|
||||
<v-col class="flex-grow-0 py-0">
|
||||
<v-icon>mdi-printer-3d</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Speed") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ (requested_speed / 60).toFixed(0) }} mm/s</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Speed</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0 text-no-wrap">{{ (requested_speed / 60 * speed_factor).toFixed(0) }} mm/s</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Layer") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Layer</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0 text-no-wrap">{{ current_layer }} of {{ max_layers }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.ETA") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>ETA</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ eta ? formatDateTime(eta) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="px-0">
|
||||
<v-col class="pa-0">
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-2">
|
||||
<v-row class="text-center py-4" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state) ">
|
||||
<v-col class="flex-grow-0 py-0">
|
||||
<v-icon>mdi-clock-outline</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2 ">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.File") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0 ">
|
||||
<v-row><v-col class="pa-0"><strong>File</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}</v-col></v-row>
|
||||
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Filament") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-2">
|
||||
<v-row><v-col class="px-0 pb-1"><strong>{{ $t("Dashboard.Slicer") }}</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 pt-1">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="pa-0"><strong>Slicer</strong></v-col></v-row>
|
||||
<v-row><v-col class="pa-0">{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
@@ -233,6 +234,7 @@
|
||||
position: state => state.printer.toolhead.position,
|
||||
gcode_position: state => state.printer.gcode_move.gcode_position,
|
||||
requested_speed: state => state.printer.gcode_move.speed,
|
||||
speed_factor: state => state.printer.gcode_move.speed_factor,
|
||||
|
||||
printProgress: state => state.printer.virtual_sdcard.progress,
|
||||
file_position: state => state.printer.virtual_sdcard.file_position,
|
||||
@@ -247,6 +249,8 @@
|
||||
|
||||
display_message: state => state.printer.display_status.message,
|
||||
loadings: state => state.socket.loadings,
|
||||
|
||||
displayCancelPrint: state => state.gui.general.displayCancelPrint,
|
||||
}),
|
||||
printPercent: {
|
||||
get() {
|
||||
|
||||
@@ -11,6 +11,15 @@
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.datasetColorSymbol {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-style: solid;
|
||||
border-width: 0px;
|
||||
cursor: pointer;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
@@ -18,13 +27,13 @@
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>{{ $t("Dashboard.Temperatures") }}</span>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-menu :offset-y="true" title="Preheat" v-if="this['gui/getPreheatPresets'].length">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">{{ $t("Dashboard.Presets") }} <v-icon small>mdi-menu-down</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-bind="attrs" v-on="on" :disabled="['printing', 'paused'].includes(printer_state)">Presets <v-icon small>mdi-menu-down</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item v-for="preset of this['gui/getPreheatPresets']" v-bind:key="preset.index" link @click="preheat(preset)">
|
||||
@@ -43,34 +52,35 @@
|
||||
<v-icon small>mdi-snowflake</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t("Dashboard.Cooldown") }}</v-list-item-title>
|
||||
<v-list-item-title>Cooldown</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>{{ $t("Dashboard.Cooldown") }}</v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Dashboard.SetupTemperatures')">
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" @click="cooldown()" v-if="this['gui/getPreheatPresets'].length === 0"><v-icon small class="mr-1">mdi-snowflake</v-icon>Cooldown</v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Temperatures">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn small class="px-2 minwidth-0" color="grey darken-3" v-bind="attrs" v-on="on"><v-icon small>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details :label="$t('Dashboard.ShowChart')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="boolTempchart" hide-details label="Show Chart"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details :label="$t('Dashboard.AutoscaleChart')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="autoscaleTempchart" hide-details label="Autoscale Chart"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-card-text class="pa-0 content">
|
||||
<v-container class="px-0">
|
||||
<v-row align="center">
|
||||
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">{{ $t("Dashboard.Name") }}</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">{{ $t("Dashboard.State") }}</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold">{{ $t("Dashboard.Current") }}</v-col>
|
||||
<v-col class="py-2 pr-8 text-center font-weight-bold">{{ $t("Dashboard.Target") }}</v-col>
|
||||
<v-col class="py-2 font-weight-bold" style="padding-left: 68px;">Name</v-col>
|
||||
<v-col class="py-2 text-center flex-grow-0 font-weight-bold d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">Color</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold d-none d-sm-block">State</v-col>
|
||||
<v-col class="py-2 text-center font-weight-bold">Current</v-col>
|
||||
<v-col class="py-2 pr-8 text-center font-weight-bold">Target</v-col>
|
||||
</v-row>
|
||||
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
@@ -79,10 +89,13 @@
|
||||
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(heater)">{{ convertName(heater.name) }}</span></v-col>
|
||||
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+heater.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(heater)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? (heater.power !== null ? (heater.power > 0 ? (heater.power * 100).toFixed(0)+'%' : "0%") : "active") : "off" }}</small></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</span>
|
||||
<span v-for="(values, key) of heater.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
<span v-for="(values, key) of heater.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" :items="heater.presets" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
|
||||
@@ -96,10 +109,16 @@
|
||||
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold"><span style="cursor: pointer;" @click="openHeater(fan)">{{ convertName(fan.name) }}</span></v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+fan.chartColor+'cc;'" class="datasetColorSymbol d-inline-block" @click="openHeater(fan)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 text-center d-none d-sm-block">
|
||||
<small class="d-block">{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small>
|
||||
</v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<span class="d-block">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</span>
|
||||
<span v-for="(values, key) of fan.additionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
<span v-for="(values, key) of fan.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></span>
|
||||
<small v-if="fan.rpm || fan.rpm === 0" :class="'d-block ' + (fan.rpm === 0 && fan.speed > 0 ? 'red--text' : '')">{{ Math.round(fan.rpm) }} RPM</small>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" :items="fan.presets" ></toolInput>
|
||||
@@ -110,11 +129,14 @@
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-2 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon color="grey darken-2" :title="$t('Dashboard.Min')+sensor.min_temp+'° / ' + $t('Dashboard.Max')+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
<v-icon color="grey darken-2" :title="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2 font-weight-bold">
|
||||
<span style="cursor: pointer;" @click="openHeater(sensor)">{{ convertName(sensor.name) }}</span>
|
||||
</v-col>
|
||||
<v-col class="py-2 flex-grow-0 text-center d-none d-sm-block" v-if="boolTempchart" style="min-width: 70px;">
|
||||
<div :style="'background-color: '+sensor.chartColor+'CC;'" class="datasetColorSymbol d-inline-block" @click="openHeater(sensor)"></div>
|
||||
</v-col>
|
||||
<v-col class="py-2 d-none d-sm-block"><span> </span></v-col>
|
||||
<v-col class="py-2 text-center">
|
||||
<v-tooltip top>
|
||||
@@ -126,16 +148,16 @@
|
||||
v-on="on"
|
||||
>{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
</template>
|
||||
<span>{{ $t('Dashboard.Min') }}{{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />{{ $t('Dashboard.Max')}}{{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
<span>min: {{ sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0}}°<br />max: {{ sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0 }}°</span>
|
||||
</v-tooltip>
|
||||
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block">{{ values.value.toFixed(1) }} {{ values.unit }}</span>
|
||||
<span v-for="(values, key) of sensor.tempListAdditionValues" v-bind:key="key" class="d-block"><small>{{ values.value.toFixed(1) }} {{ values.unit }}</small></span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-2 pr-8 vertical_align_center"><span> </span></v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
|
||||
<v-row v-if="boolTempchart">
|
||||
<v-col class="px-8 pt-6">
|
||||
<v-col class="py-0 px-3">
|
||||
<temp-chart ></temp-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -160,7 +182,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTemperature"
|
||||
:label="$t('Dashboard.ShowCurrentTemperatureInChart')"
|
||||
label="Show current temperature in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('temperature')"
|
||||
@@ -171,7 +193,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolTarget"
|
||||
:label="$t('Dashboard.ShowTargetTemperatureInChart')"
|
||||
label="Show target temperature in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('target')"
|
||||
@@ -182,7 +204,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolPower"
|
||||
:label="$t('Dashboard.ShowPWMPowerInChart')"
|
||||
label="Show PWM-power in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('power')"
|
||||
@@ -193,7 +215,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.boolSpeed"
|
||||
:label="$t('Dashboard.ShowPWMPowerInChart')"
|
||||
label="Show PWM-power in chart"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible('speed')"
|
||||
@@ -204,7 +226,7 @@
|
||||
<v-col class="col-12">
|
||||
<v-checkbox
|
||||
v-model="editHeater.additionSensors[key]"
|
||||
:label="$t('Dashboard.Show')+key+$t('Dashboard.InList')"
|
||||
:label="'Show '+key+' in list'"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisibleAdditionalSensor(key)"
|
||||
@@ -260,7 +282,7 @@
|
||||
datasets: state => state.printer.tempHistory.datasets,
|
||||
boolTempchart: state => state.gui.dashboard.boolTempchart,
|
||||
printer: state => state.printer,
|
||||
cooldownGcode: state => state.gui.cooldownGcode,
|
||||
cooldownGcode: state => state.gui.cooldown_gcode,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
...mapGetters([
|
||||
@@ -338,10 +360,10 @@
|
||||
this.editHeater.object = object
|
||||
|
||||
this.editHeater.color = object.chartColor
|
||||
this.editHeater.boolTemperature = 'chartTemperature' in object && object.chartTemperature !== undefined && 'visible' in object.chartTemperature ? object.chartTemperature.visible : false
|
||||
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'visible' in object.chartTarget ? object.chartTarget.visible : false
|
||||
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'visible' in object.chartPower ? object.chartPower.visible : false
|
||||
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'visible' in object.chartSpeed ? object.chartSpeed.visible : false
|
||||
this.editHeater.boolTemperature = 'chartTemperature' in object && object.chartTemperature !== undefined && 'lineStyle' in object.chartTemperature && 'opacity' in object.chartTemperature.lineStyle ? object.chartTemperature.lineStyle.opacity : false
|
||||
this.editHeater.boolTarget = 'chartTarget' in object && object.chartTarget !== undefined && 'areaStyle' in object.chartTarget && 'opacity' in object.chartTarget.areaStyle ? (object.chartTarget.areaStyle.opacity > 0) : false
|
||||
this.editHeater.boolPower = 'chartPower' in object && object.chartPower !== undefined && 'lineStyle' in object.chartPower && 'opacity' in object.chartPower.lineStyle ? object.chartPower.lineStyle.opacity : false
|
||||
this.editHeater.boolSpeed = 'chartSpeed' in object && object.chartSpeed !== undefined && 'lineStyle' in object.chartSpeed && 'opacity' in object.chartSpeed.lineStyle ? object.chartSpeed.lineStyle.opacity : false
|
||||
|
||||
let additionalSensors = {}
|
||||
Object.keys(object.additionValues).forEach(sensor => {
|
||||
|
||||
@@ -5,14 +5,17 @@
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-card v-observe-visibility="visibilityChanged">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>{{ $t('Setting.Webcam')}}</span>
|
||||
<span class="subheading">
|
||||
<v-icon left>mdi-webcam</v-icon> Webcam
|
||||
<small v-if="this.webcamConfig.service === 'mjpegstreamer-adaptive' && this.time">(FPS: {{ currentFPS }})</small>
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<img :src="url" class="webcamImage" :style="webcamStyle" :alt="$t('Setting.Webcam')"/>
|
||||
<img :src="url" class="webcamImage" :style="webcamStyle" @load="onLoad" alt="Webcam" v-if="['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcamConfig.service)" />
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -23,12 +26,28 @@
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
refresh: Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
refresh: Math.ceil(Math.random() * Math.pow(10, 12)),
|
||||
connection: "",
|
||||
imageData: "",
|
||||
|
||||
request_start_time: performance.now(),
|
||||
start_time: performance.now(),
|
||||
time: 0,
|
||||
request_time: 0,
|
||||
time_smoothing: 0.6,
|
||||
request_time_smoothing: 0.1,
|
||||
isVisible: true,
|
||||
currentFPS: 0,
|
||||
};
|
||||
},
|
||||
created: function () {
|
||||
document.addEventListener("focus", () => this.handleRefreshChange(), false);
|
||||
document.addEventListener("visibilitychange", this.handleRefreshChange, false);
|
||||
|
||||
if(this.webcamConfig.service === 'mjpegstreamer-adaptive') {
|
||||
this.requestMjpeg()
|
||||
}
|
||||
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -37,14 +56,20 @@
|
||||
...mapState({
|
||||
'webcamConfig': state => state.gui.webcam
|
||||
}),
|
||||
url() {
|
||||
let basicUrl = this.webcamConfig.url
|
||||
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
|
||||
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+this.refresh)
|
||||
return decodeURIComponent(params.toString())
|
||||
url() {
|
||||
if (this.webcamConfig.service === 'mjpegstreamer' && this.webcamConfig.url.indexOf("?") !== -1) {
|
||||
let basicUrl = this.webcamConfig.url
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+this.refresh)
|
||||
return decodeURIComponent(params.toString())
|
||||
} else if (this.webcamConfig.service === 'mjpegstreamer-adaptive') {
|
||||
return this.imageData
|
||||
} else {
|
||||
return this.webcamConfig.url
|
||||
}
|
||||
},
|
||||
|
||||
webcamStyle() {
|
||||
let transforms = '';
|
||||
if (this.webcamConfig.flipX) {
|
||||
@@ -69,6 +94,47 @@
|
||||
if (!document.hidden) {
|
||||
this.refresh = Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const end_time = performance.now()
|
||||
const current_time = end_time - this.start_time
|
||||
this.time = (this.time * this.time_smoothing) + (current_time * (1.0 - this.time_smoothing))
|
||||
this.start_time = end_time
|
||||
|
||||
const target_time = 1000/this.webcamConfig.targetFps
|
||||
|
||||
const current_request_time = performance.now() - this.request_start_time
|
||||
this.request_time = (this.request_time * this.request_time_smoothing) + (current_request_time * (1.0 - this.request_time_smoothing))
|
||||
const timeout = Math.max(0, target_time - this.request_time)
|
||||
|
||||
this.$nextTick(() => {
|
||||
setTimeout(this.requestMjpeg, timeout)
|
||||
})
|
||||
},
|
||||
|
||||
requestMjpeg() {
|
||||
if(!this.isVisible) return
|
||||
|
||||
this.request_start_time = performance.now()
|
||||
let basicUrl = this.webcamConfig.url
|
||||
basicUrl = basicUrl.replace("action=stream", "action=snapshot")
|
||||
if (basicUrl && basicUrl.indexOf("?") === -1) basicUrl += "?"
|
||||
|
||||
const params = new URLSearchParams(basicUrl)
|
||||
params.set('bypassCache', ""+ this.refresh + (Math.random() * 1000))
|
||||
|
||||
|
||||
this.currentFPS = Math.round(1000 / this.time)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.imageData = decodeURIComponent(params.toString())
|
||||
})
|
||||
},
|
||||
|
||||
visibilityChanged(isVisible) {
|
||||
this.isVisible = isVisible
|
||||
if(isVisible) this.requestMjpeg()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,15 +6,15 @@
|
||||
<v-card v-if="(['printing', 'paused'].includes(printer_state))">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>{{ $t("Dashboard.ZBabyStepping") }}</span>
|
||||
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>Z Baby Stepping</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container>
|
||||
<v-row class="py-0">
|
||||
<v-col class="col text-center">
|
||||
<p class="mb-0">{{ $t("Dashboard.CurrentOffset") }} {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
|
||||
<v-col class="pb-0 text-center">
|
||||
<p class="mb-0">Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
|
||||
@@ -6,7 +6,6 @@ import MinSettingsPanel from './MinSettingsPanel.vue'
|
||||
import MoonrakerFailedPluginsPanel from './MoonrakerFailedPluginsPanel.vue'
|
||||
import ToolsPanel from './ToolsPanel.vue'
|
||||
import ControlPanel from "./ControlPanel";
|
||||
import ExtruderPanel from "./ExtruderPanel";
|
||||
import ZOffsetPanel from "./ZOffsetPanel";
|
||||
import Miscellaneous from "./MiscellaneousPanel";
|
||||
import WebcamPanel from "./WebcamPanel";
|
||||
@@ -20,7 +19,6 @@ Vue.component('min-settings-panel', MinSettingsPanel);
|
||||
Vue.component('moonraker-failed-plugins-panel', MoonrakerFailedPluginsPanel);
|
||||
Vue.component('tools-panel', ToolsPanel);
|
||||
Vue.component('control-panel', ControlPanel);
|
||||
Vue.component('extruder-panel', ExtruderPanel);
|
||||
Vue.component('zoffset-panel', ZOffsetPanel);
|
||||
Vue.component('miscellaneous-panel', Miscellaneous);
|
||||
Vue.component('webcam-panel', WebcamPanel);
|
||||
|
||||
@@ -7,23 +7,26 @@
|
||||
<template>
|
||||
<v-container class="px-0 py-2">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-col :class="pwm ? 'pb-1' : 'pb-3'">
|
||||
<v-subheader class="_fan-slider-subheader">
|
||||
<v-icon small :class="'mr-2 '+(value ? 'icon-rotate' : '')" v-if="type !== 'output_pin'">mdi-fan</v-icon>
|
||||
<v-icon small :class="'mr-2 '+(value >= off_below && value > 0 ? 'icon-rotate' : '')" v-if="type !== 'output_pin'">mdi-fan</v-icon>
|
||||
<span>{{ convertName(this.name) }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold" v-if="!controllable || (controllable && pwm)">{{ Math.round(value*100) }} %</span>
|
||||
<small v-if="rpm || rpm === 0" :class="'mr-3 ' + (rpm === 0 && value > 0 ? 'red--text' : '')">{{ Math.round(rpm) }} RPM</small>
|
||||
<span class="font-weight-bold" v-if="!controllable || (controllable && pwm)">{{ Math.round(parseFloat(value)*100) }} %</span>
|
||||
<v-icon v-if="controllable && !pwm" @click="switchOutputPin">{{ value ? "mdi-toggle-switch" : "mdi-toggle-switch-off-outline" }}</v-icon>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0" v-if="controllable && pwm">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:min="0.0"
|
||||
:max="1.0"
|
||||
:step="0.01"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
:color="value < off_below && value > 0 ? 'red' : undefined"
|
||||
@start="sliding = true"
|
||||
@end="sendCmd()"
|
||||
hide-details
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
@@ -43,16 +46,16 @@
|
||||
import {convertName} from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -73,24 +76,57 @@
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
rpm: {
|
||||
type: [Number, Boolean],
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
multi: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
off_below: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
min: 0,
|
||||
value: this.target,
|
||||
sliding: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
convertName: convertName,
|
||||
sendCmd() {
|
||||
let gcode = "";
|
||||
if (this.sliding) {
|
||||
let gcode = "";
|
||||
|
||||
if (this.type === "fan") gcode = "M106 S"+(this.value * this.multi).toFixed(0)
|
||||
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value*this.multi)
|
||||
if (this.type === "output_pin") gcode = "SET_PIN PIN="+this.name+" VALUE="+(this.value*this.multi).toFixed(2)
|
||||
if (this.value < this.min) {
|
||||
this.value = 0;
|
||||
}
|
||||
|
||||
if (gcode !== "") {
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
if (this.target === this.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
const l_value = this.value * this.multi;
|
||||
|
||||
if (this.type === "fan") gcode = "M106 S" + (l_value).toFixed(0)
|
||||
if (this.type === "fan_generic") {
|
||||
gcode = "SET_FAN_SPEED FAN=" + this.name + " SPEED=" + (l_value)
|
||||
}
|
||||
if (this.type === "output_pin") gcode = "SET_PIN PIN=" + this.name + " VALUE=" + (l_value).toFixed(2)
|
||||
|
||||
if (gcode !== "") {
|
||||
this.$store.commit('server/addEvent', {message: gcode, type: 'command'})
|
||||
this.$socket.sendObj('printer.gcode.script', {script: gcode})
|
||||
}
|
||||
|
||||
this.sliding = false;
|
||||
}
|
||||
},
|
||||
switchOutputPin() {
|
||||
@@ -100,21 +136,23 @@
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > 0 ? (this.value - 0.01).toFixed(2) : 0;
|
||||
this.sendCmd();
|
||||
this.value = this.value > 0 ? (this.value - 0.01).toFixed(2) : 0
|
||||
this.sliding = true
|
||||
this.sendCmd()
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < 1 ? (this.value + 0.01).toFixed(2) : 100;
|
||||
this.sendCmd();
|
||||
this.value = this.value < 1.0 ? (this.value + 0.01).toFixed(2) : 1.0;
|
||||
if (this.value < this.off_below) {
|
||||
this.value = this.off_below
|
||||
}
|
||||
this.sliding = true
|
||||
this.sendCmd()
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
|
||||
},
|
||||
target(newVal) {
|
||||
this.value = newVal / this.max
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -26,12 +26,14 @@
|
||||
},
|
||||
methods: {
|
||||
setValue() {
|
||||
if (this.value) {
|
||||
let index = this.hiddenMacros.indexOf(this.name.toUpperCase());
|
||||
if (index > -1) this.hiddenMacros.splice(index, 1)
|
||||
} else this.hiddenMacros.push(this.name.toUpperCase())
|
||||
let hiddenMacros = this.hiddenMacros
|
||||
|
||||
this.$store.dispatch("gui/upload")
|
||||
if (this.value) {
|
||||
let index = hiddenMacros.indexOf(this.name.toUpperCase());
|
||||
if (index > -1) hiddenMacros.splice(index, 1)
|
||||
} else hiddenMacros.push(this.name.toUpperCase())
|
||||
|
||||
this.$store.dispatch("gui/setSettings", { dashboard: { hiddenMacros: hiddenMacros }})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -10,15 +10,27 @@
|
||||
<v-col class="pb-1 pt-3">
|
||||
<v-subheader class="_tool-slider-subheader">
|
||||
<span>{{ label }}</span>
|
||||
<v-btn
|
||||
v-if="value !== defaultValue"
|
||||
class="ml-2"
|
||||
x-small
|
||||
icon
|
||||
@click="processedMin = min; processedMax = max; value = defaultValue; sliding = true; sendCmd()"
|
||||
>
|
||||
<v-icon>mdi-restart</v-icon>
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
<span class="font-weight-bold">
|
||||
{{ value }} {{ unit }}
|
||||
</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@change="sendCmd"
|
||||
:max="processedMax"
|
||||
@start="sliding = true"
|
||||
@end="sendCmd()"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
@@ -38,11 +50,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
@@ -81,6 +88,26 @@
|
||||
required: false,
|
||||
default: 100
|
||||
},
|
||||
dynamicRange: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
dynamicDebounceTime: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 250
|
||||
},
|
||||
dynamicClamp: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => ([0, 1000])
|
||||
},
|
||||
defaultValue: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 100
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
required: false,
|
||||
@@ -90,32 +117,75 @@
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
startValue: this.target * this.multi,
|
||||
sliding: false,
|
||||
processedMin: this.min,
|
||||
processedMax: this.max,
|
||||
dynamicStep: Math.floor((this.max - this.min) / 2),
|
||||
dynamicValue: 30,
|
||||
editing: false,
|
||||
processingTimer: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (this.value > this.max || this.value < this.min) {
|
||||
this.processedMax = Math.ceil(this.value / this.defaultValue) * this.defaultValue;
|
||||
this.processedMin = Math.floor(this.value / this.defaultValue) * this.defaultValue - this.defaultValue;
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
watch: {
|
||||
target: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
this.value = Math.round(newVal * this.multi);
|
||||
if (!this.dynamicRange) {
|
||||
return;
|
||||
}
|
||||
if (this.processingTimer) {
|
||||
clearTimeout(this.processingTimer);
|
||||
this.processingTimer = null;
|
||||
}
|
||||
if (this.value >= this.processedMax) {
|
||||
this.processingTimer = setTimeout(() => {
|
||||
const [min, max] = this.dynamicClamp;
|
||||
this.processedMin = Math.max(min, this.value - this.dynamicStep);
|
||||
this.processedMax = Math.min(max, this.value + this.dynamicStep);
|
||||
}, this.dynamicDebounceTime);
|
||||
}
|
||||
}
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > this.min ? (this.value - this.step).toFixed(0) : this.min
|
||||
this.sendCmd();
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < this.max ? (this.value + this.step).toFixed(0) : this.max
|
||||
this.sendCmd();
|
||||
max: {
|
||||
immediate: true,
|
||||
handler(newVal) {
|
||||
this.processedMax = newVal
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal * this.multi;
|
||||
methods: {
|
||||
sendCmd(btnPress = false) {
|
||||
if (this.sliding || btnPress) {
|
||||
let gcode = this.command + ' ' + this.attributeName + (Math.max(1, this.value) * this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', {message: gcode, type: 'command'})
|
||||
this.$socket.sendObj('printer.gcode.script', {script: gcode})
|
||||
this.sliding = false;
|
||||
}
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
decrement() {
|
||||
this.value = this.value > this.min ? Math.round(this.value - this.step) : this.min
|
||||
this.sendCmd(true);
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < this.processedMax ? Math.round(this.value + this.step) : this.processedMax
|
||||
this.sendCmd(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,237 +0,0 @@
|
||||
{
|
||||
"App": {
|
||||
"SAVECONFIG": "SAVE CONFIG",
|
||||
"UploadPrint": "Upload & Print",
|
||||
"EmergencyStop": "Emergency Stop",
|
||||
"Uploading": "Uploading",
|
||||
"Connecting": "Connecting",
|
||||
"To": "to",
|
||||
"Failed": "failed",
|
||||
"CannotNotConnectTo": "Cannot not connect to",
|
||||
"TryAgain": "try again",
|
||||
"ConnectionTo": "Connection to",
|
||||
"ConnectionFailed": "Connection failed",
|
||||
"SelectPrinter": "Select Printer",
|
||||
"AddPrinter": "Add Printer",
|
||||
"EditPrinter": "Edit Printer",
|
||||
"UpdatePrinter": "Update Printer",
|
||||
"ChangePrinter": "Change Printer",
|
||||
"Hello": "Hello and welcome to the remote mode of Mainsail!",
|
||||
"PleaseRememberToAdd": "Please remember to add",
|
||||
"InMoonrakerConf": "in moonraker.conf within 'cors_domains'.",
|
||||
"YouCanFindMore": "You can find more details at",
|
||||
"Remotemode": "docs.mainsail.xyz/remotemode",
|
||||
"Empty": "Empty",
|
||||
"Close": "Close",
|
||||
"KlipperControl": "Klipper Control",
|
||||
"Restart": "Restart",
|
||||
"FirmwareRestart": "Firmware Restart",
|
||||
"RestartServices": "Restart Services",
|
||||
"Klipper": "Klipper",
|
||||
"Moonraker": "Moonraker",
|
||||
"PowerDevices": "Power Devices",
|
||||
"HostControl": "Host Control",
|
||||
"Reboot": "Reboot",
|
||||
"Shutdown": "Shutdown"
|
||||
},
|
||||
"Router" : {
|
||||
"Dashboard": "Dashboard",
|
||||
"Printers": "Printers",
|
||||
"Settings": "Settings",
|
||||
"Webcam": "Webcam",
|
||||
"Console": "Console",
|
||||
"Heightmap": "Heightmap",
|
||||
"G-Code Files": "G-Code Files",
|
||||
"Machine": "Machine",
|
||||
"Interface": "Interface"
|
||||
},
|
||||
"Dashboard": {
|
||||
"MissingConfiguration": "Missing configuration",
|
||||
"IsNotDefinedInConfig": "is not defined in config.",
|
||||
"MoreInformation": "more information",
|
||||
"MoonrakerFailedPlugins": "Moonraker Failed Plugins",
|
||||
"MoonrakerErrorInfo": "An error was detected while loading the moonraker plugins. Please check the logfile and fix the issue.",
|
||||
"FollowingPluginHasAnError": "Following plugin has an error:",
|
||||
"DownloadLog": "Download Log",
|
||||
"PausePrint": "Pause print",
|
||||
"CancelPrint": "Cancel print",
|
||||
"ResumePrint": "Resume print",
|
||||
"ClearPrintStats": "Clear print stats",
|
||||
"ReprintJob": "Reprint job",
|
||||
"Filament": "Filament",
|
||||
"Print": "Print",
|
||||
"Total": "Total",
|
||||
"Speed": "Speed",
|
||||
"Layer": "Layer",
|
||||
"ETA": "ETA",
|
||||
"File": "File",
|
||||
"Slicer": "Slicer",
|
||||
"ZBabyStepping": "Z Baby Stepping",
|
||||
"CurrentOffset": "Current Offset: ",
|
||||
"Home": "Home",
|
||||
"All": "All",
|
||||
"QGL": "QGL",
|
||||
"ZTilt": "Z Tilt",
|
||||
"FeedAmountIn": "Feed amount in",
|
||||
"FeedrateIn": "Feedrate in",
|
||||
"Retract": "Retract",
|
||||
"Extrude": "Extrude",
|
||||
"PrintSettings": "Print Settings",
|
||||
"Miscellaneous": "Miscellaneous",
|
||||
"Temperatures": "Temperatures",
|
||||
"Presets": "Presets",
|
||||
"Cooldown": "Cooldown",
|
||||
"Name": "Name",
|
||||
"State": "State",
|
||||
"Current": "Current",
|
||||
"Target": "Target",
|
||||
"Min": "min: ",
|
||||
"Max": "max: ",
|
||||
"ShowCurrentTemperatureInChart": "Show current temperature in chart",
|
||||
"ShowTargetTemperatureInChart": "Show target temperature in chart",
|
||||
"ShowPWMPowerInChart": "Show PWM-power in chart",
|
||||
"Show": "Show",
|
||||
"InList": "in list",
|
||||
"SetupTemperatures": "Setup Temperatures",
|
||||
"ShowChart": "Show Chart",
|
||||
"AutoscaleChart": "Autoscale Chart",
|
||||
"Console": "Console",
|
||||
"SendCode": "Send code...",
|
||||
"Send": "Send",
|
||||
"Empty": "Empty",
|
||||
"Setup Console": "Setup Console",
|
||||
"Hide temperatures": "Hide temperatures",
|
||||
"Custom filters": "Custom filters",
|
||||
"Unknown": "Unknown"
|
||||
},
|
||||
"Files": {
|
||||
"GCodeFiles": "G-Code Files",
|
||||
"UploadNewGcode": "Upload new Gcode",
|
||||
"CreateNewDirectory": "Create new Directory",
|
||||
"RefreshCurrentDirectory":"Refresh current Directory",
|
||||
"SetupCurrentList":"Setup current list",
|
||||
"HiddenFiles":"Hidden files",
|
||||
"FreeDisk":"Free disk: ",
|
||||
"Used":"Used: ",
|
||||
"Free":"Free: ",
|
||||
"Total":"Total: ",
|
||||
"Files": "Files",
|
||||
"Search":"Search",
|
||||
"Empty": "Empty",
|
||||
"blabla": "bla bla",
|
||||
"DropFilesToAddGcode": "Drop files to add gcode.",
|
||||
"PrintStart": "Print start",
|
||||
"Preheat": "Preheat",
|
||||
"Download": "Download",
|
||||
"Rename": "Rename",
|
||||
"Delete": "Delete",
|
||||
"StartJob": "Start Job",
|
||||
"DoYouWantToStart": "Do you want to start",
|
||||
"No": "No",
|
||||
"Yes": "Yes",
|
||||
"NewDirectory": "New Directory",
|
||||
"PleaseEnterANewDirectoryName": "Please enter a new directory name:",
|
||||
"RenameFile": "Rename File",
|
||||
"Name": "Name",
|
||||
"Cancel": "Cancel",
|
||||
"Create": "Create",
|
||||
"RenameDirectory": "Rename Directory",
|
||||
"Uploading": "Uploading",
|
||||
"CurrentPath": "Current path",
|
||||
"Filesize": "Filesize",
|
||||
"LastModified": "Last modified",
|
||||
"ObjectHeight": "Object Height",
|
||||
"LayerHeight": "Layer Height",
|
||||
"FilamentUsage": "Filament Usage",
|
||||
"PrintTime": "Print Time",
|
||||
"Slicer": "Slicer"
|
||||
},
|
||||
"Console": {
|
||||
"send": "send",
|
||||
"SetupConsole": "Setup Console",
|
||||
"SendCode": "Send code...",
|
||||
"Empty": "Empty",
|
||||
"HideTemperatures": "Hide temperatures",
|
||||
"CustomFilters": "Custom filters",
|
||||
"Date": "Date",
|
||||
"Event": "Event"
|
||||
},
|
||||
"Setting": {
|
||||
"Language": "Language",
|
||||
"General": "General",
|
||||
"PrinterName": "Printer Name",
|
||||
"ControlExtruder": "Control & Extruder",
|
||||
"PreheatPresets": "Preheat Presets",
|
||||
"Webcam": "Webcam",
|
||||
"Tempchart": "Tempchart",
|
||||
"Macros": "Macros",
|
||||
"Dashboard": "Dashboard",
|
||||
"Console": "Console",
|
||||
"RemotePrinters": "Remote Printers",
|
||||
"ConfigFiles": "Config Files",
|
||||
"SetupCurrentList": "Setup current list",
|
||||
"HiddenFiles": "Hidden files",
|
||||
"CurrentPath: ": "Current path: ",
|
||||
"Empty": "Empty",
|
||||
"EditFile": "Edit file",
|
||||
"Download": "Download",
|
||||
"Rename": "Rename",
|
||||
"Delete": "Delete",
|
||||
"PleaseStandBy": "Please stand by",
|
||||
"ConfigReference": "Config Reference",
|
||||
"Save": "Save",
|
||||
"SaveRestart": "Save & restart",
|
||||
"RenameFile": "Rename File",
|
||||
"Name": "Name",
|
||||
"Cancel": "Cancel",
|
||||
"Create": "Create",
|
||||
"Edit": "Edit",
|
||||
"CreateFile": "Create File",
|
||||
"CreateFolder": "Create Folder",
|
||||
"Uploading": "Uploading",
|
||||
"Files": "Files",
|
||||
"Filesize": "Filesize",
|
||||
"LastModified": "Last modified",
|
||||
"MachineLimits": "Machine Limits",
|
||||
"Velocity": "Velocity",
|
||||
"Acceleration": "Acceleration",
|
||||
"Deceleration": "Deceleration",
|
||||
"SquareCornerVelocity": "Square corner velocity",
|
||||
"KlippyState": "Klippy-State: ",
|
||||
"KlippyInfo": "Moonraker can't connect to Klippy!\nPlease check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.",
|
||||
"Restart": "Restart",
|
||||
"FIRMWARERestart": "FIRMWARE Restart",
|
||||
"UpdateManager": "Update Manager",
|
||||
"CheckForUpdates": "Check for updates",
|
||||
"System": "System",
|
||||
"PackagesCanBeUpgraded": "packages can be upgraded",
|
||||
"OSPackages": "OS-Packages",
|
||||
"Endstops": "Endstops",
|
||||
"Endstop": "Endstop",
|
||||
"EndstopInfo": "Press the sync-button on the right-bottom to load the current endstop status.",
|
||||
"Logfiles": "Logfiles",
|
||||
"WebcamURL": "Webcam URL",
|
||||
"Rotate": "Rotate",
|
||||
"FlipWebcamHorizontally": "Flip webcam horizontally",
|
||||
"FlipWebcamVertically": "Flip webcam vertically",
|
||||
"ShowInNavigation": "Show in navigation",
|
||||
"HideTemperatures": "Hide temperatures",
|
||||
"CustomFilter": "Custom filter",
|
||||
"Rules": "Rules",
|
||||
"FeedrateXY": "Feedrate XY",
|
||||
"FeedrateZ": "Feedrate Z",
|
||||
"Cooldown": "Cooldown",
|
||||
"AddPreset": "add preset",
|
||||
"Preset": "Preset",
|
||||
"CustomGCode": "Custom G-Code",
|
||||
"PresetInfo": "You have to set minimum a target temperature or a custom gcode.",
|
||||
"Store": "Store",
|
||||
"Update": "Update",
|
||||
"EditCooldown": "Edit Cooldown",
|
||||
"UpdateCooldown": "Update Cooldown",
|
||||
"AddPrinter": "Add Printer",
|
||||
"EditPrinter": "Edit Printer",
|
||||
"UpdatePrinter": "Update Printer",
|
||||
"detected": "detected"
|
||||
}
|
||||
}
|
||||
@@ -1,237 +0,0 @@
|
||||
{
|
||||
"App": {
|
||||
"SAVECONFIG": "保存配置",
|
||||
"UploadPrint": "上传并打印",
|
||||
"EmergencyStop": "紧急停止",
|
||||
"Uploading": "上传",
|
||||
"Connecting": "连接",
|
||||
"To": "到",
|
||||
"Failed": "失败",
|
||||
"CannotNotConnectTo": "无法连接到",
|
||||
"TryAgain": "重试",
|
||||
"ConnectionTo": "连接到",
|
||||
"ConnectionFailed": "连接失败",
|
||||
"SelectPrinter": "选择打印机",
|
||||
"AddPrinter": "添加打印机",
|
||||
"EditPrinter": "编辑打印机",
|
||||
"UpdatePrinter": "更新打印机",
|
||||
"ChangePrinter": "更换打印机",
|
||||
"Hello": "大家好,欢迎来到主帆遥控模式!",
|
||||
"PleaseRememberToAdd": "请记得添加",
|
||||
"InMoonrakerConf": "在 moonraker.conf 的 'cors_domains' 中.",
|
||||
"YouCanFindMore": "详情请浏览",
|
||||
"Remotemode": "docs.mainsail.xyz/remotemode",
|
||||
"Empty": "空的",
|
||||
"Close": "关闭",
|
||||
"KlipperControl": "Klipper 控制",
|
||||
"Restart": "重启",
|
||||
"FirmwareRestart": "固件重启",
|
||||
"RestartServices": "重启服务",
|
||||
"Klipper": "Klipper",
|
||||
"Moonraker": "Moonraker",
|
||||
"PowerDevices": "电力设备",
|
||||
"HostControl": "主机控制",
|
||||
"Reboot": "重启",
|
||||
"Shutdown": "关机"
|
||||
},
|
||||
"Router" : {
|
||||
"Dashboard": "仪表盘",
|
||||
"Printers": "打印机",
|
||||
"Settings": "设置",
|
||||
"Webcam": "摄像头",
|
||||
"Console": "控制台",
|
||||
"Heightmap": "Heightmap",
|
||||
"G-Code Files": "G-Code 文件",
|
||||
"Machine": "机器",
|
||||
"Interface": "界面"
|
||||
},
|
||||
"Dashboard": {
|
||||
"MissingConfiguration": "缺少配置",
|
||||
"IsNotDefinedInConfig": "未在配置中定义.",
|
||||
"MoreInformation": "更多信息",
|
||||
"MoonrakerFailedPlugins": "Moonraker 失败的插件",
|
||||
"MoonrakerErrorInfo": "加载moonraker插件时检测到一个错误. 请检查日志文件并修复这个问题.",
|
||||
"FollowingPluginHasAnError": "以下插件有一个错误:",
|
||||
"DownloadLog": "下载日志",
|
||||
"PausePrint": "暂停打印",
|
||||
"CancelPrint": "取消打印",
|
||||
"ResumePrint": "继续打印",
|
||||
"ClearPrintStats": "清除打印统计信息",
|
||||
"ReprintJob": "重新打印工作",
|
||||
"Filament": "Filam耗材ent",
|
||||
"Print": "打印",
|
||||
"Total": "总计",
|
||||
"Speed": "速度",
|
||||
"Layer": "层",
|
||||
"ETA": "ETA",
|
||||
"File": "文件",
|
||||
"Slicer": "切片",
|
||||
"ZBabyStepping": "Z Baby Stepping",
|
||||
"CurrentOffset": "当前偏移量: ",
|
||||
"Home": "Home",
|
||||
"All": "All",
|
||||
"QGL": "QGL",
|
||||
"ZTilt": "Z 倾斜",
|
||||
"FeedAmountIn": "进料量",
|
||||
"FeedrateIn": "输入",
|
||||
"Retract": "回抽",
|
||||
"Extrude": "挤出",
|
||||
"PrintSettings": "打印设置",
|
||||
"Miscellaneous": "其他",
|
||||
"Temperatures": "温度",
|
||||
"Presets": "预设",
|
||||
"Cooldown": "冷却",
|
||||
"Name": "名称",
|
||||
"State": "状态",
|
||||
"Current": "当前",
|
||||
"Target": "目标",
|
||||
"Min": "最小: ",
|
||||
"Max": "最大: ",
|
||||
"ShowCurrentTemperatureInChart": "在图表中显示当前温度",
|
||||
"ShowTargetTemperatureInChart": "在图表中显示目标温度",
|
||||
"ShowPWMPowerInChart": "在图表中显示PWM功率",
|
||||
"Show": "显示",
|
||||
"InList": "在列表中",
|
||||
"SetupTemperatures": "设置温度",
|
||||
"ShowChart": "显示图表",
|
||||
"AutoscaleChart": "自动缩放图表",
|
||||
"Console": "控制台",
|
||||
"SendCode": "发送代码...",
|
||||
"Send": "发送",
|
||||
"Empty": "空的",
|
||||
"SetupConsole": "设置控制台",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilters": "自定义筛选器",
|
||||
"Unknown": "未知"
|
||||
},
|
||||
"Files": {
|
||||
"GCodeFiles": "G-Code 文件",
|
||||
"UploadNewGcode": "上传新 Gcode",
|
||||
"CreateNewDirectory": "创建新目录",
|
||||
"RefreshCurrentDirectory":"刷新当前目录",
|
||||
"SetupCurrentList":"设置当前列表",
|
||||
"HiddenFiles":"隐藏文件",
|
||||
"FreeDisk":"可用磁盘: ",
|
||||
"Used":"使用: ",
|
||||
"Free":"空闲: ",
|
||||
"Total":"总共: ",
|
||||
"Files": "文件",
|
||||
"Search":"搜索",
|
||||
"Empty": "空的",
|
||||
"blabla": "巴拉巴拉",
|
||||
"DropFilesToAddGcode": "Drop files to add gcode.",
|
||||
"PrintStart": "开始打印",
|
||||
"Preheat": "预热",
|
||||
"Download": "下载",
|
||||
"Rename": "重命名",
|
||||
"Delete": "删除",
|
||||
"StartJob": "开始作业",
|
||||
"DoYouWantToStart": "你想开始吗",
|
||||
"No": "否",
|
||||
"Yes": "是",
|
||||
"NewDirectory": "新建目录",
|
||||
"PleaseEnterANewDirectoryName": "请输入新的目录名称:",
|
||||
"RenameFile": "重命名文件",
|
||||
"Name": "名称",
|
||||
"Cancel": "取消",
|
||||
"Create": "创建",
|
||||
"RenameDirectory": "重命名目录",
|
||||
"Uploading": "上传",
|
||||
"CurrentPath": "当前路径",
|
||||
"Filesize": "文件大小",
|
||||
"LastModified": "上次修改",
|
||||
"ObjectHeight": "对象高度",
|
||||
"LayerHeight": "层高",
|
||||
"FilamentUsage": "耗材使用",
|
||||
"PrintTime": "打印时间",
|
||||
"Slicer": "切片"
|
||||
},
|
||||
"Console": {
|
||||
"send": "发送",
|
||||
"SetupConsole": "设置控制台",
|
||||
"SendCode": "发送代码...",
|
||||
"Empty": "空的",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilters": "自定义筛选器",
|
||||
"Date": "时间",
|
||||
"Event": "事件"
|
||||
},
|
||||
"Setting": {
|
||||
"Language": "语言",
|
||||
"General": "一般",
|
||||
"PrinterName": "打印机名称",
|
||||
"ControlExtruder": "控制 & 挤出机",
|
||||
"PreheatPresets": "预热预设",
|
||||
"Webcam": "摄像头",
|
||||
"Tempchart": "温度图",
|
||||
"Macros": "宏",
|
||||
"Dashboard": "仪表盘",
|
||||
"Console": "控制台",
|
||||
"RemotePrinters": "远程打印机",
|
||||
"ConfigFiles": "配置文件",
|
||||
"SetupCurrentList": "设置当前列表",
|
||||
"HiddenFiles": "隐藏文件",
|
||||
"CurrentPath": "当前路径: ",
|
||||
"Empty": "空的",
|
||||
"EditFile": "编辑文件",
|
||||
"Download": "下载",
|
||||
"Rename": "重命名",
|
||||
"Delete": "删除",
|
||||
"PleaseStandBy": "请等待",
|
||||
"ConfigReference": "配置参考",
|
||||
"Save": "保存",
|
||||
"SaveRestart": "保存 & 重启",
|
||||
"RenameFile": "重命名文件",
|
||||
"Name": "名称",
|
||||
"Cancel": "取消",
|
||||
"Create": "创建",
|
||||
"Edit": "编辑",
|
||||
"CreateFile": "创建文件",
|
||||
"CreateFolder": "创建文件夹",
|
||||
"Uploading": "上传",
|
||||
"Files": "文件",
|
||||
"Filesize": "文件大小",
|
||||
"LastModified": "上次修改",
|
||||
"MachineLimits": "机器限制",
|
||||
"Velocity": "速度",
|
||||
"Acceleration": "加速",
|
||||
"Deceleration": "减速",
|
||||
"SquareCornerVelocity": "直角速度",
|
||||
"KlippyState": "Klippy 状态: ",
|
||||
"KlippyInfo": "Moonraker 不能连接到 Klippy! \n请检查Klipper服务是否正在运行, 并且是否配置了UDS (Unix域套接字). ",
|
||||
"Restart": "重启",
|
||||
"FIRMWARERestart": "固件重启",
|
||||
"UpdateManager": "更新管理器",
|
||||
"CheckForUpdates": "检查更新",
|
||||
"System": "系统",
|
||||
"PackagesCanBeUpgraded": "软件包可以升级",
|
||||
"OSPackages": "OS包",
|
||||
"Endstops": "限位开关",
|
||||
"Endstop": "限位",
|
||||
"EndstopInfo": "按右下角的同步按钮加载当前的限位状态。",
|
||||
"Logfiles": "日志文件",
|
||||
"WebcamURL": "摄像头链接",
|
||||
"Rotate": "旋转",
|
||||
"FlipWebcamHorizontally": "水平翻转摄像头 ",
|
||||
"FlipWebcamVertically": "垂直翻转摄像头",
|
||||
"ShowInNavigation": "在导航中显示 ",
|
||||
"HideTemperatures": "隐藏温度",
|
||||
"CustomFilter": "自定义筛选器",
|
||||
"Rules": "规则",
|
||||
"FeedrateXY": "XY 步进速度",
|
||||
"FeedrateZ": "Z 步进速度",
|
||||
"Cooldown": "冷却",
|
||||
"AddPreset": "添加预设",
|
||||
"Preset": "预设",
|
||||
"CustomGCode": "自定义 G-Code",
|
||||
"PresetInfo": "您必须设置最低目标温度或自定义gcode.",
|
||||
"Store": "储存",
|
||||
"Update": "更新",
|
||||
"EditCooldown": "编辑冷却",
|
||||
"UpdateCooldown": "更新冷却",
|
||||
"AddPrinter": "添加打印机",
|
||||
"EditPrinter": "编辑打印机",
|
||||
"UpdatePrinter": "更新打印机",
|
||||
"detected": "发现"
|
||||
}
|
||||
}
|
||||
@@ -2,17 +2,18 @@ import Vue from 'vue'
|
||||
import WebSocketClient from './plugins/wsClient'
|
||||
import App from './App.vue'
|
||||
import vuetify from './plugins/vuetify'
|
||||
import i18n from './plugins/i18n'
|
||||
import './plugins/longpress';
|
||||
import VueResource from 'vue-resource'
|
||||
import './components'
|
||||
import store from './store'
|
||||
import router from './plugins/router'
|
||||
import vueHeadful from 'vue-headful';
|
||||
|
||||
import VueObserveVisibility from 'vue-observe-visibility';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
Vue.use(VueResource);
|
||||
Vue.use(VueObserveVisibility);
|
||||
Vue.http.headers.common['Content-Type'] = 'application/json';
|
||||
Vue.http.headers.common['Access-Control-Allow-Origin'] = '*';
|
||||
Vue.http.headers.common['Accept'] = 'application/json, text/plain, */*';
|
||||
@@ -21,7 +22,6 @@ Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIO
|
||||
|
||||
Vue.component('vue-headful', vueHeadful);
|
||||
|
||||
|
||||
fetch('/config.json')
|
||||
.then(res => res.json())
|
||||
.then(file => {
|
||||
@@ -40,10 +40,8 @@ fetch('/config.json')
|
||||
vuetify,
|
||||
router,
|
||||
store,
|
||||
i18n,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
let p = document.createElement("p");
|
||||
@@ -52,5 +50,3 @@ fetch('/config.json')
|
||||
document.getElementById('app').append(p);
|
||||
window.console.error('Error:', error);
|
||||
});
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<v-text-field
|
||||
v-model="gcode"
|
||||
:items="items"
|
||||
:label="$t('Console.SendCode')"
|
||||
label="Send code..."
|
||||
solo
|
||||
class="gcode-command-field"
|
||||
ref="gcodeCommandField"
|
||||
@@ -48,21 +48,21 @@
|
||||
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-btn color="info" class="gcode-command-btn" @click="doSend" :loading="loadings.includes('sendGcode')" :disabled="loadings.includes('sendGcode')" >
|
||||
<v-icon class="mr-2">mdi-send</v-icon> {{ $t('Console.send')}}
|
||||
<v-icon class="mr-2">mdi-send</v-icon> send
|
||||
</v-btn>
|
||||
</v-col>
|
||||
|
||||
<v-col class="col-auto align-content-center">
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Console.SetupConsole')">
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup Console">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="gcode-command-btn px-2 minwidth-0" color="lightgray" v-bind="attrs" v-on="on"><v-icon>mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details :label="$t('Console.HideTemperatures')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="hideWaitTemperatures" hide-details label="Hide temperatures"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details :label="$t('Console.CustomFilters')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" v-model="boolCustomFilters" hide-details label="Custom filters"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -83,7 +83,7 @@
|
||||
mobile-breakpoint="0"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="text-center">{{ $t("Console.Empty")}}</div>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
@@ -116,13 +116,13 @@
|
||||
sortBy: 'date',
|
||||
headers: [
|
||||
{
|
||||
text: this.$t('Console.Date'),
|
||||
text: 'Date',
|
||||
value: 'date',
|
||||
width: '15%',
|
||||
dateType: 'Date',
|
||||
},
|
||||
{
|
||||
text: this.$t('Console.Event'),
|
||||
text: 'Event',
|
||||
sortable: false,
|
||||
value: 'message',
|
||||
width: '85%'
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
<webcam-panel class="mt-6" v-if="showDashboardWebcam"></webcam-panel>
|
||||
<z-offset-panel class="mt-6" v-if="klippy_state === 'ready'"></z-offset-panel>
|
||||
<control-panel class="mt-6" v-if="klippy_state === 'ready'"></control-panel>
|
||||
<extruder-panel class="mt-6" v-if="klippy_state === 'ready'"></extruder-panel>
|
||||
<miscellaneous-panel v-if="klippy_state === 'ready'"></miscellaneous-panel>
|
||||
</v-col>
|
||||
<v-col class="col-sm-12 col-md-7" v-if="klippy_connected">
|
||||
|
||||
@@ -51,20 +51,20 @@
|
||||
<div>
|
||||
<v-card class="fileupload-card my-3" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
|
||||
<v-card-title>
|
||||
{{ $t("Files.GCodeFiles")}}
|
||||
G-Code Files
|
||||
<v-spacer class="d-none d-sm-block"></v-spacer>
|
||||
<input type="file" ref="fileUpload" accept=".gcode, .ufp" style="display: none" multiple @change="uploadFile" />
|
||||
<input type="file" ref="fileUpload" :accept="validGcodeExtensions.join(', ')" style="display: none" multiple @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle my-5 my-sm-0 col-12 col-sm-auto px-0 py-0" name="controllers">
|
||||
<v-btn @click="clickUploadButton" :title="$t('Files.UploadNewGcode')" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" :title="$t('Files.CreateNewDirectory')" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn @click="refreshFileList" :title="$t('Files.RefreshCurrentDirectory')" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Files.SetupCurrentList')">
|
||||
<v-btn @click="clickUploadButton" title="Upload new Gcode" class="primary flex-grow-1" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" title="Create new Directory" class="flex-grow-1"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn @click="refreshFileList" title="Refresh current Directory" class="flex-grow-1"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" title="Setup current list">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="flex-grow-1" v-bind="attrs" v-on="on"><v-icon class="">mdi-cog</v-icon></v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" :label="$t('Files.HiddenFiles')"></v-checkbox>
|
||||
<v-checkbox class="mt-0" hide-details v-model="showHiddenFiles" label="Hidden files"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item class="minHeight36" v-for="header of configHeaders" v-bind:key="header.key">
|
||||
@@ -75,16 +75,16 @@
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>
|
||||
{{ $t("Files.CurrentPath") }} {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}<br />
|
||||
Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}<br />
|
||||
<div v-if="this.disk_usage !== null">
|
||||
<v-tooltip top>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">{{ $t('Files.FreeDisk') + formatFilesize(disk_usage.free) }}</span>
|
||||
<span v-bind="attrs" v-on="on">Free disk: {{ formatFilesize(disk_usage.free) }}</span>
|
||||
</template>
|
||||
<span>
|
||||
{{ $t('Files.Used') + formatFilesize(this.disk_usage.used) }}<br />
|
||||
{{ $t('Files.Free') + formatFilesize(this.disk_usage.free) }}<br />
|
||||
{{ $t('Files.Total') + formatFilesize(this.disk_usage.total) }}
|
||||
Used: {{ formatFilesize(this.disk_usage.used) }}<br />
|
||||
Free: {{ formatFilesize(this.disk_usage.free) }}<br />
|
||||
Total: {{ formatFilesize(this.disk_usage.total) }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
@@ -93,7 +93,7 @@
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
append-icon="mdi-magnify"
|
||||
:label="$t('Files.Search')"
|
||||
label="Search"
|
||||
single-line
|
||||
hide-details
|
||||
></v-text-field>
|
||||
@@ -108,7 +108,7 @@
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items-per-page.sync="countPerPage"
|
||||
:footer-props="{
|
||||
itemsPerPageText: $t('Files.Files')
|
||||
itemsPerPageText: 'Files'
|
||||
}"
|
||||
item-key="name"
|
||||
:search="search"
|
||||
@@ -121,7 +121,7 @@
|
||||
</template>
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">{{ $t('Files.empty') }}</div>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== 'gcodes')">
|
||||
@@ -137,9 +137,10 @@
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr
|
||||
v-longpress:600="(e) => showContextMenu(e, item)"
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor"
|
||||
class="file-list-cursor user-select-none"
|
||||
draggable="true"
|
||||
@drag="dragFile($event, item)"
|
||||
@dragend="dragendFile($event)"
|
||||
@@ -167,16 +168,16 @@
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'slicer')[0].visible">{{ item.slicer ? item.slicer : '--' }}<br /><small v-if="item.slicer_version">{{ item.slicer_version}}</small></td>
|
||||
</tr>
|
||||
</template>
|
||||
<v-data-footer>{{ $t('Files.blabla')}}</v-data-footer>
|
||||
<v-data-footer>bla bla</v-data-footer>
|
||||
</v-data-table>
|
||||
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
|
||||
<div class="textnode">{{ $t('Files.DropFilesToAddGcode')}}</div>
|
||||
<div class="textnode">Drop files to add gcode.</div>
|
||||
</div>
|
||||
</v-card>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item @click="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> {{ $t("Files.PrintStart")}}
|
||||
<v-list-item @click="clickRow(contextMenu.item, true)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> Print start
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
@click="preheat"
|
||||
@@ -188,22 +189,22 @@
|
||||
"
|
||||
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
|
||||
>
|
||||
<v-icon class="mr-1">mdi-fire</v-icon> {{ $t('Files.Preheat')}}
|
||||
<v-icon class="mr-1">mdi-fire</v-icon> Preheat
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> {{ $t('Filse.Download')}}
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> {{ $t('Filse.Rename')}}
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
</v-list-item>
|
||||
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
</v-list-item>
|
||||
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> {{ $t('Filse.Delete')}}
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -214,52 +215,52 @@
|
||||
v-if="existsBigThumbnail(dialogPrintFile.item)"
|
||||
:src="'data:image/gif;base64,'+getBigThumbnail(dialogPrintFile.item)"
|
||||
></v-img>
|
||||
<v-card-title class="headline">{{ $t('Files.StartJob') }}</v-card-title>
|
||||
<v-card-text>{{ $t('Files.DoYouWantToStart') + dialogPrintFile.item.filename }}?</v-card-text>
|
||||
<v-card-title class="headline">Start Job</v-card-title>
|
||||
<v-card-text>Do you want to start {{ dialogPrintFile.item.filename }}?</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">{{ $t('Files.No')}}</v-btn>
|
||||
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">{{$t('Files.Yes')}}</v-btn>
|
||||
<v-btn color="red darken-1" text @click="dialogPrintFile.show = false">No</v-btn>
|
||||
<v-btn color="green darken-1" text @click="startPrint(dialogPrintFile.item.filename)">Yes</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Files.NewDirectory') }}</v-card-title>
|
||||
<v-card-title class="headline">New Directory</v-card-title>
|
||||
<v-card-text>
|
||||
{{ $t('Files.PleaseEnterANewDirectoryName') }}
|
||||
Please enter a new directory name:
|
||||
<v-text-field label="Name" :rules="input_rules" @keypress.enter="createDirectoryAction" required v-model="dialogCreateDirectory.name"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">{{ $t('Files.Create') }}</v-btn>
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">create</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Files.RenameFile')}}</v-card-title>
|
||||
<v-card-title class="headline">Rename File</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field :label="$t('Files.Name')" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></v-text-field>
|
||||
<v-text-field label="Name" required v-model="dialogRenameFile.newName" ref="inputFieldNewName"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
<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="dialogRenameDirectory.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">{{ $t('Files.RenameDirectory') }}</v-card-title>
|
||||
<v-card-title class="headline">Rename Directory</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogRenameDirectory.newName"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">rename</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -272,7 +273,7 @@
|
||||
dark
|
||||
v-model="uploadSnackbar.status"
|
||||
>
|
||||
<span v-if="uploadSnackbar.max > 1" class="mr-1">({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})</span><strong>{{ $t("Files.Uploading") + uploadSnackbar.filename }}</strong><br />
|
||||
<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 }">
|
||||
@@ -293,6 +294,7 @@
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import axios from 'axios'
|
||||
import { findDirectory } from "@/plugins/helpers"
|
||||
import { validGcodeExtensions } from "@/store/variables"
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -322,14 +324,14 @@
|
||||
},
|
||||
headers: [
|
||||
{ text: '', value: '', align: 'left', configable: false, visible: true, filterable: false },
|
||||
{ text: this.$t('Files.Name'), value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: this.$t('Files.Filesize'), value: 'size', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.LastModified'), value: 'modified', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.ObjectHeight'), value: 'object_height', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.LayerHeight'), value: 'layer_height', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.FilamentUsage'), value: 'filament_total', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.PrintTime'), value: 'estimated_time', align: 'right', configable: true, visible: true },
|
||||
{ text: this.$t('Files.Slicer'), value: 'slicer', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Name', value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: 'Filesize', value: 'size', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Last modified', value: 'modified', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Object Height', value: 'object_height', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Layer Height', value: 'layer_height', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Filament Usage', value: 'filament_total', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Print Time', value: 'estimated_time', align: 'right', configable: true, visible: true },
|
||||
{ text: 'Slicer', value: 'slicer', align: 'right', configable: true, visible: true },
|
||||
],
|
||||
options: {
|
||||
|
||||
@@ -368,7 +370,8 @@
|
||||
time: 0,
|
||||
loaded: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
validGcodeExtensions: validGcodeExtensions
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -545,12 +548,16 @@
|
||||
return '--'
|
||||
},
|
||||
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
|
||||
})
|
||||
}
|
||||
},
|
||||
preheat() {
|
||||
if (
|
||||
@@ -621,13 +628,18 @@
|
||||
deleteDirectoryAction: function() {
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteDir');
|
||||
},
|
||||
clickRow: function(item) {
|
||||
if (!item.isDirectory) {
|
||||
this.dialogPrintFile.show = true;
|
||||
this.dialogPrintFile.item = item;
|
||||
} else {
|
||||
this.currentPath += "/"+item.filename;
|
||||
this.loadPath();
|
||||
clickRow(item, force = false) {
|
||||
if (!this.contextMenu.shown || force) {
|
||||
if (force) {
|
||||
this.contextMenu.shown = false;
|
||||
}
|
||||
if (!item.isDirectory) {
|
||||
this.dialogPrintFile.show = true;
|
||||
this.dialogPrintFile.item = item;
|
||||
} else {
|
||||
this.currentPath += "/" + item.filename;
|
||||
this.loadPath();
|
||||
}
|
||||
}
|
||||
},
|
||||
clickRowGoBack: function() {
|
||||
@@ -642,8 +654,8 @@
|
||||
}
|
||||
},
|
||||
startPrint(filename = "") {
|
||||
filename = (this.currentPath+"/"+filename).substring(7);
|
||||
this.dialogPrintFile.show = false;
|
||||
filename = (this.currentPath+"/"+filename).substring(7)
|
||||
this.dialogPrintFile.show = false
|
||||
this.$socket.sendObj('printer.print.start', { filename: filename }, 'switchToDashboard');
|
||||
},
|
||||
dragOverUpload(e) {
|
||||
@@ -866,16 +878,6 @@
|
||||
if (headerElement) headerElement.visible = false
|
||||
})
|
||||
}
|
||||
/*headers: {
|
||||
deep: true,
|
||||
handler(newVal) {
|
||||
window.console.log(newVal)
|
||||
newVal.forEach((element) => {
|
||||
if (element.visible && this.hideMetadataColums.includes(element.value)) this.hideMetadataColums.splice(this.hideMetadataColums.indexOf(element.value), 1)
|
||||
else if (!element.visible && !this.hideMetadataColums.includes(element.value)) this.hideMetadataColums.push(element.value)
|
||||
})
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -71,7 +71,15 @@
|
||||
<template v-slot:default>
|
||||
<tbody>
|
||||
<tr v-for="(profile, index) in profiles" :key="index" >
|
||||
<td>{{ profile.name }}<small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
|
||||
<td><span @click="loadProfile(profile.name)" :class="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) ? 'font-weight-bold' : ''" style="cursor: pointer;">{{ profile.name }}</span><small class="ml-2" v-if="'deleted' in profile.data">(deleted)</small></td>
|
||||
<td>
|
||||
<v-tooltip top color="rgba(0,0,0,0.8)">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<small v-bind="attrs" v-on="on">{{ profile.variance.toFixed(3) }}</small>
|
||||
</template>
|
||||
<span>min: {{ profile.min }}<br/>max: {{ profile.max }}</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<v-btn-toggle dense no-gutters>
|
||||
<v-btn class="btnMinWidthAuto" @click="loadProfile(profile.name)" :loading="loadings.includes('bedMeshLoad_'+profile.name)" :disabled="('profile_name' in bed_mesh && bed_mesh.profile_name === profile.name) || 'deleted' in profile.data" ><v-icon small>mdi-view-grid-plus</v-icon></v-btn>
|
||||
@@ -152,7 +160,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import {mapGetters, mapState} from 'vuex'
|
||||
import { Plotly } from 'vue-plotly'
|
||||
|
||||
export default {
|
||||
@@ -221,7 +229,7 @@
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
config: state => state.printer.configfile.config,
|
||||
config: state => state.printer.configfile.settings,
|
||||
loadings: state => state.socket.loadings,
|
||||
}),
|
||||
|
||||
@@ -255,36 +263,26 @@
|
||||
this.data[0].z = [];
|
||||
|
||||
if (this.bed_mesh && this.bed_mesh.profile_name !== "") {
|
||||
const meshXmin = this.bed_mesh.mesh_min[0]
|
||||
const meshXmax = this.bed_mesh.mesh_max[0]
|
||||
const meshYmin = this.bed_mesh.mesh_min[1]
|
||||
const meshYmax = this.bed_mesh.mesh_max[1]
|
||||
|
||||
if ('stepper_x 'in this.config && 'stepper_y' in this.config) {
|
||||
this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max];
|
||||
this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max];
|
||||
if ('stepper_x' in this.config && 'stepper_y' in this.config) {
|
||||
this.layout.scene.xaxis.range = [this.config.stepper_x.position_min, this.config.stepper_x.position_max]
|
||||
this.layout.scene.yaxis.range= [this.config.stepper_y.position_min, this.config.stepper_y.position_max]
|
||||
} else {
|
||||
this.layout.scene.xaxis.range = [this.bed_mesh.mesh_min[0], this.bed_mesh.mesh_max[0]];
|
||||
this.layout.scene.yaxis.range = [this.bed_mesh.mesh_min[1], this.bed_mesh.mesh_max[1]];
|
||||
this.layout.scene.xaxis.range = [meshXmin, meshXmax];
|
||||
this.layout.scene.yaxis.range = [meshYmin, meshYmax];
|
||||
}
|
||||
|
||||
let x_count = 0;
|
||||
let y_count = 0;
|
||||
const meshData = this.showMeshType === "probed" ? this.bed_mesh.probed_matrix : this.bed_mesh.mesh_matrix
|
||||
const x_count = meshData[0].length;
|
||||
const y_count = meshData.length;
|
||||
this.data[0].z = meshData;
|
||||
|
||||
let min = -0.5;
|
||||
let max = 0.5;
|
||||
|
||||
if (this.showMeshType === 'probed') {
|
||||
x_count = this.bed_mesh.probed_matrix[0].length;
|
||||
y_count = this.bed_mesh.probed_matrix.length;
|
||||
this.data[0].z = this.bed_mesh.probed_matrix;
|
||||
|
||||
min = Math.min.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
max = Math.max.apply(null, this.bed_mesh.probed_matrix.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
} else if (this.showMeshType === 'mesh') {
|
||||
x_count = this.bed_mesh.mesh_matrix[0].length;
|
||||
y_count = this.bed_mesh.mesh_matrix.length;
|
||||
this.data[0].z = this.bed_mesh.mesh_matrix;
|
||||
|
||||
min = Math.min.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
max = Math.max.apply(null, this.bed_mesh.mesh_matrix.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
}
|
||||
let min = Math.min.apply(null, meshData.map(function(row){ return Math.min.apply(Math, row); }));
|
||||
let max = Math.max.apply(null, meshData.map(function(row){ return Math.max.apply(Math, row); }));
|
||||
|
||||
let x_step = (this.bed_mesh.mesh_max[0] - this.bed_mesh.mesh_min[0]) / (x_count - 1);
|
||||
for(let i = 0; i < x_count; i++) {
|
||||
@@ -365,7 +363,7 @@
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-general-panel></settings-general-panel>
|
||||
<settings-language-panel class="mt-6"></settings-language-panel>
|
||||
<settings-webcam-panel class="mt-6"></settings-webcam-panel>
|
||||
<settings-dashboard-panel class="mt-6"></settings-dashboard-panel>
|
||||
<settings-console-panel class="mt-6"></settings-console-panel>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import Vue from 'vue';
|
||||
import VueI18n from 'vue-i18n'
|
||||
Vue.use(VueI18n)
|
||||
|
||||
function loadLocaleMessages () {
|
||||
const locales = require.context('../locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
|
||||
const messages = {}
|
||||
locales.keys().forEach(key => {
|
||||
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
||||
if (matched && matched.length > 1) {
|
||||
const locale = matched[1]
|
||||
messages[locale] = locales(key)
|
||||
}
|
||||
})
|
||||
return messages
|
||||
}
|
||||
|
||||
let lang = localStorage.getItem("lang") || 'en'
|
||||
|
||||
localStorage.setItem("lang",lang);
|
||||
|
||||
export default new VueI18n({
|
||||
locale: process.env.VUE_APP_I18N_LOCALE || lang,
|
||||
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || lang,
|
||||
messages: loadLocaleMessages()
|
||||
})
|
||||
@@ -0,0 +1,100 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
Vue.directive('longpress', {
|
||||
bind: function (el, binding, vNode) {
|
||||
// Make sure expression provided is a function
|
||||
if (typeof binding.value !== 'function') {
|
||||
// Fetch name of component
|
||||
const compName = vNode.context.name
|
||||
// pass warning to console
|
||||
let warn = `[longpress:] provided expression '${binding.expression}' is not a function, but has to be`
|
||||
if (compName) { warn += ` Found in component '${compName}' ` }
|
||||
|
||||
console.warn(warn)
|
||||
}
|
||||
|
||||
const debounceTime = parseInt(binding.arg ?? 1000);
|
||||
|
||||
// Run Function
|
||||
const handler = (e) => {
|
||||
binding.value(e)
|
||||
}
|
||||
|
||||
// Define variable
|
||||
let pressTimer = null
|
||||
|
||||
// Define funtion handlers
|
||||
// Create timeout ( run function after 1s )
|
||||
let before = null;
|
||||
let start = (e) => {
|
||||
if ((e.type === 'click' && e.button !== 0)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!e.touches || e.touches.length < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
before = document.querySelector('body').getAttribute('style');
|
||||
document.querySelector('body').setAttribute('style', (before ?? '') + 'user-select: none; -webkit-user-select: none; -moz-user-select: none;');
|
||||
|
||||
if (pressTimer === null) {
|
||||
pressTimer = setTimeout(() => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
e.stopImmediatePropagation();
|
||||
e.cancelBubble = true;
|
||||
// Run function
|
||||
handler({
|
||||
clientX: e.touches[0].clientX,
|
||||
clientY: e.touches[0].clientY,
|
||||
force: e.touches[0].force,
|
||||
identifier: e.touches[0].identifier,
|
||||
pageX: e.touches[0].pageX,
|
||||
pageY: e.touches[0].pageY,
|
||||
radiusX: e.touches[0].radiusX,
|
||||
radiusY: e.touches[0].radiusY,
|
||||
rotationAngle: e.touches[0].rotationAngle,
|
||||
screenX: e.touches[0].screenX,
|
||||
screenY: e.touches[0].screenY,
|
||||
preventDefault: () => e.preventDefault()
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (before) {
|
||||
document.querySelector('body').setAttribute('style', before);
|
||||
}
|
||||
}, 100);
|
||||
}, debounceTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Cancel Timeout
|
||||
let cancel = () => {
|
||||
// Check if timer has a value or not
|
||||
if (pressTimer !== null) {
|
||||
clearTimeout(pressTimer)
|
||||
pressTimer = null
|
||||
if (before) {
|
||||
document.querySelector('body').setAttribute('style', before);
|
||||
}
|
||||
/*console.log(e.type);
|
||||
if (e.type === "touchend" && vNode.data.on.click) {
|
||||
vNode.data.on.click();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
// Add Event listeners
|
||||
// el.addEventListener("mousedown", start);
|
||||
el.addEventListener("touchstart", start);
|
||||
// Cancel timeouts if this events happen
|
||||
//el.addEventListener("click", cancel);
|
||||
//el.addEventListener("mouseout", cancel);
|
||||
el.addEventListener("touchmove", cancel);
|
||||
el.addEventListener("touchend", cancel);
|
||||
el.addEventListener("touchcancel", cancel);
|
||||
|
||||
document.addEventListener("scroll", cancel);
|
||||
}
|
||||
});
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rootState.gui.remotePrinters.forEach((printer) => {
|
||||
rootState.gui.remote_printers.forEach((printer) => {
|
||||
commit('addPrinter',{
|
||||
hostname: printer.hostname,
|
||||
port: printer.port,
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
dispatch("gui/setSettings", { remotePrinters: printers }, { root: true })
|
||||
dispatch("gui/setSettings", { remote_printers: printers }, { root: true })
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -122,6 +122,11 @@ export default {
|
||||
action: "getConfigDir",
|
||||
params: { root: "config"}
|
||||
})
|
||||
|
||||
dispatch("sendObj", {
|
||||
method: "server.database.list",
|
||||
action: "getDatabases"
|
||||
})
|
||||
},
|
||||
|
||||
getObjectsList({ dispatch }, payload) {
|
||||
@@ -172,4 +177,20 @@ export default {
|
||||
getConfigDir({ commit }, payload) {
|
||||
commit("setConfigDir", payload)
|
||||
},
|
||||
|
||||
getDatabases({ commit, dispatch }, payload) {
|
||||
commit("setDatabases", payload.namespaces)
|
||||
|
||||
if (payload.namespaces.includes("mainsail")) {
|
||||
dispatch("sendObj", {
|
||||
method: 'server.database.get_item',
|
||||
params: { namespace: "mainsail" },
|
||||
action: "getMainsailData"
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
getMainsailData({ commit }, payload) {
|
||||
commit("setMainsailData", payload.value)
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ export function getDefaultState() {
|
||||
data: {
|
||||
|
||||
},
|
||||
databases: [],
|
||||
current_file: {},
|
||||
theme_files: []
|
||||
}
|
||||
|
||||
@@ -59,20 +59,11 @@ export default {
|
||||
if ("filename" in file) {
|
||||
if (file.filename.startsWith(".theme/")) {
|
||||
state.theme_files.push(file.filename)
|
||||
} else if (file.filename === ".mainsail.json") {
|
||||
fetch('//'+state.socket.hostname+':'+state.socket.port+'/server/files/config/.mainsail.json?time='+Date.now())
|
||||
.then(res => res.json()).then(file => {
|
||||
this.commit("farm/"+state._namespace+"/setMainsailJson", file)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setMainsailJson(state, payload) {
|
||||
Vue.set(state.data, 'gui', payload.state)
|
||||
},
|
||||
|
||||
notifyFilelistChanged( state, payload) {
|
||||
if (
|
||||
payload.action === "upload_file" &&
|
||||
@@ -84,5 +75,13 @@ export default {
|
||||
this.commit("farm/"+state._namespace+"/setMainsailJson", file)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setDatabases(state, payload) {
|
||||
Vue.set(state, 'databases', payload.namespaces)
|
||||
},
|
||||
|
||||
setMainsailData(state, payload) {
|
||||
Vue.set(state.data, 'gui', payload)
|
||||
},
|
||||
}
|
||||
@@ -34,6 +34,21 @@ export default {
|
||||
return '/img/sidebar-background.png'
|
||||
},
|
||||
|
||||
getMainBackground: (state, getters, rootState, rootGetters) => {
|
||||
let configDir = findDirectory(state.filetree, ['config', themeDir])
|
||||
|
||||
let file = configDir.find(element =>
|
||||
element.filename !== undefined && (
|
||||
element.filename === 'main-background.jpg' ||
|
||||
element.filename === 'main-background.png' ||
|
||||
element.filename === 'main-background.gif'
|
||||
)
|
||||
)
|
||||
if (file) return 'url('+rootGetters["socket/getUrl"]+'/server/files/config/'+themeDir+'/'+file.filename+')'
|
||||
|
||||
return 'transparent'
|
||||
},
|
||||
|
||||
getCustomStylesheet: (state, getters, rootState, rootGetters) => {
|
||||
let configDir = findDirectory(state.filetree, ['config', themeDir])
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ export default {
|
||||
for (const [key, item] of Object.entries(parent)) {
|
||||
if (
|
||||
item.isDirectory &&
|
||||
'filename' in item &&
|
||||
'dirs' in payload &&
|
||||
payload.dirs.length > 0 &&
|
||||
payload.dirs.findIndex(element => element.dirname === item.filename) < 0
|
||||
|
||||
@@ -1,90 +1,147 @@
|
||||
import axios from "axios";
|
||||
import Vue from "vue";
|
||||
import objectAssignDeep from "object-assign-deep"
|
||||
|
||||
export default {
|
||||
reset({ commit }) {
|
||||
commit('reset')
|
||||
},
|
||||
|
||||
getData({ commit, dispatch }, payload) {
|
||||
commit('setData', payload)
|
||||
if (
|
||||
'state' in payload &&
|
||||
'tempchart' in payload.state &&
|
||||
'datasetSettings' in payload.state.tempchart
|
||||
) {
|
||||
for (const key of Object.keys(payload.state.tempchart.datasetSettings)) {
|
||||
if (
|
||||
'color' in payload.state.tempchart.datasetSettings[key] &&
|
||||
typeof payload.state.tempchart.datasetSettings[key].color === "object"
|
||||
) {
|
||||
dispatch('setTempchartDatasetSetting', { name: key, type: 'color', value: payload.state.tempchart.datasetSettings[key].color.hex })
|
||||
}
|
||||
}
|
||||
getData({ commit, dispatch, rootState }, payload) {
|
||||
commit('setData', payload.value)
|
||||
|
||||
if ('tempchart' in payload.value && 'datasetSettings' in payload.value.tempchart) {
|
||||
commit('setTempchartDatasetSettings', payload.value.tempchart.datasetSettings)
|
||||
}
|
||||
|
||||
if (!rootState.socket.remoteMode) {
|
||||
dispatch('farm/readStoredPrinters', {}, { root: true })
|
||||
}
|
||||
|
||||
dispatch('printer/init', null, { root: true })
|
||||
},
|
||||
|
||||
setSettings({ commit, dispatch }, payload) {
|
||||
setSettings({ commit }, payload) {
|
||||
commit('setSettings', payload)
|
||||
|
||||
if ('tempchart' in payload && 'boolPowerDatasets' in payload.tempchart) {
|
||||
if (payload.tempchart.boolPowerDatasets) commit('printer/tempHistory/showPowerDatasets', {}, { root: true })
|
||||
else commit('printer/tempHistory/hidePowerDatasets', {}, { root: true })
|
||||
Object.keys(payload).forEach(key => {
|
||||
Vue.prototype.$socket.sendObj('server.database.get_item', { namespace: 'mainsail' }, 'gui/updateSettings', { newVal: payload[key], keyName: key })
|
||||
})
|
||||
},
|
||||
|
||||
updateSettings({ commit }, payload) {
|
||||
const keyName = payload.keyName
|
||||
let newState = payload.newVal
|
||||
if ('value' in payload && keyName in payload.value && typeof payload.value[keyName] !== "string") {
|
||||
newState = objectAssignDeep(payload.value[keyName], newState)
|
||||
}
|
||||
|
||||
dispatch('upload')
|
||||
Vue.prototype.$socket.sendObj('server.database.post_item', { namespace: 'mainsail', key: keyName, value: newState })
|
||||
|
||||
commit('void', {}, { root: true })
|
||||
},
|
||||
|
||||
upload({ state, rootState }) {
|
||||
let file = new File([JSON.stringify({ state })], '.mainsail.json');
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('root', 'config');
|
||||
|
||||
axios.post('//' + rootState.socket.hostname + ':' + rootState.socket.port + '/server/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
).then(() => {
|
||||
|
||||
}).catch(() => {
|
||||
window.console.error("Error save .mainsail.json!")
|
||||
});
|
||||
},
|
||||
|
||||
setGcodefilesMetadata({ commit, dispatch }, data) {
|
||||
setGcodefilesMetadata({ commit, dispatch, state }, data) {
|
||||
commit('setGcodefilesMetadata', data)
|
||||
dispatch('upload')
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'gcodefiles',
|
||||
newVal: state.gcodefiles
|
||||
})
|
||||
},
|
||||
|
||||
setGcodefilesShowHiddenFiles({ commit, dispatch }, data) {
|
||||
setGcodefilesShowHiddenFiles({ commit, dispatch, state }, data) {
|
||||
commit('setGcodefilesShowHiddenFiles', data)
|
||||
dispatch('upload')
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'gcodefiles',
|
||||
newVal: state.gcodefiles
|
||||
})
|
||||
},
|
||||
|
||||
addPreset({ commit, dispatch }, payload) {
|
||||
addPreset({ commit, dispatch, state }, payload) {
|
||||
commit("addPreset", payload)
|
||||
dispatch("upload")
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'presets',
|
||||
newVal: state.presets
|
||||
})
|
||||
},
|
||||
|
||||
updatePreset({ commit, dispatch }, payload) {
|
||||
updatePreset({ commit, dispatch, state }, payload) {
|
||||
commit("updatePreset", payload)
|
||||
dispatch("upload")
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'presets',
|
||||
newVal: state.presets
|
||||
})
|
||||
},
|
||||
|
||||
deletePreset({ commit, dispatch }, payload) {
|
||||
deletePreset({ commit, dispatch, state }, payload) {
|
||||
commit("deletePreset", payload)
|
||||
dispatch("upload")
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'presets',
|
||||
newVal: state.presets
|
||||
})
|
||||
},
|
||||
|
||||
setTempchartDatasetSetting({ commit, dispatch }, payload) {
|
||||
setTempchartDatasetSetting({ commit, dispatch, state }, payload) {
|
||||
commit("setTempchartDatasetSetting", payload)
|
||||
dispatch("upload")
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'tempchart',
|
||||
newVal: state.tempchart
|
||||
})
|
||||
},
|
||||
|
||||
setTempchartDatasetAdditionalSensorSetting({ commit, dispatch }, payload) {
|
||||
setTempchartDatasetAdditionalSensorSetting({ commit, dispatch, state }, payload) {
|
||||
commit("setTempchartDatasetAdditionalSensorSetting", payload)
|
||||
dispatch("upload")
|
||||
dispatch('updateSettings', {
|
||||
keyName: 'tempchart',
|
||||
newVal: state.tempchart
|
||||
})
|
||||
},
|
||||
|
||||
resetMoonrakerDB() {
|
||||
Vue.prototype.$socket.sendObj('server.database.list', { }, 'gui/resetMoonrakerDB2')
|
||||
},
|
||||
|
||||
resetMoonrakerDB2({ commit }, payload) {
|
||||
if ('namespaces' in payload && payload.namespaces.includes('mainsail')) {
|
||||
Vue.prototype.$socket.sendObj('server.database.get_item', { namespace: 'mainsail' }, 'gui/resetMoonrakerDB3')
|
||||
}
|
||||
|
||||
commit('void', {}, { root: true })
|
||||
},
|
||||
|
||||
resetMoonrakerDB3({ commit }, payload) {
|
||||
if ('value' in payload && Object.keys(payload.value).length) {
|
||||
Object.keys(payload.value).forEach(key => {
|
||||
Vue.prototype.$socket.sendObj('server.database.delete_item', { namespace: 'mainsail', key: key })
|
||||
})
|
||||
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
commit('void', {}, { root: true })
|
||||
},
|
||||
|
||||
//TODO: remove it after a short time of migration. maybe april release
|
||||
migrateMainsailJson({ state, dispatch, rootState }, payload) {
|
||||
const settings = {}
|
||||
|
||||
Object.keys(payload.state).forEach(key => {
|
||||
if (key in state) {
|
||||
settings[key] = {...payload.state[key]}
|
||||
}
|
||||
|
||||
if (key === "cooldownGcode") settings["cooldown_gcode"] = payload.state[key]
|
||||
if (key === "remotePrinters") settings["remote_printers"] = payload.state[key]
|
||||
})
|
||||
|
||||
if (Object.keys(settings).length) {
|
||||
dispatch('setSettings', settings)
|
||||
}
|
||||
|
||||
Vue.prototype.$socket.sendObj('server.files.delete_file', { path: 'config/.mainsail.json' })
|
||||
|
||||
if (!rootState.socket.remoteMode) {
|
||||
dispatch('farm/readStoredPrinters', {}, { root: true })
|
||||
}
|
||||
dispatch('printer/init', null, { root: true })
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ export default {
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
getDatasetAdditionalSensorValue: (state) => (payload) => {
|
||||
if (
|
||||
payload.name in state.tempchart.datasetSettings &&
|
||||
@@ -33,6 +34,7 @@ export default {
|
||||
'boolList': true
|
||||
}
|
||||
},
|
||||
|
||||
getPresetsFromHeater: state => (payload) => {
|
||||
const output = []
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export function getDefaultState() {
|
||||
return {
|
||||
general: {
|
||||
printername: "",
|
||||
displayCancelPrint: false
|
||||
},
|
||||
dashboard: {
|
||||
boolWebcam: false,
|
||||
@@ -18,14 +19,22 @@ export function getDefaultState() {
|
||||
stepsXY: [ 100, 10, 1 ],
|
||||
feedrateZ: 25,
|
||||
stepsZ: [ 25, 1, 0.1 ],
|
||||
stepsAll: [0.1, 1, 10, 25, 50, 100],
|
||||
selectedCrossStep: null,
|
||||
reverseZ: false,
|
||||
useCross: false
|
||||
},
|
||||
extruder: {
|
||||
feedamount: 25,
|
||||
feedamounts: [ 50, 25, 10, 5, 1 ],
|
||||
feedrate: 5,
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
webcam: {
|
||||
url: "",
|
||||
service: 'mjpegstreamer',
|
||||
targetFps: 25,
|
||||
url: "/webcam/?action=stream",
|
||||
rotate: false,
|
||||
rotateDegrees: 90,
|
||||
flipX: false,
|
||||
@@ -34,7 +43,7 @@ export function getDefaultState() {
|
||||
},
|
||||
tempchart: {
|
||||
intervalChartUpdate: 1000,
|
||||
intervalDatasetUpdate: 500,
|
||||
intervalDatasetUpdate: 1000,
|
||||
autoscale: false,
|
||||
datasetSettings: {
|
||||
|
||||
@@ -56,9 +65,11 @@ export function getDefaultState() {
|
||||
showHiddenFiles: false,
|
||||
}
|
||||
},
|
||||
remotePrinters: [],
|
||||
//moonraker DB api dont accept camel case key names
|
||||
remote_printers: [],
|
||||
presets: [],
|
||||
cooldownGcode: "TURN_OFF_HEATERS"
|
||||
//moonraker DB api dont accept camel case key names
|
||||
cooldown_gcode: "TURN_OFF_HEATERS"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,4 +82,4 @@ export default {
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
||||
}
|
||||
@@ -9,16 +9,15 @@ export default {
|
||||
},
|
||||
|
||||
setData(state, payload) {
|
||||
if ("state" in payload) payload = payload.state
|
||||
if ("gui" in payload) payload = payload.gui
|
||||
let setDataDeep = function(currentState, payload) {
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
if (typeof value === 'object' && !Array.isArray(value) && key in currentState) {
|
||||
setDataDeep(currentState[key], value)
|
||||
} else if (key in currentState) Vue.set(currentState, key, value)
|
||||
})
|
||||
}
|
||||
|
||||
Object.entries(payload).forEach(([key, value]) => {
|
||||
if (typeof value === 'object') {
|
||||
Object.entries(value).forEach(([key2, value2]) => {
|
||||
Vue.set(state[key], key2, value2)
|
||||
})
|
||||
} else Vue.set(state, key, value)
|
||||
})
|
||||
setDataDeep(state, payload)
|
||||
},
|
||||
|
||||
// override special setting
|
||||
@@ -67,6 +66,10 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
setTempchartDatasetSettings(state, payload) {
|
||||
Vue.set(state.tempchart, 'datasetSettings', payload)
|
||||
},
|
||||
|
||||
setTempchartDatasetSetting(state, payload) {
|
||||
if (!(payload.name in state.tempchart.datasetSettings))
|
||||
Vue.set(state.tempchart.datasetSettings, payload.name, {})
|
||||
@@ -85,6 +88,5 @@ export default {
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name]['additionalSensors'], payload.sensor, {})
|
||||
|
||||
Vue.set(state.tempchart.datasetSettings[payload.name]['additionalSensors'][payload.sensor], 'boolList', payload.value)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -83,10 +83,10 @@ export default {
|
||||
power: 'power' in value ? value.power : null,
|
||||
presets: rootGetters["gui/getPresetsFromHeater"]({ name: key }),
|
||||
chartColor: getters["tempHistory/getDatasetColor"](name),
|
||||
chartTemperature: getters["tempHistory/getDataset"](name),
|
||||
chartTarget: getters["tempHistory/getDataset"](name+"_target"),
|
||||
chartPower: getters["tempHistory/getDataset"](name+'_power'),
|
||||
chartSpeed: getters["tempHistory/getDataset"](name+'_speed'),
|
||||
chartTemperature: getters["tempHistory/getSeries"](name),
|
||||
chartTarget: getters["tempHistory/getSeries"](name+"_target"),
|
||||
chartPower: getters["tempHistory/getSeries"](name+'_power'),
|
||||
chartSpeed: getters["tempHistory/getSeries"](name+'_speed'),
|
||||
min_temp: state.configfile.config[key] !== undefined ? parseFloat(state.configfile.config[key].min_temp) : undefined,
|
||||
max_temp: state.configfile.config[key] !== undefined ? parseFloat(state.configfile.config[key].max_temp) : undefined,
|
||||
});
|
||||
@@ -111,12 +111,13 @@ export default {
|
||||
additionValues: getters.getAdditionSensors(nameSplit[1]),
|
||||
tempListAdditionValues: getters.getTempListAdditionSensors(nameSplit[1]),
|
||||
speed: value.speed,
|
||||
rpm: 'rpm' in value ? value.rpm : false,
|
||||
presets: rootGetters["gui/getPresetsFromHeater"]({ name: key }),
|
||||
chartColor: getters["tempHistory/getDatasetColor"](nameSplit[1]),
|
||||
chartTemperature: getters["tempHistory/getDataset"](nameSplit[1]),
|
||||
chartTarget: getters["tempHistory/getDataset"](nameSplit[1]+"_target"),
|
||||
chartPower: getters["tempHistory/getDataset"](nameSplit[1]+'_power'),
|
||||
chartSpeed: getters["tempHistory/getDataset"](nameSplit[1]+'_speed'),
|
||||
chartTemperature: getters["tempHistory/getSeries"](nameSplit[1]),
|
||||
chartTarget: getters["tempHistory/getSeries"](nameSplit[1]+"_target"),
|
||||
chartPower: getters["tempHistory/getSeries"](nameSplit[1]+'_power'),
|
||||
chartSpeed: getters["tempHistory/getSeries"](nameSplit[1]+'_speed'),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -152,7 +153,7 @@ export default {
|
||||
measured_min_temp: value.measured_min_temp,
|
||||
measured_max_temp: value.measured_max_temp,
|
||||
chartColor: getters["tempHistory/getDatasetColor"](nameSplit[1]),
|
||||
chartTemperature: getters["tempHistory/getDataset"](nameSplit[1]),
|
||||
chartTemperature: getters["tempHistory/getSeries"](nameSplit[1]),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -231,6 +232,7 @@ export default {
|
||||
if (!name.startsWith("_")) {
|
||||
let controllable = controllableFans.includes(nameSplit[0].toLowerCase())
|
||||
let power = 'speed' in value ? value.speed : ('value' in value ? value.value : 0)
|
||||
let rpm = 'rpm' in value ? value.rpm : false
|
||||
let pwm = controllable
|
||||
let scale = 1
|
||||
|
||||
@@ -239,31 +241,36 @@ export default {
|
||||
if (nameSplit[0].toLowerCase() === "output_pin") {
|
||||
controllable = true
|
||||
pwm = false
|
||||
if (
|
||||
'config' in state.configfile &&
|
||||
key in state.configfile.config
|
||||
) {
|
||||
if (
|
||||
'pwm' in state.configfile.config[key] &&
|
||||
state.configfile.config[key].pwm.toLowerCase() === "true"
|
||||
) pwm = true
|
||||
if ('settings' in state.configfile && key in state.configfile.settings) {
|
||||
if ('pwm' in state.configfile.settings[key])
|
||||
pwm = state.configfile.settings[key].pwm
|
||||
|
||||
if (
|
||||
'scale' in state.configfile.config[key]
|
||||
) scale = state.configfile.config[key].scale
|
||||
if ('scale' in state.configfile.settings[key])
|
||||
scale = state.configfile.settings[key].scale
|
||||
}
|
||||
}
|
||||
|
||||
output.push({
|
||||
const tmp = {
|
||||
name: name,
|
||||
type: nameSplit[0],
|
||||
power: power,
|
||||
controllable: controllable,
|
||||
pwm: pwm,
|
||||
rpm: rpm,
|
||||
scale: scale,
|
||||
object: value,
|
||||
config: state.configfile.config[key]
|
||||
})
|
||||
config: state.configfile.settings[key]
|
||||
}
|
||||
|
||||
if ('settings' in state.configfile && key in state.configfile.settings) {
|
||||
if ('off_below' in state.configfile.settings[key])
|
||||
tmp['off_below'] = state.configfile.settings[key].off_below
|
||||
|
||||
if ('max_power' in state.configfile.settings[key])
|
||||
tmp['max_power'] = state.configfile.settings[key].max_power
|
||||
}
|
||||
|
||||
output.push(tmp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,7 +330,7 @@ export default {
|
||||
|
||||
return additionValues
|
||||
},
|
||||
|
||||
|
||||
getTempListAdditionSensors: (state, getters, rootState, rootGetters) => (name) => {
|
||||
let additionValues = {}
|
||||
additionalSensors.forEach(sensorName => {
|
||||
@@ -418,9 +425,25 @@ export default {
|
||||
let nameSplit = key.split(" ");
|
||||
|
||||
if (nameSplit.length > 1 && nameSplit[0] === "bed_mesh" && nameSplit[1] !== undefined) {
|
||||
let points = []
|
||||
value.points.split("\n").forEach(function(row) {
|
||||
if (row !== "") {
|
||||
row.split(', ').forEach(function(col) {
|
||||
points.push(parseFloat(col))
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
const min = Math.min(...points)
|
||||
const max = Math.max(...points)
|
||||
|
||||
profiles.push({
|
||||
name: nameSplit[1],
|
||||
data: value,
|
||||
points: points,
|
||||
min: min,
|
||||
max: max,
|
||||
variance: Math.abs(min - max),
|
||||
is_active: (currentProfile === nameSplit[1]),
|
||||
});
|
||||
}
|
||||
@@ -508,4 +531,4 @@ export default {
|
||||
checkConfigMacroCancel: state => {
|
||||
return Object.keys(state.configfile.config).findIndex(key => key.toLowerCase() === 'gcode_macro cancel_print') !== -1;
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,11 @@ export function getDefaultState() {
|
||||
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
printer: {
|
||||
|
||||
}
|
||||
},
|
||||
config_changed: false,
|
||||
},
|
||||
helplist: [],
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {colorArray, colorChamber, colorHeaterBed, datasetTypes} from "@/store/variables";
|
||||
import {convertName} from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
reset({ commit }) {
|
||||
@@ -8,6 +7,8 @@ export default {
|
||||
|
||||
getHistory({ commit, state, rootGetters }, payload) {
|
||||
const now = new Date()
|
||||
const maxHistory = rootGetters['server/getConfig']('server', 'temperature_store_size') || 1200
|
||||
|
||||
if (payload !== undefined) {
|
||||
Object.entries(payload).sort().forEach(([name, datasets]) => {
|
||||
let keySplit = name.split(" ")
|
||||
@@ -15,7 +16,7 @@ export default {
|
||||
const type = keySplit[0]
|
||||
|
||||
if ('temperatures' in datasets) {
|
||||
let datasetTemperature = state.datasets.find(element => element.name === name)
|
||||
let datasetTemperature = state.series.find(element => element.name === name)
|
||||
if (datasetTemperature === undefined) {
|
||||
let color = ''
|
||||
|
||||
@@ -27,8 +28,11 @@ export default {
|
||||
color = colorChamber;
|
||||
break;
|
||||
default:
|
||||
color = colorArray[state.datasets.filter(element =>
|
||||
!element.name.endsWith("_target") && element.name !== "heater_bed" && element.name !== "chamber"
|
||||
color = colorArray[state.series.filter(element =>
|
||||
'name' in element &&
|
||||
!element.name.endsWith("_target") &&
|
||||
element.name !== "heater_bed" &&
|
||||
element.name !== "chamber"
|
||||
).length];
|
||||
break;
|
||||
}
|
||||
@@ -36,78 +40,108 @@ export default {
|
||||
datasetTemperature = {
|
||||
type: "line",
|
||||
name: name,
|
||||
legendText: convertName(name),
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: true,
|
||||
markerType: 'circle',
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 1 : 0,
|
||||
lineStyle: {
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
width: 2,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 0.9 : 0
|
||||
},
|
||||
symbol: 'none',
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: rootGetters["gui/getDatasetValue"]({ name: name, type: 'color' }) || color,
|
||||
width: 2,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'temperature' })) ? 0.9 : 0
|
||||
}
|
||||
},
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addDataset', datasetTemperature)
|
||||
commit('addSeries', datasetTemperature)
|
||||
} else commit('clearDataset', name)
|
||||
|
||||
commit('addValue', {
|
||||
name: name,
|
||||
value: datasets.temperatures,
|
||||
type: type,
|
||||
time: now
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
|
||||
if ('targets' in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetTarget = state.datasets.find(element => element.name === name+"_target")
|
||||
let datasetTarget = state.series.find(element => element.name === name+"_target")
|
||||
if (datasetTarget === undefined) {
|
||||
datasetTarget = {
|
||||
type: "stepArea",
|
||||
type: "line",
|
||||
name: name+"_target",
|
||||
xValueType: "dateTime",
|
||||
dataPoints:[],
|
||||
showInLegend: false,
|
||||
markerType: 'none',
|
||||
color: datasetTemperature.color,
|
||||
fillOpacity: .1,
|
||||
lineThickness: 0,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 1 : 0,
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 0,
|
||||
},
|
||||
areaStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 0.1 : 0
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 0,
|
||||
},
|
||||
areaStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: 'target' })) ? 0.1 : 0
|
||||
},
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addDataset', datasetTarget)
|
||||
commit('addSeries', datasetTarget)
|
||||
} else commit('clearDataset', name+"_target")
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_target",
|
||||
value: datasets.targets,
|
||||
type: type,
|
||||
time: now
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
|
||||
['power', 'speed'].forEach(additionalType => {
|
||||
if (additionalType+"s" in datasets && (type.startsWith("extruder") || ["heater_bed", "temperature_fan"].includes(type))) {
|
||||
let datasetAdditinal = state.datasets.find(element => element.name === name+"_"+additionalType)
|
||||
let datasetAdditinal = state.series.find(element => element.name === name+"_"+additionalType)
|
||||
if (datasetAdditinal === undefined) {
|
||||
datasetAdditinal = {
|
||||
type: "line",
|
||||
name: name+"_"+additionalType,
|
||||
xValueType: "dateTime",
|
||||
axisYType: "secondary",
|
||||
dataPoints:[],
|
||||
showInLegend: false,
|
||||
markerType: 'none',
|
||||
lineDashType: "dot",
|
||||
lineThickness: 1,
|
||||
visible: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 1 : 0,
|
||||
color: datasetTemperature.color,
|
||||
yAxisIndex: 1,
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 1,
|
||||
type: 'dotted',
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 0.9 : 0
|
||||
},
|
||||
emphasis: {
|
||||
lineStyle: {
|
||||
color: datasetTemperature.lineStyle.color,
|
||||
width: 1,
|
||||
type: 'dotted',
|
||||
opacity: (rootGetters["gui/getDatasetValue"]({ name: name, type: additionalType })) ? 0.9 : 0
|
||||
},
|
||||
},
|
||||
symbol: 'none',
|
||||
data: [],
|
||||
}
|
||||
|
||||
commit('addDataset', datasetAdditinal)
|
||||
commit('addSeries', datasetAdditinal)
|
||||
} else commit('clearDataset', name+"_"+additionalType)
|
||||
|
||||
commit('addValue', {
|
||||
name: name+"_"+additionalType,
|
||||
value: datasets[additionalType+"s"],
|
||||
type: type,
|
||||
time: now
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -116,13 +150,15 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
updateDatasets({ commit, rootState }) {
|
||||
updateDatasets({ commit, rootState, rootGetters }) {
|
||||
if (
|
||||
'heaters' in rootState.printer &&
|
||||
'available_sensors' in rootState.printer.heaters &&
|
||||
rootState.printer.heaters.available_sensors.length
|
||||
) {
|
||||
const now = new Date()
|
||||
const maxHistory = rootGetters['server/getConfig']('server', 'temperature_store_size') || 1200
|
||||
|
||||
rootState.printer.heaters.available_sensors.forEach((objectName) => {
|
||||
if (objectName in rootState.printer) {
|
||||
const objectNameSplits = objectName.split(" ")
|
||||
@@ -135,7 +171,8 @@ export default {
|
||||
name: datasetType === "temperature" ? name : name+"_"+datasetType,
|
||||
value: rootState.printer[objectName][datasetType],
|
||||
type: objectNameSplits[0],
|
||||
time: now
|
||||
time: now,
|
||||
maxHistory: maxHistory
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,12 +1,52 @@
|
||||
export default {
|
||||
|
||||
getDatasetColor: state => (name) => {
|
||||
let dataset = state.datasets.find(element => element.name === name)
|
||||
let dataset = state.series.find(element => element.name === name)
|
||||
|
||||
return (dataset) ? dataset.color : null
|
||||
return (dataset && 'lineStyle' in dataset) ? dataset.lineStyle.color : null
|
||||
},
|
||||
|
||||
getDataset: state => (name) => {
|
||||
return state.datasets.find(element => element.name === name)
|
||||
getSeries: state => (name) => {
|
||||
return state.series.find(element => element.name === name)
|
||||
},
|
||||
|
||||
getCurrentMaxTemp: state => {
|
||||
let maxTemp = 0
|
||||
|
||||
state.series.forEach(serie => {
|
||||
if (
|
||||
serie.name.lastIndexOf("_") === -1 ||
|
||||
!['power', 'speed'].includes(serie.name.substr(serie.name.lastIndexOf("_")+1))
|
||||
) {
|
||||
if (
|
||||
serie.data.length && (
|
||||
(
|
||||
'lineStyle' in serie &&
|
||||
'opacity' in serie.lineStyle &&
|
||||
serie.lineStyle.opacity
|
||||
) || (
|
||||
'areaStyle' in serie &&
|
||||
'opacity' in serie.areaStyle &&
|
||||
serie.areaStyle.opacity
|
||||
)
|
||||
)
|
||||
) {
|
||||
const max = Math.max(...serie.data.map(data => data[1]))
|
||||
if (maxTemp < max) maxTemp = max
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return Math.ceil((maxTemp + 1) / 10) * 10
|
||||
},
|
||||
|
||||
getBoolDisplayPwmAxis: state => {
|
||||
return state.series.findIndex(serie =>
|
||||
serie.name.lastIndexOf("_") &&
|
||||
['power', 'speed'].includes(serie.name.substr(serie.name.lastIndexOf("_")+1)) &&
|
||||
'lineStyle' in serie &&
|
||||
'opacity' in serie.lineStyle &&
|
||||
serie.lineStyle.opacity > 0
|
||||
) !== -1
|
||||
}
|
||||
}
|
||||