Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8755fa3fc | ||
|
|
ec399c2b78 | ||
|
|
46c9d6f627 | ||
|
|
8f96faa9ef | ||
|
|
3c0b537609 | ||
|
|
182d9541f1 | ||
|
|
3a651c99a1 | ||
|
|
6ed57fc0d3 | ||
|
|
3666e294e9 | ||
|
|
af547b35fe | ||
|
|
049997a01b | ||
|
|
e31e8ec2dd | ||
|
|
6481c6fa25 | ||
|
|
b445c8d5b8 | ||
|
|
c14873a8a5 | ||
|
|
6e21642deb | ||
|
|
6001c9210f | ||
|
|
f35252ec8b | ||
|
|
5cd5aa42a4 | ||
|
|
07795429a9 | ||
|
|
789a4c2f6a | ||
|
|
edc2af4d4c | ||
|
|
e1a754abdc | ||
|
|
4d2caeb3e7 | ||
|
|
b6f32c077c | ||
|
|
932a2c35b1 | ||
|
|
32122348b3 | ||
|
|
817efba0d8 | ||
|
|
298eae8cbf | ||
|
|
5b62b97420 | ||
|
|
c8a1e8cb79 | ||
|
|
e445fbe5cc | ||
|
|
09a994d854 | ||
|
|
1a7aca6680 | ||
|
|
a3e74aa57a | ||
|
|
cd1b9b85bd | ||
|
|
4970d0218a | ||
|
|
82e3dd8b18 | ||
|
|
3994a8ebe8 | ||
|
|
8a43ecafd1 | ||
|
|
d8430f54ed | ||
|
|
5734f1cd1d | ||
|
|
7d86df0c81 | ||
|
|
2670eb6447 | ||
|
|
5eb50bbcec | ||
|
|
79a5f9a7e4 | ||
|
|
8fc0d5c23c | ||
|
|
a28c6fdb03 | ||
|
|
b7914f8de6 | ||
|
|
2b73cce47a | ||
|
|
890b9969ae | ||
|
|
79014acf7f | ||
|
|
f3fcce3252 | ||
|
|
e1dd59db15 | ||
|
|
7ae958934f | ||
|
|
bf04ec312e | ||
|
|
09c2526642 | ||
|
|
a0ad7e84ab | ||
|
|
9a2328ba69 | ||
|
|
5007646ff0 | ||
|
|
c87586aebb | ||
|
|
ecaa894fbb | ||
|
|
e0f51667eb | ||
|
|
9f08afc138 | ||
|
|
fd293d21ec | ||
|
|
1aa9f341fa | ||
|
|
98d99d2d11 | ||
|
|
18a5c732b2 | ||
|
|
871688f3c8 | ||
|
|
c725fb09f5 | ||
|
|
5997689ef8 | ||
|
|
218f85c81f | ||
|
|
caaf5e1606 | ||
|
|
57de746adc | ||
|
|
b0491deb93 | ||
|
|
90d76c1ffe | ||
|
|
1cd2541d6f | ||
|
|
0c4b9e7551 | ||
|
|
16165ec85f | ||
|
|
69eaeb6557 | ||
|
|
e9c22d32bc | ||
|
|
98d9b0aa59 | ||
|
|
da157891a4 | ||
|
|
9883457e9d | ||
|
|
15371adc3d | ||
|
|
fe7aee9307 | ||
|
|
dbb5f81206 | ||
|
|
9e2e923a8f | ||
|
|
1a12554821 | ||
|
|
7251a8c6ba | ||
|
|
cda3098c9e | ||
|
|
9eb133bd85 | ||
|
|
6a4cca751c | ||
|
|
d67ef3aa90 | ||
|
|
aeee198239 | ||
|
|
5c40820108 | ||
|
|
e929c7cc0f | ||
|
|
0b47a80b13 | ||
|
|
8447be2ece | ||
|
|
0c5aca8baf | ||
|
|
eceb442a4c | ||
|
|
98160e1368 | ||
|
|
f52b94c459 | ||
|
|
0cefa24e76 | ||
|
|
be253165a0 | ||
|
|
5b2bea51aa | ||
|
|
db09bbe043 | ||
|
|
6758049d29 | ||
|
|
a58bef2a03 | ||
|
|
a1d3dc9118 | ||
|
|
1895d2d905 | ||
|
|
7c81690c1e | ||
|
|
039a446944 | ||
|
|
bcbef2f19a | ||
|
|
39590004da | ||
|
|
ef2d17cadd | ||
|
|
a7e70c75d0 | ||
|
|
21d3d39503 | ||
|
|
d8441254db | ||
|
|
6e7ef6554e | ||
|
|
98a750922a | ||
|
|
7da33523d1 | ||
|
|
2962df21e5 | ||
|
|
73e503fc64 | ||
|
|
705065d65e | ||
|
|
7966270ea7 | ||
|
|
f5aee3e20d | ||
|
|
8fc275086a | ||
|
|
2752cfc975 | ||
|
|
6ce0f4f074 | ||
|
|
5abf417303 | ||
|
|
5b55727485 | ||
|
|
4a41430f40 | ||
|
|
8682dd7855 | ||
|
|
cff7b32f02 | ||
|
|
8a34656e82 | ||
|
|
30efd6496e | ||
|
|
2b4b881c55 | ||
|
|
7468f882c1 | ||
|
|
f9556e27b3 | ||
|
|
630d67efc5 | ||
|
|
a85ec9d0d7 | ||
|
|
b94840736f | ||
|
|
9c3c56bd56 | ||
|
|
23cc6b18e5 | ||
|
|
d4f1bf209d | ||
|
|
8481408029 | ||
|
|
d578c2a107 | ||
|
|
080a713f4c | ||
|
|
140d796f51 | ||
|
|
23da8818c3 | ||
|
|
34e3e69e5e | ||
|
|
ea274c6d4a | ||
|
|
a08f9ac9a5 | ||
|
|
8bbd5bdb0f | ||
|
|
74816c5c21 | ||
|
|
40e8f9cd63 | ||
|
|
4d7ffbe090 | ||
|
|
ec53b974fd | ||
|
|
a3316eb23b | ||
|
|
e6505fe55a | ||
|
|
6484a41eca | ||
|
|
0e86652d1c | ||
|
|
bb710794d2 | ||
|
|
f701dfbcf8 | ||
|
|
301e8386b8 | ||
|
|
ab777d5e04 | ||
|
|
c598d6260d | ||
|
|
370d7d4142 | ||
|
|
faf09f24f9 | ||
|
|
dd262f74b0 | ||
|
|
ad8d8efb6a | ||
|
|
df83c9d8cc | ||
|
|
6b68be1121 | ||
|
|
8a199a00b6 | ||
|
|
c18a9594e6 | ||
|
|
85ea45fbe9 | ||
|
|
44f4079dac | ||
|
|
ec1b32eaaf | ||
|
|
531b75fffd | ||
|
|
7301ae986a | ||
|
|
0f01a8f994 | ||
|
|
7ad25e3851 | ||
|
|
6a7f2f56a4 | ||
|
|
47feaef671 | ||
|
|
0e4d104d20 | ||
|
|
9665fb9a38 | ||
|
|
b0cdbb48f3 | ||
|
|
52d0ea4ec5 | ||
|
|
c42f09acc9 | ||
|
|
1a6969eeea | ||
|
|
a3a71c8f15 | ||
|
|
3e49847fc3 | ||
|
|
6703721593 | ||
|
|
f3c42954f1 | ||
|
|
1bbbc0c0a8 | ||
|
|
2f868b537d | ||
|
|
c1a50180d0 | ||
|
|
3743023514 | ||
|
|
a798d8973c | ||
|
|
328530a6a3 | ||
|
|
43dc843eca | ||
|
|
92438bf8a7 | ||
|
|
e0e90bcdaf | ||
|
|
6a2a1baaab | ||
|
|
2a924bcd27 | ||
|
|
cec3a9fe33 | ||
|
|
b3ce868dec | ||
|
|
c904b7ba71 | ||
|
|
a8bf9e9559 | ||
|
|
3b5d7f146b | ||
|
|
6b9b69501a | ||
|
|
57a53b5ac3 | ||
|
|
c65527ddf2 | ||
|
|
22ccab831b | ||
|
|
0f94e80135 | ||
|
|
d29ce0a4f0 | ||
|
|
8782c89d71 | ||
|
|
b6fe84f19d | ||
|
|
051b89662b | ||
|
|
e7eb94faa1 | ||
|
|
2b7bf2a3f4 | ||
|
|
9c4fb547b5 | ||
|
|
727fc722af | ||
|
|
1a32147d68 | ||
|
|
380f3c1b6d | ||
|
|
7ac6a723b4 | ||
|
|
712d68136b | ||
|
|
034ff81e49 | ||
|
|
c2ecc845ca | ||
|
|
e21439d061 | ||
|
|
41fa1d98ca | ||
|
|
655d2fd339 | ||
|
|
0735ed37a9 | ||
|
|
d96070f336 | ||
|
|
d259abb749 | ||
|
|
3e06c5fd66 | ||
|
|
288e5110f4 | ||
|
|
41ca5244cc | ||
|
|
3d4b5451ae | ||
|
|
dc17ff1158 | ||
|
|
de23cb6243 | ||
|
|
94d7f0dc16 | ||
|
|
45c52e3571 | ||
|
|
03640e239b | ||
|
|
4c24fa7284 | ||
|
|
12483ee63b | ||
|
|
bae712540e | ||
|
|
31664b5f38 | ||
|
|
ba5aea2b88 | ||
|
|
a6e38df012 | ||
|
|
bc0018dadc | ||
|
|
1a659d30d2 | ||
|
|
d0bf0bde11 | ||
|
|
d87fe4173d | ||
|
|
f8c66af48b | ||
|
|
da14c44873 | ||
|
|
20adf79e7c | ||
|
|
2aa181c7f5 | ||
|
|
c9ab0782bf | ||
|
|
6f8cfaa276 | ||
|
|
4760b9d9f1 | ||
|
|
d6015be734 | ||
|
|
837623e0a1 | ||
|
|
7c28027189 | ||
|
|
a88c9ba083 | ||
|
|
128baea88c | ||
|
|
cca17a8822 | ||
|
|
685665bd46 | ||
|
|
d1cfe7251d | ||
|
|
05dea0c78b | ||
|
|
d05efe26c4 | ||
|
|
835c5dacd2 | ||
|
|
57bb268ea0 | ||
|
|
d5cafaaa06 | ||
|
|
8cba020fb2 | ||
|
|
a305f243da | ||
|
|
666c942b18 | ||
|
|
f01f421c1c | ||
|
|
285b8b9b6f | ||
|
|
feadc73847 | ||
|
|
ceca6ce2f7 | ||
|
|
ff37c7de32 | ||
|
|
829e7a497d | ||
|
|
37c9fa8657 | ||
|
|
6a40e6047d | ||
|
|
78b9864d11 | ||
|
|
950dea1e08 | ||
|
|
27c57eef68 | ||
|
|
f65bc9f0b9 | ||
|
|
e150a4ef32 | ||
|
|
a70bd12c19 | ||
|
|
3ec2ee2793 | ||
|
|
e411175b7f | ||
|
|
3f67d1d4c5 | ||
|
|
12dd1c9e31 | ||
|
|
2b2057648d | ||
|
|
42f7851636 | ||
|
|
175a90aae5 | ||
|
|
1e9120e709 | ||
|
|
4e8b6de72a | ||
|
|
c37ea7f0ed | ||
|
|
f22d4d09c8 | ||
|
|
4a450fc563 | ||
|
|
eb4c5678ba | ||
|
|
fe04944c79 | ||
|
|
6fefc98da6 | ||
|
|
0570568322 | ||
|
|
9a5b230ffa | ||
|
|
da569fc9f7 | ||
|
|
719b5c4b01 | ||
|
|
28e1ec384d | ||
|
|
6387431ce8 | ||
|
|
fd79316799 | ||
|
|
05672b55c1 | ||
|
|
cbb70759f5 | ||
|
|
99075fb259 | ||
|
|
14f6799489 | ||
|
|
24d5668a65 | ||
|
|
2b5ea0f66e | ||
|
|
e75f0bcee8 | ||
|
|
8e562c7bba | ||
|
|
5f2f7ddc9f | ||
|
|
349372fd64 | ||
|
|
157e099964 | ||
|
|
fe9995882a | ||
|
|
d8377ac6e5 | ||
|
|
b16c1cfdd2 | ||
|
|
8c1f09d909 | ||
|
|
1f71d2dbbc | ||
|
|
f55b58a2a9 | ||
|
|
8d7e4c1ea4 | ||
|
|
4357b8c9d6 | ||
|
|
46f0879677 | ||
|
|
1d117ed82f | ||
|
|
2eb34007e1 | ||
|
|
4c9aab5a2d | ||
|
|
98439b916b | ||
|
|
24932c088f | ||
|
|
69f30ed460 | ||
|
|
1709001c8b | ||
|
|
f277193082 | ||
|
|
8af3f92a60 | ||
|
|
79bc61780c | ||
|
|
2b626474b4 | ||
|
|
09ab1077a1 | ||
|
|
c2ddac3e2f | ||
|
|
9474ae614d | ||
|
|
fa2f07fc22 | ||
|
|
afb041a5fa | ||
|
|
f27a7770a9 | ||
|
|
5ce78fae4a | ||
|
|
6f68709f21 | ||
|
|
8ab59b642a | ||
|
|
2d7a5b5845 | ||
|
|
a4e268e543 | ||
|
|
f4ed91e515 | ||
|
|
15b12a68e5 | ||
|
|
7f57f8b9aa | ||
|
|
1f9d8e86be | ||
|
|
7536bce10d | ||
|
|
4bd2d28f4b | ||
|
|
6b6ca698e6 | ||
|
|
c514b3f130 | ||
|
|
46aa7cc7c6 | ||
|
|
d1c1b077d8 | ||
|
|
ea8e8e8caa | ||
|
|
3beeacb4ee | ||
|
|
7da894d55e | ||
|
|
d48d05bebe | ||
|
|
5f3d80dd5b | ||
|
|
e5d4e6243a | ||
|
|
1e0645be6e | ||
|
|
eb1d3c1475 | ||
|
|
1e62b5bce5 | ||
|
|
6661e031fb | ||
|
|
8a000e38a4 | ||
|
|
229a6759cf | ||
|
|
dfc91df681 | ||
|
|
38d2c883b1 | ||
|
|
b5c92cbcab | ||
|
|
642d5a0cb5 | ||
|
|
a9669ad809 | ||
|
|
753f050795 | ||
|
|
443b7f9dc8 | ||
|
|
8438c0a86b | ||
|
|
308518a25c | ||
|
|
de911d21fc | ||
|
|
911387755f | ||
|
|
8367f01bce | ||
|
|
21ad4c16e7 | ||
|
|
6b18300b5d | ||
|
|
1c84e6ec6d | ||
|
|
0d4c0149b4 | ||
|
|
5029f4d9d5 | ||
|
|
94338ba5d4 | ||
|
|
04159fc49c | ||
|
|
a30a001290 |
No files matched your search
@@ -7,8 +7,8 @@ VUE_APP_PORT=7125
|
|||||||
# reconnect interval in ms
|
# reconnect interval in ms
|
||||||
VUE_APP_RECONNECT_INTERVAL=5000
|
VUE_APP_RECONNECT_INTERVAL=5000
|
||||||
|
|
||||||
# remote mode
|
# where should mainsail read the instances from (moonraker, browser or json)
|
||||||
VUE_APP_REMOTE_MODE=false
|
VUE_APP_INSTANCES_DB="moonraker"
|
||||||
|
|
||||||
# defaults for multi language tests
|
# defaults for multi language tests
|
||||||
VUE_APP_I18N_LOCALE=en
|
VUE_APP_I18N_LOCALE=en
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"vue/no-v-html": 0,
|
"vue/no-v-html": 0,
|
||||||
"vue/component-tags-order": 0,
|
"vue/component-tags-order": 0,
|
||||||
|
"vue/no-v-text-v-html-on-component": 0,
|
||||||
"vue/valid-v-slot": [
|
"vue/valid-v-slot": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
Developer Certificate of Origin
|
||||||
|
Version 1.1
|
||||||
|
|
||||||
|
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||||
|
1 Letterman Drive
|
||||||
|
Suite D4700
|
||||||
|
San Francisco, CA, 94129
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies of this
|
||||||
|
license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Developer's Certificate of Origin 1.1
|
||||||
|
|
||||||
|
By making a contribution to this project, I certify that:
|
||||||
|
|
||||||
|
(a) The contribution was created in whole or in part by me and I
|
||||||
|
have the right to submit it under the open source license
|
||||||
|
indicated in the file; or
|
||||||
|
|
||||||
|
(b) The contribution is based upon previous work that, to the best
|
||||||
|
of my knowledge, is covered under an appropriate open source
|
||||||
|
license and I have the right under that license to submit that
|
||||||
|
work with modifications, whether created in whole or in part
|
||||||
|
by me, under the same open source license (unless I am
|
||||||
|
permitted to submit under a different license), as indicated
|
||||||
|
in the file; or
|
||||||
|
|
||||||
|
(c) The contribution was provided directly to me by some other
|
||||||
|
person who certified (a), (b) or (c) and I have not modified
|
||||||
|
it.
|
||||||
|
|
||||||
|
(d) I understand and agree that this project and the contribution
|
||||||
|
are public and that a record of the contribution (including all
|
||||||
|
personal information I submit with it, including my sign-off) is
|
||||||
|
maintained indefinitely and may be redistributed consistent with
|
||||||
|
this project or the open source license(s) involved.
|
||||||
@@ -17,6 +17,14 @@ body:
|
|||||||
[Discord](https://discord.gg/mainsail)
|
[Discord](https://discord.gg/mainsail)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
- type: input
|
||||||
|
id: version
|
||||||
|
attributes:
|
||||||
|
label: 'Mainsail Version:'
|
||||||
|
description: Mainsail version where the issue occurs
|
||||||
|
placeholder: <your current mainsail version>
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
- type: dropdown
|
- type: dropdown
|
||||||
id: browser
|
id: browser
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<!--
|
||||||
|
For Work In Progress Pull Requests, please use the Draft PR feature,
|
||||||
|
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.
|
||||||
|
|
||||||
|
For a timely review/response, please avoid force-pushing additional
|
||||||
|
commits if your PR already received reviews or comments.
|
||||||
|
|
||||||
|
We use squash-merge to merge PRs, so the commit history is clean, but we use the PR title as the commit message.
|
||||||
|
So we recommend you to use the PR title with conventional commits type prefixes. We use the following prefixes for the PR title:
|
||||||
|
- feat: A new feature
|
||||||
|
- fix: A bug fix
|
||||||
|
- docs: Documentation only changes
|
||||||
|
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
|
||||||
|
- refactor: A code change that neither fixes a bug nor adds a feature
|
||||||
|
- perf: A code change that improves performance
|
||||||
|
- test: Adding missing tests or correcting existing tests
|
||||||
|
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||||
|
- locale: Changes to the translations
|
||||||
|
|
||||||
|
You can found more information about Conventional Commits here: https://www.conventionalcommits.org/en/v1.0.0/.
|
||||||
|
|
||||||
|
Before submitting a Pull Request, please ensure you've done the following:
|
||||||
|
- 📖 Read the Mainsail Contributing Guidelines: https://github.com/mainsail-crew/mainsail/blob/HEAD/CONTRIBUTING.md#-submitting-a-pull-request-pr.
|
||||||
|
- 📖 Read the Mainsail Code of Conduct: https://github.com/mainsail-crew/mainsail/blob/HEAD/.github/CODE_OF_CONDUCT.md.
|
||||||
|
- 👷♀️ Create small PRs. In most cases, this will be possible.
|
||||||
|
- ✅ Provide tests for your changes.
|
||||||
|
- 📝 Use descriptive commit messages.
|
||||||
|
- 📗 Update any related documentation and include any relevant screenshots.
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please do not leave this blank
|
||||||
|
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Related Tickets & Documents
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please use this format link issue numbers: Fixes #123
|
||||||
|
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Mobile & Desktop Screenshots/Recordings
|
||||||
|
|
||||||
|
<!-- Visual changes require screenshots -->
|
||||||
|
|
||||||
|
## [optional] Are there any post-deployment tasks we need to perform?
|
||||||
|
|
||||||
|
<!-- note: PRs with deleted sections will be marked invalid -->
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Set update schedule for GitHub Actions
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: 'github-actions'
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
# Check for updates to GitHub Actions every week
|
||||||
|
interval: 'weekly'
|
||||||
|
|
||||||
|
- package-ecosystem: 'npm'
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: 'weekly'
|
||||||
|
allow:
|
||||||
|
# Ignore major updates to all dependencies. We're using old versions of some packages that are incompatible with newer versions of other packages.
|
||||||
|
- dependency-name: '*'
|
||||||
|
update-type: 'semver:non-major'
|
||||||
|
dependency-type: 'direct'
|
||||||
|
assignees:
|
||||||
|
- 'meteyou'
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Configuration for Label Actions - https://github.com/dessant/label-actions
|
||||||
|
|
||||||
|
not on Github:
|
||||||
|
issues:
|
||||||
|
comment: |
|
||||||
|
Ahoi!
|
||||||
|
|
||||||
|
It looks like this ticket is a request for help (or similar).
|
||||||
|
Many helpful people will not see your message here and you are
|
||||||
|
unlikely to get a useful response.
|
||||||
|
|
||||||
|
We use github to handle bugreports, feature requests and
|
||||||
|
planning new releases.
|
||||||
|
|
||||||
|
Please use our Discord-Server for help: [discord.gg/mainsail](https://discord.gg/mainsail)
|
||||||
|
|
||||||
|
This ticket will be automatically closed.
|
||||||
|
|
||||||
|
Fair wind and a following sea!
|
||||||
|
~ Your friendly MainsailGithubBot
|
||||||
|
|
||||||
|
*PS: I'm just an automated script, not a real sailor.*
|
||||||
|
close: true
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
name: 'Auto analyze if package.json was edited'
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-analyze:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Check package.json was changed
|
||||||
|
id: changed-file-package-json
|
||||||
|
uses: tj-actions/changed-files@v23
|
||||||
|
with:
|
||||||
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json')
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- uses: preactjs/compressed-size-action@v2
|
||||||
|
if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json')
|
||||||
|
with:
|
||||||
|
strip-hash: "\\b\\w{8}\\."
|
||||||
|
pattern: './dist/**/*.{js,css,html,json,woff2,svg,png}'
|
||||||
|
exclude: '{./dist/manifest.json,./dist/build.zip,**/*.map,**/node_modules/**}'
|
||||||
@@ -23,12 +23,12 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch repo
|
- name: Fetch repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install node
|
- name: Install node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 20
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Copy output
|
- name: Copy output
|
||||||
run: cp ${{ github.workspace }}/dist/mainsail.zip mainsail-latest.zip
|
run: cp ${{ github.workspace }}/dist/mainsail.zip mainsail-latest.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2.2.4
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: mainsail-latest.zip
|
name: mainsail-latest.zip
|
||||||
path: mainsail-latest.zip
|
path: mainsail-latest.zip
|
||||||
@@ -8,7 +8,7 @@ jobs:
|
|||||||
if: contains(github.event.pull_request.labels.*.name, 'analyze')
|
if: contains(github.event.pull_request.labels.*.name, 'analyze')
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- uses: preactjs/compressed-size-action@v2
|
- uses: preactjs/compressed-size-action@v2
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: Check PR title
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
statuses: write
|
||||||
|
steps:
|
||||||
|
- uses: aslafy-z/conventional-pr-title-action@v3
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
name: Check Translations
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types: [synchronize, opened]
|
||||||
|
paths:
|
||||||
|
- 'src/locales/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_translations:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install jq
|
||||||
|
run: sudo apt install -y jq
|
||||||
|
|
||||||
|
- name: Fetch repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Get changed files
|
||||||
|
id: changed-files
|
||||||
|
uses: tj-actions/changed-files@v23
|
||||||
|
with:
|
||||||
|
sha: ${{ github.event.pull_request.head.sha }}
|
||||||
|
files: 'src/locales/*.json'
|
||||||
|
|
||||||
|
- name: Run i18n-extract on changed locale files
|
||||||
|
id: i18n-extract
|
||||||
|
env:
|
||||||
|
OUTPUT: ''
|
||||||
|
run: |
|
||||||
|
mkdir ./i18n-extract
|
||||||
|
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
|
||||||
|
npm run i18n-extract -- --languageFiles=src/locales/${file##*/} --output=i18n-extract/${file##*/}
|
||||||
|
MISSING=$(cat i18n-extract/${file##*/} | jq '.missingKeys | length')
|
||||||
|
UNUSED=$(cat i18n-extract/${file##*/} | jq '.unusedKeys | length')
|
||||||
|
echo "$file=|${file##*/}|${MISSING}|${UNUSED}|" >> $GITHUB_OUTPUT
|
||||||
|
done
|
||||||
|
- name: Comment PR
|
||||||
|
uses: thollander/actions-comment-pull-request@v2
|
||||||
|
with:
|
||||||
|
message: |
|
||||||
|
Language file analysis report:
|
||||||
|
|File|Missing Keys|Unused Keys|
|
||||||
|
|:---|---:|---:|
|
||||||
|
${{join(steps.i18n-extract.outputs.*, '
|
||||||
|
')}}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -25,22 +25,22 @@ jobs:
|
|||||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||||
steps:
|
steps:
|
||||||
- name: Fetch repo
|
- name: Fetch repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Install node
|
- name: Install node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Run linters
|
- name: Run linters
|
||||||
uses: wearerequired/lint-action@v1
|
uses: wearerequired/lint-action@v2
|
||||||
with:
|
with:
|
||||||
eslint: true
|
eslint: true
|
||||||
prettier: true
|
prettier: true
|
||||||
eslint_dir: src
|
eslint_dir: src
|
||||||
eslint_extensions: ts,vue
|
eslint_extensions: ts,vue,json
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: 'Label Actions'
|
||||||
|
|
||||||
|
on:
|
||||||
|
issues:
|
||||||
|
types: [labeled, unlabeled]
|
||||||
|
pull_request:
|
||||||
|
types: [labeled, unlabeled]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
discussions: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
action:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: dessant/label-actions@v3
|
||||||
@@ -4,6 +4,9 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: ['master', 'develop']
|
branches: ['master', 'develop']
|
||||||
tags:
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -19,10 +22,10 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -30,24 +33,25 @@ jobs:
|
|||||||
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||||
type=edge,branch=develop
|
type=edge,branch=develop
|
||||||
type=ref,event=tag
|
type=semver,pattern=v{{major}}
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}
|
||||||
|
type=semver,pattern=v{{major}}.{{minor}}.{{patch}}
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||||
push: true
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
description: New version number in X.Y.Z
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
push-version-number:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Clone develop repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.PAT }}
|
||||||
|
ref: 'develop'
|
||||||
|
|
||||||
|
- name: get-npm-version
|
||||||
|
id: package-version
|
||||||
|
uses: martinbeentjes/npm-get-version-action@main
|
||||||
|
|
||||||
|
- name: Push version number
|
||||||
|
if: steps.package-version.outputs.current-version != github.event.inputs.version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
npm version --no-git-tag-version ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
|
- name: git add & commit & push
|
||||||
|
if: steps.package-version.outputs.current-version != github.event.inputs.version
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
with:
|
||||||
|
add: 'package.json package-lock.json'
|
||||||
|
default_author: github_actions
|
||||||
|
message: 'chore: push version number to v${{ github.event.inputs.version }}'
|
||||||
|
push: true
|
||||||
|
|
||||||
|
update-master-branch:
|
||||||
|
needs: ['push-version-number']
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: everlytic/branch-merge@1.1.5
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.PAT }}
|
||||||
|
source_ref: 'develop'
|
||||||
|
target_branch: 'master'
|
||||||
|
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs: ['update-master-branch']
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'master'
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Move build out of dist
|
||||||
|
shell: bash
|
||||||
|
run: mv ./dist/mainsail.zip ./mainsail.zip
|
||||||
|
|
||||||
|
- name: Get latest tag
|
||||||
|
id: latest_tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Generate a changelog
|
||||||
|
uses: orhun/git-cliff-action@v2
|
||||||
|
id: generate-changelog
|
||||||
|
with:
|
||||||
|
config: ./cliff-release.toml
|
||||||
|
args: ${{ steps.latest_tag.outputs.TAG_NAME }}..HEAD
|
||||||
|
|
||||||
|
- name: Create release and upload build
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
id: create-release
|
||||||
|
with:
|
||||||
|
name: v${{ github.event.inputs.version }}
|
||||||
|
tag_name: v${{ github.event.inputs.version }}
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
files: ./mainsail.zip
|
||||||
|
body: ${{ steps.generate-changelog.outputs.content }}
|
||||||
|
|
||||||
|
- name: Copy remote configs to dist
|
||||||
|
shell: bash
|
||||||
|
run: cp ./remote/* ./dist/
|
||||||
|
|
||||||
|
- name: Upload to remote server
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.REMOTEHOST }}
|
||||||
|
username: ${{ secrets.REMOTEUSER }}
|
||||||
|
password: ${{ secrets.REMOTEPASSWORD }}
|
||||||
|
dangerous-clean-slate: true
|
||||||
|
exclude: .htaccess
|
||||||
|
local-dir: ./dist/
|
||||||
|
|
||||||
|
update-changelog:
|
||||||
|
needs: ['release']
|
||||||
|
name: Generate changelog
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: 'develop'
|
||||||
|
token: ${{ secrets.PAT }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Get latest tag
|
||||||
|
id: latest_tag
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Generate a changelog
|
||||||
|
uses: orhun/git-cliff-action@v1
|
||||||
|
id: git-cliff
|
||||||
|
with:
|
||||||
|
config: cliff.toml
|
||||||
|
args: v0.0.4..${{ steps.latest_tag.outputs.TAG_NAME }}
|
||||||
|
env:
|
||||||
|
OUTPUT: ${{ github.workspace }}/CHANGELOG.md
|
||||||
|
|
||||||
|
- name: Show CHANGELOG
|
||||||
|
run: |
|
||||||
|
cat CHANGELOG.md
|
||||||
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: 'docs(changelog): update changelog'
|
||||||
|
file_pattern: CHANGELOG.md
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
name: 'Close stale issues and PRs'
|
||||||
|
|
||||||
|
# Both `issue_comment` and `scheduled` event types are required for this Action
|
||||||
|
# to work properly.
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
schedule:
|
||||||
|
- cron: '30 1 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v5
|
||||||
|
with:
|
||||||
|
days-before-stale: 14
|
||||||
|
days-before-close: 7
|
||||||
|
exempt-all-milestones: true
|
||||||
|
close-issue-reason: not_planned
|
||||||
|
only-labels: '❔ User Input'
|
||||||
|
labels-to-remove-when-unstale: '❔ User Input,💤 Stale'
|
||||||
|
stale-issue-label: '💤 Stale'
|
||||||
|
stale-pr-label: '💤 Stale'
|
||||||
|
stale-issue-message: |
|
||||||
|
Ahoi!
|
||||||
|
|
||||||
|
It looks like there hasn't been any recent updates on
|
||||||
|
this issue. If you created this issue and no longer
|
||||||
|
consider it to get merged, then please login to github
|
||||||
|
and close it. Otherwise, if there is no further activity
|
||||||
|
on this issue, it will be automatically closedwithin the
|
||||||
|
next 7 days.
|
||||||
|
|
||||||
|
Fair wind and a following sea!
|
||||||
|
~ Your friendly MainsailGithubBot
|
||||||
|
|
||||||
|
*PS: I'm just an automated script, not a real sailor.*
|
||||||
|
stale-pr-message: |
|
||||||
|
Ahoi!
|
||||||
|
|
||||||
|
It looks like there hasn't been any recent updates on
|
||||||
|
this pull request. If you created this pull request and
|
||||||
|
no longer consider it to get merged, then please login
|
||||||
|
to github and close it. Otherwise, if there is no further
|
||||||
|
activity on this pull request, it will be automatically
|
||||||
|
closed within the next 7 days.
|
||||||
|
|
||||||
|
Fair wind and a following sea!
|
||||||
|
~ Your friendly MainsailGithubBot
|
||||||
|
|
||||||
|
*PS: I'm just an automated script, not a real sailor.*
|
||||||
@@ -14,12 +14,12 @@ jobs:
|
|||||||
# container: cypress/browsers:node16.13.2-chrome97-ff96
|
# container: cypress/browsers:node16.13.2-chrome97-ff96
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install node
|
- name: Install node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
node-version: 20
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
@@ -28,6 +28,6 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Cypress run
|
- name: Cypress run
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v4
|
||||||
with:
|
with:
|
||||||
start: npm start
|
start: npm run preview
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
name: Update changelog
|
|
||||||
|
|
||||||
on:
|
|
||||||
# Update the changelog after pushing a new tag
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
# Update the changelog by invoking this workflow manually
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
changelog:
|
|
||||||
name: Generate changelog
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Get latest tag
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"
|
|
||||||
id: latest_tag
|
|
||||||
- name: Generate a changelog
|
|
||||||
uses: orhun/git-cliff-action@v1
|
|
||||||
id: git-cliff
|
|
||||||
with:
|
|
||||||
config: cliff.toml
|
|
||||||
args: v0.0.4..${{ steps.latest_tag.outputs.TAG_NAME }}
|
|
||||||
env:
|
|
||||||
OUTPUT: CHANGELOG.md
|
|
||||||
|
|
||||||
- name: show CHANGELOG
|
|
||||||
run: |
|
|
||||||
cat CHANGELOG.md
|
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
commit_message: 'chore(changelog): update changelog'
|
|
||||||
file_pattern: CHANGELOG.md
|
|
||||||
branch: develop
|
|
||||||
@@ -4,15 +4,19 @@ design
|
|||||||
*.log
|
*.log
|
||||||
packages/test
|
packages/test
|
||||||
dist
|
dist
|
||||||
|
dev-dist
|
||||||
temp
|
temp
|
||||||
.vuerc
|
.vuerc
|
||||||
.version
|
.version
|
||||||
.versions
|
.versions
|
||||||
.changelog
|
.changelog
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
package-lock.json
|
package-lock.json
|
||||||
*.local
|
*.local
|
||||||
.env
|
.env
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
cypress/screenshots/
|
||||||
cypress/videos/
|
cypress/videos/
|
||||||
components.d.ts
|
components.d.ts
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
"semi": false,
|
"semi": false,
|
||||||
"printWidth": 120,
|
"printWidth": 120,
|
||||||
"bracketSameLine": true,
|
"bracketSameLine": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
"htmlWhitespaceSensitivity": "ignore",
|
"htmlWhitespaceSensitivity": "ignore",
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
|||||||
+1424
-608
File diff suppressed because it is too large.
Load diff
+69
-25
@@ -1,43 +1,87 @@
|
|||||||
# Mainsail Contributing Guide
|
# Contributing to Mainsail
|
||||||
|
|
||||||
Hi! I'm really excited that you are interested in contributing to Mainsail. Before submitting your contribution, please make sure to take a moment and read through the following guidelines:
|
If you are reading this document right now, you are probably considering contributing to Mainsail and making it better
|
||||||
|
than it is today. Thank you for taking that initiative! Before submitting your contribution, please take a moment and
|
||||||
|
make sure to read through our contribution guidelines:
|
||||||
|
|
||||||
- [Code of Conduct](https://github.com/meteyou/mainsail/.github/CODE_OF_CONDUCT.md)
|
- [Code of Conduct](https://github.com/mainsail-crew/mainsail/blob/develop/.github/CODE_OF_CONDUCT.md)
|
||||||
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
|
- [Question or Problem?](#question)
|
||||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
- [Issues and Bugs](#issue)
|
||||||
|
- [Feature Requests](#feature)
|
||||||
|
- [Submission Guidelines](#submit)
|
||||||
|
- [Submit an Issue](#submit-issue)
|
||||||
|
- [Submit a Pull Request](#submit-pr)
|
||||||
|
- [Financial Contributions](#financial)
|
||||||
|
- [Credits](https://docs.mainsail.xyz/credits)
|
||||||
|
|
||||||
## Issue Reporting Guidelines
|
## <a name="question"></a> Got a Question or Problem?
|
||||||
|
|
||||||
- Use [https://github.com/meteyou/mainsail/issues](https://github.com/meteyou/mainsail/issues) to create new issues.
|
Please do not open issues for general support questions. We want to keep GitHub issues for bug reports and feature
|
||||||
|
requests. Instead, please visit us on [Discord](https://discord.gg/mainsail) to ask support-related questions.
|
||||||
|
|
||||||
## Pull Request Guidelines
|
Our Discord server is a much better place to ask general support questions. We take a right to close issues that are
|
||||||
|
requests for generic support and redirect people to Discord.
|
||||||
|
|
||||||
- The `master` branch is just a snapshot of the latest stable release. All development should be done in dedicated branches. **Do not submit PRs against the `master` branch.**
|
## <a name="issue"></a> Found a Bug?
|
||||||
|
|
||||||
- Checkout a topic branch from the relevant branch, e.g. `develop`, and merge back against that branch.
|
If you find a bug in the source code or think that Mainsail is behaving odd in specific situations, you can help us fix
|
||||||
|
that issue by [submitting an issue](https://github.com/mainsail-crew/mainsail/issues/new?assignees=&labels=%E2%9A%A1+Type%3A+Bug&template=bug_report.yml).
|
||||||
|
If you have already fixed that issue, you can [submit a Pull Request](#submit-pr) with that fix.
|
||||||
|
|
||||||
- It's OK to have multiple small commits as you work on the PR - GitHub will automatically squash it before merging.
|
## <a name="feature"></a> Missing a Feature?
|
||||||
|
|
||||||
- If adding a new feature:
|
You can request a new feature by [submitting a feature request](https://github.com/mainsail-crew/mainsail/issues/new?assignees=&labels=%F0%9F%92%A1+Type%3A+FR&template=feature_request.yml).
|
||||||
|
If you would like to implement a new feature, please consider the scope of the change. For changes requiring a lot of
|
||||||
|
work, it's best to outline a proposal first so it can be discussed. This allows us to prevent wasted time and effort and
|
||||||
|
discuss how to bring your proposed feature into the project.
|
||||||
|
|
||||||
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
|
## <a name="submit"></a> Submission Guidelines
|
||||||
|
|
||||||
- If fixing bug:
|
### <a name="submit-issue"></a> Submitting an Issue
|
||||||
- If you are resolving a special issue, add `(fix #xxxx[,#xxxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `update entities encoding/decoding (fix #3899)`.
|
|
||||||
- Provide a detailed description of the bug in the PR. Live demo preferred.
|
|
||||||
- Add appropriate test coverage if applicable.
|
|
||||||
|
|
||||||
## Committing Changes
|
Before you submit an issue, please search the issue tracker if your problem may already exist. If a ticket already
|
||||||
|
covers your case, please refrain from opening a new ticket and instead contribute to the existing ticket. If you submit
|
||||||
|
an issue, please provide the required information and reproduction steps. We need those to be able to try and reproduce
|
||||||
|
the bug ourselves. Without proper instructions on how to reproduce the issue you are encountering, we might be unable to
|
||||||
|
fix a possible bug.
|
||||||
|
|
||||||
Commit messages should follow the [commit message convention](https://www.conventionalcommits.org/en/v1.0.0/) so that changelogs can be automatically generated.
|
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
|
||||||
|
|
||||||
## Financial Contribution
|
Before you work on a PR and submit it, please pay attention to the following guidelines:
|
||||||
|
|
||||||
As a pure community-driven project without major corporate backing, we also welcome financial contributions via Patreon and OpenCollective.
|
1. Search the [pull requests](https://github.com/mainsail-crew/mainsail/pulls) for an open or closed PR related to your submission.
|
||||||
|
- You don't want to duplicate existing efforts or work on something unlikely to be merged into the project.
|
||||||
|
2. Do not submit PRs against the `master` branch. PRs need to be submitted against the `develop` branch.
|
||||||
|
3. Follow our [Code Standards](https://docs.mainsail.xyz/overview/developement/code-standards)
|
||||||
|
4. If there is an issue describing the problem you're fixing or a discussion of a feature you are implementing, make sure to link it in the PRs body.
|
||||||
|
|
||||||
- [Become a supporter on Patreon](https://patreon.com/meteyou)
|
- You can also add `fix #<id>` or `fixes #<id>` in the PR body where `<id>` is the issue id.
|
||||||
- [One-time donation via Ko-Fi](https://ko-fi.com/mainsail)
|
- Example PR title, body and sign-off:
|
||||||
|
|
||||||
## Credits
|
```
|
||||||
|
fix: incorrect handling of click event
|
||||||
|
|
||||||
Thank you to all the people who have already contributed to Mainsail!
|
This PR will fix #123.
|
||||||
|
Fixes correct handling of click event when button [X] is clicked.
|
||||||
|
|
||||||
|
Signed-off-by: James Smith <james.smith@myvalidemail.com>
|
||||||
|
```
|
||||||
|
|
||||||
|
5. If there is no issue describing the problem, create an issue first or provide a sufficient description of the bug/feature.
|
||||||
|
- Screenshots of your changes are welcome if you worked on UI-related code.
|
||||||
|
6. The title of the PR should follow the [commit message convention](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||||
|
- If the PR consists of multiple commits, it's good practice to follow the convention, although that is not necessarily required.
|
||||||
|
- Upon merging, we will squash all commits of the PR into a single commit for a clean history and release changelogs.
|
||||||
|
7. Please sign off each commit and your PR. It must contain your real name and a current email address (see example in item 4).
|
||||||
|
- The sign-off should follow this pattern: `Signed-off-by: My Name <myemail@example.org>`
|
||||||
|
- The sign-off certifies that you agree with the [developer certificate of origin](https://github.com/mainsail-crew/mainsail/blob/develop/.github/DEVELOPER_CERTIFICATE_OF_ORIGIN.md).
|
||||||
|
- If you provide a translation, a sign-off is not necessarily required.
|
||||||
|
8. When opening a pull request, keep `Allow edits and access to secrets by maintainers` **enabled**.
|
||||||
|
|
||||||
|
## <a name="financial"></a> Financial Contribution
|
||||||
|
|
||||||
|
As a community-driven project without primary corporate backing, we always welcome financial contributions. A list of
|
||||||
|
options we offer to support us financially can be seen below.
|
||||||
|
|
||||||
|
- [Become a supporter on Patreon](https://patreon.com/meteyou) (monthly recurring)
|
||||||
|
- [Donation via Ko-Fi](https://ko-fi.com/mainsail) (one time / monthly recurring)
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# Builder stage, builds the application in node
|
# Builder stage, builds the application in node
|
||||||
#
|
#
|
||||||
FROM node:16-alpine as builder
|
FROM --platform=$BUILDPLATFORM node:20-alpine as builder
|
||||||
|
|
||||||
RUN apk add zip
|
RUN apk add zip
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ You can find the latest release notes [here](https://github.com/mainsail-crew/ma
|
|||||||
- **Power Control:** _Control power devices such as relays, TP-Link and Tasmota devices, and more_
|
- **Power Control:** _Control power devices such as relays, TP-Link and Tasmota devices, and more_
|
||||||
- **Powerful Macro-Management:** _Manage your macros on a micro level_
|
- **Powerful Macro-Management:** _Manage your macros on a micro level_
|
||||||
- **[Configurable Dashboard](https://docs.mainsail.xyz/features/dashboard-organisation):** _Create your own personal dashboard_
|
- **[Configurable Dashboard](https://docs.mainsail.xyz/features/dashboard-organisation):** _Create your own personal dashboard_
|
||||||
- **[Theming Support](https://docs.mainsail.xyz/features/theming/):** _Customizable user interface including logos, backgrounds, and custom CSS_
|
- **[Theming Support](https://docs.mainsail.xyz/features/theming):** _Customizable user interface including logos, backgrounds, and custom CSS_
|
||||||
- **[Additional Sensors](https://docs.mainsail.xyz/quicktips/additional-sensors):** _Add extra sensors to the temperature graph_
|
- **[Additional Sensors](https://docs.mainsail.xyz/quicktips/additional-sensors):** _Add extra sensors to the temperature graph_
|
||||||
- **Exclude Objects:** _Exclude parts of your print <sup>(not officially supported by Klipper yet)</sup>_
|
- **Exclude Objects:** _Exclude parts of your print <sup>(not officially supported by Klipper yet)</sup>_
|
||||||
|
|
||||||
@@ -84,6 +84,14 @@ Do you need help or just want to talk? Join our active community on [Discord](ht
|
|||||||
Did you find a bug or did you thought of a feature?
|
Did you find a bug or did you thought of a feature?
|
||||||
Please create an [Issue](https://github.com/mainsail-crew/mainsail/issues) in GitHub and let us know.
|
Please create an [Issue](https://github.com/mainsail-crew/mainsail/issues) in GitHub and let us know.
|
||||||
|
|
||||||
|
## Official Sponsors
|
||||||
|
|
||||||
|
<p align='center'>
|
||||||
|
<img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo-bigtreetech.png" alt='Mainsail logo' width="150">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
**BIGTREETECH** is the official mainboard partner of Mainsail. BIGTREETECH is committed to developing innovative and competitive products to better serve the 3D printing community.
|
||||||
|
|
||||||
## Support Mainsail
|
## Support Mainsail
|
||||||
|
|
||||||
Mainsail is primarily developed and maintained by meteyou. To keep the project going he invests his free time, almost
|
Mainsail is primarily developed and maintained by meteyou. To keep the project going he invests his free time, almost
|
||||||
@@ -92,6 +100,19 @@ every day. To motivate him (☕🍺😜) there are several ways to support him:
|
|||||||
[](https://www.patreon.com/meteyou)
|
[](https://www.patreon.com/meteyou)
|
||||||
[](https://ko-fi.com/mainsail)
|
[](https://ko-fi.com/mainsail)
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
Contributions to Mainsail are always welcome!
|
||||||
|
|
||||||
|
- 📥 Pull requests and 🌟 Stars are always welcome.
|
||||||
|
- Read our [contributing guidelines](CONTRIBUTING.md) to get started,
|
||||||
|
or find us on [Discord](https://discord.gg/mainsail), we will take the time to guide you.
|
||||||
|
|
||||||
|
Looking for a first issue to tackle?
|
||||||
|
|
||||||
|
- We tag issues with [](https://github.com/mainsail-crew/mainsail/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) when we think they are well suited for people who are new to the codebase or OSS in general.
|
||||||
|
- [Talk to us](https://discord.gg/mainsail), we'll find something that suits your skills and learning interest.
|
||||||
|
|
||||||
## Credit, sources and inspiration
|
## Credit, sources and inspiration
|
||||||
|
|
||||||
- [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
|
- [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
# configuration file for git-cliff (0.1.0)
|
||||||
|
|
||||||
|
[changelog]
|
||||||
|
# changelog header
|
||||||
|
header = """
|
||||||
|
# What's Changed
|
||||||
|
"""
|
||||||
|
# template for the changelog body
|
||||||
|
# https://tera.netlify.app/docs/#introduction
|
||||||
|
body = """
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}\
|
||||||
|
### {{ group | striptags | trim | upper_first }}
|
||||||
|
{% for commit in commits
|
||||||
|
| filter(attribute="scope")
|
||||||
|
| sort(attribute="scope") %}
|
||||||
|
- **{{commit.scope}}**: {{ commit.message | upper_first | trim }}\
|
||||||
|
{%- if commit.breaking %}
|
||||||
|
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- for commit in commits %}
|
||||||
|
{%- if commit.scope -%}
|
||||||
|
{% else -%}
|
||||||
|
{% raw %}\n{% endraw %}\
|
||||||
|
- {{ commit.message | upper_first | trim }}\
|
||||||
|
{%- if commit.breaking %}
|
||||||
|
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{% endif -%}
|
||||||
|
{% endfor -%}
|
||||||
|
{% raw %}\n{% endraw %}
|
||||||
|
{% endfor %}\n\
|
||||||
|
"""
|
||||||
|
# remove the leading and trailing whitespaces from the template
|
||||||
|
trim = true
|
||||||
|
# changelog footer
|
||||||
|
footer = """
|
||||||
|
"""
|
||||||
|
|
||||||
|
# postprocessors
|
||||||
|
postprocessors = [
|
||||||
|
{ pattern = '<REPO>', replace = "https://github.com/mainsail-crew/mainsail" }, # replace repository URL
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
[git]
|
||||||
|
# allow only conventional commits
|
||||||
|
# https://www.conventionalcommits.org
|
||||||
|
conventional_commits = true
|
||||||
|
filter_unconventional = true
|
||||||
|
# regex for parsing and grouping commits
|
||||||
|
commit_parsers = [
|
||||||
|
|
||||||
|
# Commits to skip
|
||||||
|
{ message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits
|
||||||
|
{ message = "^chore: push version number to", group = "9$Other", skip = true}, # Old redundant commits
|
||||||
|
{ message = "^chore\\(changelog\\): update changelog", group = "Changelog", skip = true}, # Old redundant commits
|
||||||
|
|
||||||
|
# Commits to parse
|
||||||
|
{ message = "^feat(\\(.*\\))?:", group = "<!-- 1 -->Features"},
|
||||||
|
{ message = "^feature(\\(.*\\))?:", group = "<!-- 1 -->Features"},
|
||||||
|
{ message = "^fix(\\(.*\\))?:", group = "<!-- 2 -->Bug Fixes and Improvements"},
|
||||||
|
{ message = "^perf(\\(.*\\))?:", group = "<!-- 3 -->Performance"},
|
||||||
|
{ message = "^refactor(\\(.*\\))?:", group = "<!-- 4 -->Refactor"},
|
||||||
|
{ message = "^style(\\(.*\\))?:", group = "<!-- 5 -->Styling"},
|
||||||
|
{ message = "^locale(\\(.*\\))?:", group = "<!-- 6 -->Localization"},
|
||||||
|
{ message = "^docs(\\(.*\\))?:", group = "<!-- 7 -->Documentation"},
|
||||||
|
{ message = "^test(\\(.*\\))?:", group = "<!-- 8 -->Other"},
|
||||||
|
{ message = "^chore(\\(.*\\))?:", group = "<!-- 8 -->Other"},
|
||||||
|
|
||||||
|
{ body = ".*security", group = "Security"},
|
||||||
|
]
|
||||||
|
commit_preprocessors = [
|
||||||
|
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/pull/${2}))" },
|
||||||
|
]
|
||||||
|
# filter out the commits that are not matched by commit parsers
|
||||||
|
filter_commits = true
|
||||||
|
ignore_tags="v*-(beta|rc)*"
|
||||||
|
# glob pattern for matching git tags
|
||||||
|
tag_pattern = "v[0-9]*"
|
||||||
+31
-17
@@ -17,25 +17,23 @@ body = """
|
|||||||
## [unreleased]
|
## [unreleased]
|
||||||
{% endif %}\
|
{% endif %}\
|
||||||
{% for group, commits in commits | group_by(attribute="group") %}\
|
{% for group, commits in commits | group_by(attribute="group") %}\
|
||||||
### {{ group | upper_first }}
|
### {{ group | striptags | trim | upper_first }}
|
||||||
{% for commit in commits
|
{% for commit in commits
|
||||||
| filter(attribute="scope")
|
| filter(attribute="scope")
|
||||||
| sort(attribute="scope") %}
|
| sort(attribute="scope") %}
|
||||||
- **{{commit.scope}}**: {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})\
|
- **{{commit.scope}}**: {{ commit.message | upper_first | trim }}\
|
||||||
{%- if commit.breaking %}
|
{%- if commit.breaking %}
|
||||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
{%- for commit in commits %}
|
{%- for commit in commits %}
|
||||||
{%- if commit.scope -%}
|
{%- if commit.scope -%}
|
||||||
{% else -%}
|
{% else -%}
|
||||||
{% raw %}\n{% endraw %}\
|
{% raw %}\n{% endraw %}\
|
||||||
- {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})\
|
- {{ commit.message | upper_first | trim }}\
|
||||||
{%- if commit.breaking %}
|
{%- if commit.breaking %}
|
||||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
{% raw %}\n{% endraw %}
|
{% raw %}\n{% endraw %}
|
||||||
@@ -47,6 +45,11 @@ trim = true
|
|||||||
footer = """
|
footer = """
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# postprocessors
|
||||||
|
postprocessors = [
|
||||||
|
{ pattern = '<REPO>', replace = "https://github.com/mainsail-crew/mainsail" }, # replace repository URL
|
||||||
|
]
|
||||||
|
|
||||||
[git]
|
[git]
|
||||||
# allow only conventional commits
|
# allow only conventional commits
|
||||||
# https://www.conventionalcommits.org
|
# https://www.conventionalcommits.org
|
||||||
@@ -54,22 +57,33 @@ conventional_commits = true
|
|||||||
filter_unconventional = false
|
filter_unconventional = false
|
||||||
# regex for parsing and grouping commits
|
# regex for parsing and grouping commits
|
||||||
commit_parsers = [
|
commit_parsers = [
|
||||||
|
|
||||||
|
# Commits to skip
|
||||||
{ message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits
|
{ message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits
|
||||||
{ message = "^feat(\\(.*\\))?:", group = "Features"},
|
{ message = "^chore: push version number to", group = "9$Other", skip = true}, # Old redundant commits
|
||||||
{ message = "^feature(\\(.*\\))?:", group = "Features"},
|
{ message = "^chore\\(changelog\\): update changelog", group = "Changelog", skip = true}, # Old redundant commits
|
||||||
{ message = "^fix(\\(.*\\))?:", group = "Bug Fixes"},
|
|
||||||
{ message = "^docs(\\(.*\\))?:", group = "Documentation"},
|
# Commits to parse
|
||||||
{ message = "^perf(\\(.*\\))?:", group = "Performance"},
|
{ message = "^feat(\\(.*\\))?:", group = "<!-- 1 -->Features"},
|
||||||
{ message = "^refactor(\\(.*\\))?:", group = "Refactor"},
|
{ message = "^feature(\\(.*\\))?:", group = "<!-- 1 -->Features"},
|
||||||
{ message = "^style(\\(.*\\))?:", group = "Styling"},
|
{ message = "^fix(\\(.*\\))?:", group = "<!-- 2 -->Bug Fixes and Improvements"},
|
||||||
{ message = "^test(\\(.*\\))?:", group = "Testing"},
|
{ message = "^perf(\\(.*\\))?:", group = "<!-- 3 -->Performance"},
|
||||||
{ message = "^locale(\\(.*\\))?:", group = "Localization"},
|
{ message = "^refactor(\\(.*\\))?:", group = "<!-- 4 -->Refactor"},
|
||||||
{ message = "^chore(\\(.*\\))?:", group = "Miscellaneous Tasks", skip = true}, # chore tasks are not relevant for the changelog
|
{ message = "^style(\\(.*\\))?:", group = "<!-- 5 -->Styling"},
|
||||||
{ body = ".*security", group = "Security"},
|
{ message = "^locale(\\(.*\\))?:", group = "<!-- 6 -->Localization"},
|
||||||
|
{ message = "^docs(\\(.*\\))?:", group = "<!-- 7 -->Documentation"},
|
||||||
|
{ message = "^test(\\(.*\\))?:", group = "<!-- 8 -->Other"},
|
||||||
|
{ message = "^chore(\\(.*\\))?:", group = "<!-- 8 -->Other"},
|
||||||
|
|
||||||
{ message = "release v2.1.2", group = "Release"}, # workaround for v2.1.2 release
|
{ message = "release v2.1.2", group = "Release"}, # workaround for v2.1.2 release
|
||||||
|
|
||||||
|
{ body = ".*security", group = "Security"},
|
||||||
|
]
|
||||||
|
commit_preprocessors = [
|
||||||
|
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/pull/${2}))" },
|
||||||
]
|
]
|
||||||
# filter out the commits that are not matched by commit parsers
|
# filter out the commits that are not matched by commit parsers
|
||||||
filter_commits = true
|
filter_commits = true
|
||||||
ignore_tags="v*-(beta|rc)*"
|
ignore_tags="v*-(beta|rc)*"
|
||||||
# glob pattern for matching git tags
|
# glob pattern for matching git tags
|
||||||
tag_pattern = "v[0-9]*"
|
tag_pattern = "v[0-9]*"
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { defineConfig } from 'cypress'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
e2e: {
|
||||||
|
// We've imported your old cypress plugins here.
|
||||||
|
// You may want to clean this up later by importing these.
|
||||||
|
setupNodeEvents(on, config) {
|
||||||
|
// @ts-ignore
|
||||||
|
return require('./cypress/plugins/index.js')(on, config)
|
||||||
|
},
|
||||||
|
baseUrl: 'http://localhost:4173',
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"baseUrl": "http://localhost:4173"
|
|
||||||
}
|
|
||||||
File renamed without changes.
File renamed without changes.
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<script type="module" src="/src/main.ts"></script>
|
<script type="module" src="/src/main.ts"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body style="background-color: #121212">
|
||||||
<noscript>
|
<noscript>
|
||||||
<strong>
|
<strong>
|
||||||
We're sorry but Mainsail doesn't work properly without JavaScript enabled. Please enable it to continue.
|
We're sorry but Mainsail doesn't work properly without JavaScript enabled. Please enable it to continue.
|
||||||
|
|||||||
Generated
+4325
-9901
File diff suppressed because it is too large.
Load diff
+52
-41
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mainsail",
|
"name": "mainsail",
|
||||||
"version": "2.2.0",
|
"version": "2.8.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"decription": "a klipper web interface",
|
"decription": "a klipper web interface",
|
||||||
"author": {
|
"author": {
|
||||||
@@ -16,39 +16,44 @@
|
|||||||
"lint:fix": "npm run lint -- --fix",
|
"lint:fix": "npm run lint -- --fix",
|
||||||
"build.zip": "cd ./dist && zip -r mainsail.zip ./ -x '**.DS_Store' ./ && cd ..",
|
"build.zip": "cd ./dist && zip -r mainsail.zip ./ -x '**.DS_Store' ./ && cd ..",
|
||||||
"i18n-extract": "vue-i18n-extract use-config",
|
"i18n-extract": "vue-i18n-extract use-config",
|
||||||
"start": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "npm run build && cypress run",
|
"start": "vite build && vite preview",
|
||||||
|
"test": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress run'",
|
||||||
"test:ui": "cypress open",
|
"test:ui": "cypress open",
|
||||||
"changelog": "git cliff v0.0.4..$(git describe --tags $(git rev-list --tags --max-count=1)) --output CHANGELOG.md"
|
"changelog": "git cliff v0.0.4..$(git describe --tags $(git rev-list --tags --max-count=1)) --output CHANGELOG.md"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/basic-setup": "^0.19.0",
|
"@codemirror/commands": "^6.0.1",
|
||||||
"@codemirror/highlight": "^0.19.6",
|
"@codemirror/lang-css": "^6.0.0",
|
||||||
"@codemirror/lang-javascript": "^0.19.3",
|
"@codemirror/lang-json": "^6.0.0",
|
||||||
"@codemirror/lang-json": "^0.19.1",
|
"@codemirror/language": "^6.2.0",
|
||||||
"@codemirror/language": "^0.19.7",
|
"@codemirror/legacy-modes": "^6.1.0",
|
||||||
"@codemirror/legacy-modes": "^0.19.0",
|
"@codemirror/search": "^6.0.0",
|
||||||
"@codemirror/search": "^0.19.4",
|
"@codemirror/state": "^6.1.0",
|
||||||
"@codemirror/state": "^0.19.6",
|
"@codemirror/view": "^6.0.3",
|
||||||
"@codemirror/stream-parser": "^0.19.2",
|
"@jaames/iro": "^5.5.2",
|
||||||
"@codemirror/view": "^0.19.28",
|
"@lezer/highlight": "^1.0.0",
|
||||||
"@sindarius/gcodeviewer": "^3.1.0",
|
"@sindarius/gcodeviewer": "^3.2.2",
|
||||||
"@types/node": "^16.11.22",
|
"@uiw/codemirror-theme-vscode": "^4.19.11",
|
||||||
"@types/overlayscrollbars": "^1.12.1",
|
"axios": "^1.6.0",
|
||||||
"axios": "^0.26.0",
|
"codemirror": "^6.0.1",
|
||||||
"core-js": "^3.16.0",
|
"core-js": "^3.16.0",
|
||||||
|
"detect-browser": "^5.3.0",
|
||||||
"echarts": "^5.2.2",
|
"echarts": "^5.2.2",
|
||||||
"echarts-gl": "^2.0.8",
|
"echarts-gl": "^2.0.8",
|
||||||
"js-sha256": "^0.9.0",
|
"hls.js": "^1.3.3",
|
||||||
|
"jmuxer": "^2.0.5",
|
||||||
|
"js-sha256": "^0.10.0",
|
||||||
"lodash.kebabcase": "^4.1.1",
|
"lodash.kebabcase": "^4.1.1",
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"overlayscrollbars": "^1.13.1",
|
"overlayscrollbars": "^1.13.1",
|
||||||
"overlayscrollbars-vue": "^0.2.2",
|
"overlayscrollbars-vue": "^0.2.2",
|
||||||
"regenerator-runtime": "^0.13.9",
|
"regenerator-runtime": "^0.14.0",
|
||||||
"resize-observer-polyfill": "^1.5.1",
|
"resize-observer-polyfill": "^1.5.1",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.5.2",
|
||||||
"uuid": "^8.3.2",
|
"typed_janus_js": "^1.0.14",
|
||||||
"vue": "^2.6.14",
|
"uuid": "^9.0.0",
|
||||||
|
"vue": "^2.7.10",
|
||||||
"vue-class-component": "^7.2.6",
|
"vue-class-component": "^7.2.6",
|
||||||
"vue-echarts": "^6.0.2",
|
"vue-echarts": "^6.0.2",
|
||||||
"vue-i18n": "^8.25.0",
|
"vue-i18n": "^8.25.0",
|
||||||
@@ -59,40 +64,46 @@
|
|||||||
"vue-resize": "^1.0.1",
|
"vue-resize": "^1.0.1",
|
||||||
"vue-toast-notification": "^0.6.1",
|
"vue-toast-notification": "^0.6.1",
|
||||||
"vuedraggable": "^2.24.3",
|
"vuedraggable": "^2.24.3",
|
||||||
"vuetify": "^2.6.1",
|
"vuetify": "^2.6.10",
|
||||||
"vuex": "^3.6.2"
|
"vuex": "^3.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@intlify/vite-plugin-vue-i18n": "^2.5.0",
|
"@intlify/vite-plugin-vue-i18n": "^2.5.0",
|
||||||
"@mdi/js": "^6.5.95",
|
"@mdi/js": "^7.0.0",
|
||||||
|
"@types/file-saver": "^2.0.5",
|
||||||
|
"@types/jmuxer": "^2.0.3",
|
||||||
"@types/lodash.kebabcase": "^4.1.6",
|
"@types/lodash.kebabcase": "^4.1.6",
|
||||||
"@types/lodash.throttle": "^4.1.6",
|
"@types/lodash.throttle": "^4.1.6",
|
||||||
|
"@types/node": "^20.0.0",
|
||||||
|
"@types/overlayscrollbars": "^1.12.1",
|
||||||
"@types/semver": "^7.3.8",
|
"@types/semver": "^7.3.8",
|
||||||
"@types/uuid": "^8.3.1",
|
"@types/uuid": "^9.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^5.11.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
"@vue/composition-api": "^1.4.6",
|
"@vue/eslint-config-typescript": "^12.0.0",
|
||||||
"@vue/eslint-config-typescript": "^10.0.0",
|
|
||||||
"autoprefixer": "^10.4.2",
|
"autoprefixer": "^10.4.2",
|
||||||
"cypress": "^9.5.0",
|
"cypress": "^13.2.0",
|
||||||
"eslint": "^8.9.0",
|
"eslint": "^8.9.0",
|
||||||
"eslint-config-prettier": "^8.3.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-jsonc": "^2.2.1",
|
"eslint-plugin-jsonc": "^2.2.1",
|
||||||
"eslint-plugin-vue": "^8.4.1",
|
"eslint-plugin-vue": "^9.0.0",
|
||||||
"prettier": "^2.5.1",
|
"postcss": "^8.4.31",
|
||||||
|
"postcss-nesting": "^12.0.1",
|
||||||
|
"prettier": "^3.0.0",
|
||||||
"sass": "~1.32",
|
"sass": "~1.32",
|
||||||
|
"start-server-and-test": "^2.0.0",
|
||||||
"typescript": "^4.5.5",
|
"typescript": "^4.5.5",
|
||||||
"unplugin-vue-components": "^0.18.0",
|
"unplugin-vue-components": "^0.22.12",
|
||||||
"vite": "^2.7.13",
|
"vite": "^4.4.9",
|
||||||
"vite-plugin-checker": "^0.4.2",
|
"vite-plugin-checker": "^0.6.0",
|
||||||
"vite-plugin-package-version": "^1.0.2",
|
"vite-plugin-package-version": "^1.0.2",
|
||||||
"vite-plugin-pwa": "^0.11.13",
|
"vite-plugin-pwa": "^0.16.4",
|
||||||
"vite-plugin-vue2": "^1.9.3",
|
"vite-plugin-vue2": "^2.0.1",
|
||||||
"vue-debounce-decorator": "^1.0.1",
|
"vue-debounce-decorator": "^1.0.1",
|
||||||
"vue-i18n-extract": "^1.2.3",
|
"vue-i18n-extract": "^2.0.7",
|
||||||
"vue-router": "^3.5.2",
|
"vue-router": "^3.5.2",
|
||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.6.14",
|
||||||
"workbox-core": "^6.4.2"
|
"workbox-core": "^7.0.0"
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
@@ -110,6 +121,6 @@
|
|||||||
"last 2 edge major versions"
|
"last 2 edge major versions"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^16"
|
"node": "^18 || ^20"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+5
-1
@@ -1,3 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"defaultLocale": "en",
|
||||||
|
"hostname": null,
|
||||||
|
"port": null,
|
||||||
|
"instancesDB": "moonraker",
|
||||||
|
"instances": []
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^index\.html$ - [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /index.html [L]
|
||||||
|
</IfModule>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"defaultLocale": "en",
|
||||||
|
"hostname": null,
|
||||||
|
"port": null,
|
||||||
|
"instancesDB": "browser",
|
||||||
|
"instances": []
|
||||||
|
}
|
||||||
+92
-56
@@ -1,50 +1,25 @@
|
|||||||
<style>
|
|
||||||
@import './assets/styles/fonts.css';
|
|
||||||
@import './assets/styles/toastr.css';
|
|
||||||
@import './assets/styles/page.scss';
|
|
||||||
@import './assets/styles/sidebar.scss';
|
|
||||||
@import './assets/styles/utils.scss';
|
|
||||||
@import './assets/styles/updateManager.scss';
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--app-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content {
|
|
||||||
background-attachment: fixed;
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*noinspection CssUnusedSymbol*/
|
|
||||||
.v-btn:not(.v-btn--outlined).primary {
|
|
||||||
/*noinspection CssUnresolvedCustomProperty*/
|
|
||||||
color: var(--v-btn-text-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content-scrollbar {
|
|
||||||
height: calc(var(--app-height) - 48px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-app dark :style="cssVars">
|
<v-app dark :style="cssVars">
|
||||||
<the-sidebar></the-sidebar>
|
<template v-if="socketIsConnected && guiIsReady">
|
||||||
<the-topbar></the-topbar>
|
<the-sidebar />
|
||||||
<v-main id="content" :style="mainStyle">
|
<the-topbar />
|
||||||
<overlay-scrollbars class="main-content-scrollbar">
|
<v-main id="content" :style="mainStyle">
|
||||||
<v-container id="page-container" fluid class="container px-3 px-sm-6 py-sm-6 mx-auto">
|
<v-container id="page-container" fluid class="container px-3 px-sm-6 py-sm-6 mx-auto">
|
||||||
<router-view></router-view>
|
<router-view />
|
||||||
</v-container>
|
</v-container>
|
||||||
</overlay-scrollbars>
|
</v-main>
|
||||||
</v-main>
|
<the-service-worker />
|
||||||
<the-select-printer-dialog v-if="remoteMode"></the-select-printer-dialog>
|
<the-update-dialog />
|
||||||
<the-connecting-dialog v-else></the-connecting-dialog>
|
<the-editor />
|
||||||
<the-update-dialog></the-update-dialog>
|
<the-timelapse-rendering-snackbar />
|
||||||
<the-editor></the-editor>
|
<the-fullscreen-upload />
|
||||||
<the-timelapse-rendering-snackbar></the-timelapse-rendering-snackbar>
|
<the-upload-snackbar />
|
||||||
<the-fullscreen-upload></the-fullscreen-upload>
|
<the-manual-probe-dialog />
|
||||||
<the-upload-snackbar></the-upload-snackbar>
|
<the-bed-screws-dialog />
|
||||||
|
<the-screws-tilt-adjust-dialog />
|
||||||
|
</template>
|
||||||
|
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'" />
|
||||||
|
<the-connecting-dialog v-else />
|
||||||
</v-app>
|
</v-app>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -62,6 +37,12 @@ import { panelToolbarHeight, topbarHeight, navigationItemHeight } from '@/store/
|
|||||||
import TheTimelapseRenderingSnackbar from '@/components/TheTimelapseRenderingSnackbar.vue'
|
import TheTimelapseRenderingSnackbar from '@/components/TheTimelapseRenderingSnackbar.vue'
|
||||||
import TheFullscreenUpload from '@/components/TheFullscreenUpload.vue'
|
import TheFullscreenUpload from '@/components/TheFullscreenUpload.vue'
|
||||||
import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue'
|
import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue'
|
||||||
|
import TheManualProbeDialog from '@/components/dialogs/TheManualProbeDialog.vue'
|
||||||
|
import TheBedScrewsDialog from '@/components/dialogs/TheBedScrewsDialog.vue'
|
||||||
|
import TheScrewsTiltAdjustDialog from '@/components/dialogs/TheScrewsTiltAdjustDialog.vue'
|
||||||
|
import { setAndLoadLocale } from './plugins/i18n'
|
||||||
|
|
||||||
|
Component.registerHooks(['metaInfo'])
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -74,15 +55,23 @@ import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue'
|
|||||||
TheSidebar,
|
TheSidebar,
|
||||||
TheFullscreenUpload,
|
TheFullscreenUpload,
|
||||||
TheUploadSnackbar,
|
TheUploadSnackbar,
|
||||||
},
|
TheManualProbeDialog,
|
||||||
metaInfo() {
|
TheBedScrewsDialog,
|
||||||
const title = this.$store.getters['getTitle']
|
TheScrewsTiltAdjustDialog,
|
||||||
return {
|
|
||||||
titleTemplate: () => title,
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class App extends Mixins(BaseMixin) {
|
export default class App extends Mixins(BaseMixin) {
|
||||||
|
public metaInfo(): any {
|
||||||
|
let title = this.$store.getters['getTitle']
|
||||||
|
|
||||||
|
if (this.isPrinterPowerOff) title = this.$t('App.Titles.PrinterOff')
|
||||||
|
|
||||||
|
return {
|
||||||
|
title,
|
||||||
|
titleTemplate: '%s',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
get title(): string {
|
get title(): string {
|
||||||
return this.$store.getters['getTitle']
|
return this.$store.getters['getTitle']
|
||||||
}
|
}
|
||||||
@@ -91,13 +80,27 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
return this.$store.getters['files/getMainBackground']
|
return this.$store.getters['files/getMainBackground']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get naviDrawer(): boolean {
|
||||||
|
return this.$store.state.naviDrawer
|
||||||
|
}
|
||||||
|
|
||||||
|
get navigationStyle() {
|
||||||
|
return this.$store.state.gui.uiSettings.navigationStyle
|
||||||
|
}
|
||||||
|
|
||||||
get mainStyle() {
|
get mainStyle() {
|
||||||
let style = ''
|
let style: any = {
|
||||||
|
paddingLeft: '0',
|
||||||
|
}
|
||||||
|
|
||||||
if (this.mainBackground !== null) {
|
if (this.mainBackground !== null) {
|
||||||
style = 'background-image: url(' + this.mainBackground + ');'
|
style.backgroundImage = 'url(' + this.mainBackground + ')'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// overwrite padding left for the sidebar
|
||||||
|
if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
|
||||||
|
if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
|
||||||
|
|
||||||
return style
|
return style
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,12 +159,12 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get print_percent(): number {
|
get print_percent(): number {
|
||||||
return Math.round(this.$store.getters['printer/getPrintPercent'] * 100)
|
return Math.floor(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('language')
|
@Watch('language')
|
||||||
languageChanged(newVal: string): void {
|
async languageChanged(newVal: string): Promise<void> {
|
||||||
this.$i18n.locale = newVal
|
await setAndLoadLocale(newVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('customStylesheet')
|
@Watch('customStylesheet')
|
||||||
@@ -181,8 +184,9 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
|
|
||||||
@Watch('current_file')
|
@Watch('current_file')
|
||||||
current_fileChanged(newVal: string): void {
|
current_fileChanged(newVal: string): void {
|
||||||
if (newVal !== '')
|
if (newVal === '') return
|
||||||
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
|
||||||
|
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('primaryColor')
|
@Watch('primaryColor')
|
||||||
@@ -274,6 +278,7 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
@Watch('print_percent')
|
@Watch('print_percent')
|
||||||
print_percentChanged(newVal: number): void {
|
print_percentChanged(newVal: number): void {
|
||||||
this.drawFavicon(newVal)
|
this.drawFavicon(newVal)
|
||||||
|
this.refreshSpoolman()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('printerIsPrinting')
|
@Watch('printerIsPrinting')
|
||||||
@@ -281,6 +286,12 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
this.drawFavicon(this.print_percent)
|
this.drawFavicon(this.print_percent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshSpoolman(): void {
|
||||||
|
if (this.moonrakerComponents.includes('spoolman')) {
|
||||||
|
this.$store.dispatch('server/spoolman/refreshActiveSpool', null, { root: true })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
appHeight() {
|
appHeight() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const doc = document.documentElement
|
const doc = document.documentElement
|
||||||
@@ -296,3 +307,28 @@ export default class App extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@import './assets/styles/fonts.css';
|
||||||
|
@import './assets/styles/toastr.css';
|
||||||
|
@import './assets/styles/page.css';
|
||||||
|
@import './assets/styles/sidebar.css';
|
||||||
|
@import './assets/styles/utils.css';
|
||||||
|
@import './assets/styles/updateManager.css';
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--app-height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
background-attachment: fixed;
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
.v-btn:not(.v-btn--outlined).primary {
|
||||||
|
/*noinspection CssUnresolvedCustomProperty*/
|
||||||
|
color: var(--v-btn-text-primary);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,7 +4,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
src: local('Roboto Thin'), local('Roboto-Thin'), url(/fonts/roboto-thin.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -14,7 +17,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto-light.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -24,7 +30,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto-regular.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -34,7 +43,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto-medium.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -44,7 +56,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto-bold.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -54,7 +69,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
src: local('Roboto Black'), local('Roboto-Black'), url(/fonts/roboto-black.woff2) format('woff2');
|
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -64,7 +82,10 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
src: local('Roboto Mono'), local('Roboto-Mono'), url(/fonts/robotoMono-regular.woff) format('woff');
|
src:
|
||||||
|
local('Roboto Mono'),
|
||||||
|
local('Roboto-Mono'),
|
||||||
|
url(/fonts/robotoMono-regular.woff) format('woff');
|
||||||
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,
|
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;
|
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
html {
|
html {
|
||||||
overflow: hidden;
|
overflow: auto;
|
||||||
|
scrollbar-color: #6b6b6b #272727;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -58,3 +59,21 @@ body {
|
|||||||
.settings-tabs .v-window {
|
.settings-tabs .v-window {
|
||||||
overflow-y: auto !important;
|
overflow-y: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editor-dialog .cm-editor {
|
||||||
|
height: calc(100vh - 48px);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
background-color: #272727;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #6b6b6b;
|
||||||
|
border-radius: 7px;
|
||||||
|
border: 4px solid #272727;
|
||||||
|
min-width: 100px;
|
||||||
|
min-height: 100px;
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
@@ -1,12 +1,3 @@
|
|||||||
@mixin no-select {
|
|
||||||
-webkit-touch-callout: none;
|
|
||||||
-webkit-user-select: none;
|
|
||||||
-khtml-user-select: none;
|
|
||||||
-moz-user-select: none;
|
|
||||||
-ms-user-select: none;
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-select-none {
|
.user-select-none {
|
||||||
-webkit-touch-callout: none;
|
-webkit-touch-callout: none;
|
||||||
-webkit-user-select: none;
|
-webkit-user-select: none;
|
||||||
@@ -31,4 +31,5 @@ $t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStart')
|
|||||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart')
|
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart')
|
||||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop')
|
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop')
|
||||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostReboot')
|
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostReboot')
|
||||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostShutdown')
|
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostShutdown')
|
||||||
|
$t('Editor.Uploading')
|
||||||
@@ -124,7 +124,7 @@ export default class CommandHelpModal extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style scoped>
|
||||||
.command-help-content {
|
.command-help-content {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
||||||
|
|||||||
@@ -7,20 +7,11 @@
|
|||||||
<v-toolbar-title>
|
<v-toolbar-title>
|
||||||
<span class="subheading">
|
<span class="subheading">
|
||||||
<v-icon left>{{ mdiConnection }}</v-icon>
|
<v-icon left>{{ mdiConnection }}</v-icon>
|
||||||
<template v-if="connectingFailed">
|
{{ titleText }}
|
||||||
{{ $t('ConnectionDialog.Failed', { host: formatHostname }) }}
|
|
||||||
</template>
|
|
||||||
<template v-else-if="isConnecting">
|
|
||||||
{{ $t('ConnectionDialog.Connecting', { host: formatHostname }) }}
|
|
||||||
</template>
|
|
||||||
<template v-else>{{ formatHostname }}</template>
|
|
||||||
</span>
|
</span>
|
||||||
</v-toolbar-title>
|
</v-toolbar-title>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-card-text v-if="isConnecting" class="pt-5">
|
<v-card-text v-if="connectingFailed" class="pt-5">
|
||||||
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
|
||||||
</v-card-text>
|
|
||||||
<v-card-text v-if="!isConnecting && connectingFailed" class="pt-5">
|
|
||||||
<connection-status :moonraker="false"></connection-status>
|
<connection-status :moonraker="false"></connection-status>
|
||||||
<p class="text-center mt-3">{{ $t('ConnectionDialog.CannotConnectTo', { host: formatHostname }) }}</p>
|
<p class="text-center mt-3">{{ $t('ConnectionDialog.CannotConnectTo', { host: formatHostname }) }}</p>
|
||||||
<template v-if="counter > 2">
|
<template v-if="counter > 2">
|
||||||
@@ -36,6 +27,9 @@
|
|||||||
<v-btn class="primary--text" @click="reconnect">{{ $t('ConnectionDialog.TryAgain') }}</v-btn>
|
<v-btn class="primary--text" @click="reconnect">{{ $t('ConnectionDialog.TryAgain') }}</v-btn>
|
||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
<v-card-text v-else class="pt-5">
|
||||||
|
<v-progress-linear color="white" indeterminate></v-progress-linear>
|
||||||
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -73,10 +67,6 @@ export default class TheConnectingDialog extends Mixins(BaseMixin) {
|
|||||||
return parseInt(this.port) !== 80 && this.port !== '' ? this.hostname + ':' + this.port : this.hostname
|
return parseInt(this.port) !== 80 && this.port !== '' ? this.hostname + ':' + this.port : this.hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
get isConnected() {
|
|
||||||
return this.$store.state.socket.isConnected
|
|
||||||
}
|
|
||||||
|
|
||||||
get isConnecting() {
|
get isConnecting() {
|
||||||
return this.$store.state.socket.isConnecting
|
return this.$store.state.socket.isConnecting
|
||||||
}
|
}
|
||||||
@@ -86,7 +76,15 @@ export default class TheConnectingDialog extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get showDialog() {
|
get showDialog() {
|
||||||
return !this.isConnected
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
get titleText() {
|
||||||
|
if (this.connectingFailed) return this.$t('ConnectionDialog.Failed', { host: this.formatHostname })
|
||||||
|
if (this.isConnecting) return this.$t('ConnectionDialog.Connecting', { host: this.formatHostname })
|
||||||
|
if (!this.guiIsReady) return this.$t('ConnectionDialog.Initializing')
|
||||||
|
|
||||||
|
return this.formatHostname
|
||||||
}
|
}
|
||||||
|
|
||||||
reconnect() {
|
reconnect() {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
<style scoped></style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<v-dialog
|
<v-dialog
|
||||||
@@ -19,7 +17,7 @@
|
|||||||
v-if="restartServiceName === 'klipper'"
|
v-if="restartServiceName === 'klipper'"
|
||||||
text
|
text
|
||||||
tile
|
tile
|
||||||
href="https://www.klipper3d.org/Config_Reference.html"
|
:href="klipperConfigReference"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="d-none d-md-flex">
|
class="d-none d-md-flex">
|
||||||
<v-icon small class="mr-1">{{ mdiHelp }}</v-icon>
|
<v-icon small class="mr-1">{{ mdiHelp }}</v-icon>
|
||||||
@@ -49,14 +47,12 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-card-text class="pa-0">
|
<v-card-text class="pa-0">
|
||||||
<overlay-scrollbars style="height: calc(var(--app-height) - 48px)" :options="scrollbarOptions">
|
<codemirror-async
|
||||||
<codemirror-async
|
v-if="show"
|
||||||
v-if="show"
|
ref="editor"
|
||||||
ref="editor"
|
v-model="sourcecode"
|
||||||
v-model="sourcecode"
|
:name="filename"
|
||||||
:name="filename"
|
:file-extension="fileExtension"></codemirror-async>
|
||||||
:file-extension="fileExtension"></codemirror-async>
|
|
||||||
</overlay-scrollbars>
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</panel>
|
</panel>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
@@ -112,7 +108,7 @@
|
|||||||
<v-btn text color="primary" @click="save">
|
<v-btn text color="primary" @click="save">
|
||||||
{{ $t('Editor.SaveClose') }}
|
{{ $t('Editor.SaveClose') }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<template v-if="restartServiceName != null">
|
<template v-if="restartServiceNameExists">
|
||||||
<v-btn text color="primary" @click="save(restartServiceName)">
|
<v-btn text color="primary" @click="save(restartServiceName)">
|
||||||
{{ $t('Editor.SaveRestart') }}
|
{{ $t('Editor.SaveRestart') }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
@@ -126,8 +122,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { formatFilesize, windowBeforeUnloadFunction } from '@/plugins/helpers'
|
import { capitalize, formatFilesize, windowBeforeUnloadFunction } from '@/plugins/helpers'
|
||||||
import Panel from '@/components/ui/Panel.vue'
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import { availableKlipperConfigReferenceTranslations } from '@/store/variables'
|
||||||
import CodemirrorAsync from '@/components/inputs/CodemirrorAsync'
|
import CodemirrorAsync from '@/components/inputs/CodemirrorAsync'
|
||||||
import {
|
import {
|
||||||
mdiClose,
|
mdiClose,
|
||||||
@@ -228,13 +225,10 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get snackbarHeadline() {
|
get snackbarHeadline() {
|
||||||
let directionUppercase = this.$t('Files.Downloading')
|
let directionUppercase = this.$t('Editor.Downloading')
|
||||||
if (this.loaderProgress.direction) {
|
if (this.loaderProgress.direction) directionUppercase = capitalize(this.loaderProgress.direction)
|
||||||
directionUppercase =
|
|
||||||
this.loaderProgress.direction?.charAt(0).toUpperCase() + this.loaderProgress.direction?.slice(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.$t('Editor.' + directionUppercase)
|
return this.$t(`Editor.${directionUppercase}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
get availableServices() {
|
get availableServices() {
|
||||||
@@ -245,16 +239,32 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
|||||||
if (!this.isWriteable) return null
|
if (!this.isWriteable) return null
|
||||||
if (['printing', 'paused'].includes(this.printer_state)) return null
|
if (['printing', 'paused'].includes(this.printer_state)) return null
|
||||||
|
|
||||||
|
// check for generic services <service>.conf (like moonraker.conf, crowsnest.conf, sonar.conf)
|
||||||
if (this.availableServices.includes(this.filenameWithoutExtension) && this.fileExtension === 'conf')
|
if (this.availableServices.includes(this.filenameWithoutExtension) && this.fileExtension === 'conf')
|
||||||
return this.filenameWithoutExtension
|
return this.filenameWithoutExtension
|
||||||
|
|
||||||
|
// old webcam service DEPRECATED
|
||||||
if (this.filename.startsWith('webcam') && ['conf', 'txt'].includes(this.fileExtension)) return 'webcamd'
|
if (this.filename.startsWith('webcam') && ['conf', 'txt'].includes(this.fileExtension)) return 'webcamd'
|
||||||
|
|
||||||
|
// check for mooncord config files
|
||||||
if (this.filename.startsWith('mooncord') && this.fileExtension === 'json') return 'mooncord'
|
if (this.filename.startsWith('mooncord') && this.fileExtension === 'json') return 'mooncord'
|
||||||
|
|
||||||
|
// fallback for moonraker with multi instances
|
||||||
|
if (this.filename === 'moonraker.conf') return 'moonraker'
|
||||||
|
|
||||||
|
// all .cfg files will be klipper config files
|
||||||
if (this.fileExtension === 'cfg') return 'klipper'
|
if (this.fileExtension === 'cfg') return 'klipper'
|
||||||
|
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
get restartServiceNameExists() {
|
get restartServiceNameExists() {
|
||||||
|
// hide the button, if there is no service found
|
||||||
|
if (this.restartServiceName === null) return false
|
||||||
|
|
||||||
|
// klipper and moonraker uses specific api calls instead of generic service restart
|
||||||
|
if (['klipper', 'moonraker'].includes(this.restartServiceName)) return true
|
||||||
|
|
||||||
return this.availableServices.includes(this.restartServiceName)
|
return this.availableServices.includes(this.restartServiceName)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,6 +284,22 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
|||||||
return `${title} ${this.changedOutput}`
|
return `${title} ${this.changedOutput}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get currentLanguage() {
|
||||||
|
return this.$store.state.gui.general.language
|
||||||
|
}
|
||||||
|
|
||||||
|
get klipperConfigReference(): string {
|
||||||
|
const currentLanguage = this.currentLanguage
|
||||||
|
const translations = availableKlipperConfigReferenceTranslations
|
||||||
|
let url = 'https://www.klipper3d.org/Config_Reference.html'
|
||||||
|
|
||||||
|
if (translations.includes(currentLanguage)) {
|
||||||
|
url = `https://www.klipper3d.org/${currentLanguage}/Config_Reference.html`
|
||||||
|
}
|
||||||
|
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
|
||||||
cancelDownload() {
|
cancelDownload() {
|
||||||
this.$store.dispatch('editor/cancelLoad')
|
this.$store.dispatch('editor/cancelLoad')
|
||||||
}
|
}
|
||||||
@@ -315,3 +341,52 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
::v-deep .ͼ1 .cm-panel.cm-search *:focus:not(.focus-visible) {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox'] {
|
||||||
|
width: 2.2em;
|
||||||
|
height: 2.2em;
|
||||||
|
color: dodgerblue;
|
||||||
|
vertical-align: middle;
|
||||||
|
-webkit-appearance: none;
|
||||||
|
border: 10px;
|
||||||
|
outline: 0;
|
||||||
|
flex-grow: 0;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--v-toolbar-base);
|
||||||
|
transition: background 300ms;
|
||||||
|
cursor: pointer;
|
||||||
|
margin-right: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Pseudo element for check styling */
|
||||||
|
|
||||||
|
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']::before {
|
||||||
|
content: '';
|
||||||
|
color: transparent;
|
||||||
|
display: block;
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
border-radius: inherit;
|
||||||
|
border: 2px;
|
||||||
|
background-color: transparent;
|
||||||
|
background-size: contain;
|
||||||
|
box-shadow: inset 0 0 0 1px #ccd3d8;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Checked */
|
||||||
|
|
||||||
|
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked {
|
||||||
|
background-color: var(--color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked::before {
|
||||||
|
box-shadow: none;
|
||||||
|
background-color: var(--color-primary);
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath d='M15.88 8.29L10 14.17l-1.88-1.88a.996.996 0 1 0-1.41 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0z' fill='%23fffff'/%3E %3C/svg%3E");
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -116,8 +116,14 @@ export default class TheFullscreenUpload extends Mixins(BaseMixin) {
|
|||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: visibility 200ms, opacity 200ms;
|
transition:
|
||||||
font: bold 42px Oswald, DejaVu Sans, Tahoma, sans-serif;
|
visibility 200ms,
|
||||||
|
opacity 200ms;
|
||||||
|
font:
|
||||||
|
bold 42px Oswald,
|
||||||
|
DejaVu Sans,
|
||||||
|
Tahoma,
|
||||||
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*noinspection CssUnusedSymbol*/
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
|||||||
@@ -32,12 +32,12 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="isConnecting">
|
<template v-if="isConnecting || (isConnected && !guiIsReady)">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="!isConnecting && connectingFailed">
|
<template v-else-if="connectingFailed">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<p>
|
<p>
|
||||||
{{
|
{{
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="!isConnecting && dialogAddPrinter.bool">
|
<template v-else-if="dialogAddPrinter.bool">
|
||||||
<v-form v-model="addPrinterValid" @submit.prevent="addPrinter">
|
<v-form v-model="addPrinterValid" @submit.prevent="addPrinter">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-form>
|
</v-form>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="!isConnecting && dialogEditPrinter.bool">
|
<template v-else-if="dialogEditPrinter.bool">
|
||||||
<v-form v-model="editPrinterValid" @submit.prevent="updatePrinter">
|
<v-form v-model="editPrinterValid" @submit.prevent="updatePrinter">
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
@@ -173,29 +173,38 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-if="showCorsInfo">
|
<template v-if="instancesDB === 'browser'">
|
||||||
<v-col>
|
<v-row v-if="showCorsInfo">
|
||||||
<p v-if="printers.length === 0" class="text-center">
|
<v-col>
|
||||||
{{ $t('SelectPrinterDialog.Hello') }}
|
<p v-if="printers.length === 0" class="text-center">
|
||||||
</p>
|
{{ $t('SelectPrinterDialog.Hello') }}
|
||||||
<p class="text-center">
|
</p>
|
||||||
{{ $t('SelectPrinterDialog.RememberToAdd', { cors: currentUrl }) }}
|
<p class="text-center">
|
||||||
</p>
|
{{ $t('SelectPrinterDialog.RememberToAdd', { cors: currentUrl }) }}
|
||||||
<p class="text-center mb-0">
|
</p>
|
||||||
{{ $t('SelectPrinterDialog.YouCanFindMore') }}
|
<p class="text-center mb-0">
|
||||||
<br />
|
{{ $t('SelectPrinterDialog.YouCanFindMore') }}
|
||||||
<a href="https://docs.mainsail.xyz/remotemode" target="_blank">
|
<br />
|
||||||
https://docs.mainsail.xyz/remotemode
|
<a href="https://docs.mainsail.xyz/remotemode" target="_blank">
|
||||||
</a>
|
https://docs.mainsail.xyz/remotemode
|
||||||
.
|
</a>
|
||||||
</p>
|
.
|
||||||
</v-col>
|
</p>
|
||||||
</v-row>
|
</v-col>
|
||||||
<v-row v-if="canAddPrinters">
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col class="text-center mt-0">
|
||||||
|
<v-btn text color="primary" @click="createPrinter">
|
||||||
|
{{ $t('SelectPrinterDialog.AddPrinter') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</template>
|
||||||
|
<v-row v-else-if="instancesDB === 'json' && printers.length === 0">
|
||||||
<v-col class="text-center mt-0">
|
<v-col class="text-center mt-0">
|
||||||
<v-btn text color="primary" @click="createPrinter">
|
<p class="text-center">
|
||||||
{{ $t('SelectPrinterDialog.AddPrinter') }}
|
{{ $t('SelectPrinterDialog.AddPrintersToJson') }}
|
||||||
</v-btn>
|
</p>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -254,7 +263,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get canAddPrinters() {
|
get canAddPrinters() {
|
||||||
return this.$store.state.configInstances.length === 0
|
return this.instancesDB !== 'json'
|
||||||
}
|
}
|
||||||
|
|
||||||
get protocol() {
|
get protocol() {
|
||||||
@@ -290,7 +299,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get showDialog() {
|
get showDialog() {
|
||||||
return !this.isConnected
|
return !this.isConnected || (this.isConnected && !this.guiIsReady)
|
||||||
}
|
}
|
||||||
|
|
||||||
get currentUrl() {
|
get currentUrl() {
|
||||||
@@ -316,6 +325,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
|||||||
if (this.dialogAddPrinter.bool) return this.$t('SelectPrinterDialog.AddPrinter')
|
if (this.dialogAddPrinter.bool) return this.$t('SelectPrinterDialog.AddPrinter')
|
||||||
else if (this.dialogEditPrinter.bool) return this.$t('SelectPrinterDialog.EditPrinter')
|
else if (this.dialogEditPrinter.bool) return this.$t('SelectPrinterDialog.EditPrinter')
|
||||||
else if (this.isConnecting) return this.$t('SelectPrinterDialog.Connecting', { host: this.formatHostname })
|
else if (this.isConnecting) return this.$t('SelectPrinterDialog.Connecting', { host: this.formatHostname })
|
||||||
|
else if (this.isConnected && !this.guiIsReady) return this.$t('ConnectionDialog.Initializing')
|
||||||
else if (this.connectingFailed)
|
else if (this.connectingFailed)
|
||||||
return this.$t('SelectPrinterDialog.ConnectionFailed', { host: this.formatHostname })
|
return this.$t('SelectPrinterDialog.ConnectionFailed', { host: this.formatHostname })
|
||||||
else return this.$t('SelectPrinterDialog.SelectPrinter')
|
else return this.$t('SelectPrinterDialog.SelectPrinter')
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog v-model="showDialog" persistent max-width="400" class="mx-0">
|
||||||
|
<panel
|
||||||
|
:title="$t('App.TheServiceWorker.TitleNeedUpdate')"
|
||||||
|
card-class="service-worker-dialog"
|
||||||
|
:margin-bottom="false">
|
||||||
|
<v-card-text>
|
||||||
|
<p>{{ $t('App.TheServiceWorker.DescriptionNeedUpdate') }}</p>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer />
|
||||||
|
<v-btn text color="primary" @click="update">{{ $t('App.TheServiceWorker.Update') }}</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class TheServiceWorker extends Mixins(BaseMixin) {
|
||||||
|
showDialog = false
|
||||||
|
updateSW: ((reloadPage?: boolean | undefined) => Promise<void>) | null = null
|
||||||
|
|
||||||
|
onOfflineReady() {
|
||||||
|
window.console.info('PWA is offline ready')
|
||||||
|
}
|
||||||
|
|
||||||
|
onNeedRefresh() {
|
||||||
|
window.console.warn('PWA needs to refresh')
|
||||||
|
this.showDialog = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onRegistered() {
|
||||||
|
window.console.debug('PWA is registered')
|
||||||
|
}
|
||||||
|
|
||||||
|
onRegisterError(error: any) {
|
||||||
|
window.console.error('PWA registration error:', error)
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
this.updateSW?.(true)
|
||||||
|
this.showDialog = false
|
||||||
|
}
|
||||||
|
|
||||||
|
async mounted() {
|
||||||
|
const { registerSW } = await import('virtual:pwa-register')
|
||||||
|
this.updateSW = registerSW({
|
||||||
|
immediate: true,
|
||||||
|
onOfflineReady: this.onOfflineReady,
|
||||||
|
onNeedRefresh: this.onNeedRefresh,
|
||||||
|
onRegistered: this.onRegistered,
|
||||||
|
onRegisterError: this.onRegisterError,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
ref="settingsScroll"
|
ref="settingsScroll"
|
||||||
:class="'settings-tabs ' + (isMobile ? '' : 'height500')"
|
:class="'settings-tabs ' + (isMobile ? '' : 'height500')"
|
||||||
:options="{ overflowBehavior: { x: 'hidden' } }">
|
:options="{ overflowBehavior: { x: 'hidden' } }">
|
||||||
<component :is="'settings-' + activeTab + '-tab'" @scrollToTop="scrollToTop"></component>
|
<component :is="'settings-' + activeTab + '-tab'" @scrollToTop="scrollToTop" />
|
||||||
</overlay-scrollbars>
|
</overlay-scrollbars>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -80,6 +80,7 @@ import SettingsDashboardTab from '@/components/settings/SettingsDashboardTab.vue
|
|||||||
import SettingsGCodeViewerTab from '@/components/settings/SettingsGCodeViewerTab.vue'
|
import SettingsGCodeViewerTab from '@/components/settings/SettingsGCodeViewerTab.vue'
|
||||||
import SettingsEditorTab from '@/components/settings/SettingsEditorTab.vue'
|
import SettingsEditorTab from '@/components/settings/SettingsEditorTab.vue'
|
||||||
import SettingsTimelapseTab from '@/components/settings/SettingsTimelapseTab.vue'
|
import SettingsTimelapseTab from '@/components/settings/SettingsTimelapseTab.vue'
|
||||||
|
import SettingsNavigationTab from '@/components/settings/SettingsNavigationTab.vue'
|
||||||
|
|
||||||
import Panel from '@/components/ui/Panel.vue'
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
import {
|
import {
|
||||||
@@ -97,7 +98,10 @@ import {
|
|||||||
mdiTune,
|
mdiTune,
|
||||||
mdiVideo3d,
|
mdiVideo3d,
|
||||||
mdiWebcam,
|
mdiWebcam,
|
||||||
|
mdiDipSwitch,
|
||||||
|
mdiMenu,
|
||||||
} from '@mdi/js'
|
} from '@mdi/js'
|
||||||
|
import SettingsMiscellaneousTab from '@/components/settings/SettingsMiscellaneousTab.vue'
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
Panel,
|
Panel,
|
||||||
@@ -113,6 +117,8 @@ import {
|
|||||||
SettingsGCodeViewerTab,
|
SettingsGCodeViewerTab,
|
||||||
SettingsEditorTab,
|
SettingsEditorTab,
|
||||||
SettingsTimelapseTab,
|
SettingsTimelapseTab,
|
||||||
|
SettingsMiscellaneousTab,
|
||||||
|
SettingsNavigationTab,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
||||||
@@ -186,6 +192,16 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
|||||||
name: 'editor',
|
name: 'editor',
|
||||||
title: this.$t('Settings.EditorTab.Editor'),
|
title: this.$t('Settings.EditorTab.Editor'),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: mdiDipSwitch,
|
||||||
|
name: 'miscellaneous',
|
||||||
|
title: this.$t('Settings.MiscellaneousTab.Miscellaneous'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: mdiMenu,
|
||||||
|
name: 'navigation',
|
||||||
|
title: this.$t('Settings.NavigationTab.Navigation'),
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (this.moonrakerComponents.includes('timelapse')) {
|
if (this.moonrakerComponents.includes('timelapse')) {
|
||||||
|
|||||||
+46
-156
@@ -1,46 +1,3 @@
|
|||||||
<style>
|
|
||||||
.nav-logo {
|
|
||||||
height: 32px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-list-item {
|
|
||||||
height: var(--sidebar-menu-item-height);
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-text-decoration {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-background:before {
|
|
||||||
background-color: rgba(255, 255, 255, 0) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-border {
|
|
||||||
border: 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style scoped>
|
|
||||||
.active-nav-item {
|
|
||||||
border-right: 4px solid var(--v-primary-base);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item-icon {
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu-item-title {
|
|
||||||
line-height: 30px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 600;
|
|
||||||
text-transform: uppercase;
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-scrollbar {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<template>
|
<template>
|
||||||
<v-navigation-drawer
|
<v-navigation-drawer
|
||||||
:key="navigationStyle"
|
:key="navigationStyle"
|
||||||
@@ -59,78 +16,27 @@
|
|||||||
v-if="isMobile"
|
v-if="isMobile"
|
||||||
router
|
router
|
||||||
to="/"
|
to="/"
|
||||||
:class="
|
:class="mobileLogoClass"
|
||||||
'sidebar-logo no-text-decoration no-background no-border ' +
|
|
||||||
(navigationStyle === 'iconsOnly' ? 'pa-0 justify-center' : '')
|
|
||||||
"
|
|
||||||
:style="'height: ' + topbarHeight + 'px'"
|
:style="'height: ' + topbarHeight + 'px'"
|
||||||
:ripple="false">
|
:ripple="false">
|
||||||
<template v-if="sidebarLogo">
|
<template v-if="sidebarLogo">
|
||||||
<img :src="sidebarLogo" :style="logoCssVars" class="nav-logo" alt="Logo" />
|
<img :src="sidebarLogo" :style="logoCssVars" class="nav-logo" alt="Logo" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<mainsail-logo
|
<mainsail-logo :color="logoColor" :style="logoCssVars" class="nav-logo" :ripple="false" />
|
||||||
:color="logoColor"
|
|
||||||
:style="logoCssVars"
|
|
||||||
class="nav-logo"
|
|
||||||
:ripple="false"></mainsail-logo>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="navigationStyle !== 'iconsOnly'">
|
<template v-if="navigationStyle !== 'iconsOnly'">
|
||||||
<span class="text-h6 font-weight-regular text-truncate">{{ printerName }}</span>
|
<span class="text-h6 font-weight-regular text-truncate">{{ printerName }}</span>
|
||||||
</template>
|
</template>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<template v-if="countPrinters">
|
<sidebar-item v-for="(category, index) in visibleNaviPoints" :key="index" :item="category" />
|
||||||
<v-tooltip right :open-delay="500" :disabled="navigationStyle !== 'iconsOnly'">
|
|
||||||
<template #activator="{ on, attrs }">
|
|
||||||
<v-list-item
|
|
||||||
router
|
|
||||||
to="/allPrinters"
|
|
||||||
class="small-list-item mt-1"
|
|
||||||
v-bind="attrs"
|
|
||||||
v-on="on">
|
|
||||||
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
|
|
||||||
<v-icon>{{ mdiViewDashboardOutline }}</v-icon>
|
|
||||||
</v-list-item-icon>
|
|
||||||
<v-list-item-content>
|
|
||||||
<v-list-item-title tile class="menu-item-title">
|
|
||||||
{{ $t('App.Printers') }}
|
|
||||||
</v-list-item-title>
|
|
||||||
</v-list-item-content>
|
|
||||||
</v-list-item>
|
|
||||||
</template>
|
|
||||||
<span>{{ $t('App.Printers') }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<v-divider class="my-1"></v-divider>
|
|
||||||
</template>
|
|
||||||
<div v-for="(category, index) in naviPoints" :key="index">
|
|
||||||
<v-tooltip right :open-delay="500" :disabled="navigationStyle !== 'iconsOnly'">
|
|
||||||
<template #activator="{ on, attrs }">
|
|
||||||
<v-list-item
|
|
||||||
router
|
|
||||||
:to="category.path"
|
|
||||||
class="small-list-item"
|
|
||||||
v-bind="attrs"
|
|
||||||
v-on="on">
|
|
||||||
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
|
|
||||||
<v-icon>{{ category.icon }}</v-icon>
|
|
||||||
</v-list-item-icon>
|
|
||||||
<v-list-item-content>
|
|
||||||
<v-list-item-title tile class="menu-item-title">
|
|
||||||
{{ $t(`Router.${category.title}`) }}
|
|
||||||
</v-list-item-title>
|
|
||||||
</v-list-item-content>
|
|
||||||
</v-list-item>
|
|
||||||
</template>
|
|
||||||
<span>{{ $t(`Router.${category.title}`) }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</div>
|
|
||||||
</v-list-item-group>
|
</v-list-item-group>
|
||||||
</v-list>
|
</v-list>
|
||||||
</overlay-scrollbars>
|
</overlay-scrollbars>
|
||||||
<template #append>
|
<template #append>
|
||||||
<v-list-item class="small-list-item mb-2">
|
<v-list-item class="small-list-item mb-2">
|
||||||
<v-list-item-icon class="menu-item-icon">
|
<v-list-item-icon class="menu-item-icon">
|
||||||
<about-modal></about-modal>
|
<about-dialog />
|
||||||
</v-list-item-icon>
|
</v-list-item-icon>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</template>
|
</template>
|
||||||
@@ -139,37 +45,32 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
import routes, { AppRoute } from '@/routes'
|
|
||||||
import { Mixins } from 'vue-property-decorator'
|
import { Mixins } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { PrinterStateKlipperConfig } from '@/store/printer/types'
|
|
||||||
import TheSelectPrinterDialog from '@/components/TheSelectPrinterDialog.vue'
|
import TheSelectPrinterDialog from '@/components/TheSelectPrinterDialog.vue'
|
||||||
import AboutModal from '@/components/modals/AboutModal.vue'
|
import AboutDialog from '@/components/dialogs/AboutDialog.vue'
|
||||||
import { navigationWidth, topbarHeight } from '@/store/variables'
|
import { navigationWidth, topbarHeight } from '@/store/variables'
|
||||||
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||||
import { mdiViewDashboardOutline } from '@mdi/js'
|
import SidebarItem from '@/components/ui/SidebarItem.vue'
|
||||||
|
import NavigationMixin from '@/components/mixins/navigation'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
|
SidebarItem,
|
||||||
TheSelectPrinterDialog,
|
TheSelectPrinterDialog,
|
||||||
AboutModal,
|
AboutDialog,
|
||||||
MainsailLogo,
|
MainsailLogo,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class TheSidebar extends Mixins(BaseMixin) {
|
export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
|
||||||
navigationWidth = navigationWidth
|
navigationWidth = navigationWidth
|
||||||
topbarHeight = topbarHeight
|
topbarHeight = topbarHeight
|
||||||
|
|
||||||
/**
|
|
||||||
* Icons
|
|
||||||
*/
|
|
||||||
mdiViewDashboardOutline = mdiViewDashboardOutline
|
|
||||||
|
|
||||||
get naviDrawer(): boolean {
|
get naviDrawer(): boolean {
|
||||||
return this.$store.state.naviDrawer
|
return this.$store.state.naviDrawer
|
||||||
}
|
}
|
||||||
|
|
||||||
set naviDrawer(newVal: boolean) {
|
set naviDrawer(newVal) {
|
||||||
this.$store.dispatch('setNaviDrawer', newVal)
|
this.$store.dispatch('setNaviDrawer', newVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,45 +82,12 @@ export default class TheSidebar extends Mixins(BaseMixin) {
|
|||||||
return this.$store.getters['files/getSidebarBackground']
|
return this.$store.getters['files/getSidebarBackground']
|
||||||
}
|
}
|
||||||
|
|
||||||
get naviPoints(): AppRoute[] {
|
|
||||||
return routes.filter((element) => {
|
|
||||||
return element.showInNavi && this.showInNavi(element)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
get klippy_state(): string {
|
|
||||||
return this.$store.state.server.klippy_state
|
|
||||||
}
|
|
||||||
|
|
||||||
get boolNaviWebcam(): boolean {
|
|
||||||
return this.$store.state.gui.uiSettings.boolWebcamNavi
|
|
||||||
}
|
|
||||||
|
|
||||||
get moonrakerComponents(): string[] {
|
|
||||||
return this.$store.state.server.components
|
|
||||||
}
|
|
||||||
|
|
||||||
get registeredDirectories(): string[] {
|
|
||||||
return this.$store.state.server.registered_directories
|
|
||||||
}
|
|
||||||
|
|
||||||
get klipperConfigfileSettings(): PrinterStateKlipperConfig[] {
|
|
||||||
return this.$store.state.printer.configfile?.settings ?? {}
|
|
||||||
}
|
|
||||||
|
|
||||||
get currentPage(): string {
|
get currentPage(): string {
|
||||||
return this.$route.fullPath
|
return this.$route.fullPath
|
||||||
}
|
}
|
||||||
|
|
||||||
get countPrinters() {
|
|
||||||
return this.$store.getters['farm/countPrinters']
|
|
||||||
}
|
|
||||||
|
|
||||||
get boolNaviTemp(): boolean {
|
get boolNaviTemp(): boolean {
|
||||||
if (!this.isMobile && this.$vuetify.breakpoint.mdAndDown) {
|
return !this.isMobile && this.$vuetify.breakpoint.mdAndDown
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get sidebarCssVars(): any {
|
get sidebarCssVars(): any {
|
||||||
@@ -255,20 +123,42 @@ export default class TheSidebar extends Mixins(BaseMixin) {
|
|||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
showInNavi(route: AppRoute): boolean {
|
get mobileLogoClass() {
|
||||||
if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) return false
|
const output = ['sidebar-logo', 'no-text-decoration', 'no-background', 'no-border']
|
||||||
else if (route.title === 'Webcam' && !this.boolNaviWebcam) return false
|
|
||||||
else if (route.moonrakerComponent && !this.moonrakerComponents.includes(route.moonrakerComponent)) return false
|
|
||||||
else if (route.registeredDirectory && !this.registeredDirectories.includes(route.registeredDirectory))
|
|
||||||
return false
|
|
||||||
else if (route.klipperComponent && !(route.klipperComponent in this.klipperConfigfileSettings)) return false
|
|
||||||
else if (route.klipperIsConnected && !this.klippyIsConnected) return false
|
|
||||||
|
|
||||||
return true
|
if (this.navigationStyle === 'iconsOnly') {
|
||||||
}
|
output.push('pa-0')
|
||||||
|
output.push('justify-center')
|
||||||
|
}
|
||||||
|
|
||||||
mounted() {
|
return output
|
||||||
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.no-text-decoration {
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-background:before {
|
||||||
|
background-color: rgba(255, 255, 255, 0) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no-border {
|
||||||
|
border: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-logo {
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item-icon {
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-scrollbar {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -238,7 +238,9 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get powerDevices() {
|
get powerDevices() {
|
||||||
return this.$store.getters['server/power/getDevices']
|
const devices = this.$store.getters['server/power/getDevices'] ?? []
|
||||||
|
|
||||||
|
return devices.filter((device: ServerPowerStateDevice) => !device.device.startsWith('_'))
|
||||||
}
|
}
|
||||||
|
|
||||||
get service_states() {
|
get service_states() {
|
||||||
|
|||||||
@@ -1,31 +1,7 @@
|
|||||||
<style>
|
|
||||||
.topbar .v-toolbar__content {
|
|
||||||
padding-top: 0 !important;
|
|
||||||
padding-bottom: 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style scoped>
|
|
||||||
.button-min-width-auto {
|
|
||||||
min-width: auto !important;
|
|
||||||
}
|
|
||||||
.topbar .v-btn {
|
|
||||||
height: 100% !important;
|
|
||||||
max-height: none;
|
|
||||||
}
|
|
||||||
.topbar .v-btn.v-btn--icon {
|
|
||||||
width: var(--topbar-icon-btn-width) !important;
|
|
||||||
}
|
|
||||||
@media (min-width: 768px) {
|
|
||||||
header.topbar {
|
|
||||||
z-index: 8 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
|
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
|
||||||
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer"></v-app-bar-nav-icon>
|
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer" />
|
||||||
<router-link to="/">
|
<router-link to="/">
|
||||||
<template v-if="sidebarLogo">
|
<template v-if="sidebarLogo">
|
||||||
<img
|
<img
|
||||||
@@ -41,20 +17,20 @@
|
|||||||
class="nav-logo ml-4 mr-1 d-none d-sm-flex"
|
class="nav-logo ml-4 mr-1 d-none d-sm-flex"
|
||||||
router
|
router
|
||||||
to="/"
|
to="/"
|
||||||
:ripple="false"></mainsail-logo>
|
:ripple="false" />
|
||||||
</template>
|
</template>
|
||||||
</router-link>
|
</router-link>
|
||||||
<v-toolbar-title class="text-no-wrap ml-0 pl-2 mr-2">{{ printerName }}</v-toolbar-title>
|
<v-toolbar-title class="text-no-wrap ml-0 pl-2 mr-2">{{ printerName }}</v-toolbar-title>
|
||||||
<printer-selector v-if="countPrinters"></printer-selector>
|
<printer-selector v-if="countPrinters" />
|
||||||
<v-spacer></v-spacer>
|
<v-spacer />
|
||||||
<input
|
<input
|
||||||
ref="fileUploadAndStart"
|
ref="fileUploadAndStart"
|
||||||
type="file"
|
type="file"
|
||||||
:accept="validGcodeExtensions.join(', ')"
|
:accept="gcodeInputFileAccept.join(', ')"
|
||||||
style="display: none"
|
style="display: none"
|
||||||
@change="uploadAndStart" />
|
@change="uploadAndStart" />
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="klippyIsConnected && saveConfigPending"
|
v-if="showSaveConfigButton"
|
||||||
tile
|
tile
|
||||||
:icon="$vuetify.breakpoint.smAndDown"
|
:icon="$vuetify.breakpoint.smAndDown"
|
||||||
:text="$vuetify.breakpoint.mdAndUp"
|
:text="$vuetify.breakpoint.mdAndUp"
|
||||||
@@ -67,11 +43,7 @@
|
|||||||
<span class="d-none d-md-inline">{{ $t('App.TopBar.SAVE_CONFIG') }}</span>
|
<span class="d-none d-md-inline">{{ $t('App.TopBar.SAVE_CONFIG') }}</span>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="
|
v-if="boolShowUploadAndPrint"
|
||||||
klippyIsConnected &&
|
|
||||||
['standby', 'complete', 'cancelled'].includes(printer_state) &&
|
|
||||||
!boolHideUploadAndPrintButton
|
|
||||||
"
|
|
||||||
tile
|
tile
|
||||||
:icon="$vuetify.breakpoint.smAndDown"
|
:icon="$vuetify.breakpoint.smAndDown"
|
||||||
:text="$vuetify.breakpoint.mdAndUp"
|
:text="$vuetify.breakpoint.mdAndUp"
|
||||||
@@ -91,12 +63,12 @@
|
|||||||
class="button-min-width-auto px-3 emergency-button"
|
class="button-min-width-auto px-3 emergency-button"
|
||||||
:loading="loadings.includes('topbarEmergencyStop')"
|
:loading="loadings.includes('topbarEmergencyStop')"
|
||||||
@click="btnEmergencyStop">
|
@click="btnEmergencyStop">
|
||||||
<v-icon class="mr-md-2">{{ mdiAlertCircleOutline }}</v-icon>
|
<v-icon class="mr-md-2">{{ mdiAlertOctagonOutline }}</v-icon>
|
||||||
<span class="d-none d-md-inline">{{ $t('App.TopBar.EmergencyStop') }}</span>
|
<span class="d-none d-md-inline">{{ $t('App.TopBar.EmergencyStop') }}</span>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<the-notification-menu></the-notification-menu>
|
<the-notification-menu />
|
||||||
<the-settings-menu></the-settings-menu>
|
<the-settings-menu />
|
||||||
<the-top-corner-menu></the-top-corner-menu>
|
<the-top-corner-menu />
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
|
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
|
||||||
<strong>{{ $t('App.TopBar.Uploading') }} {{ uploadSnackbar.filename }}</strong>
|
<strong>{{ $t('App.TopBar.Uploading') }} {{ uploadSnackbar.filename }}</strong>
|
||||||
@@ -115,7 +87,7 @@
|
|||||||
:title="$t('EmergencyStopDialog.EmergencyStop')"
|
:title="$t('EmergencyStopDialog.EmergencyStop')"
|
||||||
toolbar-color="error"
|
toolbar-color="error"
|
||||||
card-class="emergency-stop-dialog"
|
card-class="emergency-stop-dialog"
|
||||||
:icon="mdiAlertCircleOutline"
|
:icon="mdiAlertOctagonOutline"
|
||||||
:margin-bottom="false">
|
:margin-bottom="false">
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<v-btn icon tile @click="showEmergencyStopDialog = false">
|
<v-btn icon tile @click="showEmergencyStopDialog = false">
|
||||||
@@ -124,7 +96,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<v-card-text>{{ $t('EmergencyStopDialog.AreYouSure') }}</v-card-text>
|
<v-card-text>{{ $t('EmergencyStopDialog.AreYouSure') }}</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer />
|
||||||
<v-btn text @click="showEmergencyStopDialog = false">{{ $t('EmergencyStopDialog.No') }}</v-btn>
|
<v-btn text @click="showEmergencyStopDialog = false">{{ $t('EmergencyStopDialog.No') }}</v-btn>
|
||||||
<v-btn color="primary" text @click="emergencyStop">{{ $t('EmergencyStopDialog.Yes') }}</v-btn>
|
<v-btn color="primary" text @click="emergencyStop">{{ $t('EmergencyStopDialog.Yes') }}</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
@@ -147,7 +119,7 @@ import PrinterSelector from '@/components/ui/PrinterSelector.vue'
|
|||||||
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||||
import TheNotificationMenu from '@/components/notifications/TheNotificationMenu.vue'
|
import TheNotificationMenu from '@/components/notifications/TheNotificationMenu.vue'
|
||||||
import { topbarHeight } from '@/store/variables'
|
import { topbarHeight } from '@/store/variables'
|
||||||
import { mdiAlertCircleOutline, mdiContentSave, mdiFileUpload, mdiClose, mdiCloseThick } from '@mdi/js'
|
import { mdiAlertOctagonOutline, mdiContentSave, mdiFileUpload, mdiClose, mdiCloseThick } from '@mdi/js'
|
||||||
|
|
||||||
type uploadSnackbar = {
|
type uploadSnackbar = {
|
||||||
status: boolean
|
status: boolean
|
||||||
@@ -173,7 +145,7 @@ type uploadSnackbar = {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class TheTopbar extends Mixins(BaseMixin) {
|
export default class TheTopbar extends Mixins(BaseMixin) {
|
||||||
mdiAlertCircleOutline = mdiAlertCircleOutline
|
mdiAlertOctagonOutline = mdiAlertOctagonOutline
|
||||||
mdiContentSave = mdiContentSave
|
mdiContentSave = mdiContentSave
|
||||||
mdiFileUpload = mdiFileUpload
|
mdiFileUpload = mdiFileUpload
|
||||||
mdiClose = mdiClose
|
mdiClose = mdiClose
|
||||||
@@ -202,6 +174,12 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
fileUploadAndStart: HTMLFormElement
|
fileUploadAndStart: HTMLFormElement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get gcodeInputFileAccept() {
|
||||||
|
if (this.isIOS) return []
|
||||||
|
|
||||||
|
return validGcodeExtensions
|
||||||
|
}
|
||||||
|
|
||||||
get naviDrawer() {
|
get naviDrawer() {
|
||||||
return this.$store.state.naviDrawer
|
return this.$store.state.naviDrawer
|
||||||
}
|
}
|
||||||
@@ -210,10 +188,6 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
this.$store.dispatch('setNaviDrawer', newVal)
|
this.$store.dispatch('setNaviDrawer', newVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
get validGcodeExtensions() {
|
|
||||||
return validGcodeExtensions
|
|
||||||
}
|
|
||||||
|
|
||||||
get currentPage() {
|
get currentPage() {
|
||||||
return this.$route.fullPath
|
return this.$route.fullPath
|
||||||
}
|
}
|
||||||
@@ -222,6 +196,20 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
return this.$store.state.printer.configfile?.save_config_pending ?? false
|
return this.$store.state.printer.configfile?.save_config_pending ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hideSaveConfigForBedMash() {
|
||||||
|
return this.$store.state.gui.uiSettings.hideSaveConfigForBedMash ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
get showSaveConfigButton() {
|
||||||
|
if (!this.klipperReadyForGui) return false
|
||||||
|
if (!this.hideSaveConfigForBedMash) return this.saveConfigPending
|
||||||
|
|
||||||
|
let pendingKeys = Object.keys(this.$store.state.printer.configfile?.save_config_pending_items ?? {})
|
||||||
|
pendingKeys = pendingKeys.filter((key: string) => !key.startsWith('bed_mesh '))
|
||||||
|
|
||||||
|
return pendingKeys.length > 0
|
||||||
|
}
|
||||||
|
|
||||||
get printerName(): string {
|
get printerName(): string {
|
||||||
if (this.$store.state.gui.general.printername.length) return this.$store.state.gui.general.printername
|
if (this.$store.state.gui.general.printername.length) return this.$store.state.gui.general.printername
|
||||||
|
|
||||||
@@ -248,13 +236,43 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
return this.$store.state.gui.uiSettings.logo
|
return this.$store.state.gui.uiSettings.logo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get boolShowUploadAndPrint() {
|
||||||
|
return (
|
||||||
|
this.klippyIsConnected &&
|
||||||
|
this.existGcodesRootDirectory &&
|
||||||
|
['standby', 'complete', 'cancelled'].includes(this.printer_state) &&
|
||||||
|
!this.boolHideUploadAndPrintButton
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultNavigationStateSetting() {
|
||||||
|
return this.$store.state.gui?.uiSettings?.defaultNavigationStateSetting ?? 'alwaysOpen'
|
||||||
|
}
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
//this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
||||||
|
switch (this.defaultNavigationStateSetting) {
|
||||||
|
case 'alwaysClosed':
|
||||||
|
this.naviDrawer = false
|
||||||
|
break
|
||||||
|
|
||||||
|
case 'lastState':
|
||||||
|
this.naviDrawer = (localStorage.getItem('naviDrawer') ?? 'true') === 'true'
|
||||||
|
break
|
||||||
|
|
||||||
|
default:
|
||||||
|
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
btnEmergencyStop() {
|
btnEmergencyStop() {
|
||||||
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
|
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
|
||||||
if (confirmOnEmergencyStop) {
|
if (confirmOnEmergencyStop) {
|
||||||
this.showEmergencyStopDialog = true
|
this.showEmergencyStopDialog = true
|
||||||
} else {
|
return
|
||||||
this.emergencyStop()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.emergencyStop()
|
||||||
}
|
}
|
||||||
|
|
||||||
emergencyStop() {
|
emergencyStop() {
|
||||||
@@ -273,14 +291,14 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
|
|
||||||
async uploadAndStart() {
|
async uploadAndStart() {
|
||||||
if (this.$refs.fileUploadAndStart?.files.length) {
|
if (this.$refs.fileUploadAndStart?.files.length) {
|
||||||
this.$store.dispatch('socket/addLoading', { name: 'btnUploadAndStart' })
|
await this.$store.dispatch('socket/addLoading', { name: 'btnUploadAndStart' })
|
||||||
let successFiles = []
|
let successFiles = []
|
||||||
for (const file of this.$refs.fileUploadAndStart?.files || []) {
|
for (const file of this.$refs.fileUploadAndStart?.files || []) {
|
||||||
const result = await this.doUploadAndStart(file)
|
const result = await this.doUploadAndStart(file)
|
||||||
successFiles.push(result)
|
successFiles.push(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$store.dispatch('socket/removeLoading', { name: 'btnUploadAndStart' })
|
await this.$store.dispatch('socket/removeLoading', { name: 'btnUploadAndStart' })
|
||||||
for (const file of successFiles) {
|
for (const file of successFiles) {
|
||||||
const text = this.$t('App.TopBar.UploadOfFileSuccessful', { file: file }).toString()
|
const text = this.$t('App.TopBar.UploadOfFileSuccessful', { file: file }).toString()
|
||||||
this.$toast.success(text)
|
this.$toast.success(text)
|
||||||
@@ -344,3 +362,31 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
::v-deep .topbar .v-toolbar__content {
|
||||||
|
padding-top: 0 !important;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-min-width-auto {
|
||||||
|
min-width: auto !important;
|
||||||
|
}
|
||||||
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
.topbar .v-btn {
|
||||||
|
height: 100% !important;
|
||||||
|
max-height: none;
|
||||||
|
}
|
||||||
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
.topbar .v-btn.v-btn--icon {
|
||||||
|
/*noinspection CssUnresolvedCustomProperty*/
|
||||||
|
width: var(--topbar-icon-btn-width) !important;
|
||||||
|
}
|
||||||
|
/*noinspection CssUnusedSymbol*/
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
header.topbar {
|
||||||
|
z-index: 8 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -161,10 +161,14 @@ export default class TheUpdateDialog extends Mixins(BaseMixin) {
|
|||||||
this.complete &&
|
this.complete &&
|
||||||
['client', 'mainsail', 'full'].includes(this.application.toLowerCase())
|
['client', 'mainsail', 'full'].includes(this.application.toLowerCase())
|
||||||
)
|
)
|
||||||
window.location.reload(true)
|
window.location.reload()
|
||||||
else {
|
else {
|
||||||
this.$store.commit('server/updateManager/resetUpdateResponse')
|
this.$store.commit('server/updateManager/resetUpdateResponse')
|
||||||
this.$socket.emit('machine.update.status', { refresh: false }, { action: 'server/updateManager/getStatus' })
|
this.$socket.emit(
|
||||||
|
'machine.update.status',
|
||||||
|
{ refresh: false },
|
||||||
|
{ action: 'server/updateManager/onUpdateStatus' }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-snackbar v-if="show" :timeout="-1" :value="true" fixed right bottom dark>
|
<v-snackbar v-if="show" :timeout="-1" :value="true" fixed right bottom dark>
|
||||||
<span v-if="maxNumber > 1" class="mr-1">({{ currentNumber }}/{{ maxNumber }})</span>
|
<span v-if="maxNumber > 1" class="mr-1">({{ currentNumber }}/{{ maxNumber }})</span>
|
||||||
<strong>{{ $t('Files.Uploading') + ' ' + filename }}</strong>
|
<strong>{{ $t('Editor.Uploading') + ' ' + filename }}</strong>
|
||||||
<br />
|
<br />
|
||||||
{{ percent }} % @ {{ speed }}/s
|
{{ percent }} % @ {{ speed }}/s
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
+3
-3
@@ -5,7 +5,7 @@
|
|||||||
:option="chartOptions"
|
:option="chartOptions"
|
||||||
:autoresize="true"
|
:autoresize="true"
|
||||||
:init-options="{ renderer: 'svg' }"
|
:init-options="{ renderer: 'svg' }"
|
||||||
style="height: 250px; width: 100%"></e-chart>
|
style="height: 200px; width: 100%"></e-chart>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -13,13 +13,13 @@ import Component from 'vue-class-component'
|
|||||||
import { Mixins, Watch } from 'vue-property-decorator'
|
import { Mixins, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import type { ECharts } from 'echarts/core'
|
import type { ECharts } from 'echarts/core'
|
||||||
import { ECBasicOption } from 'echarts/types/dist/shared'
|
import { ECBasicOption } from 'echarts/types/dist/shared.d'
|
||||||
import { ServerHistoryStateAllPrintStatusEntry } from '@/store/server/history/types'
|
import { ServerHistoryStateAllPrintStatusEntry } from '@/store/server/history/types'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {},
|
components: {},
|
||||||
})
|
})
|
||||||
export default class HistoryAllPrintStatus extends Mixins(BaseMixin) {
|
export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin) {
|
||||||
declare $refs: {
|
declare $refs: {
|
||||||
historyAllPrintStatus: any
|
historyAllPrintStatus: any
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<v-simple-table>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="status in printStatusArray" :key="status.name">
|
||||||
|
<td>{{ status.displayName }}</td>
|
||||||
|
<td class="text-right">{{ status.value }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</v-simple-table>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { ServerHistoryStateAllPrintStatusEntry } from '@/store/server/history/types'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: {},
|
||||||
|
})
|
||||||
|
export default class HistoryAllPrintStatusTable extends Mixins(BaseMixin) {
|
||||||
|
get selectedJobs() {
|
||||||
|
return this.$store.state.gui.view.history.selectedJobs ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
get allPrintStatusArray() {
|
||||||
|
return this.$store.getters['server/history/getAllPrintStatusArrayAll']
|
||||||
|
}
|
||||||
|
|
||||||
|
get selectedPrintStatusArray() {
|
||||||
|
return this.$store.getters['server/history/getSelectedPrintStatusArray']
|
||||||
|
}
|
||||||
|
|
||||||
|
get printStatusArray() {
|
||||||
|
const output: ServerHistoryStateAllPrintStatusEntry[] = []
|
||||||
|
const orgArray = this.selectedJobs.length ? this.selectedPrintStatusArray : this.allPrintStatusArray
|
||||||
|
|
||||||
|
orgArray.forEach((status: ServerHistoryStateAllPrintStatusEntry) => {
|
||||||
|
const tmp = { ...status }
|
||||||
|
tmp.name = status.displayName
|
||||||
|
output.push(tmp)
|
||||||
|
})
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
+134
-140
@@ -5,7 +5,8 @@
|
|||||||
:option="chartOptions"
|
:option="chartOptions"
|
||||||
:init-options="{ renderer: 'svg' }"
|
:init-options="{ renderer: 'svg' }"
|
||||||
:autoresize="true"
|
:autoresize="true"
|
||||||
style="height: 250px; width: 100%"></e-chart>
|
:style="tempchartStyle"
|
||||||
|
class="tempchart" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
@@ -13,11 +14,12 @@ import { convertName } from '@/plugins/helpers'
|
|||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
import { Mixins, Watch } from 'vue-property-decorator'
|
import { Mixins, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '../mixins/base'
|
import BaseMixin from '../mixins/base'
|
||||||
import { PrinterTempHistoryStateSerie, PrinterTempHistoryStateSourceEntry } from '@/store/printer/tempHistory/types'
|
import { PrinterTempHistoryStateSourceEntry } from '@/store/printer/tempHistory/types'
|
||||||
|
|
||||||
import type { ECharts } from 'echarts/core'
|
import type { ECharts } from 'echarts/core'
|
||||||
import type { ECBasicOption } from 'echarts/types/dist/shared'
|
import type { ECBasicOption } from 'echarts/types/dist/shared.d'
|
||||||
import { mdiClock } from '@mdi/js'
|
import { mdiClock } from '@mdi/js'
|
||||||
|
import { datasetTypesInPercents } from '@/store/variables'
|
||||||
|
|
||||||
interface echartsTooltipObj {
|
interface echartsTooltipObj {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
@@ -32,11 +34,48 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private isVisible = true
|
private isVisible = true
|
||||||
public chartOptions: ECBasicOption = {
|
get chartOptions(): ECBasicOption {
|
||||||
darkMode: true,
|
return {
|
||||||
renderer: 'svg',
|
darkMode: true,
|
||||||
animation: false,
|
renderer: 'svg',
|
||||||
tooltip: {
|
animation: false,
|
||||||
|
tooltip: this.tooltip,
|
||||||
|
grid: {
|
||||||
|
top: 35,
|
||||||
|
right: this.gridRight,
|
||||||
|
bottom: 30,
|
||||||
|
left: 25,
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
animation: false,
|
||||||
|
show: false,
|
||||||
|
selected: this.selectedLegends,
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'time',
|
||||||
|
splitNumber: 5,
|
||||||
|
minInterval: 60 * 1000,
|
||||||
|
splitLine: {
|
||||||
|
show: true,
|
||||||
|
lineStyle: {
|
||||||
|
color: 'rgba(255, 255, 255, 0.06)',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
axisLabel: {
|
||||||
|
color: 'rgba(255, 255, 255, 0.24)',
|
||||||
|
margin: 10,
|
||||||
|
formatter: this.timeFormat,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yAxis: this.yAxis,
|
||||||
|
media: this.media,
|
||||||
|
dataset: { source: this.source },
|
||||||
|
series: this.series,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get tooltip() {
|
||||||
|
return {
|
||||||
animation: false,
|
animation: false,
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
backgroundColor: 'rgba(0,0,0,0.9)',
|
backgroundColor: 'rgba(0,0,0,0.9)',
|
||||||
@@ -56,37 +95,11 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5
|
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5
|
||||||
return obj
|
return obj
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
grid: {
|
}
|
||||||
top: 35,
|
|
||||||
right: 15,
|
get yAxis() {
|
||||||
bottom: 30,
|
return [
|
||||||
left: 25,
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
animation: false,
|
|
||||||
show: false,
|
|
||||||
selected: {},
|
|
||||||
},
|
|
||||||
/*dataZoom: [{
|
|
||||||
type: 'inside',
|
|
||||||
}],*/
|
|
||||||
xAxis: {
|
|
||||||
type: 'time',
|
|
||||||
splitNumber: 5,
|
|
||||||
minInterval: 60 * 1000,
|
|
||||||
splitLine: {
|
|
||||||
show: true,
|
|
||||||
lineStyle: {
|
|
||||||
color: 'rgba(255, 255, 255, 0.06)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
color: 'rgba(255, 255, 255, 0.24)',
|
|
||||||
margin: 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
yAxis: [
|
|
||||||
{
|
{
|
||||||
name: this.$t('Panels.TemperaturePanel.TemperaturesInChart'),
|
name: this.$t('Panels.TemperaturePanel.TemperaturesInChart'),
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@@ -156,15 +169,18 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
media: [
|
}
|
||||||
|
|
||||||
|
get media() {
|
||||||
|
return [
|
||||||
{
|
{
|
||||||
query: {
|
query: {
|
||||||
minWidth: 500,
|
minWidth: 500,
|
||||||
},
|
},
|
||||||
option: {
|
option: {
|
||||||
grid: {
|
grid: {
|
||||||
right: 15,
|
right: this.optionGridRight,
|
||||||
left: 40,
|
left: 40,
|
||||||
},
|
},
|
||||||
yAxis: [
|
yAxis: [
|
||||||
@@ -186,11 +202,7 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
]
|
||||||
dataset: {
|
|
||||||
source: [],
|
|
||||||
},
|
|
||||||
series: [],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get chart(): ECharts | null {
|
get chart(): ECharts | null {
|
||||||
@@ -225,8 +237,28 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
return this.$store.getters['printer/tempHistory/getSelectedLegends']
|
return this.$store.getters['printer/tempHistory/getSelectedLegends']
|
||||||
}
|
}
|
||||||
|
|
||||||
mounted() {
|
get timeFormat() {
|
||||||
this.initChart()
|
return this.hours12Format ? '{hh}:{mm}' : '{HH}:{mm}'
|
||||||
|
}
|
||||||
|
|
||||||
|
get tempchartHeight() {
|
||||||
|
return this.$store.state.gui.uiSettings.tempchartHeight ?? 250
|
||||||
|
}
|
||||||
|
|
||||||
|
get tempchartStyle() {
|
||||||
|
return {
|
||||||
|
height: this.tempchartHeight + 'px',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get gridRight() {
|
||||||
|
return this.boolDisplayPwmAxis ? 25 : 15
|
||||||
|
}
|
||||||
|
|
||||||
|
get optionGridRight() {
|
||||||
|
if (this.boolDisplayPwmAxis) return 35
|
||||||
|
|
||||||
|
return 15
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@@ -234,75 +266,17 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
if (this.chart) this.chart.dispose()
|
if (this.chart) this.chart.dispose()
|
||||||
}
|
}
|
||||||
|
|
||||||
initChart() {
|
|
||||||
this.chartOptions.series = this.series
|
|
||||||
this.chartOptions.legend.selected = this.selectedLegends
|
|
||||||
this.updateChartPwmAxis()
|
|
||||||
}
|
|
||||||
|
|
||||||
updateChart() {
|
|
||||||
if (this.chart && this.isVisible) {
|
|
||||||
//const t0 = performance.now()
|
|
||||||
const limitDate = new Date(Date.now() - this.maxHistory * 1000)
|
|
||||||
let newSource = [...this.source].filter((entry: PrinterTempHistoryStateSourceEntry) => {
|
|
||||||
return entry.date >= limitDate
|
|
||||||
})
|
|
||||||
|
|
||||||
this.chart?.setOption(
|
|
||||||
{
|
|
||||||
dataset: {
|
|
||||||
source: newSource,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
|
|
||||||
//const t1 = performance.now()
|
|
||||||
//window.console.debug('calc chart', (t1-t0).toFixed(), newSource.length, this.source.length)
|
|
||||||
|
|
||||||
// reset tempHistory if working sources are smaller than 80%
|
|
||||||
if (this.source.length > 0 && newSource.length < this.maxHistory * 0.8) {
|
|
||||||
this.$socket.emit('server.temperature_store', {}, { action: 'printer/tempHistory/init' })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateChartPwmAxis() {
|
|
||||||
if (this.boolDisplayPwmAxis) {
|
|
||||||
this.chartOptions.yAxis[1].show = true
|
|
||||||
this.chartOptions.grid.right = 25
|
|
||||||
this.chartOptions.media[0].option.grid.right = 35
|
|
||||||
} else {
|
|
||||||
this.chartOptions.yAxis[1].show = false
|
|
||||||
this.chartOptions.grid.right = 15
|
|
||||||
this.chartOptions.media[0].option.grid.right = 15
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
visibilityChanged(isVisible: boolean) {
|
visibilityChanged(isVisible: boolean) {
|
||||||
this.isVisible = isVisible
|
this.isVisible = isVisible
|
||||||
|
|
||||||
if (isVisible) {
|
|
||||||
this.initChart()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tooltipFormatter(datasets: any) {
|
tooltipFormatter(datasets: any) {
|
||||||
let output = ''
|
let output = ''
|
||||||
|
|
||||||
const mainDatasets = datasets.filter((dataset: any) => {
|
const mainDatasets = datasets.filter((dataset: any) => dataset.seriesName.endsWith('-temperature'))
|
||||||
if (dataset.seriesName === 'date') return false
|
|
||||||
|
|
||||||
const lastIndex = dataset.seriesName.lastIndexOf('-')
|
|
||||||
if (lastIndex === -1) return true
|
|
||||||
|
|
||||||
const suffix = dataset.seriesName.slice(lastIndex + 1)
|
|
||||||
return !['target', 'power', 'speed'].includes(suffix)
|
|
||||||
})
|
|
||||||
if (datasets.length) {
|
if (datasets.length) {
|
||||||
let outputTime = datasets[0]['axisValueLabel']
|
let outputTime = datasets[0]['axisValueLabel']
|
||||||
outputTime = outputTime.substr(outputTime.indexOf(' '))
|
outputTime = outputTime.substring(outputTime.indexOf(' '))
|
||||||
|
|
||||||
output +=
|
output +=
|
||||||
'<div class="row">' +
|
'<div class="row">' +
|
||||||
@@ -321,24 +295,43 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mainDatasets.forEach((dataset: any) => {
|
mainDatasets.forEach((dataset: any) => {
|
||||||
|
const baseSeriesName = dataset.seriesName.substring(0, dataset.seriesName.lastIndexOf('-'))
|
||||||
|
let displayName = baseSeriesName
|
||||||
|
if (displayName.indexOf(' ') !== -1) {
|
||||||
|
displayName = displayName.substring(displayName.indexOf(' ') + 1)
|
||||||
|
}
|
||||||
|
|
||||||
output += '<div class="row">'
|
output += '<div class="row">'
|
||||||
|
|
||||||
output += '<div class="col-auto py-0">'
|
output += '<div class="col-auto py-0">'
|
||||||
output += dataset.marker
|
output += dataset.marker
|
||||||
output += "<span class='ml-2'>" + convertName(dataset.seriesName) + ':</span>'
|
output += "<span class='ml-2'>" + convertName(displayName) + ':</span>'
|
||||||
output += '</div>'
|
output += '</div>'
|
||||||
|
|
||||||
output += '<div class="col text-right py-0 font-weight-bold">'
|
output += '<div class="col text-right py-0 font-weight-bold">'
|
||||||
|
|
||||||
if (dataset.seriesName in dataset.value) output += dataset.value[dataset.seriesName].toFixed(1)
|
const seriesNameTemperature = `${baseSeriesName}-temperature`
|
||||||
if (dataset.seriesName + '-target' in dataset.value)
|
const seriesNameTarget = `${baseSeriesName}-target`
|
||||||
output += ' / ' + dataset.value[dataset.seriesName + '-target'].toFixed(1)
|
|
||||||
|
if (seriesNameTemperature in dataset.value) {
|
||||||
|
const value = dataset.value[seriesNameTemperature]
|
||||||
|
output += value !== null ? value.toFixed(1) : '--'
|
||||||
|
}
|
||||||
|
if (seriesNameTarget in dataset.value) {
|
||||||
|
output += ' / '
|
||||||
|
const value = dataset.value[seriesNameTarget]
|
||||||
|
output += value !== null ? value.toFixed(1) : '--'
|
||||||
|
}
|
||||||
output += '°C'
|
output += '°C'
|
||||||
|
|
||||||
if (dataset.seriesName + '-power' in dataset.value)
|
datasetTypesInPercents.forEach((attrKey) => {
|
||||||
output += ' [ ' + (dataset.value[dataset.seriesName + '-power'] * 100).toFixed(0) + '% ]'
|
const seriesName = `${baseSeriesName}-${attrKey}`
|
||||||
if (dataset.seriesName + '-speed' in dataset.value)
|
if (!(seriesName in dataset.value)) return
|
||||||
output += ' [ ' + (dataset.value[dataset.seriesName + '-speed'] * 100).toFixed(0) + '% ]'
|
|
||||||
|
let value = dataset.value[seriesName]
|
||||||
|
value = value !== null ? (dataset.value[seriesName] * 100).toFixed(0) : '--'
|
||||||
|
output += ` [ ${value}% ]`
|
||||||
|
})
|
||||||
|
|
||||||
output += '</div>'
|
output += '</div>'
|
||||||
output += '</div>'
|
output += '</div>'
|
||||||
@@ -347,26 +340,6 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('series', { deep: true })
|
|
||||||
seriesChanged(newVal: PrinterTempHistoryStateSerie[]) {
|
|
||||||
if (this.chart && this.chart?.isDisposed() !== true) {
|
|
||||||
this.chart.setOption(
|
|
||||||
{
|
|
||||||
series: newVal,
|
|
||||||
},
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Watch('source')
|
|
||||||
sourceChanged() {
|
|
||||||
if (this.chart?.isDisposed() !== true) {
|
|
||||||
this.updateChart()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Watch('selectedLegends')
|
@Watch('selectedLegends')
|
||||||
selectedLegendsChanged(newVal: any, oldVal: any) {
|
selectedLegendsChanged(newVal: any, oldVal: any) {
|
||||||
if (this.chart?.isDisposed() !== true) {
|
if (this.chart?.isDisposed() !== true) {
|
||||||
@@ -379,9 +352,30 @@ export default class TempChart extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('boolDisplayPwmAxis')
|
@Watch('source')
|
||||||
boolDisplayPwmAxisChanged() {
|
sourceChanged(newVal: PrinterTempHistoryStateSourceEntry[]) {
|
||||||
this.updateChartPwmAxis()
|
// break if chart isn't initialized or not visible
|
||||||
|
if (!this.chart || !this.isVisible) return
|
||||||
|
|
||||||
|
const limitDate = new Date(Date.now() - this.maxHistory * 1000)
|
||||||
|
let newSource = newVal.filter((entry: PrinterTempHistoryStateSourceEntry) => {
|
||||||
|
return entry.date >= limitDate
|
||||||
|
})
|
||||||
|
|
||||||
|
// reset tempHistory if working sources are smaller than 80%
|
||||||
|
if (newVal.length > 0 && newSource.length < this.maxHistory * 0.8) {
|
||||||
|
this.$socket.emit(
|
||||||
|
'server.temperature_store',
|
||||||
|
{ include_monitors: true },
|
||||||
|
{ action: 'printer/tempHistory/init' }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.tempchart {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<style scoped lang="scss"></style>
|
<style scoped></style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div :class="'consoleTable ' + (isMini ? 'mini' : '')">
|
<div :class="'consoleTable ' + (isMini ? 'mini' : '')">
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<style scoped lang="scss">
|
<style scoped>
|
||||||
.consoleTableRow {
|
.consoleTableRow {
|
||||||
font-family: 'Roboto Mono', monospace;
|
font-family: 'Roboto Mono', monospace;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-row :class="'ma-0 ' + entryStyle">
|
<v-row :class="'ma-0 ' + entryStyle">
|
||||||
<v-col class="col-auto pr-0 text--disabled console-time">{{ event.formatTime }}</v-col>
|
<v-col class="col-auto pr-0 text--disabled console-time">{{ entryFormatTime }}</v-col>
|
||||||
<v-col
|
<v-col
|
||||||
:class="colorConsoleMessage(event) + ' ' + 'console-message'"
|
:class="colorConsoleMessage(event) + ' ' + 'console-message'"
|
||||||
@click.capture="commandClick"
|
@click.capture="commandClick"
|
||||||
@@ -35,12 +35,12 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
import Vue from 'vue'
|
import { Mixins, Prop } from 'vue-property-decorator'
|
||||||
import { Prop } from 'vue-property-decorator'
|
|
||||||
import { ServerStateEvent } from '@/store/server/types'
|
import { ServerStateEvent } from '@/store/server/types'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class ConsoleTableEntry extends Vue {
|
export default class ConsoleTableEntry extends Mixins(BaseMixin) {
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
declare readonly event: ServerStateEvent
|
declare readonly event: ServerStateEvent
|
||||||
|
|
||||||
@@ -48,6 +48,10 @@ export default class ConsoleTableEntry extends Vue {
|
|||||||
return this.$store.state.gui.console.entryStyle ?? 'default'
|
return this.$store.state.gui.console.entryStyle ?? 'default'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get entryFormatTime() {
|
||||||
|
return this.formatTime(this.event.date.getTime(), true)
|
||||||
|
}
|
||||||
|
|
||||||
colorConsoleMessage(item: ServerStateEvent): string {
|
colorConsoleMessage(item: ServerStateEvent): string {
|
||||||
if (item.message.startsWith('!! ')) return 'error--text'
|
if (item.message.startsWith('!! ')) return 'error--text'
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<v-tooltip right color="panel">
|
||||||
|
<template #activator="{ on, attrs }">
|
||||||
|
<v-icon v-bind="attrs" v-on="on">
|
||||||
|
{{ mdiHelpCircleOutline }}
|
||||||
|
</v-icon>
|
||||||
|
</template>
|
||||||
|
<v-container class="version-container pa-0">
|
||||||
|
<div><img height="12" src="/img/logo.svg" alt="mainsail-logo" /></div>
|
||||||
|
<div>v{{ mainsailVersion }}</div>
|
||||||
|
<div>
|
||||||
|
<v-icon small class="moonraker-logo">{{ mdiMoonWaningCrescent }}</v-icon>
|
||||||
|
</div>
|
||||||
|
<div>{{ moonrakerVersion }}</div>
|
||||||
|
<div><img height="12" src="/img/klipper.svg" class="klipper-logo" alt="klipper-logo" /></div>
|
||||||
|
<div>{{ klipperVersion }}</div>
|
||||||
|
</v-container>
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import BaseMixin from '../mixins/base'
|
||||||
|
import { Mixins } from 'vue-property-decorator'
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { mdiCloseThick, mdiHelpCircleOutline, mdiMoonWaningCrescent } from '@mdi/js'
|
||||||
|
|
||||||
|
@Component({})
|
||||||
|
export default class AboutDialog extends Mixins(BaseMixin) {
|
||||||
|
mdiHelpCircleOutline = mdiHelpCircleOutline
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
mdiMoonWaningCrescent = mdiMoonWaningCrescent
|
||||||
|
|
||||||
|
get mainsailVersion(): string {
|
||||||
|
return this.$store.state.packageVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
get klipperVersion(): string {
|
||||||
|
return this.$store.state.printer?.software_version ?? ''
|
||||||
|
}
|
||||||
|
|
||||||
|
get moonrakerVersion(): string {
|
||||||
|
return this.$store.state.server?.moonraker_version ?? ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.klipper-logo {
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
.moonraker-logo {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
color: #ebc815;
|
||||||
|
}
|
||||||
|
.version-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 20px auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-dialog v-model="showDialog" width="800" persistent :fullscreen="isMobile">
|
||||||
|
<panel
|
||||||
|
:title="$t('Panels.SpoolmanPanel.ChangeSpool')"
|
||||||
|
:icon="mdiAdjust"
|
||||||
|
card-class="spoolman-change-spool-dialog"
|
||||||
|
:margin-bottom="false">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="close">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-title>
|
||||||
|
<v-text-field
|
||||||
|
v-model="search"
|
||||||
|
:append-icon="mdiMagnify"
|
||||||
|
:label="$t('Panels.SpoolmanPanel.Search')"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
hide-details
|
||||||
|
style="max-width: 300px" />
|
||||||
|
<v-spacer />
|
||||||
|
<v-btn
|
||||||
|
:title="$t('Panels.SpoolmanPanel.Refresh')"
|
||||||
|
class="px-2 minwidth-0 ml-3"
|
||||||
|
:loading="loadings.includes('refreshSpools')"
|
||||||
|
@click="refreshSpools">
|
||||||
|
<v-icon>{{ mdiRefresh }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-btn
|
||||||
|
:title="$t('Panels.SpoolmanPanel.OpenSpoolManager')"
|
||||||
|
class="px-2 minwidth-0 ml-3"
|
||||||
|
@click="openSpoolManager">
|
||||||
|
<v-icon>{{ mdiDatabase }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-card-title>
|
||||||
|
<v-card-text class="px-0 pb-0">
|
||||||
|
<v-data-table
|
||||||
|
:headers="headers"
|
||||||
|
:items="spools"
|
||||||
|
item-key="id"
|
||||||
|
:search="search"
|
||||||
|
sort-by="last_used"
|
||||||
|
:sort-desc="true"
|
||||||
|
:custom-filter="customFilter">
|
||||||
|
<template #no-data>
|
||||||
|
<div class="text-center">{{ $t('Panels.SpoolmanPanel.NoSpools') }}</div>
|
||||||
|
</template>
|
||||||
|
<template #no-results>
|
||||||
|
<div class="text-center">{{ $t('Panels.SpoolmanPanel.NoResults') }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #item="{ item }">
|
||||||
|
<SpoolmanChangeSpoolDialogRow
|
||||||
|
:key="item.id"
|
||||||
|
:spool="item"
|
||||||
|
:max_id_digits="max_spool_id_digits"
|
||||||
|
@set-spool="setSpool" />
|
||||||
|
</template>
|
||||||
|
</v-data-table>
|
||||||
|
</v-card-text>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import { mdiCloseThick, mdiAdjust, mdiDatabase, mdiMagnify, mdiRefresh } from '@mdi/js'
|
||||||
|
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||||
|
import SpoolmanChangeSpoolDialogRow from '@/components/dialogs/SpoolmanChangeSpoolDialogRow.vue'
|
||||||
|
@Component({
|
||||||
|
components: { SpoolmanChangeSpoolDialogRow, Panel },
|
||||||
|
})
|
||||||
|
export default class SpoolmanChangeSpoolDialog extends Mixins(BaseMixin) {
|
||||||
|
mdiAdjust = mdiAdjust
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
mdiDatabase = mdiDatabase
|
||||||
|
mdiMagnify = mdiMagnify
|
||||||
|
mdiRefresh = mdiRefresh
|
||||||
|
|
||||||
|
@Prop({ required: true }) declare readonly showDialog: boolean
|
||||||
|
|
||||||
|
search = ''
|
||||||
|
|
||||||
|
get spools(): ServerSpoolmanStateSpool[] {
|
||||||
|
return this.$store.state.server.spoolman.spools ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
get max_spool_id_digits(): number {
|
||||||
|
const max_id = this.$store.state.server.spoolman.spools.reduce(
|
||||||
|
(x: number, s: ServerSpoolmanStateSpool) => Math.max(x, s.id),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
|
||||||
|
return max_id.toString().length
|
||||||
|
}
|
||||||
|
|
||||||
|
get headers() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
text: ' ',
|
||||||
|
align: 'start',
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.Filament'),
|
||||||
|
align: 'start',
|
||||||
|
value: 'filament.name',
|
||||||
|
sortable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.Material'),
|
||||||
|
align: 'center',
|
||||||
|
value: 'filament.material',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.LastUsed'),
|
||||||
|
align: 'end',
|
||||||
|
value: 'last_used',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.Weight'),
|
||||||
|
align: 'end',
|
||||||
|
value: 'remaining_weight',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
get spoolManagerUrl() {
|
||||||
|
return this.$store.state.server.config.config?.spoolman?.server ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
openSpoolManager() {
|
||||||
|
window.open(this.spoolManagerUrl, '_blank')
|
||||||
|
}
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
refresh() {
|
||||||
|
this.$store.dispatch('server/spoolman/refreshSpools')
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshSpools() {
|
||||||
|
this.$store.dispatch('server/spoolman/refreshSpools')
|
||||||
|
}
|
||||||
|
|
||||||
|
customFilter(value: any, search: string, item: ServerSpoolmanStateSpool): boolean {
|
||||||
|
const querySplits = search.toLowerCase().split(' ')
|
||||||
|
const searchArray = [
|
||||||
|
item.comment,
|
||||||
|
item.filament.name,
|
||||||
|
item.filament.vendor.name,
|
||||||
|
item.filament.material,
|
||||||
|
item.location,
|
||||||
|
]
|
||||||
|
|
||||||
|
for (const query of querySplits) {
|
||||||
|
const result = searchArray.some((q) => q?.toLowerCase().includes(query))
|
||||||
|
|
||||||
|
if (!result) return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
setSpool(spool: ServerSpoolmanStateSpool) {
|
||||||
|
this.$store.dispatch('server/spoolman/setActiveSpool', spool.id)
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch('showDialog')
|
||||||
|
onShowDialogChanged(newVal: boolean) {
|
||||||
|
if (newVal) this.search = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<tr class="cursor-pointer" @click="setSpoolRow">
|
||||||
|
<td style="width: 50px" class="pr-0 py-2">
|
||||||
|
<spool-icon :color="color" style="width: 50px; float: left" class="mr-3" />
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td class="py-2" style="min-width: 300px">
|
||||||
|
<v-list-item two-line>
|
||||||
|
<v-list-item-content class="no--padding">
|
||||||
|
<div class="text--disabled mb-1">#{{ id }} | {{ vendor }}</div>
|
||||||
|
<v-list-item-title class="mb-1">
|
||||||
|
<span class="text--filament">{{ name }}</span>
|
||||||
|
</v-list-item-title>
|
||||||
|
</v-list-item-content>
|
||||||
|
</v-list-item>
|
||||||
|
<template v-if="location">
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.SpoolmanPanel.Location') }}: {{ location }}
|
||||||
|
</template>
|
||||||
|
<template v-if="spool.comment">
|
||||||
|
<br />
|
||||||
|
{{ spool.comment }}
|
||||||
|
</template>
|
||||||
|
</td>
|
||||||
|
<td class="text-center text-no-wrap">{{ material }}</td>
|
||||||
|
<td class="text-right text-no-wrap">{{ last_used }}</td>
|
||||||
|
<td class="text-right text-no-wrap">
|
||||||
|
<strong>{{ remaining_weight_format }}</strong>
|
||||||
|
<small class="ml-1">/ {{ total_weight_format }}</small>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||||
|
@Component({})
|
||||||
|
export default class SpoolmanChangeSpoolDialogRow extends Mixins(BaseMixin) {
|
||||||
|
@Prop({ required: true }) declare readonly spool: ServerSpoolmanStateSpool
|
||||||
|
@Prop({ required: false }) declare readonly max_id_digits: number
|
||||||
|
|
||||||
|
get color() {
|
||||||
|
const color = this.spool.filament?.color_hex ?? '000'
|
||||||
|
|
||||||
|
return `#${color}`
|
||||||
|
}
|
||||||
|
|
||||||
|
get id() {
|
||||||
|
// add leading zeros depending on max_id digit count
|
||||||
|
let id: string = this.spool.id.toString()
|
||||||
|
|
||||||
|
while (id.length < this.max_id_digits) {
|
||||||
|
id = '0' + id
|
||||||
|
}
|
||||||
|
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
||||||
|
get vendor() {
|
||||||
|
return this.spool.filament?.vendor?.name ?? 'Unknown'
|
||||||
|
}
|
||||||
|
|
||||||
|
get name() {
|
||||||
|
return this.spool.filament?.name ?? 'Unknown'
|
||||||
|
}
|
||||||
|
|
||||||
|
get location() {
|
||||||
|
return this.spool.location
|
||||||
|
}
|
||||||
|
|
||||||
|
get material() {
|
||||||
|
return this.spool.filament?.material ?? '--'
|
||||||
|
}
|
||||||
|
|
||||||
|
get remaining_weight() {
|
||||||
|
return this.spool.remaining_weight ?? 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get total_weight() {
|
||||||
|
return this.spool.filament?.weight ?? 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get remaining_weight_format() {
|
||||||
|
return `${this.remaining_weight.toFixed(0)}g`
|
||||||
|
}
|
||||||
|
|
||||||
|
get total_weight_format() {
|
||||||
|
if (this.total_weight < 1000) {
|
||||||
|
return `${this.total_weight.toFixed(0)}g`
|
||||||
|
}
|
||||||
|
|
||||||
|
let totalRound = Math.round(this.total_weight / 1000)
|
||||||
|
if (totalRound !== this.total_weight / 1000) {
|
||||||
|
totalRound = Math.round(this.total_weight / 100) / 10
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${totalRound}kg`
|
||||||
|
}
|
||||||
|
|
||||||
|
get last_used() {
|
||||||
|
const last_used = this.spool.last_used ?? null
|
||||||
|
if (!last_used) return this.$t('Panels.SpoolmanPanel.Never')
|
||||||
|
|
||||||
|
const date = new Date(this.spool.last_used)
|
||||||
|
const now = new Date()
|
||||||
|
const diff = now.getTime() - date.getTime()
|
||||||
|
|
||||||
|
if (diff <= 1000 * 60 * 60 * 24) return this.$t('Panels.SpoolmanPanel.Today')
|
||||||
|
if (diff <= 1000 * 60 * 60 * 24 * 2) return this.$t('Panels.SpoolmanPanel.Yesterday')
|
||||||
|
if (diff <= 1000 * 60 * 60 * 24 * 14) {
|
||||||
|
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
|
||||||
|
|
||||||
|
return this.$t('Panels.SpoolmanPanel.DaysAgo', { days })
|
||||||
|
}
|
||||||
|
|
||||||
|
return date.toLocaleDateString()
|
||||||
|
}
|
||||||
|
|
||||||
|
setSpoolRow() {
|
||||||
|
this.$emit('set-spool', this.spool)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.text--filament {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.no--padding {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog v-model="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||||
|
<panel
|
||||||
|
:title="$t('Panels.SpoolmanPanel.EjectSpool')"
|
||||||
|
:icon="mdiEject"
|
||||||
|
card-class="spoolman-eject-spool-dialog"
|
||||||
|
:margin-bottom="false">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="close">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<p class="body-2">{{ $t('Panels.SpoolmanPanel.EjectSpoolQuestion') }}</p>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer />
|
||||||
|
<v-btn text @click="close">{{ $t('Panels.SpoolmanPanel.Cancel') }}</v-btn>
|
||||||
|
<v-btn color="primary" text @click="removeSpool">
|
||||||
|
{{ $t('Panels.SpoolmanPanel.EjectSpool') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import { mdiCloseThick, mdiEject } from '@mdi/js'
|
||||||
|
@Component({
|
||||||
|
components: { Panel },
|
||||||
|
})
|
||||||
|
export default class SpoolmanEjectSpoolDialog extends Mixins(BaseMixin) {
|
||||||
|
mdiEject = mdiEject
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
|
||||||
|
@Prop({ required: true }) declare readonly showDialog: boolean
|
||||||
|
|
||||||
|
close() {
|
||||||
|
this.$emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
removeSpool() {
|
||||||
|
this.$store.dispatch('server/spoolman/setActiveSpool', null)
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,23 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-dialog v-model="bool" :max-width="dialogWidth">
|
<v-dialog v-model="bool" :max-width="dialogWidth" @click:outside="closeDialog" @keydown.esc="closeDialog">
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-img v-if="file.big_thumbnail" contain :src="file.big_thumbnail"></v-img>
|
<v-img v-if="file.big_thumbnail" contain :src="file.big_thumbnail" :style="bigThumbnailStyle" />
|
||||||
<v-card-title class="headline">{{ $t('Dialogs.StartPrint.Headline') }}</v-card-title>
|
<v-card-title class="text-h5">{{ $t('Dialogs.StartPrint.Headline') }}</v-card-title>
|
||||||
<v-card-text class="pb-0">
|
<v-card-text class="pb-0">
|
||||||
{{ $t('Dialogs.StartPrint.DoYouWantToStartFilename', { filename: file.filename }) }}
|
<p class="body-2">
|
||||||
|
{{ question }}
|
||||||
|
</p>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
<start-print-dialog-spoolman v-if="moonrakerComponents.includes('spoolman')" :file="file" />
|
||||||
<template v-if="moonrakerComponents.includes('timelapse')">
|
<template v-if="moonrakerComponents.includes('timelapse')">
|
||||||
<v-divider class="mt-3 mb-2"></v-divider>
|
<v-divider v-if="!moonrakerComponents.includes('spoolman')" class="mt-3 mb-2" />
|
||||||
<v-card-text class="pb-0">
|
<v-card-text class="py-0">
|
||||||
<settings-row :title="$t('Dialogs.StartPrint.Timelapse')">
|
<settings-row :title="$t('Dialogs.StartPrint.Timelapse')">
|
||||||
<v-switch v-model="timelapseEnabled" hide-details class="mt-0"></v-switch>
|
<v-switch v-model="timelapseEnabled" hide-details class="mt-0" />
|
||||||
</settings-row>
|
</settings-row>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-divider class="mt-2 mb-0"></v-divider>
|
<v-divider class="mt-2 mb-0" />
|
||||||
</template>
|
</template>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer />
|
||||||
<v-btn color="" text @click="closeDialog">{{ $t('Dialogs.StartPrint.Cancel') }}</v-btn>
|
<v-btn text @click="closeDialog">{{ $t('Dialogs.StartPrint.Cancel') }}</v-btn>
|
||||||
<v-btn
|
<v-btn
|
||||||
color="primary"
|
color="primary"
|
||||||
text
|
text
|
||||||
@@ -35,6 +38,9 @@ import { Component, Mixins, Prop } from 'vue-property-decorator'
|
|||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { FileStateGcodefile } from '@/store/files/types'
|
import { FileStateGcodefile } from '@/store/files/types'
|
||||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||||
|
import { mdiPrinter3d } from '@mdi/js'
|
||||||
|
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||||
|
import { defaultBigThumbnailBackground } from '@/store/variables'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -42,6 +48,8 @@ import SettingsRow from '@/components/settings/SettingsRow.vue'
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class StartPrintDialog extends Mixins(BaseMixin) {
|
export default class StartPrintDialog extends Mixins(BaseMixin) {
|
||||||
|
mdiPrinter3d = mdiPrinter3d
|
||||||
|
|
||||||
@Prop({ required: true, default: false })
|
@Prop({ required: true, default: false })
|
||||||
declare readonly bool: boolean
|
declare readonly bool: boolean
|
||||||
|
|
||||||
@@ -67,6 +75,43 @@ export default class StartPrintDialog extends Mixins(BaseMixin) {
|
|||||||
return this.file.big_thumbnail_width ?? 400
|
return this.file.big_thumbnail_width ?? 400
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get bigThumbnailBackground() {
|
||||||
|
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||||
|
}
|
||||||
|
|
||||||
|
get bigThumbnailStyle() {
|
||||||
|
if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { backgroundColor: this.bigThumbnailBackground }
|
||||||
|
}
|
||||||
|
|
||||||
|
get active_spool(): ServerSpoolmanStateSpool | null {
|
||||||
|
return this.$store.state.server.spoolman.active_spool ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
get filamentVendor() {
|
||||||
|
return this.active_spool?.filament?.vendor?.name ?? 'Unknown'
|
||||||
|
}
|
||||||
|
|
||||||
|
get filamentName() {
|
||||||
|
return this.active_spool?.filament.name ?? 'Unknown'
|
||||||
|
}
|
||||||
|
|
||||||
|
get filament() {
|
||||||
|
return `${this.filamentVendor} - ${this.filamentName}`
|
||||||
|
}
|
||||||
|
|
||||||
|
get question() {
|
||||||
|
if (this.active_spool)
|
||||||
|
return this.$t('Dialogs.StartPrint.DoYouWantToStartFilenameFilament', {
|
||||||
|
filename: this.file?.filename ?? 'unknown',
|
||||||
|
})
|
||||||
|
|
||||||
|
return this.$t('Dialogs.StartPrint.DoYouWantToStartFilename', { filename: this.file?.filename ?? 'unknown' })
|
||||||
|
}
|
||||||
|
|
||||||
startPrint(filename = '') {
|
startPrint(filename = '') {
|
||||||
filename = (this.currentPath + '/' + filename).substring(1)
|
filename = (this.currentPath + '/' + filename).substring(1)
|
||||||
this.closeDialog()
|
this.closeDialog()
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<v-divider class="mt-3 mb-0" />
|
||||||
|
<v-card-text class="py-0 px-2">
|
||||||
|
<spoolman-panel-active-spool
|
||||||
|
v-if="activeSpoolId !== null"
|
||||||
|
:small="true"
|
||||||
|
class="my-0"
|
||||||
|
@change-spool="showChangeSpoolDialog = true" />
|
||||||
|
<v-alert v-for="alert in alerts" :key="alert.text" text :color="alert.color" class="mt-4 mx-3">
|
||||||
|
{{ alert.text }}
|
||||||
|
</v-alert>
|
||||||
|
<div class="text-center">
|
||||||
|
<v-btn color="primary" small class="mx-auto" @click="showChangeSpoolDialog = true">
|
||||||
|
{{ buttonText }}
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</v-card-text>
|
||||||
|
<v-divider :class="classSecondDivider" />
|
||||||
|
<spoolman-change-spool-dialog :show-dialog="showChangeSpoolDialog" @close="showChangeSpoolDialog = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import SpoolmanPanelActiveSpool from '@/components/panels/Spoolman/SpoolmanPanelActiveSpool.vue'
|
||||||
|
import { FileStateGcodefile } from '@/store/files/types'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: { SpoolmanPanelActiveSpool },
|
||||||
|
})
|
||||||
|
export default class StartPrintDialogSpoolman extends Mixins(BaseMixin) {
|
||||||
|
@Prop({ required: true }) readonly file!: FileStateGcodefile
|
||||||
|
|
||||||
|
showChangeSpoolDialog = false
|
||||||
|
|
||||||
|
get activeSpoolId() {
|
||||||
|
let spoolId = this.$store.state.server.spoolman?.active_spool_id ?? null
|
||||||
|
if (spoolId === 0) spoolId = null
|
||||||
|
|
||||||
|
return spoolId
|
||||||
|
}
|
||||||
|
|
||||||
|
get activeSpool() {
|
||||||
|
return this.$store.state.server.spoolman?.active_spool ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
get classSecondDivider() {
|
||||||
|
const classes = ['mt-4']
|
||||||
|
|
||||||
|
classes.push(this.moonrakerComponents.includes('timelapse') ? 'mb-2' : 'mb-0')
|
||||||
|
|
||||||
|
return classes
|
||||||
|
}
|
||||||
|
|
||||||
|
get buttonText() {
|
||||||
|
if (this.activeSpoolId === null) return this.$t('Panels.SpoolmanPanel.SelectSpool') as string
|
||||||
|
|
||||||
|
return this.$t('Panels.SpoolmanPanel.ChangeSpool') as string
|
||||||
|
}
|
||||||
|
|
||||||
|
get alerts() {
|
||||||
|
let alerts = []
|
||||||
|
|
||||||
|
if (this.activeSpoolId === null) {
|
||||||
|
alerts.push({
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.NoSpoolSelected'),
|
||||||
|
color: 'orange',
|
||||||
|
})
|
||||||
|
|
||||||
|
// No need to check for filament type mismatch if no spool is selected
|
||||||
|
return alerts
|
||||||
|
}
|
||||||
|
|
||||||
|
let gcodeFilamentType = this.file.filament_type ?? ''
|
||||||
|
if (gcodeFilamentType.includes(';')) gcodeFilamentType = gcodeFilamentType.split(';')[0]
|
||||||
|
|
||||||
|
if (
|
||||||
|
gcodeFilamentType !== '' &&
|
||||||
|
this.activeSpool?.filament?.material?.toLowerCase() !== gcodeFilamentType.toLowerCase()
|
||||||
|
) {
|
||||||
|
alerts.push({
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.FilamentTypeMismatch', {
|
||||||
|
fileType: gcodeFilamentType,
|
||||||
|
spoolType: this.activeSpool?.filament?.material,
|
||||||
|
}),
|
||||||
|
color: 'warning',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const fileWeight = Math.round(this.file.filament_weight_total ?? 0)
|
||||||
|
const spoolWeight = Math.round(this.activeSpool?.remaining_weight ?? 0)
|
||||||
|
if (spoolWeight < fileWeight) {
|
||||||
|
alerts.push({
|
||||||
|
text: this.$t('Panels.SpoolmanPanel.TooLessFilament', {
|
||||||
|
fileWeight,
|
||||||
|
spoolWeight,
|
||||||
|
}),
|
||||||
|
color: 'warning',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return alerts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog :value="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||||
|
<panel
|
||||||
|
:title="$t('BedScrews.Headline').toString()"
|
||||||
|
:icon="mdiArrowCollapseDown"
|
||||||
|
card-class="manual_probe-dialog"
|
||||||
|
:margin-bottom="false"
|
||||||
|
style="overflow: hidden"
|
||||||
|
:height="isMobile ? 0 : 548">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="sendAbort">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<v-text-field
|
||||||
|
v-model="currentScrewName"
|
||||||
|
:label="$t('BedScrews.ScrewName')"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
clearable
|
||||||
|
hide-details></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col cols="6">
|
||||||
|
<v-text-field
|
||||||
|
v-model="currentScrewOutput"
|
||||||
|
:label="$t('BedScrews.ScrewIndex')"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
clearable
|
||||||
|
hide-details></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="6">
|
||||||
|
<v-text-field
|
||||||
|
v-model="acceptedScrewOutput"
|
||||||
|
:label="$t('BedScrews.ScrewAccepted')"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
clearable
|
||||||
|
hide-details></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<p class="text-center mb-0" v-html="$t('BedScrews.Description')" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn text :loading="loadingAbort" @click="sendAbort">
|
||||||
|
{{ $t('BedScrews.Abort') }}
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="primary" text :loading="loadingAdjusted" @click="sendAdjusted">
|
||||||
|
{{ $t('BedScrews.Adjusted') }}
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="primary" text :loading="loadingAccept" @click="sendAccept">
|
||||||
|
{{ $t('BedScrews.Accept') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
|
||||||
|
import { mdiArrowCollapseDown, mdiInformation, mdiCloseThick } from '@mdi/js'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
@Component({
|
||||||
|
components: { Panel, Responsive },
|
||||||
|
})
|
||||||
|
export default class TheBedScrewsDialog extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
mdiArrowCollapseDown = mdiArrowCollapseDown
|
||||||
|
mdiInformation = mdiInformation
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
|
||||||
|
get showDialog() {
|
||||||
|
if (!this.boolBedScrewsDialog) return false
|
||||||
|
|
||||||
|
const is_active = this.$store.state.printer.bed_screws?.is_active ?? false
|
||||||
|
|
||||||
|
return is_active && this.homedAxes.includes('xyz')
|
||||||
|
}
|
||||||
|
|
||||||
|
get boolBedScrewsDialog() {
|
||||||
|
return this.$store.state.gui.uiSettings.boolBedScrewsDialog ?? true
|
||||||
|
}
|
||||||
|
|
||||||
|
get config() {
|
||||||
|
return this.$store.state.printer.configfile?.settings?.bed_screws ?? {}
|
||||||
|
}
|
||||||
|
|
||||||
|
get bed_screws_state() {
|
||||||
|
return this.$store.state.printer.bed_screws?.state
|
||||||
|
}
|
||||||
|
|
||||||
|
get current_screw() {
|
||||||
|
return this.$store.state.printer.bed_screws?.current_screw
|
||||||
|
}
|
||||||
|
|
||||||
|
get accepted_screws() {
|
||||||
|
return this.$store.state.printer.bed_screws?.accepted_screws
|
||||||
|
}
|
||||||
|
|
||||||
|
get loadingAbort() {
|
||||||
|
return this.loadings.includes('bedScrewsAbort')
|
||||||
|
}
|
||||||
|
|
||||||
|
get loadingAccept() {
|
||||||
|
return this.loadings.includes('bedScrewsAccept')
|
||||||
|
}
|
||||||
|
|
||||||
|
get loadingAdjusted() {
|
||||||
|
return this.loadings.includes('bedScrewsAdjusted')
|
||||||
|
}
|
||||||
|
|
||||||
|
get screwNames() {
|
||||||
|
const configKeys = Object.keys(this.config)
|
||||||
|
const screwNameKeys = configKeys.filter((name: string) => name.startsWith('screw') && name.endsWith('_name'))
|
||||||
|
|
||||||
|
const output: string[] = []
|
||||||
|
screwNameKeys?.forEach((fullName: string) => {
|
||||||
|
const index = fullName.indexOf('_')
|
||||||
|
const number = parseInt(fullName.slice(5, index))
|
||||||
|
|
||||||
|
output[number - 1] = this.config[`screw${number}_name`] ?? ''
|
||||||
|
})
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
get countScrews() {
|
||||||
|
return this.screwNames.length
|
||||||
|
}
|
||||||
|
|
||||||
|
get currentScrewName() {
|
||||||
|
return this.screwNames[this.current_screw] ?? 'UNKNOWN'
|
||||||
|
}
|
||||||
|
|
||||||
|
get currentScrewOutput() {
|
||||||
|
return this.$t('BedScrews.ScrewOutput', { current: this.current_screw, max: this.countScrews })
|
||||||
|
}
|
||||||
|
|
||||||
|
get acceptedScrewOutput() {
|
||||||
|
return this.$t('BedScrews.ScrewOutput', { current: this.accepted_screws, max: this.countScrews })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendAbort() {
|
||||||
|
const gcode = `ABORT`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAbort' })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendAccept() {
|
||||||
|
const gcode = `ACCEPT`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAccept' })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendAdjusted() {
|
||||||
|
const gcode = `ADJUSTED`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAccept' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog :value="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||||
|
<panel
|
||||||
|
:title="$t('ManualProbe.Headline').toString()"
|
||||||
|
:icon="mdiArrowCollapseDown"
|
||||||
|
card-class="manual_probe-dialog"
|
||||||
|
:margin-bottom="false"
|
||||||
|
style="overflow: hidden"
|
||||||
|
:height="isMobile ? 0 : 548">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="sendAbort">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-container>
|
||||||
|
<v-row>
|
||||||
|
<v-col class="d-flex align-center justify-center">
|
||||||
|
<span class="text-h5">{{ z_position_lower }}</span>
|
||||||
|
<v-icon class="mx-2">{{ mdiChevronTripleRight }}</v-icon>
|
||||||
|
<span class="text-h4">{{ z_position }}</span>
|
||||||
|
<v-icon class="mx-2">{{ mdiChevronTripleLeft }}</v-icon>
|
||||||
|
<span class="text-h5">{{ z_position_upper }}</span>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col class="text-left">
|
||||||
|
<v-btn class="" color="primary" @click="sendTestZ('--')">
|
||||||
|
<v-icon small>{{ mdiMinusThick }}</v-icon>
|
||||||
|
<v-icon small>{{ mdiMinusThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="text-left">
|
||||||
|
<v-btn class="" color="primary" @click="sendTestZ('-')">
|
||||||
|
<v-icon small>{{ mdiMinusThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="text-right">
|
||||||
|
<v-btn class="" color="primary" @click="sendTestZ('+')">
|
||||||
|
<v-icon small>{{ mdiPlusThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="text-right">
|
||||||
|
<v-btn class="" color="primary" @click="sendTestZ('++')">
|
||||||
|
<v-icon small>{{ mdiPlusThick }}</v-icon>
|
||||||
|
<v-icon small>{{ mdiPlusThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-container>
|
||||||
|
<sub-panel :title="$t('ManualProbe.Advanced')" sub-panel-class="manual-probe-dialog-advanced" class="mb-n2">
|
||||||
|
<v-container>
|
||||||
|
<v-item-group class="_btn-group">
|
||||||
|
<v-btn
|
||||||
|
v-for="(offset, index) in offsetsZ"
|
||||||
|
:key="`offsetsUp-${index}`"
|
||||||
|
small
|
||||||
|
class="_btn-qs flex-grow-1 px-1"
|
||||||
|
@click="sendTestZ(offset.toString())">
|
||||||
|
<v-icon v-if="index === 0" left small class="mr-1 ml-n1">
|
||||||
|
{{ mdiArrowExpandUp }}
|
||||||
|
</v-icon>
|
||||||
|
<span>+{{ offset }}</span>
|
||||||
|
</v-btn>
|
||||||
|
</v-item-group>
|
||||||
|
<v-item-group class="_btn-group mt-6 mt-sm-3">
|
||||||
|
<v-btn
|
||||||
|
v-for="(offset, index) in offsetsZ"
|
||||||
|
:key="`offsetsDown-${index}`"
|
||||||
|
small
|
||||||
|
class="_btn-qs flex-grow-1 px-1"
|
||||||
|
@click="sendTestZ((offset * -1).toString())">
|
||||||
|
<v-icon v-if="index === 0" left small class="mr-1 ml-n1">
|
||||||
|
{{ mdiArrowCollapseDown }}
|
||||||
|
</v-icon>
|
||||||
|
<span>−{{ offset }}</span>
|
||||||
|
</v-btn>
|
||||||
|
</v-item-group>
|
||||||
|
</v-container>
|
||||||
|
</sub-panel>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn text :loading="loadingAbort" @click="sendAbort">
|
||||||
|
{{ $t('ManualProbe.Abort') }}
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="primary" text :loading="loadingAccept" @click="sendAccept">
|
||||||
|
{{ $t('ManualProbe.Accept') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
|
||||||
|
import {
|
||||||
|
mdiArrowCollapseDown,
|
||||||
|
mdiArrowExpandUp,
|
||||||
|
mdiInformation,
|
||||||
|
mdiPlusThick,
|
||||||
|
mdiMinusThick,
|
||||||
|
mdiChevronTripleLeft,
|
||||||
|
mdiChevronTripleRight,
|
||||||
|
mdiCloseThick,
|
||||||
|
} from '@mdi/js'
|
||||||
|
@Component({
|
||||||
|
components: { Panel, Responsive },
|
||||||
|
})
|
||||||
|
export default class TheManualProbeDialog extends Mixins(BaseMixin) {
|
||||||
|
mdiArrowCollapseDown = mdiArrowCollapseDown
|
||||||
|
mdiArrowExpandUp = mdiArrowExpandUp
|
||||||
|
mdiInformation = mdiInformation
|
||||||
|
mdiPlusThick = mdiPlusThick
|
||||||
|
mdiMinusThick = mdiMinusThick
|
||||||
|
mdiChevronTripleLeft = mdiChevronTripleLeft
|
||||||
|
mdiChevronTripleRight = mdiChevronTripleRight
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
|
||||||
|
get showDialog() {
|
||||||
|
if (!this.boolManualProbeDialog) return false
|
||||||
|
|
||||||
|
return this.$store.state.printer.manual_probe?.is_active ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
get boolManualProbeDialog() {
|
||||||
|
return this.$store.state.gui.uiSettings.boolManualProbeDialog ?? true
|
||||||
|
}
|
||||||
|
|
||||||
|
get offsetsZ() {
|
||||||
|
const offsets = [1, 0.1, 0.05, 0.01, 0.005]
|
||||||
|
|
||||||
|
return offsets.sort()
|
||||||
|
}
|
||||||
|
|
||||||
|
get z_position() {
|
||||||
|
return (this.$store.state.printer.manual_probe?.z_position ?? 0).toFixed(3)
|
||||||
|
}
|
||||||
|
|
||||||
|
get z_position_lower() {
|
||||||
|
const value = this.$store.state.printer.manual_probe?.z_position_lower ?? null
|
||||||
|
if (value === null) return '??????'
|
||||||
|
|
||||||
|
return value.toFixed(3)
|
||||||
|
}
|
||||||
|
|
||||||
|
get z_position_upper() {
|
||||||
|
const value = this.$store.state.printer.manual_probe?.z_position_upper ?? null
|
||||||
|
if (value === null) return '??????'
|
||||||
|
|
||||||
|
return value.toFixed(3)
|
||||||
|
}
|
||||||
|
|
||||||
|
get loadingAbort() {
|
||||||
|
return this.loadings.includes('manualProbeAbort')
|
||||||
|
}
|
||||||
|
|
||||||
|
get loadingAccept() {
|
||||||
|
return this.loadings.includes('manualProbeAccept')
|
||||||
|
}
|
||||||
|
|
||||||
|
sendTestZ(offset: string) {
|
||||||
|
const gcode = `TESTZ Z=${offset}`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendAbort() {
|
||||||
|
const gcode = `ABORT`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAbort' })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendAccept() {
|
||||||
|
const gcode = `ACCEPT`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'manualProbeAccept' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.v-btn-toggle {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
._btn-group {
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.v-btn {
|
||||||
|
border-radius: 0;
|
||||||
|
border-color: rgba(255, 255, 255, 0.12) !important;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: thin;
|
||||||
|
box-shadow: none;
|
||||||
|
height: 28px;
|
||||||
|
opacity: 0.8;
|
||||||
|
min-width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:first-child {
|
||||||
|
border-top-left-radius: inherit;
|
||||||
|
border-bottom-left-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:last-child {
|
||||||
|
border-top-right-radius: inherit;
|
||||||
|
border-bottom-right-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:not(:first-child) {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
._btn-qs {
|
||||||
|
font-size: 0.8rem !important;
|
||||||
|
font-weight: 400;
|
||||||
|
max-height: 28px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog :value="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||||
|
<panel
|
||||||
|
:title="$t('ScrewsTiltAdjust.Headline')"
|
||||||
|
:icon="mdiArrowCollapseDown"
|
||||||
|
card-class="manual_probe-dialog"
|
||||||
|
:margin-bottom="false"
|
||||||
|
style="overflow: hidden"
|
||||||
|
:height="isMobile ? 0 : 548">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="clearScrewsTiltAdjust">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-text v-if="error">
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<v-alert border="left" text type="error">{{ $t('ScrewsTiltAdjust.ErrorText') }}</v-alert>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-text v-if="Object.keys(results).length">
|
||||||
|
<template v-for="(result, name, index) of results">
|
||||||
|
<v-divider v-if="index" :key="`result-divider-${name}`" class="my-1" />
|
||||||
|
<the-screws-tilt-adjust-dialog-entry
|
||||||
|
:key="`result-${name}-${name}`"
|
||||||
|
:name="name.toString()"
|
||||||
|
:result="result" />
|
||||||
|
</template>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer />
|
||||||
|
<v-btn text @click="retryScrewsTiltAdjust">
|
||||||
|
{{ $t('ScrewsTiltAdjust.Retry') }}
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="primary" text @click="clearScrewsTiltAdjust">
|
||||||
|
{{ $t('ScrewsTiltAdjust.Accept') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||||
|
import { mdiArrowCollapseDown, mdiCloseThick } from '@mdi/js'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
import TheScrewsTiltAdjustDialogEntry from '@/components/dialogs/TheScrewsTiltAdjustDialogEntry.vue'
|
||||||
|
@Component({
|
||||||
|
components: { TheScrewsTiltAdjustDialogEntry, Panel, Responsive, SettingsRow },
|
||||||
|
})
|
||||||
|
export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
mdiArrowCollapseDown = mdiArrowCollapseDown
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
|
||||||
|
get state() {
|
||||||
|
return this.$store.state.printer.screws_tilt_adjust ?? {}
|
||||||
|
}
|
||||||
|
|
||||||
|
get error() {
|
||||||
|
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
get max_deviation() {
|
||||||
|
return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null
|
||||||
|
}
|
||||||
|
|
||||||
|
get results() {
|
||||||
|
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
|
||||||
|
}
|
||||||
|
|
||||||
|
get showDialog() {
|
||||||
|
// don't display the dialog, if the user disabled it in the UI settings
|
||||||
|
if (!this.boolScrewsTiltAdjustDialog) return false
|
||||||
|
|
||||||
|
// don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command
|
||||||
|
if (this.max_deviation !== null) return false
|
||||||
|
|
||||||
|
return this.error || Object.keys(this.results).length
|
||||||
|
}
|
||||||
|
|
||||||
|
get boolScrewsTiltAdjustDialog() {
|
||||||
|
return this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog ?? true
|
||||||
|
}
|
||||||
|
|
||||||
|
clearScrewsTiltAdjust() {
|
||||||
|
this.$store.dispatch('printer/clearScrewsTiltAdjust')
|
||||||
|
}
|
||||||
|
|
||||||
|
async retryScrewsTiltAdjust() {
|
||||||
|
await this.$store.dispatch('printer/clearScrewsTiltAdjust')
|
||||||
|
|
||||||
|
this.doSend('SCREWS_TILT_CALCULATE')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<template>
|
||||||
|
<settings-row :title="outputName" :sub-title="subTitle">
|
||||||
|
<v-chip v-if="!(is_base ?? false)" label small>
|
||||||
|
<v-icon v-if="sign === 'CCW'" small left>{{ mdiRotateLeft }}</v-icon>
|
||||||
|
<v-icon v-if="sign === 'CW'" small left>{{ mdiRotateRight }}</v-icon>
|
||||||
|
{{ adjust }}
|
||||||
|
</v-chip>
|
||||||
|
<v-chip v-else label small>{{ $t('ScrewsTiltAdjust.Base') }}</v-chip>
|
||||||
|
</settings-row>
|
||||||
|
</template>
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||||
|
import { mdiRotateLeft, mdiRotateRight, mdiCloseThick } from '@mdi/js'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
interface ScrewsTiltAdjustResult {
|
||||||
|
z: number
|
||||||
|
sign?: string
|
||||||
|
adjust?: string
|
||||||
|
is_base: boolean
|
||||||
|
}
|
||||||
|
@Component({
|
||||||
|
components: { Panel, Responsive, SettingsRow },
|
||||||
|
})
|
||||||
|
export default class TheScrewsTiltAdjustDialogEntry extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
mdiRotateLeft = mdiRotateLeft
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
mdiRotateRight = mdiRotateRight
|
||||||
|
@Prop({ required: true }) declare readonly name: string
|
||||||
|
@Prop({ required: true }) declare readonly result: ScrewsTiltAdjustResult
|
||||||
|
get settings() {
|
||||||
|
return this.$store.state.printer.configfile?.settings?.screws_tilt_adjust ?? {}
|
||||||
|
}
|
||||||
|
get outputName() {
|
||||||
|
return this.settings[this.name + '_name'] ?? 'Unknown'
|
||||||
|
}
|
||||||
|
get coordinates() {
|
||||||
|
return this.settings[this.name] ?? [0, 0]
|
||||||
|
}
|
||||||
|
get x() {
|
||||||
|
return this.coordinates[0] ?? 0
|
||||||
|
}
|
||||||
|
get y() {
|
||||||
|
return this.coordinates[1] ?? 0
|
||||||
|
}
|
||||||
|
get z() {
|
||||||
|
return this.result.z.toFixed(3)
|
||||||
|
}
|
||||||
|
get subTitle() {
|
||||||
|
return `(X: ${this.x}, Y: ${this.y}, Z: ${this.z})`
|
||||||
|
}
|
||||||
|
get sign() {
|
||||||
|
return this.result.sign ?? ''
|
||||||
|
}
|
||||||
|
get adjust() {
|
||||||
|
return this.result.adjust ?? '00:00'
|
||||||
|
}
|
||||||
|
get is_base() {
|
||||||
|
return this.result.is_base ?? false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="view" class="codeview" @mouseup="mouseUp" @keydown="keyPress"></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, PropSync, Prop, Vue, Watch } from 'vue-property-decorator'
|
||||||
|
import { EditorView, basicSetup } from 'codemirror'
|
||||||
|
import { EditorState } from '@codemirror/state'
|
||||||
|
|
||||||
|
@Component({})
|
||||||
|
export default class CodeStream extends Vue {
|
||||||
|
@PropSync('currentline') currentLineNumber!: number
|
||||||
|
@Prop({ type: String, default: '' }) declare document: string
|
||||||
|
@Prop({ type: Boolean, default: false }) declare isSimulating: boolean
|
||||||
|
@Prop({ type: Boolean, default: false }) declare shown: boolean
|
||||||
|
|
||||||
|
view: EditorView | undefined = undefined
|
||||||
|
|
||||||
|
private mounted() {
|
||||||
|
this.view = new EditorView({
|
||||||
|
doc: this.document,
|
||||||
|
extensions: [basicSetup, EditorState.readOnly.of(true)],
|
||||||
|
parent: this.$refs['view'] as HTMLElement,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
mouseUp() {
|
||||||
|
if (this.view) {
|
||||||
|
let line = this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from)
|
||||||
|
this.$emit('update:currentline', line.to)
|
||||||
|
this.view.contentDOM.blur()
|
||||||
|
this.$emit('got-focus')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
keyPress() {
|
||||||
|
if (this.view) {
|
||||||
|
let line = this.view.state.doc.lineAt(this.view.state.selection.ranges[0].from)
|
||||||
|
this.$emit('update:currentline', line.to)
|
||||||
|
this.$emit('got-focus')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch('document')
|
||||||
|
documentUpdated() {
|
||||||
|
if (this.view && this.shown) {
|
||||||
|
this.view.dispatch({
|
||||||
|
changes: {
|
||||||
|
from: 0,
|
||||||
|
to: this.view.state.doc.length,
|
||||||
|
insert: this.document,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch('currentLineNumber')
|
||||||
|
currentlineUpdated(to: number) {
|
||||||
|
if (this.view && this.shown) {
|
||||||
|
let line = this.view.state.doc.lineAt(to)
|
||||||
|
this.view.dispatch({
|
||||||
|
selection: {
|
||||||
|
anchor: line.from,
|
||||||
|
head: line.from,
|
||||||
|
},
|
||||||
|
scrollIntoView: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .cm-activeLine {
|
||||||
|
background-color: #333 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.codeview {
|
||||||
|
height: 100%;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,46 +1,3 @@
|
|||||||
<!-- Because the viewer lives outside of the components DOM it can't be scoped -->
|
|
||||||
<style>
|
|
||||||
.viewer {
|
|
||||||
width: 100%;
|
|
||||||
height: calc(var(--app-height) - 240px);
|
|
||||||
border: 1px solid #3f3f3f;
|
|
||||||
}
|
|
||||||
|
|
||||||
.withScrubber .viewer {
|
|
||||||
height: calc(var(--app-height) - 300px);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 600px) and (max-width: 959px) {
|
|
||||||
.viewer {
|
|
||||||
height: calc(var(--app-height) - 295px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.withScrubber .viewer {
|
|
||||||
height: calc(var(--app-height) - 360px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 599px) {
|
|
||||||
.viewer {
|
|
||||||
height: calc(var(--app-height) - 340px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.withScrubber .viewer {
|
|
||||||
height: calc(var(--app-height) - 340px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.scrubber {
|
|
||||||
position: relative;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 5px;
|
|
||||||
z-index: 19 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<panel :title="panelTitle" :icon="mdiVideo3d" card-class="gcode-viewer-panel" :margin-bottom="false">
|
<panel :title="panelTitle" :icon="mdiVideo3d" card-class="gcode-viewer-panel" :margin-bottom="false">
|
||||||
@@ -62,9 +19,19 @@
|
|||||||
</template>
|
</template>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row :class="showScrubber ? 'withScrubber' : ''">
|
<v-row :class="showScrubber ? 'withScrubber' : ''">
|
||||||
<v-col>
|
<v-col :cols="showGCode ? 8 : 12">
|
||||||
<div ref="viewerCanvasContainer"></div>
|
<div ref="viewerCanvasContainer"></div>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col v-show="showGCode" cols="4">
|
||||||
|
<div class="viewer">
|
||||||
|
<CodeStream
|
||||||
|
ref="gcodestream"
|
||||||
|
:shown="showGCode"
|
||||||
|
:currentline.sync="scrubPosition"
|
||||||
|
:document="fileData"
|
||||||
|
:is-simulating="!printerIsPrinting" />
|
||||||
|
</div>
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row v-show="showScrubber" class="scrubber">
|
<v-row v-show="showScrubber" class="scrubber">
|
||||||
<v-col class="pt-0">
|
<v-col class="pt-0">
|
||||||
@@ -166,8 +133,16 @@
|
|||||||
hide-details
|
hide-details
|
||||||
:label="$t('GCodeViewer.ShowTravelMoves')"></v-checkbox>
|
:label="$t('GCodeViewer.ShowTravelMoves')"></v-checkbox>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<v-list-item class="minHeight36">
|
||||||
|
<v-checkbox
|
||||||
|
v-model="showGCode"
|
||||||
|
class="mt-0"
|
||||||
|
hide-details
|
||||||
|
:label="$t('GCodeViewer.ShowGCode')"></v-checkbox>
|
||||||
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item
|
<v-list-item
|
||||||
v-if="loadedFile === sdCardFilePath && printing_objects.length > 1"
|
v-if="loadedFile === sdCardFilePath && printing_objects.length"
|
||||||
class="minHeight36">
|
class="minHeight36">
|
||||||
<v-checkbox
|
<v-checkbox
|
||||||
v-model="showObjectSelection"
|
v-model="showObjectSelection"
|
||||||
@@ -211,6 +186,13 @@
|
|||||||
hide-details
|
hide-details
|
||||||
:label="$t('GCodeViewer.SpecularLighting')"></v-checkbox>
|
:label="$t('GCodeViewer.SpecularLighting')"></v-checkbox>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<v-list-item class="minHeight36">
|
||||||
|
<v-checkbox
|
||||||
|
v-model="cncMode"
|
||||||
|
class="mt-0"
|
||||||
|
hide-details
|
||||||
|
:label="$t('GCodeViewer.CNCMode')"></v-checkbox>
|
||||||
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -264,6 +246,30 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
</v-snackbar>
|
</v-snackbar>
|
||||||
|
<v-dialog v-model="excludeObject.bool" max-width="400">
|
||||||
|
<v-card>
|
||||||
|
<v-toolbar flat dense>
|
||||||
|
<v-toolbar-title>
|
||||||
|
<span class="subheading">
|
||||||
|
<v-icon left>{{ mdiSelectionRemove }}</v-icon>
|
||||||
|
{{ $t('Panels.StatusPanel.ExcludeObject.ExcludeObjectHeadline') }}
|
||||||
|
</span>
|
||||||
|
</v-toolbar-title>
|
||||||
|
</v-toolbar>
|
||||||
|
<v-card-text class="mt-3">
|
||||||
|
{{ $t('Panels.StatusPanel.ExcludeObject.ExcludeObjectText', { name: excludeObject.name }) }}
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn text @click="excludeObject.bool = false">
|
||||||
|
{{ $t('Panels.StatusPanel.ExcludeObject.Cancel') }}
|
||||||
|
</v-btn>
|
||||||
|
<v-btn color="primary" text @click="cancelObject">
|
||||||
|
{{ $t('Panels.StatusPanel.ExcludeObject.ExcludeObject') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -274,6 +280,7 @@ import GCodeViewer from '@sindarius/gcodeviewer'
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { formatFilesize } from '@/plugins/helpers'
|
import { formatFilesize } from '@/plugins/helpers'
|
||||||
import Panel from '@/components/ui/Panel.vue'
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import CodeStream from '@/components/gcodeviewer/CodeStream.vue'
|
||||||
import {
|
import {
|
||||||
mdiCameraRetake,
|
mdiCameraRetake,
|
||||||
mdiCog,
|
mdiCog,
|
||||||
@@ -286,6 +293,7 @@ import {
|
|||||||
mdiPause,
|
mdiPause,
|
||||||
mdiFastForward,
|
mdiFastForward,
|
||||||
mdiBroom,
|
mdiBroom,
|
||||||
|
mdiSelectionRemove,
|
||||||
} from '@mdi/js'
|
} from '@mdi/js'
|
||||||
import { Debounce } from 'vue-debounce-decorator'
|
import { Debounce } from 'vue-debounce-decorator'
|
||||||
|
|
||||||
@@ -304,7 +312,7 @@ interface downloadSnackbar {
|
|||||||
|
|
||||||
let viewer: any = null
|
let viewer: any = null
|
||||||
@Component({
|
@Component({
|
||||||
components: { Panel },
|
components: { Panel, CodeStream },
|
||||||
})
|
})
|
||||||
export default class Viewer extends Mixins(BaseMixin) {
|
export default class Viewer extends Mixins(BaseMixin) {
|
||||||
/**
|
/**
|
||||||
@@ -321,6 +329,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
mdiPause = mdiPause
|
mdiPause = mdiPause
|
||||||
mdiFastForward = mdiFastForward
|
mdiFastForward = mdiFastForward
|
||||||
mdiBroom = mdiBroom
|
mdiBroom = mdiBroom
|
||||||
|
mdiSelectionRemove = mdiSelectionRemove
|
||||||
|
|
||||||
formatFilesize = formatFilesize
|
formatFilesize = formatFilesize
|
||||||
|
|
||||||
@@ -354,6 +363,13 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private excludeObject = {
|
||||||
|
bool: false,
|
||||||
|
name: '',
|
||||||
|
}
|
||||||
|
|
||||||
|
private fileData: string = ''
|
||||||
|
|
||||||
@Prop({ type: String, default: '', required: false }) declare filename: string
|
@Prop({ type: String, default: '', required: false }) declare filename: string
|
||||||
@Ref('fileInput') declare fileInput: HTMLInputElement
|
@Ref('fileInput') declare fileInput: HTMLInputElement
|
||||||
@Ref('viewerCanvasContainer') declare viewerCanvasContainer: HTMLElement
|
@Ref('viewerCanvasContainer') declare viewerCanvasContainer: HTMLElement
|
||||||
@@ -378,6 +394,9 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
await this.init()
|
await this.init()
|
||||||
|
|
||||||
if (this.loadedFile !== null) this.scrubFileSize = viewer.fileSize
|
if (this.loadedFile !== null) this.scrubFileSize = viewer.fileSize
|
||||||
|
if (viewer) {
|
||||||
|
this.fileData = viewer.fileData
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
@@ -417,10 +436,23 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
return this.$store.state.printer.print_stats?.filename ?? ''
|
return this.$store.state.printer.print_stats?.filename ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
get currentPosition() {
|
get livePosition() {
|
||||||
return this.$store.state.printer.motion_report?.live_position ?? [0, 0, 0, 0]
|
return this.$store.state.printer.motion_report?.live_position ?? [0, 0, 0, 0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get gcodeOffset() {
|
||||||
|
return this.$store.state.printer?.gcode_move?.homing_origin ?? [0, 0, 0]
|
||||||
|
}
|
||||||
|
|
||||||
|
get currentPosition() {
|
||||||
|
return [
|
||||||
|
this.livePosition[0] - this.gcodeOffset[0],
|
||||||
|
this.livePosition[1] - this.gcodeOffset[1],
|
||||||
|
this.livePosition[2] - this.gcodeOffset[2],
|
||||||
|
this.livePosition[3],
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
get showTrackingButton() {
|
get showTrackingButton() {
|
||||||
return this.printerIsPrinting && this.sdCardFilePath === this.loadedFile
|
return this.printerIsPrinting && this.sdCardFilePath === this.loadedFile
|
||||||
}
|
}
|
||||||
@@ -429,10 +461,20 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
return this.$store.state.printer.exclude_object?.objects ?? []
|
return this.$store.state.printer.exclude_object?.objects ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Watch('printing_objects')
|
||||||
|
printing_objectsChanged() {
|
||||||
|
this.refreshPrintingObjects()
|
||||||
|
}
|
||||||
|
|
||||||
get excluded_objects() {
|
get excluded_objects() {
|
||||||
return this.$store.state.printer.exclude_object?.excluded_objects ?? []
|
return this.$store.state.printer.exclude_object?.excluded_objects ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Watch('excluded_objects')
|
||||||
|
excluded_objectsChanged() {
|
||||||
|
this.refreshPrintingObjects()
|
||||||
|
}
|
||||||
|
|
||||||
get nozzle_diameter() {
|
get nozzle_diameter() {
|
||||||
return this.$store.state.printer.configfile?.settings?.extruder?.nozzle_diameter ?? 0.4
|
return this.$store.state.printer.configfile?.settings?.extruder?.nozzle_diameter ?? 0.4
|
||||||
}
|
}
|
||||||
@@ -486,13 +528,15 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewer.gcodeProcessor.useHighQualityExtrusion(this.hdRendering)
|
viewer.gcodeProcessor.useHighQualityExtrusion(this.hdRendering)
|
||||||
viewer.gcodeProcessor.updateForceWireMode(this.forceLineRendering)
|
viewer.gcodeProcessor.updateForceWireMode(this.forceLineRendering || this.cncMode)
|
||||||
viewer.gcodeProcessor.setAlpha(this.transparency)
|
viewer.gcodeProcessor.setAlpha(this.transparency)
|
||||||
viewer.gcodeProcessor.setVoxelMode(this.voxelMode)
|
viewer.gcodeProcessor.setVoxelMode(this.voxelMode)
|
||||||
viewer.gcodeProcessor.voxelWidth = this.voxelWidth
|
viewer.gcodeProcessor.voxelWidth = this.voxelWidth
|
||||||
viewer.gcodeProcessor.voxelHeight = this.voxelHeight
|
viewer.gcodeProcessor.voxelHeight = this.voxelHeight
|
||||||
viewer.gcodeProcessor.useSpecularColor(this.specularLighting)
|
viewer.gcodeProcessor.useSpecularColor(this.specularLighting)
|
||||||
viewer.gcodeProcessor.setLiveTracking(false)
|
viewer.gcodeProcessor.setLiveTracking(false)
|
||||||
|
viewer.gcodeProcessor.g1AsExtrusion = this.cncMode
|
||||||
|
viewer.buildObjects.objectCallback = this.objectCallback
|
||||||
|
|
||||||
this.loadToolColors(this.extruderColors)
|
this.loadToolColors(this.extruderColors)
|
||||||
|
|
||||||
@@ -539,9 +583,16 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
this.loading = false
|
this.loading = false
|
||||||
viewer.setCursorVisiblity(this.showCursor)
|
viewer.setCursorVisiblity(this.showCursor)
|
||||||
|
|
||||||
if (this.loadedFile === this.sdCardFilePath && this.printing_objects.length) {
|
this.refreshPrintingObjects()
|
||||||
let objects: any = []
|
this.scrubFileSize = viewer.fileSize
|
||||||
|
|
||||||
|
viewer.gcodeProcessor.updateFilePosition(viewer.fileSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
refreshPrintingObjects() {
|
||||||
|
let objects: any = []
|
||||||
|
|
||||||
|
if (this.loadedFile === this.sdCardFilePath && this.printing_objects.length) {
|
||||||
this.printing_objects.forEach((object: any) => {
|
this.printing_objects.forEach((object: any) => {
|
||||||
const xValues = object.polygon.map((point: number[]) => point[0])
|
const xValues = object.polygon.map((point: number[]) => point[0])
|
||||||
const yValues = object.polygon.map((point: number[]) => point[1])
|
const yValues = object.polygon.map((point: number[]) => point[1])
|
||||||
@@ -553,13 +604,10 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
y: [Math.min(...yValues), Math.max(...yValues)],
|
y: [Math.min(...yValues), Math.max(...yValues)],
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
viewer.buildObjects.loadObjectBoundaries(objects)
|
|
||||||
viewer.buildObjects.showObjectSelection(this.showObjectSelection)
|
|
||||||
}
|
}
|
||||||
this.scrubFileSize = viewer.fileSize
|
|
||||||
|
|
||||||
viewer.gcodeProcessor.updateFilePosition(viewer.fileSize)
|
viewer.buildObjects.loadObjectBoundaries(objects)
|
||||||
|
viewer.buildObjects.showObjectSelection(this.showObjectSelection)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fileSelected(e: any) {
|
async fileSelected(e: any) {
|
||||||
@@ -571,6 +619,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
this.fileSize = blob.length
|
this.fileSize = blob.length
|
||||||
// Do something with result
|
// Do something with result
|
||||||
await viewer.processFile(blob)
|
await viewer.processFile(blob)
|
||||||
|
this.fileData = viewer.fileData
|
||||||
}
|
}
|
||||||
this.finishLoad()
|
this.finishLoad()
|
||||||
})
|
})
|
||||||
@@ -618,6 +667,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
|
|
||||||
viewer.updateRenderQuality(this.renderQuality.value)
|
viewer.updateRenderQuality(this.renderQuality.value)
|
||||||
await viewer.processFile(text)
|
await viewer.processFile(text)
|
||||||
|
this.fileData = viewer.fileData
|
||||||
this.loadingPercent = 100
|
this.loadingPercent = 100
|
||||||
this.finishLoad()
|
this.finishLoad()
|
||||||
this.scrubFileSize = viewer.fileSize
|
this.scrubFileSize = viewer.fileSize
|
||||||
@@ -649,6 +699,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
this.loading = true
|
this.loading = true
|
||||||
this.loadingPercent = 0
|
this.loadingPercent = 0
|
||||||
await viewer.reload()
|
await viewer.reload()
|
||||||
|
this.fileData = viewer.fileData
|
||||||
this.loadingPercent = 100
|
this.loadingPercent = 100
|
||||||
this.finishLoad()
|
this.finishLoad()
|
||||||
}
|
}
|
||||||
@@ -691,6 +742,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
const offset = 350
|
const offset = 350
|
||||||
if (newVal > 0 && this.printerIsPrinting && this.tracking && newVal > offset) {
|
if (newVal > 0 && this.printerIsPrinting && this.tracking && newVal > offset) {
|
||||||
viewer.gcodeProcessor.updateFilePosition(newVal - offset)
|
viewer.gcodeProcessor.updateFilePosition(newVal - offset)
|
||||||
|
this.scrubPosition = newVal - offset
|
||||||
} else {
|
} else {
|
||||||
viewer.gcodeProcessor.updateFilePosition(viewer.fileSize)
|
viewer.gcodeProcessor.updateFilePosition(viewer.fileSize)
|
||||||
}
|
}
|
||||||
@@ -736,6 +788,18 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.showTravelMoves', value: newVal })
|
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.showTravelMoves', value: newVal })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get showGCode(): boolean {
|
||||||
|
return this.$store.state.gui.gcodeViewer.showGCode ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
set showGCode(newVal: boolean) {
|
||||||
|
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.showGCode', value: newVal })
|
||||||
|
if (newVal && viewer) {
|
||||||
|
this.fileData = viewer.fileData
|
||||||
|
}
|
||||||
|
this.handleResize()
|
||||||
|
}
|
||||||
|
|
||||||
@Watch('showTravelMoves')
|
@Watch('showTravelMoves')
|
||||||
showTravelMovesChanged(newVal: boolean) {
|
showTravelMovesChanged(newVal: boolean) {
|
||||||
viewer?.toggleTravels(newVal)
|
viewer?.toggleTravels(newVal)
|
||||||
@@ -781,7 +845,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
@Watch('forceLineRendering')
|
@Watch('forceLineRendering')
|
||||||
async forceLineRenderingChanged(newVal: boolean) {
|
async forceLineRenderingChanged(newVal: boolean) {
|
||||||
if (viewer) {
|
if (viewer) {
|
||||||
viewer.gcodeProcessor.updateForceWireMode(newVal)
|
viewer.gcodeProcessor.updateForceWireMode(newVal || this.cncMode)
|
||||||
await this.reloadViewer()
|
await this.reloadViewer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -852,6 +916,17 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get cncMode() {
|
||||||
|
return this.$store.state.gui.gcodeViewer.cncMode
|
||||||
|
}
|
||||||
|
|
||||||
|
set cncMode(newVal) {
|
||||||
|
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.cncMode', value: newVal })
|
||||||
|
viewer.gcodeProcessor.g1AsExtrusion = newVal
|
||||||
|
viewer.gcodeProcessor.updateForceWireMode(this.forceLineRendering || newVal)
|
||||||
|
this.reloadViewer()
|
||||||
|
}
|
||||||
|
|
||||||
get extruderColors() {
|
get extruderColors() {
|
||||||
return this.$store.state.gui.gcodeViewer?.extruderColors ?? false
|
return this.$store.state.gui.gcodeViewer?.extruderColors ?? false
|
||||||
}
|
}
|
||||||
@@ -1041,6 +1116,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
this.scrubInterval = setInterval(() => {
|
this.scrubInterval = setInterval(() => {
|
||||||
this.scrubPosition += 100 * this.scrubSpeed
|
this.scrubPosition += 100 * this.scrubSpeed
|
||||||
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition)
|
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition)
|
||||||
|
viewer.simulateToolPosition()
|
||||||
if (this.tracking || this.scrubPosition >= this.scrubFileSize) {
|
if (this.tracking || this.scrubPosition >= this.scrubFileSize) {
|
||||||
this.scrubPlaying = false
|
this.scrubPlaying = false
|
||||||
}
|
}
|
||||||
@@ -1059,12 +1135,69 @@ export default class Viewer extends Mixins(BaseMixin) {
|
|||||||
@Debounce(200)
|
@Debounce(200)
|
||||||
@Watch('scrubPosition')
|
@Watch('scrubPosition')
|
||||||
updateScrubPosition(to: number): void {
|
updateScrubPosition(to: number): void {
|
||||||
if (!this.tracking) viewer.gcodeProcessor.updateFilePosition(to)
|
if (!this.tracking) {
|
||||||
|
viewer.gcodeProcessor.updateFilePosition(to)
|
||||||
|
viewer.simulateToolPosition()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fastForward(): void {
|
fastForward(): void {
|
||||||
this.scrubPosition = this.scrubFileSize
|
this.scrubPosition = this.scrubFileSize
|
||||||
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition)
|
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
objectCallback(metadata: any) {
|
||||||
|
if (metadata?.cancelled === false) {
|
||||||
|
this.excludeObject.name = metadata.name ?? 'UNKNOWN'
|
||||||
|
this.excludeObject.bool = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cancelObject() {
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: 'EXCLUDE_OBJECT NAME=' + this.excludeObject.name })
|
||||||
|
this.excludeObject.bool = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- Because the viewer lives outside of the components DOM it can't be scoped -->
|
||||||
|
<style>
|
||||||
|
.viewer {
|
||||||
|
width: 100%;
|
||||||
|
height: calc(var(--app-height) - 240px);
|
||||||
|
border: 1px solid #3f3f3f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.withScrubber .viewer {
|
||||||
|
height: calc(var(--app-height) - 300px);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 600px) and (max-width: 959px) {
|
||||||
|
.viewer {
|
||||||
|
height: calc(var(--app-height) - 295px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.withScrubber .viewer {
|
||||||
|
height: calc(var(--app-height) - 360px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 599px) {
|
||||||
|
.viewer {
|
||||||
|
height: calc(var(--app-height) - 340px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.withScrubber .viewer {
|
||||||
|
height: calc(var(--app-height) - 340px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.scrubber {
|
||||||
|
position: relative;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<v-col class="pl-6">
|
||||||
|
<template v-if="selectAll">
|
||||||
|
<v-checkbox
|
||||||
|
v-model="selectAllModel"
|
||||||
|
:label="$t('Settings.GeneralTab.Everything')"
|
||||||
|
hide-details
|
||||||
|
class="mt-0"
|
||||||
|
:indeterminate="selectAllIndeterminate"
|
||||||
|
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
|
||||||
|
<v-divider class="my-2" />
|
||||||
|
</template>
|
||||||
|
<template v-for="option in options">
|
||||||
|
<v-checkbox
|
||||||
|
:key="option.value"
|
||||||
|
v-model="selectedCheckboxes"
|
||||||
|
:label="option.label"
|
||||||
|
hide-details
|
||||||
|
class="mt-0"
|
||||||
|
:value="option.value"
|
||||||
|
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
|
||||||
|
</template>
|
||||||
|
</v-col>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '../mixins/base'
|
||||||
|
import { computed } from 'vue'
|
||||||
|
import { TranslateResult } from 'vue-i18n'
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class CheckboxList extends Mixins(BaseMixin) {
|
||||||
|
@Prop({ required: true })
|
||||||
|
declare readonly options: { label: string | TranslateResult; value: string }[]
|
||||||
|
|
||||||
|
@Prop({ type: Boolean, required: false, default: false })
|
||||||
|
declare readonly selectAll: boolean
|
||||||
|
|
||||||
|
selectedCheckboxes: (string | TranslateResult)[] = []
|
||||||
|
selectAllIndeterminate: boolean = false
|
||||||
|
selectAllModel = computed<boolean>({
|
||||||
|
get: this.getSelectAll,
|
||||||
|
set: this.setSelectAll,
|
||||||
|
})
|
||||||
|
|
||||||
|
getSelectAll(): boolean {
|
||||||
|
this.selectAllIndeterminate = false
|
||||||
|
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length) {
|
||||||
|
this.selectAllIndeterminate = true
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.selectedCheckboxes.length == this.options.length
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectAll(state: boolean) {
|
||||||
|
if (state) {
|
||||||
|
this.selectedCheckboxes = this.options.map((o) => o.value)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.selectedCheckboxes = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
<style>
|
|
||||||
.vue-codemirror .cm-editor {
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="vue-codemirror">
|
<div class="vue-codemirror">
|
||||||
<div ref="codemirror" v-observe-visibility="visibilityChanged"></div>
|
<div ref="codemirror" v-observe-visibility="visibilityChanged"></div>
|
||||||
@@ -14,14 +9,17 @@
|
|||||||
|
|
||||||
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '../mixins/base'
|
import BaseMixin from '../mixins/base'
|
||||||
import { basicSetup, EditorState } from '@codemirror/basic-setup'
|
import { basicSetup } from 'codemirror'
|
||||||
import { mainsailTheme } from '@/plugins/codemirrorTheme'
|
import { EditorView, keymap } from '@codemirror/view'
|
||||||
import { StreamLanguage } from '@codemirror/stream-parser'
|
import { EditorState } from '@codemirror/state'
|
||||||
|
import { vscodeDark } from '@uiw/codemirror-theme-vscode'
|
||||||
|
import { StreamLanguage } from '@codemirror/language'
|
||||||
import { klipper_config } from '@/plugins/StreamParserKlipperConfig'
|
import { klipper_config } from '@/plugins/StreamParserKlipperConfig'
|
||||||
import { gcode } from '@/plugins/StreamParserGcode'
|
import { gcode } from '@/plugins/StreamParserGcode'
|
||||||
import { EditorView, keymap } from '@codemirror/view'
|
|
||||||
import { indentWithTab } from '@codemirror/commands'
|
import { indentWithTab } from '@codemirror/commands'
|
||||||
import { json } from '@codemirror/lang-json'
|
import { json } from '@codemirror/lang-json'
|
||||||
|
import { css } from '@codemirror/lang-css'
|
||||||
|
import { indentUnit } from '@codemirror/language'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class Codemirror extends Mixins(BaseMixin) {
|
export default class Codemirror extends Mixins(BaseMixin) {
|
||||||
@@ -84,8 +82,10 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
|||||||
|
|
||||||
get cmExtensions() {
|
get cmExtensions() {
|
||||||
const extensions = [
|
const extensions = [
|
||||||
|
EditorView.theme({}, { dark: true }),
|
||||||
basicSetup,
|
basicSetup,
|
||||||
mainsailTheme,
|
vscodeDark,
|
||||||
|
indentUnit.of(' '.repeat(this.tabSize)),
|
||||||
keymap.of([indentWithTab]),
|
keymap.of([indentWithTab]),
|
||||||
EditorView.updateListener.of((update) => {
|
EditorView.updateListener.of((update) => {
|
||||||
this.content = update.state?.doc.toString()
|
this.content = update.state?.doc.toString()
|
||||||
@@ -98,6 +98,7 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
|||||||
if (['cfg', 'conf'].includes(this.fileExtension)) extensions.push(StreamLanguage.define(klipper_config))
|
if (['cfg', 'conf'].includes(this.fileExtension)) extensions.push(StreamLanguage.define(klipper_config))
|
||||||
else if (['gcode'].includes(this.fileExtension)) extensions.push(StreamLanguage.define(gcode))
|
else if (['gcode'].includes(this.fileExtension)) extensions.push(StreamLanguage.define(gcode))
|
||||||
else if (['json'].includes(this.fileExtension)) extensions.push(json())
|
else if (['json'].includes(this.fileExtension)) extensions.push(json())
|
||||||
|
else if (['css', 'scss', 'sass'].includes(this.fileExtension)) extensions.push(css())
|
||||||
|
|
||||||
return extensions
|
return extensions
|
||||||
}
|
}
|
||||||
@@ -105,5 +106,9 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
|||||||
visibilityChanged(isVisible: boolean) {
|
visibilityChanged(isVisible: boolean) {
|
||||||
if (isVisible) this.cminstance?.focus()
|
if (isVisible) this.cminstance?.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get tabSize() {
|
||||||
|
return this.$store.state.gui.editor.tabSize || 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div ref="picker"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins, Prop, Ref, Watch } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import iro from '@jaames/iro'
|
||||||
|
import { IroColor } from '@irojs/iro-core'
|
||||||
|
import { ColorPickerProps, IroColorPicker as IroCP } from '@jaames/iro/dist/ColorPicker.d'
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class ColorPicker extends Mixins(BaseMixin) {
|
||||||
|
colorPicker: IroCP | null = null
|
||||||
|
|
||||||
|
@Ref('picker')
|
||||||
|
readonly picker!: HTMLElement
|
||||||
|
|
||||||
|
@Prop({ type: [Object, String], default: '#ffffff' })
|
||||||
|
readonly color!: IroColor
|
||||||
|
|
||||||
|
@Prop({ type: Object, default: () => ({}) })
|
||||||
|
readonly options!: ColorPickerProps
|
||||||
|
|
||||||
|
@Watch('color', { deep: true })
|
||||||
|
colorChanged(value: string) {
|
||||||
|
if (this.colorPicker && this.colorPicker.color.rgbString !== value) {
|
||||||
|
this.colorPicker.color.rgbString = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get internalOptions(): ColorPickerProps {
|
||||||
|
return {
|
||||||
|
...this.options,
|
||||||
|
color: this.color,
|
||||||
|
borderWidth: 2,
|
||||||
|
sliderSize: 16,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
emitColorChange(color: IroColor) {
|
||||||
|
this.$emit('change', color)
|
||||||
|
this.$emit('update:color', color)
|
||||||
|
}
|
||||||
|
|
||||||
|
onColorChange(color: IroColor) {
|
||||||
|
this.emitColorChange(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.colorPicker = iro.ColorPicker(this.picker, this.internalOptions)
|
||||||
|
this.colorPicker.on('color:change', this.onColorChange)
|
||||||
|
}
|
||||||
|
|
||||||
|
beforeDestroy() {
|
||||||
|
this.colorPicker?.off('color:change', this.onColorChange)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
@@ -1,15 +1,3 @@
|
|||||||
<style scoped>
|
|
||||||
.btnMacroMenu {
|
|
||||||
border-top-left-radius: 0;
|
|
||||||
border-bottom-left-radius: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.macroWithParameters {
|
|
||||||
border-top-right-radius: 0;
|
|
||||||
border-bottom-right-radius: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-item-group class="d-inline-block">
|
<v-item-group class="d-inline-block">
|
||||||
<v-btn
|
<v-btn
|
||||||
@@ -17,20 +5,27 @@
|
|||||||
:color="color"
|
:color="color"
|
||||||
:class="paramArray.length ? 'macroWithParameters' : ''"
|
:class="paramArray.length ? 'macroWithParameters' : ''"
|
||||||
:loading="loadings.includes('macro_' + macro.name)"
|
:loading="loadings.includes('macro_' + macro.name)"
|
||||||
|
:disabled="disabled"
|
||||||
@click="doSendMacro(macro.name)">
|
@click="doSendMacro(macro.name)">
|
||||||
{{ macro.name.replace(/_/g, ' ') }}
|
{{ alias ? alias : macro.name.replace(/_/g, ' ') }}
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<template v-if="paramArray.length">
|
<template v-if="paramArray.length">
|
||||||
<v-menu offset-y :close-on-content-click="false">
|
<v-menu v-if="!isMobile" offset-y :close-on-content-click="false">
|
||||||
<template #activator="{ on, attrs }">
|
<template #activator="{ on, attrs }">
|
||||||
<v-btn small :color="color" v-bind="attrs" class="minwidth-0 px-1 btnMacroMenu" v-on="on">
|
<v-btn
|
||||||
|
:disabled="disabled"
|
||||||
|
:color="color"
|
||||||
|
v-bind="attrs"
|
||||||
|
class="minwidth-0 px-1 btnMacroMenu"
|
||||||
|
small
|
||||||
|
v-on="on">
|
||||||
<v-icon>{{ mdiMenuDown }}</v-icon>
|
<v-icon>{{ mdiMenuDown }}</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-card max-width="200">
|
<v-card :max-width="paramsOverlayWidth">
|
||||||
<v-card-text class="py-2">
|
<v-card-text class="py-2">
|
||||||
<v-row v-for="(name, key) in paramArray" :key="'param_' + key" class="my-2">
|
<v-row class="my-2">
|
||||||
<v-col class="py-0">
|
<v-col v-for="(name, key) in paramArray" :key="'param_' + key" :cols="paramCssCols">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="params[name].value"
|
v-model="params[name].value"
|
||||||
:label="name"
|
:label="name"
|
||||||
@@ -54,6 +49,47 @@
|
|||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
<template v-else>
|
||||||
|
<v-btn
|
||||||
|
:disabled="disabled"
|
||||||
|
:color="color"
|
||||||
|
class="minwidth-0 px-1 btnMacroMenu"
|
||||||
|
small
|
||||||
|
@click="paramsDialog = true">
|
||||||
|
<v-icon>{{ mdiMenuDown }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-dialog v-model="paramsDialog">
|
||||||
|
<panel :title="macro.name" :card-class="`macro-params-mobile-${macro.name}`" :margin-bottom="false">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="paramsDialog = false">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col v-for="(name, key) in paramArray" :key="'param_mobile_' + key" :cols="6">
|
||||||
|
<v-text-field
|
||||||
|
v-model="params[name].value"
|
||||||
|
:label="name"
|
||||||
|
:placeholder="params[name].default"
|
||||||
|
:persistent-placeholder="true"
|
||||||
|
hide-details
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
clearable
|
||||||
|
:clear-icon="mdiRefresh"
|
||||||
|
@keyup.enter="sendWithParams"></v-text-field>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions class="px-4 pb-4">
|
||||||
|
<v-btn color="primary" class="text-uppercase" block @click="sendWithParams">
|
||||||
|
{{ $t('Panels.MacrosPanel.Send') }}
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</v-item-group>
|
</v-item-group>
|
||||||
</template>
|
</template>
|
||||||
@@ -63,7 +99,10 @@ import Component from 'vue-class-component'
|
|||||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { GuiMacrosStateMacrogroupMacro } from '@/store/gui/macros/types'
|
import { GuiMacrosStateMacrogroupMacro } from '@/store/gui/macros/types'
|
||||||
import { mdiMenuDown, mdiRefresh } from '@mdi/js'
|
import { mdiCloseThick, mdiMenuDown, mdiRefresh } from '@mdi/js'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import { TranslateResult } from 'vue-i18n'
|
||||||
|
import { PrinterStateMacro } from '@/store/printer/types'
|
||||||
|
|
||||||
interface param {
|
interface param {
|
||||||
type: 'int' | 'double' | 'string' | null
|
type: 'int' | 'double' | 'string' | null
|
||||||
@@ -75,25 +114,59 @@ interface params {
|
|||||||
[key: string]: param
|
[key: string]: param
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component
|
@Component({
|
||||||
|
components: { Panel },
|
||||||
|
})
|
||||||
export default class MacroButton extends Mixins(BaseMixin) {
|
export default class MacroButton extends Mixins(BaseMixin) {
|
||||||
/**
|
/**
|
||||||
* Icons
|
* Icons
|
||||||
*/
|
*/
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
mdiMenuDown = mdiMenuDown
|
mdiMenuDown = mdiMenuDown
|
||||||
mdiRefresh = mdiRefresh
|
mdiRefresh = mdiRefresh
|
||||||
|
|
||||||
private paramArray: string[] = []
|
private paramArray: string[] = []
|
||||||
private params: params = {}
|
private params: params = {}
|
||||||
|
private paramsDialog = false
|
||||||
|
|
||||||
@Prop({ required: true })
|
@Prop({ required: true })
|
||||||
declare readonly macro: GuiMacrosStateMacrogroupMacro
|
declare readonly macro: GuiMacrosStateMacrogroupMacro | PrinterStateMacro
|
||||||
@Prop({ default: 'primary' }) declare readonly color: string
|
|
||||||
|
@Prop({ default: 'primary' })
|
||||||
|
declare readonly color: string
|
||||||
|
|
||||||
|
@Prop({ default: null })
|
||||||
|
declare readonly alias: string | TranslateResult
|
||||||
|
|
||||||
|
@Prop({ default: false })
|
||||||
|
declare readonly disabled: boolean
|
||||||
|
|
||||||
get klipperMacro() {
|
get klipperMacro() {
|
||||||
return this.$store.getters['printer/getMacro'](this.macro.name)
|
return this.$store.getters['printer/getMacro'](this.macro.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isGcodeStyle() {
|
||||||
|
return this.macro.name.match(/[G|M]\d{1,3}/gm)
|
||||||
|
}
|
||||||
|
|
||||||
|
get paramCols() {
|
||||||
|
if (this.isMobile) return 1
|
||||||
|
|
||||||
|
const cols = Math.ceil(this.paramArray.length / 5)
|
||||||
|
|
||||||
|
if (cols > 4) return 4
|
||||||
|
|
||||||
|
return cols
|
||||||
|
}
|
||||||
|
|
||||||
|
get paramCssCols() {
|
||||||
|
return 12 / this.paramCols
|
||||||
|
}
|
||||||
|
|
||||||
|
get paramsOverlayWidth() {
|
||||||
|
return 200 * this.paramCols
|
||||||
|
}
|
||||||
|
|
||||||
@Watch('klipperMacro')
|
@Watch('klipperMacro')
|
||||||
klipperMacroChange() {
|
klipperMacroChange() {
|
||||||
this.refreshParams()
|
this.refreshParams()
|
||||||
@@ -103,7 +176,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
|||||||
this.paramArray.splice(0, this.paramArray.length)
|
this.paramArray.splice(0, this.paramArray.length)
|
||||||
this.params = {}
|
this.params = {}
|
||||||
|
|
||||||
if (this.klipperMacro.params !== null) {
|
if (this.klipperMacro?.params !== null) {
|
||||||
Object.keys(this.klipperMacro.params).forEach((name: string) => {
|
Object.keys(this.klipperMacro.params).forEach((name: string) => {
|
||||||
if (!name.startsWith('_')) {
|
if (!name.startsWith('_')) {
|
||||||
this.paramArray.push(name)
|
this.paramArray.push(name)
|
||||||
@@ -128,10 +201,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
|||||||
sendWithParams() {
|
sendWithParams() {
|
||||||
let params: string[] = []
|
let params: string[] = []
|
||||||
this.paramArray.forEach((paramname: string) => {
|
this.paramArray.forEach((paramname: string) => {
|
||||||
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
|
let value = this.params[paramname].value?.toString().trim()
|
||||||
|
|
||||||
|
if (this.params[paramname].value !== null && value !== '') {
|
||||||
let tmp: string = paramname
|
let tmp: string = paramname
|
||||||
if (paramname.length === 1) tmp += this.params[paramname].value
|
if (value?.includes(' ')) value = `"${value}"`
|
||||||
else tmp += '=' + this.params[paramname].value
|
|
||||||
|
tmp += this.isGcodeStyle ? value : `=${value}`
|
||||||
|
|
||||||
params.push(tmp)
|
params.push(tmp)
|
||||||
}
|
}
|
||||||
@@ -146,3 +222,15 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.btnMacroMenu {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.macroWithParameters {
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,519 @@
|
|||||||
|
<template>
|
||||||
|
<v-container :class="containerClass">
|
||||||
|
<v-row>
|
||||||
|
<v-col class="pb-3">
|
||||||
|
<v-subheader class="_light-subheader">
|
||||||
|
<v-icon v-if="(!root || groups.length === 0) && isOn" small left @click="off">
|
||||||
|
{{ mdiLightbulbOnOutline }}
|
||||||
|
</v-icon>
|
||||||
|
<v-icon v-else-if="!root || groups.length === 0" small left @click="on">
|
||||||
|
{{ mdiLightbulbOutline }}
|
||||||
|
</v-icon>
|
||||||
|
<span>{{ name }}</span>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<span
|
||||||
|
v-if="!root || groups.length === 0"
|
||||||
|
class="_currentState"
|
||||||
|
:style="currentStateStyle"
|
||||||
|
@click="boolDialog = true"></span>
|
||||||
|
</v-subheader>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<template v-if="root && groups.length">
|
||||||
|
<miscellaneous-light v-for="group in groups" :key="group.id" :object="object" :group="group" />
|
||||||
|
</template>
|
||||||
|
<v-dialog v-model="boolDialog" persistent :width="400">
|
||||||
|
<panel
|
||||||
|
:title="name"
|
||||||
|
:icon="mdiLightbulbOutline"
|
||||||
|
card-class="temperature-edit-heater-dialog"
|
||||||
|
:margin-bottom="false">
|
||||||
|
<template #buttons>
|
||||||
|
<v-btn icon tile @click="boolDialog = false">
|
||||||
|
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
<v-card-text class="pt-6">
|
||||||
|
<template v-if="presets.length">
|
||||||
|
<v-row>
|
||||||
|
<v-col class="light-presets-container pt-0 d-flex flex-wrap flex-row justify-center">
|
||||||
|
<v-tooltip v-for="preset in presets" :key="preset.id" top>
|
||||||
|
<template #activator="{ on, attrs }">
|
||||||
|
<div
|
||||||
|
:style="presetStyle(preset)"
|
||||||
|
v-bind="attrs"
|
||||||
|
v-on="on"
|
||||||
|
@click="usePreset(preset)"></div>
|
||||||
|
</template>
|
||||||
|
<span>{{ preset.name }}</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-divider class="my-3"></v-divider>
|
||||||
|
</template>
|
||||||
|
<v-row>
|
||||||
|
<v-col class="text-center">
|
||||||
|
<color-picker
|
||||||
|
:color="colorRGB"
|
||||||
|
:options="colorPickerOptions"
|
||||||
|
@update:color="onColorRGBChanged" />
|
||||||
|
<color-picker
|
||||||
|
v-if="existWhite"
|
||||||
|
:color="colorRGBW"
|
||||||
|
:options="colorPickerWhiteOptions"
|
||||||
|
class="mt-3"
|
||||||
|
@update:color="onColorWhiteChanged" />
|
||||||
|
</v-col>
|
||||||
|
<v-col>
|
||||||
|
<v-row v-if="existRed">
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.MiscellaneousPanel.Light.Red')"
|
||||||
|
param="red"
|
||||||
|
:target="redInt"
|
||||||
|
:default-value="Math.round(object.initialRed * 255)"
|
||||||
|
:min="0"
|
||||||
|
:max="255"
|
||||||
|
:dec="1"
|
||||||
|
:step="1"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
@submit="onColorInput" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row v-if="existGreen">
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.MiscellaneousPanel.Light.Green')"
|
||||||
|
param="green"
|
||||||
|
:target="greenInt"
|
||||||
|
:default-value="Math.round(object.initialGreen * 255)"
|
||||||
|
:min="0"
|
||||||
|
:max="255"
|
||||||
|
:dec="1"
|
||||||
|
:step="1"
|
||||||
|
:has-spinner="true"
|
||||||
|
@submit="onColorInput" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row v-if="existBlue">
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.MiscellaneousPanel.Light.Blue')"
|
||||||
|
param="blue"
|
||||||
|
:target="blueInt"
|
||||||
|
:default-value="Math.round(object.initialBlue * 255)"
|
||||||
|
:min="0"
|
||||||
|
:max="255"
|
||||||
|
:dec="1"
|
||||||
|
:step="1"
|
||||||
|
:has-spinner="true"
|
||||||
|
@submit="onColorInput" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row v-if="existWhite">
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.MiscellaneousPanel.Light.White')"
|
||||||
|
param="white"
|
||||||
|
:target="whiteInt"
|
||||||
|
:default-value="Math.round(object.initialWhite * 255)"
|
||||||
|
:min="0"
|
||||||
|
:max="255"
|
||||||
|
:dec="1"
|
||||||
|
:step="1"
|
||||||
|
:has-spinner="true"
|
||||||
|
@submit="onColorInput" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
</panel>
|
||||||
|
</v-dialog>
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { convertName } from '@/plugins/helpers'
|
||||||
|
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { mdiCloseThick, mdiLightbulbOutline, mdiLightbulbOnOutline } from '@mdi/js'
|
||||||
|
import { PrinterStateLight } from '@/store/printer/types'
|
||||||
|
import ColorPicker from '@/components/inputs/ColorPicker.vue'
|
||||||
|
import { ColorPickerProps } from '@jaames/iro/dist/ColorPicker.d'
|
||||||
|
import { Debounce } from 'vue-debounce-decorator'
|
||||||
|
import iro from '@jaames/iro'
|
||||||
|
import { IroColor } from '@irojs/iro-core'
|
||||||
|
import { GuiMiscellaneousStateEntryLightgroup, GuiMiscellaneousStateEntryPreset } from '@/store/gui/miscellaneous/types'
|
||||||
|
|
||||||
|
interface ColorData {
|
||||||
|
red: number | null
|
||||||
|
green: number | null
|
||||||
|
blue: number | null
|
||||||
|
white: number | null
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: {
|
||||||
|
ColorPicker,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export default class MiscellaneousLight extends Mixins(BaseMixin) {
|
||||||
|
mdiCloseThick = mdiCloseThick
|
||||||
|
mdiLightbulbOutline = mdiLightbulbOutline
|
||||||
|
mdiLightbulbOnOutline = mdiLightbulbOnOutline
|
||||||
|
|
||||||
|
@Prop({ type: Object, required: true })
|
||||||
|
declare object: PrinterStateLight
|
||||||
|
|
||||||
|
@Prop({ type: Boolean, default: false }) readonly root!: boolean
|
||||||
|
@Prop(Object) readonly group!: GuiMiscellaneousStateEntryLightgroup | undefined
|
||||||
|
|
||||||
|
private boolDialog = false
|
||||||
|
private inputValue = 0
|
||||||
|
|
||||||
|
get name() {
|
||||||
|
if (this.group) return convertName(this.group.name)
|
||||||
|
|
||||||
|
return convertName(this.object.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
get colorPickerOptions() {
|
||||||
|
let options: ColorPickerProps = {
|
||||||
|
width: 200,
|
||||||
|
margin: 15,
|
||||||
|
layout: [],
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.existRed) {
|
||||||
|
// @ts-ignore
|
||||||
|
options?.layout.push({
|
||||||
|
component: iro.ui.Slider,
|
||||||
|
options: {
|
||||||
|
sliderType: 'red',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.existGreen) {
|
||||||
|
// @ts-ignore
|
||||||
|
options?.layout.push({
|
||||||
|
component: iro.ui.Slider,
|
||||||
|
options: {
|
||||||
|
sliderType: 'green',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.existBlue) {
|
||||||
|
// @ts-ignore
|
||||||
|
options?.layout.push({
|
||||||
|
component: iro.ui.Slider,
|
||||||
|
options: {
|
||||||
|
sliderType: 'blue',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.existRed && this.existGreen && this.existBlue) {
|
||||||
|
options.layout = [
|
||||||
|
{
|
||||||
|
component: iro.ui.Wheel,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: iro.ui.Slider,
|
||||||
|
options: {
|
||||||
|
sliderType: 'value',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
get colorPickerWhiteOptions() {
|
||||||
|
let options: ColorPickerProps = {
|
||||||
|
width: 200,
|
||||||
|
margin: 15,
|
||||||
|
layout: [
|
||||||
|
{
|
||||||
|
component: iro.ui.Slider,
|
||||||
|
options: {
|
||||||
|
sliderType: 'alpha',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
get optionsColors() {
|
||||||
|
let output: string[] = []
|
||||||
|
|
||||||
|
this.presets.forEach((preset: GuiMiscellaneousStateEntryPreset) => {
|
||||||
|
output.push(`rgb(${preset.red}%, ${preset.green}%, ${preset.blue}%)`)
|
||||||
|
})
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
get current() {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: 0,
|
||||||
|
green: 0,
|
||||||
|
blue: 0,
|
||||||
|
white: null,
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.existWhite) color.white = 0
|
||||||
|
if (this.object.colorData.length === 0) return color
|
||||||
|
|
||||||
|
const firstColorData = this.object.colorData[(this.group?.start ?? 1) - 1]
|
||||||
|
color.red = firstColorData[0] * 255
|
||||||
|
color.green = firstColorData[1] * 255
|
||||||
|
color.blue = firstColorData[2] * 255
|
||||||
|
if (this.object.colorOrder.indexOf('W') !== -1) color.white = firstColorData[3] * 255
|
||||||
|
|
||||||
|
return color
|
||||||
|
}
|
||||||
|
|
||||||
|
get isOn() {
|
||||||
|
return (
|
||||||
|
(this.current.red ?? 0) +
|
||||||
|
(this.current?.green ?? 0) +
|
||||||
|
(this.current.blue ?? 0) +
|
||||||
|
(this.current.white ?? 0) >
|
||||||
|
0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get existRed() {
|
||||||
|
return this.object.colorOrder.indexOf('R') !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
get existGreen() {
|
||||||
|
return this.object.colorOrder.indexOf('G') !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
get existBlue() {
|
||||||
|
return this.object.colorOrder.indexOf('B') !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
get existWhite() {
|
||||||
|
return this.object.colorOrder.indexOf('W') !== -1
|
||||||
|
}
|
||||||
|
|
||||||
|
get currentStateStyle() {
|
||||||
|
let output = this.colorRGB
|
||||||
|
|
||||||
|
if (this.current.white !== null && this.current.red == 0 && this.current.green == 0 && this.current.blue == 0)
|
||||||
|
output = `rgb(${this.current.white * 255}, ${this.current.white * 255}, ${this.current.white * 255})`
|
||||||
|
|
||||||
|
return {
|
||||||
|
'background-color': output,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get colorRGB() {
|
||||||
|
return `rgb(${Math.round(this.current.red ?? 0)}, ${Math.round(this.current.green ?? 0)}, ${Math.round(
|
||||||
|
this.current.blue ?? 0
|
||||||
|
)})`
|
||||||
|
}
|
||||||
|
|
||||||
|
get colorRGBW() {
|
||||||
|
return `rgba(255, 255, 255, ${(this.current.white ?? 0) / 255})`
|
||||||
|
}
|
||||||
|
|
||||||
|
get redInt() {
|
||||||
|
return Math.round(this.current.red ?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
get greenInt() {
|
||||||
|
return Math.round(this.current.green ?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
get blueInt() {
|
||||||
|
return Math.round(this.current.blue ?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
get whiteInt() {
|
||||||
|
return Math.round(this.current.white ?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
get groups() {
|
||||||
|
return (
|
||||||
|
this.$store.getters['gui/miscellaneous/getEntryLightgroups']({
|
||||||
|
type: this.object.type,
|
||||||
|
name: this.object.name,
|
||||||
|
}) ?? []
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get presets() {
|
||||||
|
return (
|
||||||
|
this.$store.getters['gui/miscellaneous/getEntryPresets']({
|
||||||
|
type: this.object.type,
|
||||||
|
name: this.object.name,
|
||||||
|
}) ?? []
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get containerClass() {
|
||||||
|
let output = ['px-0']
|
||||||
|
|
||||||
|
output.push(this.root ? 'py-2' : 'pt-2 pb-0')
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
colorChanged(color: ColorData) {
|
||||||
|
if (
|
||||||
|
Math.round(color.red ?? 0) === Math.round(this.current.red ?? 0) &&
|
||||||
|
Math.round(color.green ?? 0) === Math.round(this.current.green ?? 0) &&
|
||||||
|
Math.round(color.blue ?? 0) === Math.round(this.current.blue ?? 0) &&
|
||||||
|
Math.round(color.white ?? 0) === Math.round(this.current.white ?? 0)
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
const red = Math.round(((color.red ?? 0) / 255) * 10000) / 10000
|
||||||
|
const green = Math.round(((color.green ?? 0) / 255) * 10000) / 10000
|
||||||
|
const blue = Math.round(((color.blue ?? 0) / 255) * 10000) / 10000
|
||||||
|
const white = Math.round(((color.white ?? 0) / 255) * 10000) / 10000
|
||||||
|
|
||||||
|
let gcode = `SET_LED LED="${this.object.name}" RED=${red} GREEN=${green} BLUE=${blue}`
|
||||||
|
if (this.existWhite) gcode += ` WHITE=${white}`
|
||||||
|
gcode += ` SYNC=0`
|
||||||
|
|
||||||
|
if (this.group) {
|
||||||
|
const tmp = gcode
|
||||||
|
|
||||||
|
for (let i = this.group.start; i <= this.group.end; i++) {
|
||||||
|
if (i === this.group.start) {
|
||||||
|
gcode += ` INDEX=${i}`
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
gcode += `\n${tmp} INDEX=${i}`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gcode += ` TRANSMIT=1`
|
||||||
|
|
||||||
|
this.$store.dispatch('server/addEvent', {
|
||||||
|
message: gcode,
|
||||||
|
type: 'command',
|
||||||
|
})
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce({ time: 500 })
|
||||||
|
onColorRGBChanged(payload: IroColor) {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: payload.red,
|
||||||
|
green: payload.green,
|
||||||
|
blue: payload.blue,
|
||||||
|
white: this.current.white,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce({ time: 500 })
|
||||||
|
onColorWhiteChanged(payload: IroColor) {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: this.current.red,
|
||||||
|
green: this.current.green,
|
||||||
|
blue: this.current.blue,
|
||||||
|
white: this.current.white,
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
color.white = payload.alpha * 255
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce({ time: 500 })
|
||||||
|
onColorInput(payload: { name: string; value: number }) {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: this.current.red,
|
||||||
|
green: this.current.green,
|
||||||
|
blue: this.current.blue,
|
||||||
|
white: this.current.white,
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
color[payload.name] = payload.value
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
off() {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: 0,
|
||||||
|
green: 0,
|
||||||
|
blue: 0,
|
||||||
|
white: 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
on() {
|
||||||
|
const color: ColorData = {
|
||||||
|
red: 255,
|
||||||
|
green: 255,
|
||||||
|
blue: 255,
|
||||||
|
white: 255,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
|
||||||
|
presetStyle(preset: GuiMiscellaneousStateEntryPreset) {
|
||||||
|
if ((preset?.red ?? 0) + (preset?.green ?? 0) + (preset?.blue ?? 0) === 0 && (preset?.white ?? 0) > 0) {
|
||||||
|
return {
|
||||||
|
backgroundColor: `rgb(${preset.white}%, ${preset.white}%, ${preset.white}%)`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
backgroundColor: `rgb(${preset.red}%, ${preset.green}%, ${preset.blue}%)`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
usePreset(preset: GuiMiscellaneousStateEntryPreset) {
|
||||||
|
const color: ColorData = { ...preset }
|
||||||
|
|
||||||
|
this.colorChanged(color)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._light-subheader {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
._currentState {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid lightgray;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-presets-container {
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light-presets-container > div {
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,73 +1,23 @@
|
|||||||
<style scoped>
|
|
||||||
._fan-slider-subheader {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
._lock-button {
|
|
||||||
margin-left: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._rpm {
|
|
||||||
padding-top: 0.2rem !important;
|
|
||||||
margin: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
._error-msg {
|
|
||||||
color: #ff5252;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 4px 16px 2px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-active {
|
|
||||||
animation: slide-in 0.15s reverse;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-leave-active {
|
|
||||||
animation: slide-in 0.15s;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes slide-in {
|
|
||||||
100% {
|
|
||||||
transform: translateY(-5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
max-width: 5.4rem;
|
|
||||||
margin-left: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input >>> .v-input__slot {
|
|
||||||
min-height: 1rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input >>> .v-text-field__slot input {
|
|
||||||
padding: 4px 0 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-container class="px-0 py-2">
|
<v-container class="px-0 py-2">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col :class="pwm ? 'pb-1' : 'pb-3'">
|
<v-col :class="pwm ? 'pb-1' : 'pb-3'">
|
||||||
<v-subheader class="_fan-slider-subheader">
|
<v-subheader class="_fan-slider-subheader">
|
||||||
<v-icon
|
<v-icon
|
||||||
v-if="type !== 'output_pin'"
|
v-if="type === 'led' && target > 0"
|
||||||
|
class="mr-2"
|
||||||
small
|
small
|
||||||
:class="'mr-2 ' + (value >= off_below && value > 0 ? 'icon-rotate' : '')">
|
:retain-focus-on-click="true"
|
||||||
{{ mdiFan }}
|
@click="ledOff">
|
||||||
|
{{ mdiLightbulbOnOutline }}
|
||||||
</v-icon>
|
</v-icon>
|
||||||
|
<v-icon v-else-if="type === 'led'" class="mr-2" small :retain-focus-on-click="true" @click="ledOn">
|
||||||
|
{{ mdiLightbulbOutline }}
|
||||||
|
</v-icon>
|
||||||
|
<v-icon v-else-if="type !== 'output_pin'" small :class="fanClasses">{{ mdiFan }}</v-icon>
|
||||||
<span>{{ convertName(name) }}</span>
|
<span>{{ convertName(name) }}</span>
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<small
|
<small v-if="rpm !== null" :class="rpmClasses">{{ Math.round(rpm ?? 0) }} RPM</small>
|
||||||
v-if="rpm || rpm === 0"
|
|
||||||
:class="`mr-3 ${controllable && pwm ? '_rpm' : ''}
|
|
||||||
${rpm === 0 && value > 0 ? 'red--text' : ''}`">
|
|
||||||
{{ Math.round(rpm) }} RPM
|
|
||||||
</small>
|
|
||||||
<span v-if="!controllable" class="font-weight-bold">
|
<span v-if="!controllable" class="font-weight-bold">
|
||||||
{{ Math.round(parseFloat(value) * 100) }} %
|
{{ Math.round(parseFloat(value) * 100) }} %
|
||||||
</span>
|
</span>
|
||||||
@@ -78,7 +28,7 @@
|
|||||||
<v-text-field
|
<v-text-field
|
||||||
v-if="controllable && pwm"
|
v-if="controllable && pwm"
|
||||||
v-model="inputValue"
|
v-model="inputValue"
|
||||||
:error="errors().length > 0"
|
:error="errors.length > 0"
|
||||||
suffix="%"
|
suffix="%"
|
||||||
type="number"
|
type="number"
|
||||||
hide-spin-buttons
|
hide-spin-buttons
|
||||||
@@ -88,13 +38,13 @@
|
|||||||
class="_slider-input pt-1"
|
class="_slider-input pt-1"
|
||||||
@blur="inputValue = Math.round(parseFloat(sliderValue) * 100)"
|
@blur="inputValue = Math.round(parseFloat(sliderValue) * 100)"
|
||||||
@focus="$event.target.select()"
|
@focus="$event.target.select()"
|
||||||
@keydown="checkInvalidChars"></v-text-field>
|
@keydown="checkInvalidChars" />
|
||||||
</form>
|
</form>
|
||||||
</v-subheader>
|
</v-subheader>
|
||||||
<transition name="fade">
|
<transition v-if="controllable && pwm" name="fade">
|
||||||
<!-- display errors -->
|
<!-- display errors -->
|
||||||
<div v-show="errors().length > 0 && controllable && pwm" class="_error-msg d-flex justify-end">
|
<div v-show="errors.length > 0" class="_error-msg d-flex justify-end">
|
||||||
{{ errors()[0] }}
|
{{ errors[0] ?? '' }}
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
<v-card-text v-if="controllable && pwm" class="py-0 pb-2 d-flex align-center">
|
<v-card-text v-if="controllable && pwm" class="py-0 pb-2 d-flex align-center">
|
||||||
@@ -126,7 +76,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #append>
|
<template #append>
|
||||||
<v-icon :disabled="isLocked || sliderValue >= max" @click="increment">{{ mdiPlus }}</v-icon>
|
<v-icon :disabled="isLocked || sliderValue >= 1" @click="increment">{{ mdiPlus }}</v-icon>
|
||||||
</template>
|
</template>
|
||||||
</v-slider>
|
</v-slider>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@@ -148,6 +98,8 @@ import {
|
|||||||
mdiPlus,
|
mdiPlus,
|
||||||
mdiToggleSwitch,
|
mdiToggleSwitch,
|
||||||
mdiToggleSwitchOffOutline,
|
mdiToggleSwitchOffOutline,
|
||||||
|
mdiLightbulbOutline,
|
||||||
|
mdiLightbulbOnOutline,
|
||||||
} from '@mdi/js'
|
} from '@mdi/js'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@@ -159,6 +111,8 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
mdiLockOpenVariantOutline = mdiLockOpenVariantOutline
|
mdiLockOpenVariantOutline = mdiLockOpenVariantOutline
|
||||||
mdiMinus = mdiMinus
|
mdiMinus = mdiMinus
|
||||||
mdiPlus = mdiPlus
|
mdiPlus = mdiPlus
|
||||||
|
mdiLightbulbOutline = mdiLightbulbOutline
|
||||||
|
mdiLightbulbOnOutline = mdiLightbulbOnOutline
|
||||||
|
|
||||||
convertName = convertName
|
convertName = convertName
|
||||||
private declare timeout: ReturnType<typeof setTimeout>
|
private declare timeout: ReturnType<typeof setTimeout>
|
||||||
@@ -166,19 +120,42 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
private invalidChars: string[] = ['e', 'E', '+']
|
private invalidChars: string[] = ['e', 'E', '+']
|
||||||
|
|
||||||
private min = 0
|
private min = 0
|
||||||
private value = 0
|
|
||||||
private inputValue = 0
|
private inputValue = 0
|
||||||
private sliderValue = 0
|
private sliderValue = 0
|
||||||
|
|
||||||
@Prop({ type: Number, required: true }) declare target: number
|
@Prop({ type: Number, required: true })
|
||||||
@Prop({ type: Number, default: 1 }) declare max: number
|
declare target: number
|
||||||
@Prop({ type: String, default: '' }) declare name: string
|
|
||||||
@Prop({ type: String, default: '' }) declare type: string
|
@Prop({ type: Number, default: 1 })
|
||||||
@Prop({ type: Boolean, default: false }) declare controllable: boolean
|
declare max: number
|
||||||
@Prop({ type: Boolean, default: false }) declare pwm: boolean
|
|
||||||
@Prop({ type: [Number, Boolean], default: false }) declare rpm: number | boolean
|
@Prop({ type: String, default: '' })
|
||||||
@Prop({ type: Number, default: 1 }) declare multi: number
|
declare name: string
|
||||||
@Prop({ type: Number, default: 0 }) declare off_below: number
|
|
||||||
|
@Prop({ type: String, default: '' })
|
||||||
|
declare type: string
|
||||||
|
|
||||||
|
@Prop({ type: Boolean, default: false })
|
||||||
|
declare controllable: boolean
|
||||||
|
|
||||||
|
@Prop({ type: Boolean, default: false })
|
||||||
|
declare pwm: boolean
|
||||||
|
|
||||||
|
@Prop({ type: [Number, Boolean], default: false })
|
||||||
|
declare rpm: number | boolean
|
||||||
|
|
||||||
|
@Prop({ type: Number, default: 1 })
|
||||||
|
declare multi: number
|
||||||
|
|
||||||
|
@Prop({ type: Number, default: 0 })
|
||||||
|
declare off_below: number
|
||||||
|
|
||||||
|
@Prop({ type: String, default: '' })
|
||||||
|
declare colorOrder: string
|
||||||
|
|
||||||
|
get value(): number {
|
||||||
|
return Math.round((this.target / this.max) * 100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
@Watch('lockSliders', { immediate: true })
|
@Watch('lockSliders', { immediate: true })
|
||||||
lockSlidersChanged(): void {
|
lockSlidersChanged(): void {
|
||||||
@@ -215,19 +192,21 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
} else if (this.sliderValue > this.value && this.sliderValue < this.off_below) {
|
} else if (this.sliderValue > this.value && this.sliderValue < this.off_below) {
|
||||||
this.sliderValue = this.off_below
|
this.sliderValue = this.off_below
|
||||||
}
|
}
|
||||||
this.value = this.sliderValue
|
|
||||||
this.sendCmd()
|
this.sendCmd(this.sliderValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
sendCmd(): void {
|
sendCmd(newVal: number): void {
|
||||||
if (this.target === this.value) return
|
if (this.value === newVal) return
|
||||||
|
|
||||||
let gcode = ''
|
let gcode = ''
|
||||||
if (this.value < this.min) this.value = 0
|
if (newVal < this.min) newVal = 0
|
||||||
const l_value = this.value * this.multi
|
newVal = newVal * this.multi
|
||||||
if (this.type === 'fan') gcode = `M106 S${l_value.toFixed(0)}`
|
if (this.type === 'fan') gcode = `M106 S${newVal.toFixed(0)}`
|
||||||
if (this.type === 'fan_generic') gcode = `SET_FAN_SPEED FAN=${this.name} SPEED=${l_value}`
|
if (this.type === 'fan_generic') gcode = `SET_FAN_SPEED FAN=${this.name} SPEED=${newVal}`
|
||||||
if (this.type === 'output_pin') gcode = `SET_PIN PIN=${this.name} VALUE=${l_value.toFixed(2)}`
|
if (this.type === 'output_pin') gcode = `SET_PIN PIN=${this.name} VALUE=${newVal.toFixed(2)}`
|
||||||
|
if (this.type === 'led')
|
||||||
|
gcode = `SET_LED LED=${this.name} ${this.ledChannelName}=${newVal.toFixed(2)} SYNC=0 TRANSMIT=1`
|
||||||
|
|
||||||
if (gcode !== '') {
|
if (gcode !== '') {
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
@@ -237,32 +216,35 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
this.startLockTimer()
|
this.startLockTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ledOff() {
|
||||||
|
this.sendCmd(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
ledOn() {
|
||||||
|
this.sendCmd(1)
|
||||||
|
}
|
||||||
|
|
||||||
switchOutputPin(): void {
|
switchOutputPin(): void {
|
||||||
this.value = this.value ? 0 : 1
|
const newVal = this.value ? 0 : 1
|
||||||
const gcode = `SET_PIN PIN=${this.name} VALUE=${(this.value * this.multi).toFixed(2)}`
|
const gcode = `SET_PIN PIN=${this.name} VALUE=${(newVal * this.multi).toFixed(2)}`
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||||
}
|
}
|
||||||
|
|
||||||
decrement(): void {
|
decrement(): void {
|
||||||
this.value = this.value > 0 ? Math.round((this.value - 0.01) * 100) / 100 : 0
|
let newVal = this.value > 0 ? Math.round((this.value - 0.01) * 100) / 100 : 0
|
||||||
if (this.value < this.off_below) this.value = 0
|
if (this.value < this.off_below) newVal = 0
|
||||||
this.sendCmd()
|
this.sendCmd(newVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
increment(): void {
|
increment(): void {
|
||||||
this.value = this.value < 1.0 ? Math.round((this.value + 0.01) * 100) / 100 : 1.0
|
let newVal = this.value < 1.0 ? Math.round((this.value + 0.01) * 100) / 100 : 1.0
|
||||||
if (this.value < this.off_below) this.value = this.off_below
|
if (this.value < this.off_below) newVal = this.off_below
|
||||||
this.sendCmd()
|
this.sendCmd(newVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
mounted(): void {
|
mounted() {
|
||||||
this.value = this.target
|
this.sliderValue = this.value
|
||||||
}
|
|
||||||
|
|
||||||
@Watch('target')
|
|
||||||
targetChanged(newVal: number): void {
|
|
||||||
this.value = newVal
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('value')
|
@Watch('value')
|
||||||
@@ -282,7 +264,7 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
errors() {
|
get errors() {
|
||||||
const errors = []
|
const errors = []
|
||||||
const input = this.inputValue / 100
|
const input = this.inputValue / 100
|
||||||
if (this.inputValue.toString() === '') {
|
if (this.inputValue.toString() === '') {
|
||||||
@@ -293,24 +275,94 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
|||||||
// "Must be grater or equal than {min}!"
|
// "Must be grater or equal than {min}!"
|
||||||
errors.push(this.$t('App.NumberInput.GreaterOrEqualError', { min: this.min * 100 }))
|
errors.push(this.$t('App.NumberInput.GreaterOrEqualError', { min: this.min * 100 }))
|
||||||
}
|
}
|
||||||
if (input > this.max || input < this.min) {
|
|
||||||
// "Must be between {min} and {max}!"
|
|
||||||
errors.push(this.$t('App.NumberInput.MustBeBetweenError', { min: this.min * 100, max: this.max * 100 }))
|
|
||||||
}
|
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get disableFanAnimation() {
|
||||||
|
return this.$store.state.gui.uiSettings.disableFanAnimation ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
get fanClasses() {
|
||||||
|
const output = ['mr-2']
|
||||||
|
if (!this.disableFanAnimation && this.value >= this.off_below && this.value > 0) output.push('icon-rotate')
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
get rpmClasses() {
|
||||||
|
const output = []
|
||||||
|
if (!this.controllable) output.push(['mr-3', 'mt-1'])
|
||||||
|
else output.push(['mt-2'])
|
||||||
|
if (this.rpm === 0 && this.value > 0) output.push('red--text')
|
||||||
|
|
||||||
|
return output
|
||||||
|
}
|
||||||
|
|
||||||
|
get ledChannelName() {
|
||||||
|
if (this.colorOrder === 'R') return 'RED'
|
||||||
|
if (this.colorOrder === 'G') return 'GREEN'
|
||||||
|
if (this.colorOrder === 'B') return 'BLUE'
|
||||||
|
|
||||||
|
return 'WHITE'
|
||||||
|
}
|
||||||
|
|
||||||
submitInput(): void {
|
submitInput(): void {
|
||||||
if (this.errors().length > 0) return
|
if (this.errors.length > 0) return
|
||||||
|
|
||||||
const input = this.inputValue / 100
|
let newVal = this.inputValue / 100
|
||||||
if (this.value === 0 && input < this.off_below) {
|
if (this.value === 0 && newVal < this.off_below) {
|
||||||
this.value = this.off_below
|
newVal = this.off_below
|
||||||
} else if (this.value >= this.off_below && input < this.off_below) {
|
} else if (this.value >= this.off_below && newVal < this.off_below) {
|
||||||
this.value = 0
|
newVal = 0
|
||||||
} else this.value = input
|
}
|
||||||
|
|
||||||
this.sendCmd()
|
this.sendCmd(newVal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._fan-slider-subheader {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
._lock-button {
|
||||||
|
margin-left: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._error-msg {
|
||||||
|
color: #ff5252;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 4px 16px 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-active {
|
||||||
|
animation: slide-in 0.15s reverse;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-leave-active {
|
||||||
|
animation: slide-in 0.15s;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-in {
|
||||||
|
100% {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input {
|
||||||
|
min-width: 4.2rem;
|
||||||
|
max-width: 5rem;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input >>> .v-input__slot {
|
||||||
|
min-height: 1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input >>> .v-text-field__slot input {
|
||||||
|
padding: 4px 0 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
:label="`[ ${label} ]`"
|
:label="`[ ${label} ]`"
|
||||||
:suffix="suffix"
|
:suffix="suffix"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
:step="step"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:error="!validate"
|
|
||||||
hide-details="auto"
|
hide-details="auto"
|
||||||
type="number"
|
type="number"
|
||||||
hide-spin-buttons
|
hide-spin-buttons
|
||||||
@@ -14,30 +14,18 @@
|
|||||||
reverse
|
reverse
|
||||||
dense
|
dense
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@focus="!readonly ? $event.target.select() : {}">
|
@focus="!readonly ? $event.target.select() : {}"></v-text-field>
|
||||||
<template v-if="errorMsg.length" #append>
|
|
||||||
<v-tooltip top>
|
|
||||||
<template #activator="{ on, attrs }">
|
|
||||||
<v-icon color="error" v-bind="attrs" v-on="on">{{ mdiAlert }}</v-icon>
|
|
||||||
</template>
|
|
||||||
<span>{{ errorMsg.join(', ') }}</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</template>
|
|
||||||
</v-text-field>
|
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Mixins, Prop, VModel } from 'vue-property-decorator'
|
import { Component, Mixins, Prop, VModel } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { mdiAlert } from '@mdi/js'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {},
|
components: {},
|
||||||
})
|
})
|
||||||
export default class MoveToInput extends Mixins(BaseMixin) {
|
export default class MoveToInput extends Mixins(BaseMixin) {
|
||||||
mdiAlert = mdiAlert
|
|
||||||
|
|
||||||
@VModel({ type: String })
|
@VModel({ type: String })
|
||||||
declare position: string
|
declare position: string
|
||||||
|
|
||||||
@@ -50,11 +38,8 @@ export default class MoveToInput extends Mixins(BaseMixin) {
|
|||||||
@Prop({ type: String, required: false })
|
@Prop({ type: String, required: false })
|
||||||
declare readonly suffix: string
|
declare readonly suffix: string
|
||||||
|
|
||||||
@Prop({ type: Number, required: true })
|
@Prop({ type: Number, required: false, default: 1 })
|
||||||
declare readonly positionMax: number
|
declare readonly step: number
|
||||||
|
|
||||||
@Prop({ type: Number, required: true })
|
|
||||||
declare readonly positionMin: number
|
|
||||||
|
|
||||||
@Prop({ type: Boolean, required: false })
|
@Prop({ type: Boolean, required: false })
|
||||||
declare readonly disabled: boolean
|
declare readonly disabled: boolean
|
||||||
@@ -63,47 +48,13 @@ export default class MoveToInput extends Mixins(BaseMixin) {
|
|||||||
declare readonly readonly: boolean
|
declare readonly readonly: boolean
|
||||||
|
|
||||||
onBlur() {
|
onBlur() {
|
||||||
if (!this.validate && this.position !== this.currentPos) {
|
if (this.position !== this.currentPos) {
|
||||||
this.position = this.currentPos
|
this.position = this.currentPos
|
||||||
this.$emit('validate', { axis: this.suffix.toLowerCase(), valid: true })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
submit(): void {
|
submit(): void {
|
||||||
this.$emit('submit')
|
this.$emit('submit')
|
||||||
}
|
}
|
||||||
|
|
||||||
get validate(): boolean {
|
|
||||||
const isValid =
|
|
||||||
this.position !== '' &&
|
|
||||||
parseFloat(this.position) <= this.positionMax &&
|
|
||||||
parseFloat(this.position) >= this.positionMin
|
|
||||||
this.$emit('validate', { axis: this.suffix.toLowerCase(), valid: isValid })
|
|
||||||
return isValid
|
|
||||||
}
|
|
||||||
|
|
||||||
get errorMsg() {
|
|
||||||
const errors = []
|
|
||||||
if (this.position === '') errors.push(this.$t('Panels.ToolheadControlPanel.Invalid'))
|
|
||||||
if (parseFloat(this.position) > this.positionMax || parseFloat(this.position) < this.positionMin)
|
|
||||||
errors.push(this.$t('Panels.ToolheadControlPanel.OutOfRange'))
|
|
||||||
|
|
||||||
return errors
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
label {
|
|
||||||
font-size: 14px !important;
|
|
||||||
color: rgba(255, 255, 255, 0.5) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-input.error--text .v-input__slot {
|
|
||||||
padding-left: 3px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-input.error--text .v-input__append-inner {
|
|
||||||
margin-right: 5px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,40 +1,26 @@
|
|||||||
<style scoped>
|
|
||||||
._spin_button_group {
|
|
||||||
width: 24px;
|
|
||||||
margin-top: -6px;
|
|
||||||
margin-left: -6px;
|
|
||||||
margin-bottom: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-input--has-state {
|
|
||||||
margin-bottom: -18px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<form @submit.prevent="submit">
|
<form @submit.prevent="submit">
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model.number="value"
|
v-model="value"
|
||||||
:label="label"
|
:label="label"
|
||||||
:suffix="unit"
|
:suffix="unit"
|
||||||
:error="invalidInput()"
|
:error="invalidInput"
|
||||||
:error-messages="inputErrors()"
|
:error-messages="inputErrors"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:step="step"
|
:step="step"
|
||||||
:min="min"
|
:min="min"
|
||||||
:max="max"
|
:max="max"
|
||||||
:dec="dec"
|
:dec="dec"
|
||||||
type="number"
|
|
||||||
hide-spin-buttons
|
hide-spin-buttons
|
||||||
hide-details="auto"
|
hide-details="auto"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
class="d-flex align-top"
|
class="d-flex align-top"
|
||||||
@blur="value = target"
|
@blur="value = target.toString()"
|
||||||
@focus="$event.target.select()"
|
@focus="$event.target.select()"
|
||||||
@keydown="checkInvalidChars">
|
@keydown="checkInvalidChars">
|
||||||
<template v-if="defaultValue" #append>
|
<template v-if="defaultValue" #append>
|
||||||
<v-icon @click="resetToDefault">{{ value !== defaultValue ? mdiRestart : '' }}</v-icon>
|
<v-icon @click="resetToDefault">{{ value !== defaultValue.toString() ? mdiRestart : '' }}</v-icon>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="hasSpinner" #append-outer>
|
<template v-if="hasSpinner" #append-outer>
|
||||||
<div class="_spin_button_group">
|
<div class="_spin_button_group">
|
||||||
@@ -67,6 +53,7 @@ import Component from 'vue-class-component'
|
|||||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { mdiChevronDown, mdiChevronUp, mdiRestart } from '@mdi/js'
|
import { mdiChevronDown, mdiChevronUp, mdiRestart } from '@mdi/js'
|
||||||
|
import { TranslateResult } from 'vue-i18n'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class NumberInput extends Mixins(BaseMixin) {
|
export default class NumberInput extends Mixins(BaseMixin) {
|
||||||
@@ -74,89 +61,68 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
|||||||
mdiChevronUp = mdiChevronUp
|
mdiChevronUp = mdiChevronUp
|
||||||
mdiChevronDown = mdiChevronDown
|
mdiChevronDown = mdiChevronDown
|
||||||
|
|
||||||
private value: number = 0
|
private value: string = '0'
|
||||||
private error: boolean = false
|
private error: boolean = false
|
||||||
private invalidChars: string[] = ['e', 'E', '+']
|
private invalidChars: string[] = ['e', 'E', '+']
|
||||||
|
|
||||||
// input field name and identifier
|
// input field name and identifier
|
||||||
@Prop({ type: String, required: true })
|
@Prop({ required: true }) declare readonly label: TranslateResult | string
|
||||||
declare readonly label: string
|
@Prop({ type: String, required: true }) declare readonly param: string
|
||||||
|
|
||||||
@Prop({ type: String, required: true })
|
|
||||||
declare readonly param: string
|
|
||||||
|
|
||||||
// props defining incoming data
|
// props defining incoming data
|
||||||
@Prop({ type: Number, required: true })
|
@Prop({ type: Number, required: true }) declare readonly target: number
|
||||||
declare readonly target: number
|
@Prop({ type: Number, required: false }) declare readonly defaultValue: number
|
||||||
|
|
||||||
@Prop({ type: Number, required: false })
|
|
||||||
declare readonly defaultValue: number
|
|
||||||
|
|
||||||
// props for internal processing
|
// props for internal processing
|
||||||
@Prop({ type: Number, required: true })
|
@Prop({ type: Number, required: true }) declare readonly min: number
|
||||||
declare readonly min: number
|
@Prop({ default: null }) declare readonly max: number | null
|
||||||
|
@Prop({ type: Number, required: true }) declare readonly dec: number
|
||||||
@Prop({ type: Number, default: null })
|
@Prop({ type: Number, required: false, default: 1 }) declare readonly step: number
|
||||||
declare readonly max: number | null
|
@Prop({ type: String, required: false }) declare readonly unit: string
|
||||||
|
|
||||||
@Prop({ type: Number, required: true })
|
|
||||||
declare readonly dec: number
|
|
||||||
|
|
||||||
@Prop({ type: Number, required: false, default: 1 })
|
|
||||||
declare readonly step: number
|
|
||||||
|
|
||||||
@Prop({ type: String, required: false })
|
|
||||||
declare readonly unit: string
|
|
||||||
|
|
||||||
// spinner related props
|
// spinner related props
|
||||||
@Prop({ type: Boolean, required: false, default: false })
|
@Prop({ type: Boolean, required: false, default: false }) declare readonly hasSpinner: boolean
|
||||||
declare readonly hasSpinner: boolean
|
@Prop({ type: Number, required: false, default: 1 }) declare readonly spinnerFactor: number
|
||||||
|
|
||||||
@Prop({ type: Number, required: false, default: 1 })
|
|
||||||
declare readonly spinnerFactor: number
|
|
||||||
|
|
||||||
// props for general internal behaviour
|
// props for general internal behaviour
|
||||||
@Prop({ type: Boolean, required: false, default: false })
|
@Prop({ type: Boolean, required: false, default: false }) declare readonly disabled: boolean
|
||||||
declare readonly disabled: boolean
|
@Prop({ type: Boolean, required: false, default: false }) declare readonly outputErrorMsg: boolean
|
||||||
|
|
||||||
@Prop({ type: Boolean, required: false, default: false })
|
|
||||||
declare readonly outputErrorMsg: boolean
|
|
||||||
|
|
||||||
created(): void {
|
created(): void {
|
||||||
this.value = this.target
|
this.value = this.target.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('target')
|
@Watch('target')
|
||||||
updateTarget(): void {
|
updateTarget(): void {
|
||||||
this.value = this.target
|
this.value = this.target.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementValue(): void {
|
incrementValue(): void {
|
||||||
if (this.value + this.step * this.spinnerFactor < this.max! || this.max === null) {
|
if (this.inputValue + this.step * this.spinnerFactor < this.max! || this.max === null) {
|
||||||
this.value = Math.round((this.value + this.step * this.spinnerFactor) * 10 ** this.dec) / 10 ** this.dec
|
this.value = (
|
||||||
} else {
|
Math.round((this.inputValue + this.step * this.spinnerFactor) * 10 ** this.dec) /
|
||||||
this.value = this.max
|
10 ** this.dec
|
||||||
}
|
).toString()
|
||||||
|
} else this.value = this.max.toString()
|
||||||
|
|
||||||
this.submit()
|
this.submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
decrementValue(): void {
|
decrementValue(): void {
|
||||||
if (this.value - this.step * this.spinnerFactor > this.min) {
|
if (this.inputValue - this.step * this.spinnerFactor > this.min) {
|
||||||
this.value = Math.round((this.value - this.step * this.spinnerFactor) * 10 ** this.dec) / 10 ** this.dec
|
this.value = (
|
||||||
} else {
|
Math.round((this.inputValue - this.step * this.spinnerFactor) * 10 ** this.dec) /
|
||||||
this.value = this.min
|
10 ** this.dec
|
||||||
}
|
).toString()
|
||||||
|
} else this.value = this.min.toString()
|
||||||
|
|
||||||
this.submit()
|
this.submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
resetToDefault(): void {
|
resetToDefault(): void {
|
||||||
this.value = this.defaultValue
|
this.value = this.defaultValue.toString()
|
||||||
this.submit()
|
this.submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
submit(): void {
|
submit(): void {
|
||||||
if (this.invalidInput()) return
|
if (this.invalidInput) return
|
||||||
this.$emit('submit', { name: this.param, value: this.value })
|
this.$emit('submit', { name: this.param, value: this.inputValue })
|
||||||
}
|
}
|
||||||
|
|
||||||
// input validation //
|
// input validation //
|
||||||
@@ -166,27 +132,44 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
|||||||
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
invalidInput(): boolean {
|
// this function only parse this.value, to escape an empty input
|
||||||
return this.value.toString() === '' || this.value < this.min || (this.value > this.max! && this.max !== null)
|
get inputValue(): number {
|
||||||
|
if (this.value.toString() === '') return 0
|
||||||
|
|
||||||
|
return parseFloat(this.value.replace(',', '.'))
|
||||||
}
|
}
|
||||||
|
|
||||||
inputErrors() {
|
get invalidInput(): boolean {
|
||||||
|
return this.inputErrors.length > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get inputErrors() {
|
||||||
if (!this.outputErrorMsg) return []
|
if (!this.outputErrorMsg) return []
|
||||||
|
|
||||||
const errors = []
|
const errors = []
|
||||||
if (this.value.toString() === '') {
|
if (this.max === null && this.inputValue < this.min) {
|
||||||
// "Input must not be empty!"
|
|
||||||
errors.push(this.$t('App.NumberInput.NoEmptyAllowedError'))
|
|
||||||
}
|
|
||||||
if (this.max === null && this.value < this.min) {
|
|
||||||
// "Must be grater or equal than {min}!"
|
// "Must be grater or equal than {min}!"
|
||||||
errors.push(this.$t('App.NumberInput.GreaterOrEqualError', { min: this.min }))
|
errors.push(this.$t('App.NumberInput.GreaterOrEqualError', { min: this.min }))
|
||||||
}
|
}
|
||||||
if (this.max !== null && (this.value > this.max! || this.value < this.min)) {
|
if (this.max !== null && (this.inputValue > this.max! || this.inputValue < this.min)) {
|
||||||
// "Must be between {min} and {max}!"
|
// "Must be between {min} and {max}!"
|
||||||
errors.push(this.$t('App.NumberInput.MustBeBetweenError', { min: this.min, max: this.max }))
|
errors.push(this.$t('App.NumberInput.MustBeBetweenError', { min: this.min, max: this.max }))
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._spin_button_group {
|
||||||
|
width: 24px;
|
||||||
|
margin-top: -6px;
|
||||||
|
margin-left: -6px;
|
||||||
|
margin-bottom: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-input--has-state {
|
||||||
|
margin-bottom: -18px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,26 +1,3 @@
|
|||||||
<style scoped>
|
|
||||||
._temp-input {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
min-width: 4rem;
|
|
||||||
max-width: 5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
._temp-input >>> .v-input__slot {
|
|
||||||
min-height: 1rem !important;
|
|
||||||
padding-left: 8px !important;
|
|
||||||
padding-right: 8px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
._temp-input >>> .v-text-field__slot input {
|
|
||||||
padding: 4px 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._preset {
|
|
||||||
font-size: 0.8125rem;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<form @submit.prevent="setTemps">
|
<form @submit.prevent="setTemps">
|
||||||
@@ -57,11 +34,11 @@
|
|||||||
link
|
link
|
||||||
style="min-height: 32px"
|
style="min-height: 32px"
|
||||||
@click="doSend(`${command} ${attributeName}=${name} TARGET=${preset.value}`)">
|
@click="doSend(`${command} ${attributeName}=${name} TARGET=${preset.value}`)">
|
||||||
<div class="d-flex align-center _preset">
|
<div class="_preset">
|
||||||
<v-icon v-if="preset.value === 0" else color="primary" small class="mr-1">
|
<v-icon v-if="preset.value === 0" else color="primary" small class="_preset-icon">
|
||||||
{{ mdiSnowflake }}
|
{{ mdiSnowflake }}
|
||||||
</v-icon>
|
</v-icon>
|
||||||
<v-icon v-else small class="mr-1">{{ mdiFire }}</v-icon>
|
<v-icon v-else small class="_preset-icon">{{ mdiFire }}</v-icon>
|
||||||
<span style="padding-top: 2px">{{ preset.value }}°C</span>
|
<span style="padding-top: 2px">{{ preset.value }}°C</span>
|
||||||
</div>
|
</div>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
@@ -124,3 +101,30 @@ export default class TemperatureInput extends Mixins(BaseMixin, ControlMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._temp-input {
|
||||||
|
min-width: 4.2rem;
|
||||||
|
max-width: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
._temp-input >>> .v-input__slot {
|
||||||
|
min-height: 1rem !important;
|
||||||
|
padding-left: 8px !important;
|
||||||
|
padding-right: 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
._temp-input >>> .v-text-field__slot input {
|
||||||
|
padding-top: 4px;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._preset {
|
||||||
|
font-size: 0.875rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
._preset-icon {
|
||||||
|
margin-top: -1px;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,53 +1,3 @@
|
|||||||
<style scoped>
|
|
||||||
._tool-slider-subheader {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
._lock-button {
|
|
||||||
margin-left: -6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._error-msg {
|
|
||||||
color: #ff5252;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 4px 16px 2px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-active {
|
|
||||||
animation: slide-in 0.15s reverse;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-leave-active {
|
|
||||||
animation: slide-in 0.15s;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes slide-in {
|
|
||||||
100% {
|
|
||||||
transform: translateY(-5px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
max-width: 5.4rem;
|
|
||||||
margin-left: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input >>> .v-input__slot {
|
|
||||||
min-height: 1rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input >>> .v-text-field__slot input {
|
|
||||||
padding: 4px 0 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._slider-input >>> .v-input__append-inner {
|
|
||||||
margin: auto -5px auto 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<v-row dense>
|
<v-row dense>
|
||||||
<v-col class="pa-0">
|
<v-col class="pa-0">
|
||||||
@@ -135,6 +85,7 @@ import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
|||||||
import { Debounce } from 'vue-debounce-decorator'
|
import { Debounce } from 'vue-debounce-decorator'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { mdiLockOpenVariantOutline, mdiLockOutline, mdiMinus, mdiPlus, mdiRestart } from '@mdi/js'
|
import { mdiLockOpenVariantOutline, mdiLockOutline, mdiMinus, mdiPlus, mdiRestart } from '@mdi/js'
|
||||||
|
import { TranslateResult } from 'vue-i18n'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class ToolSlider extends Mixins(BaseMixin) {
|
export default class ToolSlider extends Mixins(BaseMixin) {
|
||||||
@@ -157,7 +108,7 @@ export default class ToolSlider extends Mixins(BaseMixin) {
|
|||||||
@Prop({ type: Number, required: true }) declare readonly target: number
|
@Prop({ type: Number, required: true }) declare readonly target: number
|
||||||
@Prop({ type: String, required: true }) declare readonly command: string
|
@Prop({ type: String, required: true }) declare readonly command: string
|
||||||
@Prop({ type: String, default: '' }) declare readonly attributeName: string
|
@Prop({ type: String, default: '' }) declare readonly attributeName: string
|
||||||
@Prop({ type: String, default: '' }) declare readonly label: string
|
@Prop({ default: '' }) declare readonly label: string | TranslateResult
|
||||||
@Prop({ type: String, default: '' }) declare readonly icon: string
|
@Prop({ type: String, default: '' }) declare readonly icon: string
|
||||||
@Prop({ type: String, default: '%' }) declare readonly unit: string
|
@Prop({ type: String, default: '%' }) declare readonly unit: string
|
||||||
@Prop({ type: Number, default: 1 }) declare readonly attributeScale: number
|
@Prop({ type: Number, default: 1 }) declare readonly attributeScale: number
|
||||||
@@ -301,3 +252,54 @@ export default class ToolSlider extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._tool-slider-subheader {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
._lock-button {
|
||||||
|
margin-left: -6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._error-msg {
|
||||||
|
color: #ff5252;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 4px 16px 2px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-active {
|
||||||
|
animation: slide-in 0.15s reverse;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-leave-active {
|
||||||
|
animation: slide-in 0.15s;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes slide-in {
|
||||||
|
100% {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input {
|
||||||
|
min-width: 4.2rem;
|
||||||
|
max-width: 5rem;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input >>> .v-input__slot {
|
||||||
|
min-height: 1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input >>> .v-text-field__slot input {
|
||||||
|
padding-top: 4px;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._slider-input >>> .v-input__append-inner {
|
||||||
|
margin: auto -5px auto 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
|
import { DateTimeFormatOptions } from 'vue-i18n'
|
||||||
|
import { ServerPowerStateDevice } from '@/store/server/power/types'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class BaseMixin extends Vue {
|
export default class BaseMixin extends Vue {
|
||||||
@@ -11,19 +13,29 @@ export default class BaseMixin extends Vue {
|
|||||||
return this.$store.getters['socket/getHostUrl']
|
return this.$store.getters['socket/getHostUrl']
|
||||||
}
|
}
|
||||||
|
|
||||||
get remoteMode() {
|
get hostPort(): boolean {
|
||||||
return this.$store.state.remoteMode
|
return this.$store.state.socket.port ?? 80
|
||||||
|
}
|
||||||
|
|
||||||
|
get instancesDB() {
|
||||||
|
return this.$store.state.instancesDB ?? 'moonraker'
|
||||||
}
|
}
|
||||||
|
|
||||||
get socketIsConnected(): boolean {
|
get socketIsConnected(): boolean {
|
||||||
return this.$store.state.socket.isConnected ?? false
|
return this.$store.state.socket.isConnected ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get guiIsReady() {
|
||||||
|
return this.$store.state.socket.initializationList.length === 0
|
||||||
|
}
|
||||||
|
|
||||||
get klippyIsConnected(): boolean {
|
get klippyIsConnected(): boolean {
|
||||||
return this.$store.state.server.klippy_connected ?? false
|
return this.$store.state.server.klippy_connected ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
get klipperState(): string {
|
get klipperState(): string {
|
||||||
|
if (!this.klippyIsConnected) return 'disconnected'
|
||||||
|
|
||||||
return this.$store.state.server.klippy_state ?? ''
|
return this.$store.state.server.klippy_state ?? ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,6 +47,35 @@ export default class BaseMixin extends Vue {
|
|||||||
return this.klipperReadyForGui && ['printing', 'paused'].includes(this.printer_state)
|
return this.klipperReadyForGui && ['printing', 'paused'].includes(this.printer_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get printerIsPrintingOnly() {
|
||||||
|
return this.klipperReadyForGui && this.printer_state === 'printing'
|
||||||
|
}
|
||||||
|
|
||||||
|
get printerPowerDevice(): string {
|
||||||
|
let deviceName = this.$store.state.gui.uiSettings.powerDeviceName ?? null
|
||||||
|
if (deviceName === null) deviceName = 'printer'
|
||||||
|
|
||||||
|
return deviceName
|
||||||
|
}
|
||||||
|
|
||||||
|
get isPrinterPowerOff() {
|
||||||
|
const devices = this.$store.getters['server/power/getDevices'] ?? []
|
||||||
|
if (devices.length === 0) return false
|
||||||
|
|
||||||
|
const deviceIndex = devices.findIndex(
|
||||||
|
(device: ServerPowerStateDevice) => device.device === this.printerPowerDevice
|
||||||
|
)
|
||||||
|
// stop if device is not found
|
||||||
|
if (deviceIndex === -1) return false
|
||||||
|
|
||||||
|
const device = devices[deviceIndex]
|
||||||
|
// Printer is on, if device status is "on" or "error"
|
||||||
|
if (device.status !== 'off') return false
|
||||||
|
|
||||||
|
// if klippy is not connected (service shutdown) and device.status === off
|
||||||
|
return !this.klippyIsConnected
|
||||||
|
}
|
||||||
|
|
||||||
get loadings(): string[] {
|
get loadings(): string[] {
|
||||||
return this.$store.state.socket.loadings ?? []
|
return this.$store.state.socket.loadings ?? []
|
||||||
}
|
}
|
||||||
@@ -74,7 +115,109 @@ export default class BaseMixin extends Vue {
|
|||||||
return 'ontouchstart' in window || (navigator.maxTouchPoints > 0 && navigator.maxTouchPoints !== 256)
|
return 'ontouchstart' in window || (navigator.maxTouchPoints > 0 && navigator.maxTouchPoints !== 256)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isIOS() {
|
||||||
|
return !!(
|
||||||
|
navigator.userAgent.match(/(iPad|iPhone|iPod)/) ||
|
||||||
|
// @ts-ignore
|
||||||
|
(navigator.platform === 'MacIntel' && typeof navigator.standalone !== 'undefined')
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
get moonrakerComponents() {
|
get moonrakerComponents() {
|
||||||
return this.$store.state.server?.components ?? []
|
return this.$store.state.server?.components ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get existGcodesRootDirectory() {
|
||||||
|
const roots = this.$store.state.server.registered_directories
|
||||||
|
|
||||||
|
return roots.findIndex((root: string) => root === 'gcodes') >= 0
|
||||||
|
}
|
||||||
|
|
||||||
|
get formatDateOptions(): DateTimeFormatOptions {
|
||||||
|
const format = this.$store.state.gui.general.dateFormat
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case '2-digits':
|
||||||
|
return { day: '2-digit', month: '2-digit', year: 'numeric' }
|
||||||
|
|
||||||
|
case 'short':
|
||||||
|
return { day: '2-digit', month: 'short', year: 'numeric' }
|
||||||
|
|
||||||
|
default:
|
||||||
|
return { dateStyle: 'medium' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get formatTimeOptions(): DateTimeFormatOptions {
|
||||||
|
const format = this.$store.state.gui.general.timeFormat
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case '24hours':
|
||||||
|
return { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }
|
||||||
|
|
||||||
|
case '12hours':
|
||||||
|
return { hour: '2-digit', minute: '2-digit', hourCycle: 'h12' }
|
||||||
|
|
||||||
|
default:
|
||||||
|
return { timeStyle: 'short' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get formatTimeWithSecondsOptions(): DateTimeFormatOptions {
|
||||||
|
const format = this.$store.state.gui.general.timeFormat
|
||||||
|
|
||||||
|
switch (format) {
|
||||||
|
case '24hours':
|
||||||
|
return { hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h23' }
|
||||||
|
|
||||||
|
case '12hours':
|
||||||
|
return { hour: '2-digit', minute: '2-digit', second: '2-digit', hourCycle: 'h12' }
|
||||||
|
|
||||||
|
default:
|
||||||
|
return { timeStyle: 'short' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get browserLocale() {
|
||||||
|
return navigator.language
|
||||||
|
}
|
||||||
|
|
||||||
|
get hours12Format() {
|
||||||
|
return this.$store.getters['gui/getHours12Format']
|
||||||
|
}
|
||||||
|
|
||||||
|
formatDate(value: number | Date): string {
|
||||||
|
let tmp = null
|
||||||
|
|
||||||
|
try {
|
||||||
|
// @ts-ignore
|
||||||
|
tmp = (typeof value.getMonth === 'function' ? value : new Date(value)) as Date
|
||||||
|
} catch (_) {
|
||||||
|
return 'UNKNOWN'
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp.toLocaleDateString(this.browserLocale, this.formatDateOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
formatTime(value: number | Date, boolSeconds = false): string {
|
||||||
|
let tmp = null
|
||||||
|
|
||||||
|
try {
|
||||||
|
// @ts-ignore
|
||||||
|
tmp = (typeof value.getMonth === 'function' ? value : new Date(value)) as Date
|
||||||
|
} catch (_) {
|
||||||
|
return 'UNKNOWN'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (boolSeconds) return tmp.toLocaleTimeString(this.browserLocale, this.formatTimeWithSecondsOptions)
|
||||||
|
|
||||||
|
return tmp.toLocaleTimeString(this.browserLocale, this.formatTimeOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
formatDateTime(value: number, boolSeconds = false): string {
|
||||||
|
const date = this.formatDate(value)
|
||||||
|
const time = this.formatTime(value, boolSeconds)
|
||||||
|
|
||||||
|
return `${date} ${time}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -43,6 +43,10 @@ export default class ControlMixin extends Vue {
|
|||||||
return this.$store.getters['printer/existsScrewsTilt']
|
return this.$store.getters['printer/existsScrewsTilt']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get existsFirmwareRetraction(): boolean {
|
||||||
|
return this.$store.getters['printer/existsFirmwareRetraction']
|
||||||
|
}
|
||||||
|
|
||||||
get colorQuadGantryLevel() {
|
get colorQuadGantryLevel() {
|
||||||
const status = this.$store.state.printer.quad_gantry_level?.applied ?? true
|
const status = this.$store.state.printer.quad_gantry_level?.applied ?? true
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,22 @@
|
|||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
import BaseMixin from '@/components/mixins/base'
|
import BaseMixin from '@/components/mixins/base'
|
||||||
import { allDashboardPanels } from '@/store/variables'
|
|
||||||
import { capitalize } from '@/plugins/helpers'
|
import { capitalize } from '@/plugins/helpers'
|
||||||
import { GuiMacrosStateMacrogroup } from '@/store/gui/macros/types'
|
import { GuiMacrosStateMacrogroup } from '@/store/gui/macros/types'
|
||||||
import kebabCase from 'lodash.kebabcase'
|
import {
|
||||||
import Vue from 'vue'
|
mdiArrowCollapseVertical,
|
||||||
|
mdiCodeTags,
|
||||||
|
mdiConsoleLine,
|
||||||
|
mdiDipSwitch,
|
||||||
|
mdiEngine,
|
||||||
|
mdiGamepad,
|
||||||
|
mdiInformation,
|
||||||
|
mdiPrinter3dNozzle,
|
||||||
|
mdiThermometerLines,
|
||||||
|
mdiWebcam,
|
||||||
|
} from '@mdi/js'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class DashboardMixin extends BaseMixin {
|
export default class DashboardMixin extends BaseMixin {
|
||||||
get printerKinematics() {
|
|
||||||
return this.$store.getters['printer/getKinematics']
|
|
||||||
}
|
|
||||||
|
|
||||||
get printerExtruderCount() {
|
|
||||||
return this.$store.getters['printer/getExtruders'].length
|
|
||||||
}
|
|
||||||
|
|
||||||
get printerAvailableHeatersCount() {
|
|
||||||
return this.$store.getters['printer/getAvailableHeaters'].length
|
|
||||||
}
|
|
||||||
|
|
||||||
get printerAvailableSensorsCount() {
|
|
||||||
return this.$store.getters['printer/getAvailableSensors'].length
|
|
||||||
}
|
|
||||||
|
|
||||||
get macroMode() {
|
|
||||||
return this.$store.state.gui.macros.mode ?? 'simple'
|
|
||||||
}
|
|
||||||
|
|
||||||
get macrogroups() {
|
get macrogroups() {
|
||||||
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
|
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
|
||||||
}
|
}
|
||||||
@@ -36,89 +25,6 @@ export default class DashboardMixin extends BaseMixin {
|
|||||||
return this.$store.getters['gui/webcams/getWebcams'] ?? []
|
return this.$store.getters['gui/webcams/getWebcams'] ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
get missingPanelsMobile() {
|
|
||||||
const panels = [...this.$store.state.gui.dashboard.mobileLayout]
|
|
||||||
|
|
||||||
return this.checkMissingPanels(panels)
|
|
||||||
}
|
|
||||||
|
|
||||||
get missingPanelsTablet() {
|
|
||||||
const panels = [
|
|
||||||
...this.$store.state.gui.dashboard.tabletLayout1,
|
|
||||||
...this.$store.state.gui.dashboard.tabletLayout2,
|
|
||||||
]
|
|
||||||
|
|
||||||
return this.checkMissingPanels(panels)
|
|
||||||
}
|
|
||||||
|
|
||||||
get missingPanelsDesktop() {
|
|
||||||
const panels = [
|
|
||||||
...this.$store.state.gui.dashboard.desktopLayout1,
|
|
||||||
...this.$store.state.gui.dashboard.desktopLayout2,
|
|
||||||
]
|
|
||||||
|
|
||||||
return this.checkMissingPanels(panels)
|
|
||||||
}
|
|
||||||
|
|
||||||
get missingPanelsWidescreen() {
|
|
||||||
const panels = [
|
|
||||||
...this.$store.state.gui.dashboard.widescreenLayout1,
|
|
||||||
...this.$store.state.gui.dashboard.widescreenLayout2,
|
|
||||||
...this.$store.state.gui.dashboard.widescreenLayout3,
|
|
||||||
]
|
|
||||||
|
|
||||||
return this.checkMissingPanels(panels)
|
|
||||||
}
|
|
||||||
|
|
||||||
get allPossiblePanels() {
|
|
||||||
let allPanels = [...allDashboardPanels]
|
|
||||||
|
|
||||||
// remove macros panel and add macrogroups panels if macroMode === expert
|
|
||||||
if (this.macroMode === 'expert') {
|
|
||||||
this.macrogroups.forEach((group: GuiMacrosStateMacrogroup) => {
|
|
||||||
allPanels.push('macrogroup_' + group.id)
|
|
||||||
})
|
|
||||||
|
|
||||||
allPanels = allPanels.filter((name) => name !== 'macros')
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove toolhead panel, if kinematics === none
|
|
||||||
if (this.printerKinematics === 'none') {
|
|
||||||
allPanels = allPanels.filter((name) => name !== 'toolhead-control')
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove extruder panel, if printerExtruderCount < 1
|
|
||||||
if (this.printerExtruderCount < 1) {
|
|
||||||
allPanels = allPanels.filter((name) => name !== 'extruder-control')
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove temperature panel, if heaters & sensors < 1
|
|
||||||
if (this.printerAvailableHeatersCount + this.printerAvailableSensorsCount < 1) {
|
|
||||||
allPanels = allPanels.filter((name) => name !== 'temperature')
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove webcam panel, if no webcam exists
|
|
||||||
if (this.webcams.length === 0) {
|
|
||||||
allPanels = allPanels.filter((name) => name !== 'webcam')
|
|
||||||
}
|
|
||||||
|
|
||||||
return allPanels
|
|
||||||
}
|
|
||||||
|
|
||||||
checkMissingPanels(panels: any[]) {
|
|
||||||
const missingPanels: any[] = []
|
|
||||||
|
|
||||||
this.allPossiblePanels.forEach((panelname) => {
|
|
||||||
if (!panels.find((panel) => panel.name === panelname))
|
|
||||||
missingPanels.push({
|
|
||||||
name: panelname,
|
|
||||||
visible: true,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
return missingPanels
|
|
||||||
}
|
|
||||||
|
|
||||||
getPanelName(name: string) {
|
getPanelName(name: string) {
|
||||||
if (name.startsWith('macrogroup_')) {
|
if (name.startsWith('macrogroup_')) {
|
||||||
const groupId = name.split('_')[1] ?? ''
|
const groupId = name.split('_')[1] ?? ''
|
||||||
@@ -133,9 +39,37 @@ export default class DashboardMixin extends BaseMixin {
|
|||||||
subStrings.forEach((subStr) => {
|
subStrings.forEach((subStr) => {
|
||||||
panelName += capitalize(subStr)
|
panelName += capitalize(subStr)
|
||||||
})
|
})
|
||||||
return this.$t('Panels.' + panelName + 'Panel.Headline')
|
return this.$t(`Panels.${panelName}Panel.Headline`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$t('Panels.' + capitalize(name) + 'Panel.Headline')
|
return this.$t(`Panels.${capitalize(name)}Panel.Headline`)
|
||||||
|
}
|
||||||
|
|
||||||
|
convertPanelnameToIcon(name: string): string {
|
||||||
|
if (name.startsWith('macrogroup_')) return mdiCodeTags
|
||||||
|
|
||||||
|
switch (name) {
|
||||||
|
case 'webcam':
|
||||||
|
return mdiWebcam
|
||||||
|
case 'zoffset':
|
||||||
|
return mdiArrowCollapseVertical
|
||||||
|
case 'toolhead-control':
|
||||||
|
return mdiGamepad
|
||||||
|
case 'macros':
|
||||||
|
return mdiCodeTags
|
||||||
|
case 'miscellaneous':
|
||||||
|
return mdiDipSwitch
|
||||||
|
case 'temperature':
|
||||||
|
return mdiThermometerLines
|
||||||
|
case 'miniconsole':
|
||||||
|
return mdiConsoleLine
|
||||||
|
case 'machine-settings':
|
||||||
|
return mdiEngine
|
||||||
|
case 'extruder-control':
|
||||||
|
return mdiPrinter3dNozzle
|
||||||
|
|
||||||
|
default:
|
||||||
|
return mdiInformation
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import { Component } from 'vue-property-decorator'
|
||||||
|
@Component
|
||||||
|
export default class ExtruderMixin extends Vue {
|
||||||
|
get activeExtruder(): string {
|
||||||
|
return this.$store.state.printer.toolhead?.extruder
|
||||||
|
}
|
||||||
|
|
||||||
|
get activeExtruderSettings(): any {
|
||||||
|
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]
|
||||||
|
}
|
||||||
|
|
||||||
|
get filamentDiameter(): number {
|
||||||
|
return this.activeExtruderSettings?.filament_diameter ?? 1.75
|
||||||
|
}
|
||||||
|
|
||||||
|
get nozzleDiameter(): number {
|
||||||
|
return this.activeExtruderSettings?.nozzle_diameter ?? 0.4
|
||||||
|
}
|
||||||
|
|
||||||
|
get feedamount(): number {
|
||||||
|
return parseFloat(this.$store.state.gui.control.extruder.feedamount)
|
||||||
|
}
|
||||||
|
|
||||||
|
get feedrate(): number {
|
||||||
|
return parseFloat(this.$store.state.gui.control.extruder.feedrate)
|
||||||
|
}
|
||||||
|
|
||||||
|
get extrudeFactor() {
|
||||||
|
return this.$store.state.printer?.gcode_move?.extrude_factor ?? 1
|
||||||
|
}
|
||||||
|
|
||||||
|
get extrudePossible(): boolean {
|
||||||
|
return this.$store.getters['printer/getExtrudePossible']
|
||||||
|
}
|
||||||
|
|
||||||
|
get minExtrudeTemp(): number {
|
||||||
|
return this.activeExtruderSettings?.min_extrude_temp ?? 170
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
import Component from 'vue-class-component'
|
||||||
|
import routes, { AppRoute } from '@/routes'
|
||||||
|
import { Mixins, Watch } from 'vue-property-decorator'
|
||||||
|
import { mdiLinkVariant, mdiViewDashboardOutline } from '@mdi/js'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { PrinterStateKlipperConfig } from '@/store/printer/types'
|
||||||
|
import { GuiNavigationStateEntry } from '@/store/gui/navigation/types'
|
||||||
|
|
||||||
|
export interface NaviPoint {
|
||||||
|
type: 'link' | 'route'
|
||||||
|
title: string
|
||||||
|
orgTitle?: string
|
||||||
|
to?: string
|
||||||
|
href?: string
|
||||||
|
target?: string
|
||||||
|
icon: string
|
||||||
|
position: number
|
||||||
|
visible: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class NavigationMixin extends Mixins(BaseMixin) {
|
||||||
|
private customNaviLinks: NaviPoint[] = []
|
||||||
|
|
||||||
|
get countPrinters() {
|
||||||
|
return this.$store.getters['farm/countPrinters']
|
||||||
|
}
|
||||||
|
|
||||||
|
get routesNaviPoints(): NaviPoint[] {
|
||||||
|
const points: NaviPoint[] = []
|
||||||
|
|
||||||
|
if (this.countPrinters) {
|
||||||
|
points.push({
|
||||||
|
title: this.$t('App.Printers'),
|
||||||
|
icon: mdiViewDashboardOutline,
|
||||||
|
to: '/allPrinters',
|
||||||
|
position: 0,
|
||||||
|
visible: true,
|
||||||
|
} as NaviPoint)
|
||||||
|
}
|
||||||
|
|
||||||
|
routes
|
||||||
|
.filter((element) => {
|
||||||
|
return element.showInNavi && this.showInNavi(element)
|
||||||
|
})
|
||||||
|
.forEach((element) => {
|
||||||
|
const [position, visible] = this.getUiSettings({
|
||||||
|
type: 'route',
|
||||||
|
title: element.title ?? 'unknown',
|
||||||
|
visible: true,
|
||||||
|
position: element.position ?? 999,
|
||||||
|
})
|
||||||
|
|
||||||
|
points.push({
|
||||||
|
type: 'route',
|
||||||
|
title: this.$t(`Router.${element.title}`),
|
||||||
|
orgTitle: element.title,
|
||||||
|
icon: element.icon,
|
||||||
|
to: element.path,
|
||||||
|
position,
|
||||||
|
visible,
|
||||||
|
} as NaviPoint)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this.customNaviLinks.length) {
|
||||||
|
this.customNaviLinks.forEach((element) => {
|
||||||
|
const [position, visible] = this.getUiSettings({
|
||||||
|
type: 'link',
|
||||||
|
title: element.title ?? 'unknown',
|
||||||
|
visible: element.visible ?? true,
|
||||||
|
position: element.position ?? 999,
|
||||||
|
})
|
||||||
|
|
||||||
|
points.push({
|
||||||
|
type: 'link',
|
||||||
|
title: element.title,
|
||||||
|
icon: element.icon,
|
||||||
|
href: element.href,
|
||||||
|
target: element.target,
|
||||||
|
position,
|
||||||
|
visible,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return points
|
||||||
|
}
|
||||||
|
|
||||||
|
get naviPoints(): NaviPoint[] {
|
||||||
|
return this.routesNaviPoints.sort((a, b) => a.position - b.position)
|
||||||
|
}
|
||||||
|
|
||||||
|
get visibleNaviPoints(): NaviPoint[] {
|
||||||
|
return this.naviPoints.filter((entry) => entry.visible)
|
||||||
|
}
|
||||||
|
|
||||||
|
get uiSettings(): GuiNavigationStateEntry[] {
|
||||||
|
return this.$store.state.gui.navigation.entries
|
||||||
|
}
|
||||||
|
|
||||||
|
get klippy_state(): string {
|
||||||
|
return this.$store.state.server.klippy_state
|
||||||
|
}
|
||||||
|
|
||||||
|
get boolNaviWebcam(): boolean {
|
||||||
|
return this.$store.state.gui.uiSettings.boolWebcamNavi
|
||||||
|
}
|
||||||
|
|
||||||
|
get moonrakerComponents(): string[] {
|
||||||
|
return this.$store.state.server.components
|
||||||
|
}
|
||||||
|
|
||||||
|
get registeredDirectories(): string[] {
|
||||||
|
return this.$store.state.server.registered_directories
|
||||||
|
}
|
||||||
|
|
||||||
|
get klipperConfigfileSettings(): PrinterStateKlipperConfig[] {
|
||||||
|
return this.$store.state.printer.configfile?.settings ?? {}
|
||||||
|
}
|
||||||
|
|
||||||
|
get sidebarNaviFile(): string {
|
||||||
|
return this.$store.getters['files/getCustomNaviPoints']
|
||||||
|
}
|
||||||
|
|
||||||
|
get webcamCount(): number {
|
||||||
|
return this.$store.getters['gui/webcams/getWebcams'].length
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch('sidebarNaviFile', { immediate: true })
|
||||||
|
async sidebarNaviFileChanged(newVal: string) {
|
||||||
|
this.customNaviLinks = []
|
||||||
|
|
||||||
|
// stop if no file is set
|
||||||
|
if (!newVal) return
|
||||||
|
|
||||||
|
const content = await fetch(newVal)
|
||||||
|
.then((res) => res.json())
|
||||||
|
.catch((err) => {
|
||||||
|
window.console.error('Unable to parse .theme/navi.json.')
|
||||||
|
throw err
|
||||||
|
})
|
||||||
|
|
||||||
|
content.forEach((item: NaviPoint) => {
|
||||||
|
this.customNaviLinks.push({
|
||||||
|
title: item.title ?? 'Unknown',
|
||||||
|
icon: item.icon ?? mdiLinkVariant,
|
||||||
|
href: item.href ?? '#',
|
||||||
|
target: item.target ?? undefined,
|
||||||
|
position: item.position ?? 999,
|
||||||
|
} as NaviPoint)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
showInNavi(route: AppRoute): boolean {
|
||||||
|
if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) return false
|
||||||
|
else if (route.title === 'Webcam' && this.webcamCount === 0) return false
|
||||||
|
else if (route.moonrakerComponent && !this.moonrakerComponents.includes(route.moonrakerComponent)) return false
|
||||||
|
else if (route.registeredDirectory && !this.registeredDirectories.includes(route.registeredDirectory))
|
||||||
|
return false
|
||||||
|
else if (route.klipperComponent && !(route.klipperComponent in this.klipperConfigfileSettings)) return false
|
||||||
|
else if (route.klipperIsConnected && !this.klippyIsConnected) return false
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
getUiSettings(entry: GuiNavigationStateEntry): [number, boolean] {
|
||||||
|
const index = this.uiSettings.findIndex((point) => {
|
||||||
|
return point.title === entry.title && point.type === entry.type
|
||||||
|
})
|
||||||
|
|
||||||
|
if (index === -1) return [entry.position, entry.visible]
|
||||||
|
|
||||||
|
return [this.uiSettings[index].position, this.uiSettings[index].visible]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
import Component from 'vue-class-component'
|
||||||
|
import BaseMixin from './base'
|
||||||
|
import { TranslateResult } from 'vue-i18n'
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class SettingsGeneralDatabase extends BaseMixin {
|
||||||
|
get availableKeys() {
|
||||||
|
return [
|
||||||
|
// gui namespace
|
||||||
|
{
|
||||||
|
value: 'general',
|
||||||
|
label: this.$t('Settings.GeneralTab.General'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'control',
|
||||||
|
label: this.$t('Settings.ControlTab.Control'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'dashboard',
|
||||||
|
label: this.$t('Settings.DashboardTab.Dashboard'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'editor',
|
||||||
|
label: this.$t('Settings.EditorTab.Editor'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'gcodeViewer',
|
||||||
|
label: this.$t('Settings.GCodeViewerTab.GCodeViewer'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'navigation',
|
||||||
|
label: this.$t('Settings.GeneralTab.DBNavigation'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'uiSettings',
|
||||||
|
label: this.$t('Settings.UiSettingsTab.UiSettings'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'view',
|
||||||
|
label: this.$t('Settings.GeneralTab.DbView'),
|
||||||
|
},
|
||||||
|
|
||||||
|
// gui modules
|
||||||
|
{
|
||||||
|
value: 'console',
|
||||||
|
label: this.$t('Settings.ConsoleTab.Console'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'gcodehistory',
|
||||||
|
label: this.$t('Settings.GeneralTab.DbConsoleHistory'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'macros',
|
||||||
|
label: this.$t('Settings.MacrosTab.Macros'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'notifications',
|
||||||
|
label: this.$t('App.Notifications.Notifications'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'presets',
|
||||||
|
label: this.$t('Settings.PresetsTab.PreheatPresets'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'remoteprinters',
|
||||||
|
label: this.$t('Settings.RemotePrintersTab.RemotePrinters'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 'timelapse',
|
||||||
|
label: this.$t('Settings.TimelapseTab.Timelapse'),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
async loadBackupableNamespaces() {
|
||||||
|
// init namespaces
|
||||||
|
let backupableNamespaces: { value: string; label: string | TranslateResult }[] = []
|
||||||
|
|
||||||
|
// load DB namespaces from moonraker
|
||||||
|
const urlRequestDbList = this.$store.getters['socket/getUrl'] + '/server/database/list'
|
||||||
|
const availableNamespaces = await fetch(urlRequestDbList)
|
||||||
|
// read json
|
||||||
|
.then((response) => response?.json())
|
||||||
|
// extract result namespaces
|
||||||
|
.then((response) => response?.result?.namespaces ?? [])
|
||||||
|
.catch(() => {
|
||||||
|
window.console.error('Cannot load Moonraker DB namespaces')
|
||||||
|
return []
|
||||||
|
})
|
||||||
|
|
||||||
|
// load mainsail keys, if mainsail namespace exists
|
||||||
|
if (availableNamespaces.includes('mainsail')) {
|
||||||
|
const urlRequestMainsailNamespace =
|
||||||
|
this.$store.getters['socket/getUrl'] + '/server/database/item?namespace=mainsail'
|
||||||
|
backupableNamespaces = await fetch(urlRequestMainsailNamespace)
|
||||||
|
// read json
|
||||||
|
.then((response) => response?.json())
|
||||||
|
// extract result object
|
||||||
|
.then((response) => response?.result?.value ?? {})
|
||||||
|
// extract keys from mainsail gui object
|
||||||
|
.then((objects) => Object.keys(objects))
|
||||||
|
// filter initVersion
|
||||||
|
.then((keys) => keys.filter((key) => key !== 'initVersion'))
|
||||||
|
// convert to locale
|
||||||
|
.then((keys) =>
|
||||||
|
keys.map((key) => {
|
||||||
|
const namespace = this.availableKeys.find((namespace) => namespace.value === key)
|
||||||
|
if (namespace) return namespace
|
||||||
|
|
||||||
|
// fallback return key name
|
||||||
|
return { value: key, label: key }
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
backupableNamespaces = backupableNamespaces.sort(this.sortNamespaces)
|
||||||
|
}
|
||||||
|
|
||||||
|
// add timelapse if exists
|
||||||
|
if (availableNamespaces.includes('timelapse')) {
|
||||||
|
backupableNamespaces.push({
|
||||||
|
value: 'timelapse',
|
||||||
|
label: this.$t('Settings.GeneralTab.DbTimelapseSettings'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// add webcams if exists
|
||||||
|
if (availableNamespaces.includes('webcams')) {
|
||||||
|
backupableNamespaces.push({
|
||||||
|
value: 'webcams',
|
||||||
|
label: this.$t('Settings.WebcamsTab.Webcams'),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return backupableNamespaces
|
||||||
|
}
|
||||||
|
|
||||||
|
sortNamespaces(
|
||||||
|
a: { value: string; label: string | TranslateResult },
|
||||||
|
b: { value: string; label: string | TranslateResult }
|
||||||
|
) {
|
||||||
|
if (a.value === 'general') return -1
|
||||||
|
if (b.value === 'general') return 1
|
||||||
|
|
||||||
|
const stringA = a.label.toString().toLowerCase()
|
||||||
|
const stringB = b.label.toString().toLowerCase()
|
||||||
|
|
||||||
|
if (stringA < stringB) return -1
|
||||||
|
if (stringA > stringB) return 1
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import Component from 'vue-class-component'
|
import Component from 'vue-class-component'
|
||||||
import {
|
import {
|
||||||
mdiAlbum,
|
mdiAlbum,
|
||||||
@@ -10,9 +9,23 @@ import {
|
|||||||
mdiRaspberryPi,
|
mdiRaspberryPi,
|
||||||
mdiWebcam,
|
mdiWebcam,
|
||||||
} from '@mdi/js'
|
} from '@mdi/js'
|
||||||
|
import { Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class WebcamMixin extends Vue {
|
export default class WebcamMixin extends Mixins(BaseMixin) {
|
||||||
|
convertUrl(baseUrl: string, printerUrl: string | null) {
|
||||||
|
let url = new URL(baseUrl, this.hostUrl.toString())
|
||||||
|
|
||||||
|
// use printerURL if it exists
|
||||||
|
if (printerUrl !== null) url = new URL(baseUrl, printerUrl)
|
||||||
|
|
||||||
|
// overwrite url to baseUrl, if it is an absolute URL
|
||||||
|
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
|
||||||
|
|
||||||
|
return decodeURIComponent(url.toString())
|
||||||
|
}
|
||||||
|
|
||||||
convertWebcamIcon(iconName: string): string {
|
convertWebcamIcon(iconName: string): string {
|
||||||
switch (iconName) {
|
switch (iconName) {
|
||||||
case 'mdiAlbum':
|
case 'mdiAlbum':
|
||||||
@@ -34,4 +47,17 @@ export default class WebcamMixin extends Vue {
|
|||||||
return mdiWebcam
|
return mdiWebcam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generateTransform(flip_horizontal: boolean, flip_vertical: boolean, rotation: number) {
|
||||||
|
let transforms = ''
|
||||||
|
if (flip_horizontal) transforms += ' scaleX(-1)'
|
||||||
|
if (flip_vertical) transforms += ' scaleY(-1)'
|
||||||
|
if (rotation === 180) transforms += ' rotate(180deg)'
|
||||||
|
|
||||||
|
// return transform when exist
|
||||||
|
if (transforms.trimStart().length) return transforms.trimStart()
|
||||||
|
|
||||||
|
// return none as fallback
|
||||||
|
return 'none'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
<style scoped>
|
|
||||||
.klipper-logo {
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
.moonraker-logo {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
color: #ebc815;
|
|
||||||
}
|
|
||||||
.version-container {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 20px auto;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<v-dialog v-model="isOpen" transition="dialog-bottom-transition" max-width="600" scrollable>
|
|
||||||
<template #activator="{ an }">
|
|
||||||
<v-tooltip right color="panel">
|
|
||||||
<template #activator="{ on, attrs }">
|
|
||||||
<v-icon v-bind="attrs" v-on="an" @mouseenter="on.mouseenter" @mouseleave="on.mouseleave">
|
|
||||||
{{ mdiHelpCircleOutline }}
|
|
||||||
</v-icon>
|
|
||||||
</template>
|
|
||||||
<span class="dark version-container">
|
|
||||||
<div><img height="12" src="/img/logo.svg" /></div>
|
|
||||||
<div>v{{ mainsailVersion }}</div>
|
|
||||||
<div>
|
|
||||||
<v-icon small class="moonraker-logo">{{ mdiMoonWaningCrescent }}</v-icon>
|
|
||||||
</div>
|
|
||||||
<div>{{ moonrakerVersion }}</div>
|
|
||||||
<div><img height="12" src="/img/klipper.svg" class="klipper-logo" /></div>
|
|
||||||
<div>{{ klipperVersion }}</div>
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</template>
|
|
||||||
<template #default>
|
|
||||||
<panel title="About" :margin-bottom="false">
|
|
||||||
<template #buttons>
|
|
||||||
<v-btn icon tile @click="isOpen = false">
|
|
||||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
</template>
|
|
||||||
<v-card-text>
|
|
||||||
<v-container fliud class="align-self-start">
|
|
||||||
<v-row tag="logo">
|
|
||||||
<v-col cols="auto">
|
|
||||||
<v-img
|
|
||||||
height="80"
|
|
||||||
contain
|
|
||||||
src="https://docs.mainsail.xyz/assets/img/logo-mainsail.png"></v-img>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row tag="data1" justify="center">
|
|
||||||
<v-col class="pr-3 text-right">Version</v-col>
|
|
||||||
<v-col>v2.1.0-alpha</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
</v-card-text>
|
|
||||||
</panel>
|
|
||||||
</template>
|
|
||||||
</v-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import BaseMixin from '../mixins/base'
|
|
||||||
import { Mixins } from 'vue-property-decorator'
|
|
||||||
import Component from 'vue-class-component'
|
|
||||||
import Panel from '@/components/ui/Panel.vue'
|
|
||||||
import { mdiCloseThick, mdiHelpCircleOutline, mdiMoonWaningCrescent } from '@mdi/js'
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
components: { Panel },
|
|
||||||
})
|
|
||||||
export default class AboutModal extends Mixins(BaseMixin) {
|
|
||||||
mdiHelpCircleOutline = mdiHelpCircleOutline
|
|
||||||
mdiCloseThick = mdiCloseThick
|
|
||||||
mdiMoonWaningCrescent = mdiMoonWaningCrescent
|
|
||||||
|
|
||||||
private isOpen = false
|
|
||||||
|
|
||||||
get mainsailVersion(): string {
|
|
||||||
return this.$store.state.packageVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
get klipperVersion(): string {
|
|
||||||
return this.$store.state.printer?.software_version ?? ''
|
|
||||||
}
|
|
||||||
|
|
||||||
get moonrakerVersion(): string {
|
|
||||||
return this.$store.state.server?.moonraker_version ?? ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -4,4 +4,8 @@ $t('History.StatusValues.error')
|
|||||||
$t('History.StatusValues.in_progress')
|
$t('History.StatusValues.in_progress')
|
||||||
$t('History.StatusValues.klippy_disconnect')
|
$t('History.StatusValues.klippy_disconnect')
|
||||||
$t('History.StatusValues.klippy_shutdown')
|
$t('History.StatusValues.klippy_shutdown')
|
||||||
$t('History.StatusValues.server_exit')
|
$t('History.StatusValues.server_exit')
|
||||||
|
$t('Panels.TemperaturePanel.Dataset.Power')
|
||||||
|
$t('Panels.TemperaturePanel.Dataset.Speed')
|
||||||
|
$t('Panels.TemperaturePanel.Dataset.Target')
|
||||||
|
$t('Panels.TemperaturePanel.Dataset.Temperature')
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<template>
|
||||||
|
<v-container v-if="showEstimatedExtrusion" class="pa-0 ma-0 pb-1">
|
||||||
|
<div style="font-size: 0.8em" class="text--disabled text-caption font-weight-light d-flex justify-center">
|
||||||
|
<span>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.EstimatedExtrusion') }} ~ {{ extrudedLength }} mm @
|
||||||
|
{{ volumetricFlow }} mm³/s -
|
||||||
|
<v-icon x-small style="opacity: 0.4; margin-top: -2px">
|
||||||
|
{{ mdiDiameterVariant }}
|
||||||
|
</v-icon>
|
||||||
|
{{ nozzleDiameter }} mm
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { mdiDiameterVariant } from '@mdi/js'
|
||||||
|
import ExtruderMixin from '@/components/mixins/extruder'
|
||||||
|
|
||||||
|
@Component({})
|
||||||
|
export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderMixin) {
|
||||||
|
mdiDiameterVariant = mdiDiameterVariant
|
||||||
|
|
||||||
|
get showEstimatedExtrusion() {
|
||||||
|
return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo ?? true
|
||||||
|
}
|
||||||
|
|
||||||
|
get extrudedLength(): number {
|
||||||
|
return Math.round(
|
||||||
|
this.feedamount *
|
||||||
|
this.extrudeFactor *
|
||||||
|
(Math.pow(this.filamentDiameter, 2) / Math.pow(this.nozzleDiameter, 2))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get volumetricFlow(): number {
|
||||||
|
return Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * 10) / 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,320 @@
|
|||||||
|
<template>
|
||||||
|
<responsive :breakpoints="{ large: (el) => el.width >= 640 }">
|
||||||
|
<template #default="{ el }">
|
||||||
|
<v-container>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.FilamentLength')"
|
||||||
|
param="feedamount"
|
||||||
|
:target="feedamount"
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="100"
|
||||||
|
:step="0.01"
|
||||||
|
:min="0.01"
|
||||||
|
:max="maxExtrudeOnlyDistance"
|
||||||
|
:dec="2"
|
||||||
|
unit="mm"
|
||||||
|
:submit-on-blur="true"
|
||||||
|
@submit="setFeedamount" />
|
||||||
|
<v-item-group class="_btn-group pt-3">
|
||||||
|
<v-btn
|
||||||
|
v-for="value in feedamountsSorted"
|
||||||
|
:key="value"
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
dense
|
||||||
|
class="_btn-qs flex-grow-1 px-0"
|
||||||
|
@click="setFeedamount({ value })">
|
||||||
|
{{ value }}
|
||||||
|
</v-btn>
|
||||||
|
</v-item-group>
|
||||||
|
</v-col>
|
||||||
|
<v-col>
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.ExtrusionFeedrate')"
|
||||||
|
param="feedrate"
|
||||||
|
:target="feedrate"
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
:has-spinner="true"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:spinner-factor="100"
|
||||||
|
:step="0.01"
|
||||||
|
:min="0.01"
|
||||||
|
:max="null"
|
||||||
|
:dec="2"
|
||||||
|
type="number"
|
||||||
|
unit="mm/s"
|
||||||
|
@submit="setFeedrate" />
|
||||||
|
<v-item-group class="_btn-group pt-3">
|
||||||
|
<v-btn
|
||||||
|
v-for="value in feedratesSorted"
|
||||||
|
:key="value"
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
dense
|
||||||
|
class="_btn-qs flex-grow-1 px-0"
|
||||||
|
@click="setFeedrate({ value })">
|
||||||
|
{{ value }}
|
||||||
|
</v-btn>
|
||||||
|
</v-item-group>
|
||||||
|
</v-col>
|
||||||
|
<!-- EXTRUDE AND RETRACT BUTTON LARGE SIZED PANEL -->
|
||||||
|
<v-col v-if="el.is.large" class="col-3 d-flex align-center flex-column justify-center">
|
||||||
|
<!-- RETRACT -->
|
||||||
|
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||||
|
<template #activator="{ on }">
|
||||||
|
<div class="mb-4" v-on="on">
|
||||||
|
<v-btn
|
||||||
|
:loading="loadings.includes('btnRetract')"
|
||||||
|
:disabled="!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly"
|
||||||
|
small
|
||||||
|
class="_btn-extruder-cmd"
|
||||||
|
@click="sendRetract()">
|
||||||
|
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span v-show="!extrudePossible">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||||
|
{{ minExtrudeTemp }} °C
|
||||||
|
</span>
|
||||||
|
<span v-show="tooLargeExtrusion">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
<!-- EXTRUDE -->
|
||||||
|
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||||
|
<template #activator="{ on }">
|
||||||
|
<div v-on="on">
|
||||||
|
<v-btn
|
||||||
|
:loading="loadings.includes('btnDetract')"
|
||||||
|
:disabled="!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly"
|
||||||
|
small
|
||||||
|
class="_btn-extruder-cmd"
|
||||||
|
@click="sendExtrude()">
|
||||||
|
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span v-show="!extrudePossible">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||||
|
{{ minExtrudeTemp }} °C
|
||||||
|
</span>
|
||||||
|
<span v-show="tooLargeExtrusion">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<!-- EXTRUDE AND RETRACT BUTTON SMALL AND MEDIUM SIZED PANEL -->
|
||||||
|
<v-row v-if="!el.is.large">
|
||||||
|
<v-col class="pa-0">
|
||||||
|
<div class="d-flex justify-space-around">
|
||||||
|
<div class="d-flex align-center">
|
||||||
|
<!-- RETRACT -->
|
||||||
|
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||||
|
<template #activator="{ on }">
|
||||||
|
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||||
|
<v-btn
|
||||||
|
:loading="loadings.includes('btnRetract')"
|
||||||
|
:disabled="
|
||||||
|
!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly
|
||||||
|
"
|
||||||
|
small
|
||||||
|
class="_btn-extruder-cmd"
|
||||||
|
@click="sendRetract()">
|
||||||
|
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span v-show="!extrudePossible">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||||
|
{{ minExtrudeTemp }} °C
|
||||||
|
</span>
|
||||||
|
<span v-show="tooLargeExtrusion">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||||
|
{{ feedamount * extrudeFactor }} mm
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
<!-- EXTRUDE -->
|
||||||
|
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||||
|
<template #activator="{ on }">
|
||||||
|
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||||
|
<v-btn
|
||||||
|
:loading="loadings.includes('btnDetract')"
|
||||||
|
:disabled="
|
||||||
|
!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly
|
||||||
|
"
|
||||||
|
small
|
||||||
|
class="_btn-extruder-cmd"
|
||||||
|
@click="sendExtrude()">
|
||||||
|
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||||
|
</v-btn>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span v-show="!extrudePossible">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||||
|
{{ minExtrudeTemp }} °C
|
||||||
|
</span>
|
||||||
|
<span v-show="tooLargeExtrusion">
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||||
|
{{ feedamount * extrudeFactor }} mm
|
||||||
|
<br />
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
</responsive>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { mdiArrowDownBold, mdiArrowUpBold, mdiPrinter3dNozzle } from '@mdi/js'
|
||||||
|
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
||||||
|
import ExtruderMixin from '@/components/mixins/extruder'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: {
|
||||||
|
NumberInput,
|
||||||
|
Responsive,
|
||||||
|
ToolSlider,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export default class ExtruderControlPanel extends Mixins(BaseMixin, ExtruderMixin) {
|
||||||
|
mdiArrowDownBold = mdiArrowDownBold
|
||||||
|
mdiArrowUpBold = mdiArrowUpBold
|
||||||
|
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||||
|
|
||||||
|
get feedamounts(): number[] {
|
||||||
|
return this.$store.state.gui.control.extruder?.feedamounts ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
get feedrates(): number[] {
|
||||||
|
return this.$store.state.gui.control.extruder?.feedrates ?? []
|
||||||
|
}
|
||||||
|
|
||||||
|
get feedamountsSorted(): number[] {
|
||||||
|
return [...this.feedamounts].sort((a, b) => {
|
||||||
|
return b - a
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
get feedratesSorted(): number[] {
|
||||||
|
return [...this.feedrates].sort((a, b) => {
|
||||||
|
return b - a
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setFeedamount(params: { value: number }): void {
|
||||||
|
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamount', value: params.value })
|
||||||
|
}
|
||||||
|
|
||||||
|
setFeedrate(params: { value: number }): void {
|
||||||
|
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrate', value: params.value })
|
||||||
|
}
|
||||||
|
|
||||||
|
get maxExtrudeOnlyDistance(): number {
|
||||||
|
return this.activeExtruderSettings?.max_extrude_only_distance ?? 50
|
||||||
|
}
|
||||||
|
|
||||||
|
get tooLargeExtrusion(): boolean {
|
||||||
|
return this.feedamount * this.extrudeFactor > this.maxExtrudeOnlyDistance
|
||||||
|
}
|
||||||
|
|
||||||
|
@Watch('maxExtrudeOnlyDistance', { immediate: true })
|
||||||
|
onMaxExtrudeOnlyDistanceChange(): void {
|
||||||
|
/**
|
||||||
|
* If, while switching from ex. A to ex. B, the feedamount
|
||||||
|
* from ex. an exceeds the maxExtrudeOnlyDistance of ex. B,
|
||||||
|
* set the feedamount to maxExtrudeOnlyDistance of ex. B
|
||||||
|
*/
|
||||||
|
if (this.feedamount > this.maxExtrudeOnlyDistance) {
|
||||||
|
this.setFeedamount({ value: this.maxExtrudeOnlyDistance })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sendRetract(): void {
|
||||||
|
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
|
||||||
|
}
|
||||||
|
|
||||||
|
sendExtrude(): void {
|
||||||
|
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}`
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._btn-group {
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.v-btn {
|
||||||
|
border-radius: 0;
|
||||||
|
border-color: rgba(255, 255, 255, 0.12);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: thin;
|
||||||
|
box-shadow: none;
|
||||||
|
height: 28px;
|
||||||
|
opacity: 0.8;
|
||||||
|
min-width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:first-child {
|
||||||
|
border-top-left-radius: inherit;
|
||||||
|
border-bottom-left-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:last-child {
|
||||||
|
border-top-right-radius: inherit;
|
||||||
|
border-bottom-right-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:not(:first-child) {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
._btn-qs {
|
||||||
|
font-size: 0.8rem !important;
|
||||||
|
max-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
._btn-extruder-cmd {
|
||||||
|
min-width: 135px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="toolchangeMacros.length > 1">
|
||||||
|
<v-row v-for="(row, index) in rows" :key="'row_' + index" class="mt-0">
|
||||||
|
<v-col>
|
||||||
|
<v-item-group class="_btn-group py-0 px-3">
|
||||||
|
<extruder-control-panel-tools-item v-for="macro in row" :key="macro.name" :macro="macro" />
|
||||||
|
</v-item-group>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { mdiPrinter3dNozzle } from '@mdi/js'
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import { PrinterStateMacro, PrinterStateToolchangeMacro } from '@/store/printer/types'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
|
||||||
|
@Component({})
|
||||||
|
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||||
|
|
||||||
|
get macros() {
|
||||||
|
return this.$store.getters['printer/getMacros']
|
||||||
|
}
|
||||||
|
|
||||||
|
get toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
||||||
|
return this.macros
|
||||||
|
.filter((macro: PrinterStateMacro) => macro.name.toUpperCase().match(/^T\d+/))
|
||||||
|
.sort((a: PrinterStateMacro, b: PrinterStateMacro) => {
|
||||||
|
const numberA = parseInt(a.name.slice(1))
|
||||||
|
const numberB = parseInt(b.name.slice(1))
|
||||||
|
|
||||||
|
return numberA - numberB
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
get rows() {
|
||||||
|
const cols = 6
|
||||||
|
let rows = []
|
||||||
|
|
||||||
|
for (let i = 0; i < this.toolchangeMacros.length; i += cols) {
|
||||||
|
rows.push(this.toolchangeMacros.slice(i, i + cols))
|
||||||
|
}
|
||||||
|
|
||||||
|
return rows
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
._btn-group {
|
||||||
|
border-radius: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
|
||||||
|
.v-btn {
|
||||||
|
border-radius: 0;
|
||||||
|
border-color: rgba(255, 255, 255, 0.12);
|
||||||
|
border-style: solid;
|
||||||
|
border-width: thin;
|
||||||
|
box-shadow: none;
|
||||||
|
height: 28px;
|
||||||
|
opacity: 0.8;
|
||||||
|
min-width: auto !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:first-child {
|
||||||
|
border-top-left-radius: inherit;
|
||||||
|
border-bottom-left-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:last-child {
|
||||||
|
border-top-right-radius: inherit;
|
||||||
|
border-bottom-right-radius: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-btn:not(:first-child) {
|
||||||
|
border-left-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<template>
|
||||||
|
<v-btn
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
dense
|
||||||
|
class="flex-grow-1 px-0"
|
||||||
|
:style="buttonStyle"
|
||||||
|
@click="doSend(macro.name)">
|
||||||
|
<span v-if="color != null" class="_extruderColorState mr-1" :style="dotStyle" />
|
||||||
|
{{ macro.name }}
|
||||||
|
</v-btn>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||||
|
import { PrinterStateMacro } from '@/store/printer/types'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: {},
|
||||||
|
})
|
||||||
|
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
@Prop({ type: Object }) macro!: PrinterStateMacro
|
||||||
|
|
||||||
|
get active() {
|
||||||
|
return this.macro.variables.active ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
get color() {
|
||||||
|
const color = this.macro.variables.color ?? this.macro.variables.colour ?? null
|
||||||
|
if (color === '' || color === 'undefined') return null
|
||||||
|
|
||||||
|
return color
|
||||||
|
}
|
||||||
|
|
||||||
|
get primaryColor(): string {
|
||||||
|
return this.$store.state.gui.uiSettings.primary
|
||||||
|
}
|
||||||
|
|
||||||
|
get primaryTextColor(): string {
|
||||||
|
let splits = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor)
|
||||||
|
if (splits) {
|
||||||
|
const r = parseInt(splits[1], 16) * 0.2126
|
||||||
|
const g = parseInt(splits[2], 16) * 0.7152
|
||||||
|
const b = parseInt(splits[3], 16) * 0.0722
|
||||||
|
const perceivedLightness = (r + g + b) / 255
|
||||||
|
|
||||||
|
return perceivedLightness > 0.7 ? '#222' : '#fff'
|
||||||
|
}
|
||||||
|
|
||||||
|
return '#ffffff'
|
||||||
|
}
|
||||||
|
|
||||||
|
get warningColor(): string {
|
||||||
|
return this.$vuetify?.theme?.currentTheme?.warning?.toString() ?? '#ff8300'
|
||||||
|
}
|
||||||
|
|
||||||
|
get buttonStyle() {
|
||||||
|
let backgroundColor = ''
|
||||||
|
if (this.active) {
|
||||||
|
backgroundColor = this.homedAxes.includes('xyz') ? this.primaryColor : this.warningColor
|
||||||
|
}
|
||||||
|
|
||||||
|
const textColor = this.active ? this.primaryTextColor : ''
|
||||||
|
|
||||||
|
return {
|
||||||
|
color: textColor,
|
||||||
|
'background-color': backgroundColor,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get dotStyle() {
|
||||||
|
return {
|
||||||
|
'border-color': this.active ? this.primaryTextColor : '',
|
||||||
|
'background-color': '#' + this.color,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
._extruderColorState {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 1px solid lightgray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<v-container class="pb-1">
|
||||||
|
<tool-slider
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.ExtrusionFactor')"
|
||||||
|
:icon="mdiPrinter3dNozzleOutline"
|
||||||
|
:target="extrudeFactor"
|
||||||
|
:min="1"
|
||||||
|
:max="200"
|
||||||
|
:multi="100"
|
||||||
|
:step="1"
|
||||||
|
:has-input-field="true"
|
||||||
|
command="M221"
|
||||||
|
attribute-name="S" />
|
||||||
|
</v-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import { mdiPrinter3dNozzleOutline } from '@mdi/js'
|
||||||
|
import ExtruderMixin from '@/components/mixins/extruder'
|
||||||
|
|
||||||
|
@Component({})
|
||||||
|
export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderMixin) {
|
||||||
|
mdiPrinter3dNozzleOutline = mdiPrinter3dNozzleOutline
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="existsFirmwareRetraction">
|
||||||
|
<v-divider />
|
||||||
|
<v-container>
|
||||||
|
<responsive
|
||||||
|
:breakpoints="{
|
||||||
|
small: (el) => el.width <= 350,
|
||||||
|
}">
|
||||||
|
<template #default="{ el }">
|
||||||
|
<v-row>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractLength')"
|
||||||
|
param="RETRACT_LENGTH"
|
||||||
|
:target="retractLength"
|
||||||
|
:default-value="defaultRetractLength"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="10"
|
||||||
|
:step="0.01"
|
||||||
|
:min="0"
|
||||||
|
:max="null"
|
||||||
|
:dec="2"
|
||||||
|
unit="mm"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractSpeed')"
|
||||||
|
param="RETRACT_SPEED"
|
||||||
|
:target="retractSpeed"
|
||||||
|
:default-value="defaultRetractSpeed"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="5"
|
||||||
|
:step="1"
|
||||||
|
:min="1"
|
||||||
|
:max="null"
|
||||||
|
:dec="0"
|
||||||
|
unit="mm/s"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="
|
||||||
|
$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractExtraLength')
|
||||||
|
"
|
||||||
|
param="UNRETRACT_EXTRA_LENGTH"
|
||||||
|
:target="unretractExtraLength"
|
||||||
|
:default-value="defaultUnretractExtraLength"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="10"
|
||||||
|
:step="0.01"
|
||||||
|
:min="0"
|
||||||
|
:max="null"
|
||||||
|
:dec="2"
|
||||||
|
unit="mm"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractSpeed')"
|
||||||
|
param="UNRETRACT_SPEED"
|
||||||
|
:target="unretractSpeed"
|
||||||
|
:default-value="defaultUnretractSpeed"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="5"
|
||||||
|
:step="1"
|
||||||
|
:min="1"
|
||||||
|
:max="null"
|
||||||
|
:dec="0"
|
||||||
|
unit="mm/s"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</template>
|
||||||
|
</responsive>
|
||||||
|
</v-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import { Debounce } from 'vue-debounce-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
import ControlMixin from '@/components/mixins/control'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: { Panel, NumberInput, Responsive },
|
||||||
|
})
|
||||||
|
export default class FirmwareRetractionSettings extends Mixins(BaseMixin, ControlMixin) {
|
||||||
|
get retractLength(): number {
|
||||||
|
return Math.floor((this.$store.state.printer?.firmware_retraction?.retract_length ?? 0) * 100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
|
get retractSpeed(): number {
|
||||||
|
return Math.trunc(this.$store.state.printer?.firmware_retraction?.retract_speed ?? 20)
|
||||||
|
}
|
||||||
|
|
||||||
|
get unretractExtraLength(): number {
|
||||||
|
return Math.floor((this.$store.state.printer?.firmware_retraction?.unretract_extra_length ?? 0) * 100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
|
get unretractSpeed(): number {
|
||||||
|
return Math.trunc(this.$store.state.printer?.firmware_retraction?.unretract_speed ?? 10)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultRetractLength(): number {
|
||||||
|
return (
|
||||||
|
Math.floor(
|
||||||
|
(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.retract_length ?? 0) * 100
|
||||||
|
) / 100
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultRetractSpeed(): number {
|
||||||
|
return Math.trunc(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.retract_speed ?? 20)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultUnretractExtraLength(): number {
|
||||||
|
return (
|
||||||
|
Math.floor(
|
||||||
|
(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.unretract_extra_length ?? 0) *
|
||||||
|
100
|
||||||
|
) / 100
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultUnretractSpeed(): number {
|
||||||
|
return Math.trunc(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.unretract_speed ?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce(500)
|
||||||
|
sendCmd(params: { name: string; value: number }): void {
|
||||||
|
const gcode = `SET_RETRACTION ${params.name}=${params.value}`
|
||||||
|
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,144 @@
|
|||||||
|
<template>
|
||||||
|
<div v-if="show">
|
||||||
|
<v-divider />
|
||||||
|
<v-container>
|
||||||
|
<responsive
|
||||||
|
:breakpoints="{
|
||||||
|
small: (el) => el.width <= 350,
|
||||||
|
medium: (el) => el.width > 350 && el.width <= 500,
|
||||||
|
}">
|
||||||
|
<template #default="{ el }">
|
||||||
|
<v-row>
|
||||||
|
<v-col v-if="allExtruders.length > 1" :class="{ 'col-12': el.is.small || el.is.medium }">
|
||||||
|
<div class="d-flex align-center">
|
||||||
|
<v-btn
|
||||||
|
v-if="selectedExtruder !== activeExtruder"
|
||||||
|
icon
|
||||||
|
plain
|
||||||
|
@click="resetToActiveExtruder">
|
||||||
|
<v-icon>{{ mdiRestart }}</v-icon>
|
||||||
|
</v-btn>
|
||||||
|
<v-select
|
||||||
|
v-model="selectedExtruder"
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder')"
|
||||||
|
:items="allExtruders"
|
||||||
|
:value="activeExtruder"
|
||||||
|
hide-details
|
||||||
|
outlined
|
||||||
|
dense />
|
||||||
|
</div>
|
||||||
|
</v-col>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance')"
|
||||||
|
param="ADVANCE"
|
||||||
|
:target="pressureAdvance"
|
||||||
|
:default-value="defaultPressureAdvance"
|
||||||
|
:extruder="selectedExtruder"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:min="0"
|
||||||
|
:max="null"
|
||||||
|
:step="0.001"
|
||||||
|
:dec="3"
|
||||||
|
unit="s"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
<v-col :class="{ 'col-12': el.is.small }">
|
||||||
|
<number-input
|
||||||
|
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime')"
|
||||||
|
param="SMOOTH_TIME"
|
||||||
|
:target="smoothTime"
|
||||||
|
:default-value="defaultSmoothTime"
|
||||||
|
:extruder="selectedExtruder"
|
||||||
|
:output-error-msg="true"
|
||||||
|
:has-spinner="true"
|
||||||
|
:spinner-factor="10"
|
||||||
|
:min="0"
|
||||||
|
:max="0.2"
|
||||||
|
:step="0.001"
|
||||||
|
:dec="3"
|
||||||
|
unit="s"
|
||||||
|
@submit="sendCmd" />
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</template>
|
||||||
|
</responsive>
|
||||||
|
</v-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
|
import { Debounce } from 'vue-debounce-decorator'
|
||||||
|
import BaseMixin from '@/components/mixins/base'
|
||||||
|
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||||
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
|
import Responsive from '@/components/ui/Responsive.vue'
|
||||||
|
import { mdiRestart } from '@mdi/js'
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
components: { NumberInput, Panel, Responsive },
|
||||||
|
})
|
||||||
|
export default class PressureAdvanceSettings extends Mixins(BaseMixin) {
|
||||||
|
mdiRestart = mdiRestart
|
||||||
|
|
||||||
|
private extruders: string[] = []
|
||||||
|
private selectedExtruder = ''
|
||||||
|
|
||||||
|
resetToActiveExtruder(): void {
|
||||||
|
this.selectedExtruder = this.$store.state.printer.toolhead?.extruder
|
||||||
|
}
|
||||||
|
|
||||||
|
get show(): boolean {
|
||||||
|
return !(this.$store.getters['printer/getExtruderSteppers'].length > 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
get allExtruders(): string[] {
|
||||||
|
Object.keys(this.$store.state.printer).forEach((e) => {
|
||||||
|
if (e.startsWith('extruder') && !this.extruders.includes(e)) this.extruders.push(e)
|
||||||
|
})
|
||||||
|
this.extruders.length === 1 ? this.resetToActiveExtruder() : {}
|
||||||
|
|
||||||
|
return this.extruders
|
||||||
|
}
|
||||||
|
|
||||||
|
get activeExtruder(): string {
|
||||||
|
this.resetToActiveExtruder()
|
||||||
|
return this.$store.state.printer.toolhead?.extruder
|
||||||
|
}
|
||||||
|
|
||||||
|
get pressureAdvance(): number {
|
||||||
|
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000) / 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
get smoothTime(): number {
|
||||||
|
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.smooth_time ?? 0.04) * 1000) / 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultPressureAdvance(): number {
|
||||||
|
return (
|
||||||
|
Math.floor(
|
||||||
|
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000
|
||||||
|
) / 1000
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
get defaultSmoothTime(): number {
|
||||||
|
return (
|
||||||
|
Math.floor(
|
||||||
|
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]
|
||||||
|
?.pressure_advance_smooth_time ?? 0.04) * 1000
|
||||||
|
) / 1000
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Debounce(500)
|
||||||
|
sendCmd(params: { name: string; value: number }): void {
|
||||||
|
const gcode = `SET_PRESSURE_ADVANCE EXTRUDER=${this.selectedExtruder} ${params.name}=${params.value}`
|
||||||
|
|
||||||
|
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||||
|
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -1,82 +1,30 @@
|
|||||||
<style lang="scss" scoped>
|
|
||||||
._btn-group {
|
|
||||||
border-radius: 4px;
|
|
||||||
display: inline-flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
max-width: 100%;
|
|
||||||
min-width: 100%;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.v-btn {
|
|
||||||
border-radius: 0;
|
|
||||||
border-color: rgba(255, 255, 255, 0.12);
|
|
||||||
border-style: solid;
|
|
||||||
border-width: thin;
|
|
||||||
box-shadow: none;
|
|
||||||
height: 28px;
|
|
||||||
opacity: 0.8;
|
|
||||||
min-width: auto !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-btn:first-child {
|
|
||||||
border-top-left-radius: inherit;
|
|
||||||
border-bottom-left-radius: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-btn:last-child {
|
|
||||||
border-top-right-radius: inherit;
|
|
||||||
border-bottom-right-radius: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-btn:not(:first-child) {
|
|
||||||
border-left-width: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
._btn-qs {
|
|
||||||
font-size: 0.8rem !important;
|
|
||||||
max-height: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
._btn-extruder-cmd {
|
|
||||||
min-width: 135px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<panel
|
<panel
|
||||||
v-if="klipperReadyForGui && extruders.length"
|
v-if="showPanel"
|
||||||
:icon="mdiPrinter3dNozzle"
|
:icon="mdiPrinter3dNozzle"
|
||||||
:title="$t('Panels.ExtruderControlPanel.Headline').toString()"
|
:title="$t('Panels.ExtruderControlPanel.Headline')"
|
||||||
:collapsible="true"
|
:collapsible="true"
|
||||||
card-class="extruder-control-panel">
|
card-class="extruder-control-panel"
|
||||||
|
class="pb-1">
|
||||||
<!-- PANEL-HEADER 3-DOT-MENU -->
|
<!-- PANEL-HEADER 3-DOT-MENU -->
|
||||||
<template #buttons>
|
<template #buttons>
|
||||||
<v-menu v-if="filamentChangeMacros" left :offset-y="true" :close-on-content-click="false" class="pa-0">
|
<v-menu v-if="showFilamentMacros" :offset-y="true" :close-on-content-click="false" left>
|
||||||
<template #activator="{ on, attrs }">
|
<template #activator="{ on, attrs }">
|
||||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||||
<v-icon>{{ mdiDotsVertical }}</v-icon>
|
<v-icon>{{ mdiDotsVertical }}</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<v-list dense>
|
<v-list dense>
|
||||||
<v-list-item>
|
<!-- FILAMENT UNLOAD -->
|
||||||
<!-- FILAMENT UNLOAD -->
|
<v-list-item v-if="unloadFilamentMacro">
|
||||||
<v-tooltip top :disabled="extrudePossible" color="secondary">
|
<v-tooltip top :disabled="canExecuteUnloadMacro" color="secondary">
|
||||||
<template #activator="{ on }">
|
<template #activator="{ on }">
|
||||||
<div style="width: 100%" v-on="on">
|
<div v-on="on">
|
||||||
<v-btn
|
<macro-button
|
||||||
:loading="loadings.includes('btnUnloadFilament')"
|
:macro="unloadFilamentMacro"
|
||||||
:disabled="!extrudePossible || isPrinting"
|
:alias="$t('Panels.ExtruderControlPanel.UnloadFilament')"
|
||||||
small
|
:disabled="!canExecuteUnloadMacro || printerIsPrintingOnly"
|
||||||
style="width: 100%"
|
color="#272727" />
|
||||||
@click="sendUnloadFilament()">
|
|
||||||
<span class="d-flex align-center">
|
|
||||||
<v-icon left small style="transform: rotate(270deg)" class="mr-1">
|
|
||||||
{{ mdiLocationExit }}
|
|
||||||
</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.UnloadFilament') }}
|
|
||||||
</span>
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<span>
|
<span>
|
||||||
@@ -85,24 +33,16 @@
|
|||||||
</span>
|
</span>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-list-item>
|
<!-- FILAMENT LOAD -->
|
||||||
<!-- FILAMENT LOAD -->
|
<v-list-item v-if="loadFilamentMacro">
|
||||||
<v-tooltip top :disabled="extrudePossible" color="secondary">
|
<v-tooltip top :disabled="canExecuteLoadMacro" color="secondary">
|
||||||
<template #activator="{ on }">
|
<template #activator="{ on }">
|
||||||
<div style="width: 100%" v-on="on">
|
<div v-on="on">
|
||||||
<v-btn
|
<macro-button
|
||||||
:loading="loadings.includes('btnLoadFilament')"
|
:macro="loadFilamentMacro"
|
||||||
:disabled="!extrudePossible || isPrinting"
|
:alias="$t('Panels.ExtruderControlPanel.LoadFilament')"
|
||||||
small
|
:disabled="!canExecuteLoadMacro || printerIsPrintingOnly"
|
||||||
style="width: 100%"
|
color="#272727" />
|
||||||
@click="sendLoadFilament()">
|
|
||||||
<span class="d-flex align-center">
|
|
||||||
<v-icon left small style="transform: rotate(90deg)" class="mr-1">
|
|
||||||
{{ mdiLocationEnter }}
|
|
||||||
</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.LoadFilament') }}
|
|
||||||
</span>
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<span>
|
<span>
|
||||||
@@ -111,425 +51,131 @@
|
|||||||
</span>
|
</span>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
<!-- FILAMENT PURGE -->
|
||||||
|
<v-list-item v-if="purgeFilamentMacro">
|
||||||
|
<v-tooltip top :disabled="canExecutePurgeMacro" color="secondary">
|
||||||
|
<template #activator="{ on }">
|
||||||
|
<div v-on="on">
|
||||||
|
<macro-button
|
||||||
|
:macro="purgeFilamentMacro"
|
||||||
|
:alias="$t('Panels.ExtruderControlPanel.PurgeFilament')"
|
||||||
|
:disabled="!canExecutePurgeMacro || printerIsPrintingOnly"
|
||||||
|
color="#272727" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<span>
|
||||||
|
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||||
|
{{ minExtrudeTemp }} °C
|
||||||
|
</span>
|
||||||
|
</v-tooltip>
|
||||||
|
</v-list-item>
|
||||||
|
<!-- NOZZLE CLEAN -->
|
||||||
|
<v-list-item v-if="cleanNozzleMacro">
|
||||||
|
<macro-button
|
||||||
|
:macro="cleanNozzleMacro"
|
||||||
|
:alias="$t('Panels.ExtruderControlPanel.CleanNozzle')"
|
||||||
|
:disabled="printerIsPrintingOnly"
|
||||||
|
color="#272727" />
|
||||||
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
</template>
|
</template>
|
||||||
<responsive :breakpoints="{ large: (el) => el.width >= 640 }">
|
<!-- TOOL SELECTOR BUTTONS -->
|
||||||
<template #default="{ el }">
|
<extruder-control-panel-tools />
|
||||||
<!-- TOOL SELECTOR BUTTONS -->
|
<!-- EXTRUSION FACTOR SLIDER -->
|
||||||
<v-container v-if="toolchangeMacros.length > 1" class="pb-1">
|
<extrusion-factor-settings />
|
||||||
<v-item-group class="_btn-group py-0">
|
<!-- PRESSURE ADVANCE SETTINGS -->
|
||||||
<v-btn
|
<pressure-advance-settings />
|
||||||
v-for="tool in toolchangeMacros"
|
<!-- FIRMWARE RETRACTION SETTINGS -->
|
||||||
:key="tool.name"
|
<firmware-retraction-settings />
|
||||||
:class="tool.active ? 'primary--text' : {}"
|
<v-divider class="pb-1" />
|
||||||
:disabled="isPrinting"
|
<!-- EXTRUDER INPUTS AND QUICKSELECTS -->
|
||||||
dense
|
<extruder-control-panel-control />
|
||||||
class="flex-grow-1 px-0"
|
<!-- EXTRUSION ESTIMATION NOTE -->
|
||||||
@click="doSend(tool.name)">
|
<estimated-extrusion-output />
|
||||||
{{ tool.name }}
|
|
||||||
</v-btn>
|
|
||||||
</v-item-group>
|
|
||||||
</v-container>
|
|
||||||
<!-- EXTRUSION FACTOR SLIDER -->
|
|
||||||
<v-container class="pb-1">
|
|
||||||
<tool-slider
|
|
||||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFactor').toString()"
|
|
||||||
:icon="mdiPrinter3dNozzleOutline"
|
|
||||||
:target="extrudeFactor"
|
|
||||||
:min="1"
|
|
||||||
:max="200"
|
|
||||||
:multi="100"
|
|
||||||
:step="1"
|
|
||||||
:has-input-field="true"
|
|
||||||
command="M221"
|
|
||||||
attribute-name="S"></tool-slider>
|
|
||||||
</v-container>
|
|
||||||
<!-- PRESSURE ADVANCE SETTINGS -->
|
|
||||||
<template v-if="!extruderSteppers.length > 0">
|
|
||||||
<v-divider></v-divider>
|
|
||||||
<pressure-advance-settings></pressure-advance-settings>
|
|
||||||
</template>
|
|
||||||
<v-divider class="pb-1"></v-divider>
|
|
||||||
<!-- EXTRUDER INPUTS AND QUICKSELECTS -->
|
|
||||||
<v-container>
|
|
||||||
<v-row>
|
|
||||||
<v-col>
|
|
||||||
<number-input
|
|
||||||
:label="$t('Panels.ExtruderControlPanel.FilamentLength').toString()"
|
|
||||||
param="feedamount"
|
|
||||||
:target="feedamount"
|
|
||||||
:disabled="isPrinting"
|
|
||||||
:output-error-msg="true"
|
|
||||||
:has-spinner="true"
|
|
||||||
:spinner-factor="100"
|
|
||||||
:step="0.01"
|
|
||||||
:min="0.01"
|
|
||||||
:max="maxExtrudeOnlyDistance"
|
|
||||||
:dec="2"
|
|
||||||
unit="mm"
|
|
||||||
:submit-on-blur="true"
|
|
||||||
@submit="setFeedamount"></number-input>
|
|
||||||
<v-item-group class="_btn-group pt-3">
|
|
||||||
<v-btn
|
|
||||||
v-for="value in feedamountsSorted"
|
|
||||||
:key="value"
|
|
||||||
:disabled="isPrinting"
|
|
||||||
dense
|
|
||||||
class="_btn-qs flex-grow-1 px-0"
|
|
||||||
@click="setFeedamount({ value })">
|
|
||||||
{{ value }}
|
|
||||||
</v-btn>
|
|
||||||
</v-item-group>
|
|
||||||
</v-col>
|
|
||||||
<v-col>
|
|
||||||
<number-input
|
|
||||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFeedrate').toString()"
|
|
||||||
param="feedrate"
|
|
||||||
:target="feedrate"
|
|
||||||
:disabled="isPrinting"
|
|
||||||
:has-spinner="true"
|
|
||||||
:output-error-msg="true"
|
|
||||||
:spinner-factor="100"
|
|
||||||
:step="0.01"
|
|
||||||
:min="0.01"
|
|
||||||
:max="null"
|
|
||||||
:dec="2"
|
|
||||||
type="number"
|
|
||||||
unit="mm/s"
|
|
||||||
@submit="setFeedrate"></number-input>
|
|
||||||
<v-item-group class="_btn-group pt-3">
|
|
||||||
<v-btn
|
|
||||||
v-for="value in feedratesSorted"
|
|
||||||
:key="value"
|
|
||||||
:disabled="isPrinting"
|
|
||||||
dense
|
|
||||||
class="_btn-qs flex-grow-1 px-0"
|
|
||||||
@click="setFeedrate({ value })">
|
|
||||||
{{ value }}
|
|
||||||
</v-btn>
|
|
||||||
</v-item-group>
|
|
||||||
</v-col>
|
|
||||||
<!-- EXTRUDE AND RETRACT BUTTON LARGE SIZED PANEL -->
|
|
||||||
<v-col v-if="el.is.large" class="col-3 d-flex align-center flex-column justify-center">
|
|
||||||
<!-- RETRACT -->
|
|
||||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
|
||||||
<template #activator="{ on }">
|
|
||||||
<div class="mb-4" v-on="on">
|
|
||||||
<v-btn
|
|
||||||
:loading="loadings.includes('btnRetract')"
|
|
||||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
|
||||||
small
|
|
||||||
class="_btn-extruder-cmd"
|
|
||||||
@click="sendRetract()">
|
|
||||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<span v-show="!extrudePossible">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
|
||||||
{{ minExtrudeTemp }} °C
|
|
||||||
</span>
|
|
||||||
<span v-show="tooLargeExtrusion">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
|
||||||
{{ feedamount * extrudeFactor }} mm
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<!-- EXTRUDE -->
|
|
||||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
|
||||||
<template #activator="{ on }">
|
|
||||||
<div v-on="on">
|
|
||||||
<v-btn
|
|
||||||
:loading="loadings.includes('btnDetract')"
|
|
||||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
|
||||||
small
|
|
||||||
class="_btn-extruder-cmd"
|
|
||||||
@click="sendExtrude()">
|
|
||||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<span v-show="!extrudePossible">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
|
||||||
{{ minExtrudeTemp }} °C
|
|
||||||
</span>
|
|
||||||
<span v-show="tooLargeExtrusion">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
|
||||||
{{ feedamount * extrudeFactor }} mm
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<!-- EXTRUDE AND RETRACT BUTTON SMALL AND MEDIUM SIZED PANEL -->
|
|
||||||
<v-row v-if="!el.is.large" :class="{ 'pb-1': !showEstimatedExtrusion }">
|
|
||||||
<v-col class="pa-0">
|
|
||||||
<div class="d-flex justify-space-around">
|
|
||||||
<div class="d-flex align-center">
|
|
||||||
<!-- RETRACT -->
|
|
||||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
|
||||||
<template #activator="{ on }">
|
|
||||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
|
||||||
<v-btn
|
|
||||||
:loading="loadings.includes('btnRetract')"
|
|
||||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
|
||||||
small
|
|
||||||
class="_btn-extruder-cmd"
|
|
||||||
@click="sendRetract()">
|
|
||||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<span v-show="!extrudePossible">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
|
||||||
{{ minExtrudeTemp }} °C
|
|
||||||
</span>
|
|
||||||
<span v-show="tooLargeExtrusion">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
|
||||||
{{ feedamount * extrudeFactor }} mm
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}:
|
|
||||||
{{ maxExtrudeOnlyDistance }} mm
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
<!-- EXTRUDE -->
|
|
||||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
|
||||||
<template #activator="{ on }">
|
|
||||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
|
||||||
<v-btn
|
|
||||||
:loading="loadings.includes('btnDetract')"
|
|
||||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
|
||||||
small
|
|
||||||
class="_btn-extruder-cmd"
|
|
||||||
@click="sendExtrude()">
|
|
||||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
|
||||||
</v-btn>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<span v-show="!extrudePossible">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
|
||||||
{{ minExtrudeTemp }} °C
|
|
||||||
</span>
|
|
||||||
<span v-show="tooLargeExtrusion">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
|
||||||
{{ feedamount * extrudeFactor }} mm
|
|
||||||
<br />
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}:
|
|
||||||
{{ maxExtrudeOnlyDistance }} mm
|
|
||||||
</span>
|
|
||||||
</v-tooltip>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
<!-- EXTRUSION ESTIMATION NOTE -->
|
|
||||||
<v-container v-if="showEstimatedExtrusion" class="pa-0 ma-0 pb-2">
|
|
||||||
<div
|
|
||||||
v-if="filamentDiameter && nozzleDiameter"
|
|
||||||
style="font-size: 0.8em"
|
|
||||||
class="text--disabled text-caption font-weight-light d-flex justify-center">
|
|
||||||
{{ $t('Panels.ExtruderControlPanel.EstimatedExtrusion') }} ~ {{ extrudedLength }} mm @
|
|
||||||
{{ volumetricFlow }} mm³/s
|
|
||||||
</div>
|
|
||||||
</v-container>
|
|
||||||
</template>
|
|
||||||
</responsive>
|
|
||||||
</panel>
|
</panel>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { mdiPrinter3dNozzle, mdiDotsVertical } from '@mdi/js'
|
||||||
mdiArrowDownBold,
|
import { Component, Mixins } from 'vue-property-decorator'
|
||||||
mdiArrowUpBold,
|
import { PrinterStateExtruder, PrinterStateMacro } from '@/store/printer/types'
|
||||||
mdiPrinter3dNozzle,
|
import BaseMixin from '@/components/mixins/base'
|
||||||
mdiPrinter3dNozzleOutline,
|
import ControlMixin from '@/components/mixins/control'
|
||||||
mdiLocationEnter,
|
|
||||||
mdiLocationExit,
|
|
||||||
mdiDotsVertical,
|
|
||||||
} from '@mdi/js'
|
|
||||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
|
||||||
import { PrinterStateExtruder, PrinterStateExtruderStepper, PrinterStateToolchangeMacro } from '@/store/printer/types'
|
|
||||||
import BaseMixin from '../mixins/base'
|
|
||||||
import ControlMixin from '../mixins/control'
|
|
||||||
import NumberInput from '@/components/inputs/NumberInput.vue'
|
|
||||||
import Panel from '@/components/ui/Panel.vue'
|
import Panel from '@/components/ui/Panel.vue'
|
||||||
import PressureAdvanceSettings from '@/components/panels/MachineSettings/PressureAdvanceSettings.vue'
|
import ExtruderMixin from '@/components/mixins/extruder'
|
||||||
import Responsive from '@/components/ui/Responsive.vue'
|
|
||||||
import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
Panel,
|
Panel,
|
||||||
PressureAdvanceSettings,
|
|
||||||
NumberInput,
|
|
||||||
Responsive,
|
|
||||||
ToolSlider,
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin, ExtruderMixin) {
|
||||||
mdiArrowUpBold = mdiArrowUpBold
|
|
||||||
mdiArrowDownBold = mdiArrowDownBold
|
|
||||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||||
mdiPrinter3dNozzleOutline = mdiPrinter3dNozzleOutline
|
|
||||||
mdiLocationEnter = mdiLocationEnter
|
|
||||||
mdiLocationExit = mdiLocationExit
|
|
||||||
mdiDotsVertical = mdiDotsVertical
|
mdiDotsVertical = mdiDotsVertical
|
||||||
|
|
||||||
get isPrinting(): boolean {
|
private heatWaitGcodes = ['printer.extruder.can_extrude', 'TEMPERATURE_WAIT', 'M109']
|
||||||
return ['printing'].includes(this.printer_state)
|
|
||||||
|
get showPanel(): boolean {
|
||||||
|
return this.klipperReadyForGui && this.extruders.length > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
get toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
get macros() {
|
||||||
return this.$store.getters['printer/getToolchangeMacros']
|
return this.$store.getters['printer/getMacros']
|
||||||
}
|
}
|
||||||
|
|
||||||
get filamentChangeMacros(): boolean {
|
get loadFilamentMacro(): PrinterStateMacro | undefined {
|
||||||
let macros: string[] = []
|
const macros = ['LOAD_FILAMENT', 'FILAMENT_LOAD']
|
||||||
this.$store.getters['printer/getMacros'].forEach((m: any) => {
|
|
||||||
if (m.name.toUpperCase().startsWith('LOAD_FILAMENT')) macros.push(m.name)
|
return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase()))
|
||||||
if (m.name.toUpperCase().startsWith('UNLOAD_FILAMENT')) macros.push(m.name)
|
}
|
||||||
})
|
|
||||||
return macros.length === 2
|
get unloadFilamentMacro(): PrinterStateMacro | undefined {
|
||||||
|
const macros = ['UNLOAD_FILAMENT', 'FILAMENT_UNLOAD']
|
||||||
|
|
||||||
|
return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase()))
|
||||||
|
}
|
||||||
|
|
||||||
|
get purgeFilamentMacro(): PrinterStateMacro | undefined {
|
||||||
|
const macros = ['PURGE_FILAMENT', 'FILAMENT_PURGE']
|
||||||
|
|
||||||
|
return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase()))
|
||||||
|
}
|
||||||
|
|
||||||
|
get cleanNozzleMacro(): PrinterStateMacro | undefined {
|
||||||
|
const macros = ['CLEAN_NOZZLE', 'NOZZLE_CLEAN', 'WIPE_NOZZLE', 'NOZZLE_WIPE']
|
||||||
|
|
||||||
|
return this.macros.find((macro: PrinterStateMacro) => macros.includes(macro.name.toUpperCase()))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* test if the load and unload macro include specific keywords. if true, we allow
|
||||||
|
* execution of that macro even if at the current time extrudePossible === false
|
||||||
|
*/
|
||||||
|
get canExecuteLoadMacro(): boolean {
|
||||||
|
if (this.extrudePossible) return true
|
||||||
|
|
||||||
|
return this.heatWaitGcodes.some((gcode) => this.loadFilamentMacro?.prop.gcode.includes(gcode))
|
||||||
|
}
|
||||||
|
|
||||||
|
get canExecuteUnloadMacro(): boolean {
|
||||||
|
if (this.extrudePossible) return true
|
||||||
|
|
||||||
|
return this.heatWaitGcodes.some((gcode) => this.unloadFilamentMacro?.prop.gcode.includes(gcode))
|
||||||
|
}
|
||||||
|
|
||||||
|
get canExecutePurgeMacro(): boolean {
|
||||||
|
if (this.extrudePossible) return true
|
||||||
|
|
||||||
|
return this.heatWaitGcodes.some((gcode) => this.purgeFilamentMacro?.prop.gcode.includes(gcode))
|
||||||
|
}
|
||||||
|
|
||||||
|
get showFilamentMacros(): boolean {
|
||||||
|
return this.loadFilamentMacro !== undefined || this.unloadFilamentMacro !== undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
get extruders(): PrinterStateExtruder[] {
|
get extruders(): PrinterStateExtruder[] {
|
||||||
return this.$store.getters['printer/getExtruders']
|
return this.$store.getters['printer/getExtruders']
|
||||||
}
|
}
|
||||||
|
|
||||||
get extruderSteppers(): PrinterStateExtruderStepper[] {
|
|
||||||
return this.$store.getters['printer/getExtruderSteppers']
|
|
||||||
}
|
|
||||||
|
|
||||||
get activeExtruder(): string {
|
|
||||||
return this.$store.state.printer.toolhead?.extruder
|
|
||||||
}
|
|
||||||
|
|
||||||
get filamentDiameter(): number {
|
|
||||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.filament_diameter ?? 1.75
|
|
||||||
}
|
|
||||||
|
|
||||||
get nozzleDiameter(): number {
|
|
||||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.nozzle_diameter ?? 0.4
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedamounts(): number[] {
|
|
||||||
return this.$store.state.gui.control.extruder?.feedamounts ?? []
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedrates(): number[] {
|
|
||||||
return this.$store.state.gui.control.extruder?.feedrates ?? []
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedamountsSorted(): number[] {
|
|
||||||
return [...this.feedamounts].sort((a, b) => {
|
|
||||||
return b - a
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedratesSorted(): number[] {
|
|
||||||
return [...this.feedrates].sort((a, b) => {
|
|
||||||
return b - a
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedamount(): number {
|
|
||||||
return parseFloat(this.$store.state.gui.control.extruder.feedamount)
|
|
||||||
}
|
|
||||||
|
|
||||||
setFeedamount(params: { value: number }): void {
|
|
||||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamount', value: params.value })
|
|
||||||
}
|
|
||||||
|
|
||||||
get feedrate(): number {
|
|
||||||
return parseFloat(this.$store.state.gui.control.extruder.feedrate)
|
|
||||||
}
|
|
||||||
|
|
||||||
setFeedrate(params: { value: number }): void {
|
|
||||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrate', value: params.value })
|
|
||||||
}
|
|
||||||
|
|
||||||
get extrudePossible(): boolean {
|
|
||||||
return this.$store.getters['printer/getExtrudePossible']
|
|
||||||
}
|
|
||||||
|
|
||||||
get minExtrudeTemp(): number {
|
|
||||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.min_extrude_temp ?? 170
|
|
||||||
}
|
|
||||||
|
|
||||||
get maxExtrudeOnlyDistance(): number {
|
|
||||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.max_extrude_only_distance ?? 50
|
|
||||||
}
|
|
||||||
|
|
||||||
get tooLargeExtrusion(): boolean {
|
|
||||||
return this.feedamount * this.extrudeFactor > this.maxExtrudeOnlyDistance
|
|
||||||
}
|
|
||||||
|
|
||||||
get extrudedLength(): number {
|
|
||||||
return Math.round(this.feedamount * this.extrudeFactor * (this.filamentDiameter / this.nozzleDiameter))
|
|
||||||
}
|
|
||||||
|
|
||||||
get volumetricFlow(): number {
|
|
||||||
return Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * 10) / 10
|
|
||||||
}
|
|
||||||
|
|
||||||
get extrudeFactor() {
|
|
||||||
return this.$store.state.printer?.gcode_move?.extrude_factor ?? 1
|
|
||||||
}
|
|
||||||
|
|
||||||
get showEstimatedExtrusion() {
|
|
||||||
return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
@Watch('maxExtrudeOnlyDistance', { immediate: true })
|
|
||||||
onMaxExtrudeOnlyDistanceChange(): void {
|
|
||||||
/**
|
|
||||||
* If, while switching from ex. A to ex. B, the feedamount
|
|
||||||
* from ex. A exceeds the maxExtrudeOnlyDistance of ex. B,
|
|
||||||
* set the feedamount to maxExtrudeOnlyDistance of ex. B
|
|
||||||
*/
|
|
||||||
if (this.feedamount > this.maxExtrudeOnlyDistance) {
|
|
||||||
this.setFeedamount({ value: this.maxExtrudeOnlyDistance })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sendRetract(): void {
|
|
||||||
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
|
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
||||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
|
|
||||||
}
|
|
||||||
|
|
||||||
sendExtrude(): void {
|
|
||||||
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}`
|
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
||||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
|
|
||||||
}
|
|
||||||
|
|
||||||
sendUnloadFilament(): void {
|
|
||||||
const gcode = 'UNLOAD_FILAMENT'
|
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
||||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnUnloadFilament' })
|
|
||||||
}
|
|
||||||
|
|
||||||
sendLoadFilament(): void {
|
|
||||||
const gcode = 'LOAD_FILAMENT'
|
|
||||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
|
||||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnLoadFilament' })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
Loaded 100 of 337 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user