Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
460714e775 | ||
|
|
b668fb6b48 | ||
|
|
8f11d50915 | ||
|
|
d13642cfd2 | ||
|
|
94858b9340 | ||
|
|
605c6ee05e | ||
|
|
31667347f9 | ||
|
|
99529defb8 | ||
|
|
188bce0aa4 | ||
|
|
98f50790c0 | ||
|
|
1e2c2d15e6 | ||
|
|
cb602518f0 | ||
|
|
8f363ec1c1 | ||
|
|
f26aff2085 | ||
|
|
fcae508d19 | ||
|
|
d9b5486346 | ||
|
|
a333b8afa6 | ||
|
|
672c6b3f32 | ||
|
|
ebaab6324d | ||
|
|
6c01fc04f8 | ||
|
|
7756362a58 | ||
|
|
601d49fc4e | ||
|
|
7b2d257db3 | ||
|
|
3fd3862bc5 | ||
|
|
e9179e5bcd | ||
|
|
f068a2ef21 | ||
|
|
6da293b494 | ||
|
|
fe385d1558 | ||
|
|
d4785c0b27 | ||
|
|
894ef6912b | ||
|
|
3997c8b3a1 | ||
|
|
5a4dfb492b | ||
|
|
49c79c9eae | ||
|
|
2bcf08e5ab | ||
|
|
ce6843cf49 | ||
|
|
cf7cb122d1 | ||
|
|
a56050ca1c | ||
|
|
39fdb75a96 | ||
|
|
f6687a944d | ||
|
|
c513a7ca51 | ||
|
|
616f84edbe | ||
|
|
fefabb1ef7 | ||
|
|
189fd3ddd7 | ||
|
|
e796b27145 | ||
|
|
ac32eca665 | ||
|
|
f94402b94b | ||
|
|
91f2e9b6d8 | ||
|
|
0f955fbeb4 | ||
|
|
6282356ddd | ||
|
|
9057bea653 | ||
|
|
d19bf2ee05 | ||
|
|
f35cf70301 | ||
|
|
27308e44ab | ||
|
|
0a5b664ded | ||
|
|
ece599595b | ||
|
|
c8f847ccc8 | ||
|
|
ca1fd5d04e | ||
|
|
470a7633c5 | ||
|
|
01da938a79 | ||
|
|
b27390133a | ||
|
|
231ef16da1 | ||
|
|
906e738151 | ||
|
|
4b6bcd7ad4 | ||
|
|
959869b64f | ||
|
|
fe19bddb54 | ||
|
|
59db2ca55b | ||
|
|
1691a2cbfe | ||
|
|
257b792aee | ||
|
|
1457f86764 | ||
|
|
3670d4cc63 | ||
|
|
d397ccf804 | ||
|
|
1b3636864d | ||
|
|
ce8608f7db | ||
|
|
0b276168b9 | ||
|
|
ea5f61761b | ||
|
|
260be4ae24 | ||
|
|
0b14108a6a | ||
|
|
7442908405 | ||
|
|
bb50aa690d | ||
|
|
facd18543e | ||
|
|
c3e3c6e567 | ||
|
|
0977cb39c6 | ||
|
|
e2273ecfaf | ||
|
|
a011510098 | ||
|
|
08a106d945 | ||
|
|
e6c19065b9 | ||
|
|
c9e0278b26 | ||
|
|
8220642774 | ||
|
|
c48f8321d5 | ||
|
|
789c1d2a5b | ||
|
|
294d21e47c | ||
|
|
d235c434f4 | ||
|
|
ce8df80d1c | ||
|
|
0672caa6fd | ||
|
|
bc0d1ed6df | ||
|
|
676fdaede5 | ||
|
|
75d742acbe | ||
|
|
c386375e53 | ||
|
|
98f7ceebd7 | ||
|
|
c14f9d8deb | ||
|
|
8aef278a03 | ||
|
|
bd938a5d02 | ||
|
|
76a93ccb45 | ||
|
|
5a20f9dcad | ||
|
|
5fed21320f | ||
|
|
8d620ba522 | ||
|
|
9074d28d9f | ||
|
|
a60603e360 | ||
|
|
b216ead36d | ||
|
|
330e78828d | ||
|
|
b0b25839ca | ||
|
|
5caaf20ee1 | ||
|
|
afb62ca393 | ||
|
|
c971e80074 | ||
|
|
f53cd00cc1 | ||
|
|
59efbfa369 | ||
|
|
b314e57bfc | ||
|
|
458444f03a | ||
|
|
2c093913e8 | ||
|
|
c81c491577 | ||
|
|
5cbed10d44 | ||
|
|
958358d483 | ||
|
|
ddc2ab477f | ||
|
|
f351268745 | ||
|
|
25a7e8a33b | ||
|
|
8b8f3cf939 | ||
|
|
3440d486df | ||
|
|
693fcae49a | ||
|
|
c99d4bea7e | ||
|
|
ac01dce620 | ||
|
|
d3c3113c43 | ||
|
|
ae30257ee1 | ||
|
|
b5add6f919 | ||
|
|
90b3419552 | ||
|
|
0100eaad5d | ||
|
|
825d65be9d | ||
|
|
38a0c8f441 | ||
|
|
ad6ae1128b | ||
|
|
6094c4f9bd | ||
|
|
65a4e40d39 | ||
|
|
39f3cfe824 | ||
|
|
84c9040e2a | ||
|
|
890a3e3332 | ||
|
|
16b6ed6000 | ||
|
|
2efc961eeb | ||
|
|
70c259bd22 | ||
|
|
d6eb97ffe1 | ||
|
|
fb10211b52 | ||
|
|
753efc5104 | ||
|
|
543af7032e | ||
|
|
0e21d865b7 | ||
|
|
601dd07f85 | ||
|
|
f06ce3e430 | ||
|
|
1f5f1749fc | ||
|
|
a40701d611 | ||
|
|
c0472dfb30 | ||
|
|
3607a2f6f9 | ||
|
|
03610868d1 | ||
|
|
f6873bda85 | ||
|
|
bec378d2a0 | ||
|
|
f2a5d1d8ee | ||
|
|
1daf1b07aa | ||
|
|
9bdcec01ca | ||
|
|
717408592d | ||
|
|
00319167a4 | ||
|
|
beb52f2290 | ||
|
|
8d45767e14 | ||
|
|
ffa2ea9b08 | ||
|
|
41f855d9c4 | ||
|
|
f4a514cb67 | ||
|
|
29d5b81b47 | ||
|
|
c322edba72 | ||
|
|
43d832cd33 | ||
|
|
981b2e854c | ||
|
|
707330e501 | ||
|
|
7a75f6f6cc | ||
|
|
331c0a1e99 | ||
|
|
0c70bd5f23 | ||
|
|
bce591e16e | ||
|
|
d0d36470ba | ||
|
|
479f2245e3 | ||
|
|
706803ea5b | ||
|
|
1efe346cb0 | ||
|
|
20bad7d24c | ||
|
|
8494a35adf | ||
|
|
6766a266e8 | ||
|
|
75d6cce540 | ||
|
|
e0e3150466 | ||
|
|
fcaebc4413 | ||
|
|
37f1ffb04b | ||
|
|
1b501bb810 | ||
|
|
7956304f64 | ||
|
|
e98d6c0ba9 | ||
|
|
be7abdf254 | ||
|
|
0e598f83a6 | ||
|
|
ded73fc6a8 | ||
|
|
458a6e8592 | ||
|
|
15a5e07dca | ||
|
|
efa15131d8 | ||
|
|
e9fc463e4a | ||
|
|
2636311cc1 | ||
|
|
32daeedcf7 | ||
|
|
98a7292b7b | ||
|
|
86d9bac54d | ||
|
|
bb0b7b58fa | ||
|
|
d18355507f | ||
|
|
316763e92e | ||
|
|
44a381c243 | ||
|
|
c71bc47ab8 | ||
|
|
143d9aad7e | ||
|
|
f2466b3ad7 | ||
|
|
7f6a1bcabe | ||
|
|
fb242bc5d3 | ||
|
|
accde2227b | ||
|
|
e25c10c757 | ||
|
|
5795fe45d1 | ||
|
|
1e61749175 | ||
|
|
4937f02673 | ||
|
|
4b13e4c6ce | ||
|
|
b4ee662a4f | ||
|
|
1fd2473e9e | ||
|
|
8a203c1def | ||
|
|
57f6d275a3 | ||
|
|
78dfbfb131 | ||
|
|
da844fec63 | ||
|
|
35e8470430 | ||
|
|
5cff1fc45a | ||
|
|
7301cecbdf | ||
|
|
0478d1aefb | ||
|
|
d9469b3c8b | ||
|
|
0a51b0d255 | ||
|
|
52afc35fd6 | ||
|
|
9e5266425c | ||
|
|
86595ab70b | ||
|
|
0f87e3f28f | ||
|
|
88305e74cf | ||
|
|
abea5d8660 | ||
|
|
d2bccb737e | ||
|
|
0bfde82ee8 | ||
|
|
de9485cc84 | ||
|
|
e8d2c71401 | ||
|
|
554b25d754 | ||
|
|
ecf2ee070b | ||
|
|
e35d13d446 | ||
|
|
9f46a502fc | ||
|
|
a4436348df | ||
|
|
706515bc84 | ||
|
|
efc70ca5aa | ||
|
|
544d5e2db5 | ||
|
|
70e8ce5687 | ||
|
|
6bc72dcb8c | ||
|
|
d0f78196c5 | ||
|
|
ec827bbea4 | ||
|
|
beba547031 | ||
|
|
bb18992f80 | ||
|
|
572fbd7629 | ||
|
|
69fff8fe0e | ||
|
|
101904bd6d | ||
|
|
28177e35a7 | ||
|
|
54aaf8d0c7 | ||
|
|
d57e888133 | ||
|
|
851c17a6d4 | ||
|
|
aa0780097c | ||
|
|
1ae7827f7e | ||
|
|
98950a2b9a | ||
|
|
3051c9a033 | ||
|
|
da7dc25b51 | ||
|
|
ea8d6cfb84 | ||
|
|
21b56a9c55 |
No files matched your search
@@ -0,0 +1,8 @@
|
||||
# hostname or ip from the moonraker instance
|
||||
VUE_APP_HOSTNAME=printer.local
|
||||
|
||||
# port from the moonraker instance
|
||||
VUE_APP_PORT=7125
|
||||
|
||||
# reconnect interval in ms
|
||||
VUE_APP_RECONNECT_INTERVAL=5000
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug:**\
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Expected behavior:**\
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots:**\
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Logfiles:**\
|
||||
Please upload your Logfiles here or upload them to [pastebin.com](http://pastebin.com) and paste your log links here.
|
||||
- klippy.log
|
||||
- moonraker.log
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FR]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,13 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
design
|
||||
*.log
|
||||
packages/test
|
||||
dist
|
||||
temp
|
||||
.vuerc
|
||||
.version
|
||||
.versions
|
||||
.changelog
|
||||
package-lock.json
|
||||
*.local
|
||||
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
@@ -1,24 +1,16 @@
|
||||
# kwc
|
||||
# Mainsail
|
||||
Mainsail is a lightweight & responsive web interface for the [Klipper](https://github.com/KevinOConnor/klipper)
|
||||
3D printer firmware. It communicates with the [Moonraker (Klipper-API)](https://github.com/arksine/moonraker) from [Arksine](https://github.com/arksine).
|
||||
|
||||
## Project setup
|
||||
```
|
||||
npm install
|
||||
```
|
||||

|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
npm run serve
|
||||
```
|
||||
To begin using Mainsail start by [installing](https://meteyou.github.io/mainsail/setup/) it or read the [pages](https://meteyou.github.io/mainsail/) for more informations.
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
npm run build
|
||||
```
|
||||
## Credit, sources and inspiration
|
||||
* [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
|
||||
* [Eric Callahan (arksine)](https://github.com/Arksine) for [Moonraker (Klipper API)](https://github.com/Arksine/moonraker). Without Moonraker, Mainsail would not be possible.
|
||||
* [lixxbox](https://github.com/lixxbox) for the Mainsail logo & Docs
|
||||
* [Vue.js](https://vuejs.org/): The Progressive JavaScript Framework
|
||||
* [Vuetify](https://vuetifyjs.com/): Material Design Component Framework for Vue.js
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
npm run lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
Massive thanks to the whole [Voron Design](http://vorondesign.com/) community. Without them such a project would not be possible.
|
||||
@@ -0,0 +1 @@
|
||||
Welcome to the Mainsail documentation. The [index](http://meteyou.github.io/mainsail) of the docs is here.
|
||||
@@ -0,0 +1,6 @@
|
||||
title: "Mainsail"
|
||||
logo: "/assets/img/logo-mainsail.png"
|
||||
description: A web interface for Klipper
|
||||
remote_theme: pmarsceill/just-the-docs
|
||||
color_scheme: "mainsail"
|
||||
search_enabled: true
|
||||
@@ -0,0 +1,17 @@
|
||||
$body-background-color: darken($grey-dk-300, 3%);
|
||||
$sidebar-color: $grey-dk-300;
|
||||
$border-color: $grey-dk-200;
|
||||
|
||||
$body-text-color: $grey-lt-300;
|
||||
$body-heading-color: $grey-lt-000;
|
||||
$nav-child-link-color: $grey-dk-000;
|
||||
$search-result-preview-color: $grey-dk-000;
|
||||
|
||||
$link-color: $red-300;
|
||||
$btn-primary-color: $blue-200;
|
||||
$base-button-color: $grey-dk-250;
|
||||
|
||||
$code-background-color: $grey-dk-250;
|
||||
$search-background-color: $grey-dk-250;
|
||||
$table-background-color: $grey-dk-250;
|
||||
$feedback-color: darken($sidebar-color, 3%);
|
||||
@@ -0,0 +1 @@
|
||||
$link-color: $red-300;
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
layout: default
|
||||
title: About
|
||||
nav_order: 100
|
||||
has_children: false
|
||||
permalink: /about
|
||||
---
|
||||
|
||||
# About Mainsail
|
||||
trollolol
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Additional Support
|
||||
nav_order: 5
|
||||
has_children: true
|
||||
permalink: /additional
|
||||
---
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
title: Samba shares
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/shares
|
||||
---
|
||||
|
||||
## Samba shares
|
||||
|
||||
``sudo apt-get update``
|
||||
``sudo apt-get install samba samba-common-bin``
|
||||
|
||||
> _passwort setzen - wird der schritt benötigt?_
|
||||
``sudo smbpasswd -a pi``
|
||||
|
||||
``sudo chmod -R 777 /home/pi/klipper_config``
|
||||
``sudo chmod -R 777 /home/pi/sdcard``
|
||||
|
||||
``sudo nano /etc/samba/smb.conf``
|
||||
|
||||
```ini
|
||||
[klipper_config]
|
||||
comment = klipper config
|
||||
path = /home/pi/klipper_config
|
||||
writeable = Yes
|
||||
only guest = Yes
|
||||
create mask = 0777
|
||||
directory mask = 0777
|
||||
browseable = Yes
|
||||
public = yes
|
||||
|
||||
[virtual_sdcard]
|
||||
comment = virtual sdcard
|
||||
path = /home/pi/sdcard
|
||||
writeable = yes
|
||||
only guest = yes
|
||||
create mask = 0777
|
||||
directory mask = 0777
|
||||
browseable = yes
|
||||
public = yes
|
||||
```
|
||||
|
||||
``sudo service smbd restart``
|
||||
@@ -0,0 +1,21 @@
|
||||
---
|
||||
layout: default
|
||||
title: Slicer upload
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/slicer-upload
|
||||
---
|
||||
|
||||
## Upload from Slicer
|
||||
### PrusaSlicer/SuperSlicer (prior to v2.3.0)
|
||||
|
||||
You can upload your GCode-files from your Slicer. Moonraker simulates the octoprint-upload function.
|
||||
|
||||
If not already been done, switch to advanced or expert mode and set the options under "Printer Settings / General" as shown in the screenshot below.
|
||||
For "API Key" you can type anything.
|
||||
|
||||

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

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

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

|
||||
|
||||
From now on the gcode files contain thumbnails displayed by mainsail.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
title: Webcam
|
||||
parent: Additional Support
|
||||
nav_order: 1
|
||||
permalink: /additional/webcam
|
||||
---
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 599.38 523.11" style="enable-background:new 0 0 599.38 523.11;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#E30613;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st1{fill:#D41216;}
|
||||
.st2{fill:#D41216;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st3{fill:none;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st4{display:none;}
|
||||
.st5{display:inline;fill:#E73D26;}
|
||||
.st6{display:inline;fill:none;}
|
||||
</style>
|
||||
<g id="Ebene_2">
|
||||
<g>
|
||||
<path class="st0" d="M382.29,142.98"/>
|
||||
<path class="st1" d="M382.29,142.98L132.98,522.82L0,522.68L344.3,0l0,0C352.18,49.06,365.2,97.68,382.29,142.98"/>
|
||||
<path class="st2" d="M413.28,213.54L208.5,522.92l132.94,0.19l135.03-206.33l0,0C452.69,284.29,431.53,249.77,413.28,213.54 L413.28,213.54"/>
|
||||
<path class="st3" d="M599.38,447.69"/>
|
||||
<path class="st3" d="M518.6,369.16"/>
|
||||
<path class="st1" d="M599.38,447.69l-49.25,75.42L417,522.82l101.6-153.67l0,0C543.48,397.35,570.49,423.61,599.38,447.69 L599.38,447.69z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Ebene_1" class="st4">
|
||||
<path class="st5" d="M-45.42,426.29c0.34,0.34,97.62,1.14,107.04,0.94c0.94-0.07,1.75-0.74,2.29-2.08 c0.47-1.14,1.08-2.02,1.41-2.02s0.61-0.34,0.61-0.67c0-0.81,2.76-4.91,3.56-5.24c0.27-0.13,0.47-0.61,0.47-1.08 c0-0.74,0.61-1.61,3.29-4.84c0.34-0.47,0.47-1.01,0.27-1.21c-0.27-0.2-0.07-0.4,0.34-0.4c0.47,0,0.81-0.47,0.81-1.01 c0-0.47,0.47-1.21,1.08-1.55c0.61-0.34,1.08-0.87,1.08-1.21c0.07-0.54,3.09-5.58,3.9-6.32c0.2-0.2,0.94-1.41,1.61-2.69 c0.74-1.28,1.48-2.49,1.68-2.69c0.61-0.54,3.43-4.64,3.43-4.98c0-0.2,1.95-3.23,4.37-6.72s4.37-6.66,4.37-7.06 c0-0.34,0.2-0.74,0.54-0.87c0.54-0.27,3.5-4.37,3.5-4.91c0-0.2,0.34-0.74,0.74-1.21c0.34-0.47,2.22-3.23,4.17-6.19 c1.88-2.96,3.56-5.51,3.83-5.71c0.2-0.2,0.74-1.14,1.28-2.15c0.54-1.01,1.48-2.49,2.22-3.16c0.67-0.74,1.21-1.55,1.21-1.68 c0-0.61,12.98-20.17,13.65-20.64c0.34-0.2,0.47-0.61,0.34-0.81c-0.07-0.27,0.27-1.01,0.87-1.68c0.61-0.67,1.61-2.22,2.35-3.36 c0.67-1.21,1.48-2.15,1.82-2.15c0.27,0,0.4-0.27,0.13-0.61c-0.2-0.34,0.07-1.01,0.54-1.55c1.48-1.48,5.18-7.13,5.18-7.87 c0-0.4,0.34-0.74,0.67-0.74c0.4,0,0.67-0.47,0.67-1.01c0-0.54,0.34-1.01,0.67-1.01c0.4,0,0.67-0.4,0.67-0.94 c0-0.54,0.27-1.08,0.54-1.21c0.27-0.13,1.28-1.41,2.15-2.89c0.87-1.48,1.88-3.03,2.15-3.36c1.01-1.21,9.28-13.92,9.28-14.19 c0-0.34,4.24-6.45,5.18-7.46c0.4-0.47,1.01-1.48,1.21-2.22c0.2-0.74,0.67-1.34,1.01-1.34c0.27,0,0.67-0.54,0.94-1.21 c0.4-1.14,1.82-3.56,2.49-4.17c0.2-0.2,2.15-3.16,4.37-6.66c2.15-3.43,4.5-6.86,5.11-7.53c0.67-0.74,1.08-1.28,0.87-1.28 c-0.2,0,0.74-1.48,2.02-3.36c1.28-1.82,2.35-3.63,2.35-4.03c0-0.34,0.2-0.67,0.54-0.67c0.27,0,1.21-1.34,2.15-3.03 c0.94-1.68,1.88-3.03,2.15-3.03c0.34,0,0.54-0.4,0.54-0.87c0-0.54,0.61-1.48,1.34-2.15c0.74-0.67,1.34-1.61,1.34-2.15 c0-0.47,0.34-0.87,0.67-0.87c0.4,0,0.67-0.34,0.67-0.67c0-0.74,3.16-5.85,4.5-7.26c0.4-0.4,1.01-1.41,1.21-2.15 s0.67-1.34,0.94-1.34c0.34,0,0.94-0.87,1.41-2.02c0.47-1.14,1.08-2.02,1.34-2.02c0.27,0,0.87-0.87,1.34-2.02 c0.47-1.14,1.08-2.02,1.34-2.02c0.27,0,0.87-0.94,1.34-2.02c0.47-1.14,1.14-2.02,1.48-2.02s0.4-0.34,0.2-0.67 c-0.2-0.4-0.2-0.67,0.13-0.67c0.27,0,1.41-1.55,2.55-3.36c1.08-1.88,2.22-3.36,2.55-3.36c0.27,0,0.4-0.27,0.2-0.61 c-0.2-0.27,0.2-1.08,0.94-1.75c0.74-0.67,1.34-1.55,1.34-1.95c0-0.4,0.74-1.61,1.68-2.62c0.94-1.01,1.55-1.82,1.41-1.82 c-0.34,0,8.87-14.19,10.35-15.93c0.34-0.47,0.67-1.14,0.67-1.55c0-0.34,0.34-0.67,0.67-0.67c0.4,0,0.67-0.47,0.67-1.01 s0.34-1.01,0.67-1.01c0.4,0,0.67-0.34,0.67-0.67c0-0.4,1.08-2.22,2.35-4.03s2.35-3.5,2.35-3.7s0.61-1.01,1.34-1.82 c0.74-0.81,1.34-1.88,1.34-2.35s0.34-0.87,0.74-0.87c0.34,0,0.54-0.27,0.34-0.54c-0.2-0.34,0.27-0.94,0.94-1.48 c0.67-0.54,1.14-1.14,1.01-1.34c-0.2-0.27,0.27-1.01,1.01-1.68c0.74-0.67,1.34-1.48,1.34-1.75c0-0.27,2.35-4.1,5.24-8.47 c2.96-4.37,8.27-12.51,11.9-18.02c3.63-5.58,6.93-10.29,7.33-10.56c0.4-0.27,0.47-0.54,0.13-0.54c-0.34,0-0.13-0.54,0.4-1.21 c1.01-1.21,1.08-1.75,0.2-3.83c-2.89-6.93-5.04-12.77-5.04-13.51c0-0.54-0.27-0.94-0.67-0.94c-0.34,0-0.61-0.2-0.54-0.54 c0.2-0.87-1.75-6.52-2.42-6.99c-0.4-0.27-0.47-0.67-0.2-0.94s0.2-0.81-0.13-1.21c-0.47-0.67-3.97-10.62-4.37-12.71 c-0.13-0.47-0.4-1.34-0.61-2.02c-0.27-0.61-0.67-1.68-0.94-2.35c-0.2-0.61-0.47-1.61-0.61-2.15c-0.27-1.34-1.61-5.98-2.42-8.14 c-0.34-0.94-0.67-2.35-0.74-3.16c-0.07-0.81-0.27-1.48-0.47-1.48c-0.27,0-0.47-0.4-0.54-0.87c0-0.4-0.2-1.41-0.4-2.15 c-0.2-0.74-1.01-3.9-1.68-7.06c-0.74-3.16-1.34-5.78-1.41-5.92c-0.13-0.07-0.2-0.34-0.27-0.67c-0.34-1.34-1.28-5.92-1.41-6.52 c-0.07-0.4-0.2-0.81-0.27-1.01c-0.2-0.4-0.54-2.22-0.94-5.38c-0.2-1.28-0.54-2.82-0.74-3.43c-0.27-0.61-0.4-1.34-0.34-1.68 c0.07-0.34,0-0.74-0.07-0.94c-0.27-0.67-0.67-3.09-0.94-5.38c-0.13-1.28-0.34-2.35-0.4-2.35c-0.13,0-0.61-3.36-0.74-5.92 c-0.07-1.01-0.4-2.02-0.74-2.22s-0.27-0.81,0.13-1.28c1.48-1.75-0.54-1.61-2.08,0.2l0,0c-0.87,1.01-2.22,2.96-2.96,4.37 c-0.74,1.48-1.95,3.29-2.69,4.1c-0.74,0.81-1.95,2.62-2.69,4.03c-0.74,1.34-1.82,3.03-2.42,3.63c-0.54,0.61-1.61,2.22-2.35,3.5 c-1.48,2.69-1.68,2.96-3.97,5.78c-0.94,1.21-1.68,2.35-1.68,2.55c0,0.47-6.66,10.56-7.33,11.16c-0.2,0.2-1.01,1.41-1.68,2.69 c-0.74,1.28-1.48,2.49-1.68,2.69c-0.47,0.4-8.27,12.03-8.81,13.11 M294.17,171.07c-0.74,1.14-1.82,2.76-2.35,3.56 c-0.54,0.81-1.68,2.55-2.49,3.83c-1.88,2.82-2.22,3.36-5.58,8.2c-1.48,2.15-2.69,4.03-2.69,4.24s-0.34,0.67-0.74,1.14 c-0.34,0.47-4.24,6.25-8.67,12.91c-4.37,6.66-8.27,12.44-8.67,12.91c-0.4,0.47-0.74,0.94-0.74,1.14c0,0.61-4.3,6.79-4.84,6.99 c-0.27,0.13-0.54,0.67-0.54,1.21s-0.34,0.94-0.74,0.94c-0.34,0-0.54,0.27-0.34,0.61c0.27,0.34,0.2,0.74-0.07,0.87 c-0.81,0.34-4.91,6.39-4.91,7.19c0,0.34-0.54,1.01-1.14,1.34c-0.67,0.4-0.94,0.74-0.67,0.74s-0.07,0.67-0.87,1.48 c-0.74,0.81-1.34,1.88-1.34,2.35s-0.2,0.87-0.47,0.87c-0.34,0-1.41,1.55-2.55,3.43c-1.08,1.88-2.29,3.77-2.69,4.24 c-1.34,1.61-3.7,5.04-3.7,5.45c0,0.27-0.4,0.87-0.81,1.34c-1.95,2.15-2.49,2.89-2.22,3.16c0.13,0.13-0.47,1.14-1.34,2.15 c-0.94,1.08-1.68,2.15-1.68,2.42s-0.61,1.14-1.34,2.02s-1.34,1.95-1.34,2.49s-0.27,0.81-0.61,0.61c-0.34-0.2-0.81,0.34-1.01,1.28 cLine truncated
|
||||
<line class="st6" x1="108.71" y1="523.11" x2="108.7" y2="523.11"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 382 KiB |
@@ -0,0 +1,15 @@
|
||||
---
|
||||
layout: default
|
||||
title: Welcome
|
||||
nav_order: 1
|
||||
has_children: false
|
||||
---
|
||||
|
||||
# Welcome to the Mainsail docs!
|
||||
|
||||
Mainsail is a lightweight & responsive web interface for the Klipper 3D printer firmware. It communicates with Moonraker (Klipper-API) from Arksine.
|
||||
|
||||
[Setup Guide](/setup-guide/index.md){: .btn}
|
||||
|
||||
## Screenshots
|
||||

|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
layout: default
|
||||
title: Necessary Configuration
|
||||
nav_order: 4
|
||||
has_children: false
|
||||
permalink: /necessary-configuration
|
||||
---
|
||||
|
||||
Mainsail requires a minimum configuration to function properly. It should give you a warning at startup if the required parts are not found in your configuration.
|
||||
|
||||
## Required configuration
|
||||
### virtual_sdcard
|
||||
This allows gcode file uploads.
|
||||
```yaml
|
||||
[virtual_sdcard]
|
||||
path: ~/sdcard
|
||||
```
|
||||
|
||||
### display_status
|
||||
This is required for messages in your status panel, if you don't have a `[display]` in your configuration.
|
||||
```yaml
|
||||
[display_status]
|
||||
```
|
||||
|
||||
### pause / resume / cancel
|
||||
This enables pause / resume in mainsail.
|
||||
|
||||
```yaml
|
||||
[pause_resume]
|
||||
```
|
||||
|
||||
## Macros
|
||||
### for pause /resume / cancel functionality
|
||||
These should be modified to your own needs.
|
||||
```yaml
|
||||
[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
|
||||
```
|
||||
|
||||
```yaml
|
||||
[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
|
||||
```
|
||||
|
||||
```yaml
|
||||
[gcode_macro CANCEL_PRINT]
|
||||
rename_existing: BASE_CANCEL_PRINT
|
||||
gcode:
|
||||
TURN_OFF_HEATERS
|
||||
CLEAR_PAUSE
|
||||
SDCARD_RESET_FILE
|
||||
BASE_CANCEL_PRINT
|
||||
```
|
||||
|
||||
## Optional
|
||||
|
||||
### customize klipper default commands
|
||||
for example, if you want to adjust the `BED_MESH_CALIBRATE` command, which you can run from "heightmap > calibrate".
|
||||
```yaml
|
||||
[gcode_macro BED_MESH_CALIBRATE]
|
||||
rename_existing: BASE_BED_MESH_CALIBRATE
|
||||
gcode:
|
||||
#before the original gcode
|
||||
BED_MESH_CLEAR
|
||||
QUAD_GANTRY_LEVEL
|
||||
G1 X125 Y125 Z5 F6000
|
||||
#the original gcode
|
||||
BASE_BED_MESH_CALIBRATE
|
||||
#after the original gcode
|
||||
```
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
layout: default
|
||||
title: Setup Guide
|
||||
nav_order: 2
|
||||
has_children: true
|
||||
permalink: /setup/
|
||||
---
|
||||
This is a guide to setting up Klipper, Moonraker & Mainsail on a Raspberry Pi with Raspberry Pi OS. Other SBCs and/or Linux distributions might work, but may require a customized installation script or configs.
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
layout: default
|
||||
title: Klipper
|
||||
parent: Setup Guide
|
||||
nav_order: 3
|
||||
permalink: /setup/klipper
|
||||
---
|
||||
|
||||
## Klipper
|
||||
### Installation
|
||||
The following commands will clone Klipper to an appropriate directory in HOME and run the setup script.
|
||||
```bash
|
||||
cd ~
|
||||
git clone https://github.com/KevinOConnor/klipper
|
||||
cd ~/klipper
|
||||
./scripts/install-octopi.sh
|
||||
```
|
||||
|
||||
### Configuration
|
||||
After Klipper is installed, you will need to change the default location of the printer.cfg and add the UDS (unix domain socket). This is defined in the file `/etc/default/klipper`
|
||||
|
||||
To edit this file type:
|
||||
```bash
|
||||
sudo nano /etc/default/klipper
|
||||
```
|
||||
|
||||
find the following line:
|
||||
```
|
||||
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/printer.cfg -l /tmp/klippy.log"
|
||||
```
|
||||
and change the config location to `/home/pi/klipper_config/printer.cfg` and add `-a /tmp/klippy_uds` to define UDS.
|
||||
```
|
||||
KLIPPY_ARGS="/home/pi/klipper/klippy/klippy.py /home/pi/klipper_config/printer.cfg -l /tmp/klippy.log -a /tmp/klippy_uds"
|
||||
```
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
|
||||
You have to create the directories for your klipper configuration and the virtual_sdcard directory:
|
||||
|
||||
```bash
|
||||
mkdir ~/klipper_config
|
||||
mkdir ~/sdcard
|
||||
```
|
||||
|
||||
Move your printer.cfg to ~/klipper_config and check if the following entries are present in the config.
|
||||
```ini
|
||||
[virtual_sdcard]
|
||||
# for gcode upload
|
||||
path: ~/sdcard
|
||||
|
||||
[display_status]
|
||||
# for display messages in status panel
|
||||
|
||||
[pause_resume]
|
||||
# for pause/resume functionality.
|
||||
# Mainsail needs gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT` to make the buttons work.
|
||||
```
|
||||
> ℹ️ **These entries are very important.**
|
||||
For the full functionality of mainsail, you should also define gcode macros for `PAUSE`, `RESUME` and `CANCEL_PRINT`. You'll find further information in [this](../necessary-cfg.md){: target="_blank"} document.
|
||||
|
||||
After your config is in place, restart klipper with `sudo service klipper restart`. Check the `/tmp/klippy.log` for errors, if Klipper starts correctly you can continue the guide.
|
||||
|
||||
---
|
||||
[< previous step](operating-system.md){: .btn } [next step >](moonraker.md){: .btn}
|
||||
@@ -0,0 +1,202 @@
|
||||
---
|
||||
layout: default
|
||||
title: Mainsail
|
||||
parent: Setup Guide
|
||||
nav_order: 5
|
||||
permalink: /setup/mainsail
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Mainsail
|
||||
### Install webserver & reverse proxy (nginx)
|
||||
|
||||
nginx is important to mount all components on port 80 and host the static files from Mainsail. To install nginx you only need to execute:
|
||||
|
||||
`sudo apt install nginx`
|
||||
|
||||
now we create the config files with:
|
||||
|
||||
```
|
||||
sudo touch /etc/nginx/sites-available/mainsail
|
||||
sudo touch /etc/nginx/conf.d/upstreams.conf
|
||||
sudo touch /etc/nginx/conf.d/common_vars.conf
|
||||
```
|
||||
|
||||
Each file can be filled with the following content:
|
||||
|
||||
`sudo nano /etc/nginx/conf.d/upstreams.conf`
|
||||
|
||||
```
|
||||
# /etc/nginx/conf.d/upstreams.conf
|
||||
|
||||
upstream apiserver {
|
||||
#edit your api port here
|
||||
ip_hash;
|
||||
server 127.0.0.1:7125;
|
||||
}
|
||||
|
||||
upstream mjpgstreamer {
|
||||
#edit your webcam port here
|
||||
ip_hash;
|
||||
server 127.0.0.1:8081;
|
||||
}
|
||||
```
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
|
||||
|
||||
`sudo nano /etc/nginx/conf.d/common_vars.conf`
|
||||
|
||||
```
|
||||
# /etc/nginx/conf.d/common_vars.conf
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
```
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
|
||||
`sudo nano /etc/nginx/sites-available/mainsail`
|
||||
|
||||
```
|
||||
# /etc/nginx/sites-available/mainsail
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
|
||||
access_log /var/log/nginx/mainsail-access.log;
|
||||
error_log /var/log/nginx/mainsail-error.log;
|
||||
|
||||
#disable this section on smaller hardware like a pi zero
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_proxied expired no-cache no-store private auth;
|
||||
gzip_comp_level 4;
|
||||
gzip_buffers 16 8k;
|
||||
gzip_http_version 1.1;
|
||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/json application/xml;
|
||||
|
||||
#web_path from mainsail static files
|
||||
root /home/pi/mainsail;
|
||||
|
||||
index index.html;
|
||||
server_name _;
|
||||
|
||||
#max upload size for gcodes
|
||||
client_max_body_size 200M;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /printer {
|
||||
proxy_pass http://apiserver/printer;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://apiserver/api;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /access {
|
||||
proxy_pass http://apiserver/access;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /websocket {
|
||||
proxy_pass http://apiserver/websocket;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
|
||||
location /machine {
|
||||
proxy_pass http://apiserver/machine;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /server {
|
||||
proxy_pass http://apiserver/server;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Scheme $scheme;
|
||||
}
|
||||
|
||||
location /webcam/ {
|
||||
proxy_pass http://mjpgstreamer/;
|
||||
}
|
||||
}
|
||||
```
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
|
||||
Create directory for static files and active nginx config:
|
||||
|
||||
```
|
||||
mkdir ~/mainsail
|
||||
sudo rm /etc/nginx/sites-enabled/default
|
||||
sudo ln -s /etc/nginx/sites-available/mainsail /etc/nginx/sites-enabled/
|
||||
sudo service nginx restart
|
||||
```
|
||||
|
||||
Now you can check again the API if it works with the reverse proxy. Open the url http://<printer-ip>/printer/info in your browser. if you see a content like this:
|
||||
|
||||
```
|
||||
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-479-gd586fb06", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
|
||||
```
|
||||
|
||||
Now we can install Mainsail (static httpdocs).
|
||||
|
||||
### Install httpdocs
|
||||
|
||||
Now you can download the current mainsail static data
|
||||
|
||||
```
|
||||
cd ~/mainsail
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/latest/mainsail.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
|
||||
Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
|
||||
### Important macros
|
||||
|
||||
if you want to get the full experience with mainsail and klipper virtual_sdcard print, you should use these macros, or use them as templates for your own.
|
||||
|
||||
[Macro Link](../necessary-cfg.md){: .btn target="_blank"}
|
||||
|
||||
|
||||
### Change the Hostname (optional)
|
||||
|
||||
to use the hostname instate of the ip, you can install the avahi-daemon:
|
||||
|
||||
`sudo apt install avahi-daemon`
|
||||
|
||||
and you can config your hostname:
|
||||
|
||||
`sudo raspi-config`
|
||||
|
||||
in 2 Network Options > N1 Hostname you can edit your hostname of your raspberry pi. After a reboot you can use http://<hostname>.local/ to open the webinterface.
|
||||
|
||||
|
||||
---
|
||||
[< previous step](moonraker.md){: .btn }
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
layout: default
|
||||
title: Moonraker
|
||||
parent: Setup Guide
|
||||
nav_order: 4
|
||||
permalink: /setup/moonraker
|
||||
---
|
||||
## Moonraker
|
||||
Moonraker is a web server that exposes APIs which lets Mainsail interact with Klipper.
|
||||
|
||||
### Installation
|
||||
Clone Moonraker into your HOME directory:
|
||||
```bash
|
||||
cd ~
|
||||
git clone https://github.com/Arksine/moonraker.git
|
||||
```
|
||||
|
||||
Run Moonrakers install script:
|
||||
```bash
|
||||
cd ~/moonraker/scripts
|
||||
./install-moonraker.sh
|
||||
```
|
||||
|
||||
Once the script is finished, both Moonraker and Klipper should be started.
|
||||
In `/tmp/klippy.log` the following entry should appear: `Moonraker: server connection detected`
|
||||
|
||||
### Configuration
|
||||
> ⚠️ **Please pay attention to the following steps!**
|
||||
Misconfigured trusted_clients are a very common source of failure.
|
||||
|
||||
For Moonraker you'll need to create a separate config file.
|
||||
|
||||
`nano ~/moonraker.conf`
|
||||
|
||||
Insert the following part and modify `trusted_clients` according to arksines description below.
|
||||
Also consider further IP ranges, e.g. when connecting via VPN. To determine your local ip `ip a` and `ifconfig -a` are common ways to do so on Linux and `ipconfig` on Windows.
|
||||
|
||||
> ℹ️ **This is a very basic config**
|
||||
For more options and detailed explanations you should follow [arksines instructions](https://github.com/Arksine/moonraker/blob/master/docs/installation.md).
|
||||
|
||||
```
|
||||
[server]
|
||||
host: 0.0.0.0
|
||||
config_path: ~/klipper_config
|
||||
|
||||
[authorization]
|
||||
enabled: true
|
||||
trusted_clients:
|
||||
192.168.1.0/24
|
||||
```
|
||||
|
||||
> 🔥 **trusted_clients - read carefully** 🔥
|
||||
A list of newline separated ip addresses and/or ip ranges that are
|
||||
trusted. Trusted clients are given full access to the API. Both IPv4
|
||||
and IPv6 addresses and ranges are supported. Ranges must be expressed
|
||||
in CIDR notation (see http://ip.sb/cidr for more info).
|
||||
For example, an entry of 192.168.1.0/24 will authorize IPs in the range of 192.168.1.1 -
|
||||
192.168.1.254. Note that when specifying IPv4 ranges the last segment
|
||||
of the ip address must be 0. The default is no clients or ranges are
|
||||
trusted.
|
||||
|
||||
Save the file with `CTRL+O` and close the editor with `CTRL+X`.
|
||||
|
||||
Restart Moonraker
|
||||
```bash
|
||||
sudo service moonraker restart
|
||||
```
|
||||
|
||||
Open the following url with your printers IP in your browser
|
||||
```
|
||||
http://<printer-ip>:7125/printer/info
|
||||
```
|
||||
|
||||
If everything has been set up successfully, a message like this should appear:
|
||||
```
|
||||
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-643-g528f9f25", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
|
||||
```
|
||||
|
||||
---
|
||||
[< previous step](klipper.md){: .btn } [next step >](mainsail.md){: .btn }
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
layout: default
|
||||
title: Operating System
|
||||
parent: Setup Guide
|
||||
nav_order: 2
|
||||
permalink: /setup/operating-systen
|
||||
---
|
||||
## Operation System
|
||||
> ⚠️ **Please don't use an OctoPi image!**
|
||||
It can cause unforeseeable events, like rips in the space-time continuum. So be aware!
|
||||
|
||||
It is recommended to use a clean Raspberry Pi OS 32-bit Lite image (previously called Raspbian). You can download it [here](https://downloads.raspberrypi.org/raspios_lite_armhf_latest){:target="_blank"}.
|
||||
For more information about installing Raspberry Pi OS click [here](https://www.raspberrypi.org/documentation/installation/installing-images/){:target="_blank"}. Don't forget to enable ssh.
|
||||
|
||||
Once you have finished the installation and are connected via ssh, you can continue.
|
||||
|
||||
### Requirements
|
||||
```bash
|
||||
sudo apt update && sudo apt upgrade
|
||||
sudo apt install git dfu-util unzip
|
||||
```
|
||||
|
||||
> ⚠️ **Moonraker requires Python 3.7 or greater,** verify that your distribution's Python 3 packages meet this requirement.
|
||||
|
||||
```
|
||||
python3 --version
|
||||
```
|
||||
|
||||
---
|
||||
[< table of contents](index.md){: .btn } [next step >](klipper.md){: .btn }
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
layout: default
|
||||
title: Update Guide
|
||||
nav_order: 3
|
||||
has_children: true
|
||||
permalink: /update/
|
||||
---
|
||||
|
||||
This is a guide to update up Klipper, Moonraker & Mainsail on your Raspberry Pi.
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
layout: default
|
||||
title: Klipper
|
||||
parent: Update Guide
|
||||
nav_order: 2
|
||||
permalink: /update/klipper
|
||||
---
|
||||
|
||||
## Klipper
|
||||
### Update from Repository
|
||||
```bash
|
||||
cd ~/klipper
|
||||
git fetch
|
||||
git checkout origin/master
|
||||
```
|
||||
|
||||
Restart Klipper (`sudo service klipper restart`) and check the `klippy.log`, if Klipper starts
|
||||
correctly and then continue the guide.
|
||||
|
||||
### Klipper config changes
|
||||
If you have issues after update your Klipper instance, you can check config changes [here](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Changes.md).
|
||||
|
||||
---
|
||||
[< table of contents](index.md){: .btn } [next step >](moonraker.md){: .btn}
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
layout: default
|
||||
title: Mainsail
|
||||
parent: Update Guide
|
||||
nav_order: 4
|
||||
permalink: /update/mainsail
|
||||
---
|
||||
|
||||
## Mainsail
|
||||
```bash
|
||||
cd ~/mainsail
|
||||
rm -R ./*
|
||||
wget -q -O mainsail.zip https://github.com/meteyou/mainsail/releases/download/latest/mainsail.zip && unzip mainsail.zip && rm mainsail.zip
|
||||
```
|
||||
|
||||
### Move gui.json from gcodes to klipper_config
|
||||
This is only necessary if you update from 0.2.2 to 0.2.3 or higher. If you use MainsailOS, the virtual_sdcard directory is `gcode_files` instead of `sdcard`.
|
||||
```
|
||||
mv ~/sdcard/gui.json ~/klipper_config/
|
||||
```
|
||||
|
||||
Now it should be possible to open the interface: `http://<printer-ip>/`.
|
||||
|
||||
---
|
||||
[< previous step](moonraker.md){: .btn }
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
layout: default
|
||||
title: Moonraker
|
||||
parent: Update Guide
|
||||
nav_order: 3
|
||||
permalink: /update/moonraker
|
||||
---
|
||||
|
||||
## Moonraker
|
||||
```bash
|
||||
cd ~/moonraker
|
||||
git fetch
|
||||
git checkout origin/master
|
||||
```
|
||||
|
||||
Restart Moonraker (`sudo service moonraker restart`) and open the url `http://<printer-ip>:7125/printer/info` in your browser.
|
||||
|
||||
If you see a content like this
|
||||
```
|
||||
{"result": {"hostname": "voron250", "error_detected": false, "version": "v0.8.0-643-g528f9f25", "is_ready": true, "message": "Printer is ready", "cpu": "4 core ARMv7 Processor rev 4 (v7l)"}}
|
||||
```
|
||||
|
||||
### Update Moonraker dependence
|
||||
This is only nessasary, if your Moonraker version is older than 31. october 2020.
|
||||
```bash
|
||||
~/moonraker/scripts/install-moonraker.sh -r
|
||||
```
|
||||
|
||||
### Moonraker config changes
|
||||
If you have issues after update your Moonraker instance, you can check config changes [here](https://github.com/Arksine/moonraker/blob/master/docs/user_changes.md).
|
||||
|
||||
---
|
||||
[< previous step](klipper.md){: .btn } [next step >](mainsail.md){: .btn }
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "kwc",
|
||||
"version": "0.1.0",
|
||||
"name": "mainsail",
|
||||
"version": "0.3.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -8,39 +8,41 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"chart.js": "^2.9.3",
|
||||
"core-js": "^3.1.2",
|
||||
"vue": "^2.6.10",
|
||||
"vue-chartjs": "^3.5.0",
|
||||
"vue-context": "^5.0.0",
|
||||
"axios": "^0.21.0",
|
||||
"chart.js": "^2.9.4",
|
||||
"core-js": "^3.7.0",
|
||||
"object-assign-deep": "^0.4.0",
|
||||
"prismjs": "^1.22.0",
|
||||
"vue": "^2.6.12",
|
||||
"vue-chartjs": "^3.5.1",
|
||||
"vue-context": "^6.0.0",
|
||||
"vue-headful": "^2.1.0",
|
||||
"vue-json-rpc-websocket": "^1.0.5",
|
||||
"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.0.3",
|
||||
"vuetify": "^2.1.0",
|
||||
"vuetify-toast-snackbar": "^0.6.1",
|
||||
"vuex": "^3.1.1"
|
||||
"vue-toast-notification": "^0.6.0",
|
||||
"vuetify": "^2.3.18",
|
||||
"vuex": "^3.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fortawesome/fontawesome-free": "^5.12.0",
|
||||
"@mdi/font": "^4.5.95",
|
||||
"@vue/cli-plugin-babel": "^4.0.0",
|
||||
"@vue/cli-plugin-eslint": "^4.0.0",
|
||||
"@vue/cli-service": "^4.0.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"css-loader": "^3.4.0",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-plugin-vue": "^5.0.0",
|
||||
"material-design-icons-iconfont": "^5.0.1",
|
||||
"sass": "^1.19.0",
|
||||
"sass-loader": "^8.0.0",
|
||||
"@mdi/font": "^5.8.55",
|
||||
"@vue/cli-plugin-babel": "^4.5.9",
|
||||
"@vue/cli-plugin-eslint": "^4.5.3",
|
||||
"@vue/cli-plugin-pwa": "^4.5.9",
|
||||
"@vue/cli-service": "^4.5.9",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"css-loader": "^5.0.1",
|
||||
"eslint": "^7.13.0",
|
||||
"eslint-plugin-vue": "^7.1.0",
|
||||
"sass": "^1.29.0",
|
||||
"sass-loader": "^10.1.0",
|
||||
"sw-precache-webpack-plugin": "^1.0.0",
|
||||
"vue-cli-plugin-route": "0.0.7",
|
||||
"vue-cli-plugin-vuetify": "^1.1.0",
|
||||
"vue-router": "^3.1.3",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"vuetify-loader": "^1.3.0"
|
||||
"vue-cli-plugin-vuetify": "^2.0.7",
|
||||
"vue-router": "^3.4.9",
|
||||
"vue-template-compiler": "^2.6.12",
|
||||
"vuetify-loader": "^1.6.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 456 B |
|
After Width: | Height: | Size: 912 B |
|
After Width: | Height: | Size: 6.3 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 43 KiB |
@@ -4,14 +4,11 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>kwc</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
|
||||
<title>Mainsail</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but kwc doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
<strong>We're sorry but Mainsail doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
|
||||
@@ -1,16 +1,43 @@
|
||||
<style>
|
||||
@import './assets/styles/fonts.css';
|
||||
@import './assets/styles/toastr.css';
|
||||
|
||||
.button-min-width-auto {
|
||||
min-width: auto !important;
|
||||
}
|
||||
|
||||
#page-container {
|
||||
max-width: 1400px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-app>
|
||||
<vue-headful :title="getTitle" />
|
||||
<v-navigation-drawer
|
||||
class="sidebar-wrapper" persistent v-model="drawer" enable-resize-watcher fixed app
|
||||
:src="require('./assets/bg-navi.jpg')"
|
||||
:src="require('./assets/bg-navi.png')"
|
||||
>
|
||||
<div id="nav-header">
|
||||
<img :src="require('./assets/logo.svg')" />
|
||||
<v-toolbar-title>{{ hostname }}</v-toolbar-title>
|
||||
<v-toolbar-title>{{ printername !== "" ? printername : hostname }}</v-toolbar-title>
|
||||
</div>
|
||||
<ul class="navi" :expand="$vuetify.breakpoint.mdAndUp">
|
||||
<li v-for="(category, index) in routes" :key="index" :prepend-icon="category.icon" :class="[category.path !== '/' && currentPage.includes(category.path) ? 'active' : '', 'nav-item']" :value="true">
|
||||
<router-link slot="activator" class="nav-link" exact :to="category.path" @click.prevent>
|
||||
<li v-for="(category, index) in routes" :key="index" :prepend-icon="category.icon"
|
||||
:class="[category.path !== '/' && currentPage.includes(category.path) ? 'active' : '', 'nav-item']"
|
||||
:value="true"
|
||||
>
|
||||
<router-link
|
||||
slot="activator" class="nav-link" exact :to="category.path" @click.prevent
|
||||
v-if="
|
||||
(category.title === 'Webcam' && boolNaviWebcam) ||
|
||||
(category.title === 'Heightmap' && boolNaviHeightmap) ||
|
||||
(
|
||||
category.title !== 'Webcam' &&
|
||||
category.title !== 'Heightmap' &&
|
||||
(klippy_state !== 'error' || category.alwaysShow)
|
||||
)
|
||||
">
|
||||
<v-icon>mdi-{{ category.icon }}</v-icon>
|
||||
<span class="nav-title">{{ category.title }}</span>
|
||||
<v-icon class="nav-arrow" v-if="category.children && category.children.length > 0">mdi-chevron-down</v-icon>
|
||||
@@ -18,7 +45,7 @@
|
||||
|
||||
<ul class="child">
|
||||
<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>
|
||||
<router-link :to="page.path" class="nav-link" @click.prevent v-if="klippy_state !== 'error' || page.alwaysShow">
|
||||
<v-icon>mdi-{{ page.icon }}</v-icon>
|
||||
<span class="nav-title">{{ page.title }}</span>
|
||||
</router-link>
|
||||
@@ -28,34 +55,65 @@
|
||||
</ul>
|
||||
</v-navigation-drawer>
|
||||
|
||||
<v-app-bar app absolute
|
||||
elevate-on-scroll>
|
||||
<v-app-bar app elevate-on-scroll>
|
||||
<v-app-bar-nav-icon @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="green" v-if="!isConnected" :loading="loadingEmergencyStop" @click="emergencyStop"><v-icon class="mr-2">mdi-refresh-circle</v-icon> reconnect</v-btn>
|
||||
<v-btn color="error" v-if="isConnected" :loading="loadingEmergencyStop" @click="emergencyStop">Emergency Stop</v-btn>
|
||||
<v-btn color="primary" class="mr-5 d-none d-sm-flex" v-if="isConnected && save_config_pending" :loading="loadings.includes['topbarSaveConfig']" @click="clickSaveConfig">SAVE CONFIG</v-btn>
|
||||
<v-btn color="error" class="button-min-width-auto px-3" v-if="isConnected" :loading="loadings.includes['topbarEmergencyStop']" @click="clickEmergencyStop"><v-icon class="mr-sm-2">mdi-alert-circle-outline</v-icon><span class="d-none d-sm-flex">Emergency Stop</span></v-btn>
|
||||
<v-menu bottom left :offset-y="true">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn dark icon v-bind="attrs" v-on="on">
|
||||
<v-icon>mdi-dots-vertical</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-list dense>
|
||||
<v-list-item link @click="doRestart()">
|
||||
<v-list-item-title><v-icon class="mr-3">mdi-sync</v-icon>Restart</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="doFirmwareRestart()">
|
||||
<v-list-item-title><v-icon class="mr-3">mdi-sync</v-icon>FW Restart</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item link @click="doHostReboot()">
|
||||
<v-list-item-title><v-icon class="mr-3">mdi-power</v-icon>Reboot Host</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item link @click="doHostShutdown()">
|
||||
<v-list-item-title><v-icon class="mr-3">mdi-power</v-icon>Shutdown Host</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-app-bar>
|
||||
|
||||
<v-content id="content">
|
||||
<v-main id="content">
|
||||
<v-scroll-y-transition>
|
||||
<v-container fluid id="page-container" class="container">
|
||||
<v-container fluid id="page-container" class="container px-sm-6 px-3 mx-auto">
|
||||
<keep-alive>
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
</v-container>
|
||||
</v-scroll-y-transition>
|
||||
</v-content>
|
||||
</v-main>
|
||||
|
||||
<v-dialog v-model="overlayDisconnect" persistent width="300">
|
||||
<v-card color="primary" dark >
|
||||
<v-card-text class="pt-2">
|
||||
Connecting...
|
||||
<v-progress-linear indeterminate color="white" class="mb-0"></v-progress-linear>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
<v-footer app class="d-block">
|
||||
<span v-if="version">{{ version }}</span>
|
||||
<span class="float-right">© 2019</span>
|
||||
<span>v{{ getVersion }}</span>
|
||||
<span class="float-right d-none d-sm-inline" v-if="version">{{ version }}</span>
|
||||
</v-footer>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import routes from './routes';
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -65,66 +123,158 @@ export default {
|
||||
|
||||
},
|
||||
data: () => ({
|
||||
overlayDisconnect: true,
|
||||
drawer: null,
|
||||
activeClass: 'active',
|
||||
routes: routes
|
||||
routes: routes,
|
||||
boolNaviHeightmap: false,
|
||||
}),
|
||||
created () {
|
||||
this.$vuetify.theme.dark = true,
|
||||
this.$socket.onOpen = () => {
|
||||
this.$socket.sendObj('get_printer_info', {}, 'getKlipperInfo');
|
||||
this.$socket.sendObj('get_printer_objects', {}, 'getObjectInfo');
|
||||
this.$socket.sendObj('get_printer_status', { heater: [] }, 'getObjectInfo');
|
||||
this.$socket.sendObj('post_printer_subscriptions', {
|
||||
gcode: ["gcode_position", "speed", "speed_factor", "extrude_factor", "busy", "abs_extrude"],
|
||||
toolhead: [],
|
||||
virtual_sdcard: [],
|
||||
header: [],
|
||||
heater_bed: [],
|
||||
extruder: ["temperature", "target"],
|
||||
fan: [],
|
||||
pause_resume: [],
|
||||
idle_timeout: [],
|
||||
|
||||
});
|
||||
this.$socket.sendObj('get_printer_files', {}, 'getFileList');
|
||||
}
|
||||
this.$vuetify.theme.dark = true;
|
||||
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
|
||||
},
|
||||
computed: {
|
||||
currentPage: function() {
|
||||
return this.$route.fullPath;
|
||||
},
|
||||
...mapState({
|
||||
toolhead: state => state.printer.toolhead,
|
||||
hostname: state => state.printer.hostname,
|
||||
version: state => state.printer.version,
|
||||
loadingEmergencyStop: state => state.socket.loadingEmergencyStop,
|
||||
isConnected: state => state.socket.isConnected,
|
||||
hostname: state => state.printer.hostname,
|
||||
version: state => state.printer.software_version,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
loadings: state => state.socket.loadings,
|
||||
|
||||
toolhead: state => state.printer.toolhead,
|
||||
printername: state => state.gui.general.printername,
|
||||
virtual_sdcard: state => state.printer.virtual_sdcard,
|
||||
current_file: state => state.printer.print_stats.filename,
|
||||
boolNaviWebcam: state => state.gui.webcam.bool,
|
||||
config: state => state.printer.configfile.config,
|
||||
save_config_pending: state => state.printer.configfile.save_config_pending,
|
||||
}),
|
||||
...mapGetters([
|
||||
'getTitle',
|
||||
'getVersion'
|
||||
]),
|
||||
print_percent: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getPrintPercent"];
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emergencyStop: function() {
|
||||
this.$store.commit('setLoadingEmergencyStop', true);
|
||||
this.$socket.sendObj('post_printer_gcode', {script: 'M112'}, 'setLoadingEmergencyStop');
|
||||
clickEmergencyStop: function() {
|
||||
this.$store.commit('socket/addLoading', { name: 'topbarEmergencyStop' });
|
||||
this.$socket.sendObj('printer.emergency_stop', {}, 'socket/removeLoading',{ name: 'topbarEmergencyStop' });
|
||||
},
|
||||
}
|
||||
clickSaveConfig: function() {
|
||||
this.$store.commit('server/addEvent', "SAVE_CONFIG");
|
||||
this.$store.commit('socket/addLoading', { name: 'topbarSaveConfig' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "SAVE_CONFIG" }, 'socket/removeLoading', { name: 'topbarSaveConfig' });
|
||||
},
|
||||
doRestart: function() {
|
||||
this.$store.commit('server/addEvent', "RESTART");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "RESTART" });
|
||||
},
|
||||
doFirmwareRestart: function() {
|
||||
this.$store.commit('server/addEvent', "FIRMWARE_RESTART");
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "FIRMWARE_RESTART" });
|
||||
},
|
||||
doHostReboot: function() {
|
||||
this.$socket.sendObj('machine.reboot', { });
|
||||
},
|
||||
doHostShutdown: function() {
|
||||
this.$socket.sendObj('machine.shutdown', { });
|
||||
},
|
||||
drawFavicon(val) {
|
||||
let favicon16 = document.querySelector("link[rel*='icon'][sizes='16x16']")
|
||||
let favicon32 = document.querySelector("link[rel*='icon'][sizes='32x32']")
|
||||
|
||||
if (val > 0 && val < 100) {
|
||||
let faviconSize = 64;
|
||||
|
||||
let canvas = document.createElement('canvas');
|
||||
canvas.width = faviconSize;
|
||||
canvas.height = faviconSize;
|
||||
let context = canvas.getContext('2d');
|
||||
let centerX = canvas.width / 2;
|
||||
let centerY = canvas.height / 2;
|
||||
let radius = 32;
|
||||
let percent = val * 100;
|
||||
|
||||
/* draw the grey circle */
|
||||
context.beginPath();
|
||||
context.moveTo(centerX, centerY);
|
||||
context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false);
|
||||
context.closePath();
|
||||
context.fillStyle = "#ddd";
|
||||
context.fill();
|
||||
context.strokeStyle = "rgba(200, 208, 218, 0.66)";
|
||||
context.stroke();
|
||||
|
||||
/* draw the green circle based on percentage */
|
||||
let startAngle = 1.5 * Math.PI;
|
||||
let endAngle = 0;
|
||||
let unitValue = (Math.PI - 0.5 * Math.PI) / 25;
|
||||
if (percent >= 0 && percent <= 25) endAngle = startAngle + (percent * unitValue);
|
||||
else if (percent > 25 && percent <= 50) endAngle = startAngle + (percent * unitValue);
|
||||
else if (percent > 50 && percent <= 75) endAngle = startAngle + (percent * unitValue);
|
||||
else if (percent > 75 && percent <= 100) endAngle = startAngle + (percent * unitValue);
|
||||
|
||||
context.beginPath();
|
||||
context.moveTo(centerX, centerY);
|
||||
context.arc(centerX, centerY, radius, startAngle, endAngle, false);
|
||||
context.closePath();
|
||||
context.fillStyle = "#e41313";
|
||||
context.fill();
|
||||
|
||||
favicon16.href = canvas.toDataURL('image/png')
|
||||
favicon32.href = canvas.toDataURL('image/png')
|
||||
} else {
|
||||
favicon16.href = "/img/icons/favicon-16x16.png"
|
||||
favicon32.href = "/img/icons/favicon-32x32.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
print_percent() {
|
||||
this.drawFavicon(this.print_percent);
|
||||
},
|
||||
current_file: {
|
||||
handler: function(newVal) {
|
||||
this.$socket.sendObj("server.files.metadata", { filename: newVal }, "files/getMetadataCurrentFile");
|
||||
}
|
||||
},
|
||||
config() {
|
||||
this.boolNaviHeightmap = (typeof(this.config.bed_mesh) !== "undefined");
|
||||
},
|
||||
isConnected(newVal) {
|
||||
this.overlayDisconnect = !newVal;
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.sidebar-wrapper:before {
|
||||
body {
|
||||
background: #121212;
|
||||
}
|
||||
/*.sidebar-wrapper:before {
|
||||
position: absolute;
|
||||
content: ' ';
|
||||
top: 0; right: 0; bottom: 0; left: 0;
|
||||
background: #000;
|
||||
opacity: .7;
|
||||
}
|
||||
opacity: .5;
|
||||
}*/
|
||||
|
||||
#nav-header {
|
||||
text-align: center;
|
||||
border-bottom: 1px solid #ffffff40;
|
||||
margin-bottom: 1em;
|
||||
padding: .75em 0 .25em 0;
|
||||
padding: .75em 0 .75em 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#nav-header img {
|
||||
@@ -133,9 +283,8 @@ export default {
|
||||
}
|
||||
|
||||
#nav-header .v-toolbar__title {
|
||||
display: inline-block;
|
||||
line-height: 40px;
|
||||
font-size: 24px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.v-navigation-drawer__content {
|
||||
@@ -232,4 +381,4 @@ export default {
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
@@ -1,21 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="_x30_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 165 190.5" style="enable-background:new 0 0 165 190.5;" xml:space="preserve">
|
||||
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 599.38 523.11" style="enable-background:new 0 0 599.38 523.11;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#E41313;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st0{fill:#E30613;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st1{fill:#D41216;}
|
||||
.st2{fill:#D41216;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st3{fill:none;stroke:#009640;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st4{display:none;}
|
||||
.st5{display:inline;fill:#E73D26;}
|
||||
.st6{display:inline;fill:none;}
|
||||
</style>
|
||||
<g id="LWPOLYLINE">
|
||||
<polygon class="st0" points="82.5,0 0,47.6 0,142.9 82.5,190.5 165,142.9 165,47.6 "/>
|
||||
<g id="Ebene_2">
|
||||
<g>
|
||||
<path class="st0" d="M382.29,142.98"/>
|
||||
<path class="st1" d="M382.29,142.98L132.98,522.82L0,522.68L344.3,0l0,0C352.18,49.06,365.2,97.68,382.29,142.98"/>
|
||||
<path class="st2" d="M413.28,213.54L208.5,522.92l132.94,0.19l135.03-206.33l0,0C452.69,284.29,431.53,249.77,413.28,213.54
|
||||
L413.28,213.54"/>
|
||||
<path class="st3" d="M599.38,447.69"/>
|
||||
<path class="st3" d="M518.6,369.16"/>
|
||||
<path class="st1" d="M599.38,447.69l-49.25,75.42L417,522.82l101.6-153.67l0,0C543.48,397.35,570.49,423.61,599.38,447.69
|
||||
L599.38,447.69z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g id="LWPOLYLINE_1_">
|
||||
<polygon class="st1" points="58.2,43.5 83.1,43.5 49.1,95.3 24.2,95.3 "/>
|
||||
</g>
|
||||
<g id="LWPOLYLINE_2_">
|
||||
<polygon class="st1" points="36,147 104.1,43.5 129,43.5 60.9,147 "/>
|
||||
</g>
|
||||
<g id="LWPOLYLINE_3_">
|
||||
<polygon class="st1" points="106.8,147 81.9,147 115.9,95.3 140.8,95.3 "/>
|
||||
<g id="Ebene_1" class="st4">
|
||||
<path class="st5" d="M-45.42,426.29c0.34,0.34,97.62,1.14,107.04,0.94c0.94-0.07,1.75-0.74,2.29-2.08
|
||||
c0.47-1.14,1.08-2.02,1.41-2.02s0.61-0.34,0.61-0.67c0-0.81,2.76-4.91,3.56-5.24c0.27-0.13,0.47-0.61,0.47-1.08
|
||||
c0-0.74,0.61-1.61,3.29-4.84c0.34-0.47,0.47-1.01,0.27-1.21c-0.27-0.2-0.07-0.4,0.34-0.4c0.47,0,0.81-0.47,0.81-1.01
|
||||
c0-0.47,0.47-1.21,1.08-1.55c0.61-0.34,1.08-0.87,1.08-1.21c0.07-0.54,3.09-5.58,3.9-6.32c0.2-0.2,0.94-1.41,1.61-2.69
|
||||
c0.74-1.28,1.48-2.49,1.68-2.69c0.61-0.54,3.43-4.64,3.43-4.98c0-0.2,1.95-3.23,4.37-6.72s4.37-6.66,4.37-7.06
|
||||
c0-0.34,0.2-0.74,0.54-0.87c0.54-0.27,3.5-4.37,3.5-4.91c0-0.2,0.34-0.74,0.74-1.21c0.34-0.47,2.22-3.23,4.17-6.19
|
||||
c1.88-2.96,3.56-5.51,3.83-5.71c0.2-0.2,0.74-1.14,1.28-2.15c0.54-1.01,1.48-2.49,2.22-3.16c0.67-0.74,1.21-1.55,1.21-1.68
|
||||
c0-0.61,12.98-20.17,13.65-20.64c0.34-0.2,0.47-0.61,0.34-0.81c-0.07-0.27,0.27-1.01,0.87-1.68c0.61-0.67,1.61-2.22,2.35-3.36
|
||||
c0.67-1.21,1.48-2.15,1.82-2.15c0.27,0,0.4-0.27,0.13-0.61c-0.2-0.34,0.07-1.01,0.54-1.55c1.48-1.48,5.18-7.13,5.18-7.87
|
||||
c0-0.4,0.34-0.74,0.67-0.74c0.4,0,0.67-0.47,0.67-1.01c0-0.54,0.34-1.01,0.67-1.01c0.4,0,0.67-0.4,0.67-0.94
|
||||
c0-0.54,0.27-1.08,0.54-1.21c0.27-0.13,1.28-1.41,2.15-2.89c0.87-1.48,1.88-3.03,2.15-3.36c1.01-1.21,9.28-13.92,9.28-14.19
|
||||
c0-0.34,4.24-6.45,5.18-7.46c0.4-0.47,1.01-1.48,1.21-2.22c0.2-0.74,0.67-1.34,1.01-1.34c0.27,0,0.67-0.54,0.94-1.21
|
||||
c0.4-1.14,1.82-3.56,2.49-4.17c0.2-0.2,2.15-3.16,4.37-6.66c2.15-3.43,4.5-6.86,5.11-7.53c0.67-0.74,1.08-1.28,0.87-1.28
|
||||
c-0.2,0,0.74-1.48,2.02-3.36c1.28-1.82,2.35-3.63,2.35-4.03c0-0.34,0.2-0.67,0.54-0.67c0.27,0,1.21-1.34,2.15-3.03
|
||||
c0.94-1.68,1.88-3.03,2.15-3.03c0.34,0,0.54-0.4,0.54-0.87c0-0.54,0.61-1.48,1.34-2.15c0.74-0.67,1.34-1.61,1.34-2.15
|
||||
c0-0.47,0.34-0.87,0.67-0.87c0.4,0,0.67-0.34,0.67-0.67c0-0.74,3.16-5.85,4.5-7.26c0.4-0.4,1.01-1.41,1.21-2.15
|
||||
s0.67-1.34,0.94-1.34c0.34,0,0.94-0.87,1.41-2.02c0.47-1.14,1.08-2.02,1.34-2.02c0.27,0,0.87-0.87,1.34-2.02
|
||||
c0.47-1.14,1.08-2.02,1.34-2.02c0.27,0,0.87-0.94,1.34-2.02c0.47-1.14,1.14-2.02,1.48-2.02s0.4-0.34,0.2-0.67
|
||||
c-0.2-0.4-0.2-0.67,0.13-0.67c0.27,0,1.41-1.55,2.55-3.36c1.08-1.88,2.22-3.36,2.55-3.36c0.27,0,0.4-0.27,0.2-0.61
|
||||
c-0.2-0.27,0.2-1.08,0.94-1.75c0.74-0.67,1.34-1.55,1.34-1.95c0-0.4,0.74-1.61,1.68-2.62c0.94-1.01,1.55-1.82,1.41-1.82
|
||||
c-0.34,0,8.87-14.19,10.35-15.93c0.34-0.47,0.67-1.14,0.67-1.55c0-0.34,0.34-0.67,0.67-0.67c0.4,0,0.67-0.47,0.67-1.01
|
||||
s0.34-1.01,0.67-1.01c0.4,0,0.67-0.34,0.67-0.67c0-0.4,1.08-2.22,2.35-4.03s2.35-3.5,2.35-3.7s0.61-1.01,1.34-1.82
|
||||
c0.74-0.81,1.34-1.88,1.34-2.35s0.34-0.87,0.74-0.87c0.34,0,0.54-0.27,0.34-0.54c-0.2-0.34,0.27-0.94,0.94-1.48
|
||||
c0.67-0.54,1.14-1.14,1.01-1.34c-0.2-0.27,0.27-1.01,1.01-1.68c0.74-0.67,1.34-1.48,1.34-1.75c0-0.27,2.35-4.1,5.24-8.47
|
||||
c2.96-4.37,8.27-12.51,11.9-18.02c3.63-5.58,6.93-10.29,7.33-10.56c0.4-0.27,0.47-0.54,0.13-0.54c-0.34,0-0.13-0.54,0.4-1.21
|
||||
c1.01-1.21,1.08-1.75,0.2-3.83c-2.89-6.93-5.04-12.77-5.04-13.51c0-0.54-0.27-0.94-0.67-0.94c-0.34,0-0.61-0.2-0.54-0.54
|
||||
c0.2-0.87-1.75-6.52-2.42-6.99c-0.4-0.27-0.47-0.67-0.2-0.94s0.2-0.81-0.13-1.21c-0.47-0.67-3.97-10.62-4.37-12.71
|
||||
c-0.13-0.47-0.4-1.34-0.61-2.02c-0.27-0.61-0.67-1.68-0.94-2.35c-0.2-0.61-0.47-1.61-0.61-2.15c-0.27-1.34-1.61-5.98-2.42-8.14
|
||||
c-0.34-0.94-0.67-2.35-0.74-3.16c-0.07-0.81-0.27-1.48-0.47-1.48c-0.27,0-0.47-0.4-0.54-0.87c0-0.4-0.2-1.41-0.4-2.15
|
||||
c-0.2-0.74-1.01-3.9-1.68-7.06c-0.74-3.16-1.34-5.78-1.41-5.92c-0.13-0.07-0.2-0.34-0.27-0.67c-0.34-1.34-1.28-5.92-1.41-6.52
|
||||
c-0.07-0.4-0.2-0.81-0.27-1.01c-0.2-0.4-0.54-2.22-0.94-5.38c-0.2-1.28-0.54-2.82-0.74-3.43c-0.27-0.61-0.4-1.34-0.34-1.68
|
||||
c0.07-0.34,0-0.74-0.07-0.94c-0.27-0.67-0.67-3.09-0.94-5.38c-0.13-1.28-0.34-2.35-0.4-2.35c-0.13,0-0.61-3.36-0.74-5.92
|
||||
c-0.07-1.01-0.4-2.02-0.74-2.22s-0.27-0.81,0.13-1.28c1.48-1.75-0.54-1.61-2.08,0.2l0,0c-0.87,1.01-2.22,2.96-2.96,4.37
|
||||
c-0.74,1.48-1.95,3.29-2.69,4.1c-0.74,0.81-1.95,2.62-2.69,4.03c-0.74,1.34-1.82,3.03-2.42,3.63c-0.54,0.61-1.61,2.22-2.35,3.5
|
||||
c-1.48,2.69-1.68,2.96-3.97,5.78c-0.94,1.21-1.68,2.35-1.68,2.55c0,0.47-6.66,10.56-7.33,11.16c-0.2,0.2-1.01,1.41-1.68,2.69
|
||||
c-0.74,1.28-1.48,2.49-1.68,2.69c-0.47,0.4-8.27,12.03-8.81,13.11 M294.17,171.07c-0.74,1.14-1.82,2.76-2.35,3.56
|
||||
c-0.54,0.81-1.68,2.55-2.49,3.83c-1.88,2.82-2.22,3.36-5.58,8.2c-1.48,2.15-2.69,4.03-2.69,4.24s-0.34,0.67-0.74,1.14
|
||||
c-0.34,0.47-4.24,6.25-8.67,12.91c-4.37,6.66-8.27,12.44-8.67,12.91c-0.4,0.47-0.74,0.94-0.74,1.14c0,0.61-4.3,6.79-4.84,6.99
|
||||
c-0.27,0.13-0.54,0.67-0.54,1.21s-0.34,0.94-0.74,0.94c-0.34,0-0.54,0.27-0.34,0.61c0.27,0.34,0.2,0.74-0.07,0.87
|
||||
c-0.81,0.34-4.91,6.39-4.91,7.19c0,0.34-0.54,1.01-1.14,1.34c-0.67,0.4-0.94,0.74-0.67,0.74s-0.07,0.67-0.87,1.48
|
||||
c-0.74,0.81-1.34,1.88-1.34,2.35s-0.2,0.87-0.47,0.87c-0.34,0-1.41,1.55-2.55,3.43c-1.08,1.88-2.29,3.77-2.69,4.24
|
||||
c-1.34,1.61-3.7,5.04-3.7,5.45c0,0.27-0.4,0.87-0.81,1.34c-1.95,2.15-2.49,2.89-2.22,3.16c0.13,0.13-0.47,1.14-1.34,2.15
|
||||
c-0.94,1.08-1.68,2.15-1.68,2.42s-0.61,1.14-1.34,2.02s-1.34,1.95-1.34,2.49s-0.27,0.81-0.61,0.61c-0.34-0.2-0.81,0.34-1.01,1.28
|
||||
c-0.27,0.94-0.74,1.68-1.08,1.68c-0.4,0-0.67,0.34-0.67,0.67c0,0.81-2.76,4.91-3.5,5.24c-0.34,0.13-0.54,0.54-0.54,0.81
|
||||
c0,0.81-4.17,6.99-4.84,7.26c-0.27,0.13-0.54,0.54-0.54,0.94c0,0.74-4.1,6.79-4.84,7.13c-0.34,0.13-0.54,0.54-0.54,0.87
|
||||
c0,0.94-4.91,8-5.58,8c-0.27,0-0.4,0.27-0.13,0.61c0.2,0.34-0.07,1.01-0.47,1.55c-0.47,0.47-2.55,3.43-4.57,6.59
|
||||
c-2.02,3.16-3.83,5.85-4.03,6.05c-0.4,0.4-2.89,4.03-3.36,5.04c-1.01,1.95-31.26,47.13-31.87,47.53c-0.4,0.27-0.47,0.54-0.13,0.54
|
||||
c0.34,0,0.07,0.67-0.67,1.48c-1.61,1.82-4.77,6.72-4.84,7.46c0,0.34-0.74,1.14-1.55,1.88c-0.81,0.67-1.21,1.28-0.94,1.28
|
||||
c0.34,0-0.13,0.74-1.01,1.68s-1.28,1.68-0.94,1.68s0.27,0.27-0.07,0.54c-0.94,0.67-3.83,4.77-4.98,6.99
|
||||
c-0.54,1.08-1.21,1.88-1.55,1.88c-0.27,0-0.54,0.27-0.54,0.67c0,0.34-1.01,2.08-2.22,3.83c-1.28,1.82-2.49,3.77-2.69,4.37
|
||||
c-0.27,0.67-0.74,1.21-1.14,1.21c-0.34,0-0.67,0.47-0.67,1.01c0,0.54-0.27,1.01-0.67,1.01c-0.34,0-0.67,0.27-0.67,0.61
|
||||
c0,0.4-2.29,4.03-5.11,8.14c-2.76,4.17-4.91,7.66-4.77,7.87c0.34,0.27,33.68,0.67,83.44,0.87c22.79,0.13,24.14,0.07,25.21-1.14
|
||||
c1.21-1.48,2.55-3.43,3.23-4.91c0.27-0.54,1.01-1.61,1.68-2.29c0.61-0.67,1.01-1.55,0.81-1.88c-0.2-0.27-0.07-0.54,0.34-0.54
|
||||
s1.21-1.01,1.82-2.22c0.61-1.14,1.34-2.29,1.61-2.49c0.2-0.2,1.48-2.08,2.76-4.24c1.21-2.08,2.49-3.83,2.76-3.83
|
||||
c0.34,0,0.54-0.47,0.54-1.01c0-0.54,0.34-1.01,0.74-1.01c0.34,0,0.54-0.27,0.34-0.61c-0.27-0.34-0.2-0.74,0.07-0.87
|
||||
c0.81-0.34,3.56-4.44,3.56-5.24c0-0.34,0.34-0.67,0.67-0.67c0.4,0,0.67-0.47,0.67-1.01c0-0.54,0.27-1.01,0.54-1.01
|
||||
c0.34,0,0.94-0.67,1.41-1.55c0.4-0.81,1.34-2.42,2.08-3.5c0.74-1.14,1.68-2.69,2.08-3.56c0.47-0.81,1.08-1.48,1.41-1.48
|
||||
c0.27,0,0.54-0.4,0.54-0.87c0-0.47,0.54-1.48,1.21-2.22c0.61-0.67,1.55-2.08,2.08-3.09c0.54-1.01,1.61-2.55,2.35-3.36
|
||||
c0.81-0.81,1.41-1.68,1.34-1.88c-0.07-0.47,6.05-9.68,6.66-9.95c0.27-0.13,0.47-0.54,0.47-0.87c0-0.54,5.85-9.88,6.72-10.69
|
||||
c0.2-0.2,1.41-2.02,2.69-4.03c1.28-2.02,2.62-3.9,3.03-4.17c0.34-0.27,0.4-0.54,0.13-0.54c-0.34,0-0.13-0.47,0.34-1.01
|
||||
c2.08-2.29,2.42-2.89,2.08-3.29c-0.27-0.2-0.07-0.4,0.34-0.4c0.47,0,0.81-0.4,0.81-0.94c0-0.54,0.27-1.08,0.54-1.21
|
||||
c0.34-0.13,1.95-2.35,3.56-4.91c1.61-2.62,3.16-4.84,3.43-4.91c0.27-0.13,0.54-0.54,0.54-0.87c0-0.34,1.08-2.15,2.35-3.97
|
||||
c1.28-1.82,2.35-3.5,2.35-3.77c0-0.2,0.4-0.74,0.87-1.28c0.4-0.47,2.89-4.17,5.51-8.2c2.55-3.97,4.91-7.4,5.18-7.46
|
||||
c0.34-0.13,0.4-0.54,0.13-0.87c-0.2-0.34,0.13-0.81,0.67-1.01c0.61-0.2,1.08-0.74,1.08-1.08c0-0.4,1.08-2.22,2.35-3.97
|
||||
c1.28-1.82,2.35-3.43,2.35-3.5c0-0.27,11.16-17.28,11.97-18.29c0.27-0.4,1.14-1.75,1.88-3.03c0.67-1.28,1.68-2.62,2.15-2.89
|
||||
c0.4-0.27,0.81-0.87,0.81-1.21c0-0.4,0.74-1.68,1.68-2.89c0.94-1.21,1.68-2.55,1.68-2.96c0-0.47,0.27-0.81,0.54-0.81
|
||||
c0.34,0,0.94-0.74,1.34-1.61c0.61-1.34,0.34-2.02-1.95-5.04c-1.41-1.88-2.35-3.43-2.08-3.43s0.13-0.27-0.27-0.54
|
||||
c-0.87-0.54-6.99-9.48-6.99-10.22c0-0.27-0.61-1.01-1.34-1.68c-0.74-0.67-1.34-1.61-1.34-2.15c0-0.47-0.27-0.87-0.67-0.87
|
||||
c-0.34,0-0.67-0.4-0.67-0.94c0-0.54-0.27-1.08-0.54-1.21c-0.54-0.2-6.19-9.01-6.19-9.61c0-0.2-0.61-1.01-1.34-1.82
|
||||
c-0.74-0.81-1.34-1.88-1.34-2.35s-0.27-0.87-0.67-0.87c-0.34,0-0.67-0.27-0.67-0.61c0-0.4-0.87-2.02-2.02-3.63
|
||||
c-1.08-1.68-2.02-3.36-2.02-3.77c0-0.4-0.27-0.74-0.61-0.74s-0.74-0.54-0.94-1.21c-0.4-1.14-2.49-4.84-3.16-5.51
|
||||
c-0.2-0.2-1.08-1.68-1.95-3.36c-0.94-1.68-1.82-3.16-2.02-3.36c-0.27-0.2-0.81-1.08-1.21-2.02c-0.47-0.94-2.22-4.1-3.9-7.06
|
||||
c-1.75-2.96-3.29-5.92-3.5-6.59c-0.2-0.61-0.61-1.14-0.87-1.14c-0.54,0-2.29-3.97-2.08-4.91
|
||||
C296.66,168.25,295.38,169.19,294.17,171.07L294.17,171.07z M379.36,300.09c-0.81,1.08-1.48,2.22-1.41,2.42
|
||||
c0,0.27-0.2,0.67-0.54,0.87c-0.94,0.67-8.94,12.71-8.94,13.51c0,0.34-0.2,0.67-0.47,0.67c-0.34,0-1.61,1.82-2.89,4.03
|
||||
s-2.55,4.03-2.82,4.03c-0.34,0-0.54,0.4-0.54,0.94c0,0.54-0.2,1.08-0.47,1.21c-0.74,0.27-4.24,5.71-4.24,6.52
|
||||
c0,0.34-0.47,0.74-1.01,1.01c-0.54,0.2-1.01,0.81-1.01,1.34c0,0.54-0.2,1.08-0.54,1.21c-0.27,0.07-1.55,1.88-2.82,3.9
|
||||
c-1.28,2.02-2.49,3.83-2.69,4.03s-1.14,1.55-2.02,3.03c-0.87,1.48-2.02,3.09-2.42,3.56c-0.47,0.4-1.08,1.41-1.28,2.15
|
||||
c-0.2,0.74-0.74,1.34-1.14,1.34c-0.4,0-0.61,0.2-0.34,0.4c0.2,0.27,0.07,0.81-0.4,1.28c-0.47,0.47-1.21,1.41-1.61,2.08
|
||||
c-0.47,0.74-2.22,3.36-3.9,5.85c-1.68,2.55-3.03,4.91-3.03,5.24c0,0.34-0.27,0.61-0.54,0.61c-0.34,0-1.01,0.81-1.55,1.82
|
||||
c-0.54,1.08-1.14,2.02-1.34,2.22s-3.36,4.84-6.99,10.42c-3.63,5.51-6.86,10.22-7.13,10.29c-0.34,0.13-0.47,0.54-0.2,0.87
|
||||
c0.2,0.34,0,0.61-0.34,0.61c-0.4,0-0.74,0.47-0.74,1.01c0,0.61-0.47,1.21-1.01,1.41c-0.54,0.27-0.81,0.67-0.61,1.01
|
||||
c0.2,0.34,0,0.61-0.34,0.61c-0.4,0-0.74,0.34-0.74,0.74s-0.54,1.41-1.14,2.29c-1.41,1.82-1.41,1.82-8.2,12.1
|
||||
c-2.96,4.44-5.71,8.47-6.12,8.94c-0.54,0.61,0.4,0.81,4.5,0.87c13.31,0.13,60.58,0.54,80.81,0.61l22.39,0.13l1.61-1.88
|
||||
c0.87-1.08,1.55-2.22,1.61-2.49c0-0.27,0.61-1.14,1.34-1.95c0.74-0.81,1.34-1.88,1.34-2.35s0.34-0.87,0.74-0.87
|
||||
c0.34,0,0.54-0.27,0.34-0.54c-0.2-0.34,0.27-0.94,0.94-1.48c0.67-0.54,1.14-1.14,1.01-1.34c-0.2-0.27,0.27-1.01,1.01-1.68
|
||||
c0.74-0.67,1.34-1.55,1.34-1.88c0-0.4,0.74-1.68,1.68-2.82c0.87-1.21,1.41-2.35,1.21-2.62c-0.27-0.2-0.13-0.4,0.27-0.4
|
||||
c0.4,0,2.89-3.5,5.58-7.73c2.69-4.24,5.51-8.34,6.19-9.08s1.08-1.34,0.94-1.34c-0.54,0,7.73-12.3,8.61-12.91
|
||||
c0.4-0.27,0.47-0.54,0.2-0.54c-0.34,0,0.07-0.81,0.81-1.75c0.81-1.01,1.41-2.22,1.41-2.76c0-0.81-3.03-4.24-11.56-13.11
|
||||
c-1.82-1.82-3.23-3.43-3.23-3.56c0-0.13-0.67-1.01-1.48-1.82c-1.48-1.48-6.19-6.86-11.36-12.91c-1.28-1.41-2.89-3.23-3.63-4.03
|
||||
c-1.08-1.14-4.57-5.18-9.41-10.89c-1.01-1.21-4.17-5.04-11.43-14.05C380.23,296.93,381.11,297.67,379.36,300.09L379.36,300.09z"/>
|
||||
<line class="st6" x1="108.71" y1="523.11" x2="108.7" y2="523.11"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,48 @@
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 100;
|
||||
src: local('Roboto Thin'), local('Roboto-Thin'), url(/fonts/roboto-thin.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto-light.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto-regular.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto-medium.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto-bold.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Roboto';
|
||||
font-style: normal;
|
||||
font-weight: 900;
|
||||
src: local('Roboto Black'), local('Roboto-Black'), url(/fonts/roboto-black.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
.v-toast__item--error {
|
||||
background-color: #F56565 !important;
|
||||
}
|
||||
|
||||
.v-toast__item--success {
|
||||
background-color: #38A169 !important;
|
||||
}
|
||||
|
||||
.v-toast__item--warning {
|
||||
background-color: #ED8936 !important;
|
||||
}
|
||||
|
||||
.v-toast__text {
|
||||
font-family: "Roboto", sans-serif;
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
//import store from '../store'
|
||||
import { Line, mixins } from 'vue-chartjs'
|
||||
const { reactiveProp } = mixins;
|
||||
|
||||
@@ -11,52 +12,101 @@ export default {
|
||||
props: ['chartData'],
|
||||
data() {
|
||||
return {
|
||||
timer: '',
|
||||
options: {
|
||||
events: [],
|
||||
animation: {
|
||||
duration: 0 // general animation time
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0 // disable bezier curves
|
||||
tension: 0,
|
||||
borderWidth: 1,
|
||||
},
|
||||
point: {
|
||||
radius: 0,
|
||||
}
|
||||
},
|
||||
showLines: true,
|
||||
legend: {
|
||||
labels: {
|
||||
fontColor: 'rgb(203, 203, 203)',
|
||||
fontFamily: 'Roboto,sans-serif'
|
||||
//fontFamily: 'Roboto,sans-serif',
|
||||
filter: function(item) {
|
||||
if (item && item.text) return !item.text.includes('_target');
|
||||
}
|
||||
},
|
||||
onClick: function(e, legendItem) {
|
||||
window.console.log(e)
|
||||
window.console.log(legendItem)
|
||||
|
||||
let ci = this.chart;
|
||||
let index = legendItem.datasetIndex;
|
||||
let index_target = ci.data.datasets.findIndex(dataset => dataset.label === legendItem.text+'_target');
|
||||
let meta = ci.getDatasetMeta(index);
|
||||
|
||||
// See controller.isDatasetVisible comment
|
||||
meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
|
||||
if (index_target !== -1) {
|
||||
let meta_target = ci.getDatasetMeta(index_target);
|
||||
meta_target.hidden = meta.hidden;
|
||||
}
|
||||
|
||||
//store.dispatch('gui/setHeaterChartVisibility', { name: legendItem.text, hidden: meta.hidden });
|
||||
|
||||
ci.update();
|
||||
}
|
||||
},
|
||||
tooltips: {
|
||||
enabled: false
|
||||
},
|
||||
hover: {
|
||||
mode:undefined
|
||||
},
|
||||
/*tooltips: {
|
||||
enabled: false,
|
||||
mode: 'nearest',
|
||||
caretPadding: 20,
|
||||
intersect: false,
|
||||
callbacks: {
|
||||
title: function (tooltipItem) {
|
||||
let date = new Date(tooltipItem[0].label);
|
||||
return date.getHours()+":"+(date.getMinutes() < 10 ? "0" : "")+date.getMinutes()+":"+(date.getSeconds() < 10 ? "0" : "")+date.getSeconds();
|
||||
},
|
||||
label: function (tooltipItem/!*, data*!/) {
|
||||
/!*let label_target = data['datasets'][tooltipItem.datasetIndex].label+"_target";
|
||||
let target_dataset = data['datasets'].find(dataset => dataset.label === label_target);
|
||||
|
||||
if (target_dataset !== undefined && target_dataset.data[tooltipItem.index] !== undefined) return tooltipItem.value+" / "+target_dataset.data[tooltipItem.index].y;*!/
|
||||
return tooltipItem.value;
|
||||
},
|
||||
}
|
||||
},*/
|
||||
maintainAspectRatio: false,
|
||||
responsive: true,
|
||||
responsiveAnimationDuration: 0, // animation duration after a resize
|
||||
scales: {
|
||||
xAxes: [
|
||||
{
|
||||
gridLines: {
|
||||
color: 'rgba(0,0,0,0.2)',
|
||||
display: true
|
||||
xAxes: [{
|
||||
type: 'time',
|
||||
time: {
|
||||
unit: 'minute',
|
||||
displayFormats: {
|
||||
second: 'HH:mm:ss',
|
||||
minute: 'HH:mm'
|
||||
}
|
||||
},
|
||||
ticks: {
|
||||
minor: {
|
||||
fontColor: 'rgb(203, 203, 203)',
|
||||
fontFamily: 'Roboto,sans-serif'
|
||||
},
|
||||
ticks: {
|
||||
minor: {
|
||||
fontColor: 'rgb(203, 203, 203)',
|
||||
fontFamily: 'Roboto,sans-serif'
|
||||
},
|
||||
major: {
|
||||
fontColor: 'rgb(203, 203, 203)',
|
||||
fontFamily: 'Roboto,sans-serif'
|
||||
},
|
||||
min: new Date() - maxSampleTime,
|
||||
max: new Date()
|
||||
},
|
||||
time: {
|
||||
unit: 'minute',
|
||||
displayFormats: {
|
||||
minute: 'HH:mm'
|
||||
}
|
||||
},
|
||||
type: 'time',
|
||||
}
|
||||
],
|
||||
min: new Date() - maxSampleTime,
|
||||
max: new Date(),
|
||||
},
|
||||
gridLines: {
|
||||
color: 'rgba(203,203,203,0.1)',
|
||||
},
|
||||
}],
|
||||
yAxes: [
|
||||
{
|
||||
gridLines: {
|
||||
@@ -83,20 +133,27 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.timer = setInterval(() => {
|
||||
if (
|
||||
this.$data._chart.config &&
|
||||
this.$data._chart.config.options &&
|
||||
this.$data._chart.config.options.scales &&
|
||||
this.$data._chart.config.options.scales.xAxes &&
|
||||
this.$data._chart.config.options.scales.xAxes.length &&
|
||||
this.$data._chart.config.options.scales.xAxes[0].ticks &&
|
||||
this.$data._chart.config.options.scales.yAxes &&
|
||||
this.$data._chart.config.options.scales.yAxes.length &&
|
||||
this.$data._chart.config.options.scales.yAxes[0].ticks
|
||||
) {
|
||||
this.$data._chart.config.options.scales.yAxes[0].ticks.max = defaultMaxTemperature
|
||||
this.$data._chart.config.options.scales.xAxes[0].ticks.min = new Date() - maxSampleTime
|
||||
this.$data._chart.config.options.scales.xAxes[0].ticks.max = new Date()
|
||||
this.$data._chart.update()
|
||||
}
|
||||
}, 1000)
|
||||
},
|
||||
mounted () {
|
||||
this.renderChart(this.chartData, this.options)
|
||||
},
|
||||
methods: {
|
||||
update() {
|
||||
this.$data._chart.config.options.scales.yAxes[0].ticks.max = defaultMaxTemperature;
|
||||
this.$data._chart.config.options.scales.xAxes[0].ticks.min = new Date() - maxSampleTime;
|
||||
this.$data._chart.config.options.scales.xAxes[0].ticks.max = new Date();
|
||||
this.$data._chart.update();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartData () {
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
<style>
|
||||
.btnHomeAxis {
|
||||
width: 36px;
|
||||
min-width: 36px !important;
|
||||
}
|
||||
|
||||
.btnMinWidthAuto {
|
||||
min-width: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-row class="" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 pb-0 text-center">
|
||||
<v-btn small @click="doHome" :loading="loadings.includes('homeAll')" :color="homedAxes.includes('xyz') ? 'primary' : 'warning'"><v-icon class="mr-1">mdi-home</v-icon><span class="d-none d-sm-inline">Home </span>all</v-btn>
|
||||
<v-btn small @click="doQGL" :loading="loadings.includes('qgl')" color="primary" class="ml-2" v-if="'quad_gantry_level' in config">QGL</v-btn>
|
||||
<v-btn small @click="doZtilt" :loading="loadings.includes('zTilt')" color="primary" class="ml-2" v-if="'z_tilt' in config">Z Tilt</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('X-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeX" :color="homedAxes.includes('x') ? 'primary' : 'warning'" :loading="loadings.includes('homeX')" class="font-weight-bold btnHomeAxis">X</v-btn>
|
||||
<v-btn @click="doSendMove('X+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('X+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Y-100')" class="btnMinWidthAuto col"><span class="body-2">-100</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-10')" class="btnMinWidthAuto col"><span class="body-2">-10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y-1')" class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doHomeY" :color="homedAxes.includes('y') ? 'primary' : 'warning'" :loading="loadings.includes('homeY')" class="font-weight-bold btnHomeAxis">Y</v-btn>
|
||||
<v-btn @click="doSendMove('Y+1')" class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+10')" class="btnMinWidthAuto col"><span class="body-2">+10</span></v-btn>
|
||||
<v-btn @click="doSendMove('Y+100')" class="btnMinWidthAuto col"><span class="body-2">+100</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-3" v-if="['standby', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="col-12 py-0 px-6 text-center">
|
||||
<v-btn-toggle dense no-gutters class="row mx-auto" style="flex-wrap: nowrap;" >
|
||||
<v-btn @click="doSendMove('Z-25')" dense class="btnMinWidthAuto col"><span class="body-2">-25</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-1')" dense class="btnMinWidthAuto col"><span class="body-2">-1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z-0.1')" dense class="btnMinWidthAuto col"><span class="body-2">-0.1</span></v-btn>
|
||||
<v-btn @click="doHomeZ" :color="homedAxes.includes('z') ? 'primary' : 'warning'" :loading="loadings.includes('homeZ')" class="font-weight-bold btnHomeAxis">Z</v-btn>
|
||||
<v-btn @click="doSendMove('Z+0.1')" dense class="btnMinWidthAuto col"><span class="body-2">+0.1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+1')" dense class="btnMinWidthAuto col"><span class="body-2">+1</span></v-btn>
|
||||
<v-btn @click="doSendMove('Z+25')" dense class="btnMinWidthAuto col"><span class="body-2">+25</span></v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="" v-if="this['printer/getMacros'].length > 0">
|
||||
<v-col class="col-12 px-4 py-2 text-center">
|
||||
<div v-for="(macro, index) in this['printer/getMacros']" v-bind:key="index+99" class="d-inline-block mx-1 my-1">
|
||||
<v-btn small color="primary" class="mx-1 my-1" :loading="loadings.includes('macro_'+macro.name)" @click="doSendMacro(macro.name)">{{ macro.name.replace(/_/g, " ") }}</v-btn>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
homedAxes: state => state.printer.toolhead.homed_axes,
|
||||
config: state => state.printer.configfile.config,
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getMacros',
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
doHome() {
|
||||
this.$store.commit('server/addEvent', "G28");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeAll' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28" }, "socket/removeLoading", { name: 'homeAll' });
|
||||
},
|
||||
doHomeX() {
|
||||
this.$store.commit('server/addEvent', "G28 X");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeX' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 X" }, "socket/removeLoading", { name: 'homeX' });
|
||||
},
|
||||
doHomeY() {
|
||||
this.$store.commit('server/addEvent', "G28 Y");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeY' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Y" }, "socket/removeLoading", { name: 'homeY' });
|
||||
},
|
||||
doHomeZ() {
|
||||
this.$store.commit('server/addEvent', "G28 Z");
|
||||
this.$store.commit('socket/addLoading', { name: 'homeZ' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "G28 Z" }, "socket/removeLoading", { name: 'homeZ' });
|
||||
},
|
||||
doQGL() {
|
||||
this.$store.commit('server/addEvent', "QUAD_GANTRY_LEVEL");
|
||||
this.$store.commit('socket/addLoading', { name: 'qgl' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "QUAD_GANTRY_LEVEL" }, "socket/removeLoading", { name: 'qgl' });
|
||||
},
|
||||
doZtilt() {
|
||||
this.$store.commit('server/addEvent', "Z_TILT_ADJUST");
|
||||
this.$store.commit('socket/addLoading', { name: 'zTilt' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "Z_TILT_ADJUST" }, "socket/removeLoading", { name: 'zTilt' });
|
||||
},
|
||||
doSendMove(gcode) {
|
||||
gcode = "G91" + "\n" +
|
||||
"G1 " + gcode + " F6000" + "\n" +
|
||||
"G90";
|
||||
|
||||
this.doSend(gcode);
|
||||
},
|
||||
doSend(gcode) {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "server/getGcodeRespond");
|
||||
},
|
||||
doSendMacro(gcode) {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('socket/addLoading', { name: 'macro_'+gcode });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'macro_'+gcode });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,78 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card v-if="(['standby', 'paused', 'complete'].includes(printer_state))">
|
||||
<v-row class="px-3">
|
||||
<v-col class="col-12 col-md-6">
|
||||
<v-label>Feed amount in mm:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="amount in feedAmounts" v-bind:key="amount" @click="setFeedAmount(amount)" dense :class="(amount === feedAmount ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ amount }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<v-label>Feedrate in mm/s:</v-label>
|
||||
<v-btn-toggle class="mt-2" dense no-gutters style="flex-wrap: nowrap; width: 100%;" >
|
||||
<v-btn v-for="rate in feedrates" v-bind:key="rate" @click="setFeedrate(rate)" dense :class="(feedrate === rate ? 'v-btn--active' : '') + ' btnMinWidthAuto flex-grow-1 px-0 _btnFeedrate'">{{ rate }}</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="px-3">
|
||||
<v-col class="col-12 text-center">
|
||||
<v-btn small @click="sendRetract()" class="mx-2" :loading="loadings.includes('btnRetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-up-bold</v-icon> Retract</v-btn>
|
||||
<v-btn small @click="sendDetract()" class="mx-2" :loading="loadings.includes('btnDetract')" :disabled="!this['printer/getExtrudePossible']"><v-icon small class="mr-1">mdi-arrow-down-bold</v-icon> Extrude</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
feedAmount: 25,
|
||||
feedrate: 5,
|
||||
feedAmounts: [ 100, 25, 10, 5, 1 ],
|
||||
feedrates: [ 60, 30, 15, 5, 1 ],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loadings: state => state.socket.loadings,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
extruder: state => state.printer.extruder,
|
||||
config: state => state.printer.configfile.config
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getExtrudePossible',
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
setFeedAmount(value) {
|
||||
this.feedAmount = value;
|
||||
},
|
||||
setFeedrate(value) {
|
||||
this.feedrate = value;
|
||||
},
|
||||
sendRetract() {
|
||||
let gcode = "M83\nG1 E-"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('socket/addLoading', { name: 'btnRetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnRetract' });
|
||||
},
|
||||
sendDetract() {
|
||||
let gcode = "M83\nG1 E"+this.feedAmount+" F"+(this.feedrate * 60);
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$store.commit('socket/addLoading', { name: 'btnDetract' });
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'btnDetract' });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-alert-circle</v-icon>Klippy-State: {{ klippy_state}}</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col class="text-left" v-if="klippy_connected"><pre style="white-space: pre-wrap;">{{ klippy_message }}</pre></v-flex>
|
||||
<v-flex col class="text-left" v-if="!klippy_connected">
|
||||
<p>Moonraker can't connect to Klippy!<br />Please check if the Klipper service is running and an UDS (Unix Domain Socket) is configured.</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider class="my-2" v-if="klippy_connected" ></v-divider>
|
||||
<v-card-text class="px-4 pt-2 pb-4 content text-center text-lg-left" v-if="klippy_connected">
|
||||
<v-btn small @click="doRestart" color="error" class=""><v-icon class="mr-sm-2">mdi-cached</v-icon>Restart</v-btn>
|
||||
<v-btn small @click="doRestartFirmware" class="ml-4" color="error"><v-icon class="mr-sm-2">mdi-cached</v-icon>FIRMWARE Restart</v-btn>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
klippy_connected: state => state.server.klippy_connected,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
klippy_message: state => state.server.klippy_message,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
doRestart() {
|
||||
this.$store.commit('socket/addLoading', { name: 'restart' });
|
||||
this.$socket.sendObj('printer.restart', { }, 'socket/removeLoading', { name: 'restart' });
|
||||
},
|
||||
doRestartFirmware() {
|
||||
this.$store.commit('socket/addLoading', { name: 'firmwareRestart' });
|
||||
this.$socket.sendObj('printer.firmware_restart', { }, 'socket/removeLoading', { name: 'firmwareRestart' });
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<v-card
|
||||
class="mb-6"
|
||||
v-if="
|
||||
!boolVirtualSdcard ||
|
||||
!boolPauseResume ||
|
||||
!boolDisplayStatus ||
|
||||
!boolMacroPause ||
|
||||
!boolMacroResume ||
|
||||
!boolMacroCancelPrint
|
||||
">
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<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"><code>virtual_sdcard</code> is not defined in config.</p>
|
||||
<p v-if="!boolPauseResume"><code>pause_resume</code> is not defined in config.</p>
|
||||
<p v-if="!boolDisplayStatus"><code>display_status</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroPause"><code>gcode_macro PAUSE</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroResume"><code>gcode_macro RESUME</code> is not defined in config.</p>
|
||||
<p v-if="!boolMacroCancelPrint"><code>gcode_macro CANCEL_PRINT</code> is not defined in config.</p>
|
||||
<p class="mb-0"><a href="https://meteyou.github.io/mainsail/necessary-configuration" target="_blank">Here you will find more information.</a></p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
boolVirtualSdcard: false,
|
||||
boolPauseResume: false,
|
||||
boolDisplayStatus: false,
|
||||
boolMacroPause: false,
|
||||
boolMacroResume: false,
|
||||
boolMacroCancelPrint: false,
|
||||
}),
|
||||
computed: {
|
||||
...mapState({
|
||||
config: state => state.printer.configfile.config,
|
||||
}),
|
||||
...mapMutations([
|
||||
|
||||
]),
|
||||
...mapGetters([
|
||||
'printer/checkConfigVirtualSdcard',
|
||||
'printer/checkConfigPauseResume',
|
||||
'printer/checkConfigDisplayStatus',
|
||||
'printer/checkConfigMacroPause',
|
||||
'printer/checkConfigMacroResume',
|
||||
'printer/checkConfigMacroCancel',
|
||||
]),
|
||||
},
|
||||
created() {
|
||||
this.refreshConfig();
|
||||
},
|
||||
methods: {
|
||||
refreshConfig() {
|
||||
this.boolVirtualSdcard = this['printer/checkConfigVirtualSdcard'];
|
||||
this.boolPauseResume = this['printer/checkConfigPauseResume'];
|
||||
this.boolDisplayStatus = this['printer/checkConfigDisplayStatus'];
|
||||
this.boolMacroPause = this['printer/checkConfigMacroPause'];
|
||||
this.boolMacroResume = this['printer/checkConfigMacroResume'];
|
||||
this.boolMacroCancelPrint = this['printer/checkConfigMacroCancel'];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
config: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.refreshConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content span,
|
||||
.content strong {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,128 @@
|
||||
<style>
|
||||
|
||||
.minievent-table {
|
||||
max-height: 350px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.miniConsole .title-cell {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.miniConsole.v-data-table > .v-data-table__wrapper > table > tbody > tr > td {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.miniConsole .content-cell {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-console-line</v-icon>Console</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:options="options"
|
||||
:items="events"
|
||||
item-key="date"
|
||||
hide-default-footer
|
||||
hide-default-header
|
||||
disable-pagination
|
||||
class="minievent-table miniConsole"
|
||||
:custom-sort="customSort"
|
||||
sort-by="date"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="py-2">empty</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr>
|
||||
<td class="log-cell title-cell py-2">
|
||||
{{ formatTime(item.date)}}
|
||||
</td>
|
||||
<td class="log-cell content-cell pl-0 py-2" colspan="2" style="width:100%;">
|
||||
<span v-if="item.message" class="message" v-html="formatMessage(item.message)"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: 'Date',
|
||||
value: 'date',
|
||||
width: '15%',
|
||||
dateType: 'Date',
|
||||
},
|
||||
{
|
||||
text: 'Event',
|
||||
sortable: false,
|
||||
value: 'message',
|
||||
width: '85%'
|
||||
},
|
||||
],
|
||||
options: {
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
events: state => state.server.events,
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
formatTime(date) {
|
||||
let hours = date.getHours();
|
||||
if (hours < 10) hours = "0"+hours.toString();
|
||||
let minutes = date.getMinutes();
|
||||
if (minutes < 10) minutes = "0"+minutes.toString();
|
||||
let seconds = date.getSeconds();
|
||||
if (seconds < 10) seconds = "0"+seconds.toString();
|
||||
|
||||
|
||||
return hours+":"+minutes+":"+seconds;
|
||||
},
|
||||
formatMessage(message) {
|
||||
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||
|
||||
return message;
|
||||
},
|
||||
customSort: function(items, index, isDesc) {
|
||||
items.sort((a, b) => {
|
||||
if (index[0] === 'date') {
|
||||
if (!isDesc[0]) return new Date(b[index]) - new Date(a[index]);
|
||||
else return new Date(a[index]) - new Date(b[index]);
|
||||
} else {
|
||||
if(typeof a[index] !== 'undefined'){
|
||||
if (!isDesc[0]) return a[index].toLowerCase().localeCompare(b[index].toLowerCase());
|
||||
else return b[index].toLowerCase().localeCompare(a[index].toLowerCase());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,71 @@
|
||||
<style>
|
||||
.icon-rotate {
|
||||
animation-name: spin;
|
||||
animation-duration: 1000ms;
|
||||
animation-iteration-count: infinite;
|
||||
animation-timing-function: linear;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
} to {
|
||||
transform: rotate(-360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card v-if="this['printer/getFans'].length">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon :class="'mdi mdi-fan '+(this['printer/getPartFanSpeed'] ? 'icon-rotate' : '')" left></v-icon>Fans</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<div v-for="(fan, index) of this['printer/getFans']" v-bind:key="index">
|
||||
<v-divider v-if="index"></v-divider>
|
||||
<fan-slider :name="fan.name" :type="fan.type" :target="fan.speed" :controllable="fan.controllable" :multi="100" class="py-0" ></fan-slider>
|
||||
</div>
|
||||
</v-card>
|
||||
<v-card class="mt-6" v-if="['printing', 'paused'].includes(printer_state)">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon class="mdi mdi-printer-3d" left></v-icon>Print Settings</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Speed factor" :target="speed_factor" :max="200" :multi="100" :step="5" command="M220" attribute-name="S" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Extrusion factor" :target="extrude_factor" :max="200" :multi="100" :step="1" command="M221" attribute-name="S" ></tool-slider>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex'
|
||||
import FanSlider from '../../inputs/FanSlider'
|
||||
import ToolSlider from '../../inputs/ToolSlider'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FanSlider,
|
||||
ToolSlider
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
extrude_factor: state => state.printer.gcode_move.extrude_factor,
|
||||
speed_factor: state => state.printer.gcode_move.speed_factor,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getFans',
|
||||
'printer/getPartFanSpeed',
|
||||
]),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,53 @@
|
||||
<style>
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon class="mdi mdi-power" left></v-icon>Power Control
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
|
||||
<div v-for="(device, index) in devices" v-bind:key="index">
|
||||
<v-divider class="mt-0" v-if="index > 0"></v-divider>
|
||||
<v-card-text class="py-2">
|
||||
<v-row>
|
||||
<v-col class="py-0 pt-1">{{ device.device }}</v-col>
|
||||
<v-col class="py-0 text-right">
|
||||
<v-btn-toggle v-model="device.status">
|
||||
<v-btn small v-if="device.status === 'error'" disabled>Error</v-btn>
|
||||
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'on'" @click="setPower(device,1)">On</v-btn>
|
||||
<v-btn small v-if="device.status !== 'error'" :disabled="device.status === 'off'" @click="setPower(device,0)">Off</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from "vuex";
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
|
||||
computed: {
|
||||
...mapState({
|
||||
devices: (state) => state.server.power.devices,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
setPower(device, value) {
|
||||
let rpc = value === 1 ? "machine.device_power.on" : "machine.device_power.off";
|
||||
Vue.prototype.$socket.sendObj(rpc,{ [device.device]: null },"server/power/responseToggle");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,491 @@
|
||||
<style>
|
||||
.my-editor {
|
||||
background: #2d2d2d;
|
||||
color: #ccc;
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.prism-editor__textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.config-editor-overlay div.v-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.config-editor-overlay div.v-card header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
Config Files
|
||||
<v-spacer></v-spacer>
|
||||
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
|
||||
<v-item-group class="v-btn-toggle">
|
||||
<v-btn color="" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="uploadFileButton" :loading="loadings.includes['configFileUpload']"><v-icon>mdi-file-upload</v-icon></v-btn>
|
||||
<v-btn color="" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFile"><v-icon>mdi-file-plus</v-icon></v-btn>
|
||||
<v-btn color="" v-if="currentPath !== '' && currentPath !== '/config_examples'" @click="createFolder"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn color="primary" @click="refreshFileList"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath === "" ? "/" : this.currentPath }}</v-card-subtitle>
|
||||
<v-data-table
|
||||
:items="files"
|
||||
class="files-table"
|
||||
:headers="headers"
|
||||
:options="options"
|
||||
:page.sync="currentPage"
|
||||
:custom-sort="sortFiles"
|
||||
:sort-by.sync="sortBy"
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items-per-page.sync="countPerPage"
|
||||
item-key="name">
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== '')">
|
||||
<tr
|
||||
class="file-list-cursor"
|
||||
@click="clickRowGoBack">
|
||||
<td class=" "><v-icon>mdi-folder-upload</v-icon></td>
|
||||
<td class=" " colspan="8">..</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor"
|
||||
:data-name="item.filename">
|
||||
<td class=" ">
|
||||
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
|
||||
<v-icon v-if="!item.isDirectory">mdi-file</v-icon>
|
||||
</td>
|
||||
<td class=" ">{{ item.filename }}</td>
|
||||
<td class="text-no-wrap text-right">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
|
||||
<td class="text-right">{{ formatDate(item.modified) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item @click="clickRow(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-file-document-edit-outline</v-icon> Edit file
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
</v-list-item>
|
||||
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
</v-list-item>
|
||||
<v-list-item @click="deleteDirectoryAction" v-if="contextMenu.item.isDirectory && currentPath !== '' && currentPath !== '/config_examples'">
|
||||
<v-icon class="mr-1">mdi-delete</v-icon> Delete
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-dialog v-model="editor.showLoader" hide-overlay persistent width="300" >
|
||||
<v-card color="primary" dark >
|
||||
<v-card-text>
|
||||
Please stand by
|
||||
<v-progress-linear indeterminate color="white" class="mb-0" ></v-progress-linear>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="editor.show" fullscreen hide-overlay transition="dialog-bottom-transition" content-class="config-editor-overlay">
|
||||
<v-card d-flex>
|
||||
<v-toolbar dark color="primary">
|
||||
<v-btn icon dark @click="editor.show = false">
|
||||
<v-icon>mdi-close</v-icon>
|
||||
</v-btn>
|
||||
<v-toolbar-title>{{ editor.item.filename }}</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-toolbar-items>
|
||||
<v-btn dark text @click="saveFile" v-if="currentPath !== '/config_examples'">Save</v-btn>
|
||||
</v-toolbar-items>
|
||||
</v-toolbar>
|
||||
<prism-editor class="my-editor" v-model="editor.sourcecode" :readonly="editor.readonly" :highlight="highlighter" line-numbers></prism-editor>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">Rename File</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogRenameFile.newName"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameFile.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">rename</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateFile.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">Create File</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogCreateFile.name"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogCreateFile.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="createFileAction">create</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateFolder.show" max-width="400">
|
||||
<v-card>
|
||||
<v-card-title class="headline">Create Folder</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field label="Name" required v-model="dialogCreateFolder.name"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogCreateFolder.show = false">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="createFolderAction">create</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import {findDirectory} from "@/plugins/helpers";
|
||||
|
||||
import { PrismEditor } from 'vue-prism-editor';
|
||||
import 'vue-prism-editor/dist/prismeditor.min.css'; // import the styles somewhere
|
||||
|
||||
// import highlighting library (you can use any library you want just return html string)
|
||||
import { highlight, languages } from 'prismjs/components/prism-core';
|
||||
import 'prismjs/components/prism-editorconfig';
|
||||
import 'prismjs/components/prism-ini';
|
||||
import 'prismjs/themes/prism-okaidia.css';
|
||||
import axios from "axios"; // import syntax highlighting styles
|
||||
|
||||
export default {
|
||||
components: {
|
||||
PrismEditor,
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
sortBy: 'filename',
|
||||
sortDesc: false,
|
||||
selected: [],
|
||||
headers: [
|
||||
{ text: '', value: '', },
|
||||
{ text: 'Name', value: 'filename', },
|
||||
{ text: 'Filesize', value: 'size', align: 'right', },
|
||||
{ text: 'Last modified', value: 'modified', align: 'right', },
|
||||
],
|
||||
options: {
|
||||
},
|
||||
currentPage: 1,
|
||||
files: [],
|
||||
currentPath: '/config',
|
||||
editor: {
|
||||
show: false,
|
||||
showLoader: false,
|
||||
readonly: false,
|
||||
item: {
|
||||
filename: "",
|
||||
},
|
||||
sourcecode: ''
|
||||
},
|
||||
contextMenu: {
|
||||
shown: false,
|
||||
isDirectory: false,
|
||||
touchTimer: undefined,
|
||||
x: 0,
|
||||
y: 0,
|
||||
item: {}
|
||||
},
|
||||
dialogRenameFile: {
|
||||
show: false,
|
||||
newName: "",
|
||||
item: {}
|
||||
},
|
||||
dialogCreateFile: {
|
||||
show: false,
|
||||
name: "",
|
||||
},
|
||||
dialogCreateFolder: {
|
||||
show: false,
|
||||
name: "",
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
filetree: state => state.files.filetree,
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.socket.loadings,
|
||||
}),
|
||||
countPerPage: {
|
||||
get: function() {
|
||||
return this.$store.state.gui.settings.configfiles.countPerPage
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { settings: { configfiles: { countPerPage: newVal } } });
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadPath();
|
||||
},
|
||||
methods: {
|
||||
highlighter(code) {
|
||||
return highlight(code, languages.ini); //returns html
|
||||
},
|
||||
refreshFileList: function() {
|
||||
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');
|
||||
} else this.$socket.sendObj('server.files.get_directory', { path: this.currentPath.substring(1) }, 'files/getDirectory');
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date);
|
||||
|
||||
return tmp2.toLocaleString().replace(',', '');
|
||||
},
|
||||
formatFilesize(fileSizeInBytes) {
|
||||
let i = -1;
|
||||
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
do {
|
||||
fileSizeInBytes = fileSizeInBytes / 1024;
|
||||
i++;
|
||||
} while (fileSizeInBytes > 1024);
|
||||
|
||||
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
|
||||
},
|
||||
sortFiles(items, sortBy, sortDesc) {
|
||||
sortBy = sortBy.length ? sortBy[0] : 'filename';
|
||||
sortDesc = sortDesc[0];
|
||||
|
||||
if (items !== undefined) {
|
||||
// Sort by index
|
||||
items.sort(function(a, b) {
|
||||
if (a[sortBy] === b[sortBy]) {
|
||||
return 0;
|
||||
}
|
||||
if (a[sortBy] === null || a[sortBy] === undefined) {
|
||||
return -1;
|
||||
}
|
||||
if (b[sortBy] === null || b[sortBy] === undefined) {
|
||||
return 1;
|
||||
}
|
||||
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
|
||||
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
|
||||
}
|
||||
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
|
||||
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
|
||||
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
|
||||
return reducedA - reducedB;
|
||||
}
|
||||
return a[sortBy] - b[sortBy];
|
||||
});
|
||||
|
||||
// Deal with descending order
|
||||
if (sortDesc) items.reverse();
|
||||
|
||||
// Then make sure directories come first
|
||||
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
|
||||
}
|
||||
return items;
|
||||
},
|
||||
loadPath: function() {
|
||||
let dirArray = this.currentPath.substring(1).split("/");
|
||||
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
if (dirArray.length === 1 && this.currentPath === "") {
|
||||
this.files = this.files.filter(element => element.filename !== "gcodes");
|
||||
}
|
||||
},
|
||||
clickRow: function(item) {
|
||||
if (!item.isDirectory) {
|
||||
this.editor.showLoader = true;
|
||||
this.editor.sourcecode = "";
|
||||
this.editor.item = item;
|
||||
|
||||
let url = '//'+this.hostname+':'+this.port+'/server/files'+this.currentPath+'/'+item.filename+'?time='+Date.now();
|
||||
fetch(url, { cache: "no-cache" }).then(res => res.text()).then(file => {
|
||||
this.editor.sourcecode = file;
|
||||
this.editor.show = true;
|
||||
this.editor.showLoader = false;
|
||||
this.editor.readonly = false;
|
||||
if (this.currentPath === '/config_examples') this.editor.readonly = true;
|
||||
});
|
||||
|
||||
} else {
|
||||
this.currentPath += "/"+item.filename;
|
||||
this.currentPage = 1;
|
||||
}
|
||||
},
|
||||
clickRowGoBack: function() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
|
||||
},
|
||||
saveFile: function() {
|
||||
let file = new File([this.editor.sourcecode], this.editor.item.filename);
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('root', 'config');
|
||||
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
|
||||
|
||||
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
).then(() => {
|
||||
this.$toast.success("File '"+this.editor.item.filename+"' successfully saved.");
|
||||
this.editor.show = false;
|
||||
this.editor.sourcecode = "";
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error save "+this.editor.item.filename);
|
||||
});
|
||||
},
|
||||
showContextMenu (e, item) {
|
||||
e.preventDefault();
|
||||
this.contextMenu.shown = true;
|
||||
this.contextMenu.x = e.clientX;
|
||||
this.contextMenu.y = e.clientY;
|
||||
this.contextMenu.item = item;
|
||||
this.$nextTick(() => {
|
||||
this.contextMenu.shown = true
|
||||
});
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
link.download = name;
|
||||
link.href = '//' + this.hostname + ':' + this.port + '/server/files/' + filename;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
createFolder() {
|
||||
this.dialogCreateFolder.name = "";
|
||||
this.dialogCreateFolder.show = true;
|
||||
},
|
||||
createFolderAction() {
|
||||
this.dialogCreateFolder.show = false;
|
||||
|
||||
this.$socket.sendObj('server.files.post_directory', {
|
||||
path: this.currentPath.substring(1)+"/"+this.dialogCreateFolder.name
|
||||
}, 'files/getCreateDir');
|
||||
},
|
||||
createFile() {
|
||||
this.dialogCreateFile.name = "";
|
||||
this.dialogCreateFile.show = true;
|
||||
},
|
||||
createFileAction() {
|
||||
let file = new File([""], this.dialogCreateFile.name);
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('root', 'config');
|
||||
if(this.currentPath.length > 7) formData.append('path', this.currentPath.substring(8));
|
||||
|
||||
axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
).then(() => {
|
||||
this.dialogCreateFile.show = false;
|
||||
this.dialogCreateFile.name = "";
|
||||
}).catch(() => {
|
||||
window.console.error("Error save "+this.editor.item.filename);
|
||||
});
|
||||
},
|
||||
renameFile(item) {
|
||||
this.dialogRenameFile.item = item;
|
||||
this.dialogRenameFile.newName = item.filename;
|
||||
this.dialogRenameFile.show = true;
|
||||
},
|
||||
renameFileAction() {
|
||||
this.dialogRenameFile.show = false;
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameFile.newName
|
||||
}, 'files/getMove');
|
||||
},
|
||||
removeFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
axios.delete(
|
||||
'//'+ this.hostname + ':' + this.port +'/server/files/'+filename
|
||||
).then((result) => {
|
||||
this.$toast.success(result.data.result+" successfully deleted.");
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error! Cannot delete file.");
|
||||
});
|
||||
},
|
||||
deleteDirectoryAction: function() {
|
||||
this.$socket.sendObj('server.files.delete_directory', { path: this.currentPath+"/"+this.contextMenu.item.filename }, 'files/getDeleteDir');
|
||||
},
|
||||
uploadFileButton: function() {
|
||||
this.$refs.fileUpload.click()
|
||||
},
|
||||
uploadFile: function() {
|
||||
if (this.$refs.fileUpload.files.length) {
|
||||
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
|
||||
this.$refs.fileUpload.value = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
let toast = this.$toast;
|
||||
let formData = new FormData();
|
||||
let filename = file.name.replace(" ", "_");
|
||||
formData.append('root', 'config');
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7));
|
||||
this.$store.commit('socket/addLoading', { name: 'configFileUpload' });
|
||||
|
||||
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, { headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
).then((result) => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' });
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
}).catch(() => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'configFileUpload' });
|
||||
toast.error("Cannot upload the file!");
|
||||
});
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
config: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.loadPath();
|
||||
}
|
||||
},
|
||||
config_examples: {
|
||||
deep: true,
|
||||
handler() {
|
||||
this.loadPath();
|
||||
}
|
||||
},
|
||||
currentPath: {
|
||||
handler() {
|
||||
this.loadPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,74 @@
|
||||
<style>
|
||||
.settings_dashboard_switch .v-messages {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-view-dashboard</v-icon>Dashbaord</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-3">
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowWebcamOnDashboard" label="Webcam" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowTempchartOnDashboard" label="Tempchart" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolShowConsoleOnDashboard" label="Console" class="settings_dashboard_switch mt-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
boolShowWebcamOnDashboard: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.boolWebcam;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolWebcam: status } });
|
||||
}
|
||||
},
|
||||
boolShowTempchartOnDashboard: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.boolTempchart;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolTempchart: status } });
|
||||
}
|
||||
},
|
||||
boolShowConsoleOnDashboard: {
|
||||
get() {
|
||||
return this.$store.state.gui.dashboard.boolConsole;
|
||||
},
|
||||
set(status) {
|
||||
return this.$store.dispatch('gui/setSettings', { dashboard: { boolConsole: status } });
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<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">
|
||||
<div v-for="(status, index) of sortEndstops" v-bind:key="index">
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<label class="mt-1 d-inline-block">Endstop <b>{{ index.toUpperCase() }}</b></label>
|
||||
<v-chip class="float-right" :color="status === 'open' ? 'green' : 'red' " text-color="white">{{ status }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-row v-if="(Object.keys(endstops).length === 0 && endstops.constructor === Object)" >
|
||||
<v-col class="py-0">
|
||||
<p>Press the sync-button on the right-bottom to load the current endstop status.</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon @click="syncEndstops" :loading="loadings.includes('queryEndstops')">
|
||||
<v-icon>mdi-sync</v-icon>
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
sortEndstops: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loadings: state => state.socket.loadings,
|
||||
endstops: state => state.printer.endstops,
|
||||
})
|
||||
},
|
||||
created() {
|
||||
this.getEndstops();
|
||||
},
|
||||
methods: {
|
||||
syncEndstops() {
|
||||
this.$store.commit('socket/addLoading', { name: 'queryEndstops' });
|
||||
this.$socket.sendObj('printer.query_endstops.status', { }, "printer/getEndstopStatus");
|
||||
},
|
||||
getEndstops() {
|
||||
this.sortEndstops = {};
|
||||
|
||||
let keys = Object.keys(this.endstops);
|
||||
keys.sort();
|
||||
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let k = keys[i];
|
||||
this.sortEndstops[k] = this.endstops[k];
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
endstops: function() {
|
||||
this.getEndstops();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,51 @@
|
||||
<style>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-cog</v-icon>General</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="py-0">
|
||||
<v-row>
|
||||
<v-col class="pt-2 pb-0">
|
||||
<v-text-field
|
||||
v-model="printerName"
|
||||
label="Printer Name"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
printerName: {
|
||||
get() {
|
||||
return this.$store.state.gui.general.printername;
|
||||
},
|
||||
set(newName) {
|
||||
return this.$store.dispatch('gui/setSettings', { general: { printername: newName } });
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-speedometer</v-icon>Machine Limits</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<tool-slider label="Velocity" unit="mm/s" :target="current_velocity" :max="max_velocity" command="SET_VELOCITY_LIMIT" attribute-name="VELOCITY=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Acceleration" unit="mm/s²" :target="current_accel" :max="max_accel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Deceleration" unit="mm/s²" :target="current_accel_to_decel" :max="max_accel_to_decel" command="SET_VELOCITY_LIMIT" attribute-name="ACCEL_TO_DECEL=" ></tool-slider>
|
||||
<v-divider></v-divider>
|
||||
<tool-slider label="Square corner velocity" unit="mm/s" :target="current_square_corner_velocity" :max="max_square_corner_velocity" command="SET_VELOCITY_LIMIT" attribute-name="SQUARE_CORNER_VELOCITY=" ></tool-slider>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import ToolSlider from '../../../inputs/ToolSlider'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ToolSlider
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
current_velocity: state => state.printer.toolhead.max_velocity,
|
||||
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,
|
||||
}),
|
||||
},
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<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'">
|
||||
<v-row>
|
||||
<v-col :class="'col-12' +(klippy_state !== 'ready' ? 'col-md-6' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/klippy.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Klipper</v-btn>
|
||||
</v-col>
|
||||
<v-col :class="'col-12 pt-0 ' +(klippy_state !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12')+ ''">
|
||||
<v-btn :href="'//'+hostname+':'+port+'/server/files/moonraker.log'" block color="primary"><v-icon class="mr-2">mdi-download</v-icon>Moonraker</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
}),
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,46 @@
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<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-card-text class="py-3">
|
||||
<div v-for="(macro, index) in this['printer/getAllMacros']" v-bind:key="index">
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<settings-macro-switch :name="macro.name"></settings-macro-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import SettingsMacroSwitch from "../../../inputs/SettingsMacroSwitch";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SettingsMacroSwitch
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hiddenMacros: state => state.gui.dashboard.hiddenMacros,
|
||||
}),
|
||||
...mapGetters([
|
||||
'printer/getAllMacros',
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-for="(runout, index) of this['printer/getFilamentSwitchSensors']" v-bind:key="index">
|
||||
<v-card class="mt-6">
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>mdi-printer-3d-nozzle-alert</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">{{ runout.name }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<settings-runout-switch :name="runout.name" :enabled="runout.enabled" :filament_detected="runout.filament_detected"></settings-runout-switch>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import SettingsRunoutSwitch from "../../../inputs/SettingsRunoutSwitch";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SettingsRunoutSwitch
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'printer/getFilamentSwitchSensors'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<style>
|
||||
.content { overflow: hidden; }
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-text-field
|
||||
v-model="webcamUrl"
|
||||
hide-details
|
||||
label="Webcam URL"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="rotationEnabled">
|
||||
<v-col class="py-0" col-auto>
|
||||
<v-switch v-model="rotate" hide-details label="Rotate"></v-switch>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-select :items="[{ text: '90 degrees', value: 90 }, { text: '270 degrees', value: 270 }]" v-model="rotateDegrees" hide-details></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="flipX" hide-details label="Flip webcam horizontally"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="flipY" hide-details label="Flip webcam vertically"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<v-switch v-model="boolNavi" hide-details label="Show in navigation"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
rotationEnabled: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
webcamUrl: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.url;
|
||||
},
|
||||
set(url) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { url } });
|
||||
}
|
||||
},
|
||||
flipX: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.flipX;
|
||||
},
|
||||
set(flipX) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipX } });
|
||||
}
|
||||
},
|
||||
flipY: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.flipY;
|
||||
},
|
||||
set(flipY) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { flipY } });
|
||||
}
|
||||
},
|
||||
rotate: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.rotate;
|
||||
},
|
||||
set(rotate) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { rotate } });
|
||||
}
|
||||
},
|
||||
rotateDegrees: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.rotateDegrees;
|
||||
},
|
||||
set(rotateDegrees) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { rotateDegrees } });
|
||||
}
|
||||
},
|
||||
boolNavi: {
|
||||
get() {
|
||||
return this.$store.state.gui.webcam.bool;
|
||||
},
|
||||
set(showNav) {
|
||||
return this.$store.dispatch('gui/setSettings', { webcam: { bool: showNav } });
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,25 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
import GeneralPanel from './GeneralPanel'
|
||||
import WebcamPanel from './WebcamPanel'
|
||||
import DashboardPanel from "./DashboardPanel";
|
||||
import MacrosPanel from "./MacrosPanel";
|
||||
import EndstopPanel from "./EndstopPanel";
|
||||
import LimitsPanel from "./LimitsPanel";
|
||||
import ConfigFilesPanel from "./ConfigFilesPanel";
|
||||
import RunoutPanel from "./RunoutPanel";
|
||||
import LogfilesPanel from "./LogfilesPanel";
|
||||
|
||||
Vue.component('settings-general-panel', GeneralPanel);
|
||||
Vue.component('settings-webcam-panel', WebcamPanel);
|
||||
Vue.component('settings-dashboard-panel', DashboardPanel);
|
||||
Vue.component('settings-macros-panel', MacrosPanel);
|
||||
Vue.component('settings-endstop-panel', EndstopPanel);
|
||||
Vue.component('settings-limits-panel', LimitsPanel);
|
||||
Vue.component('settings-runout-panel', RunoutPanel);
|
||||
Vue.component('settings-logfiles-panel', LogfilesPanel);
|
||||
Vue.component('settings-config-files-panel', ConfigFilesPanel);
|
||||
|
||||
export default {
|
||||
|
||||
}
|
||||
@@ -1,76 +1,130 @@
|
||||
<style>
|
||||
.vertical_align_center {
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
.statusPanel-image-preview {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.v-btn.minwidth-0 {
|
||||
min-width: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>fa-info</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">Status</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ toolhead !== null && 'status' in toolhead ? toolhead.status : "" }}</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
<v-btn class="orange" v-if="toolhead && toolhead.status === 'Printing'" @click="btnPauseJob" :loading="btnStatusPause">pause job</v-btn>
|
||||
<v-btn class="orange" v-if="(toolhead && toolhead.status === 'Ready') && is_paused" :loading="btnStatusResume" @click="btnResumeJob">resume job</v-btn>
|
||||
<v-btn class="red ml-2" v-if="(toolhead && toolhead.status === 'Ready') && is_paused" :loading="btnStatusCancel" @click="btnCancelJob">cancel job</v-btn>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2" ></v-divider>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading align-baseline">
|
||||
<v-icon left>mdi-information</v-icon>{{ (printer_state !== "" ? printer_state.charAt(0).toUpperCase() + printer_state.slice(1) : "Unknown") }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="printer_state === 'printing'" @click="btnPauseJob" :loading="loadings.includes('statusPrintPause')" title="Pause print"><v-icon small>mdi-pause</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="red" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintCancel')" @click="btnCancelJob" title="Cancel print"><v-icon small>mdi-stop</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'paused')" :loading="loadings.includes('statusPrintResume')" @click="btnResumeJob" title="Resume job"><v-icon small>mdi-play</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="orange" v-if="(printer_state === 'error')" :loading="loadings.includes('statusPrintClear')" @click="btnClearJob" title="Clear job"><v-icon small>mdi-close</v-icon></v-btn>
|
||||
<v-btn small class="px-2 minwidth-0" color="primary" v-if="(printer_state === 'complete')" :loading="loadings.includes('statusPrintReprint')" @click="btnReprintJob" title="Reprint job"><v-icon small>mdi-autorenew</v-icon></v-btn>
|
||||
</v-item-group>
|
||||
</v-toolbar>
|
||||
<v-row v-if="current_filename" class="mx-0">
|
||||
<v-col class="col-auto py-3 pr-0">
|
||||
<v-progress-circular
|
||||
:rotate="-90"
|
||||
:size="50"
|
||||
:width="7"
|
||||
:value="printPercent * 100"
|
||||
color="red"
|
||||
>
|
||||
</v-progress-circular>
|
||||
</v-col>
|
||||
<v-col class="col py-3" style="width: 100px;">
|
||||
<h3 class="font-weight-regular">{{ Math.round(printPercent * 100)+"%" }}{{ display_message ? " - "+display_message : "" }}</h3>
|
||||
<span class="subtitle-2 text-truncate d-block px-0 text--disabled"><v-icon small class="mr-1">mdi-file-outline</v-icon>{{ current_filename }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="mt-0 mb-0" ></v-divider>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-layout wrap class=" text-center">
|
||||
<v-flex col tag="strong" class="category-header">
|
||||
Position
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">X</v-flex>
|
||||
<v-flex tag="span">{{ position.length ? position[0].toFixed(2) : "--" }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">Y</v-flex>
|
||||
<v-flex tag="span">{{ position.length ? position[1].toFixed(2) : "--" }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">Z</v-flex>
|
||||
<v-flex tag="span">{{ position.length ? position[2].toFixed(2) : "--" }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-divider class="my-2" v-if="(toolhead && toolhead.status === 'Printing') || is_paused"></v-divider>
|
||||
<v-layout wrap class=" text-center" v-if="(toolhead && toolhead.status === 'Printing') || is_paused">
|
||||
<v-flex col tag="strong" class="category-header">
|
||||
Printstatus
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">printing</v-flex>
|
||||
<v-flex tag="span">{{ formatTime(toolhead.printing_time) }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">estimated</v-flex>
|
||||
<v-flex tag="span">{{ formatTime(print_time) }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex grow class="equal-width">
|
||||
<v-layout column>
|
||||
<v-flex tag="strong">total</v-flex>
|
||||
<v-flex tag="span">{{ formatTime(print_time + toolhead.printing_time) }}</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout wrap class=" text-center" v-if="(toolhead && toolhead.status === 'Printing') || is_paused">
|
||||
<v-layout column class="mt-2" >
|
||||
<v-progress-linear
|
||||
:value="printProgress * 100"
|
||||
height="25"
|
||||
>
|
||||
<template>
|
||||
<strong>{{ Math.ceil(printProgress * 100) }}%</strong>
|
||||
</template>
|
||||
</v-progress-linear>
|
||||
</v-layout>
|
||||
</v-layout>
|
||||
<v-row>
|
||||
<v-col
|
||||
class="col-12 col-sm-4 pl-sm-3 pt-0 pr-sm-0 pb-0"
|
||||
v-if="
|
||||
['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400)
|
||||
">
|
||||
<img
|
||||
class="statusPanel-image-preview"
|
||||
:src="'data:image/gif;base64,'+(current_file.thumbnails ? current_file.thumbnails.find(element => element.width === 400).data : '')"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
:class="
|
||||
(['printing', 'paused', 'complete'].includes(printer_state) &&
|
||||
current_file &&
|
||||
current_file.thumbnails &&
|
||||
current_file.thumbnails.length &&
|
||||
current_file.thumbnails.find(element => element.width === 400 || element.width === 300)) ? 'col-12 py-0 col-sm-8 pl-sm-0' : 'col-12 py-0'
|
||||
">
|
||||
<v-row class="text-center pt-2" align="center">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-axis-arrow</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>X</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[0].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Y</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[1].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Z</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ position.length ? position[2].toFixed(2) : "--" }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="my-2" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)"></v-divider>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'complete', 'error'].includes(printer_state)">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-poll</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ filament_used > 1000 ? (filament_used / 1000).toFixed(2)+"m" : filament_used.toFixed(2)+"mm" }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Print</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time) }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Total</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ formatTime(print_time_total) }}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="my-2" v-if="['printing', 'paused', 'error'].includes(printer_state)"></v-divider>
|
||||
<v-row class="text-center" align="center" v-if="['printing', 'paused', 'error'].includes(printer_state)">
|
||||
<v-col class="py-0 flex-grow-0 pl-8 pr-3">
|
||||
<v-icon>mdi-clock-outline</v-icon>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>File</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ print_time > 0 && printPercent > 0 ? formatTime(print_time / printPercent - print_time) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Filament</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ (filament_used > 0 && 'filament_total' in current_file && current_file.filament_total > filament_used) ? formatTime(print_time / (filament_used / current_file.filament_total) - print_time) : '--' }}</v-col></v-row>
|
||||
</v-col>
|
||||
<v-col class="equal-width py-0 pr-sm-6">
|
||||
<v-row><v-col class="px-0 py-0"><strong>Slicer</strong></v-col></v-row>
|
||||
<v-row><v-col class="px-0 py-0">{{ 'estimated_time' in current_file && current_file.estimated_time > print_time ? formatTime(current_file.estimated_time - print_time) : '--'}}</v-col></v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -79,41 +133,65 @@
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
progress: 0.15
|
||||
}),
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
toolhead: state => state.printer.toolhead,
|
||||
position: state => state.printer.toolhead.position,
|
||||
is_paused: state => state.printer.pause_resume.is_paused,
|
||||
btnStatusPause: state => state.socket.loadingPrintPause,
|
||||
btnStatusResume: state => state.socket.loadingPrintResume,
|
||||
btnStatusCancel: state => state.socket.loadingPrintCancel,
|
||||
|
||||
printProgress: state => state.printer.virtual_sdcard.progress,
|
||||
print_time: state => state.printer.idle_timeout.printing_time,
|
||||
file_position: state => state.printer.virtual_sdcard.file_position,
|
||||
current_file: state => state.printer.current_file,
|
||||
|
||||
print_time: state => state.printer.print_stats.print_duration,
|
||||
print_time_total: state => state.printer.print_stats.total_duration,
|
||||
filament_used: state => state.printer.print_stats.filament_used,
|
||||
current_filename: state => state.printer.print_stats.filename,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
|
||||
display_message: state => state.printer.display_status.message,
|
||||
loadings: state => state.socket.loadings,
|
||||
}),
|
||||
printPercent: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getPrintPercent"];
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
btnPauseJob() {
|
||||
this.$store.commit('setLoadingPrintPause', true);
|
||||
this.$socket.sendObj('post_printer_print_pause', { }, 'setLoadingPrintPause');
|
||||
this.$store.commit('socket/addLoading', { name: 'statusPrintPause' });
|
||||
this.$socket.sendObj('printer.print.pause', { }, 'socket/removeLoading', { name: 'statusPrintPause' });
|
||||
},
|
||||
btnResumeJob() {
|
||||
this.$store.commit('setLoadingPrintResume', true);
|
||||
this.$socket.sendObj('post_printer_print_resume', { }, 'setLoadingPrintResume');
|
||||
this.$store.commit('socket/addLoading', { name: 'statusPrintResume' });
|
||||
this.$socket.sendObj('printer.print.resume', { }, 'socket/removeLoading', { name: 'statusPrintResume' });
|
||||
},
|
||||
btnCancelJob() {
|
||||
this.$store.commit('setLoadingPrintCancel', true);
|
||||
this.$socket.sendObj('post_printer_print_cancel', { }, 'setLoadingPrintCancel');
|
||||
this.$store.commit('socket/addLoading', { name: 'statusPrintCancel' });
|
||||
this.$socket.sendObj('printer.print.cancel', { }, 'socket/removeLoading', { name: 'statusPrintCancel' });
|
||||
},
|
||||
btnClearJob() {
|
||||
this.$store.commit('socket/addLoading', {name: 'statusPrintClear'});
|
||||
this.$socket.sendObj('printer.gcode.script', {script: 'SDCARD_RESET_FILE'}, 'socket/removeLoading', { name: 'statusPrintClear' });
|
||||
},
|
||||
btnReprintJob() {
|
||||
this.$store.commit('socket/addLoading', {name: 'statusPrintReprint'});
|
||||
this.$socket.sendObj('printer.print.start', { filename: this.current_filename }, 'socket/removeLoading', { name: 'statusPrintReprint' });
|
||||
},
|
||||
formatTime(seconds) {
|
||||
let date = new Date(null);
|
||||
date.setSeconds(seconds);
|
||||
let h = Math.floor(seconds / 3600);
|
||||
seconds %= 3600;
|
||||
let m = ("0" + Math.floor(seconds / 60)).slice(-2);
|
||||
let s = ("0" + (seconds % 60).toFixed(0)).slice(-2);
|
||||
|
||||
return date.toISOString().substr(11,8);
|
||||
}
|
||||
},
|
||||
return h+':'+m+':'+s;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -142,4 +220,4 @@
|
||||
.probe-span:not(:last-child) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
@@ -1,58 +0,0 @@
|
||||
<template>
|
||||
<v-card>
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">Temperature Chart</v-list-item-title>
|
||||
<v-list-item-subtitle>buxdehude</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<line-chart :chart-data="chartdata" v-if="loaded"></line-chart>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LineChart from '../../charts/LineChart.js'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
LineChart
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
loaded: false,
|
||||
chartdata: {
|
||||
labels: [],
|
||||
datasets: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
labels: state => state.temperaturChart.labels,
|
||||
datasets: state => state.temperaturChart.datasets,
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
fillData () {
|
||||
this.loaded = true;
|
||||
this.chartdata = {
|
||||
labels: this.labels,
|
||||
datasets: this.datasets
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.fillData();
|
||||
},
|
||||
watch: {
|
||||
labels() {
|
||||
this.fillData();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,64 +2,136 @@
|
||||
.heater-row .vertical_align_center {
|
||||
margin: auto 0;
|
||||
}
|
||||
|
||||
#line-chart {
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.colHeaterIcons {
|
||||
width: 68px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>fa-thermometer-three-quarters</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">Heaters</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ heatersCount }} heaters</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-0 pt-0 pb-2 content">
|
||||
<v-row class="pl-3 pr-3">
|
||||
<v-col class="text-center"><b>Heater</b></v-col>
|
||||
<v-col class="text-center"><b>Current</b></v-col>
|
||||
<v-col class="text-center"><b>Target</b></v-col>
|
||||
<v-toolbar flat dense>
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-thermometer-lines</v-icon>Temperatures</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-2 content">
|
||||
<v-row align="center">
|
||||
<v-col class="py-0 font-weight-bold" style="padding-left: 68px;">Name</v-col>
|
||||
<v-col class="py-0 text-center font-weight-bold d-none d-sm-block">Status</v-col>
|
||||
<v-col class="py-0 text-center font-weight-bold">Current</v-col>
|
||||
<v-col class="text-center py-0 pr-8 font-weight-bold">Target</v-col>
|
||||
</v-row>
|
||||
<div v-for="(heater, index) in heaters" v-bind:key="index" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row class="pl-3 pr-3 heater-row">
|
||||
<v-col class="text-center">
|
||||
<b>{{ heater.name }}</b><br />
|
||||
<small>{{ heater.target > 0 ? "active" : "off" }}</small>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon :color="heater.color">mdi-{{ heater.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="text-center vertical_align_center"><span>{{ heater.temperature.toFixed(1) }}°C</span></v-col>
|
||||
<v-col class="text-center vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" ></toolInput>
|
||||
<v-col class="py-0 font-weight-bold">{{ heater.name }}</v-col>
|
||||
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ heater.target > 0 ? "active" : "off" }}</small></v-col>
|
||||
<v-col class="py-0 text-center">{{ heater.temperature ? heater.temperature.toFixed(1) : 0 }}°C</v-col>
|
||||
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="heater.name" :target="heater.target" :min_temp="heater.min_temp" :max_temp="heater.max_temp" command="SET_HEATER_TEMPERATURE" attribute-name="HEATER" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(fan, index) in this['printer/getTemperatureFans']" v-bind:key="index+99" >
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon :color="(fan.target ? 'grey lighten-5' : 'grey darken-2')" :class="(fan.speed ? ' icon-rotate' : '')">mdi-fan</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-0 font-weight-bold">{{ fan.name }}</v-col>
|
||||
<v-col class="py-0 text-center d-none d-sm-block"><small>{{ fan.target > 0 && fan.speed > 0 ? (fan.speed * 100).toFixed(0)+"%" : (fan.target > 0 ? "standby" : "off") }}</small></v-col>
|
||||
<v-col class="py-0 text-center">{{ fan.temperature ? fan.temperature.toFixed(1) : 0}}°C</v-col>
|
||||
<v-col class="text-center py-0 pr-8 pr-0 vertical_align_center">
|
||||
<toolInput :name="fan.name" :target="fan.target" command="SET_TEMPERATURE_FAN_TARGET" attribute-name="temperature_fan" ></toolInput>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<div v-for="(sensor,index) in this['printer/getTemperatureSensors']" v-bind:key="index+999">
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-row align="center">
|
||||
<v-col class="flex-grow-0 py-0 pl-8 pr-0 colHeaterIcons">
|
||||
<v-icon color="grey darken-2" :title="'min: '+sensor.min_temp+'° / max: '+sensor.max_temp+'°'">{{ sensor.icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-0 font-weight-bold">{{ sensor.name }}</v-col>
|
||||
<v-col class="py-0 d-none d-sm-block"><span> </span></v-col>
|
||||
<v-col class="py-0 text-center">
|
||||
<span style="cursor: default;" :title="'min: '+(sensor.measured_min_temp ? sensor.measured_min_temp.toFixed(1) : 0)+'° / max: '+(sensor.measured_max_temp ? sensor.measured_max_temp.toFixed(1) : 0)+'°'">{{ sensor.temperature ? sensor.temperature.toFixed(1) : 0 }}°C</span>
|
||||
</v-col>
|
||||
<v-col class="text-center py-0 pr-8 vertical_align_center"><span> </span></v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<v-divider class="my-2" v-if="boolTempchart"></v-divider>
|
||||
<v-row v-if="boolTempchart">
|
||||
<v-col class="px-8">
|
||||
<line-chart :chart-data="chartdata" v-if="loaded"></line-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { mapGetters, mapState } from 'vuex'
|
||||
import toolInput from '../../inputs/ToolInput'
|
||||
|
||||
import LineChart from '../../charts/LineChart.js'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
toolInput
|
||||
toolInput,
|
||||
LineChart
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
extruderTemps: [250,215,195,0]
|
||||
extruderTemps: [250,215,195,0],
|
||||
loaded: false,
|
||||
chartdata: {
|
||||
datasets: []
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
datasets: state => state.printer.tempHistory.datasets,
|
||||
boolTempchart: state => state.gui.dashboard.boolTempchart,
|
||||
}),
|
||||
...mapGetters([
|
||||
'heaters',
|
||||
'heatersCount'
|
||||
])
|
||||
'printer/getTemperatureFans',
|
||||
'printer/getTemperatureSensors',
|
||||
]),
|
||||
datasets: {
|
||||
get () {
|
||||
return this.$store.state.printer.tempHistory.datasets
|
||||
}
|
||||
},
|
||||
heaters: {
|
||||
get () {
|
||||
return this.$store.getters["printer/getHeaters"]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.chartdata = {
|
||||
datasets: this.datasets
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
this.loaded = true
|
||||
}, 1000)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<style>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card>
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon left>mdi-webcam</v-icon>Webcam</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text class="px-0 py-0 content">
|
||||
<img :src="webcamConfig.url" class="webcamImage" :style="webcamStyle" />
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
'webcamConfig': state => state.gui.webcam
|
||||
}),
|
||||
webcamStyle() {
|
||||
var transforms = '';
|
||||
if (this.webcamConfig.flipX) {
|
||||
transforms += ' scaleX(-1)'
|
||||
}
|
||||
if (this.webcamConfig.flipY) {
|
||||
transforms += ' scaleY(-1)'
|
||||
}
|
||||
if (this.webcamConfig.rotate && this.webcamConfig.rotateDegrees) {
|
||||
transforms += ` rotate(${this.webcamConfig.rotateDegrees}deg)`
|
||||
}
|
||||
if (transforms.trimLeft().length) {
|
||||
return {
|
||||
transform: transforms.trimLeft(),
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,83 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card v-if="(['printing', 'paused'].includes(printer_state))">
|
||||
<v-toolbar flat dense >
|
||||
<v-toolbar-title>
|
||||
<span class="subheading"><v-icon class="mdi mdi-arrow-collapse-vertical" left></v-icon>Z Baby Stepping</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card-text class="py-1">
|
||||
<v-row class="">
|
||||
<v-col class="col-12 pb-0 text-center">
|
||||
<p>Current Offset: {{ homing_origin.length > 1 ? homing_origin[2].toFixed(2) : 0.00 }}mm</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 pt-0 text-center d-flex flex-column align-center flex-sm-row justify-center">
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-last flex-nowrap order-sm-first" >
|
||||
<v-btn small @click="sendBabySteppingDownFine()" class="" :loading="loadings.includes('babySteppingDownFine')" ><v-icon small class="mr-2">mdi-arrow-collapse-down</v-icon> -0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingDown()" class="" :loading="loadings.includes('babySteppingDown')" >-0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
<v-btn-toggle dense no-gutters class="mx-2 mb-2 order-first flex-nowrap order-sm-last" >
|
||||
<v-btn small @click="sendBabySteppingUpFine()" class="" :loading="loadings.includes('babySteppingUpFine')" ><v-icon small class="mr-2">mdi-arrow-expand-up</v-icon> +0.01mm</v-btn>
|
||||
<v-btn small @click="sendBabySteppingUp()" class="" :loading="loadings.includes('babySteppingUp')" >+0.05mm</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
loadings: state => state.socket.loadings,
|
||||
homing_origin: state => state.printer.gcode_move.homing_origin,
|
||||
printer_state: state => state.printer.print_stats.state,
|
||||
homed_axis: state => state.printer.toolhead.homed_axes,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
sendBabySteppingDownFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingDownFine' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDownFine' });
|
||||
},
|
||||
sendBabySteppingDown() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=-0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingDown' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingDown' });
|
||||
},
|
||||
sendBabySteppingUpFine() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.01"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingUpFine' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUpFine' });
|
||||
},
|
||||
sendBabySteppingUp() {
|
||||
let gcode = "SET_GCODE_OFFSET Z_ADJUST=0.05"+(this.homed_axis === "xyz" ? " MOVE=1" : "");
|
||||
this.$store.commit('socket/addLoading', { name: 'babySteppingUp' });
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: gcode }, "socket/removeLoading", { name: 'babySteppingUp' });
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,13 +1,30 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
import StatusPanel from './StatusPanel.vue'
|
||||
import KlippyStatePanel from './KlippyStatePanel.vue'
|
||||
import MinSettingsPanel from './MinSettingsPanel.vue'
|
||||
import ToolsPanel from './ToolsPanel.vue'
|
||||
import TempchartPanel from './TempchartPanel.vue'
|
||||
import ControlPanel from "./ControlPanel";
|
||||
import ExtruderPanel from "./ExtruderPanel";
|
||||
import ZOffsetPanel from "./ZOffsetPanel";
|
||||
import Peripherie from "./PeripheriePanel";
|
||||
import WebcamPanel from "./WebcamPanel";
|
||||
import MiniconsolePanel from "./MiniconsolePanel";
|
||||
import Settings from "./Settings/";
|
||||
import PowerControlPanel from "./PowerControlPanel.vue";
|
||||
|
||||
Vue.component('status-panel', StatusPanel);
|
||||
Vue.component('klippy-state-panel', KlippyStatePanel);
|
||||
Vue.component('min-settings-panel', MinSettingsPanel);
|
||||
Vue.component('tools-panel', ToolsPanel);
|
||||
Vue.component('tempchart-panel', TempchartPanel);
|
||||
Vue.component('control-panel', ControlPanel);
|
||||
Vue.component('extruder-panel', ExtruderPanel);
|
||||
Vue.component('zoffset-panel', ZOffsetPanel);
|
||||
Vue.component('peripherie-panel', Peripherie);
|
||||
Vue.component('webcam-panel', WebcamPanel);
|
||||
Vue.component('miniconsole-panel', MiniconsolePanel);
|
||||
Vue.component('power-control-panel', PowerControlPanel);
|
||||
|
||||
export default {
|
||||
StatusPanel,
|
||||
Settings
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
<style>
|
||||
._fan-slider-subheader {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col :class="controllable ? 'pb-1 pt-3' : 'py-2'">
|
||||
<v-subheader class="_fan-slider-subheader">
|
||||
<span>{{ convertName }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ Math.round(value) }} %</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0" v-if="controllable">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="0"
|
||||
:max="100"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: ''
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
controllable: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
multi: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
convertName() {
|
||||
let tmp = this.name;
|
||||
tmp = tmp.replaceAll("_", " ");
|
||||
tmp = tmp.charAt(0).toUpperCase() + tmp.slice(1);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = "";
|
||||
|
||||
if (this.type === "fan") gcode = "M106 S"+(this.value * 2.55).toFixed(0);
|
||||
if (this.type === "fan_generic") gcode = "SET_FAN_SPEED FAN="+this.name+" SPEED="+(this.value/100);
|
||||
|
||||
if (gcode !== "") {
|
||||
this.$store.commit('server/addEvent', gcode);
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode });
|
||||
}
|
||||
},
|
||||
decrement() {
|
||||
this.value = this.value > 0 ? (this.value - 1).toFixed(0) : 0;
|
||||
this.sendCmd();
|
||||
},
|
||||
increment() {
|
||||
this.value = this.value < 100 ? (this.value + 1).toFixed(0) : 100;
|
||||
this.sendCmd();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal * this.multi;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<style>
|
||||
.settings_macro_switch .v-messages {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-switch v-model="value" :label="name.toUpperCase()" @change="setValue" class="settings_macro_switch mt-0"></v-switch>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: false
|
||||
}
|
||||
},
|
||||
props: {
|
||||
name: String,
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
hiddenMacros: state => state.gui.dashboard.hiddenMacros
|
||||
}),
|
||||
},
|
||||
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())
|
||||
|
||||
this.$store.dispatch("gui/upload")
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
hiddenMacros: function() {
|
||||
this.value = !this.hiddenMacros.includes(this.name.toUpperCase())
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.value = !this.hiddenMacros.includes(this.name.toUpperCase())
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,51 @@
|
||||
<style>
|
||||
.settingsRunoutSwitchInput .v-messages {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-row class="px-6" >
|
||||
<v-col sm-12>
|
||||
<v-switch v-model="value" :label="enabled ? 'enabled' : 'disabled'" @change="changeSensor()" class="settingsRunoutSwitchInput my-0"></v-switch>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="px-6" v-if="value" >
|
||||
<v-col sm-12>
|
||||
<label class="mt-1 d-inline-block">Filament:</label>
|
||||
<v-chip class="float-right" :color="filament_detected ? 'green' : 'red' " text-color="white">{{ filament_detected ? 'detected' : 'empty' }}</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: false,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
name: String,
|
||||
enabled: Boolean,
|
||||
filament_detected: Boolean,
|
||||
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
changeSensor() {
|
||||
let gcode = 'SET_FILAMENT_SENSOR SENSOR='+this.name+' ENABLE='+(this.value ? 1 : 0)
|
||||
this.$store.commit('server/addEvent', gcode)
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.value = this.enabled
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -7,15 +7,26 @@
|
||||
|
||||
.tool-input .v-input__slot { margin-bottom: 0; }
|
||||
.tool-input .v-text-field__details { display: none; }
|
||||
|
||||
.tool-input input {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.tool-input input::-webkit-outer-spin-button,
|
||||
.tool-input input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-text-field type="number" min="-273" max="1999" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps">
|
||||
<v-text-field type="number" min="0" :max="max_temp" step="any" ref="toolField" v-model="value" class="tool-input" @change="setTemps" onClick="this.select();">
|
||||
</v-text-field>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
@@ -25,13 +36,23 @@
|
||||
props: {
|
||||
name: String,
|
||||
target: Number,
|
||||
min_temp: Number,
|
||||
max_temp: Number,
|
||||
command: String,
|
||||
attributeName: String,
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
setTemps() {
|
||||
this.$socket.sendObj('post_printer_gcode', {script: 'SET_HEATER_TEMPERATURE HEATER='+this.name+' TARGET='+this.value});
|
||||
if (this.max_temp !== undefined && this.value > this.max_temp) {
|
||||
this.value = this.target;
|
||||
Vue.$toast.error("Temperature too high for "+this.name+"! (max: "+this.max_temp+")");
|
||||
} else if (this.min_temp !== undefined && this.value < this.min_temp && parseFloat(this.value) !== 0) {
|
||||
this.value = this.target;
|
||||
Vue.$toast.error("Temperature too low for "+this.name+"! (min: "+this.min_temp+")");
|
||||
} else this.$socket.sendObj('printer.gcode.script', { script: this.command+' '+this.attributeName+'='+this.name+' TARGET='+this.value });
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
<style>
|
||||
._tool-slider-subheader {
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="pb-1 pt-3">
|
||||
<v-subheader class="_tool-slider-subheader">
|
||||
<span>{{ label }}</span>
|
||||
<v-spacer></v-spacer>
|
||||
<span class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
</v-subheader>
|
||||
<v-card-text class="py-0">
|
||||
<v-slider
|
||||
v-model="value"
|
||||
:min="min"
|
||||
:max="max"
|
||||
@change="sendCmd"
|
||||
hide-details>
|
||||
|
||||
<template v-slot:prepend>
|
||||
<v-icon @click="decrement">mdi-minus</v-icon>
|
||||
</template>
|
||||
|
||||
<template v-slot:append>
|
||||
<v-icon @click="increment">mdi-plus</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function() {
|
||||
return {
|
||||
value: this.target * this.multi,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
target: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
command: {
|
||||
required: true,
|
||||
},
|
||||
attributeName: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: ''
|
||||
},
|
||||
unit: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '%'
|
||||
},
|
||||
attributeScale: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
min: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 0
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 100
|
||||
},
|
||||
step: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
multi: {
|
||||
type: Number,
|
||||
required: false,
|
||||
default: 1
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
sendCmd() {
|
||||
let gcode = this.command+' '+this.attributeName+(this.value*this.attributeScale).toFixed(0)
|
||||
this.$store.commit('server/addEvent', gcode)
|
||||
this.$socket.sendObj('printer.gcode.script', { script: gcode })
|
||||
},
|
||||
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();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
target: function(newVal) {
|
||||
this.value = newVal * this.multi;
|
||||
},
|
||||
},
|
||||
created: function() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,17 +1,12 @@
|
||||
import Vue from 'vue'
|
||||
import JRPCWS from './plugins/json-rpc-websocket'
|
||||
import WebSocketClient from './plugins/wsClient'
|
||||
import App from './App.vue'
|
||||
import vuetify from './plugins/vuetify'
|
||||
import VueResource from 'vue-resource'
|
||||
import './components'
|
||||
import store from './store'
|
||||
import router from './plugins/router'
|
||||
import { hostname } from './store/variables'
|
||||
import 'vue-toast-notification/dist/index.css';
|
||||
|
||||
Vue.use(JRPCWS, 'ws://' + hostname + '/websocket', {
|
||||
store: store
|
||||
});
|
||||
import vueHeadful from 'vue-headful';
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
|
||||
@@ -22,9 +17,33 @@ Vue.http.headers.common['Accept'] = 'application/json, text/plain, */*';
|
||||
Vue.http.headers.common['Access-Control-Allow-Headers'] = 'Origin, Accept, Content-Type, Authorization, Access-Control-Allow-Origin';
|
||||
Vue.http.headers.common['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS, DELETE, OPTIONS';
|
||||
|
||||
new Vue({
|
||||
vuetify,
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
Vue.component('vue-headful', vueHeadful);
|
||||
|
||||
fetch('/config.json')
|
||||
.then(res => res.json())
|
||||
.then(file => {
|
||||
store.commit('socket/setData', file);
|
||||
|
||||
const websocketProtocol = document.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
||||
const socketClient = new WebSocketClient(websocketProtocol + store.state.socket.hostname + ':' + store.state.socket.port + '/websocket', {
|
||||
store: store,
|
||||
reconnectEnabled: true,
|
||||
reconnectInterval: store.state.socket.reconnectInterval,
|
||||
});
|
||||
socketClient.connect();
|
||||
Vue.prototype.$socket = socketClient;
|
||||
|
||||
new Vue({
|
||||
vuetify,
|
||||
router,
|
||||
store,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
})
|
||||
.catch((error) => {
|
||||
let p = document.createElement("p");
|
||||
let content = document.createTextNode("config.json not found or cannot be decoded!");
|
||||
p.appendChild(content);
|
||||
document.getElementById('app').append(p);
|
||||
window.console.error('Error:', error);
|
||||
});
|
||||
@@ -15,12 +15,15 @@
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.log-cell {
|
||||
padding: 16px !important;
|
||||
}
|
||||
|
||||
.log-cell.title-cell {
|
||||
vertical-align: top;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.log-cell.content-cell {
|
||||
vertical-align: top;
|
||||
min-height: auto;
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -29,11 +32,17 @@
|
||||
<v-row>
|
||||
<v-col class="col">
|
||||
<v-text-field
|
||||
v-model="gcode"
|
||||
label="Send code..."
|
||||
solo
|
||||
class="gcode-command-field"
|
||||
v-on:keyup.enter="doSend"
|
||||
v-model="gcode"
|
||||
:items="items"
|
||||
label="Send code..."
|
||||
solo
|
||||
class="gcode-command-field"
|
||||
ref="gcodeCommandField"
|
||||
autocomplete="off"
|
||||
v-on:keyup.enter="doSend"
|
||||
v-on:keyup.up="onKeyUp"
|
||||
v-on:keyup.down="onKeyDown"
|
||||
v-on:keydown.tab="getAutocomplete"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
@@ -49,12 +58,12 @@
|
||||
:headers="headers"
|
||||
:options="options"
|
||||
:sort-by.sync="sortBy"
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items="events"
|
||||
item-key="date"
|
||||
hide-default-footer
|
||||
disable-pagination
|
||||
class="event-table"
|
||||
:custom-sort="customSort"
|
||||
>
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
@@ -62,10 +71,10 @@
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr>
|
||||
<td class="log-cell title-cell">
|
||||
<td class="log-cell title-cell py-2 flex-grow-0 pr-0">
|
||||
{{ item.date.toLocaleString() }}
|
||||
</td>
|
||||
<td class="log-cell content-cell" colspan="2">
|
||||
<td class="log-cell content-cell py-2" colspan="2">
|
||||
<span v-if="item.message" class="message" v-html="formatMessage(item.message)"></span>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -76,19 +85,20 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import Vue from "vue";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
gcode: "",
|
||||
sortBy: 'date',
|
||||
sortDesc: true,
|
||||
headers: [
|
||||
{
|
||||
text: 'Date',
|
||||
value: 'date',
|
||||
width: '15%'
|
||||
width: '15%',
|
||||
dateType: 'Date',
|
||||
},
|
||||
{
|
||||
text: 'Event',
|
||||
@@ -99,31 +109,95 @@
|
||||
],
|
||||
options: {
|
||||
|
||||
}
|
||||
},
|
||||
lastCommands: [
|
||||
|
||||
],
|
||||
lastCommandNumber: null,
|
||||
items: [],
|
||||
loadingSendGcode: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
events: state => state.events,
|
||||
events: state => state.server.events,
|
||||
helplist: state => state.printer.helplist,
|
||||
loadings: state => state.loadings,
|
||||
}),
|
||||
loadingSendGcode: {
|
||||
get() {
|
||||
return this.$store.state.socket.loadingSendGcode
|
||||
},
|
||||
set(value) {
|
||||
return this.$store.dispatch('setLoadingSendGcode', value)
|
||||
}
|
||||
}
|
||||
...mapGetters([
|
||||
'getMacros'
|
||||
]),
|
||||
},
|
||||
methods: {
|
||||
doSend() {
|
||||
this.loadingSendGcode = true;
|
||||
this.$socket.sendObj('post_printer_gcode', { script: this.gcode }, "sendGcode");
|
||||
//this.$store.commit('setLoading', { name: 'loadingSendGcode' });
|
||||
this.$store.commit('server/addEvent', this.gcode);
|
||||
Vue.prototype.$socket.sendObj('printer.gcode.script', { script: this.gcode }, "server/getGcodeRespond");
|
||||
this.lastCommands.push(this.gcode);
|
||||
this.gcode = "";
|
||||
this.lastCommandNumber = null;
|
||||
},
|
||||
formatMessage(message) {
|
||||
message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||
if (typeof message === "string") message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
||||
|
||||
return message;
|
||||
},
|
||||
onKeyUp() {
|
||||
if (this.lastCommandNumber === null && this.lastCommands.length) {
|
||||
this.lastCommandNumber = this.lastCommands.length - 1;
|
||||
this.gcode = this.lastCommands[this.lastCommandNumber];
|
||||
} else if (this.lastCommandNumber > 0) {
|
||||
this.lastCommandNumber--;
|
||||
this.gcode = this.lastCommands[this.lastCommandNumber];
|
||||
}
|
||||
},
|
||||
onKeyDown() {
|
||||
if (this.lastCommandNumber !== null && this.lastCommandNumber < (this.lastCommands.length - 1)) {
|
||||
this.lastCommandNumber++;
|
||||
this.gcode = this.lastCommands[this.lastCommandNumber];
|
||||
} else if (this.lastCommandNumber !== null && this.lastCommandNumber === (this.lastCommands.length - 1)) {
|
||||
this.lastCommandNumber = null;
|
||||
this.gcode = "";
|
||||
}
|
||||
},
|
||||
getAutocomplete(e) {
|
||||
e.preventDefault();
|
||||
if (this.gcode.length) {
|
||||
let commands = this.helplist.filter((element) => element.commandLow.indexOf(this.gcode.toLowerCase()) === 0);
|
||||
if (commands && commands.length === 1) this.gcode = commands[0].command;
|
||||
else {
|
||||
let commands = this.helplist.filter((element) => element.commandLow.includes(this.gcode.toLowerCase()));
|
||||
if (commands && commands.length) {
|
||||
let output = "";
|
||||
commands.forEach(command => output += "<b>"+command.command+":</b> "+command.description+"<br />");
|
||||
|
||||
this.$store.commit('server/addEvent', output);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.gcodeCommandField.focus();
|
||||
},
|
||||
customSort: function(items, index, isDesc) {
|
||||
items.sort((a, b) => {
|
||||
if (index[0] === 'date') {
|
||||
if (!isDesc[0]) return new Date(b[index]) - new Date(a[index]);
|
||||
else return new Date(a[index]) - new Date(b[index]);
|
||||
} else {
|
||||
if(typeof a[index] !== 'undefined'){
|
||||
if (!isDesc[0]) return a[index].toLowerCase().localeCompare(b[index].toLowerCase());
|
||||
else return b[index].toLowerCase().localeCompare(a[index].toLowerCase());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return items;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
loadings: {
|
||||
handler: function(newVal) {
|
||||
this.loadingSendGcode = newVal.includes('loadingSendGcode');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,52 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col xs12 sm6 md4>
|
||||
<status-panel></status-panel>
|
||||
<div class="mt-6">
|
||||
<tools-panel></tools-panel>
|
||||
</div>
|
||||
<v-col class="col-sm-12 col-md-5">
|
||||
<min-settings-panel v-if="klippy_state === 'ready' && existsPrinterConfig"></min-settings-panel>
|
||||
<status-panel v-if="klippy_state === 'ready'"></status-panel>
|
||||
<klippy-state-panel v-if="socket_connected && klippy_state !== 'ready'"></klippy-state-panel>
|
||||
<webcam-panel v-if="showDashboardWebcam" class="mt-6"></webcam-panel>
|
||||
<z-offset-panel class="mt-6" v-if="klippy_state === 'ready'"></z-offset-panel>
|
||||
<control-panel class="mt-6" v-if="klippy_state === 'ready'"></control-panel>
|
||||
<extruder-panel class="mt-6" v-if="klippy_state === 'ready'"></extruder-panel>
|
||||
<peripherie-panel class="mt-6" v-if="klippy_state === 'ready'"></peripherie-panel>
|
||||
<power-control-panel class="mt-6" v-if="countPowerDevices > 0"></power-control-panel>
|
||||
</v-col>
|
||||
<v-col xs12 sm6 md8>
|
||||
<tempchart-panel></tempchart-panel>
|
||||
<v-col class="col-sm-12 col-md-7">
|
||||
<tools-panel v-if="socket_connected && klippy_connected"></tools-panel>
|
||||
<miniconsole-panel class="mt-6" v-if="klippy_state === 'ready' && showDashboardConsole"></miniconsole-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
import { mapState } from 'vuex'
|
||||
import ZOffsetPanel from "../components/panels/ZOffsetPanel";
|
||||
|
||||
export default {
|
||||
components: { ZOffsetPanel },
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
...mapState({
|
||||
socket_connected: state => state.socket.isConnected,
|
||||
klippy_connected: state => state.server.klippy_connected,
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
|
||||
showDashboardWebcam: state => state.gui.dashboard.boolWebcam,
|
||||
showDashboardConsole: state => state.gui.dashboard.boolConsole,
|
||||
config: state => state.printer.configfile.config,
|
||||
}),
|
||||
countPowerDevices: {
|
||||
get() {
|
||||
return this.$store.getters["server/power/count"]
|
||||
}
|
||||
},
|
||||
existsPrinterConfig: {
|
||||
get() {
|
||||
return this.$store.getters["printer/existPrinterConfig"]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@@ -1,190 +1,669 @@
|
||||
<style>
|
||||
.v-data-table .v-data-table-header__icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.v-data-table th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.v-data-table .file-list-cursor:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fileupload-card {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dragzone {
|
||||
display: table;
|
||||
position: absolute;
|
||||
top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
z-index: 9999999999;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
transition: visibility 175ms, opacity 175ms;
|
||||
font: bold 42px Oswald, DejaVu Sans, Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
.dragzone:before {
|
||||
display: block;
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
top: 15px; right: 15px; bottom: 15px; left: 15px;
|
||||
border: 3px dashed white;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.dragzone .textnode {
|
||||
display: table-cell;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
transition: font-size 175ms;
|
||||
}
|
||||
|
||||
.minHeight36 {
|
||||
min-height: 36px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card>
|
||||
<v-card class="fileupload-card my-3" @dragover="dragOverUpload" @dragleave="dragLeaveUpload" @drop.prevent.stop="dragDropUpload">
|
||||
<v-card-title>
|
||||
G-Code Files
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn :loading="loadingRefresh" @click="refreshFileList"><v-icon class="mr-1">mdi-refresh</v-icon> Refresh</v-btn>
|
||||
<input type="file" ref="fileUpload" style="display: none" @change="uploadFile" />
|
||||
<v-btn color="primary ml-4 " v-if="printStatus == 'Ready'" :loading="loadingUpload" @click="clickUploadButton"><v-icon>mdi-upload</v-icon>Upload</v-btn>
|
||||
<v-item-group class="v-btn-toggle" name="controllers">
|
||||
<v-btn @click="clickUploadButton" title="Upload new Gcode" class="primary" :loading="loadings.includes('gcodeUpload')"><v-icon>mdi-upload</v-icon></v-btn>
|
||||
<v-btn @click="createDirectory" title="Create new Directory"><v-icon>mdi-folder-plus</v-icon></v-btn>
|
||||
<v-btn @click="refreshFileList" title="Refresh current Directory"><v-icon>mdi-refresh</v-icon></v-btn>
|
||||
<v-menu :offset-y="true" title="Setup current list">
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<v-btn class="" 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" 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">
|
||||
<v-checkbox class="mt-0" hide-details v-model="header.visible" @change="changeMetadataVisible(header.value)" :label="header.text"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-item-group>
|
||||
</v-card-title>
|
||||
<v-card-subtitle>Current path: {{ this.currentPath !== 'gcodes' ? "/"+this.currentPath.substring(7) : "/" }}</v-card-subtitle>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
append-icon="mdi-magnify"
|
||||
label="Search"
|
||||
single-line
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:options="options"
|
||||
:sort-by.sync="sortBy"
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items="files"
|
||||
item-key="date"
|
||||
class="files-table"
|
||||
>
|
||||
:items="files"
|
||||
class="files-table"
|
||||
:headers="filteredHeaders"
|
||||
:options="options"
|
||||
:custom-sort="sortFiles"
|
||||
:sort-by.sync="sortBy"
|
||||
:sort-desc.sync="sortDesc"
|
||||
:items-per-page.sync="countPerPage"
|
||||
item-key="name"
|
||||
:search="search"
|
||||
:custom-filter="advancedSearch"
|
||||
@pagination="refreshMetadata">
|
||||
|
||||
<template slot="items" slot-scope="props">
|
||||
<td v-for="header in filteredHeaders" v-bind:key="header.text">{{ props.item[header.value] }}</td>
|
||||
</template>
|
||||
|
||||
<template #no-data>
|
||||
<div class="text-center">empty</div>
|
||||
</template>
|
||||
|
||||
<template slot="body.prepend" v-if="(currentPath !== 'gcodes')">
|
||||
<tr
|
||||
class="file-list-cursor"
|
||||
@click="clickRowGoBack"
|
||||
@dragover="dragOverFilelist($event, {isDirectory: true, filename: '..'})" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, {isDirectory: true, filename: '..'})"
|
||||
>
|
||||
<td class=" "><v-icon>mdi-folder-upload</v-icon></td>
|
||||
<td class=" " colspan="8">..</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<tr @contextmenu="showContextMenu($event, item)" @click="dialog.show = true, dialog.filename = item.filename">
|
||||
<td class=" ">
|
||||
{{ item.filename }}
|
||||
</td>
|
||||
<td class=" ">
|
||||
{{ formatFilesize(item.size) }}
|
||||
</td>
|
||||
<td class="text-end ">
|
||||
{{ formatDate(item.modified) }}
|
||||
<tr
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)"
|
||||
class="file-list-cursor"
|
||||
draggable="true"
|
||||
@drag="dragFile($event, item)"
|
||||
@dragend="dragendFile($event)"
|
||||
@dragover="dragOverFilelist($event, item)" @dragleave="dragLeaveFilelist" @drop.prevent.stop="dragDropFilelist($event, item)"
|
||||
:data-name="item.filename"
|
||||
>
|
||||
<td class="pr-0" style="width: 32px;">
|
||||
<v-icon v-if="item.isDirectory">mdi-folder</v-icon>
|
||||
<v-icon v-if="!item.isDirectory && !(item.thumbnails && item.thumbnails.length > 0)">mdi-file</v-icon>
|
||||
<img v-if="!item.isDirectory && item.thumbnails && item.thumbnails.length > 0" :src="'data:image/gif;base64,'+(item.thumbnails.length ? item.thumbnails[0].data : '--')" />
|
||||
</td>
|
||||
<td class=" ">{{ item.filename }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'size')[0].visible">{{ item.isDirectory ? '--' : formatFilesize(item.size) }}</td>
|
||||
<td class="text-right" v-if="headers.filter(header => header.value === 'modified')[0].visible">{{ formatDate(item.modified) }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'object_height')[0].visible">{{ item.object_height ? item.object_height.toFixed(2)+' mm' : '--' }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'layer_height')[0].visible">{{ item.layer_height ? item.layer_height.toFixed(2)+' mm' : '--' }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'filament_total')[0].visible">{{ item.filament_total ? item.filament_total.toFixed()+' mm' : '--' }}</td>
|
||||
<td class="text-no-wrap text-right" v-if="headers.filter(header => header.value === 'estimated_time')[0].visible">{{ formatPrintTime(item.estimated_time) }}</td>
|
||||
<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-table>
|
||||
<div class="dragzone" :style="'visibility: '+dropzone.visibility+'; opacity: '+dropzone.hidden">
|
||||
<div class="textnode">Drop files to add gcode.</div>
|
||||
</div>
|
||||
</v-card>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<!--<v-list-item>
|
||||
<v-list-item @click="clickRow(contextMenu.item)" :disabled="is_printing" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-play</v-icon> Print start
|
||||
</v-list-item>
|
||||
<v-list-item @click="downloadFile" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-cloud-download</v-icon> Download
|
||||
</v-list-item>-->
|
||||
<v-list-item @click="removeFile">
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameDirectory(contextMenu.item)" v-if="contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
</v-list-item>
|
||||
<v-list-item @click="renameFile(contextMenu.item)" v-if="!contextMenu.item.isDirectory">
|
||||
<v-icon class="mr-1">mdi-rename-box</v-icon> Rename
|
||||
</v-list-item>
|
||||
<v-list-item @click="removeFile" v-if="!contextMenu.item.isDirectory">
|
||||
<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> Delete
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialog.show" max-width="400">
|
||||
<v-dialog v-model="dialogPrintFile.show" max-width="400">
|
||||
<v-card>
|
||||
<v-img
|
||||
contain
|
||||
v-if="dialogPrintFile.item.thumbnails && dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400)"
|
||||
:src="'data:image/gif;base64,'+(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 300 || element.width === 400).data : '')"
|
||||
:height="(dialogPrintFile.item.thumbnails ? dialogPrintFile.item.thumbnails.find(element => element.width === 400 || element.width === 300).height : '')+'px'"
|
||||
></v-img>
|
||||
<v-card-title class="headline">Start Job</v-card-title>
|
||||
<v-card-text>Do you want to start {{ dialog.filename }}?</v-card-text>
|
||||
<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="dialog.show = false">No</v-btn>
|
||||
<v-btn color="green darken-1" text @click="startPrint(dialog.filename)">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">New Directory</v-card-title>
|
||||
<v-card-text>
|
||||
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">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">Rename File</v-card-title>
|
||||
<v-card-text>
|
||||
<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">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">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">Cancel</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">rename</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import axios from 'axios';
|
||||
import { hostname } from '../store/variables';
|
||||
import { findDirectory } from "@/plugins/helpers";
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
search: '',
|
||||
sortBy: 'modified',
|
||||
sortDesc: true,
|
||||
dialog: {
|
||||
selected: [],
|
||||
hideHeaderColums: [],
|
||||
dialogPrintFile: {
|
||||
show: false,
|
||||
filename: ""
|
||||
item: {}
|
||||
},
|
||||
dialogCreateDirectory: {
|
||||
show: false,
|
||||
name: ""
|
||||
},
|
||||
dialogRenameFile: {
|
||||
show: false,
|
||||
newName: "",
|
||||
item: {}
|
||||
},
|
||||
dialogRenameDirectory: {
|
||||
show: false,
|
||||
newName: "",
|
||||
item: {}
|
||||
},
|
||||
headers: [
|
||||
{
|
||||
text: 'Name',
|
||||
value: 'filename',
|
||||
width: '50%'
|
||||
},
|
||||
{
|
||||
text: 'Filesize',
|
||||
value: 'size',
|
||||
},
|
||||
{
|
||||
text: 'last modified',
|
||||
value: 'modified',
|
||||
align: 'end',
|
||||
},
|
||||
{ text: '', value: '', align: 'left', configable: false, 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: {
|
||||
|
||||
},
|
||||
contextMenu: {
|
||||
shown: false,
|
||||
isDirectory: false,
|
||||
touchTimer: undefined,
|
||||
x: 0,
|
||||
y: 0,
|
||||
item: {}
|
||||
},
|
||||
dropzone: {
|
||||
visibility: 'hidden',
|
||||
opacity: 0,
|
||||
},
|
||||
files: [],
|
||||
currentPath: 'gcodes',
|
||||
draggingFile: {
|
||||
status: false,
|
||||
item: {}
|
||||
},
|
||||
input_rules: [
|
||||
value => value.indexOf(" ") === -1 || 'Name contain spaces!'
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
files: state => state.files,
|
||||
loadingUpload: state => state.socket.loadingGcodeUpload,
|
||||
loadingRefresh: state => state.socket.loadingGcodeRefresh,
|
||||
printStatus: state => state.printer.toolhead.status,
|
||||
})
|
||||
filetree: state => state.files.filetree,
|
||||
hostname: state => state.socket.hostname,
|
||||
port: state => state.socket.port,
|
||||
loadings: state => state.socket.loadings,
|
||||
|
||||
displayMetadata: state => state.gui.gcodefiles.showMetadata,
|
||||
}),
|
||||
...mapGetters([
|
||||
'is_printing'
|
||||
]),
|
||||
configHeaders() {
|
||||
return this.headers.filter(header => header.configable === true);
|
||||
},
|
||||
filteredHeaders() {
|
||||
return this.headers.filter(header => header.visible === true);
|
||||
},
|
||||
showHiddenFiles: {
|
||||
get: function() {
|
||||
return this.$store.state.gui.gcodefiles.showHiddenFiles;
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { gcodefiles: { showHiddenFiles: newVal } });
|
||||
}
|
||||
},
|
||||
countPerPage: {
|
||||
get: function() {
|
||||
return this.$store.state.gui.gcodefiles.countPerPage
|
||||
},
|
||||
set: function(newVal) {
|
||||
return this.$store.dispatch("gui/setSettings", { gcodefiles: { countPerPage: newVal } });
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.loadPath()
|
||||
},
|
||||
methods: {
|
||||
uploadFile: function() {
|
||||
if (this.$refs.fileUpload.files.length) {
|
||||
let toast = this.$toast;
|
||||
let file = this.$refs.fileUpload.files[0];
|
||||
let formData = new FormData();
|
||||
formData.append('file', file);
|
||||
this.$store.commit('setLoadingGcodeUpload', true);
|
||||
|
||||
axios.post('http://' + hostname + '/printer/files/upload',
|
||||
formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}
|
||||
).then((result) => {
|
||||
this.$store.commit('setLoadingGcodeUpload', false);
|
||||
toast.success("Upload of "+result.data.result+" successful!", {
|
||||
icon: 'fa-check'
|
||||
});
|
||||
this.doUploadFile(this.$refs.fileUpload.files[0]).finally(() => {
|
||||
this.$refs.fileUpload.value = ''
|
||||
})
|
||||
.catch(() => {
|
||||
this.$store.commit('setLoadingGcodeUpload', false);
|
||||
toast.error("Cannot upload the file!", {
|
||||
icon: 'fa-exclamation-triangle'
|
||||
});
|
||||
}
|
||||
},
|
||||
doUploadFile: function(file) {
|
||||
let toast = this.$toast;
|
||||
let formData = new FormData();
|
||||
let filename = file.name.replace(" ", "_");
|
||||
|
||||
formData.append('file', file, (this.currentPath+"/"+filename).substring(7));
|
||||
this.$store.commit('socket/addLoading', { name: 'gcodeUpload' });
|
||||
|
||||
return axios.post('//' + this.hostname + ':' + this.port + '/server/files/upload',
|
||||
formData, { headers: { 'Content-Type': 'multipart/form-data' } }
|
||||
).then((result) => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' });
|
||||
toast.success("Upload of "+result.data.result+" successful!");
|
||||
}).catch(() => {
|
||||
this.$store.commit('socket/removeLoading', { name: 'gcodeUpload' });
|
||||
toast.error("Cannot upload the file!");
|
||||
});
|
||||
},
|
||||
clickUploadButton: function() {
|
||||
this.$refs.fileUpload.click()
|
||||
},
|
||||
refreshFileList: function() {
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'files/getDirectory')
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date)
|
||||
|
||||
return tmp2.toLocaleString().replace(',', '')
|
||||
},
|
||||
formatFilesize(fileSizeInBytes) {
|
||||
let i = -1
|
||||
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB']
|
||||
do {
|
||||
fileSizeInBytes = fileSizeInBytes / 1024
|
||||
i++
|
||||
} while (fileSizeInBytes > 1024)
|
||||
|
||||
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i]
|
||||
},
|
||||
formatPrintTime(totalSeconds) {
|
||||
if (totalSeconds) {
|
||||
let output = ""
|
||||
|
||||
let days = Math.floor(totalSeconds / (3600 * 24))
|
||||
if (days) {
|
||||
totalSeconds %= (3600 * 24)
|
||||
output += days+"d"
|
||||
}
|
||||
|
||||
let hours = Math.floor(totalSeconds / 3600)
|
||||
totalSeconds %= 3600
|
||||
if (hours) output += " "+hours+"h"
|
||||
|
||||
let minutes = Math.floor(totalSeconds / 60)
|
||||
if (minutes) output += " "+minutes+"m"
|
||||
|
||||
let seconds = totalSeconds % 60
|
||||
if (seconds) output += " "+seconds.toFixed(0)+"s"
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
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 })
|
||||
},
|
||||
downloadFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
let link = document.createElement("a");
|
||||
link.download = name;
|
||||
link.href = '//' + this.hostname + ':' + this.port + '/server/files/' + encodeURI(filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
renameFile(item) {
|
||||
this.dialogRenameFile.item = item;
|
||||
this.dialogRenameFile.newName = item.filename;
|
||||
this.dialogRenameFile.show = true;
|
||||
},
|
||||
renameFileAction() {
|
||||
this.dialogRenameFile.show = false;
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameFile.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameFile.newName
|
||||
}, 'files/getMove');
|
||||
},
|
||||
renameDirectory(item) {
|
||||
this.dialogRenameDirectory.item = item;
|
||||
this.dialogRenameDirectory.newName = item.filename;
|
||||
this.dialogRenameDirectory.show = true;
|
||||
},
|
||||
renameDirectoryAction() {
|
||||
this.dialogRenameDirectory.show = false;
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.dialogRenameDirectory.item.filename,
|
||||
dest: this.currentPath+"/"+this.dialogRenameDirectory.newName
|
||||
}, 'files/getFileMove');
|
||||
},
|
||||
removeFile() {
|
||||
let filename = (this.currentPath+"/"+this.contextMenu.item.filename);
|
||||
axios.delete(
|
||||
'//'+ this.hostname + ':' + this.port +'/server/files/' + encodeURI(filename)
|
||||
).then((result) => {
|
||||
this.$toast.success(result.data.result+" successfully deleted.");
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error! Cannot delete file.");
|
||||
});
|
||||
},
|
||||
createDirectory: function() {
|
||||
this.dialogCreateDirectory.name = "";
|
||||
this.dialogCreateDirectory.show = true;
|
||||
},
|
||||
createDirectoryAction: function() {
|
||||
if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(" ") === -1) {
|
||||
this.dialogCreateDirectory.show = false;
|
||||
this.$socket.sendObj('server.files.post_directory', { path: this.currentPath+"/"+this.dialogCreateDirectory.name }, 'files/getCreateDir');
|
||||
}
|
||||
},
|
||||
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();
|
||||
}
|
||||
},
|
||||
clickRowGoBack: function() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf("/"));
|
||||
},
|
||||
loadPath: function() {
|
||||
this.$socket.sendObj('server.files.get_directory', { path: this.currentPath }, 'files/getDirectory');
|
||||
let dirArray = this.currentPath.split("/");
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
if (!this.showHiddenFiles) {
|
||||
this.files = this.files.filter(file => file.filename !== "thumbs" && file.filename.substr(0, 1) !== ".");
|
||||
}
|
||||
},
|
||||
startPrint(filename = "") {
|
||||
filename = (this.currentPath+"/"+filename).substring(7);
|
||||
this.dialogPrintFile.show = false;
|
||||
this.$socket.sendObj('printer.print.start', { filename: filename }, 'switchToDashboard');
|
||||
},
|
||||
dragOverUpload(e) {
|
||||
if (!this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
this.dropzone.visibility = 'visible';
|
||||
this.dropzone.opacity = 1;
|
||||
}
|
||||
},
|
||||
dragLeaveUpload(e) {
|
||||
if (!this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
this.dropzone.visibility = 'hidden';
|
||||
this.dropzone.opacity = 0;
|
||||
}
|
||||
},
|
||||
async dragDropUpload(e) {
|
||||
if (!this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
|
||||
this.dropzone.visibility = 'hidden';
|
||||
this.dropzone.opacity = 0;
|
||||
|
||||
if (!this.is_printing && e.dataTransfer.files.length) {
|
||||
await this.doUploadFile(e.dataTransfer.files[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
dragFile(e, item) {
|
||||
e.preventDefault();
|
||||
this.draggingFile.status = true;
|
||||
this.draggingFile.item = item;
|
||||
},
|
||||
dragendFile(e) {
|
||||
e.preventDefault();
|
||||
this.draggingFile.status = false;
|
||||
this.draggingFile.item = { };
|
||||
},
|
||||
dragOverFilelist(e, row) {
|
||||
if (this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
//e.stopPropagation();
|
||||
|
||||
if (row.isDirectory) {
|
||||
e.target.parentElement.style.backgroundColor = '#43A04720';
|
||||
}
|
||||
}
|
||||
},
|
||||
dragLeaveFilelist(e) {
|
||||
if (this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
e.target.parentElement.style.backgroundColor = 'transparent';
|
||||
}
|
||||
},
|
||||
async dragDropFilelist(e, row) {
|
||||
if (this.draggingFile.status) {
|
||||
e.preventDefault();
|
||||
e.target.parentElement.style.backgroundColor = 'transparent';
|
||||
|
||||
let dest = "";
|
||||
if (row.filename === '..') {
|
||||
dest = this.currentPath.substring(0, this.currentPath.lastIndexOf("/") + 1)+this.draggingFile.item.filename;
|
||||
} else dest = this.currentPath+"/"+row.filename+"/"+this.draggingFile.item.filename;
|
||||
|
||||
this.$socket.sendObj('server.files.move', {
|
||||
source: this.currentPath+"/"+this.draggingFile.item.filename,
|
||||
dest: dest
|
||||
}, 'getPostFileMove');
|
||||
}
|
||||
},
|
||||
sortFiles(items, sortBy, sortDesc) {
|
||||
sortBy = sortBy.length ? sortBy[0] : 'filename';
|
||||
sortDesc = sortDesc[0];
|
||||
|
||||
if (items !== undefined) {
|
||||
// Sort by index
|
||||
items.sort(function(a, b) {
|
||||
if (a[sortBy] === b[sortBy]) {
|
||||
return 0;
|
||||
}
|
||||
if (a[sortBy] === null || a[sortBy] === undefined) {
|
||||
return -1;
|
||||
}
|
||||
if (b[sortBy] === null || b[sortBy] === undefined) {
|
||||
return 1;
|
||||
}
|
||||
if (a[sortBy].constructor === String && b[sortBy].constructor === String) {
|
||||
return a[sortBy].localeCompare(b[sortBy], undefined, { sensivity: 'base' });
|
||||
}
|
||||
if (a[sortBy] instanceof Array && b[sortBy] instanceof Array) {
|
||||
const reducedA = a[sortBy].length ? a.filament.reduce((a, b) => a + b) : 0;
|
||||
const reducedB = b[sortBy].length ? b.filament.reduce((a, b) => a + b) : 0;
|
||||
return reducedA - reducedB;
|
||||
}
|
||||
return a[sortBy] - b[sortBy];
|
||||
});
|
||||
|
||||
// Deal with descending order
|
||||
if (sortDesc) items.reverse();
|
||||
|
||||
// Then make sure directories come first
|
||||
items.sort((a, b) => (a.isDirectory === b.isDirectory) ? 0 : (a.isDirectory ? -1 : 1));
|
||||
}
|
||||
return items;
|
||||
},
|
||||
refreshMetadata: function(data) {
|
||||
let items = this.sortFiles(this.files, [this.sortBy], [this.sortDesc]);
|
||||
for (let i = data.pageStart; i < data.pageStop; i++) {
|
||||
if (items[i] && !items[i].isDirectory && !items[i].metadataPulled) {
|
||||
let filename = (this.currentPath+"/"+items[i].filename).substring(7);
|
||||
this.$socket.sendObj("server.files.metadata", { filename: filename }, "files/getMetadata");
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
advancedSearch: function(value, search) {
|
||||
return value != null &&
|
||||
search != null &&
|
||||
typeof value === 'string' &&
|
||||
value.toString().toLowerCase().indexOf(search.toLowerCase()) !== -1
|
||||
},
|
||||
changeMetadataVisible: function(name) {
|
||||
if (this.headers.filter(header => header.value === name).length) {
|
||||
let value = this.headers.filter(header => header.value === name)[0].visible;
|
||||
|
||||
this.$store.dispatch("gui/setGcodefilesMetadata", {name: name, value: value});
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
filetree: {
|
||||
deep: true,
|
||||
handler(newVal) {
|
||||
let dirArray = this.currentPath.split("/");
|
||||
this.files = findDirectory(newVal, dirArray);
|
||||
|
||||
if (!this.showHiddenFiles) {
|
||||
this.files = this.files.filter(file => file.filename !== "thumbs" && file.filename.substr(0, 1) !== ".");
|
||||
}
|
||||
}
|
||||
},
|
||||
currentPath: {
|
||||
handler(newVal) {
|
||||
let dirArray = newVal.split("/");
|
||||
this.files = findDirectory(this.filetree, dirArray);
|
||||
|
||||
if (!this.showHiddenFiles) {
|
||||
this.files = this.files.filter(file => file.filename !== "thumbs" && file.filename.substr(0, 1) !== ".");
|
||||
}
|
||||
}
|
||||
},
|
||||
displayMetadata: {
|
||||
deep: true,
|
||||
handler(newVal) {
|
||||
Object.entries(newVal).forEach(value => {
|
||||
if (this.headers.filter(header => header.value === value[0]).length) {
|
||||
this.headers.filter(header => header.value === value[0])[0].visible = value[1];
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
clickUploadButton: function() {
|
||||
this.$refs.fileUpload.click();
|
||||
},
|
||||
refreshFileList: function() {
|
||||
this.$store.commit('setLoadingGcodeRefresh', true);
|
||||
this.$socket.sendObj('get_printer_files', {}, 'getFileList');
|
||||
},
|
||||
formatDate(date) {
|
||||
let tmp2 = new Date(date);
|
||||
|
||||
return tmp2.toLocaleString();
|
||||
},
|
||||
formatFilesize(fileSizeInBytes) {
|
||||
let i = -1;
|
||||
let byteUnits = [' kB', ' MB', ' GB', ' TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
do {
|
||||
fileSizeInBytes = fileSizeInBytes / 1024;
|
||||
i++;
|
||||
} while (fileSizeInBytes > 1024);
|
||||
|
||||
return Math.max(fileSizeInBytes, 0.1).toFixed(1) + byteUnits[i];
|
||||
},
|
||||
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
|
||||
});
|
||||
},
|
||||
removeFile() {
|
||||
axios.delete(
|
||||
'http://'+hostname+'/printer/files/'+this.contextMenu.item.filename
|
||||
).then(() => {
|
||||
this.$toast(this.contextMenu.item.filename+" successfully deleted.", {
|
||||
icon: 'fa-trash'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$toast.error("Error! Cannot delete file.", {
|
||||
icon: 'fa-warning'
|
||||
});
|
||||
});
|
||||
},
|
||||
startPrint(filename = "") {
|
||||
this.dialog.show = false;
|
||||
this.$socket.sendObj('post_printer_print_start', { filename: filename }, 'switchToDashboard');
|
||||
showHiddenFiles: function() {
|
||||
this.loadPath();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -0,0 +1,362 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-8">
|
||||
<v-card>
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>mdi-grid</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">Heightmap</v-list-item-title>
|
||||
<v-list-item-subtitle class="mr-3" v-if="boolShowBedMesh">Current profile: {{ this.bed_mesh ? this.bed_mesh.profile_name : "unknown" }}</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text class="px-0 py-0 content" v-if="boolShowBedMesh">
|
||||
<Plotly ref="heightmap" :data="data" :layout="layout" :display-mode-bar="false"></Plotly>
|
||||
</v-card-text>
|
||||
<v-card-text v-if="!boolShowBedMesh">
|
||||
No bed_mesh has been loaded yet.
|
||||
</v-card-text>
|
||||
<v-card-actions v-if="boolShowBedMesh">
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text :color="(this.showMeshType === 'probed' ? 'primary accent-4' : 'grey lighten-2')" @click="switchToProbed">Probed</v-btn>
|
||||
<v-btn text :color="(this.showMeshType === 'mesh' ? 'primary accent-4' : 'grey lighten-2')" @click="switchToMesh">Mesh</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-4">
|
||||
<v-card>
|
||||
<v-list-item>
|
||||
<v-list-item-avatar color="grey"><v-icon dark>mdi-cogs</v-icon></v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title class="headline">Profile</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-select
|
||||
:items="profiles"
|
||||
v-model="profile"
|
||||
item-text="name"
|
||||
item-value="name"
|
||||
label="Profile"
|
||||
outlined
|
||||
></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-btn color="primary" class="mr-3" @click="loadProfile" :loading="loadings.includes('bedMeshLoad')" :disabled="disabledLoad">LOAD</v-btn>
|
||||
<v-btn color="primary" class="mr-3" @click="saveDialog = true; newName = profile" :loading="loadings.includes('bedMeshSave')" :disabled="disabledSave">SAVE</v-btn>
|
||||
<v-btn color="primary" class="mr-3" @click="removeDialog = true" :loading="loadings.includes('bedMeshRemove')" :disabled="disabledRemove">REMOVE</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12">
|
||||
<v-btn color="primary" class="mr-3" @click="clearBedMesh" :loading="loadings.includes('bedMeshClear')" :disabled="disabledClear">CLEAR</v-btn>
|
||||
<v-btn color="primary" class="mr-3" @click="calibrateDialog = true" :loading="loadings.includes('bedMeshCalibrate')" :disabled="is_printing">Calibrate</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-dialog v-model="saveDialog" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Mesh Profile</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-text-field label="Name" required v-model="newName"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="waring darken-1" text @click="saveDialog = false">abort</v-btn>
|
||||
<v-btn color="blue darken-1" text @click="saveProfile">save</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="calibrateDialog" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Bed Mesh Calibrate</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<p>Do you really want to start the bed calibration?</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="waring darken-1" text @click="calibrateDialog = false">abort</v-btn>
|
||||
<v-btn color="blue darken-1" text @click="calibrateMesh">calibrate</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="removeDialog" persistent max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Bed Mesh Profile</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<p>Do you really want to delete the profile "{{ this.profile }}"?</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="waring darken-1" text @click="removeDialog = false">abort</v-btn>
|
||||
<v-btn color="blue darken-1" text @click="removeProfile">remove</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {mapGetters, mapState} from 'vuex';
|
||||
import { Plotly } from 'vue-plotly'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Plotly
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
data:[
|
||||
{
|
||||
x: [],
|
||||
y: [],
|
||||
z: [],
|
||||
type:"surface",
|
||||
intensity: [0, .05, .1],
|
||||
cmin: -0.1,
|
||||
cmax: 0.1,
|
||||
showscale: true,
|
||||
autocolorscale: true,
|
||||
colorbar: {
|
||||
tickfont: {
|
||||
color: '#fff'
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
layout:{
|
||||
showScale: true,
|
||||
plot_bgcolor: 'transparent',
|
||||
paper_bgcolor: 'transparent',
|
||||
margin: {
|
||||
l: 0,
|
||||
r: 100,
|
||||
b: 0,
|
||||
t: 0
|
||||
},
|
||||
scene: {
|
||||
camera: {
|
||||
eye: {
|
||||
x: -1.25,
|
||||
y: -1.25,
|
||||
z: 0.5
|
||||
}
|
||||
},
|
||||
xaxis: {
|
||||
color: '#fff',
|
||||
range: [0,200]
|
||||
},
|
||||
yaxis: {
|
||||
color: '#fff',
|
||||
range: [0,200]
|
||||
},
|
||||
zaxis: {
|
||||
color: '#fff',
|
||||
range: [-1,1]
|
||||
}
|
||||
}
|
||||
},
|
||||
profile: {},
|
||||
boolShowBedMesh: false,
|
||||
disabledLoad: true,
|
||||
disabledSave: true,
|
||||
disabledRemove: true,
|
||||
disabledClear: true,
|
||||
showMeshType: 'probed',
|
||||
saveDialog: false,
|
||||
removeDialog: false,
|
||||
calibrateDialog: false,
|
||||
newName: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
config: state => state.printer.configfile.config,
|
||||
bed_mesh: state => state.printer.bed_mesh,
|
||||
loadings: state => state.socket.loadings,
|
||||
}),
|
||||
|
||||
...mapGetters([
|
||||
'is_printing',
|
||||
]),
|
||||
profiles: {
|
||||
get() {
|
||||
return this.$store.getters["printer/getBedMeshProfiles"]
|
||||
},
|
||||
set() {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
showBedMesh: function() {
|
||||
this.data[0].x = [];
|
||||
this.data[0].y = [];
|
||||
this.data[0].z = [];
|
||||
|
||||
if (this.bed_mesh && this.bed_mesh.profile_name !== "") {
|
||||
|
||||
if (this.config.stepper_x !== undefined && this.config.stepper_y !== undefined) {
|
||||
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]];
|
||||
}
|
||||
|
||||
let x_count = 0;
|
||||
let y_count = 0;
|
||||
|
||||
let min = -1;
|
||||
let max = 1;
|
||||
|
||||
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 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++) {
|
||||
this.data[0].x.push(parseFloat(this.bed_mesh.mesh_min[0]) + parseFloat(x_step) * i);
|
||||
}
|
||||
|
||||
let y_step = (this.bed_mesh.mesh_max[1] - this.bed_mesh.mesh_min[1]) / (y_count - 1);
|
||||
for(let i = 0; i < y_count; i++) {
|
||||
this.data[0].y.push(parseFloat(this.bed_mesh.mesh_min[1]) + parseFloat(y_step) * i);
|
||||
}
|
||||
|
||||
if (min > -1) min = -1;
|
||||
if (max < 1) max = 1;
|
||||
|
||||
this.layout.scene.zaxis.range = [min, max];
|
||||
|
||||
this.boolShowBedMesh = true;
|
||||
} else this.boolShowBedMesh = false;
|
||||
|
||||
//this.$refs.heightmap.update();
|
||||
},
|
||||
switchToProbed: function() {
|
||||
this.showMeshType = 'probed';
|
||||
this.showBedMesh();
|
||||
},
|
||||
switchToMesh: function() {
|
||||
this.showMeshType = 'mesh';
|
||||
this.showBedMesh();
|
||||
},
|
||||
loadProfile: function() {
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshLoad' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE LOAD="+this.profile }, "socket/removeLoading", { name: 'bedMeshLoad' });
|
||||
},
|
||||
saveProfile: function() {
|
||||
this.saveDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshSave' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE SAVE="+this.newName.toUpperCase() }, "socket/removeLoading", { name: 'bedMeshSave' });
|
||||
},
|
||||
removeProfile: function() {
|
||||
this.removeDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshRemove' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_PROFILE REMOVE="+this.profile }, "socket/removeLoading", { name: 'bedMeshRemove' });
|
||||
},
|
||||
clearBedMesh: function() {
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshClear' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CLEAR" }, "socket/removeLoading", { name: 'bedMeshClear' });
|
||||
},
|
||||
calibrateMesh: function() {
|
||||
this.calibrateDialog = false;
|
||||
this.$store.commit('socket/addLoading', { name: 'bedMeshCalibrate' });
|
||||
this.$socket.sendObj('printer.gcode.script', { script: "BED_MESH_CALIBRATE" }, "socket/removeLoading", { name: 'bedMeshCalibrate' });
|
||||
}
|
||||
},
|
||||
created: function() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
config: function() {
|
||||
this.profiles = this.$store.getters["printer/getBedMeshProfiles"];
|
||||
},
|
||||
profile: function() {
|
||||
if (this.profile !== "" && this.bed_mesh !== undefined && this.profile === this.bed_mesh.profile_name) {
|
||||
this.disabledLoad = true;
|
||||
this.disabledRemove = false;
|
||||
} else if (this.profile !== "") {
|
||||
this.disabledLoad = false;
|
||||
this.disabledRemove = false;
|
||||
} else {
|
||||
this.disabledLoad = true;
|
||||
this.disabledRemove = true;
|
||||
}
|
||||
},
|
||||
bed_mesh: {
|
||||
deep: false,
|
||||
handler(newVal) {
|
||||
if (newVal !== undefined) {
|
||||
this.profiles = this.$store.getters["printer/getBedMeshProfiles"];
|
||||
this.showBedMesh();
|
||||
|
||||
if (this.profile !== "" && this.profile === this.bed_mesh.profile_name) this.disabledLoad = true;
|
||||
else if (this.profile !== "") this.disabledLoad = false;
|
||||
else this.disabledLoad = true;
|
||||
|
||||
if (
|
||||
this.bed_mesh.probed_matrix.length &&
|
||||
this.bed_mesh.probed_matrix[0].length) {
|
||||
this.disabledClear = false;
|
||||
this.disabledSave = false;
|
||||
} else {
|
||||
this.disabledClear = true;
|
||||
this.disabledSave = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
|
||||
<template>
|
||||
<div>
|
||||
Settings - General
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -1,10 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
Current Job
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-row>
|
||||
<v-col col-12>
|
||||
<webcam-panel></webcam-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-general-panel></settings-general-panel>
|
||||
<settings-webcam-panel class="mt-6"></settings-webcam-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-dashboard-panel></settings-dashboard-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6 col-lg-4">
|
||||
<settings-macros-panel></settings-macros-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapState, mapActions } from 'vuex';
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
...mapActions([
|
||||
|
||||
]),
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,10 +1,52 @@
|
||||
<template>
|
||||
<div>
|
||||
Settings - Machine
|
||||
<v-row>
|
||||
<v-col class="col-12 col-sm-6">
|
||||
<settings-config-files-panel></settings-config-files-panel>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-sm-6">
|
||||
<v-row v-if="klippy_state === 'ready'">
|
||||
<v-col class="col-12 pt-0">
|
||||
<settings-limits-panel></settings-limits-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="klippy_state !== 'ready'">
|
||||
<v-col class="col-12 pt-0">
|
||||
<klippy-state-panel></klippy-state-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-md-6" v-if="klippy_state === 'ready'">
|
||||
<settings-endstop-panel></settings-endstop-panel>
|
||||
<settings-runout-panel></settings-runout-panel>
|
||||
</v-col>
|
||||
<v-col :class="(klippy_state !== 'ready' ? 'col-md-12' : 'col-md-6')">
|
||||
<settings-logfiles-panel></settings-logfiles-panel>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
import {mapState} from "vuex";
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
|
||||
}),
|
||||
computed: {
|
||||
...mapState({
|
||||
klippy_state: state => state.server.klippy_state,
|
||||
}),
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,23 @@
|
||||
export function findDirectory (folder, dirArray) {
|
||||
if (folder !== undefined && dirArray.length) {
|
||||
if (folder.childrens) folder = folder.childrens;
|
||||
|
||||
let parent = folder.find(element => (element.isDirectory && element.filename === dirArray[0]));
|
||||
if (parent) {
|
||||
dirArray.shift();
|
||||
if (dirArray.length) {
|
||||
return findDirectory(parent, dirArray);
|
||||
} else return parent.childrens;
|
||||
} else return folder;
|
||||
}
|
||||
}
|
||||
|
||||
export function caseInsensitiveNameSort(a, b) {
|
||||
let nameA = a.name.toUpperCase();
|
||||
let nameB = b.name.toUpperCase();
|
||||
|
||||
if (nameA < nameB) return -1;
|
||||
if (nameA > nameB) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import WebSocketClient from './wsClient'
|
||||
|
||||
export default {
|
||||
install (Vue, url, options) {
|
||||
const socketClient = new WebSocketClient(url, options)
|
||||
socketClient.connect()
|
||||
Vue.prototype.$socket = socketClient
|
||||
}
|
||||
}
|
||||