Compare commits
180
Commits
v2.2.0-beta4
...
v2.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
4c7ec84420 | ||
|
|
e251d3cfe0 | ||
|
|
87a98543eb | ||
|
|
8f843e42b1 | ||
|
|
ae68b490ac | ||
|
|
8adfb0fdd3 | ||
|
|
1c706b0725 | ||
|
|
a6c09bc937 | ||
|
|
76c04beb4d | ||
|
|
0f279eb60d | ||
|
|
e7b281739b | ||
|
|
5f8f0469e0 | ||
|
|
07db82a269 | ||
|
|
5c536b18ec | ||
|
|
ceb03862a5 | ||
|
|
cc5c15fc90 | ||
|
|
3d3f29223b | ||
|
|
1ed67b41ab | ||
|
|
0551ea39e7 | ||
|
|
80206d7b4a | ||
|
|
9f4fb30b98 | ||
|
|
8b4d534e86 | ||
|
|
edd97e0773 | ||
|
|
78ac2bb0d2 | ||
|
|
2113eae8fe | ||
|
|
4671935491 | ||
|
|
4be40b6457 | ||
|
|
e0fd25cd90 | ||
|
|
b6f0020d77 | ||
|
|
eb0f157fee | ||
|
|
1370e089ef | ||
|
|
02e9b2c9a1 | ||
|
|
d85a072a39 | ||
|
|
a5a7d05460 | ||
|
|
132a0d34d3 | ||
|
|
359b20e75d | ||
|
|
ebf74860f4 |
No files matched your search
@@ -7,8 +7,8 @@ VUE_APP_PORT=7125
|
||||
# reconnect interval in ms
|
||||
VUE_APP_RECONNECT_INTERVAL=5000
|
||||
|
||||
# remote mode
|
||||
VUE_APP_REMOTE_MODE=false
|
||||
# where should mainsail read the instances from (moonraker, browser or json)
|
||||
VUE_APP_INSTANCES_DB="moonraker"
|
||||
|
||||
# defaults for multi language tests
|
||||
VUE_APP_I18N_LOCALE=en
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"rules": {
|
||||
"vue/no-v-html": 0,
|
||||
"vue/component-tags-order": 0,
|
||||
"vue/no-v-text-v-html-on-component": 0,
|
||||
"vue/valid-v-slot": [
|
||||
"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)
|
||||
|
||||
---
|
||||
- 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
|
||||
id: browser
|
||||
attributes:
|
||||
|
||||
@@ -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@v3
|
||||
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: '16'
|
||||
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/**}'
|
||||
@@ -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@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- 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 "::set-output name=$file::|${file##*/}|${MISSING}|${UNUSED}|"
|
||||
done
|
||||
- name: Comment PR
|
||||
uses: thollander/actions-comment-pull-request@v1
|
||||
with:
|
||||
message: |
|
||||
Language file analysis report:
|
||||
|File|Missing Keys|Unused Keys|
|
||||
|:---|---:|---:|
|
||||
${{join(steps.i18n-extract.outputs.*, '
|
||||
')}}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -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@v2
|
||||
@@ -5,6 +5,9 @@ on:
|
||||
branches: ['master', 'develop']
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
@@ -37,7 +40,6 @@ jobs:
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
|
||||
type=edge,branch=develop
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
@@ -47,7 +49,7 @@ jobs:
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
@@ -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.*
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -28,6 +28,6 @@ jobs:
|
||||
run: npm run build
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v2
|
||||
uses: cypress-io/github-action@v4
|
||||
with:
|
||||
start: npm start
|
||||
start: npm run preview
|
||||
@@ -14,5 +14,6 @@ package-lock.json
|
||||
*.local
|
||||
.env
|
||||
|
||||
cypress/screenshots/
|
||||
cypress/videos/
|
||||
components.d.ts
|
||||
+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)
|
||||
- [Issue Reporting Guidelines](#issue-reporting-guidelines)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Code of Conduct](https://github.com/mainsail-crew/mainsail/blob/develop/.github/CODE_OF_CONDUCT.md)
|
||||
- [Question or Problem?](#question)
|
||||
- [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:
|
||||
- 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.
|
||||
### <a name="submit-issue"></a> Submitting an Issue
|
||||
|
||||
## 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/development/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)
|
||||
- [One-time donation via Ko-Fi](https://ko-fi.com/mainsail)
|
||||
- You can also add `fix #<id>` or `fixes #<id>` in the PR body where `<id>` is the issue id.
|
||||
- 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
|
||||
#
|
||||
FROM node:16-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM node:18-alpine as builder
|
||||
|
||||
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_
|
||||
- **Powerful Macro-Management:** _Manage your macros on a micro level_
|
||||
- **[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_
|
||||
- **Exclude Objects:** _Exclude parts of your print <sup>(not officially supported by Klipper yet)</sup>_
|
||||
|
||||
|
||||
@@ -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.
+1
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body style="background-color: #121212">
|
||||
<noscript>
|
||||
<strong>
|
||||
We're sorry but Mainsail doesn't work properly without JavaScript enabled. Please enable it to continue.
|
||||
|
||||
Generated
+4708
-3798
File diff suppressed because it is too large.
Load diff
+34
-32
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "2.2.0-beta4",
|
||||
"version": "2.4.0",
|
||||
"private": true,
|
||||
"decription": "a klipper web interface",
|
||||
"author": {
|
||||
@@ -14,28 +14,30 @@
|
||||
"format:check": "npm run format:base -- --check",
|
||||
"lint": "eslint --ignore-path .gitignore src",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"build.zip": "cd ./dist && zip -r mainsail.zip ./ && cd ..",
|
||||
"build.zip": "cd ./dist && zip -r mainsail.zip ./ -x '**.DS_Store' ./ && cd ..",
|
||||
"i18n-extract": "vue-i18n-extract use-config",
|
||||
"start": "vite preview",
|
||||
"test": "npm run build && cypress run",
|
||||
"preview": "vite preview",
|
||||
"start": "vite build && vite preview",
|
||||
"test": "start-server-and-test preview http://127.0.0.1:4173/ 'cypress run'",
|
||||
"test:ui": "cypress open",
|
||||
"changelog": "git cliff v0.0.4..$(git describe --tags $(git rev-list --tags --max-count=1)) --output CHANGELOG.md"
|
||||
},
|
||||
"dependencies": {
|
||||
"@codemirror/basic-setup": "^0.19.0",
|
||||
"@codemirror/highlight": "^0.19.6",
|
||||
"@codemirror/lang-javascript": "^0.19.3",
|
||||
"@codemirror/lang-json": "^0.19.1",
|
||||
"@codemirror/language": "^0.19.7",
|
||||
"@codemirror/legacy-modes": "^0.19.0",
|
||||
"@codemirror/search": "^0.19.4",
|
||||
"@codemirror/state": "^0.19.6",
|
||||
"@codemirror/stream-parser": "^0.19.2",
|
||||
"@codemirror/view": "^0.19.28",
|
||||
"@sindarius/gcodeviewer": "^2.1.17",
|
||||
"@types/node": "^16.11.22",
|
||||
"@codemirror/commands": "^6.0.1",
|
||||
"@codemirror/lang-css": "^6.0.0",
|
||||
"@codemirror/lang-json": "^6.0.0",
|
||||
"@codemirror/language": "^6.2.0",
|
||||
"@codemirror/legacy-modes": "^6.1.0",
|
||||
"@codemirror/search": "^6.0.0",
|
||||
"@codemirror/state": "^6.1.0",
|
||||
"@codemirror/view": "^6.0.3",
|
||||
"@jaames/iro": "^5.5.2",
|
||||
"@lezer/highlight": "^1.0.0",
|
||||
"@sindarius/gcodeviewer": "^3.1.4",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/overlayscrollbars": "^1.12.1",
|
||||
"axios": "^0.26.0",
|
||||
"axios": "^0.27.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"core-js": "^3.16.0",
|
||||
"echarts": "^5.2.2",
|
||||
"echarts-gl": "^2.0.8",
|
||||
@@ -47,8 +49,8 @@
|
||||
"regenerator-runtime": "^0.13.9",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"semver": "^7.3.5",
|
||||
"uuid": "^8.3.2",
|
||||
"vue": "^2.6.14",
|
||||
"uuid": "^9.0.0",
|
||||
"vue": "^2.7.10",
|
||||
"vue-class-component": "^7.2.6",
|
||||
"vue-echarts": "^6.0.2",
|
||||
"vue-i18n": "^8.25.0",
|
||||
@@ -59,37 +61,37 @@
|
||||
"vue-resize": "^1.0.1",
|
||||
"vue-toast-notification": "^0.6.1",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuetify": "^2.6.1",
|
||||
"vuetify": "^2.6.10",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@intlify/vite-plugin-vue-i18n": "^2.5.0",
|
||||
"@mdi/js": "^6.5.95",
|
||||
"@mdi/js": "^7.0.0",
|
||||
"@types/lodash.kebabcase": "^4.1.6",
|
||||
"@types/lodash.throttle": "^4.1.6",
|
||||
"@types/semver": "^7.3.8",
|
||||
"@types/uuid": "^8.3.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"@vue/composition-api": "^1.4.6",
|
||||
"@vue/eslint-config-typescript": "^10.0.0",
|
||||
"@vue/eslint-config-typescript": "^11.0.0",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"cypress": "^9.5.0",
|
||||
"cypress": "^10.0.0",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-jsonc": "^2.2.1",
|
||||
"eslint-plugin-vue": "^8.4.1",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"prettier": "^2.5.1",
|
||||
"sass": "~1.32",
|
||||
"start-server-and-test": "^1.14.0",
|
||||
"typescript": "^4.5.5",
|
||||
"unplugin-vue-components": "^0.18.0",
|
||||
"vite": "^2.7.13",
|
||||
"vite-plugin-checker": "^0.4.2",
|
||||
"unplugin-vue-components": "^0.22.0",
|
||||
"vite": "^3.0.0",
|
||||
"vite-plugin-checker": "^0.5.0",
|
||||
"vite-plugin-package-version": "^1.0.2",
|
||||
"vite-plugin-pwa": "^0.11.13",
|
||||
"vite-plugin-vue2": "^1.9.3",
|
||||
"vite-plugin-pwa": "^0.13.0",
|
||||
"vite-plugin-vue2": "^2.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-template-compiler": "^2.6.14",
|
||||
"workbox-core": "^6.4.2"
|
||||
@@ -110,6 +112,6 @@
|
||||
"last 2 edge major versions"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^16"
|
||||
"node": "^16 || ^18"
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -1,3 +1,7 @@
|
||||
{
|
||||
|
||||
"defaultLocale": "en",
|
||||
"hostname": null,
|
||||
"port": null,
|
||||
"instancesDB": "moonraker",
|
||||
"instances": []
|
||||
}
|
||||
+18
-16
@@ -21,31 +21,29 @@
|
||||
/*noinspection CssUnresolvedCustomProperty*/
|
||||
color: var(--v-btn-text-primary);
|
||||
}
|
||||
|
||||
.main-content-scrollbar {
|
||||
height: calc(var(--app-height) - 48px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-app dark :style="cssVars">
|
||||
<the-sidebar></the-sidebar>
|
||||
<the-topbar></the-topbar>
|
||||
<template v-if="socketIsConnected && guiIsReady">
|
||||
<the-sidebar></the-sidebar>
|
||||
<the-topbar></the-topbar>
|
||||
|
||||
<v-main id="content" :style="mainStyle">
|
||||
<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">
|
||||
<router-view></router-view>
|
||||
</v-container>
|
||||
</overlay-scrollbars>
|
||||
</v-main>
|
||||
<the-select-printer-dialog v-if="remoteMode"></the-select-printer-dialog>
|
||||
</v-main>
|
||||
<the-update-dialog></the-update-dialog>
|
||||
<the-editor></the-editor>
|
||||
<the-timelapse-rendering-snackbar></the-timelapse-rendering-snackbar>
|
||||
<the-fullscreen-upload></the-fullscreen-upload>
|
||||
<the-upload-snackbar></the-upload-snackbar>
|
||||
<the-manual-probe-dialog />
|
||||
<the-bed-screws-dialog />
|
||||
</template>
|
||||
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'"></the-select-printer-dialog>
|
||||
<the-connecting-dialog v-else></the-connecting-dialog>
|
||||
<the-update-dialog></the-update-dialog>
|
||||
<the-editor></the-editor>
|
||||
<the-timelapse-rendering-snackbar></the-timelapse-rendering-snackbar>
|
||||
<the-fullscreen-upload></the-fullscreen-upload>
|
||||
<the-upload-snackbar></the-upload-snackbar>
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
@@ -63,6 +61,8 @@ import { panelToolbarHeight, topbarHeight, navigationItemHeight } from '@/store/
|
||||
import TheTimelapseRenderingSnackbar from '@/components/TheTimelapseRenderingSnackbar.vue'
|
||||
import TheFullscreenUpload from '@/components/TheFullscreenUpload.vue'
|
||||
import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue'
|
||||
import TheManualProbeDialog from '@/components/dialogs/TheManualProbeDialog.vue'
|
||||
import TheBedScrewsDialog from '@/components/dialogs/TheBedScrewsDialog.vue'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -75,6 +75,8 @@ import TheUploadSnackbar from '@/components/TheUploadSnackbar.vue'
|
||||
TheSidebar,
|
||||
TheFullscreenUpload,
|
||||
TheUploadSnackbar,
|
||||
TheManualProbeDialog,
|
||||
TheBedScrewsDialog,
|
||||
},
|
||||
metaInfo() {
|
||||
const title = this.$store.getters['getTitle']
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
html {
|
||||
overflow: auto;
|
||||
scrollbar-color: #6b6b6b #272727;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -58,3 +59,21 @@ body {
|
||||
.settings-tabs .v-window {
|
||||
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;
|
||||
}
|
||||
@@ -31,4 +31,5 @@ $t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStart')
|
||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceRestart')
|
||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.ServiceStop')
|
||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostReboot')
|
||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostShutdown')
|
||||
$t('App.TopCornerMenu.ConfirmationDialog.Description.HostShutdown')
|
||||
$t('Editor.Uploading')
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-dialog v-model="isOpen" transition="dialog-bottom-transition" max-width="600" scrollable :fullscreen="isMobile">
|
||||
<v-dialog v-model="isOpen" transition="dialog-bottom-transition" max-width="600" :fullscreen="isMobile">
|
||||
<template #activator="{ on, attrs }">
|
||||
<template v-if="inToolbar">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
@@ -42,7 +42,7 @@
|
||||
</v-row>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<overlay-scrollbars :class="'command-help-content ' + (isMobile ? '' : 'height300')">
|
||||
<overlay-scrollbars class="command-help-content" :class="isMobile ? 'mobileHeight' : 'height300'">
|
||||
<v-card-text class="pt-0">
|
||||
<v-row>
|
||||
<v-col>
|
||||
@@ -131,5 +131,9 @@ export default class CommandHelpModal extends Mixins(BaseMixin) {
|
||||
&.height300 {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
&.mobileHeight {
|
||||
height: calc(var(--app-height) - 48px - 73px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -7,20 +7,11 @@
|
||||
<v-toolbar-title>
|
||||
<span class="subheading">
|
||||
<v-icon left>{{ mdiConnection }}</v-icon>
|
||||
<template v-if="connectingFailed">
|
||||
{{ $t('ConnectionDialog.Failed', { host: formatHostname }) }}
|
||||
</template>
|
||||
<template v-else-if="isConnecting">
|
||||
{{ $t('ConnectionDialog.Connecting', { host: formatHostname }) }}
|
||||
</template>
|
||||
<template v-else>{{ formatHostname }}</template>
|
||||
{{ titleText }}
|
||||
</span>
|
||||
</v-toolbar-title>
|
||||
</v-toolbar>
|
||||
<v-card-text v-if="isConnecting" 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">
|
||||
<v-card-text v-if="connectingFailed" class="pt-5">
|
||||
<connection-status :moonraker="false"></connection-status>
|
||||
<p class="text-center mt-3">{{ $t('ConnectionDialog.CannotConnectTo', { host: formatHostname }) }}</p>
|
||||
<template v-if="counter > 2">
|
||||
@@ -36,6 +27,9 @@
|
||||
<v-btn class="primary--text" @click="reconnect">{{ $t('ConnectionDialog.TryAgain') }}</v-btn>
|
||||
</div>
|
||||
</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-dialog>
|
||||
</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
|
||||
}
|
||||
|
||||
get isConnected() {
|
||||
return this.$store.state.socket.isConnected
|
||||
}
|
||||
|
||||
get isConnecting() {
|
||||
return this.$store.state.socket.isConnecting
|
||||
}
|
||||
@@ -86,7 +76,15 @@ export default class TheConnectingDialog extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
<style scoped></style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog
|
||||
@@ -19,7 +17,7 @@
|
||||
v-if="restartServiceName === 'klipper'"
|
||||
text
|
||||
tile
|
||||
href="https://www.klipper3d.org/Config_Reference.html"
|
||||
:href="klipperConfigReference"
|
||||
target="_blank"
|
||||
class="d-none d-md-flex">
|
||||
<v-icon small class="mr-1">{{ mdiHelp }}</v-icon>
|
||||
@@ -35,7 +33,7 @@
|
||||
<span class="d-none d-sm-inline">{{ $t('Editor.SaveClose') }}</span>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="restartServiceName !== null"
|
||||
v-if="restartServiceNameExists"
|
||||
color="primary"
|
||||
text
|
||||
tile
|
||||
@@ -49,14 +47,12 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text class="pa-0">
|
||||
<overlay-scrollbars style="height: calc(var(--app-height) - 48px)" :options="scrollbarOptions">
|
||||
<codemirror-async
|
||||
v-if="show"
|
||||
ref="editor"
|
||||
v-model="sourcecode"
|
||||
:name="filename"
|
||||
:file-extension="fileExtension"></codemirror-async>
|
||||
</overlay-scrollbars>
|
||||
<codemirror-async
|
||||
v-if="show"
|
||||
ref="editor"
|
||||
v-model="sourcecode"
|
||||
:name="filename"
|
||||
:file-extension="fileExtension"></codemirror-async>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
@@ -112,7 +108,7 @@
|
||||
<v-btn text color="primary" @click="save">
|
||||
{{ $t('Editor.SaveClose') }}
|
||||
</v-btn>
|
||||
<template v-if="restartServiceName != null">
|
||||
<template v-if="restartServiceNameExists">
|
||||
<v-btn text color="primary" @click="save(restartServiceName)">
|
||||
{{ $t('Editor.SaveRestart') }}
|
||||
</v-btn>
|
||||
@@ -126,8 +122,9 @@
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
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 { availableKlipperConfigReferenceTranslations } from '@/store/variables'
|
||||
import CodemirrorAsync from '@/components/inputs/CodemirrorAsync'
|
||||
import {
|
||||
mdiClose,
|
||||
@@ -187,6 +184,12 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
||||
return this.$store.state.editor.filename ?? ''
|
||||
}
|
||||
|
||||
get filenameWithoutExtension(): string {
|
||||
if (this.filename.lastIndexOf('.')) return this.filename.slice(0, this.filename.lastIndexOf('.'))
|
||||
|
||||
return this.filename
|
||||
}
|
||||
|
||||
get fileExtension() {
|
||||
if (this.filename.lastIndexOf('.')) return this.filename.slice(this.filename.lastIndexOf('.') + 1)
|
||||
|
||||
@@ -222,28 +225,41 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get snackbarHeadline() {
|
||||
let directionUppercase = this.$t('Files.Downloading')
|
||||
if (this.loaderProgress.direction) {
|
||||
directionUppercase =
|
||||
this.loaderProgress.direction?.charAt(0).toUpperCase() + this.loaderProgress.direction?.slice(1)
|
||||
}
|
||||
let directionUppercase = this.$t('Editor.Downloading')
|
||||
if (this.loaderProgress.direction) directionUppercase = capitalize(this.loaderProgress.direction)
|
||||
|
||||
return this.$t('Editor.' + directionUppercase)
|
||||
return this.$t(`Editor.${directionUppercase}`)
|
||||
}
|
||||
|
||||
get availableServices() {
|
||||
return this.$store.state.server.system_info?.available_services ?? []
|
||||
}
|
||||
|
||||
get restartServiceName() {
|
||||
if (!this.isWriteable) return null
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return null
|
||||
|
||||
if (this.filename === 'moonraker.conf') return 'moonraker'
|
||||
else if (this.filename === 'webcam.conf') return 'webcamd'
|
||||
else if (this.filename.startsWith('webcam') && this.filename.endsWith('.txt')) return 'webcamd'
|
||||
else if (this.filename.startsWith('mooncord') && this.filename.endsWith('.json')) return 'mooncord'
|
||||
else if (this.filename.endsWith('.cfg')) return 'klipper'
|
||||
if (this.availableServices.includes(this.filenameWithoutExtension) && this.fileExtension === 'conf')
|
||||
return this.filenameWithoutExtension
|
||||
if (this.filename.startsWith('webcam') && ['conf', 'txt'].includes(this.fileExtension)) return 'webcamd'
|
||||
if (this.filename.startsWith('mooncord') && this.fileExtension === 'json') return 'mooncord'
|
||||
if (this.filename === 'moonraker.conf') return this.moonrakerRestartInstance ?? 'moonraker'
|
||||
|
||||
if (this.fileExtension === 'cfg') return 'klipper'
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get restartServiceNameExists() {
|
||||
if (this.restartServiceName) return true
|
||||
|
||||
return this.availableServices.includes(this.restartServiceName)
|
||||
}
|
||||
|
||||
get moonrakerRestartInstance() {
|
||||
return this.$store.state.gui.editor.moonrakerRestartInstance
|
||||
}
|
||||
|
||||
get confirmUnsavedChanges() {
|
||||
return this.$store.state.gui.editor.confirmUnsavedChanges ?? false
|
||||
}
|
||||
@@ -260,6 +276,22 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
||||
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() {
|
||||
this.$store.dispatch('editor/cancelLoad')
|
||||
}
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="isConnecting">
|
||||
<template v-if="isConnecting || (isConnected && !guiIsReady)">
|
||||
<v-card-text>
|
||||
<v-progress-linear color="primary" indeterminate></v-progress-linear>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<template v-else-if="!isConnecting && connectingFailed">
|
||||
<template v-else-if="connectingFailed">
|
||||
<v-card-text>
|
||||
<p>
|
||||
{{
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
</v-card-text>
|
||||
</template>
|
||||
<template v-else-if="!isConnecting && dialogAddPrinter.bool">
|
||||
<template v-else-if="dialogAddPrinter.bool">
|
||||
<v-form v-model="addPrinterValid" @submit.prevent="addPrinter">
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
@@ -92,7 +92,7 @@
|
||||
</v-card-actions>
|
||||
</v-form>
|
||||
</template>
|
||||
<template v-else-if="!isConnecting && dialogEditPrinter.bool">
|
||||
<template v-else-if="dialogEditPrinter.bool">
|
||||
<v-form v-model="editPrinterValid" @submit.prevent="updatePrinter">
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
@@ -173,29 +173,38 @@
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="showCorsInfo">
|
||||
<v-col>
|
||||
<p v-if="printers.length === 0" class="text-center">
|
||||
{{ $t('SelectPrinterDialog.Hello') }}
|
||||
</p>
|
||||
<p class="text-center">
|
||||
{{ $t('SelectPrinterDialog.RememberToAdd', { cors: currentUrl }) }}
|
||||
</p>
|
||||
<p class="text-center mb-0">
|
||||
{{ $t('SelectPrinterDialog.YouCanFindMore') }}
|
||||
<br />
|
||||
<a href="https://docs.mainsail.xyz/remotemode" target="_blank">
|
||||
https://docs.mainsail.xyz/remotemode
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="canAddPrinters">
|
||||
<template v-if="instancesDB === 'browser'">
|
||||
<v-row v-if="showCorsInfo">
|
||||
<v-col>
|
||||
<p v-if="printers.length === 0" class="text-center">
|
||||
{{ $t('SelectPrinterDialog.Hello') }}
|
||||
</p>
|
||||
<p class="text-center">
|
||||
{{ $t('SelectPrinterDialog.RememberToAdd', { cors: currentUrl }) }}
|
||||
</p>
|
||||
<p class="text-center mb-0">
|
||||
{{ $t('SelectPrinterDialog.YouCanFindMore') }}
|
||||
<br />
|
||||
<a href="https://docs.mainsail.xyz/remotemode" target="_blank">
|
||||
https://docs.mainsail.xyz/remotemode
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</v-col>
|
||||
</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-btn text color="primary" @click="createPrinter">
|
||||
{{ $t('SelectPrinterDialog.AddPrinter') }}
|
||||
</v-btn>
|
||||
<p class="text-center">
|
||||
{{ $t('SelectPrinterDialog.AddPrintersToJson') }}
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
@@ -254,7 +263,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get canAddPrinters() {
|
||||
return this.$store.state.configInstances.length === 0
|
||||
return this.instancesDB !== 'json'
|
||||
}
|
||||
|
||||
get protocol() {
|
||||
@@ -290,7 +299,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get showDialog() {
|
||||
return !this.isConnected
|
||||
return !this.isConnected || (this.isConnected && !this.guiIsReady)
|
||||
}
|
||||
|
||||
get currentUrl() {
|
||||
@@ -316,6 +325,7 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
|
||||
if (this.dialogAddPrinter.bool) return this.$t('SelectPrinterDialog.AddPrinter')
|
||||
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.isConnected && !this.guiIsReady) return this.$t('ConnectionDialog.Initializing')
|
||||
else if (this.connectingFailed)
|
||||
return this.$t('SelectPrinterDialog.ConnectionFailed', { host: this.formatHostname })
|
||||
else return this.$t('SelectPrinterDialog.SelectPrinter')
|
||||
|
||||
@@ -97,7 +97,9 @@ import {
|
||||
mdiTune,
|
||||
mdiVideo3d,
|
||||
mdiWebcam,
|
||||
mdiDipSwitch,
|
||||
} from '@mdi/js'
|
||||
import SettingsMiscellaneousTab from '@/components/settings/SettingsMiscellaneousTab.vue'
|
||||
@Component({
|
||||
components: {
|
||||
Panel,
|
||||
@@ -113,6 +115,7 @@ import {
|
||||
SettingsGCodeViewerTab,
|
||||
SettingsEditorTab,
|
||||
SettingsTimelapseTab,
|
||||
SettingsMiscellaneousTab,
|
||||
},
|
||||
})
|
||||
export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
||||
@@ -186,6 +189,11 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
||||
name: 'editor',
|
||||
title: this.$t('Settings.EditorTab.Editor'),
|
||||
},
|
||||
{
|
||||
icon: mdiDipSwitch,
|
||||
name: 'miscellaneous',
|
||||
title: this.$t('Settings.MiscellaneousTab.Miscellaneous'),
|
||||
},
|
||||
]
|
||||
|
||||
if (this.moonrakerComponents.includes('timelapse')) {
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
<template #append>
|
||||
<v-list-item class="small-list-item mb-2">
|
||||
<v-list-item-icon class="menu-item-icon">
|
||||
<about-modal></about-modal>
|
||||
<about-dialog></about-dialog>
|
||||
</v-list-item-icon>
|
||||
</v-list-item>
|
||||
</template>
|
||||
@@ -144,7 +144,7 @@ import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { PrinterStateKlipperConfig } from '@/store/printer/types'
|
||||
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 MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||
import { mdiViewDashboardOutline } from '@mdi/js'
|
||||
@@ -152,7 +152,7 @@ import { mdiViewDashboardOutline } from '@mdi/js'
|
||||
@Component({
|
||||
components: {
|
||||
TheSelectPrinterDialog,
|
||||
AboutModal,
|
||||
AboutDialog,
|
||||
MainsailLogo,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,27 +1,3 @@
|
||||
<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>
|
||||
<div>
|
||||
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
|
||||
@@ -50,7 +26,7 @@
|
||||
<input
|
||||
ref="fileUploadAndStart"
|
||||
type="file"
|
||||
:accept="validGcodeExtensions.join(', ')"
|
||||
:accept="gcodeInputFileAccept.join(', ')"
|
||||
style="display: none"
|
||||
@change="uploadAndStart" />
|
||||
<v-btn
|
||||
@@ -67,11 +43,7 @@
|
||||
<span class="d-none d-md-inline">{{ $t('App.TopBar.SAVE_CONFIG') }}</span>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="
|
||||
klippyIsConnected &&
|
||||
['standby', 'complete', 'cancelled'].includes(printer_state) &&
|
||||
!boolHideUploadAndPrintButton
|
||||
"
|
||||
v-if="boolShowUploadAndPrint"
|
||||
tile
|
||||
:icon="$vuetify.breakpoint.smAndDown"
|
||||
:text="$vuetify.breakpoint.mdAndUp"
|
||||
@@ -202,6 +174,12 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
fileUploadAndStart: HTMLFormElement
|
||||
}
|
||||
|
||||
get gcodeInputFileAccept() {
|
||||
if (this.isIOS) return []
|
||||
|
||||
return validGcodeExtensions
|
||||
}
|
||||
|
||||
get naviDrawer() {
|
||||
return this.$store.state.naviDrawer
|
||||
}
|
||||
@@ -210,10 +188,6 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('setNaviDrawer', newVal)
|
||||
}
|
||||
|
||||
get validGcodeExtensions() {
|
||||
return validGcodeExtensions
|
||||
}
|
||||
|
||||
get currentPage() {
|
||||
return this.$route.fullPath
|
||||
}
|
||||
@@ -248,6 +222,15 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
return this.$store.state.gui.uiSettings.logo
|
||||
}
|
||||
|
||||
get boolShowUploadAndPrint() {
|
||||
return (
|
||||
this.klippyIsConnected &&
|
||||
this.existGcodesRootDirectory &&
|
||||
['standby', 'complete', 'cancelled'].includes(this.printer_state) &&
|
||||
!this.boolHideUploadAndPrintButton
|
||||
)
|
||||
}
|
||||
|
||||
btnEmergencyStop() {
|
||||
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
|
||||
if (confirmOnEmergencyStop) {
|
||||
@@ -344,3 +327,27 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<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>
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-snackbar v-if="show" :timeout="-1" :value="true" fixed right bottom dark>
|
||||
<span v-if="maxNumber > 1" class="mr-1">({{ currentNumber }}/{{ maxNumber }})</span>
|
||||
<strong>{{ $t('Files.Uploading') + ' ' + filename }}</strong>
|
||||
<strong>{{ $t('Editor.Uploading') + ' ' + filename }}</strong>
|
||||
<br />
|
||||
{{ percent }} % @ {{ speed }}/s
|
||||
<br />
|
||||
|
||||
@@ -13,7 +13,7 @@ import Component from 'vue-class-component'
|
||||
import { Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
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'
|
||||
|
||||
@Component({
|
||||
@@ -80,7 +80,7 @@ export default class HistoryAllPrintStatus extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get chart(): ECharts | null {
|
||||
return this.$refs.historyAllPrintStatus ?? null
|
||||
return this.$refs.historyAllPrintStatus?.chart ?? null
|
||||
}
|
||||
|
||||
mounted() {
|
||||
|
||||
@@ -110,7 +110,7 @@ export default class HistoryPrinttimeAvg extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get chart(): ECharts | null {
|
||||
return this.$refs.historyFilamentUsage ?? null
|
||||
return this.$refs.historyFilamentUsage?.chart ?? null
|
||||
}
|
||||
|
||||
mounted() {
|
||||
|
||||
@@ -95,7 +95,7 @@ export default class HistoryPrinttimeAvg extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get chart(): ECharts | null {
|
||||
return this.$refs.historyPrinttimeAvg ?? null
|
||||
return this.$refs.historyPrinttimeAvg?.chart ?? null
|
||||
}
|
||||
|
||||
mounted() {
|
||||
|
||||
@@ -16,7 +16,7 @@ import BaseMixin from '../mixins/base'
|
||||
import { PrinterTempHistoryStateSerie, PrinterTempHistoryStateSourceEntry } from '@/store/printer/tempHistory/types'
|
||||
|
||||
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'
|
||||
|
||||
interface echartsTooltipObj {
|
||||
@@ -27,8 +27,6 @@ interface echartsTooltipObj {
|
||||
components: {},
|
||||
})
|
||||
export default class TempChart extends Mixins(BaseMixin) {
|
||||
convertName = convertName
|
||||
|
||||
declare $refs: {
|
||||
tempchart: any
|
||||
}
|
||||
@@ -86,6 +84,7 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
margin: 10,
|
||||
formatter: this.timeFormat,
|
||||
},
|
||||
},
|
||||
yAxis: [
|
||||
@@ -196,7 +195,7 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get chart(): ECharts | null {
|
||||
return this.$refs.tempchart ?? null
|
||||
return this.$refs.tempchart?.chart ?? null
|
||||
}
|
||||
|
||||
get maxHistory() {
|
||||
@@ -227,8 +226,13 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
return this.$store.getters['printer/tempHistory/getSelectedLegends']
|
||||
}
|
||||
|
||||
get timeFormat() {
|
||||
return this.hours12Format ? '{hh}:{mm}' : '{HH}:{mm}'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.initChart()
|
||||
this.chartOptions.xAxis.axisLabel.formatter = this.timeFormat
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
@@ -385,5 +389,10 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
boolDisplayPwmAxisChanged() {
|
||||
this.updateChartPwmAxis()
|
||||
}
|
||||
|
||||
@Watch('hours12Format')
|
||||
hours12FormatChanged() {
|
||||
this.chartOptions.xAxis.axisLabel.formatter = this.timeFormat
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<template>
|
||||
<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
|
||||
:class="colorConsoleMessage(event) + ' ' + 'console-message'"
|
||||
@click.capture="commandClick"
|
||||
@@ -35,12 +35,12 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import Vue from 'vue'
|
||||
import { Prop } from 'vue-property-decorator'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import { ServerStateEvent } from '@/store/server/types'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class ConsoleTableEntry extends Vue {
|
||||
export default class ConsoleTableEntry extends Mixins(BaseMixin) {
|
||||
@Prop({ required: true })
|
||||
declare readonly event: ServerStateEvent
|
||||
|
||||
@@ -48,6 +48,10 @@ export default class ConsoleTableEntry extends Vue {
|
||||
return this.$store.state.gui.console.entryStyle ?? 'default'
|
||||
}
|
||||
|
||||
get entryFormatTime() {
|
||||
return this.formatTime(this.event.date.getTime(), true)
|
||||
}
|
||||
|
||||
colorConsoleMessage(item: ServerStateEvent): string {
|
||||
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,170 @@
|
||||
<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() {
|
||||
const is_active = this.$store.state.printer.bed_screws?.is_active ?? false
|
||||
|
||||
return is_active && this.homedAxes.includes('xyz')
|
||||
}
|
||||
|
||||
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 lang="scss" scoped></style>
|
||||
@@ -0,0 +1,222 @@
|
||||
<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-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() {
|
||||
return this.$store.state.printer.manual_probe?.is_active ?? false
|
||||
}
|
||||
|
||||
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 lang="scss" 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>
|
||||
@@ -1,67 +1,6 @@
|
||||
<!-- Because the viewer lives outside of the components DOM it can't be scoped -->
|
||||
<style>
|
||||
.viewer {
|
||||
width: 100%;
|
||||
height: calc(var(--app-height) - 266px);
|
||||
border: 1px solid #3f3f3f;
|
||||
}
|
||||
|
||||
.slider-autoheight,
|
||||
.slider-autoheight .v-slider {
|
||||
height: calc(var(--app-height) - 286px);
|
||||
}
|
||||
|
||||
@media (min-width: 600px) and (max-width: 959px) {
|
||||
.viewer {
|
||||
height: calc(var(--app-height) - 318px);
|
||||
}
|
||||
.slider-autoheight,
|
||||
.slider-autoheight .v-slider {
|
||||
height: calc(var(--app-height) - 338px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 599px) {
|
||||
.viewer {
|
||||
height: calc(var(--app-height) - 356px);
|
||||
}
|
||||
.slider-autoheight,
|
||||
.slider-autoheight .v-slider {
|
||||
height: calc(var(--app-height) - 376px);
|
||||
}
|
||||
}
|
||||
|
||||
.slider-autoheight .v-slider {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.slider-autoheight .v-input__slot {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.progress-text {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
position: absolute;
|
||||
width: 80.5%;
|
||||
}
|
||||
|
||||
.disable-transition {
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
.gcode-viewer-panel {
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel :title="$t('GCodeViewer.Title')" :icon="mdiVideo3d" card-class="gcode-viewer-panel">
|
||||
<panel :title="panelTitle" :icon="mdiVideo3d" card-class="gcode-viewer-panel" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn
|
||||
v-show="reloadRequired"
|
||||
@@ -79,19 +18,36 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-row :class="showScrubber ? 'withScrubber' : ''">
|
||||
<v-col>
|
||||
<div ref="viewerCanvasContainer"></div>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6">
|
||||
</v-row>
|
||||
<v-row v-show="showScrubber" class="scrubber">
|
||||
<v-col class="pt-0">
|
||||
<v-slider
|
||||
vertical
|
||||
:disabled="loading || !loadedFile"
|
||||
:max="maxZSlider"
|
||||
:min="0"
|
||||
:value="zSlider"
|
||||
class="slider-autoheight mt-3"
|
||||
@input="updateZSlider"></v-slider>
|
||||
v-model="scrubPosition"
|
||||
:hint="scrubPosition + '/' + scrubFileSize"
|
||||
:max="scrubFileSize"
|
||||
dense
|
||||
min="0"
|
||||
persistent-hint></v-slider>
|
||||
</v-col>
|
||||
<v-col class="col-auto pt-0 text-center">
|
||||
<v-btn class="px-2 minwidth-0" color="primary" @click="scrubPlaying = !scrubPlaying">
|
||||
<v-icon v-if="scrubPlaying">{{ mdiPause }}</v-icon>
|
||||
<v-icon v-else>{{ mdiPlay }}</v-icon>
|
||||
</v-btn>
|
||||
<v-btn class="px-2 minwidth-0 mx-3" color="primary" @click="fastForward">
|
||||
<v-icon>{{ mdiFastForward }}</v-icon>
|
||||
</v-btn>
|
||||
<v-btn-toggle v-model="scrubSpeed" class="mt-3 mt-sm-0" dense mandatory rounded>
|
||||
<v-btn :value="1">1x</v-btn>
|
||||
<v-btn :value="2">2x</v-btn>
|
||||
<v-btn :value="5">5x</v-btn>
|
||||
<v-btn :value="10">10x</v-btn>
|
||||
<v-btn :value="20">20x</v-btn>
|
||||
</v-btn-toggle>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-0 d-flex align-top">
|
||||
@@ -116,7 +72,10 @@
|
||||
v-html="tracking ? mdiToggleSwitch : mdiToggleSwitchOffOutline"></v-icon>
|
||||
{{ $t('GCodeViewer.Tracking') }}
|
||||
</v-btn>
|
||||
<v-btn @click="clearLoadedFile">{{ $t('GCodeViewer.ClearLoadedFile') }}</v-btn>
|
||||
<v-btn @click="clearLoadedFile">
|
||||
<v-icon left>{{ mdiBroom }}</v-icon>
|
||||
{{ $t('GCodeViewer.ClearLoadedFile') }}
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-sm-6 col-md-4">
|
||||
@@ -129,7 +88,7 @@
|
||||
hide-details
|
||||
outlined></v-select>
|
||||
</v-col>
|
||||
<v-col order-md="3" class="col-12 col-sm-6 col-md-4">
|
||||
<v-col order-md="3" class="col-12 col-sm-6 col-md-4 d-flex">
|
||||
<v-select
|
||||
v-model="renderQuality"
|
||||
:items="renderQualities"
|
||||
@@ -138,82 +97,82 @@
|
||||
dense
|
||||
hide-details
|
||||
outlined></v-select>
|
||||
<v-menu
|
||||
:offset-y="true"
|
||||
:offset-x="true"
|
||||
top
|
||||
:close-on-content-click="false"
|
||||
:title="$t('Files.SetupCurrentList')">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn class="minwidth-0 px-2 ml-3" v-bind="attrs" v-on="on">
|
||||
<v-icon>{{ mdiCog }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showCursor"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowToolhead')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showTravelMoves"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowTravelMoves')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="loadedFile === sdCardFilePath && printing_objects.length"
|
||||
class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showObjectSelection"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowObjectSelection')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hdRendering"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.HDRendering')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="forceLineRendering"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ForceLineRendering')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="transparency"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.Transparency')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="voxelMode"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.VoxelMode')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="specularLighting"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.SpecularLighting')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-menu
|
||||
:offset-y="true"
|
||||
:offset-x="true"
|
||||
top
|
||||
:close-on-content-click="false"
|
||||
:title="$t('Files.SetupCurrentList')">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn class="minwidth-0 px-2 mr-3 mt-3" v-bind="attrs" v-on="on">
|
||||
<v-icon>{{ mdiCog }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showCursor"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowToolhead')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showTravelMoves"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowTravelMoves')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="loadedFile === sdCardFilePath && printing_objects.length > 1"
|
||||
class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="showObjectSelection"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ShowObjectSelection')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-divider></v-divider>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hdRendering"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.HDRendering')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="forceLineRendering"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.ForceLineRendering')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="transparency"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.Transparency')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="voxelMode"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.VoxelMode')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="specularLighting"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('GCodeViewer.SpecularLighting')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</v-row>
|
||||
<input
|
||||
ref="fileInput"
|
||||
@@ -262,6 +221,30 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
@@ -280,6 +263,11 @@ import {
|
||||
mdiToggleSwitch,
|
||||
mdiToggleSwitchOffOutline,
|
||||
mdiVideo3d,
|
||||
mdiPlay,
|
||||
mdiPause,
|
||||
mdiFastForward,
|
||||
mdiBroom,
|
||||
mdiSelectionRemove,
|
||||
} from '@mdi/js'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
|
||||
@@ -311,6 +299,11 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
mdiClose = mdiClose
|
||||
mdiCog = mdiCog
|
||||
mdiVideo3d = mdiVideo3d
|
||||
mdiPlay = mdiPlay
|
||||
mdiPause = mdiPause
|
||||
mdiFastForward = mdiFastForward
|
||||
mdiBroom = mdiBroom
|
||||
mdiSelectionRemove = mdiSelectionRemove
|
||||
|
||||
formatFilesize = formatFilesize
|
||||
|
||||
@@ -323,11 +316,14 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
|
||||
private reloadRequired = false
|
||||
private fileSize = 0
|
||||
private maxZSlider = 100000
|
||||
private zSlider = this.maxZSlider
|
||||
private zSlicerHeight = 100
|
||||
private renderQuality = this.renderQualities[2]
|
||||
|
||||
private scrubPosition = 0
|
||||
private scrubPlaying = false
|
||||
private scrubSpeed = 1
|
||||
private scrubInterval: ReturnType<typeof setInterval> | undefined = undefined
|
||||
private scrubFileSize = 0
|
||||
|
||||
private downloadSnackbar: downloadSnackbar = {
|
||||
status: false,
|
||||
filename: '',
|
||||
@@ -341,6 +337,11 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
},
|
||||
}
|
||||
|
||||
private excludeObject = {
|
||||
bool: false,
|
||||
name: '',
|
||||
}
|
||||
|
||||
@Prop({ type: String, default: '', required: false }) declare filename: string
|
||||
@Ref('fileInput') declare fileInput: HTMLInputElement
|
||||
@Ref('viewerCanvasContainer') declare viewerCanvasContainer: HTMLElement
|
||||
@@ -362,8 +363,9 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
async mounted() {
|
||||
this.loadedFile = this.$store.state.gcodeviewer?.loadedFileBackup ?? null
|
||||
viewer = this.$store.state.gcodeviewer?.viewerBackup ?? null
|
||||
|
||||
await this.init()
|
||||
|
||||
if (this.loadedFile !== null) this.scrubFileSize = viewer.fileSize
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
@@ -372,6 +374,12 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('gcodeviewer/setLoadedFileBackup', this.loadedFile)
|
||||
this.$store.dispatch('gcodeviewer/setViewerBackup', viewer)
|
||||
}
|
||||
|
||||
this.scrubPlaying = false
|
||||
if (this.scrubInterval) {
|
||||
clearInterval(this.scrubInterval)
|
||||
this.scrubInterval = undefined
|
||||
}
|
||||
}
|
||||
|
||||
@Debounce(200)
|
||||
@@ -381,6 +389,14 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
})
|
||||
}
|
||||
|
||||
get panelTitle() {
|
||||
let title = this.$t('GCodeViewer.Title').toString()
|
||||
|
||||
if (this.loadedFile) title += `: ${this.loadedFile}`
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
get filePosition() {
|
||||
return this.printerIsPrinting ? this.$store.state.printer.virtual_sdcard.file_position : 0
|
||||
}
|
||||
@@ -401,10 +417,20 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
return this.$store.state.printer.exclude_object?.objects ?? []
|
||||
}
|
||||
|
||||
@Watch('printing_objects')
|
||||
printing_objectsChanged() {
|
||||
this.refreshPrintingObjects()
|
||||
}
|
||||
|
||||
get excluded_objects() {
|
||||
return this.$store.state.printer.exclude_object?.excluded_objects ?? []
|
||||
}
|
||||
|
||||
@Watch('excluded_objects')
|
||||
excluded_objectsChanged() {
|
||||
this.refreshPrintingObjects()
|
||||
}
|
||||
|
||||
get nozzle_diameter() {
|
||||
return this.$store.state.printer.configfile?.settings?.extruder?.nozzle_diameter ?? 0.4
|
||||
}
|
||||
@@ -424,22 +450,20 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
if (viewer === null) {
|
||||
await this.viewerInit(canvasElement)
|
||||
}
|
||||
if (viewer === null) await this.viewerInit(canvasElement)
|
||||
|
||||
this.registerProgressCallback()
|
||||
|
||||
if (this.$route.query?.filename && this.loadedFile !== this.$route.query?.filename?.toString()) {
|
||||
//TODO: test without sleep
|
||||
await this.sleep(1000) //Give the store a chance to initializ before loading the file.
|
||||
await this.sleep(1000) //Give the store a chance to initialize before loading the file.
|
||||
await this.loadFile(this.$route.query.filename.toString())
|
||||
}
|
||||
}
|
||||
|
||||
viewerInit(element: HTMLCanvasElement) {
|
||||
async viewerInit(element: HTMLCanvasElement) {
|
||||
viewer = new GCodeViewer(element)
|
||||
viewer.init()
|
||||
await viewer.init()
|
||||
viewer.setBackgroundColor(this.backgroundColor)
|
||||
viewer.bed.setBedColor(this.gridColor)
|
||||
viewer.setCursorVisiblity(this.showCursor)
|
||||
@@ -467,6 +491,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
viewer.gcodeProcessor.voxelHeight = this.voxelHeight
|
||||
viewer.gcodeProcessor.useSpecularColor(this.specularLighting)
|
||||
viewer.gcodeProcessor.setLiveTracking(false)
|
||||
viewer.buildObjects.objectCallback = this.objectCallback
|
||||
|
||||
this.loadToolColors(this.extruderColors)
|
||||
|
||||
@@ -495,6 +520,8 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
|
||||
clearLoadedFile() {
|
||||
if (viewer) {
|
||||
this.scrubPlaying = false
|
||||
this.scrubFileSize = 0
|
||||
viewer.clearScene(true)
|
||||
this.loadedFile = null
|
||||
this.tracking = false
|
||||
@@ -508,14 +535,19 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
finishLoad() {
|
||||
this.maxZSlider = viewer.getMaxHeight() + 1
|
||||
this.zSlider = this.maxZSlider
|
||||
this.loading = false
|
||||
viewer.setCursorVisiblity(this.showCursor)
|
||||
|
||||
if (this.loadedFile === this.sdCardFilePath && this.printing_objects.length) {
|
||||
let objects: any = []
|
||||
this.refreshPrintingObjects()
|
||||
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) => {
|
||||
const xValues = object.polygon.map((point: number[]) => point[0])
|
||||
const yValues = object.polygon.map((point: number[]) => point[1])
|
||||
@@ -527,12 +559,10 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
y: [Math.min(...yValues), Math.max(...yValues)],
|
||||
})
|
||||
})
|
||||
|
||||
viewer.buildObjects.loadObjectBoundaries(objects)
|
||||
viewer.buildObjects.showObjectSelection(this.showObjectSelection)
|
||||
}
|
||||
|
||||
viewer.gcodeProcessor.updateFilePosition(viewer.fileSize)
|
||||
viewer.buildObjects.loadObjectBoundaries(objects)
|
||||
viewer.buildObjects.showObjectSelection(this.showObjectSelection)
|
||||
}
|
||||
|
||||
async fileSelected(e: any) {
|
||||
@@ -593,6 +623,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
await viewer.processFile(text)
|
||||
this.loadingPercent = 100
|
||||
this.finishLoad()
|
||||
this.scrubFileSize = viewer.fileSize
|
||||
}
|
||||
|
||||
cancelDownload() {
|
||||
@@ -672,8 +703,7 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
async trackingChanged(newVal: boolean) {
|
||||
if (!viewer) return
|
||||
if (newVal) {
|
||||
//Set zSlider to max value
|
||||
this.zSlider = this.maxZSlider
|
||||
this.scrubPlaying = false
|
||||
//Force renderers reload.
|
||||
viewer.gcodeProcessor.updateFilePosition(0)
|
||||
viewer?.forceRender()
|
||||
@@ -989,12 +1019,6 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('zSlider')
|
||||
zSliderChanged(newVal: number) {
|
||||
viewer?.setZClipPlane(newVal, -1)
|
||||
viewer?.forceRender()
|
||||
}
|
||||
|
||||
get progressColor() {
|
||||
return this.$store.state.gui.gcodeViewer?.progressColor ?? '#FFFFFF'
|
||||
}
|
||||
@@ -1004,8 +1028,100 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
viewer?.setProgressColor(newVal)
|
||||
}
|
||||
|
||||
updateZSlider(newVal: any) {
|
||||
this.zSlider = newVal
|
||||
@Watch('scrubPlaying')
|
||||
scrubPlayingChanged(to: boolean): void {
|
||||
if (to) {
|
||||
if (this.scrubInterval) {
|
||||
clearInterval(this.scrubInterval)
|
||||
this.scrubInterval = undefined
|
||||
}
|
||||
this.scrubPlaying = true
|
||||
if (this.scrubPosition >= this.scrubFileSize) {
|
||||
this.scrubPosition = 0
|
||||
}
|
||||
|
||||
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition - 30000)
|
||||
this.scrubInterval = setInterval(() => {
|
||||
this.scrubPosition += 100 * this.scrubSpeed
|
||||
viewer.gcodeProcessor.updateFilePosition(this.scrubPosition)
|
||||
if (this.tracking || this.scrubPosition >= this.scrubFileSize) {
|
||||
this.scrubPlaying = false
|
||||
}
|
||||
}, 200)
|
||||
} else {
|
||||
if (this.scrubInterval) clearInterval(this.scrubInterval)
|
||||
this.scrubPlaying = false
|
||||
this.scrubInterval = undefined
|
||||
}
|
||||
}
|
||||
|
||||
get showScrubber() {
|
||||
return !this.tracking && this.scrubFileSize > 0
|
||||
}
|
||||
|
||||
@Debounce(200)
|
||||
@Watch('scrubPosition')
|
||||
updateScrubPosition(to: number): void {
|
||||
if (!this.tracking) viewer.gcodeProcessor.updateFilePosition(to)
|
||||
}
|
||||
|
||||
fastForward(): void {
|
||||
this.scrubPosition = this.scrubFileSize
|
||||
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>
|
||||
|
||||
<!-- 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>
|
||||
@@ -1,8 +1,3 @@
|
||||
<style>
|
||||
.vue-codemirror .cm-editor {
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div class="vue-codemirror">
|
||||
<div ref="codemirror" v-observe-visibility="visibilityChanged"></div>
|
||||
@@ -14,14 +9,16 @@
|
||||
|
||||
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import { basicSetup, EditorState } from '@codemirror/basic-setup'
|
||||
import { basicSetup } from 'codemirror'
|
||||
import { EditorView, keymap } from '@codemirror/view'
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import { mainsailTheme } from '@/plugins/codemirrorTheme'
|
||||
import { StreamLanguage } from '@codemirror/stream-parser'
|
||||
import { StreamLanguage } from '@codemirror/language'
|
||||
import { klipper_config } from '@/plugins/StreamParserKlipperConfig'
|
||||
import { gcode } from '@/plugins/StreamParserGcode'
|
||||
import { EditorView, keymap } from '@codemirror/view'
|
||||
import { indentWithTab } from '@codemirror/commands'
|
||||
import { json } from '@codemirror/lang-json'
|
||||
import { css } from '@codemirror/lang-css'
|
||||
|
||||
@Component
|
||||
export default class Codemirror extends Mixins(BaseMixin) {
|
||||
@@ -98,6 +95,7 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
||||
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 (['json'].includes(this.fileExtension)) extensions.push(json())
|
||||
else if (['css', 'scss', 'sass'].includes(this.fileExtension)) extensions.push(css())
|
||||
|
||||
return extensions
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
<v-item-group class="d-inline-block">
|
||||
<v-btn
|
||||
@@ -17,20 +5,27 @@
|
||||
:color="color"
|
||||
:class="paramArray.length ? 'macroWithParameters' : ''"
|
||||
:loading="loadings.includes('macro_' + macro.name)"
|
||||
:disabled="disabled"
|
||||
@click="doSendMacro(macro.name)">
|
||||
{{ macro.name.replace(/_/g, ' ') }}
|
||||
{{ alias ? alias : macro.name.replace(/_/g, ' ') }}
|
||||
</v-btn>
|
||||
<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 }">
|
||||
<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-btn>
|
||||
</template>
|
||||
<v-card max-width="200">
|
||||
<v-card :max-width="paramsOverlayWidth">
|
||||
<v-card-text class="py-2">
|
||||
<v-row v-for="(name, key) in paramArray" :key="'param_' + key" class="my-2">
|
||||
<v-col class="py-0">
|
||||
<v-row class="my-2">
|
||||
<v-col v-for="(name, key) in paramArray" :key="'param_' + key" :cols="paramCssCols">
|
||||
<v-text-field
|
||||
v-model="params[name].value"
|
||||
:label="name"
|
||||
@@ -54,6 +49,47 @@
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</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="0">
|
||||
<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>
|
||||
</v-item-group>
|
||||
</template>
|
||||
@@ -63,7 +99,8 @@ import Component from 'vue-class-component'
|
||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
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'
|
||||
|
||||
interface param {
|
||||
type: 'int' | 'double' | 'string' | null
|
||||
@@ -75,25 +112,59 @@ interface params {
|
||||
[key: string]: param
|
||||
}
|
||||
|
||||
@Component
|
||||
@Component({
|
||||
components: { Panel },
|
||||
})
|
||||
export default class MacroButton extends Mixins(BaseMixin) {
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiMenuDown = mdiMenuDown
|
||||
mdiRefresh = mdiRefresh
|
||||
|
||||
private paramArray: string[] = []
|
||||
private params: params = {}
|
||||
private paramsDialog = false
|
||||
|
||||
@Prop({ required: true })
|
||||
declare readonly macro: GuiMacrosStateMacrogroupMacro
|
||||
@Prop({ default: 'primary' }) declare readonly color: string
|
||||
|
||||
@Prop({ default: 'primary' })
|
||||
declare readonly color: string
|
||||
|
||||
@Prop({ default: null })
|
||||
declare readonly alias: string
|
||||
|
||||
@Prop({ default: false })
|
||||
declare readonly disabled: boolean
|
||||
|
||||
get klipperMacro() {
|
||||
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')
|
||||
klipperMacroChange() {
|
||||
this.refreshParams()
|
||||
@@ -103,7 +174,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
||||
this.paramArray.splice(0, this.paramArray.length)
|
||||
this.params = {}
|
||||
|
||||
if (this.klipperMacro.params !== null) {
|
||||
if (this.klipperMacro?.params !== null) {
|
||||
Object.keys(this.klipperMacro.params).forEach((name: string) => {
|
||||
if (!name.startsWith('_')) {
|
||||
this.paramArray.push(name)
|
||||
@@ -130,8 +201,7 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
||||
this.paramArray.forEach((paramname: string) => {
|
||||
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
|
||||
let tmp: string = paramname
|
||||
if (paramname.length === 1) tmp += this.params[paramname].value
|
||||
else tmp += '=' + this.params[paramname].value
|
||||
tmp += this.isGcodeStyle ? this.params[paramname].value : `=${this.params[paramname].value}`
|
||||
|
||||
params.push(tmp)
|
||||
}
|
||||
@@ -146,3 +216,15 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</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,99 +1,50 @@
|
||||
<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>
|
||||
<v-container class="px-0 py-2">
|
||||
<v-row>
|
||||
<v-col :class="pwm ? 'pb-1' : 'pb-3'">
|
||||
<v-subheader class="_fan-slider-subheader">
|
||||
<v-icon
|
||||
v-if="type !== 'output_pin'"
|
||||
v-if="type === 'led' && target > 0"
|
||||
class="mr-2"
|
||||
small
|
||||
:class="'mr-2 ' + (value >= off_below && value > 0 ? 'icon-rotate' : '')">
|
||||
{{ mdiFan }}
|
||||
:retain-focus-on-click="true"
|
||||
@click="ledOff">
|
||||
{{ mdiLightbulbOnOutline }}
|
||||
</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>
|
||||
<v-spacer></v-spacer>
|
||||
<small
|
||||
v-if="rpm || rpm === 0"
|
||||
:class="`mr-3 ${controllable && pwm ? '_rpm' : ''}
|
||||
${rpm === 0 && value > 0 ? 'red--text' : ''}`">
|
||||
{{ Math.round(rpm) }} RPM
|
||||
</small>
|
||||
<small v-if="rpm !== null" :class="rpmClasses">{{ Math.round(rpm ?? 0) }} RPM</small>
|
||||
<span v-if="!controllable" class="font-weight-bold">
|
||||
{{ Math.round(parseFloat(value) * 100) }} %
|
||||
</span>
|
||||
<v-icon v-if="controllable && !pwm" @click="switchOutputPin">
|
||||
{{ value ? mdiToggleSwitch : mdiToggleSwitchOffOutline }}
|
||||
</v-icon>
|
||||
<v-text-field
|
||||
v-if="controllable && pwm"
|
||||
v-model="inputValue"
|
||||
:error="errors().length > 0"
|
||||
suffix="%"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
class="_slider-input pt-1"
|
||||
@blur="inputValue = Math.round(parseFloat(sliderValue) * 100)"
|
||||
@focus="$event.target.select()"
|
||||
@keydown="checkInvalidChars"
|
||||
@keyup.enter="submitInput"></v-text-field>
|
||||
<form @submit.prevent="submitInput">
|
||||
<v-text-field
|
||||
v-if="controllable && pwm"
|
||||
v-model="inputValue"
|
||||
:error="errors.length > 0"
|
||||
suffix="%"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
class="_slider-input pt-1"
|
||||
@blur="inputValue = Math.round(parseFloat(sliderValue) * 100)"
|
||||
@focus="$event.target.select()"
|
||||
@keydown="checkInvalidChars" />
|
||||
</form>
|
||||
</v-subheader>
|
||||
<transition name="fade">
|
||||
<transition v-if="controllable && pwm" name="fade">
|
||||
<!-- display errors -->
|
||||
<div v-show="errors().length > 0 && controllable && pwm" class="_error-msg d-flex justify-end">
|
||||
{{ errors()[0] }}
|
||||
<div v-show="errors.length > 0" class="_error-msg d-flex justify-end">
|
||||
{{ errors[0] ?? '' }}
|
||||
</div>
|
||||
</transition>
|
||||
<v-card-text v-if="controllable && pwm" class="py-0 pb-2 d-flex align-center">
|
||||
@@ -147,6 +98,8 @@ import {
|
||||
mdiPlus,
|
||||
mdiToggleSwitch,
|
||||
mdiToggleSwitchOffOutline,
|
||||
mdiLightbulbOutline,
|
||||
mdiLightbulbOnOutline,
|
||||
} from '@mdi/js'
|
||||
|
||||
@Component
|
||||
@@ -158,6 +111,8 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
mdiLockOpenVariantOutline = mdiLockOpenVariantOutline
|
||||
mdiMinus = mdiMinus
|
||||
mdiPlus = mdiPlus
|
||||
mdiLightbulbOutline = mdiLightbulbOutline
|
||||
mdiLightbulbOnOutline = mdiLightbulbOnOutline
|
||||
|
||||
convertName = convertName
|
||||
private declare timeout: ReturnType<typeof setTimeout>
|
||||
@@ -165,19 +120,42 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
private invalidChars: string[] = ['e', 'E', '+']
|
||||
|
||||
private min = 0
|
||||
private value = 0
|
||||
private inputValue = 0
|
||||
private sliderValue = 0
|
||||
|
||||
@Prop({ type: Number, required: true }) declare target: number
|
||||
@Prop({ type: Number, default: 1 }) declare max: number
|
||||
@Prop({ type: String, default: '' }) declare name: string
|
||||
@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: Number, required: true })
|
||||
declare target: number
|
||||
|
||||
@Prop({ type: Number, default: 1 })
|
||||
declare max: number
|
||||
|
||||
@Prop({ type: String, default: '' })
|
||||
declare name: string
|
||||
|
||||
@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 })
|
||||
lockSlidersChanged(): void {
|
||||
@@ -214,19 +192,21 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
} else if (this.sliderValue > this.value && this.sliderValue < this.off_below) {
|
||||
this.sliderValue = this.off_below
|
||||
}
|
||||
this.value = this.sliderValue
|
||||
this.sendCmd()
|
||||
|
||||
this.sendCmd(this.sliderValue)
|
||||
}
|
||||
|
||||
sendCmd(): void {
|
||||
if (this.target === this.value) return
|
||||
sendCmd(newVal: number): void {
|
||||
if (this.value === newVal) return
|
||||
|
||||
let gcode = ''
|
||||
if (this.value < this.min) this.value = 0
|
||||
const l_value = this.value * this.multi
|
||||
if (this.type === 'fan') gcode = `M106 S${l_value.toFixed(0)}`
|
||||
if (this.type === 'fan_generic') gcode = `SET_FAN_SPEED FAN=${this.name} SPEED=${l_value}`
|
||||
if (this.type === 'output_pin') gcode = `SET_PIN PIN=${this.name} VALUE=${l_value.toFixed(2)}`
|
||||
if (newVal < this.min) newVal = 0
|
||||
newVal = newVal * this.multi
|
||||
if (this.type === 'fan') gcode = `M106 S${newVal.toFixed(0)}`
|
||||
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=${newVal.toFixed(2)}`
|
||||
if (this.type === 'led')
|
||||
gcode = `SET_LED LED=${this.name} ${this.ledChannelName}=${newVal.toFixed(2)} SYNC=0 TRANSMIT=1`
|
||||
|
||||
if (gcode !== '') {
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
@@ -236,32 +216,35 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
this.startLockTimer()
|
||||
}
|
||||
|
||||
ledOff() {
|
||||
this.sendCmd(0)
|
||||
}
|
||||
|
||||
ledOn() {
|
||||
this.sendCmd(1)
|
||||
}
|
||||
|
||||
switchOutputPin(): void {
|
||||
this.value = this.value ? 0 : 1
|
||||
const gcode = `SET_PIN PIN=${this.name} VALUE=${(this.value * this.multi).toFixed(2)}`
|
||||
const newVal = this.value ? 0 : 1
|
||||
const gcode = `SET_PIN PIN=${this.name} VALUE=${(newVal * this.multi).toFixed(2)}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
decrement(): void {
|
||||
this.value = this.value > 0 ? Math.round((this.value - 0.01) * 100) / 100 : 0
|
||||
if (this.value < this.off_below) this.value = 0
|
||||
this.sendCmd()
|
||||
let newVal = this.value > 0 ? Math.round((this.value - 0.01) * 100) / 100 : 0
|
||||
if (this.value < this.off_below) newVal = 0
|
||||
this.sendCmd(newVal)
|
||||
}
|
||||
|
||||
increment(): void {
|
||||
this.value = 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
|
||||
this.sendCmd()
|
||||
let newVal = this.value < 1.0 ? Math.round((this.value + 0.01) * 100) / 100 : 1.0
|
||||
if (this.value < this.off_below) newVal = this.off_below
|
||||
this.sendCmd(newVal)
|
||||
}
|
||||
|
||||
mounted(): void {
|
||||
this.value = this.target
|
||||
}
|
||||
|
||||
@Watch('target')
|
||||
targetChanged(newVal: number): void {
|
||||
this.value = newVal
|
||||
mounted() {
|
||||
this.sliderValue = this.value
|
||||
}
|
||||
|
||||
@Watch('value')
|
||||
@@ -281,7 +264,7 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
||||
}
|
||||
|
||||
errors() {
|
||||
get errors() {
|
||||
const errors = []
|
||||
const input = this.inputValue / 100
|
||||
if (this.inputValue.toString() === '') {
|
||||
@@ -292,24 +275,90 @@ export default class MiscellaneousSlider extends Mixins(BaseMixin) {
|
||||
// "Must be grater or equal than {min}!"
|
||||
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
|
||||
}
|
||||
|
||||
get fanClasses() {
|
||||
const output = ['mr-2']
|
||||
if (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 {
|
||||
if (this.errors().length > 0) return
|
||||
if (this.errors.length > 0) return
|
||||
|
||||
const input = this.inputValue / 100
|
||||
if (this.value === 0 && input < this.off_below) {
|
||||
this.value = this.off_below
|
||||
} else if (this.value >= this.off_below && input < this.off_below) {
|
||||
this.value = 0
|
||||
} else this.value = input
|
||||
let newVal = this.inputValue / 100
|
||||
if (this.value === 0 && newVal < this.off_below) {
|
||||
newVal = this.off_below
|
||||
} else if (this.value >= this.off_below && newVal < this.off_below) {
|
||||
newVal = 0
|
||||
}
|
||||
|
||||
this.sendCmd()
|
||||
this.sendCmd(newVal)
|
||||
}
|
||||
}
|
||||
</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>
|
||||
@@ -1,41 +1,31 @@
|
||||
<template>
|
||||
<v-text-field
|
||||
v-model="position"
|
||||
:label="`[ ${label} ]`"
|
||||
:suffix="suffix"
|
||||
:disabled="disabled"
|
||||
:readonly="readonly"
|
||||
:error="!validate"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
outlined
|
||||
reverse
|
||||
dense
|
||||
@blur="onBlur"
|
||||
@focus="!readonly ? $event.target.select() : {}">
|
||||
<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 @submit.prevent="submit">
|
||||
<v-text-field
|
||||
v-model="position"
|
||||
:label="`[ ${label} ]`"
|
||||
:suffix="suffix"
|
||||
:disabled="disabled"
|
||||
:step="step"
|
||||
:readonly="readonly"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
outlined
|
||||
reverse
|
||||
dense
|
||||
@blur="onBlur"
|
||||
@focus="!readonly ? $event.target.select() : {}"></v-text-field>
|
||||
</form>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop, VModel } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiAlert } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
})
|
||||
export default class MoveToInput extends Mixins(BaseMixin) {
|
||||
mdiAlert = mdiAlert
|
||||
|
||||
@VModel({ type: String })
|
||||
declare position: string
|
||||
|
||||
@@ -48,11 +38,8 @@ export default class MoveToInput extends Mixins(BaseMixin) {
|
||||
@Prop({ type: String, required: false })
|
||||
declare readonly suffix: string
|
||||
|
||||
@Prop({ type: Number, required: true })
|
||||
declare readonly positionMax: number
|
||||
|
||||
@Prop({ type: Number, required: true })
|
||||
declare readonly positionMin: number
|
||||
@Prop({ type: Number, required: false, default: 1 })
|
||||
declare readonly step: number
|
||||
|
||||
@Prop({ type: Boolean, required: false })
|
||||
declare readonly disabled: boolean
|
||||
@@ -61,43 +48,13 @@ export default class MoveToInput extends Mixins(BaseMixin) {
|
||||
declare readonly readonly: boolean
|
||||
|
||||
onBlur() {
|
||||
if (!this.validate && this.position !== this.currentPos) {
|
||||
if (this.position !== this.currentPos) {
|
||||
this.position = this.currentPos
|
||||
this.$emit('validate', { axis: this.suffix.toLowerCase(), valid: true })
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
submit(): void {
|
||||
this.$emit('submit')
|
||||
}
|
||||
}
|
||||
</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,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>
|
||||
<div class="d-flex align-center">
|
||||
<form @submit.prevent="setTemps">
|
||||
@@ -57,11 +34,11 @@
|
||||
link
|
||||
style="min-height: 32px"
|
||||
@click="doSend(`${command} ${attributeName}=${name} TARGET=${preset.value}`)">
|
||||
<div class="d-flex align-center _preset">
|
||||
<v-icon v-if="preset.value === 0" else color="primary" small class="mr-1">
|
||||
<div class="_preset">
|
||||
<v-icon v-if="preset.value === 0" else color="primary" small class="_preset-icon">
|
||||
{{ mdiSnowflake }}
|
||||
</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>
|
||||
</div>
|
||||
</v-list-item>
|
||||
@@ -124,3 +101,30 @@ export default class TemperatureInput extends Mixins(BaseMixin, ControlMixin) {
|
||||
}
|
||||
}
|
||||
</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>
|
||||
<v-row dense>
|
||||
<v-col class="pa-0">
|
||||
@@ -67,25 +17,26 @@
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<span v-if="!hasInputField" class="font-weight-bold">{{ value }} {{ unit }}</span>
|
||||
<v-text-field
|
||||
v-if="hasInputField"
|
||||
v-model="numInput"
|
||||
:error="errors().length > 0"
|
||||
:suffix="unit"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
class="_slider-input d-flex align-center pt-1"
|
||||
@blur="numInput = value"
|
||||
@focus="$event.target.select()"
|
||||
@keydown="checkInvalidChars"
|
||||
@keyup.enter="submitInput">
|
||||
<template v-if="value !== defaultValue || value !== numInput" #append>
|
||||
<v-icon small @click="resetSlider">{{ mdiRestart }}</v-icon>
|
||||
</template>
|
||||
</v-text-field>
|
||||
<form @submit.prevent="submitInput">
|
||||
<v-text-field
|
||||
v-if="hasInputField"
|
||||
v-model="numInput"
|
||||
:error="errors().length > 0"
|
||||
:suffix="unit"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
class="_slider-input d-flex align-center pt-1"
|
||||
@blur="numInput = value"
|
||||
@focus="$event.target.select()"
|
||||
@keydown="checkInvalidChars">
|
||||
<template v-if="value !== defaultValue || value !== numInput" #append>
|
||||
<v-icon small @click="resetSlider">{{ mdiRestart }}</v-icon>
|
||||
</template>
|
||||
</v-text-field>
|
||||
</form>
|
||||
</v-subheader>
|
||||
<transition name="fade">
|
||||
<!-- display errors-->
|
||||
@@ -300,3 +251,54 @@ export default class ToolSlider extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</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,6 @@
|
||||
import Vue from 'vue'
|
||||
import Component from 'vue-class-component'
|
||||
import { DateTimeFormatOptions } from 'vue-i18n'
|
||||
|
||||
@Component
|
||||
export default class BaseMixin extends Vue {
|
||||
@@ -11,14 +12,22 @@ export default class BaseMixin extends Vue {
|
||||
return this.$store.getters['socket/getHostUrl']
|
||||
}
|
||||
|
||||
get remoteMode() {
|
||||
return this.$store.state.remoteMode
|
||||
get hostPort(): boolean {
|
||||
return this.$store.state.socket.port ?? 80
|
||||
}
|
||||
|
||||
get instancesDB() {
|
||||
return this.$store.state.instancesDB ?? 'moonraker'
|
||||
}
|
||||
|
||||
get socketIsConnected(): boolean {
|
||||
return this.$store.state.socket.isConnected ?? false
|
||||
}
|
||||
|
||||
get guiIsReady() {
|
||||
return this.$store.state.socket.initializationList.length === 0
|
||||
}
|
||||
|
||||
get klippyIsConnected(): boolean {
|
||||
return this.$store.state.server.klippy_connected ?? false
|
||||
}
|
||||
@@ -74,7 +83,113 @@ export default class BaseMixin extends Vue {
|
||||
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() {
|
||||
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.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
||||
}
|
||||
|
||||
get hours12Format() {
|
||||
const setting = this.$store.state.gui.general.timeFormat
|
||||
if (setting === '12hours') return true
|
||||
if (setting === null && this.browserLocale === 'en_us') return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
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']
|
||||
}
|
||||
|
||||
get existsFirmwareRetraction(): boolean {
|
||||
return this.$store.getters['printer/existsFirmwareRetraction']
|
||||
}
|
||||
|
||||
get colorQuadGantryLevel() {
|
||||
const status = this.$store.state.printer.quad_gantry_level?.applied ?? true
|
||||
|
||||
|
||||
@@ -3,11 +3,25 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import { allDashboardPanels } from '@/store/variables'
|
||||
import { capitalize } from '@/plugins/helpers'
|
||||
import { GuiMacrosStateMacrogroup } from '@/store/gui/macros/types'
|
||||
import kebabCase from 'lodash.kebabcase'
|
||||
import Vue from 'vue'
|
||||
|
||||
@Component
|
||||
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 printerTemperatureSensorsCount() {
|
||||
return this.$store.getters['printer/getTemperatureSensors'].length
|
||||
}
|
||||
|
||||
get macroMode() {
|
||||
return this.$store.state.gui.macros.mode ?? 'simple'
|
||||
}
|
||||
@@ -66,6 +80,21 @@ export default class DashboardMixin extends BaseMixin {
|
||||
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.printerTemperatureSensorsCount < 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')
|
||||
@@ -102,9 +131,9 @@ export default class DashboardMixin extends BaseMixin {
|
||||
subStrings.forEach((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`)
|
||||
}
|
||||
}
|
||||
@@ -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.klippy_disconnect')
|
||||
$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')
|
||||
@@ -1,48 +1,3 @@
|
||||
<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>
|
||||
<panel
|
||||
v-if="klipperReadyForGui && extruders.length"
|
||||
@@ -52,31 +7,23 @@
|
||||
card-class="extruder-control-panel">
|
||||
<!-- PANEL-HEADER 3-DOT-MENU -->
|
||||
<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 }">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
<v-icon>{{ mdiDotsVertical }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense>
|
||||
<v-list-item>
|
||||
<!-- FILAMENT UNLOAD -->
|
||||
<v-tooltip top :disabled="extrudePossible" color="secondary">
|
||||
<!-- FILAMENT UNLOAD -->
|
||||
<v-list-item v-if="unloadFilamentMacro">
|
||||
<v-tooltip top :disabled="canExecuteUnloadMacro" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div style="width: 100%" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnUnloadFilament')"
|
||||
:disabled="!extrudePossible || isPrinting"
|
||||
small
|
||||
style="width: 100%"
|
||||
@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 v-on="on">
|
||||
<macro-button
|
||||
:macro="unloadFilamentMacro"
|
||||
:alias="$t('Panels.ExtruderControlPanel.UnloadFilament').toString()"
|
||||
:disabled="!canExecuteUnloadMacro || isPrinting"
|
||||
color="#272727" />
|
||||
</div>
|
||||
</template>
|
||||
<span>
|
||||
@@ -85,24 +32,16 @@
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<!-- FILAMENT LOAD -->
|
||||
<v-tooltip top :disabled="extrudePossible" color="secondary">
|
||||
<!-- FILAMENT LOAD -->
|
||||
<v-list-item v-if="loadFilamentMacro">
|
||||
<v-tooltip top :disabled="canExecuteLoadMacro" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div style="width: 100%" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnLoadFilament')"
|
||||
:disabled="!extrudePossible || isPrinting"
|
||||
small
|
||||
style="width: 100%"
|
||||
@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 v-on="on">
|
||||
<macro-button
|
||||
:macro="loadFilamentMacro"
|
||||
:alias="$t('Panels.ExtruderControlPanel.LoadFilament').toString()"
|
||||
:disabled="!canExecuteLoadMacro || isPrinting"
|
||||
color="#272727" />
|
||||
</div>
|
||||
</template>
|
||||
<span>
|
||||
@@ -146,8 +85,15 @@
|
||||
attribute-name="S"></tool-slider>
|
||||
</v-container>
|
||||
<!-- PRESSURE ADVANCE SETTINGS -->
|
||||
<v-divider></v-divider>
|
||||
<pressure-advance-settings></pressure-advance-settings>
|
||||
<template v-if="!extruderSteppers.length > 0">
|
||||
<v-divider></v-divider>
|
||||
<pressure-advance-settings></pressure-advance-settings>
|
||||
</template>
|
||||
<!-- FIRMWARE RETRACTION SETTINGS -->
|
||||
<template v-if="existsFirmwareRetraction">
|
||||
<v-divider></v-divider>
|
||||
<firmware-retraction-settings></firmware-retraction-settings>
|
||||
</template>
|
||||
<v-divider class="pb-1"></v-divider>
|
||||
<!-- EXTRUDER INPUTS AND QUICKSELECTS -->
|
||||
<v-container>
|
||||
@@ -342,8 +288,14 @@
|
||||
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
|
||||
<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>
|
||||
@@ -357,17 +309,22 @@ import {
|
||||
mdiArrowUpBold,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiPrinter3dNozzleOutline,
|
||||
mdiLocationEnter,
|
||||
mdiLocationExit,
|
||||
mdiDotsVertical,
|
||||
mdiDiameterVariant,
|
||||
} from '@mdi/js'
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import { PrinterStateExtruder, PrinterStateToolchangeMacro } from '@/store/printer/types'
|
||||
import {
|
||||
PrinterStateExtruder,
|
||||
PrinterStateExtruderStepper,
|
||||
PrinterStateMacro,
|
||||
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 PressureAdvanceSettings from '@/components/panels/MachineSettings/PressureAdvanceSettings.vue'
|
||||
import PressureAdvanceSettings from '@/components/panels/ExtruderSettings/PressureAdvanceSettings.vue'
|
||||
import FirmwareRetractionSettings from '@/components/panels/ExtruderSettings/FirmwareRetractionSettings.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
||||
|
||||
@@ -375,6 +332,7 @@ import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
||||
components: {
|
||||
Panel,
|
||||
PressureAdvanceSettings,
|
||||
FirmwareRetractionSettings,
|
||||
NumberInput,
|
||||
Responsive,
|
||||
ToolSlider,
|
||||
@@ -385,31 +343,59 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
|
||||
mdiArrowDownBold = mdiArrowDownBold
|
||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||
mdiPrinter3dNozzleOutline = mdiPrinter3dNozzleOutline
|
||||
mdiLocationEnter = mdiLocationEnter
|
||||
mdiLocationExit = mdiLocationExit
|
||||
mdiDotsVertical = mdiDotsVertical
|
||||
mdiDiameterVariant = mdiDiameterVariant
|
||||
|
||||
private heatWaitGcodes = ['printer.extruder.can_extrude', 'TEMPERATURE_WAIT', 'M109']
|
||||
|
||||
get isPrinting(): boolean {
|
||||
return ['printing'].includes(this.printer_state)
|
||||
}
|
||||
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getMacros']
|
||||
}
|
||||
|
||||
get toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
||||
return this.$store.getters['printer/getToolchangeMacros']
|
||||
}
|
||||
|
||||
get filamentChangeMacros(): boolean {
|
||||
let macros: string[] = []
|
||||
this.$store.getters['printer/getMacros'].forEach((m: any) => {
|
||||
if (m.name.toUpperCase().startsWith('LOAD_FILAMENT')) macros.push(m.name)
|
||||
if (m.name.toUpperCase().startsWith('UNLOAD_FILAMENT')) macros.push(m.name)
|
||||
})
|
||||
return macros.length === 2
|
||||
get loadFilamentMacro() {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name === 'LOAD_FILAMENT')
|
||||
}
|
||||
|
||||
get unloadFilamentMacro() {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name === 'UNLOAD_FILAMENT')
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 showFilamentMacros(): boolean {
|
||||
return this.loadFilamentMacro !== undefined || this.unloadFilamentMacro !== undefined
|
||||
}
|
||||
|
||||
get extruders(): PrinterStateExtruder[] {
|
||||
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
|
||||
}
|
||||
@@ -513,17 +499,50 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
|
||||
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>
|
||||
|
||||
<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>
|
||||
@@ -0,0 +1,152 @@
|
||||
<template>
|
||||
<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').toString()
|
||||
"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="
|
||||
$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractSpeed').toString()
|
||||
"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="
|
||||
$t(
|
||||
'Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractExtraLength'
|
||||
).toString()
|
||||
"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="
|
||||
$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractSpeed').toString()
|
||||
"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</responsive>
|
||||
</v-container>
|
||||
</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'
|
||||
|
||||
@Component({
|
||||
components: { Panel, NumberInput, Responsive },
|
||||
})
|
||||
export default class FirmwareRetractionSettings extends Mixins(BaseMixin) {
|
||||
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>
|
||||
+4
-4
@@ -14,7 +14,7 @@
|
||||
</v-btn>
|
||||
<v-select
|
||||
v-model="selectedExtruder"
|
||||
:label="$t('Panels.MachineSettingsPanel.PressureAdvanceSettings.Extruder').toString()"
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder').toString()"
|
||||
:items="allExtruders"
|
||||
:value="activeExtruder"
|
||||
hide-details
|
||||
@@ -24,7 +24,7 @@
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.MachineSettingsPanel.PressureAdvanceSettings.Advance').toString()"
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance').toString()"
|
||||
param="ADVANCE"
|
||||
:target="pressureAdvance"
|
||||
:default-value="defaultPressureAdvance"
|
||||
@@ -35,12 +35,12 @@
|
||||
:max="null"
|
||||
:step="0.001"
|
||||
:dec="3"
|
||||
unit="mm/s"
|
||||
unit="s"
|
||||
@submit="sendCmd"></number-input>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.MachineSettingsPanel.PressureAdvanceSettings.SmoothTime').toString()"
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime').toString()"
|
||||
param="SMOOTH_TIME"
|
||||
:target="smoothTime"
|
||||
:default-value="defaultSmoothTime"
|
||||
@@ -1,41 +1,3 @@
|
||||
<style>
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.files-table .v-data-table-header__icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.files-table .file-list-cursor:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.file-list--select-td {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.files-table th.text-start {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-chip.minimum-chip {
|
||||
padding: 0;
|
||||
min-width: 24px;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-chip.minimum-chip .v-chip__content {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.file-list__count_printed {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
@@ -67,7 +29,7 @@
|
||||
<input
|
||||
ref="fileUpload"
|
||||
type="file"
|
||||
:accept="validGcodeExtensions.join(', ')"
|
||||
:accept="gcodeInputFileAccept.join(', ')"
|
||||
style="display: none"
|
||||
multiple
|
||||
@change="uploadFile" />
|
||||
@@ -143,11 +105,10 @@
|
||||
<v-list-item
|
||||
v-for="header of configurableHeaders"
|
||||
:key="header.value"
|
||||
class="minHeight36"
|
||||
link>
|
||||
class="minHeight36">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon class="handle">{{ mdiDragVertical }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
{{ header.text }}
|
||||
@@ -269,50 +230,36 @@
|
||||
<template v-if="item.isDirectory">
|
||||
<v-icon>{{ mdiFolder }}</v-icon>
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="item.small_thumbnail && item.big_thumbnail">
|
||||
<v-tooltip
|
||||
v-if="!item.isDirectory && item.small_thumbnail && item.big_thumbnail"
|
||||
top
|
||||
content-class="tooltip__content-opacity1">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image>
|
||||
<img
|
||||
slot="image"
|
||||
:src="item.small_thumbnail"
|
||||
width="32"
|
||||
height="32"
|
||||
:alt="item.filename"
|
||||
v-bind="attrs"
|
||||
v-on="on" />
|
||||
<template v-else-if="item.small_thumbnail">
|
||||
<v-tooltip
|
||||
top
|
||||
content-class="tooltip__content-opacity1"
|
||||
:disabled="!item.big_thumbnail">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image>
|
||||
<img
|
||||
slot="image"
|
||||
:src="item.small_thumbnail"
|
||||
width="32"
|
||||
height="32"
|
||||
:alt="item.filename"
|
||||
v-bind="attrs"
|
||||
v-on="on" />
|
||||
<div slot="preloader">
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<span><img :src="item.big_thumbnail" width="250" :alt="item.filename" /></span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template v-else-if="item.small_thumbnail">
|
||||
<vue-load-image>
|
||||
<img
|
||||
slot="image"
|
||||
:src="item.small_thumbnail"
|
||||
width="32"
|
||||
height="32"
|
||||
:alt="item.filename" />
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</template>
|
||||
</div>
|
||||
<div slot="error">
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</div>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<span><img :src="item.big_thumbnail" width="250" :alt="item.filename" /></span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</template>
|
||||
</td>
|
||||
<td class=" ">{{ item.filename }}</td>
|
||||
@@ -369,14 +316,9 @@
|
||||
{{ $t('Files.AddToQueue') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="
|
||||
'first_layer_extr_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_extr_temp > 0 &&
|
||||
'first_layer_bed_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_bed_temp > 0
|
||||
"
|
||||
v-if="contextMenu.item.preheat_gcode !== null"
|
||||
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
|
||||
@click="preheat">
|
||||
@click="doSend(contextMenu.item.preheat_gcode)">
|
||||
<v-icon class="mr-1">{{ mdiFire }}</v-icon>
|
||||
{{ $t('Files.Preheat') }}
|
||||
</v-list-item>
|
||||
@@ -418,7 +360,7 @@
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.NewDirectory')"
|
||||
:title="$t('Files.NewDirectory').toString()"
|
||||
card-class="gcode-files-new-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -431,19 +373,25 @@
|
||||
ref="inputFieldCreateDirectory"
|
||||
v-model="dialogCreateDirectory.name"
|
||||
:label="$t('Files.Name')"
|
||||
:rules="input_rules"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keypress.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">{{ $t('Files.Create') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="createDirectoryAction">
|
||||
{{ $t('Files.Create') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" :max-width="400">
|
||||
<panel :title="$t('Files.RenameFile')" card-class="gcode-files-rename-file-dialog" :margin-bottom="false">
|
||||
<panel
|
||||
:title="$t('Files.RenameFile').toString()"
|
||||
card-class="gcode-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="dialogRenameFile.show = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
@@ -453,20 +401,24 @@
|
||||
<v-text-field
|
||||
ref="inputFieldRenameFile"
|
||||
v-model="dialogRenameFile.newName"
|
||||
:label="$t('Files.Name')"
|
||||
:label="$t('Files.Name').toString()"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameFileAction">
|
||||
{{ $t('Files.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.RenameDirectory')"
|
||||
:title="$t('Files.RenameDirectory').toString()"
|
||||
card-class="gcode-files-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -480,18 +432,22 @@
|
||||
v-model="dialogRenameDirectory.newName"
|
||||
:label="$t('Files.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Files.Rename') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameDirectoryAction">
|
||||
{{ $t('Files.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.DeleteDirectory')"
|
||||
:title="$t('Files.DeleteDirectory').toString()"
|
||||
card-class="gcode-files-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -512,7 +468,10 @@
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel :title="$t('Files.Delete')" card-class="gcode-files-delete-selected-dialog" :margin-bottom="false">
|
||||
<panel
|
||||
:title="$t('Files.Delete').toString()"
|
||||
card-class="gcode-files-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteSelectedDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
@@ -535,13 +494,13 @@
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { validGcodeExtensions } from '@/store/variables'
|
||||
import { formatDate, formatFilesize, formatPrintTime, sortFiles } from '@/plugins/helpers'
|
||||
import { formatFilesize, formatPrintTime, sortFiles } from '@/plugins/helpers'
|
||||
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import {
|
||||
mdiArrowUpDown,
|
||||
mdiDragVertical,
|
||||
mdiCheckboxBlankOutline,
|
||||
mdiCheckboxMarked,
|
||||
mdiCloseThick,
|
||||
@@ -564,6 +523,16 @@ import {
|
||||
mdiFileDocumentEditOutline,
|
||||
} from '@mdi/js'
|
||||
import StartPrintDialog from '@/components/dialogs/StartPrintDialog.vue'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
|
||||
interface contextMenu {
|
||||
shown: boolean
|
||||
isDirectory: boolean
|
||||
touchTimer?: number | null
|
||||
x: number
|
||||
y: number
|
||||
item: FileStateGcodefile
|
||||
}
|
||||
|
||||
interface draggingFile {
|
||||
item: FileStateGcodefile
|
||||
@@ -587,13 +556,13 @@ interface tableColumnSetting {
|
||||
sortable?: boolean
|
||||
class?: string
|
||||
pos?: number
|
||||
outputType?: 'string' | 'date' | 'length' | 'weight' | 'filesize' | 'time'
|
||||
outputType?: 'string' | 'date' | 'length' | 'weight' | 'filesize' | 'temp' | 'time'
|
||||
}
|
||||
|
||||
@Component({
|
||||
components: { StartPrintDialog, Panel, SettingsRow, draggable },
|
||||
})
|
||||
export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiFile = mdiFile
|
||||
mdiFileDocumentMultipleOutline = mdiFileDocumentMultipleOutline
|
||||
mdiMagnify = mdiMagnify
|
||||
@@ -614,10 +583,8 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiCheckboxBlankOutline = mdiCheckboxBlankOutline
|
||||
mdiCheckboxMarked = mdiCheckboxMarked
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
|
||||
validGcodeExtensions = validGcodeExtensions
|
||||
formatDate = formatDate
|
||||
formatFilesize = formatFilesize
|
||||
formatPrintTime = formatPrintTime
|
||||
sortFiles = sortFiles
|
||||
@@ -630,29 +597,13 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
private search = ''
|
||||
private draggingFile: draggingFile = {
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
count_printed: 0,
|
||||
last_filament_used: null,
|
||||
last_start_time: null,
|
||||
last_end_time: null,
|
||||
last_print_duration: null,
|
||||
last_status: null,
|
||||
last_total_duration: null,
|
||||
},
|
||||
}
|
||||
|
||||
private dialogCreateDirectory = {
|
||||
show: false,
|
||||
name: '',
|
||||
}
|
||||
private contextMenu = {
|
||||
|
||||
private contextMenu: contextMenu = {
|
||||
shown: false,
|
||||
isDirectory: false,
|
||||
touchTimer: undefined,
|
||||
@@ -663,16 +614,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
},
|
||||
}
|
||||
|
||||
private dialogPrintFile: dialogPrintFile = {
|
||||
show: false,
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
preheat_gcode: null,
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
@@ -686,72 +628,50 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
},
|
||||
}
|
||||
|
||||
private draggingFile: draggingFile = {
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogPrintFile: dialogPrintFile = {
|
||||
show: false,
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogRenameFile: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
count_printed: 0,
|
||||
last_filament_used: null,
|
||||
last_start_time: null,
|
||||
last_end_time: null,
|
||||
last_print_duration: null,
|
||||
last_status: null,
|
||||
last_total_duration: null,
|
||||
},
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogRenameDirectory: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
count_printed: 0,
|
||||
last_filament_used: null,
|
||||
last_start_time: null,
|
||||
last_end_time: null,
|
||||
last_print_duration: null,
|
||||
last_status: null,
|
||||
last_total_duration: null,
|
||||
},
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogDeleteDirectory: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
count_printed: 0,
|
||||
last_filament_used: null,
|
||||
last_start_time: null,
|
||||
last_end_time: null,
|
||||
last_print_duration: null,
|
||||
last_status: null,
|
||||
last_total_duration: null,
|
||||
},
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private input_rules = [(value: string) => value.indexOf(' ') === -1 || 'Name contains spaces!']
|
||||
private isInvalidName = true
|
||||
private nameInputRules = [
|
||||
(value: string) => !!value || this.$t('Files.InvalidNameEmpty'),
|
||||
(value: string) => !this.existsFilename(value) || this.$t('Files.InvalidNameAlreadyExists'),
|
||||
]
|
||||
|
||||
existsFilename(name: string) {
|
||||
return this.files.findIndex((file) => file.filename === name) >= 0
|
||||
}
|
||||
|
||||
get gcodeInputFileAccept() {
|
||||
if (this.isIOS) return []
|
||||
|
||||
return validGcodeExtensions
|
||||
}
|
||||
|
||||
get currentPath() {
|
||||
const path = this.$store.state.gui.view.gcodefiles.currentPath
|
||||
@@ -822,6 +742,27 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
class: 'text-no-wrap',
|
||||
outputType: 'length',
|
||||
},
|
||||
{
|
||||
text: this.$t('Files.ExtruderTemp').toString(),
|
||||
value: 'first_layer_extr_temp',
|
||||
visible: true,
|
||||
class: 'text-no-wrap',
|
||||
outputType: 'temp',
|
||||
},
|
||||
{
|
||||
text: this.$t('Files.BedTemp').toString(),
|
||||
value: 'first_layer_bed_temp',
|
||||
visible: true,
|
||||
class: 'text-no-wrap',
|
||||
outputType: 'temp',
|
||||
},
|
||||
{
|
||||
text: this.$t('Files.ChamberTemp').toString(),
|
||||
value: 'chamber_temp',
|
||||
visible: true,
|
||||
class: 'text-no-wrap',
|
||||
outputType: 'temp',
|
||||
},
|
||||
{
|
||||
text: this.$t('Files.FilamentName').toString(),
|
||||
value: 'filament_name',
|
||||
@@ -1035,7 +976,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
e.preventDefault()
|
||||
e.target.parentElement.style.backgroundColor = 'transparent'
|
||||
|
||||
let dest = ''
|
||||
let dest: string
|
||||
if (row.filename === '..') {
|
||||
dest =
|
||||
this.currentPath.substring(0, this.currentPath.lastIndexOf('/') + 1) + this.draggingFile.item.filename
|
||||
@@ -1090,7 +1031,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
createDirectoryAction() {
|
||||
if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(' ') === -1) {
|
||||
if (this.dialogCreateDirectory.name.length) {
|
||||
this.dialogCreateDirectory.show = false
|
||||
this.$socket.emit(
|
||||
'server.files.post_directory',
|
||||
@@ -1108,13 +1049,17 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
)
|
||||
}
|
||||
|
||||
advancedSearch(value: string | number, search: string) {
|
||||
return (
|
||||
value != null &&
|
||||
search != null &&
|
||||
typeof value === 'string' &&
|
||||
value.toString().toLowerCase().indexOf(search.toLowerCase()) !== -1
|
||||
)
|
||||
advancedSearch(value: any, search: string | null) {
|
||||
if (search === null) return false
|
||||
if (typeof value !== 'string') return false
|
||||
|
||||
value = value.toString().toLowerCase()
|
||||
const searchSplits = search.toLowerCase().split(' ')
|
||||
for (const searchWord of searchSplits) {
|
||||
if (!value.includes(searchWord)) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
refreshMetadata(data: FileStateGcodefile[]) {
|
||||
@@ -1140,7 +1085,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
clickRowGoBack() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf('/'))
|
||||
this.currentPath = this.currentPath.slice(0, this.currentPath.lastIndexOf('/'))
|
||||
}
|
||||
|
||||
addToQueue(item: FileStateGcodefile | FileStateFile) {
|
||||
@@ -1154,7 +1099,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('gui/setGcodefilesMetadata', { name: name, value: value })
|
||||
}
|
||||
|
||||
showContextMenu(e: any, item: FileStateGcodefile | FileStateFile) {
|
||||
showContextMenu(e: any, item: FileStateGcodefile) {
|
||||
if (!this.contextMenu.shown) {
|
||||
e?.preventDefault()
|
||||
this.contextMenu.shown = true
|
||||
@@ -1167,29 +1112,6 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
preheat() {
|
||||
const file: any = this.contextMenu.item
|
||||
|
||||
if (
|
||||
'first_layer_extr_temp' in file &&
|
||||
'first_layer_bed_temp' in file &&
|
||||
!['error', 'printing', 'paused'].includes(this.printer_state)
|
||||
) {
|
||||
let gcode = ''
|
||||
if (file.first_layer_extr_temp > 0) {
|
||||
gcode = 'M104 S' + file.first_layer_extr_temp
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
if (file.first_layer_bed_temp > 0) {
|
||||
gcode = 'M140 S' + file.first_layer_bed_temp
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editFile(item: FileStateGcodefile) {
|
||||
this.$store.dispatch('editor/openFile', {
|
||||
root: 'gcodes',
|
||||
@@ -1290,6 +1212,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
count_printed: 0,
|
||||
preheat_gcode: null,
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
@@ -1317,7 +1240,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
view3D(item: FileStateFile) {
|
||||
this.$router.push({ path: '/viewer', query: { filename: this.currentPath + '/' + item.filename } })
|
||||
this.$router.push({ path: '/viewer', query: { filename: 'gcodes' + this.currentPath + '/' + item.filename } })
|
||||
}
|
||||
|
||||
deleteSelectedFiles() {
|
||||
@@ -1350,7 +1273,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
return formatFilesize(value)
|
||||
|
||||
case 'date':
|
||||
return this.formatDate(value)
|
||||
return this.formatDateTime(value)
|
||||
|
||||
case 'time':
|
||||
return this.formatPrintTime(value)
|
||||
@@ -1373,3 +1296,45 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.files-table .v-data-table-header__icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.files-table .file-list-cursor:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.file-list--select-td {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.files-table th.text-start {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-chip.minimum-chip {
|
||||
padding: 0;
|
||||
min-width: 24px;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-chip.minimum-chip .v-chip__content {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.file-list__count_printed {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -272,7 +272,9 @@
|
||||
<v-divider class="my-3"></v-divider>
|
||||
<v-row>
|
||||
<v-col>{{ $t('History.LastModified') }}</v-col>
|
||||
<v-col class="text-right">{{ formatDate(detailsDialog.item.metadata.modified) }}</v-col>
|
||||
<v-col class="text-right">
|
||||
{{ formatDateTime(detailsDialog.item.metadata.modified) }}
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<v-divider class="my-3"></v-divider>
|
||||
@@ -289,13 +291,13 @@
|
||||
<v-divider class="my-3"></v-divider>
|
||||
<v-row>
|
||||
<v-col>{{ $t('History.StartTime') }}</v-col>
|
||||
<v-col class="text-right">{{ formatDate(detailsDialog.item.start_time) }}</v-col>
|
||||
<v-col class="text-right">{{ formatDateTime(detailsDialog.item.start_time) }}</v-col>
|
||||
</v-row>
|
||||
<template v-if="'end_time' in detailsDialog.item && detailsDialog.item.end_time > 0">
|
||||
<v-divider class="my-3"></v-divider>
|
||||
<v-row>
|
||||
<v-col>{{ $t('History.EndTime') }}</v-col>
|
||||
<v-col class="text-right">{{ formatDate(detailsDialog.item.end_time) }}</v-col>
|
||||
<v-col class="text-right">{{ formatDateTime(detailsDialog.item.end_time) }}</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<template
|
||||
@@ -761,12 +763,6 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
this.$socket.emit('server.history.list', { start: 0, limit: 50 }, { action: 'server/history/getHistory' })
|
||||
}
|
||||
|
||||
formatDate(date: number) {
|
||||
const tmp2 = new Date(date * 1000)
|
||||
|
||||
return tmp2.toLocaleString().replace(',', '')
|
||||
}
|
||||
|
||||
formatPrintTime(totalSeconds: number) {
|
||||
if (totalSeconds) {
|
||||
let output = ''
|
||||
@@ -948,14 +944,24 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
|
||||
row.push('filename')
|
||||
row.push('status')
|
||||
|
||||
this.tableFields.forEach((col) => {
|
||||
row.push(col.value)
|
||||
})
|
||||
|
||||
if (this.headers.find((header) => header.value === 'slicer')?.visible) {
|
||||
row.push('slicer')
|
||||
}
|
||||
|
||||
content.push(row)
|
||||
|
||||
if (this.jobs.length) {
|
||||
this.jobs.forEach((job: ServerHistoryStateJob) => {
|
||||
let jobs = [...this.jobs]
|
||||
if (this.selectedJobs.length) {
|
||||
jobs = [...this.selectedJobs]
|
||||
}
|
||||
|
||||
if (jobs.length) {
|
||||
jobs.forEach((job: ServerHistoryStateJob) => {
|
||||
const row: string[] = []
|
||||
|
||||
let filename = job.filename
|
||||
@@ -1003,15 +1009,15 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
if (!format) {
|
||||
switch (col.outputType) {
|
||||
case 'date':
|
||||
return this.formatDate(value)
|
||||
return this.formatDateTime(value * 1000)
|
||||
|
||||
case 'time':
|
||||
return value.toFixed()
|
||||
return value?.toFixed() ?? ''
|
||||
|
||||
default:
|
||||
switch (typeof value) {
|
||||
case 'number':
|
||||
return value.toLocaleString()
|
||||
return value?.toLocaleString(undefined, { useGrouping: false }) ?? 0
|
||||
|
||||
case 'string':
|
||||
if (escapeChar !== null && value.includes(escapeChar)) value = '"' + value + '"'
|
||||
@@ -1028,18 +1034,18 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
return formatFilesize(value)
|
||||
|
||||
case 'date':
|
||||
return this.formatDate(value)
|
||||
return this.formatDateTime(value * 1000)
|
||||
|
||||
case 'time':
|
||||
return this.formatPrintTime(value)
|
||||
|
||||
case 'temp':
|
||||
return value.toFixed() + ' °C'
|
||||
return value?.toFixed() + ' °C'
|
||||
|
||||
case 'length':
|
||||
if (value > 1000) return (value / 1000).toFixed(2) + ' m'
|
||||
|
||||
return value.toFixed(2) + ' mm'
|
||||
return value?.toFixed(2) + ' mm'
|
||||
|
||||
default:
|
||||
return value
|
||||
|
||||
@@ -1,37 +1,88 @@
|
||||
<template>
|
||||
<panel
|
||||
v-if="klipperState !== 'ready' && socketIsConnected"
|
||||
:icon="mdiAlertCircle"
|
||||
:title="$t('Panels.KlippyStatePanel.KlippyState') + ': ' + klipperState"
|
||||
card-class="klippy-state-panel">
|
||||
<template v-if="klippyIsConnected">
|
||||
<v-card-text v-if="klippy_message !== null" class="py-1 mt-2">
|
||||
<pre style="white-space: pre-wrap">{{ klippy_message }}</pre>
|
||||
</v-card-text>
|
||||
<v-card-text v-else class="text-center py-3">
|
||||
<v-progress-circular indeterminate color="primary"></v-progress-circular>
|
||||
</v-card-text>
|
||||
<v-divider class="mt-2"></v-divider>
|
||||
<v-card-actions class="justify-start">
|
||||
<v-btn small class="ml-2 error--text" @click="restart">
|
||||
<v-icon class="mr-sm-2">{{ mdiRestart }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.Restart') }}
|
||||
</v-btn>
|
||||
<v-btn small class="ml-4 error--text" @click="firmwareRestart">
|
||||
<v-icon class="mr-sm-2">{{ mdiRestart }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.FirmwareRestart') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-card-text class="pt-5 pb-1">
|
||||
<div v-if="klipperState !== 'ready' && socketIsConnected">
|
||||
<v-container v-if="klippyIsConnected" class="pa-0 pb-6">
|
||||
<v-alert :color="messageType.color" dense text border="left" class="mb-0">
|
||||
<!-- KLIPPER MESSAGE TITLE -->
|
||||
<p class="font-weight-medium d-flex align-center">
|
||||
<v-icon :color="messageType.color" class="pr-2">{{ messageType.icon }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.ServiceReports', { service: 'Klipper' }) }}:
|
||||
{{ klipperState.toUpperCase() }}
|
||||
</p>
|
||||
<!-- KLIPPER MESSAGE -->
|
||||
<div v-if="klippy_message !== null">
|
||||
<pre style="white-space: pre-wrap">{{ klippy_message.trim() }}</pre>
|
||||
<v-divider class="mt-2 pb-3"></v-divider>
|
||||
<v-row>
|
||||
<!-- RESTART BUTTONS -->
|
||||
<v-col>
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
text
|
||||
:class="`${messageType.color}--text my-1`"
|
||||
style="width: 100%"
|
||||
@click="restart">
|
||||
<v-icon class="mr-sm-2">{{ mdiRestart }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.Restart') }}
|
||||
</v-btn>
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
text
|
||||
:class="`${messageType.color}--text my-1`"
|
||||
style="width: 100%"
|
||||
@click="firmwareRestart">
|
||||
<v-icon class="mr-sm-2">{{ mdiRestart }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.FirmwareRestart') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<!-- LOG DOWNLOAD BUTTONS -->
|
||||
<v-col>
|
||||
<v-btn
|
||||
:href="apiUrl + '/server/files/klippy.log'"
|
||||
small
|
||||
outlined
|
||||
text
|
||||
:class="`${messageType.color}--text my-1`"
|
||||
style="width: 100%"
|
||||
@click="downloadLog">
|
||||
<v-icon class="mr-2">{{ mdiDownload }}</v-icon>
|
||||
Klipper Log
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:href="apiUrl + '/server/files/moonraker.log'"
|
||||
small
|
||||
outlined
|
||||
text
|
||||
:class="`${messageType.color}--text my-1`"
|
||||
style="width: 100%"
|
||||
@click="downloadLog">
|
||||
<v-icon class="mr-2">{{ mdiDownload }}</v-icon>
|
||||
Moonraker Log
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<!-- LOADER -->
|
||||
<v-card-text v-else class="text-center py-3">
|
||||
<v-progress-circular indeterminate :color="messageType.color"></v-progress-circular>
|
||||
</v-card-text>
|
||||
</v-alert>
|
||||
</v-container>
|
||||
<!-- DISCONNECTED INFOGRAPHIC -->
|
||||
<v-container v-if="klipperState === 'disconnected'" class="pa-0">
|
||||
<v-alert dense text border="left">
|
||||
<p class="font-weight-medium d-flex align-center">
|
||||
<v-icon class="pr-2">{{ messageType.icon }}</v-icon>
|
||||
{{ $t('Panels.KlippyStatePanel.ServiceReports', { service: 'Moonraker' }) }}:
|
||||
{{ klipperState.toUpperCase() }}
|
||||
</p>
|
||||
<connection-status :moonraker="true" :klipper="false"></connection-status>
|
||||
<p class="mt-2 mb-0 text-center">{{ $t('Panels.KlippyStatePanel.MoonrakerCannotConnect') }}</p>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<p class="mt-2">{{ $t('Panels.KlippyStatePanel.KlipperCheck') }}</p>
|
||||
</v-card-text>
|
||||
</template>
|
||||
</panel>
|
||||
<p class="mb-0 text-center">{{ $t('Panels.KlippyStatePanel.KlipperCheck') }}</p>
|
||||
</v-alert>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -40,21 +91,43 @@ import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import ConnectionStatus from '../ui/ConnectionStatus.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiAlertCircle, mdiRestart } from '@mdi/js'
|
||||
import {
|
||||
mdiRestart,
|
||||
mdiDownload,
|
||||
mdiMessageOutline,
|
||||
mdiAlertOutline,
|
||||
mdiRocketLaunch,
|
||||
mdiConnection,
|
||||
mdiPrinter3d,
|
||||
} from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { Panel, ConnectionStatus },
|
||||
})
|
||||
export default class KlippyStatePanel extends Mixins(BaseMixin) {
|
||||
//private timer: number | null = null
|
||||
|
||||
mdiAlertCircle = mdiAlertCircle
|
||||
mdiPrinter3d = mdiPrinter3d
|
||||
mdiRestart = mdiRestart
|
||||
mdiDownload = mdiDownload
|
||||
|
||||
get klippy_message() {
|
||||
return this.$store.state.server.klippy_message ?? null
|
||||
}
|
||||
|
||||
get messageType(): { color: string; icon: string } {
|
||||
switch (this.klipperState) {
|
||||
case 'startup':
|
||||
return { color: 'info', icon: mdiRocketLaunch }
|
||||
case 'shutdown':
|
||||
return { color: 'warning', icon: mdiAlertOutline }
|
||||
case 'error':
|
||||
return { color: 'error', icon: mdiAlertOutline }
|
||||
case 'disconnected':
|
||||
return { color: '', icon: mdiConnection }
|
||||
default:
|
||||
return { color: '', icon: mdiMessageOutline }
|
||||
}
|
||||
}
|
||||
|
||||
restart() {
|
||||
this.$socket.emit('printer.restart', {}, { loading: 'restart' })
|
||||
}
|
||||
@@ -63,22 +136,13 @@ export default class KlippyStatePanel extends Mixins(BaseMixin) {
|
||||
this.$socket.emit('printer.firmware_restart', {}, { loading: 'firmwareRestart' })
|
||||
}
|
||||
|
||||
/*requestKlippyState() {
|
||||
this.$socket.emit('printer.info', {}, { action: 'printer/getInfo' })
|
||||
}
|
||||
downloadLog(event: any) {
|
||||
event.preventDefault()
|
||||
let href = ''
|
||||
if ('href' in event.target.attributes) href = event.target.attributes.href.value
|
||||
if ('href' in event.target.parentElement.attributes) href = event.target.parentElement.attributes.href.value
|
||||
|
||||
@Watch('klipperState')
|
||||
klipperStateChanged(newVal: string) {
|
||||
if (['ready', 'disconnected'].includes(newVal)) {
|
||||
if (this.timer) {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
} else if (this.timer === null) {
|
||||
this.timer = setInterval(() => {
|
||||
this.requestKlippyState()
|
||||
}, 2000)
|
||||
}
|
||||
}*/
|
||||
window.open(href)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -3,16 +3,17 @@
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.ConfigFiles')"
|
||||
:title="$t('Machine.ConfigFilesPanel.ConfigFiles').toString()"
|
||||
card-class="machine-configfiles-panel"
|
||||
:icon="mdiInformation">
|
||||
:icon="mdiInformation"
|
||||
:collapsible="true">
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-lg pr-lg-0">
|
||||
<v-select
|
||||
v-model="root"
|
||||
class="machine-configfiles-panel__root-select"
|
||||
:items="registeredDirectories"
|
||||
:items="registeredDirectoriesSelectItems"
|
||||
:label="$t('Machine.ConfigFilesPanel.Root')"
|
||||
outlined
|
||||
hide-details
|
||||
@@ -70,7 +71,7 @@
|
||||
{{ absolutePath }}
|
||||
</span>
|
||||
<v-spacer></v-spacer>
|
||||
<template v-if="disk_usage !== null">
|
||||
<template v-if="disk_usage !== null && !showMissingConfigRootWarning">
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">
|
||||
@@ -83,7 +84,8 @@
|
||||
<br />
|
||||
{{ $t('Machine.ConfigFilesPanel.Free') }}: {{ formatFilesize(disk_usage.free) }}
|
||||
<br />
|
||||
{{ $t('Machine.ConfigFilesPanel.Total') }}: {{ formatFilesize(disk_usage.total) }}
|
||||
{{ $t('Machine.ConfigFilesPanel.Total') }}:
|
||||
{{ formatFilesize(disk_usage.total) }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
@@ -92,6 +94,7 @@
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-data-table
|
||||
v-if="!showMissingConfigRootWarning"
|
||||
v-model="selectedFiles"
|
||||
:items="files"
|
||||
class="files-table"
|
||||
@@ -159,10 +162,26 @@
|
||||
<td class="text-no-wrap text-right">
|
||||
{{ item.isDirectory ? '--' : formatFilesize(item.size) }}
|
||||
</td>
|
||||
<td class="text-right">{{ formatDate(item.modified) }}</td>
|
||||
<td class="text-right">{{ formatDateTime(item.modified) }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-card-text v-else>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-lg pr-lg-0">
|
||||
<v-alert
|
||||
dense
|
||||
text
|
||||
type="warning"
|
||||
elevation="2"
|
||||
class="mx-auto mt-6"
|
||||
max-width="500"
|
||||
:icon="mdiLockOutline">
|
||||
{{ $t('Machine.ConfigFilesPanel.ConfigRootDirectoryDoesntExists') }}
|
||||
</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
@@ -244,7 +263,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateFile')"
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateFile').toString()"
|
||||
card-class="maschine-configfiles-create-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -258,6 +277,8 @@
|
||||
v-model="dialogCreateFile.name"
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="createFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -265,7 +286,7 @@
|
||||
<v-btn color="" text @click="dialogCreateFile.show = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="createFileAction">
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="createFileAction">
|
||||
{{ $t('Machine.ConfigFilesPanel.Create') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -273,7 +294,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameFile')"
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameFile').toString()"
|
||||
card-class="maschine-configfiles-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -287,6 +308,8 @@
|
||||
v-model="dialogRenameFile.newName"
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -294,7 +317,7 @@
|
||||
<v-btn color="" text @click="dialogRenameFile.show = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameFileAction">
|
||||
{{ $t('Machine.ConfigFilesPanel.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -302,7 +325,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateDirectory')"
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateDirectory').toString()"
|
||||
card-class="maschine-configfiles-create-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -316,6 +339,8 @@
|
||||
v-model="dialogCreateDirectory.name"
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -323,7 +348,7 @@
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="createDirectoryAction">
|
||||
{{ $t('Machine.ConfigFilesPanel.Create') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -331,7 +356,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameDirectory')"
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameDirectory').toString()"
|
||||
card-class="maschine-configfiles-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -345,6 +370,8 @@
|
||||
v-model="dialogRenameDirectory.newName"
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -352,7 +379,7 @@
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameDirectoryAction">
|
||||
{{ $t('Machine.ConfigFilesPanel.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -360,7 +387,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.DeleteDirectory')"
|
||||
:title="$t('Machine.ConfigFilesPanel.DeleteDirectory').toString()"
|
||||
card-class="maschine-configfiles-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -390,7 +417,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.Delete')"
|
||||
:title="$t('Machine.ConfigFilesPanel.Delete').toString()"
|
||||
card-class="gcode-files-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -435,7 +462,7 @@
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { formatDate, formatFilesize, sortFiles } from '@/plugins/helpers'
|
||||
import { formatFilesize, sortFiles } from '@/plugins/helpers'
|
||||
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
|
||||
import axios from 'axios'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
@@ -456,6 +483,7 @@ import {
|
||||
mdiRenameBox,
|
||||
mdiDelete,
|
||||
mdiCloseThick,
|
||||
mdiLockOutline,
|
||||
} from '@mdi/js'
|
||||
|
||||
interface contextMenu {
|
||||
@@ -521,10 +549,10 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
mdiRenameBox = mdiRenameBox
|
||||
mdiDelete = mdiDelete
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiLockOutline = mdiLockOutline
|
||||
|
||||
sortFiles = sortFiles
|
||||
formatFilesize = formatFilesize
|
||||
formatDate = formatDate
|
||||
|
||||
declare $refs: {
|
||||
fileUpload: HTMLInputElement
|
||||
@@ -618,6 +646,16 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private isInvalidName = true
|
||||
private nameInputRules = [
|
||||
(value: string) => !!value || this.$t('Files.InvalidNameEmpty'),
|
||||
(value: string) => !this.existsFilename(value) || this.$t('Files.InvalidNameAlreadyExists'),
|
||||
]
|
||||
|
||||
existsFilename(name: string) {
|
||||
return this.files.findIndex((file) => file.filename === name) >= 0
|
||||
}
|
||||
|
||||
get blockFileUpload() {
|
||||
return this.$store.state.gui.view.blockFileUpload ?? false
|
||||
}
|
||||
@@ -707,7 +745,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
let files = [...(this.directory?.childrens ?? [])]
|
||||
|
||||
if (!this.showHiddenFiles) {
|
||||
files = files.filter((file) => file.filename.substr(0, 1) !== '.')
|
||||
files = files.filter((file) => file.filename.slice(0, 1) !== '.')
|
||||
}
|
||||
|
||||
if (this.hideBackupFiles) {
|
||||
@@ -780,9 +818,26 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get registeredDirectories() {
|
||||
return this.$store.state.server.registered_directories
|
||||
.filter((dir: string) => !hiddenRootDirectories.includes(dir))
|
||||
.sort()
|
||||
return this.$store.state.server.registered_directories ?? []
|
||||
}
|
||||
|
||||
get existConfigRoot() {
|
||||
return this.registeredDirectories.findIndex((root: string) => root === 'config') !== -1
|
||||
}
|
||||
|
||||
get showMissingConfigRootWarning() {
|
||||
return (
|
||||
this.absolutePath.startsWith('/config') &&
|
||||
!this.absolutePath.startsWith('/config_example') &&
|
||||
!this.existConfigRoot
|
||||
)
|
||||
}
|
||||
|
||||
get registeredDirectoriesSelectItems() {
|
||||
const items = this.registeredDirectories.filter((dir: string) => !hiddenRootDirectories.includes(dir)).sort()
|
||||
if (!this.existConfigRoot) items.push('config')
|
||||
|
||||
return items
|
||||
}
|
||||
|
||||
get root() {
|
||||
@@ -853,7 +908,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
clickRowGoBack() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf('/'))
|
||||
this.currentPath = this.currentPath.slice(0, this.currentPath.lastIndexOf('/'))
|
||||
}
|
||||
|
||||
showContextMenu(e: any, item: FileStateFile) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<panel
|
||||
:title="$t('Machine.LogfilesPanel.Logfiles')"
|
||||
:title="$t('Machine.LogfilesPanel.Logfiles').toString()"
|
||||
:icon="mdiFileDocumentEdit"
|
||||
card-class="machine-logfiles-panel"
|
||||
:collapsible="true">
|
||||
@@ -28,6 +28,30 @@
|
||||
Moonraker
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="existsCrowsnestLog"
|
||||
:class="'col-12 pt-0 ' + (klipperState !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12') + ''">
|
||||
<v-btn
|
||||
:href="apiUrl + '/server/files/logs/crowsnest.log'"
|
||||
block
|
||||
class="primary--text"
|
||||
@click="downloadLog">
|
||||
<v-icon class="mr-2">{{ mdiDownload }}</v-icon>
|
||||
Crowsnest
|
||||
</v-btn>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="existsSonarLog"
|
||||
:class="'col-12 pt-0 ' + (klipperState !== 'ready' ? 'col-md-6 mt-md-3 ' : 'col-md-12') + ''">
|
||||
<v-btn
|
||||
:href="apiUrl + '/server/files/logs/sonar.log'"
|
||||
block
|
||||
class="primary--text"
|
||||
@click="downloadLog">
|
||||
<v-icon class="mr-2">{{ mdiDownload }}</v-icon>
|
||||
Sonar
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</v-card-text>
|
||||
@@ -38,6 +62,7 @@
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '../../mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { FileStateFile } from '@/store/files/types'
|
||||
import { mdiDownload, mdiFileDocumentEdit } from '@mdi/js'
|
||||
@Component({
|
||||
components: { Panel },
|
||||
@@ -46,6 +71,20 @@ export default class LogfilesPanel extends Mixins(BaseMixin) {
|
||||
mdiFileDocumentEdit = mdiFileDocumentEdit
|
||||
mdiDownload = mdiDownload
|
||||
|
||||
get logfiles() {
|
||||
return this.$store.getters['files/getDirectory']('logs')?.childrens ?? []
|
||||
}
|
||||
|
||||
get existsCrowsnestLog(): boolean {
|
||||
return this.logfiles.findIndex((log: FileStateFile) => log.filename === 'crowsnest.log') !== -1
|
||||
}
|
||||
|
||||
get existsSonarLog(): boolean {
|
||||
const sonarLog = this.logfiles.find((log: FileStateFile) => log.filename === 'sonar.log')
|
||||
|
||||
return sonarLog?.size > 0
|
||||
}
|
||||
|
||||
downloadLog(event: any) {
|
||||
event.preventDefault()
|
||||
let href = ''
|
||||
|
||||
@@ -9,16 +9,12 @@
|
||||
<v-row class="py-0 pr-4">
|
||||
<v-col class="pl-6">
|
||||
<strong style="cursor: pointer" @click="hostDetailsDialog = true">Host</strong>
|
||||
<template v-if="hostStats.cpuDesc">
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<small v-if="hostStats.cpuName" class="ml-2" v-bind="attrs" v-on="on">
|
||||
({{ hostStats.cpuName }})
|
||||
</small>
|
||||
</template>
|
||||
<span>{{ hostStats.cpuDesc }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<small v-if="hostStats.cpuName" class="ml-2" v-bind="attrs" v-on="on">({{ cpuName }})</small>
|
||||
</template>
|
||||
<span>{{ cpuDesc }}</span>
|
||||
</v-tooltip>
|
||||
<br />
|
||||
<div class="text-body-2">
|
||||
<div v-if="hostStats.version">
|
||||
@@ -27,16 +23,10 @@
|
||||
<div v-if="hostStats.os">
|
||||
{{ $t('Machine.SystemPanel.Values.Os', { os: hostStats.os }) }}
|
||||
</div>
|
||||
<div
|
||||
v-if="
|
||||
hostStats.release_info &&
|
||||
'name' in hostStats.release_info &&
|
||||
hostStats.release_info.name !== '0.'
|
||||
"
|
||||
class="text-no-wrap">
|
||||
<div v-if="releaseName" class="text-no-wrap">
|
||||
{{
|
||||
$t('Machine.SystemPanel.Values.Distro', {
|
||||
name: hostStats.release_info.name,
|
||||
name: releaseName,
|
||||
version_id: hostStats.release_info.version_id,
|
||||
})
|
||||
}}
|
||||
@@ -225,6 +215,15 @@ export default class SystemPanelHost extends Mixins(BaseMixin) {
|
||||
return this.$store.state.server?.system_info ?? {}
|
||||
}
|
||||
|
||||
get releaseName() {
|
||||
let name = this.hostStats.release_info?.name ?? ''
|
||||
|
||||
if (name.startsWith('#')) return this.hostStats.release_info?.id ?? null
|
||||
if (name.startsWith('0.')) return null
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
get directory() {
|
||||
return this.$store.getters['files/getDirectory']('gcodes')
|
||||
}
|
||||
@@ -258,5 +257,21 @@ export default class SystemPanelHost extends Mixins(BaseMixin) {
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get cpuDesc() {
|
||||
let output = this.hostStats.cpuDesc
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
get cpuName() {
|
||||
let output = this.hostStats.cpuName
|
||||
|
||||
if (this.hostStats.bits) {
|
||||
output += `, ${this.hostStats.bits}`
|
||||
}
|
||||
|
||||
return output
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -557,7 +557,9 @@ export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
output +=
|
||||
local_version +
|
||||
' > ' +
|
||||
this.$tc('Machine.UpdatePanel.CommitsAvailabe', commits_behind.length, { count: commits_behind.length })
|
||||
this.$tc('Machine.UpdatePanel.CommitsAvailable', commits_behind.length, {
|
||||
count: commits_behind.length,
|
||||
})
|
||||
else if ('full_version_string' in object && object.full_version_string !== '?')
|
||||
output += object.full_version_string
|
||||
else output += local_version
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<number-input
|
||||
:label="$t('Panels.MachineSettingsPanel.FirmwareRetractionSettings.RetractLength').toString()"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<number-input
|
||||
:label="$t('Panels.MachineSettingsPanel.FirmwareRetractionSettings.RetractSpeed').toString()"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<number-input
|
||||
:label="
|
||||
$t('Panels.MachineSettingsPanel.FirmwareRetractionSettings.UnretractExtraLength').toString()
|
||||
"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<number-input
|
||||
:label="$t('Panels.MachineSettingsPanel.FirmwareRetractionSettings.UnretractSpeed').toString()"
|
||||
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"></number-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</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'
|
||||
|
||||
@Component({
|
||||
components: { Panel, NumberInput },
|
||||
})
|
||||
export default class FirmwareRetractionSettings extends Mixins(BaseMixin) {
|
||||
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>
|
||||
@@ -6,21 +6,7 @@
|
||||
:collapsible="true"
|
||||
card-class="machine-settings-panel">
|
||||
<div>
|
||||
<template v-if="existsFirmwareRetraction">
|
||||
<sub-panel
|
||||
:title="$t('Panels.MachineSettingsPanel.MotionSettings.Motion').toString()"
|
||||
sub-panel-class="motion-settings-subpanel"
|
||||
class="py-3">
|
||||
<motion-settings class="pb-0"></motion-settings>
|
||||
</sub-panel>
|
||||
<sub-panel
|
||||
:title="$t('Panels.MachineSettingsPanel.FirmwareRetractionSettings.FirmwareRetraction').toString()"
|
||||
sub-panel-class="firmware-retraction-settings-subpanel"
|
||||
class="pb-3">
|
||||
<firmware-retraction-settings class="pb-0"></firmware-retraction-settings>
|
||||
</sub-panel>
|
||||
</template>
|
||||
<motion-settings v-else></motion-settings>
|
||||
<motion-settings></motion-settings>
|
||||
</div>
|
||||
</panel>
|
||||
</template>
|
||||
@@ -31,8 +17,6 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import SubPanel from '@/components/ui/SubPanel.vue'
|
||||
import MotionSettings from '@/components/panels/MachineSettings/MotionSettings.vue'
|
||||
import PressureAdvanceSettings from '@/components/panels/MachineSettings/PressureAdvanceSettings.vue'
|
||||
import FirmwareRetractionSettings from '@/components/panels/MachineSettings/FirmwareRetractionSettings.vue'
|
||||
import { mdiEngine } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
@@ -40,18 +24,9 @@ import { mdiEngine } from '@mdi/js'
|
||||
Panel,
|
||||
SubPanel,
|
||||
MotionSettings,
|
||||
PressureAdvanceSettings,
|
||||
FirmwareRetractionSettings,
|
||||
},
|
||||
})
|
||||
export default class MachineSettingsPanel extends Mixins(BaseMixin) {
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
mdiEngine = mdiEngine
|
||||
|
||||
get existsFirmwareRetraction() {
|
||||
return this.$store.state.printer.configfile?.settings?.firmware_retraction ?? false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -43,7 +43,7 @@ export default class MacrogroupPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get allMacros() {
|
||||
return this.$store.getters['printer/getAllMacros'] ?? []
|
||||
return this.$store.getters['printer/getMacros'] ?? []
|
||||
}
|
||||
|
||||
get macros() {
|
||||
|
||||
@@ -26,14 +26,21 @@ import BaseMixin from '../mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import MacroButton from '@/components/inputs/MacroButton.vue'
|
||||
import { mdiCodeTags } from '@mdi/js'
|
||||
import { PrinterStateMacro } from '@/store/printer/types'
|
||||
@Component({
|
||||
components: { MacroButton, Panel },
|
||||
})
|
||||
export default class MacrosPanel extends Mixins(BaseMixin) {
|
||||
mdiCodeTags = mdiCodeTags
|
||||
|
||||
get hiddenMacros() {
|
||||
return (this.$store.state.gui?.macros?.hiddenMacros ?? []).map((name: string) => name.toLowerCase())
|
||||
}
|
||||
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getMacros']
|
||||
const macros = this.$store.getters['printer/getMacros']
|
||||
|
||||
return macros.filter((macro: PrinterStateMacro) => !this.hiddenMacros.includes(macro.name.toLowerCase()))
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<template>
|
||||
<panel
|
||||
v-if="klipperReadyForGui && (miscellaneous.length || filamentSensors.length)"
|
||||
v-if="showMiscellaneousPanel"
|
||||
:icon="mdiDipSwitch"
|
||||
:title="$t('Panels.MiscellaneousPanel.Headline')"
|
||||
:collapsible="true"
|
||||
@@ -20,8 +20,21 @@
|
||||
:max="object.max_power"
|
||||
:multi="parseInt(object.scale)"></miscellaneous-slider>
|
||||
</div>
|
||||
<div v-for="(sensor, index) of filamentSensors" :key="'sensor_' + index">
|
||||
<div v-for="(light, index) of lights" :key="'light_' + light.name">
|
||||
<v-divider v-if="index || miscellaneous.length"></v-divider>
|
||||
<miscellaneous-slider
|
||||
v-if="light.type === 'led' && light.colorOrder.length === 1"
|
||||
:name="light.name"
|
||||
type="led"
|
||||
:rpm="null"
|
||||
:controllable="true"
|
||||
:pwm="true"
|
||||
:target="light.singleChannelTarget"
|
||||
:color-order="light.colorOrder" />
|
||||
<miscellaneous-light v-else :object="light" :root="true" />
|
||||
</div>
|
||||
<div v-for="(sensor, index) of filamentSensors" :key="'sensor_' + index">
|
||||
<v-divider v-if="index || miscellaneous.length || lights.length"></v-divider>
|
||||
<filament-sensor
|
||||
:name="sensor.name"
|
||||
:enabled="sensor.enabled"
|
||||
@@ -34,21 +47,32 @@
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import MiscellaneousSlider from '@/components/inputs/MiscellaneousSlider.vue'
|
||||
import MiscellaneousLight from '@/components/inputs/MiscellaneousLight.vue'
|
||||
import FilamentSensor from '@/components/inputs/FilamentSensor.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiDipSwitch } from '@mdi/js'
|
||||
@Component({
|
||||
components: { Panel, FilamentSensor, MiscellaneousSlider },
|
||||
components: { Panel, FilamentSensor, MiscellaneousSlider, MiscellaneousLight },
|
||||
})
|
||||
export default class MiscellaneousPanel extends Mixins(BaseMixin) {
|
||||
mdiDipSwitch = mdiDipSwitch
|
||||
|
||||
get filamentSensors() {
|
||||
return this.$store.getters['printer/getFilamentSensors'] ?? []
|
||||
}
|
||||
|
||||
get miscellaneous() {
|
||||
return this.$store.getters['printer/getMiscellaneous'] ?? []
|
||||
}
|
||||
|
||||
get filamentSensors() {
|
||||
return this.$store.getters['printer/getFilamentSensors'] ?? []
|
||||
get lights() {
|
||||
return this.$store.getters['printer/getLights'] ?? []
|
||||
}
|
||||
|
||||
get showMiscellaneousPanel() {
|
||||
return (
|
||||
this.klipperReadyForGui && (this.miscellaneous.length || this.filamentSensors.length || this.lights.length)
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -19,37 +19,29 @@
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="showDialog(item)">
|
||||
<td class="pr-0 text-center" style="width: 32px">
|
||||
<template v-if="item.small_thumbnail && item.big_thumbnail">
|
||||
<v-tooltip top content-class="tooltip__content-opacity1">
|
||||
<template v-if="item.small_thumbnail">
|
||||
<v-tooltip top content-class="tooltip__content-opacity1" :disabled="!item.big_thumbnail">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image class="d-flex">
|
||||
<img
|
||||
slot="image"
|
||||
:src="item.small_thumbnail"
|
||||
:alt="item.filename"
|
||||
width="32"
|
||||
height="32"
|
||||
v-bind="attrs"
|
||||
v-on="on" />
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
<div slot="preloader">
|
||||
<v-progress-circular indeterminate color="primary"></v-progress-circular>
|
||||
</div>
|
||||
<div slot="error">
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</div>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<span><img :src="item.big_thumbnail" width="250" /></span>
|
||||
<span><img :src="item.big_thumbnail" :alt="item.filename" width="250" /></span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template v-else-if="item.small_thumbnail">
|
||||
<vue-load-image>
|
||||
<img slot="image" :src="item.small_thumbnail" width="32" height="32" />
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</template>
|
||||
@@ -92,14 +84,9 @@
|
||||
{{ $t('Files.AddToQueue') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="
|
||||
'first_layer_extr_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_extr_temp > 0 &&
|
||||
'first_layer_bed_temp' in contextMenu.item &&
|
||||
contextMenu.item.first_layer_bed_temp > 0
|
||||
"
|
||||
v-if="contextMenu.item.preheat_gcode !== null"
|
||||
:disabled="['error', 'printing', 'paused'].includes(printer_state)"
|
||||
@click="preheat(contextMenu.item)">
|
||||
@click="doSend(contextMenu.item.preheat_gcode)">
|
||||
<v-icon class="mr-1">{{ mdiFire }}</v-icon>
|
||||
{{ $t('Files.Preheat') }}
|
||||
</v-list-item>
|
||||
@@ -127,7 +114,7 @@
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogRenameFile.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.RenameFile')"
|
||||
:title="$t('Files.RenameFile').toString()"
|
||||
card-class="dashboard-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -157,7 +144,8 @@
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
import { FileStateGcodefile } from '@/store/files/types'
|
||||
import StartPrintDialog from '@/components/dialogs/StartPrintDialog.vue'
|
||||
import {
|
||||
mdiFile,
|
||||
@@ -183,7 +171,7 @@ interface dialogRenameObject {
|
||||
StartPrintDialog,
|
||||
},
|
||||
})
|
||||
export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
export default class StatusPanelGcodefiles extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiFile = mdiFile
|
||||
mdiPlay = mdiPlay
|
||||
mdiPlaylistPlus = mdiPlaylistPlus
|
||||
@@ -225,32 +213,13 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
touchTimer: undefined,
|
||||
x: 0,
|
||||
y: 0,
|
||||
item: {
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
},
|
||||
item: { ...this.dialogFile },
|
||||
}
|
||||
|
||||
private dialogRenameFile: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
small_thumbnail: null,
|
||||
big_thumbnail: null,
|
||||
big_thumbnail_width: null,
|
||||
count_printed: 0,
|
||||
last_filament_used: null,
|
||||
last_start_time: null,
|
||||
last_end_time: null,
|
||||
last_print_duration: null,
|
||||
last_status: null,
|
||||
last_total_duration: null,
|
||||
},
|
||||
item: { ...this.dialogFile },
|
||||
}
|
||||
|
||||
get gcodeFiles() {
|
||||
@@ -278,7 +247,7 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
return `width: ${this.contentTdWidth}px;`
|
||||
}
|
||||
|
||||
showContextMenu(e: any, item: FileStateFile) {
|
||||
showContextMenu(e: any, item: FileStateGcodefile) {
|
||||
if (!this.contextMenu.shown) {
|
||||
e?.preventDefault()
|
||||
this.contextMenu.shown = true
|
||||
@@ -348,10 +317,6 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
return '--'
|
||||
}
|
||||
|
||||
getJobStatus(item: FileStateGcodefile) {
|
||||
return item.last_status
|
||||
}
|
||||
|
||||
getStatusIcon(status: string) {
|
||||
return this.$store.getters['server/history/getPrintStatusIcon'](status)
|
||||
}
|
||||
@@ -378,26 +343,6 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('server/jobQueue/addToQueue', [item.filename])
|
||||
}
|
||||
|
||||
preheat(item: FileStateGcodefile) {
|
||||
if (
|
||||
'first_layer_extr_temp' in item &&
|
||||
'first_layer_bed_temp' in item &&
|
||||
!['error', 'printing', 'paused'].includes(this.printer_state)
|
||||
) {
|
||||
if (item.first_layer_extr_temp && item.first_layer_extr_temp > 0) {
|
||||
const gcode = 'M104 S' + item.first_layer_extr_temp
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
if (item.first_layer_bed_temp && item.first_layer_bed_temp > 0) {
|
||||
const gcode = 'M140 S' + item.first_layer_bed_temp
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
view3D(item: FileStateGcodefile) {
|
||||
this.$router.push({ path: '/viewer', query: { filename: 'gcodes/' + item.filename } })
|
||||
}
|
||||
@@ -457,7 +402,9 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.calcContentTdWidth()
|
||||
setTimeout(() => {
|
||||
this.calcContentTdWidth()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
calcContentTdWidth() {
|
||||
|
||||
@@ -254,7 +254,9 @@ export default class StatusPanelJobqueue extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.calcContentTdWidth()
|
||||
setTimeout(() => {
|
||||
this.calcContentTdWidth()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
calcContentTdWidth() {
|
||||
|
||||
@@ -81,16 +81,16 @@
|
||||
<strong>{{ $t('Panels.StatusPanel.Estimate') }}</strong>
|
||||
<br />
|
||||
<span class="text-no-wrap">
|
||||
{{ estimated_time_avg ? formatTime(estimated_time_avg) : '--' }}
|
||||
{{ estimated_time_avg ? formatDuration(estimated_time_avg) : '--' }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="text-right">
|
||||
{{ $t('Panels.StatusPanel.File') }}:
|
||||
{{ estimated_time_file ? formatTime(estimated_time_file) : '--' }}
|
||||
{{ estimated_time_file ? formatDuration(estimated_time_file) : '--' }}
|
||||
<br />
|
||||
{{ $t('Panels.StatusPanel.Filament') }}:
|
||||
{{ estimated_time_filament ? formatTime(estimated_time_filament) : '--' }}
|
||||
{{ estimated_time_filament ? formatDuration(estimated_time_filament) : '--' }}
|
||||
</div>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
@@ -98,7 +98,7 @@
|
||||
<strong>{{ $t('Panels.StatusPanel.Slicer') }}</strong>
|
||||
<br />
|
||||
<span class="text-no-wrap">
|
||||
{{ estimated_time_slicer ? formatTime(estimated_time_slicer) : '--' }}
|
||||
{{ estimated_time_slicer ? formatDuration(estimated_time_slicer) : '--' }}
|
||||
</span>
|
||||
</v-col>
|
||||
<v-col class="col-3 pa-0">
|
||||
@@ -108,23 +108,23 @@
|
||||
<strong>{{ $t('Panels.StatusPanel.Total') }}</strong>
|
||||
<br />
|
||||
<span class="text-no-wrap">
|
||||
{{ print_time_total ? formatTime(print_time_total) : '--' }}
|
||||
{{ print_time_total ? formatDuration(print_time_total) : '--' }}
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="text-right">
|
||||
{{ $t('Panels.StatusPanel.Print') }}:
|
||||
{{ print_time ? formatTime(print_time) : '--' }}
|
||||
{{ print_time ? formatDuration(print_time) : '--' }}
|
||||
<br />
|
||||
{{ $t('Panels.StatusPanel.Difference') }}:
|
||||
{{ print_time && print_time_total ? formatTime(print_time_total - print_time) : '--' }}
|
||||
{{ print_time && print_time_total ? formatDuration(print_time_total - print_time) : '--' }}
|
||||
</div>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
<v-col class="col-3 pa-0">
|
||||
<strong>{{ $t('Panels.StatusPanel.ETA') }}</strong>
|
||||
<br />
|
||||
<span class="text-no-wrap">{{ outputEta }}</span>
|
||||
<span class="text-no-wrap">{{ eta }}</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
@@ -189,34 +189,11 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get max_layers() {
|
||||
if (
|
||||
'first_layer_height' in this.current_file &&
|
||||
'layer_height' in this.current_file &&
|
||||
'object_height' in this.current_file
|
||||
) {
|
||||
const max = Math.ceil(
|
||||
(this.current_file.object_height - this.current_file.first_layer_height) /
|
||||
this.current_file.layer_height +
|
||||
1
|
||||
)
|
||||
return max > 0 ? max : 0
|
||||
}
|
||||
|
||||
return 0
|
||||
return this.$store.getters['printer/getPrintMaxLayers'] ?? 0
|
||||
}
|
||||
|
||||
get current_layer() {
|
||||
if (this.print_time > 0 && 'first_layer_height' in this.current_file && 'layer_height' in this.current_file) {
|
||||
const gcodePositionZ = this.$store.state.printer.gcode_move?.gcode_position[2] ?? 0
|
||||
let current_layer = Math.ceil(
|
||||
(gcodePositionZ - this.current_file.first_layer_height) / this.current_file.layer_height + 1
|
||||
)
|
||||
current_layer = current_layer <= this.max_layers ? current_layer : this.max_layers
|
||||
|
||||
return current_layer > 0 ? current_layer : 0
|
||||
}
|
||||
|
||||
return 0
|
||||
return this.$store.getters['printer/getPrintCurrentLayer'] ?? 0
|
||||
}
|
||||
|
||||
get estimated_time_file() {
|
||||
@@ -236,11 +213,7 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get eta() {
|
||||
return this.$store.getters['printer/getEstimatedTimeETA']
|
||||
}
|
||||
|
||||
get outputEta() {
|
||||
return this.eta ? this.formatDateTime(this.eta) : '--'
|
||||
return this.$store.getters['printer/getEstimatedTimeETAFormat']
|
||||
}
|
||||
|
||||
get filament_diameter() {
|
||||
@@ -265,7 +238,7 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
|
||||
: this.filament_used.toFixed(2) + ' mm'
|
||||
}
|
||||
|
||||
formatTime(seconds: number) {
|
||||
formatDuration(seconds: number) {
|
||||
let h = Math.floor(seconds / 3600)
|
||||
seconds %= 3600
|
||||
let m = ('0' + Math.floor(seconds / 60)).slice(-2)
|
||||
@@ -273,14 +246,5 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
|
||||
|
||||
return h + ':' + m + ':' + s
|
||||
}
|
||||
|
||||
formatDateTime(msec: number) {
|
||||
const date = new Date(msec)
|
||||
const h = date.getHours() >= 10 ? date.getHours() : '0' + date.getHours()
|
||||
const m = date.getMinutes() >= 10 ? date.getMinutes() : '0' + date.getMinutes()
|
||||
|
||||
const diff = msec - new Date().getTime()
|
||||
return h + ':' + m + (diff > 60 * 60 * 24 * 1000 ? '+' + Math.round(diff / (60 * 60 * 24 * 1000)) : '')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,5 +1,3 @@
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<min-settings-panel></min-settings-panel>
|
||||
@@ -65,7 +63,7 @@
|
||||
<v-tab href="#jobqueue">{{ $t('Panels.StatusPanel.Jobqueue', { count: jobsCount }) }}</v-tab>
|
||||
</v-tabs>
|
||||
<v-divider class="my-0"></v-divider>
|
||||
<v-tabs-items v-model="activeTab">
|
||||
<v-tabs-items v-model="activeTab" class="_border-radius">
|
||||
<v-tab-item v-if="current_filename" value="status">
|
||||
<status-panel-printstatus></status-panel-printstatus>
|
||||
</v-tab-item>
|
||||
@@ -239,6 +237,10 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
return this.$store.state.printer.print_stats?.message ?? ''
|
||||
}
|
||||
|
||||
mounted() {
|
||||
if (this.current_filename !== '') this.activeTab = 'status'
|
||||
}
|
||||
|
||||
@Watch('current_filename')
|
||||
current_filenameChanged(newVal: string) {
|
||||
if (newVal === '') this.activeTab = 'files'
|
||||
@@ -280,3 +282,10 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
._border-radius {
|
||||
border-bottom-left-radius: inherit;
|
||||
border-bottom-right-radius: inherit;
|
||||
}
|
||||
</style>
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-divider></v-divider>
|
||||
<v-divider class="_fix_transparency"></v-divider>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="cooldown()">
|
||||
<div class="d-flex align-center _preset-title">
|
||||
@@ -81,7 +81,7 @@
|
||||
<v-card-text class="pa-0">
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
mobile: (el) => el.width <= 390,
|
||||
mobile: (el) => el.width <= 395,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-simple-table class="temperature-panel-table">
|
||||
@@ -120,9 +120,9 @@
|
||||
<td v-if="!el.is.mobile" class="state">
|
||||
<v-tooltip v-if="object.state !== null" top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<small v-bind="attrs" v-on="on">
|
||||
<div v-bind="attrs" v-on="on">
|
||||
{{ object.state }}
|
||||
</small>
|
||||
</div>
|
||||
</template>
|
||||
<span>{{ $t('Panels.TemperaturePanel.Avg') }}: {{ object.avgState }}</span>
|
||||
</v-tooltip>
|
||||
@@ -149,7 +149,7 @@
|
||||
{{ object.measured_min_temp }}°C
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<div v-for="(values, key) of object.additionSensors" :key="key">
|
||||
<div v-for="(values, key) of object.additionalSensors" :key="key">
|
||||
<span v-if="values.bool" class="d-block">
|
||||
<small>{{ values.value }} {{ values.unit }}</small>
|
||||
</span>
|
||||
@@ -203,11 +203,7 @@
|
||||
v-model="editHeater['bool' + dataset.charAt(0).toUpperCase() + dataset.slice(1)]"
|
||||
:label="
|
||||
$t('Panels.TemperaturePanel.ShowNameInChart', {
|
||||
name: $t(
|
||||
'Panels.TemperaturePanel.Dataset.' +
|
||||
dataset.charAt(0).toUpperCase() +
|
||||
dataset.slice(1)
|
||||
),
|
||||
name: $t(`Panels.TemperaturePanel.Dataset.${capitalize(dataset)}`),
|
||||
})
|
||||
"
|
||||
hide-details
|
||||
@@ -215,14 +211,14 @@
|
||||
@change="setVisible(dataset)"></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-for="key in Object.keys(editHeater.additionSensors)" :key="key">
|
||||
<v-row v-for="additionalSensor in editHeater.additionalSensors" :key="additionalSensor.name">
|
||||
<v-col class="col-12 py-1">
|
||||
<v-checkbox
|
||||
v-model="editHeater.additionSensors[key]['bool']"
|
||||
:label="$t('Panels.TemperaturePanel.ShowNameInList', { name: key })"
|
||||
v-model="additionalSensor.bool"
|
||||
:label="$t('Panels.TemperaturePanel.ShowNameInList', { name: additionalSensor.name })"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisibleAdditionalSensor(key)"></v-checkbox>
|
||||
@change="setVisibleAdditionalSensor(additionalSensor)"></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
@@ -244,24 +240,22 @@
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import { convertName } from '@/plugins/helpers'
|
||||
import { capitalize, convertName } from '@/plugins/helpers'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
|
||||
import { PrinterStateTemperatureObject } from '@/store/printer/types'
|
||||
import { PrinterStateAdditionalSensor, PrinterStateTemperatureObject } from '@/store/printer/types'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
import TempChart from '@/components/charts/TempChart.vue'
|
||||
import TemperatureInput from '@/components/inputs/TemperatureInput.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import { datasetTypes } from '@/store/variables'
|
||||
import { mdiCloseThick, mdiCog, mdiFan, mdiSnowflake, mdiFire, mdiMenuDown, mdiThermometerLines } from '@mdi/js'
|
||||
import { mdiCloseThick, mdiCog, mdiSnowflake, mdiFire, mdiMenuDown, mdiThermometerLines } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { Panel, TempChart, TemperatureInput, Responsive },
|
||||
})
|
||||
export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiFan = mdiFan
|
||||
mdiSnowflake = mdiSnowflake
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiCog = mdiCog
|
||||
@@ -270,7 +264,7 @@ export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiThermometerLines = mdiThermometerLines
|
||||
|
||||
convertName = convertName
|
||||
datasetTypes = datasetTypes
|
||||
capitalize = capitalize
|
||||
|
||||
private editHeater: any = {
|
||||
bool: false,
|
||||
@@ -280,7 +274,7 @@ export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
boolTarget: false,
|
||||
boolPower: false,
|
||||
boolSpeed: false,
|
||||
additionSensors: {},
|
||||
additionalSensors: {},
|
||||
color: '',
|
||||
}
|
||||
|
||||
@@ -353,7 +347,7 @@ export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.editHeater.boolTarget = this.$store.getters['gui/getDatasetValue']({ name: object.name, type: 'target' })
|
||||
this.editHeater.boolPower = this.$store.getters['gui/getDatasetValue']({ name: object.name, type: 'power' })
|
||||
this.editHeater.boolSpeed = this.$store.getters['gui/getDatasetValue']({ name: object.name, type: 'speed' })
|
||||
this.editHeater.additionSensors = object.additionSensors
|
||||
this.editHeater.additionalSensors = object.additionalSensors
|
||||
|
||||
this.editHeater.bool = true
|
||||
}
|
||||
@@ -366,9 +360,9 @@ export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.$store.dispatch('gui/saveSetting', { name, value })
|
||||
}
|
||||
|
||||
setVisibleAdditionalSensor(sensor: string): void {
|
||||
const name = 'view.tempchart.datasetSettings.' + this.editHeater.name + '.additionalSensors.' + sensor
|
||||
this.$store.dispatch('gui/saveSetting', { name, value: this.editHeater.additionSensors[sensor].bool })
|
||||
setVisibleAdditionalSensor(sensor: PrinterStateAdditionalSensor): void {
|
||||
const name = 'view.tempchart.datasetSettings.' + this.editHeater.name + '.additionalSensors.' + sensor.name
|
||||
this.$store.dispatch('gui/saveSetting', { name, value: sensor.bool })
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
@@ -426,4 +420,12 @@ export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
.temperature-panel-table .target {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
/*
|
||||
workaround for fixing a transparency issue
|
||||
which is assumingly a vuetify bug
|
||||
*/
|
||||
._fix_transparency {
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:title="$t('Timelapse.TimelapseFiles')"
|
||||
:title="$t('Timelapse.TimelapseFiles').toString()"
|
||||
:icon="mdiFileDocumentMultipleOutline"
|
||||
card-class="timelapse-files-panel">
|
||||
<v-card-text>
|
||||
@@ -32,6 +32,14 @@
|
||||
dense
|
||||
style="max-width: 300px"></v-text-field>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
v-if="selectedFiles.length"
|
||||
:title="$t('Timelapse.Delete')"
|
||||
color="error"
|
||||
class="px-2 minwidth-0 ml-3"
|
||||
@click="deleteSelectedDialog = true">
|
||||
<v-icon>{{ mdiDelete }}</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
v-if="directoryPermissions.includes('w')"
|
||||
:title="$t('Timelapse.CreateNewDirectory')"
|
||||
@@ -78,6 +86,7 @@
|
||||
</v-card-text>
|
||||
<v-divider class="mb-3"></v-divider>
|
||||
<v-data-table
|
||||
v-model="selectedFiles"
|
||||
:items="displayFiles"
|
||||
class="files-table"
|
||||
:headers="headers"
|
||||
@@ -90,10 +99,11 @@
|
||||
itemsPerPageAllText: $t('Timelapse.AllFiles'),
|
||||
itemsPerPageOptions: [10, 25, 50, 100, -1],
|
||||
}"
|
||||
item-key="name"
|
||||
item-key="filename"
|
||||
:search="search"
|
||||
:custom-filter="advancedSearch"
|
||||
mobile-breakpoint="0">
|
||||
mobile-breakpoint="0"
|
||||
show-select>
|
||||
<template slot="items">
|
||||
<td v-for="header in headers" :key="header.value">{{ header.text }}</td>
|
||||
</template>
|
||||
@@ -111,19 +121,26 @@
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template #item="{ index, item }">
|
||||
<template #item="{ index, item, isSelected, select }">
|
||||
<tr
|
||||
:key="`${index} ${item.filename}`"
|
||||
v-longpress:600="(e) => showContextMenu(e, item)"
|
||||
class="file-list-cursor user-select-none"
|
||||
@contextmenu="showContextMenu($event, item)"
|
||||
@click="clickRow(item)">
|
||||
<td class="pr-0 text-center" style="width: 32px">
|
||||
<td class="file-list__select-td pr-0">
|
||||
<v-simple-checkbox
|
||||
v-ripple
|
||||
:value="isSelected"
|
||||
class="pa-0 mr-0"
|
||||
@click.stop="select(!isSelected)"></v-simple-checkbox>
|
||||
</td>
|
||||
<td class="px-0 text-center" style="width: 32px">
|
||||
<template v-if="item.isDirectory">
|
||||
<v-icon>{{ mdiFolder }}</v-icon>
|
||||
<v-icon width="32">{{ mdiFolder }}</v-icon>
|
||||
</template>
|
||||
<template v-else-if="item.filename.endsWith('zip')">
|
||||
<v-icon>{{ mdiFolderZipOutline }}</v-icon>
|
||||
<v-icon width="32">{{ mdiFolderZipOutline }}</v-icon>
|
||||
</template>
|
||||
<template v-else-if="getThumbnail(item)">
|
||||
<v-tooltip
|
||||
@@ -139,11 +156,15 @@
|
||||
width="32"
|
||||
v-bind="attrs"
|
||||
v-on="on" />
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
<div slot="preloader">
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
</div>
|
||||
<div slot="error">
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</div>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<span><img :src="getThumbnail(item)" :alt="item.filename" width="250" /></span>
|
||||
@@ -160,7 +181,7 @@
|
||||
{{ item.isDirectory ? '--' : formatFilesize(item.size) }}
|
||||
</td>
|
||||
<td v-if="headers.find((header) => header.value === 'modified').visible" class="text-right">
|
||||
{{ formatDate(item.modified) }}
|
||||
{{ formatDateTime(item.modified) }}
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -169,38 +190,40 @@
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" @click="downloadFile(contextMenu.item.filename)">
|
||||
<v-icon left>{{ mdiCloudDownload }}</v-icon>
|
||||
<v-icon class="mr-1">{{ mdiCloudDownload }}</v-icon>
|
||||
{{ $t('Timelapse.Download') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
@click="renameDirectory(contextMenu.item)">
|
||||
<v-icon left>{{ mdiRenameBox }}</v-icon>
|
||||
<v-icon class="mr-1">{{ mdiRenameBox }}</v-icon>
|
||||
{{ $t('Timelapse.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="!contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
@click="renameFile(contextMenu.item)">
|
||||
<v-icon left>{{ mdiRenameBox }}</v-icon>
|
||||
<v-icon class="mr-1">{{ mdiRenameBox }}</v-icon>
|
||||
{{ $t('Timelapse.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="!contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
class="red--text"
|
||||
@click="removeFile">
|
||||
<v-icon left>{{ mdiDelete }}</v-icon>
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Timelapse.Delete') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
class="red--text"
|
||||
@click="deleteDirectory(contextMenu.item)">
|
||||
<v-icon left>{{ mdiDelete }}</v-icon>
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Timelapse.Delete') }}
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.RenameFile')"
|
||||
:title="$t('Timelapse.RenameFile').toString()"
|
||||
card-class="gcode-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -214,18 +237,22 @@
|
||||
v-model="dialogRenameFile.newName"
|
||||
:label="$t('Timelapse.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keypress.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogRenameFile.show = false">{{ $t('Timelapse.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="renameFileAction">{{ $t('Timelapse.Rename') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameFileAction">
|
||||
{{ $t('Timelapse.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.NewDirectory')"
|
||||
:title="$t('Timelapse.NewDirectory').toString()"
|
||||
card-class="gcode-files-new-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -238,8 +265,9 @@
|
||||
ref="inputFieldCreateDirectory"
|
||||
v-model="dialogCreateDirectory.name"
|
||||
:label="$t('Timelapse.Name')"
|
||||
:rules="input_rules"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keypress.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -247,13 +275,15 @@
|
||||
<v-btn color="" text @click="dialogCreateDirectory.show = false">
|
||||
{{ $t('Timelapse.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="createDirectoryAction">{{ $t('Timelapse.Create') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="createDirectoryAction">
|
||||
{{ $t('Timelapse.Create') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.RenameDirectory')"
|
||||
:title="$t('Timelapse.RenameDirectory').toString()"
|
||||
card-class="gcode-files-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -267,6 +297,8 @@
|
||||
v-model="dialogRenameDirectory.newName"
|
||||
:label="$t('Timelapse.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -274,13 +306,15 @@
|
||||
<v-btn color="" text @click="dialogRenameDirectory.show = false">
|
||||
{{ $t('Timelapse.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="renameDirectoryAction">{{ $t('Timelapse.Rename') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="renameDirectoryAction">
|
||||
{{ $t('Timelapse.Rename') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.DeleteDirectory')"
|
||||
:title="$t('Timelapse.DeleteDirectory').toString()"
|
||||
card-class="gcode-files-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -304,7 +338,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="boolVideoDialog" :max-width="700">
|
||||
<panel
|
||||
:title="$t('Timelapse.Video')"
|
||||
:title="$t('Timelapse.Video').toString()"
|
||||
:icon="mdiFileVideo"
|
||||
card-class="timelapse-video-dialog"
|
||||
:margin-bottom="false">
|
||||
@@ -337,13 +371,33 @@
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.Delete').toString()"
|
||||
card-class="timelapse-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteSelectedDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">{{ $t('Timelapse.DeleteSelectedQuestion', { count: selectedFiles.length }) }}</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteSelectedDialog = false">{{ $t('Timelapse.Cancel') }}</v-btn>
|
||||
<v-btn color="error" text @click="deleteSelectedFiles">{{ $t('Timelapse.Delete') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { formatFilesize, formatDate, sortFiles } from '@/plugins/helpers'
|
||||
import { FileStateFile } from '@/store/files/types'
|
||||
import { formatFilesize, sortFiles } from '@/plugins/helpers'
|
||||
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import {
|
||||
mdiFolderPlus,
|
||||
@@ -371,7 +425,6 @@ interface dialogRenameObject {
|
||||
components: { Panel },
|
||||
})
|
||||
export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
formatDate = formatDate
|
||||
formatFilesize = formatFilesize
|
||||
sortFiles = sortFiles
|
||||
|
||||
@@ -451,11 +504,21 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
},
|
||||
}
|
||||
|
||||
private input_rules = [(value: string) => value.indexOf(' ') === -1 || 'Name contains spaces!']
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private isInvalidName = true
|
||||
private nameInputRules = [
|
||||
(value: string) => !!value || this.$t('Files.InvalidNameEmpty'),
|
||||
(value: string) => !this.existsFilename(value) || this.$t('Files.InvalidNameAlreadyExists'),
|
||||
]
|
||||
|
||||
existsFilename(name: string) {
|
||||
return this.files.findIndex((file) => file.filename === name) >= 0
|
||||
}
|
||||
|
||||
get headers() {
|
||||
return [
|
||||
{ text: '', value: '', align: 'left', configable: false, visible: true, filterable: false },
|
||||
{ text: '', value: '', align: 'left', configable: false, visible: true, sortable: false },
|
||||
{ text: this.$t('Timelapse.Name'), value: 'filename', align: 'left', configable: false, visible: true },
|
||||
{ text: this.$t('Timelapse.Filesize'), value: 'size', align: 'right', configable: true, visible: true },
|
||||
{
|
||||
@@ -530,6 +593,14 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('gui/saveSettingWithoutUpload', { name: 'view.timelapse.currentPath', value: newVal })
|
||||
}
|
||||
|
||||
get selectedFiles() {
|
||||
return this.$store.state.gui.view.timelapse.selectedFiles ?? []
|
||||
}
|
||||
|
||||
set selectedFiles(newVal) {
|
||||
this.$store.dispatch('gui/saveSettingWithoutUpload', { name: 'view.timelapse.selectedFiles', value: newVal })
|
||||
}
|
||||
|
||||
createDirectory() {
|
||||
this.dialogCreateDirectory.name = ''
|
||||
this.dialogCreateDirectory.show = true
|
||||
@@ -540,14 +611,15 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
createDirectoryAction() {
|
||||
if (this.dialogCreateDirectory.name.length && this.dialogCreateDirectory.name.indexOf(' ') === -1) {
|
||||
this.dialogCreateDirectory.show = false
|
||||
this.$socket.emit(
|
||||
'server.files.post_directory',
|
||||
{ path: this.currentPath + '/' + this.dialogCreateDirectory.name },
|
||||
{ action: 'files/getCreateDir' }
|
||||
)
|
||||
}
|
||||
this.dialogCreateDirectory.show = false
|
||||
|
||||
this.$socket.emit(
|
||||
'server.files.post_directory',
|
||||
{
|
||||
path: this.currentPath + '/' + this.dialogCreateDirectory.name,
|
||||
},
|
||||
{ action: 'files/getCreateDir' }
|
||||
)
|
||||
}
|
||||
|
||||
refreshFileList() {
|
||||
@@ -590,7 +662,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
clickRowGoBack() {
|
||||
this.currentPath = this.currentPath.substr(0, this.currentPath.lastIndexOf('/'))
|
||||
this.currentPath = this.currentPath.slice(0, this.currentPath.lastIndexOf('/'))
|
||||
}
|
||||
|
||||
showContextMenu(e: any, item: FileStateFile) {
|
||||
@@ -608,7 +680,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
existsFramesZip(item: FileStateFile) {
|
||||
const posLastPoint = item.filename.lastIndexOf('.')
|
||||
const zipFilename = item.filename.substr(0, posLastPoint) + '.zip'
|
||||
const zipFilename = item.filename.slice(0, posLastPoint) + '.zip'
|
||||
|
||||
return this.files.findIndex((file) => file.filename === zipFilename) !== -1
|
||||
}
|
||||
@@ -622,7 +694,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
renameFile(item: FileStateFile) {
|
||||
const posLastPoint = item.filename.lastIndexOf('.')
|
||||
this.dialogRenameFile.newName = item.filename.substr(0, posLastPoint)
|
||||
this.dialogRenameFile.newName = item.filename.slice(0, posLastPoint)
|
||||
|
||||
this.dialogRenameFile.item = item
|
||||
this.dialogRenameFile.show = true
|
||||
@@ -634,23 +706,35 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
renameFileAction() {
|
||||
const posLastPoint = this.dialogRenameFile.item.filename.lastIndexOf('.')
|
||||
const oldNameWithoutExtension = this.dialogRenameFile.item.filename.substr(0, posLastPoint)
|
||||
const oldNameWithoutExtension = this.dialogRenameFile.item.filename.slice(0, posLastPoint)
|
||||
const fileExtension = this.dialogRenameFile.item.filename.split('.').pop()
|
||||
|
||||
this.dialogRenameFile.show = false
|
||||
|
||||
/**
|
||||
* rename the file regardless of its file-extension
|
||||
*/
|
||||
this.$socket.emit(
|
||||
'server.files.move',
|
||||
{
|
||||
source: this.currentPath + '/' + this.dialogRenameFile.item.filename,
|
||||
dest: this.currentPath + '/' + this.dialogRenameFile.newName + '.mp4',
|
||||
source: `${this.currentPath}/${this.dialogRenameFile.item.filename}`,
|
||||
dest: `${this.currentPath}/${this.dialogRenameFile.newName}.${fileExtension}`,
|
||||
},
|
||||
{ action: 'files/getMove' }
|
||||
)
|
||||
|
||||
const fileJpg = this.files.find((file) => file.filename === oldNameWithoutExtension + '.jpg')
|
||||
if (fileExtension !== 'mp4') return
|
||||
|
||||
/**
|
||||
* mp4 and jpg always require to have the same name as the
|
||||
* jpg is used as a mp4-thumbnail in the timelapse file-browser
|
||||
*/
|
||||
const fileJpg = this.files.find((file) => file.filename === `${oldNameWithoutExtension}.jpg`)
|
||||
|
||||
if (fileJpg) {
|
||||
this.$socket.emit('server.files.move', {
|
||||
source: this.currentPath + '/' + oldNameWithoutExtension + '.jpg',
|
||||
dest: this.currentPath + '/' + this.dialogRenameFile.newName + '.jpg',
|
||||
source: `${this.currentPath}/${oldNameWithoutExtension}.jpg`,
|
||||
dest: `${this.currentPath}/${this.dialogRenameFile.newName}.jpg`,
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -679,6 +763,22 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
removeFile() {
|
||||
const filename = this.contextMenu.item.filename.slice(0, this.contextMenu.item.filename.lastIndexOf('.'))
|
||||
const fileExtension = this.contextMenu.item.filename.split('.').pop()
|
||||
|
||||
/**
|
||||
* delete the file regardless of its file-extension
|
||||
*/
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: this.currentPath + '/' + this.contextMenu.item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
if (fileExtension !== 'mp4') return
|
||||
|
||||
/**
|
||||
* if file-extension is mp4, also delete its corresponding thumbnail jpg
|
||||
*/
|
||||
const previewFilename = filename + '.jpg'
|
||||
const previewExists = this.files.findIndex((file) => file.filename === previewFilename) !== -1
|
||||
|
||||
@@ -688,11 +788,6 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
{ path: this.currentPath + '/' + previewFilename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: this.currentPath + '/' + this.contextMenu.item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
}
|
||||
|
||||
deleteDirectory(item: FileStateFile) {
|
||||
@@ -708,5 +803,44 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
{ action: 'files/getDeleteDir' }
|
||||
)
|
||||
}
|
||||
|
||||
deleteSelectedFiles() {
|
||||
this.selectedFiles.forEach((item: FileStateGcodefile) => {
|
||||
if (item.isDirectory) {
|
||||
this.$socket.emit(
|
||||
'server.files.delete_directory',
|
||||
{ path: this.currentPath + '/' + item.filename, force: true },
|
||||
{ action: 'files/getDeleteDir' }
|
||||
)
|
||||
} else {
|
||||
const filename = item.filename.slice(0, item.filename.lastIndexOf('.'))
|
||||
const fileExtension = item.filename.split('.').pop()
|
||||
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: this.currentPath + '/' + item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
if (fileExtension !== 'mp4') return
|
||||
|
||||
/**
|
||||
* if file-extension is mp4, also delete its corresponding thumbnail jpg
|
||||
*/
|
||||
const previewFilename = filename + '.jpg'
|
||||
const previewExists = this.files.findIndex((file) => file.filename === previewFilename) !== -1
|
||||
|
||||
if (previewExists)
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: this.currentPath + '/' + previewFilename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
this.selectedFiles = []
|
||||
this.deleteSelectedDialog = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,58 +1,75 @@
|
||||
<template>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
small: (el) => el.width <= 320,
|
||||
xsmall: (el) => el.width <= 320,
|
||||
small: (el) => el.width > 320 && el.width <= 460,
|
||||
medium: (el) => el.width > 460 && el.width <= 560,
|
||||
large: (el) => el.width > 560,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-container class="py-0">
|
||||
<v-row>
|
||||
<v-col class="v-subheader text--secondary pr-0">
|
||||
<v-icon small class="mr-2">
|
||||
<v-row class="flex-nowrap pb-1">
|
||||
<v-col
|
||||
:class="{
|
||||
'col-5': el.is.small,
|
||||
'col-4': el.is.xsmall || el.is.medium,
|
||||
'col-3': el.is.large,
|
||||
}"
|
||||
class="v-subheader text--secondary mr-2">
|
||||
<v-icon small class="mr-1">
|
||||
{{ mdiCrosshairsGps }}
|
||||
</v-icon>
|
||||
<span>{{ $t('Panels.ToolheadControlPanel.Position') }}: {{ displayPositionAbsolute }}</span>
|
||||
<span v-if="!el.is.xsmall" class="text-no-wrap">
|
||||
{{ $t('Panels.ToolheadControlPanel.Position') }}:
|
||||
</span>
|
||||
<span class="text-no-wrap">{{ displayPositionAbsolute }}</span>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="currentProfileName"
|
||||
class="v-subheader text--secondary pl-2 justify-end text-no-wrap text-truncate">
|
||||
<v-icon small class="mr-1">
|
||||
{{ mdiGrid }}
|
||||
</v-icon>
|
||||
<span class="text-no-wrap text-truncate">
|
||||
{{ currentProfileName }}
|
||||
</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row dense>
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.x.pos"
|
||||
:label="livePositions.x"
|
||||
:suffix="'X'"
|
||||
:step="0.01"
|
||||
:current-pos="gcodePositions.x"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!xAxisHomed"
|
||||
@submit="sendCmd"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.y.pos"
|
||||
:label="livePositions.y"
|
||||
:suffix="'Y'"
|
||||
:step="0.01"
|
||||
:current-pos="gcodePositions.y"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!yAxisHomed"
|
||||
@submit="sendCmd"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.xsmall ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.z.pos"
|
||||
:label="livePositions.z"
|
||||
:suffix="'Z'"
|
||||
:step="0.001"
|
||||
:current-pos="gcodePositions.z"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!zAxisHomed"
|
||||
@submit="sendCmd"></move-to-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-form class="pt-3" @keyup.native.enter="sendCmd">
|
||||
<v-row dense>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.x.pos"
|
||||
:label="livePositions.x"
|
||||
:suffix="'X'"
|
||||
:position-max="stepperXmax"
|
||||
:position-min="stepperXmin"
|
||||
:current-pos="gcodePositions.x"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!xAxisHomed"
|
||||
@validate="validate"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.y.pos"
|
||||
:label="livePositions.y"
|
||||
:suffix="'Y'"
|
||||
:position-max="stepperYmax"
|
||||
:position-min="stepperYmin"
|
||||
:current-pos="gcodePositions.y"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!yAxisHomed"
|
||||
@validate="validate"></move-to-input>
|
||||
</v-col>
|
||||
<v-col :class="el.is.small ? 'col-12' : 'col-4'">
|
||||
<move-to-input
|
||||
v-model="input.z.pos"
|
||||
:label="livePositions.z"
|
||||
:suffix="'Z'"
|
||||
:position-max="stepperZmax"
|
||||
:position-min="stepperZmin"
|
||||
:current-pos="gcodePositions.z"
|
||||
:readonly="['printing'].includes(printer_state)"
|
||||
:disabled="!zAxisHomed"
|
||||
@validate="validate"></move-to-input>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-form>
|
||||
</v-container>
|
||||
</template>
|
||||
</responsive>
|
||||
@@ -64,13 +81,14 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
import MoveToInput from '@/components/inputs/MoveToInput.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import { mdiCrosshairsGps } from '@mdi/js'
|
||||
import { mdiCrosshairsGps, mdiGrid } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { MoveToInput, Responsive },
|
||||
})
|
||||
export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiCrosshairsGps = mdiCrosshairsGps
|
||||
mdiGrid = mdiGrid
|
||||
|
||||
input: { [index: string]: any } = {
|
||||
x: { pos: '', valid: true },
|
||||
@@ -78,10 +96,6 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
z: { pos: '', valid: true },
|
||||
}
|
||||
|
||||
validate(event: { axis: string; valid: boolean }): void {
|
||||
this.input[event.axis].valid = event.valid
|
||||
}
|
||||
|
||||
@Watch('gcodePositions.x', { immediate: true })
|
||||
updatePositionX(newVal: string): void {
|
||||
this.input.x.pos = newVal
|
||||
@@ -97,33 +111,6 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.input.z.pos = newVal
|
||||
}
|
||||
|
||||
/**
|
||||
* Axis limits
|
||||
*/
|
||||
get stepperXmin(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_min ?? Number.NEGATIVE_INFINITY
|
||||
}
|
||||
|
||||
get stepperXmax(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_x?.position_max ?? Number.POSITIVE_INFINITY
|
||||
}
|
||||
|
||||
get stepperYmin(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_min ?? Number.NEGATIVE_INFINITY
|
||||
}
|
||||
|
||||
get stepperYmax(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_y?.position_max ?? Number.POSITIVE_INFINITY
|
||||
}
|
||||
|
||||
get stepperZmin(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_z?.position_min ?? Number.NEGATIVE_INFINITY
|
||||
}
|
||||
|
||||
get stepperZmax(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.stepper_z?.position_max ?? Number.POSITIVE_INFINITY
|
||||
}
|
||||
|
||||
/**
|
||||
* Axes positions and positioning mode (G90 / G91)
|
||||
*/
|
||||
@@ -155,6 +142,17 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currently loaded bed mesh profile name
|
||||
*/
|
||||
get bed_mesh() {
|
||||
return this.$store.state.printer.bed_mesh ?? null
|
||||
}
|
||||
|
||||
get currentProfileName() {
|
||||
return this.bed_mesh?.profile_name ?? ''
|
||||
}
|
||||
|
||||
sendCmd(): void {
|
||||
const xPos = this.input.x.pos !== this.gcodePositions.x ? ` X${this.input.x.pos}` : ''
|
||||
const yPos = this.input.y.pos !== this.gcodePositions.y ? ` Y${this.input.y.pos}` : ''
|
||||
|
||||
@@ -1,49 +1,3 @@
|
||||
<style lang="scss" 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);
|
||||
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>
|
||||
|
||||
<template>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
@@ -125,7 +79,7 @@
|
||||
small
|
||||
class="_btn-qs flex-grow-1 px-1"
|
||||
@click="sendBabyStepUp(offset)">
|
||||
<v-icon v-if="index === 0 && !el.is.xsmall" left small class="mr-1 ml-1">
|
||||
<v-icon v-if="index === 0 && !el.is.xsmall" left small class="mr-1 ml-n1">
|
||||
{{ mdiArrowExpandUp }}
|
||||
</v-icon>
|
||||
<span>+{{ offset }}</span>
|
||||
@@ -134,14 +88,31 @@
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col :class="!el.is.medium ? 'order-0 col-6' : 'col-12'">
|
||||
<v-item-group class="_btn-group">
|
||||
<v-item-group v-if="!el.is.medium" class="_btn-group">
|
||||
<v-btn
|
||||
v-for="(offset, index) in offsetsZ.slice().reverse()"
|
||||
:key="`offsetsDown-${index}`"
|
||||
small
|
||||
class="_btn-qs flex-grow-1 px-1"
|
||||
@click="sendBabyStepDown(offset)">
|
||||
<span>−{{ offset }}</span>
|
||||
<v-icon
|
||||
v-if="index === offsetsZ.length - 1 && !el.is.xsmall"
|
||||
left
|
||||
small
|
||||
class="mr-n1 ml-1">
|
||||
{{ mdiArrowCollapseDown }}
|
||||
</v-icon>
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
<v-item-group v-else class="_btn-group">
|
||||
<v-btn
|
||||
v-for="(offset, index) in offsetsZ"
|
||||
:key="`offsetsDown-${index}`"
|
||||
small
|
||||
class="_btn-qs flex-grow-1 px-1"
|
||||
@click="sendBabyStepDown(offset)">
|
||||
<v-icon v-if="index === 0 && !el.is.xsmall" left small class="mr-1 ml-1">
|
||||
<v-icon v-if="index === 0 && !el.is.xsmall" left small class="mr-1 ml-n1">
|
||||
{{ mdiArrowCollapseDown }}
|
||||
</v-icon>
|
||||
<span>−{{ offset }}</span>
|
||||
@@ -295,3 +266,49 @@ export default class ZoffsetControl extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" 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);
|
||||
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>
|
||||
@@ -4,6 +4,13 @@
|
||||
<div>
|
||||
<v-card v-if="!form.bool" flat>
|
||||
<v-card-text>
|
||||
<div class="d-flex align-center">
|
||||
<v-icon style="opacity: 0.7">{{ mdiConsoleLine }}</v-icon>
|
||||
<v-card-title class="mx-n2">
|
||||
{{ $t('Settings.ConsoleTab.Console') }}
|
||||
</v-card-title>
|
||||
<v-divider class="ml-3"></v-divider>
|
||||
</div>
|
||||
<settings-row :title="$t('Settings.ConsoleTab.Direction').toString()">
|
||||
<v-select
|
||||
v-model="consoleDirection"
|
||||
@@ -34,7 +41,13 @@
|
||||
:label="consoleHeightTmp + 'px'"
|
||||
@change="updateConsoleHeight"></v-slider>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<div class="d-flex align-center">
|
||||
<v-icon style="opacity: 0.7">{{ mdiFilter }}</v-icon>
|
||||
<v-card-title class="mx-n2">
|
||||
{{ $t('Settings.ConsoleTab.Filters') }}
|
||||
</v-card-title>
|
||||
<v-divider class="ml-3"></v-divider>
|
||||
</div>
|
||||
<settings-row :title="$t('Settings.ConsoleTab.HideTemperatures').toString()" :dynamic-slot-width="true">
|
||||
<v-switch v-model="hideWaitTemperatures" hide-details class="mt-0"></v-switch>
|
||||
</settings-row>
|
||||
@@ -122,7 +135,7 @@ import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import { mdiFilter, mdiPencil, mdiFilterOff, mdiDelete } from '@mdi/js'
|
||||
import { mdiFilter, mdiPencil, mdiFilterOff, mdiDelete, mdiConsoleLine } from '@mdi/js'
|
||||
|
||||
interface consoleForm {
|
||||
bool: boolean
|
||||
@@ -140,6 +153,7 @@ export default class SettingsConsoleTab extends Mixins(BaseMixin) {
|
||||
mdiFilterOff = mdiFilterOff
|
||||
mdiPencil = mdiPencil
|
||||
mdiDelete = mdiDelete
|
||||
mdiConsoleLine = mdiConsoleLine
|
||||
|
||||
private form: consoleForm = {
|
||||
bool: false,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn-toggle v-model="currentViewport" class="mx-auto">
|
||||
<v-btn-toggle v-model="currentViewport" class="mx-auto" mandatory>
|
||||
<v-btn value="mobile">
|
||||
<span class="hidden-sm-and-down">{{ $t('Settings.DashboardTab.Mobile') }}</span>
|
||||
<v-icon right class="hidden-sm-and-down">{{ mdiCellphone }}</v-icon>
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
@@ -14,34 +7,34 @@
|
||||
<v-list dense>
|
||||
<v-list-item>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-col class="col-auto pr-0 pl-8">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ $t('Panels.StatusPanel.Headline') }}
|
||||
</v-col>
|
||||
<v-col class="col-auto">
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-icon color="grey lighten-1">{{ mdiLock }}</v-icon>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<draggable
|
||||
v-model="desktopLayout1"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="desktopViewport">
|
||||
<template v-for="element in desktopLayout1">
|
||||
<v-list-item :key="'item-desktop-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-desktop-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -67,21 +60,21 @@
|
||||
<v-list dense>
|
||||
<draggable
|
||||
v-model="desktopLayout2"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="desktopViewport">
|
||||
<template v-for="element in desktopLayout2">
|
||||
<v-list-item :key="'item-desktop-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-desktop-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -116,9 +109,9 @@
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import draggable from 'vuedraggable'
|
||||
import { capitalize, convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import { mdiInformation, mdiCheckboxMarked, mdiCheckboxBlankOutline, mdiLock, mdiArrowUpDown } from '@mdi/js'
|
||||
import { mdiInformation, mdiCheckboxMarked, mdiCheckboxBlankOutline, mdiLock, mdiDragVertical } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -126,19 +119,17 @@ import { mdiInformation, mdiCheckboxMarked, mdiCheckboxBlankOutline, mdiLock, md
|
||||
},
|
||||
})
|
||||
export default class SettingsDashboardTabDesktop extends Mixins(DashboardMixin) {
|
||||
capitalize = capitalize
|
||||
convertPanelnameToIcon = convertPanelnameToIcon
|
||||
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
|
||||
mdiLock = mdiLock
|
||||
mdiInformation = mdiInformation
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
mdiCheckboxMarked = mdiCheckboxMarked
|
||||
mdiCheckboxBlankOutline = mdiCheckboxBlankOutline
|
||||
|
||||
convertPanelnameToIcon = convertPanelnameToIcon
|
||||
|
||||
get desktopLayout1() {
|
||||
let panels = this.$store.getters['gui/getPanels']('desktopLayout1')
|
||||
panels = panels.concat(this.missingPanelsDesktop)
|
||||
@@ -188,3 +179,14 @@ export default class SettingsDashboardTabDesktop extends Mixins(DashboardMixin)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,3 @@
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
@@ -14,34 +7,34 @@
|
||||
<v-list dense>
|
||||
<v-list-item>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-col class="col-auto pr-0 pl-8">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ $t('Panels.StatusPanel.Headline') }}
|
||||
</v-col>
|
||||
<v-col class="col-auto">
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-icon color="grey lighten-1">{{ mdiLock }}</v-icon>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<draggable
|
||||
v-model="mobileLayout"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="mobileViewport">
|
||||
<template v-for="element in mobileLayout">
|
||||
<v-list-item :key="'item-mobile-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-mobile-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -77,8 +70,8 @@ import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import draggable from 'vuedraggable'
|
||||
import { capitalize, convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { mdiArrowUpDown, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiInformation, mdiLock } from '@mdi/js'
|
||||
import { convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { mdiDragVertical, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiInformation, mdiLock } from '@mdi/js'
|
||||
@Component({
|
||||
components: {
|
||||
draggable,
|
||||
@@ -90,11 +83,10 @@ export default class SettingsDashboardTabMobile extends Mixins(DashboardMixin) {
|
||||
*/
|
||||
mdiLock = mdiLock
|
||||
mdiInformation = mdiInformation
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
mdiCheckboxMarked = mdiCheckboxMarked
|
||||
mdiCheckboxBlankOutline = mdiCheckboxBlankOutline
|
||||
|
||||
capitalize = capitalize
|
||||
convertPanelnameToIcon = convertPanelnameToIcon
|
||||
|
||||
get mobileLayout() {
|
||||
@@ -124,3 +116,14 @@ export default class SettingsDashboardTabMobile extends Mixins(DashboardMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,3 @@
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
@@ -14,34 +7,34 @@
|
||||
<v-list dense>
|
||||
<v-list-item>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-col class="col-auto pr-0 pl-8">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ $t('Panels.StatusPanel.Headline') }}
|
||||
</v-col>
|
||||
<v-col class="col-auto">
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-icon color="grey lighten-1">{{ mdiLock }}</v-icon>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<draggable
|
||||
v-model="tabletLayout1"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="tabletViewport">
|
||||
<template v-for="element in tabletLayout1">
|
||||
<v-list-item :key="'item-tablet-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-tablet-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -67,21 +60,21 @@
|
||||
<v-list dense>
|
||||
<draggable
|
||||
v-model="tabletLayout2"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="tabletViewport">
|
||||
<template v-for="element in tabletLayout2">
|
||||
<v-list-item :key="'item-tablet-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-tablet-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -117,8 +110,8 @@ import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import draggable from 'vuedraggable'
|
||||
import { capitalize, convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { mdiLock, mdiInformation, mdiArrowUpDown, mdiCheckboxMarked, mdiCheckboxBlankOutline } from '@mdi/js'
|
||||
import { convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { mdiLock, mdiInformation, mdiDragVertical, mdiCheckboxMarked, mdiCheckboxBlankOutline } from '@mdi/js'
|
||||
@Component({
|
||||
components: {
|
||||
draggable,
|
||||
@@ -130,11 +123,10 @@ export default class SettingsDashboardTabTablet extends Mixins(DashboardMixin) {
|
||||
*/
|
||||
mdiLock = mdiLock
|
||||
mdiInformation = mdiInformation
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
mdiCheckboxMarked = mdiCheckboxMarked
|
||||
mdiCheckboxBlankOutline = mdiCheckboxBlankOutline
|
||||
|
||||
capitalize = capitalize
|
||||
convertPanelnameToIcon = convertPanelnameToIcon
|
||||
|
||||
get tabletLayout1() {
|
||||
@@ -186,3 +178,14 @@ export default class SettingsDashboardTabTablet extends Mixins(DashboardMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,3 @@
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
@@ -14,34 +7,34 @@
|
||||
<v-list dense>
|
||||
<v-list-item>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-col class="col-auto pr-0 pl-8">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ $t('Panels.StatusPanel.Headline') }}
|
||||
</v-col>
|
||||
<v-col class="col-auto">
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-icon color="grey lighten-1">{{ mdiLock }}</v-icon>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
<draggable
|
||||
v-model="widescreenLayout1"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="widescreenViewport">
|
||||
<template v-for="element in widescreenLayout1">
|
||||
<v-list-item :key="'item-widescreen-' + element.name" link>
|
||||
<v-list-item :key="'item-widescreen-' + element.name">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -67,21 +60,21 @@
|
||||
<v-list dense>
|
||||
<draggable
|
||||
v-model="widescreenLayout2"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="widescreenViewport">
|
||||
<template v-for="element in widescreenLayout2">
|
||||
<v-list-item :key="'item-widescreen-' + element.name" link>
|
||||
<v-list-item :key="'item-widescreen-' + element.name">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -107,21 +100,21 @@
|
||||
<v-list dense>
|
||||
<draggable
|
||||
v-model="widescreenLayout3"
|
||||
:handle="isMobile ? '.handle' : ''"
|
||||
handle=".handle"
|
||||
class="v-list-item-group"
|
||||
ghost-class="ghost"
|
||||
group="widescreenViewport">
|
||||
<template v-for="element in widescreenLayout3">
|
||||
<v-list-item :key="'item-widescreen-' + element.name" link>
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0">
|
||||
<v-icon v-if="isMobile" class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
<v-icon v-else v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
<v-list-item :key="'item-widescreen-' + element.name">
|
||||
<v-row class="d-flex align-center">
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon v-text="convertPanelnameToIcon(element.name)"></v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0">
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ getPanelName(element.name) }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-0">
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
v-if="!element.visible"
|
||||
color="grey lighten-1"
|
||||
@@ -156,9 +149,9 @@
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import draggable from 'vuedraggable'
|
||||
import { capitalize, convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import { convertPanelnameToIcon } from '@/plugins/helpers'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import { mdiArrowUpDown, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiInformation, mdiLock } from '@mdi/js'
|
||||
import { mdiDragVertical, mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiInformation, mdiLock } from '@mdi/js'
|
||||
@Component({
|
||||
components: {
|
||||
draggable,
|
||||
@@ -170,11 +163,10 @@ export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixi
|
||||
*/
|
||||
mdiLock = mdiLock
|
||||
mdiInformation = mdiInformation
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
mdiCheckboxMarked = mdiCheckboxMarked
|
||||
mdiCheckboxBlankOutline = mdiCheckboxBlankOutline
|
||||
|
||||
capitalize = capitalize
|
||||
convertPanelnameToIcon = convertPanelnameToIcon
|
||||
|
||||
get widescreenLayout1() {
|
||||
@@ -257,3 +249,14 @@ export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixi
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -37,6 +37,24 @@
|
||||
</v-menu>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GCodeViewerTab.ProgressColor')">
|
||||
<v-menu :close-on-content-click="false" bottom left offset-y>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
:color="progressColor"
|
||||
class="minwidth-0 px-5"
|
||||
small
|
||||
v-bind="attrs"
|
||||
v-on="on"></v-btn>
|
||||
</template>
|
||||
<v-color-picker
|
||||
:value="progressColor"
|
||||
hide-mode-switch
|
||||
mode="rgba"
|
||||
@update:color="updateColorValue('progressColor', $event)"></v-color-picker>
|
||||
</v-menu>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GCodeViewerTab.ExtruderColor')">
|
||||
<v-row no-gutters>
|
||||
<v-menu
|
||||
@@ -172,6 +190,14 @@ export default class SettingsGCodeViewerTab extends Mixins(BaseMixin) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.gridColor', value: newVal })
|
||||
}
|
||||
|
||||
get progressColor(): string {
|
||||
return this.$store.state.gui.gcodeViewer.progressColor
|
||||
}
|
||||
|
||||
set progressColor(newVal: string) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.progressColor', value: newVal })
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
updateColorValue(colorElement: string, newVal: any): void {
|
||||
Vue.set(this, colorElement, this.clearColorObject(newVal))
|
||||
@@ -219,13 +245,5 @@ export default class SettingsGCodeViewerTab extends Mixins(BaseMixin) {
|
||||
if (this.minFeed < 1) this.minFeed = 1
|
||||
if (this.maxFeed < this.minFeed) this.maxFeed = this.minFeed + 1
|
||||
}
|
||||
|
||||
get progressColor(): string {
|
||||
return this.$store.state.gui.gcodeViewer.progressColor
|
||||
}
|
||||
|
||||
set progressColor(newVal: string) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'gcodeViewer.progressColor', value: newVal })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,11 +2,11 @@
|
||||
<div>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<settings-row :title="$t('Settings.GeneralTab.PrinterName')">
|
||||
<settings-row :title="$t('Settings.GeneralTab.PrinterName').toString()">
|
||||
<v-text-field v-model="printerName" hide-details outlined dense></v-text-field>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GeneralTab.Language')">
|
||||
<settings-row :title="$t('Settings.GeneralTab.Language').toString()">
|
||||
<v-select
|
||||
v-model="currentLanguage"
|
||||
:items="availableLanguages"
|
||||
@@ -16,9 +16,41 @@
|
||||
attach></v-select>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GeneralTab.DateFormat').toString()">
|
||||
<v-select
|
||||
v-model="dateFormat"
|
||||
:items="dateFormatItems"
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
attach></v-select>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GeneralTab.TimeFormat').toString()">
|
||||
<v-select
|
||||
v-model="timeFormat"
|
||||
:items="timeFormatItems"
|
||||
hide-details
|
||||
outlined
|
||||
dense
|
||||
attach></v-select>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="$t('Settings.GeneralTab.CalcEstimateTime')"
|
||||
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription')">
|
||||
:title="$t('Settings.GeneralTab.CalcPrintProgress').toString()"
|
||||
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription').toString()">
|
||||
<v-select
|
||||
v-model="calcPrintProgress"
|
||||
:items="calcPrintProgressItems"
|
||||
hide-details
|
||||
dense
|
||||
outlined
|
||||
attach></v-select>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="$t('Settings.GeneralTab.CalcEstimateTime').toString()"
|
||||
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription').toString()">
|
||||
<v-select
|
||||
v-model="calcEstimateTime"
|
||||
:items="calcEstimateItems"
|
||||
@@ -30,8 +62,8 @@
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="$t('Settings.GeneralTab.CalcEtaTime')"
|
||||
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription')">
|
||||
:title="$t('Settings.GeneralTab.CalcEtaTime').toString()"
|
||||
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription').toString()">
|
||||
<v-select
|
||||
v-model="calcEtaTime"
|
||||
:items="calcEtaTimeItems"
|
||||
@@ -42,7 +74,7 @@
|
||||
attach></v-select>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GeneralTab.MoonrakerDb')" :dynamic-slot-width="true">
|
||||
<settings-row :title="$t('Settings.GeneralTab.MoonrakerDb').toString()" :dynamic-slot-width="true">
|
||||
<input
|
||||
ref="uploadBackupFile"
|
||||
type="file"
|
||||
@@ -57,7 +89,7 @@
|
||||
</v-btn>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.GeneralTab.FactoryReset')" :dynamic-slot-width="true">
|
||||
<settings-row :title="$t('Settings.GeneralTab.FactoryReset').toString()" :dynamic-slot-width="true">
|
||||
<v-btn color="error" small @click="resetMainsail">
|
||||
{{ $t('Settings.GeneralTab.FactoryReset') }}
|
||||
</v-btn>
|
||||
@@ -66,7 +98,7 @@
|
||||
</v-card>
|
||||
<v-dialog v-model="dialogBackupMainsail" persistent :width="360">
|
||||
<panel
|
||||
:title="$t('Settings.GeneralTab.Backup')"
|
||||
:title="$t('Settings.GeneralTab.Backup').toString()"
|
||||
card-class="mainsail-backup-dialog"
|
||||
:margin-bottom="false"
|
||||
:icon="mdiHelpCircle">
|
||||
@@ -117,7 +149,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogResetMainsail" persistent :width="360">
|
||||
<panel
|
||||
:title="$t('Settings.GeneralTab.FactoryReset')"
|
||||
:title="$t('Settings.GeneralTab.FactoryReset').toString()"
|
||||
card-class="factory-reset-dialog"
|
||||
:margin-bottom="false"
|
||||
:icon="mdiHelpCircle">
|
||||
@@ -183,7 +215,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRestoreMainsail" persistent :width="360">
|
||||
<panel
|
||||
:title="$t('Settings.GeneralTab.Restore')"
|
||||
:title="$t('Settings.GeneralTab.Restore').toString()"
|
||||
card-class="factory-reset-dialog"
|
||||
:margin-bottom="false"
|
||||
:icon="mdiHelpCircle">
|
||||
@@ -259,59 +291,63 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
|
||||
return [
|
||||
{
|
||||
name: 'general',
|
||||
label: this.$t('Settings.GeneralTab.General') + '',
|
||||
label: this.$t('Settings.GeneralTab.General').toString(),
|
||||
},
|
||||
{
|
||||
name: 'console',
|
||||
label: this.$t('Settings.ConsoleTab.Console') + '',
|
||||
label: this.$t('Settings.ConsoleTab.Console').toString(),
|
||||
},
|
||||
{
|
||||
name: 'control',
|
||||
label: this.$t('Settings.ControlTab.Control') + '',
|
||||
label: this.$t('Settings.ControlTab.Control').toString(),
|
||||
},
|
||||
{
|
||||
name: 'dashboard',
|
||||
label: this.$t('Settings.DashboardTab.Dashboard') + '',
|
||||
label: this.$t('Settings.DashboardTab.Dashboard').toString(),
|
||||
},
|
||||
{
|
||||
name: 'editor',
|
||||
label: this.$t('Settings.EditorTab.Editor') + '',
|
||||
label: this.$t('Settings.EditorTab.Editor').toString(),
|
||||
},
|
||||
{
|
||||
name: 'gcodeviewer',
|
||||
label: this.$t('Settings.GCodeViewerTab.GCodeViewer') + '',
|
||||
name: 'gcodeViewer',
|
||||
label: this.$t('Settings.GCodeViewerTab.GCodeViewer').toString(),
|
||||
},
|
||||
{
|
||||
name: 'gcodehistory',
|
||||
label: this.$t('Settings.GeneralTab.DbConsoleHistory') + '',
|
||||
label: this.$t('Settings.GeneralTab.DbConsoleHistory').toString(),
|
||||
},
|
||||
{
|
||||
name: 'macros',
|
||||
label: this.$t('Settings.MacrosTab.Macros') + '',
|
||||
label: this.$t('Settings.MacrosTab.Macros').toString(),
|
||||
},
|
||||
{
|
||||
name: 'notifications',
|
||||
label: this.$t('App.Notifications.Notifications').toString(),
|
||||
},
|
||||
{
|
||||
name: 'presets',
|
||||
label: this.$t('Settings.PresetsTab.PreheatPresets') + '',
|
||||
label: this.$t('Settings.PresetsTab.PreheatPresets').toString(),
|
||||
},
|
||||
{
|
||||
name: 'remoteprinters',
|
||||
label: this.$t('Settings.RemotePrintersTab.RemotePrinters') + '',
|
||||
label: this.$t('Settings.RemotePrintersTab.RemotePrinters').toString(),
|
||||
},
|
||||
{
|
||||
name: 'timelapse',
|
||||
label: this.$t('Settings.TimelapseTab.Timelapse') + '',
|
||||
label: this.$t('Settings.TimelapseTab.Timelapse').toString(),
|
||||
},
|
||||
{
|
||||
name: 'uiSettings',
|
||||
label: this.$t('Settings.UiSettingsTab.UiSettings') + '',
|
||||
label: this.$t('Settings.UiSettingsTab.UiSettings').toString(),
|
||||
},
|
||||
{
|
||||
name: 'view',
|
||||
label: this.$t('Settings.GeneralTab.DbView') + '',
|
||||
label: this.$t('Settings.GeneralTab.DbView').toString(),
|
||||
},
|
||||
{
|
||||
name: 'webcams',
|
||||
label: this.$t('Settings.WebcamsTab.Webcams') + '',
|
||||
label: this.$t('Settings.WebcamsTab.Webcams').toString(),
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -333,8 +369,8 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get availableLanguages() {
|
||||
const locales = import.meta.globEager('../../locales/*.json')
|
||||
const languages: any = []
|
||||
const locales = import.meta.glob('../../locales/*.json', { eager: true }) as { [key: string]: any }
|
||||
const languages: { text: string; value: string }[] = []
|
||||
|
||||
Object.keys(locales).map((file: string) => {
|
||||
const langKey = file.slice(file.lastIndexOf('.') - 2, file.lastIndexOf('.'))
|
||||
@@ -348,6 +384,79 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
|
||||
return languages
|
||||
}
|
||||
|
||||
get dateFormat() {
|
||||
return this.$store.state.gui.general.dateFormat
|
||||
}
|
||||
|
||||
set dateFormat(newVal) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'general.dateFormat', value: newVal })
|
||||
}
|
||||
|
||||
get dateFormatItems() {
|
||||
const date = new Date()
|
||||
const userLocale =
|
||||
navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
||||
|
||||
return [
|
||||
{ value: null, text: `Browser (${date.toLocaleDateString(userLocale, { dateStyle: 'medium' })})` },
|
||||
{
|
||||
value: '2-digits',
|
||||
text: date.toLocaleDateString(userLocale, { day: '2-digit', month: '2-digit', year: 'numeric' }),
|
||||
},
|
||||
{
|
||||
value: 'short',
|
||||
text: date.toLocaleDateString(userLocale, { day: '2-digit', month: 'short', year: 'numeric' }),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
get timeFormat() {
|
||||
return this.$store.state.gui.general.timeFormat
|
||||
}
|
||||
|
||||
set timeFormat(newVal) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'general.timeFormat', value: newVal })
|
||||
}
|
||||
|
||||
get timeFormatItems() {
|
||||
const date = new Date()
|
||||
const userLocale =
|
||||
navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
||||
|
||||
return [
|
||||
{ value: null, text: `Browser (${date.toLocaleTimeString(userLocale, { timeStyle: 'short' })})` },
|
||||
{
|
||||
value: '24hours',
|
||||
text: this.$t('Settings.GeneralTab.24hours', {
|
||||
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }),
|
||||
}).toString(),
|
||||
},
|
||||
{
|
||||
value: '12hours',
|
||||
text: this.$t('Settings.GeneralTab.12hours', {
|
||||
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h12' }),
|
||||
}).toString(),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
get calcPrintProgressItems() {
|
||||
return [
|
||||
{ value: 'file-relative', text: this.$t('Settings.GeneralTab.CalcPrintProgressItems.FileRelative') },
|
||||
{ value: 'file-absolute', text: this.$t('Settings.GeneralTab.CalcPrintProgressItems.FileAbsolute') },
|
||||
{ value: 'slicer', text: this.$t('Settings.GeneralTab.CalcPrintProgressItems.Slicer') },
|
||||
{ value: 'filament', text: this.$t('Settings.GeneralTab.CalcPrintProgressItems.Filament') },
|
||||
]
|
||||
}
|
||||
|
||||
get calcPrintProgress() {
|
||||
return this.$store.state.gui.general.calcPrintProgress ?? 'file-relative'
|
||||
}
|
||||
|
||||
set calcPrintProgress(newVal) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'general.calcPrintProgress', value: newVal })
|
||||
}
|
||||
|
||||
get calcEstimateItems() {
|
||||
return [
|
||||
{ value: 'file', text: this.$t('Settings.GeneralTab.EstimateValues.File') },
|
||||
@@ -452,7 +561,7 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
async backupDb() {
|
||||
this.$store.dispatch('socket/addLoading', 'backupDbButton')
|
||||
await this.$store.dispatch('socket/addLoading', 'backupDbButton')
|
||||
await this.refreshNamespaces()
|
||||
if (this.availableNamespaces.includes('mainsail')) await this.refreshMainsailKeys()
|
||||
else this.mainsailKeys = []
|
||||
@@ -469,7 +578,7 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
async restoreDb() {
|
||||
this.$store.dispatch('socket/addLoading', 'restoreUploadButton')
|
||||
await this.$store.dispatch('socket/addLoading', 'restoreUploadButton')
|
||||
this.$refs?.uploadBackupFile?.click()
|
||||
}
|
||||
|
||||
|
||||
@@ -141,120 +141,114 @@
|
||||
ghost-class="ghost"
|
||||
group="macros"
|
||||
@change="updateMacroOrder">
|
||||
<template v-for="(macro, index) in editGroupMacros">
|
||||
<div :key="macro.name">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0 d-flex">
|
||||
<v-icon class="handle">{{ mdiArrowUpDown }}</v-icon>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<settings-row
|
||||
:key="'groupMacro_macro_' + index"
|
||||
:title="macro.name"
|
||||
:sub-title="getMacroDescription(macro.name)"
|
||||
:dynamic-slot-width="true">
|
||||
<template v-if="existsMacro(macro.name)">
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.color"
|
||||
v-on="on"
|
||||
@click="changeColorMacroFromGroup(macro)">
|
||||
<v-icon small left>{{ mdiPalette }}</v-icon>
|
||||
{{ macro.color }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ChangeMacroColor') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInStandby ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(
|
||||
macro,
|
||||
'showInStandby',
|
||||
!macro.showInStandby
|
||||
)
|
||||
">
|
||||
<v-icon small>{{ mdiSleep }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStateStandby') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInPause ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(
|
||||
macro,
|
||||
'showInPause',
|
||||
!macro.showInPause
|
||||
)
|
||||
">
|
||||
<v-icon small>{{ mdiPause }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStatePaused') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInPrinting ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(
|
||||
macro,
|
||||
'showInPrinting',
|
||||
!macro.showInPrinting
|
||||
)
|
||||
">
|
||||
<v-icon small>{{ mdiPrinter3dNozzle }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStatePrinting') }}</span>
|
||||
</v-tooltip>
|
||||
<v-row
|
||||
v-for="(macro, index) in editGroupMacros"
|
||||
:key="macro.name"
|
||||
class="dragable-item my-2 mx-0">
|
||||
<v-col class="col-auto pr-0 d-flex py-2">
|
||||
<v-icon class="handle">{{ mdiDragVertical }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="py-2">
|
||||
<settings-row
|
||||
:key="'groupMacro_macro_' + index"
|
||||
:title="macro.name"
|
||||
:sub-title="getMacroDescription(macro.name)"
|
||||
:dynamic-slot-width="true">
|
||||
<template v-if="existsMacro(macro.name)">
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.color"
|
||||
v-on="on"
|
||||
@click="changeColorMacroFromGroup(macro)">
|
||||
<v-icon small left>{{ mdiPalette }}</v-icon>
|
||||
{{ macro.color }}
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
color="error"
|
||||
v-on="on"
|
||||
@click="removeMacroFromGroup(macro)">
|
||||
<v-icon small>{{ mdiDelete }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.DeleteMacroFromGroup') }}</span>
|
||||
</v-tooltip>
|
||||
</settings-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
</div>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ChangeMacroColor') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInStandby ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(
|
||||
macro,
|
||||
'showInStandby',
|
||||
!macro.showInStandby
|
||||
)
|
||||
">
|
||||
<v-icon small>{{ mdiSleep }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStateStandby') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInPause ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(macro, 'showInPause', !macro.showInPause)
|
||||
">
|
||||
<v-icon small>{{ mdiPause }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStatePaused') }}</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
:color="macro.showInPrinting ? '' : 'secondary'"
|
||||
v-on="on"
|
||||
@click="
|
||||
updateMacroFromGroup(
|
||||
macro,
|
||||
'showInPrinting',
|
||||
!macro.showInPrinting
|
||||
)
|
||||
">
|
||||
<v-icon small>{{ mdiPrinter3dNozzle }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.ShowInStatePrinting') }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<v-tooltip top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
v-bind="attrs"
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
color="error"
|
||||
v-on="on"
|
||||
@click="removeMacroFromGroup(macro)">
|
||||
<v-icon small>{{ mdiDelete }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t('Settings.MacrosTab.DeleteMacroFromGroup') }}</span>
|
||||
</v-tooltip>
|
||||
</settings-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</draggable>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -309,7 +303,7 @@ import {
|
||||
mdiPause,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiPlus,
|
||||
mdiArrowUpDown,
|
||||
mdiDragVertical,
|
||||
mdiPalette,
|
||||
mdiPencil,
|
||||
} from '@mdi/js'
|
||||
@@ -319,15 +313,15 @@ import {
|
||||
})
|
||||
export default class SettingsMacrosTabExpert extends Mixins(BaseMixin) {
|
||||
/**
|
||||
Icons
|
||||
*/
|
||||
* Icons
|
||||
*/
|
||||
mdiPencil = mdiPencil
|
||||
mdiDelete = mdiDelete
|
||||
mdiSleep = mdiSleep
|
||||
mdiPause = mdiPause
|
||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||
mdiPlus = mdiPlus
|
||||
mdiArrowUpDown = mdiArrowUpDown
|
||||
mdiDragVertical = mdiDragVertical
|
||||
mdiPalette = mdiPalette
|
||||
|
||||
private rules = {
|
||||
@@ -381,7 +375,7 @@ Icons
|
||||
}
|
||||
|
||||
get allMacros() {
|
||||
return this.$store.getters['printer/getAllMacros'] ?? []
|
||||
return this.$store.getters['printer/getMacros'] ?? []
|
||||
}
|
||||
|
||||
get availableMacros() {
|
||||
@@ -553,3 +547,9 @@ Icons
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dragable-item {
|
||||
background-color: #282828;
|
||||
}
|
||||
</style>
|
||||
@@ -32,7 +32,7 @@ import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
})
|
||||
export default class SettingsMacrosTabSimple extends Mixins(BaseMixin) {
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getAllMacros'] ?? []
|
||||
return this.$store.getters['printer/getMacros'] ?? []
|
||||
}
|
||||
|
||||
get hiddenMacros() {
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<div>
|
||||
<settings-miscellaneous-tab-light-groups
|
||||
v-if="editLightGroupObject"
|
||||
:light="editLightGroupObject"
|
||||
@close="editLightGroupObject = null" />
|
||||
<settings-miscellaneous-tab-light-presets
|
||||
v-else-if="editLightPresetObject"
|
||||
:light="editLightPresetObject"
|
||||
@close="editLightPresetObject = null" />
|
||||
<v-card-text v-else>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.MiscellaneousTab.Miscellaneous') }}</h3>
|
||||
<template v-if="filteredLights.length">
|
||||
<div v-for="(light, index) in filteredLights" :key="index">
|
||||
<v-divider v-if="index" class="my-2"></v-divider>
|
||||
<settings-row :title="convertName(light.name)" :dynamic-slot-width="true">
|
||||
<v-btn
|
||||
v-if="light.chainCount > 1"
|
||||
small
|
||||
outlined
|
||||
class="ml-3"
|
||||
@click="editLightGroupObject = light">
|
||||
<v-icon left small>{{ mdiPencil }}</v-icon>
|
||||
{{ $t('Settings.MiscellaneousTab.Groups') }}
|
||||
</v-btn>
|
||||
<v-btn small outlined class="ml-3" @click="editLightPresetObject = light">
|
||||
<v-icon left small>{{ mdiPalette }}</v-icon>
|
||||
{{ $t('Settings.MiscellaneousTab.Presets') }}
|
||||
</v-btn>
|
||||
</settings-row>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">{{ $t('Settings.MiscellaneousTab.NoDevicesFound') }}</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-card-text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { mdiDelete, mdiPalette, mdiPencil } from '@mdi/js'
|
||||
import { convertName } from '@/plugins/helpers'
|
||||
import SettingsMiscellaneousTabLightGroups from '@/components/settings/SettingsMiscellaneousTabLightGroups.vue'
|
||||
import SettingsMiscellaneousTabLightPresets from '@/components/settings/SettingsMiscellaneousTabLightPresets.vue'
|
||||
import { PrinterStateLight } from '@/store/printer/types'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SettingsRow,
|
||||
SettingsMiscellaneousTabLightGroups,
|
||||
SettingsMiscellaneousTabLightPresets,
|
||||
},
|
||||
})
|
||||
export default class SettingsMiscellaneousTab extends Mixins(BaseMixin) {
|
||||
mdiDelete = mdiDelete
|
||||
mdiPalette = mdiPalette
|
||||
mdiPencil = mdiPencil
|
||||
|
||||
convertName = convertName
|
||||
|
||||
editLightGroupObject: PrinterStateLight | null = null
|
||||
editLightPresetObject: PrinterStateLight | null = null
|
||||
|
||||
get lights() {
|
||||
return this.$store.getters['printer/getLights'] ?? []
|
||||
}
|
||||
|
||||
get filteredLights() {
|
||||
return this.lights.filter((light: PrinterStateLight) => light.colorOrder.length > 1)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,236 @@
|
||||
<template>
|
||||
<div>
|
||||
<template v-if="boolForm">
|
||||
<v-card-text>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.MiscellaneousTab.CreateGroup') }}</h3>
|
||||
<settings-row :title="$t('Settings.MiscellaneousTab.Name').toString()">
|
||||
<v-text-field
|
||||
v-model="form.name"
|
||||
hide-details="auto"
|
||||
:rules="[rules.required, rules.groupUnique]"
|
||||
dense
|
||||
outlined></v-text-field>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="$t('Settings.MiscellaneousTab.Start').toString()"
|
||||
:sub-title="$t('Settings.MiscellaneousTab.StartDescription').toString()">
|
||||
<v-text-field
|
||||
v-model="form.start"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
step="1"
|
||||
:rules="[rules.minStart, rules.max]"
|
||||
dense
|
||||
outlined></v-text-field>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="$t('Settings.MiscellaneousTab.End').toString()"
|
||||
:sub-title="$t('Settings.MiscellaneousTab.EndDescription').toString()">
|
||||
<v-text-field
|
||||
v-model="form.end"
|
||||
hide-details="auto"
|
||||
type="number"
|
||||
step="1"
|
||||
:rules="[rules.minEnd, rules.max]"
|
||||
dense
|
||||
outlined></v-text-field>
|
||||
</settings-row>
|
||||
</v-card-text>
|
||||
<v-card-actions class="d-flex justify-end">
|
||||
<v-btn text @click="closeForm">{{ $t('Settings.Cancel') }}</v-btn>
|
||||
<v-btn v-if="form.id !== null" text color="primary" @click="updateGroup">
|
||||
{{ $t('Settings.Update') }}
|
||||
</v-btn>
|
||||
<v-btn v-else text color="primary" @click="storeGroup">{{ $t('Settings.Store') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-card-text>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.MiscellaneousTab.LightGroups', { name: light.name }) }}</h3>
|
||||
<template v-if="light">
|
||||
<template v-if="groups.length">
|
||||
<div v-for="(group, index) in groups" :key="group.id">
|
||||
<v-divider v-if="index" class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="group.name"
|
||||
:sub-title="
|
||||
$t('Settings.MiscellaneousTab.GroupSubTitle', {
|
||||
start: group.start,
|
||||
end: group.end,
|
||||
}).toString()
|
||||
"
|
||||
:dynamic-slot-width="true">
|
||||
<v-btn small outlined class="ml-3" @click="editGroup(group)">
|
||||
<v-icon left small>{{ mdiPencil }}</v-icon>
|
||||
{{ $t('Settings.Edit') }}
|
||||
</v-btn>
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
color="error"
|
||||
@click="deleteGroup(group.id)">
|
||||
<v-icon small>{{ mdiDelete }}</v-icon>
|
||||
</v-btn>
|
||||
</settings-row>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">
|
||||
{{ $t('Settings.MiscellaneousTab.NoGroupFound') }}
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">
|
||||
{{ $t('Settings.MiscellaneousTab.UnableToLoadLight') }}
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-card-text>
|
||||
<v-card-actions class="d-flex justify-end">
|
||||
<v-btn text @click="$emit('close')">{{ $t('Settings.Close') }}</v-btn>
|
||||
<v-btn text color="primary" @click="createGroup">
|
||||
{{ $t('Settings.MiscellaneousTab.AddGroup') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { mdiDelete, mdiPalette, mdiPencil } from '@mdi/js'
|
||||
import { caseInsensitiveSort, convertName } from '@/plugins/helpers'
|
||||
import { PrinterStateLight } from '@/store/printer/types'
|
||||
import { GuiMacrosStateMacrogroup } from '@/store/gui/macros/types'
|
||||
import { GuiMiscellaneousStateEntry, GuiMiscellaneousStateEntryLightgroup } from '@/store/gui/miscellaneous/types'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SettingsRow,
|
||||
},
|
||||
})
|
||||
export default class SettingsMiscellaneousTabLightGroups extends Mixins(BaseMixin) {
|
||||
mdiDelete = mdiDelete
|
||||
mdiPalette = mdiPalette
|
||||
mdiPencil = mdiPencil
|
||||
|
||||
convertName = convertName
|
||||
|
||||
private boolForm = false
|
||||
|
||||
private form: {
|
||||
id: string | null
|
||||
name: string
|
||||
start: number
|
||||
end: number
|
||||
} = {
|
||||
id: null,
|
||||
name: '',
|
||||
start: 1,
|
||||
end: 1,
|
||||
}
|
||||
|
||||
private rules = {
|
||||
required: (value: string) => value !== '' || 'required',
|
||||
groupUnique: (value: string) => !this.existsGroupName(value) || 'Name already exists',
|
||||
minStart: (value: number) => value > 0 || 'smaller than 1',
|
||||
minEnd: (value: number) => value >= this.form.start || 'smaller than start value',
|
||||
max: (value: number) => value <= (this.light?.chainCount ?? 1) || 'higher than chain_count',
|
||||
}
|
||||
|
||||
@Prop({ type: Object, default: null })
|
||||
declare light: PrinterStateLight | null
|
||||
|
||||
get entry() {
|
||||
return this.$store.getters['gui/miscellaneous/getEntry']({
|
||||
type: this.light?.type,
|
||||
name: this.light?.name,
|
||||
}) as GuiMiscellaneousStateEntry | null
|
||||
}
|
||||
|
||||
get groups() {
|
||||
if (!this.entry) return []
|
||||
|
||||
const groups: GuiMiscellaneousStateEntryLightgroup[] = []
|
||||
Object.entries(this.entry.lightgroups).forEach(([key, lightgroup]) => {
|
||||
groups.push({
|
||||
name: lightgroup.name,
|
||||
start: lightgroup.start,
|
||||
end: lightgroup.end,
|
||||
id: key,
|
||||
})
|
||||
})
|
||||
window.console.log('getEntryLightgroups', groups)
|
||||
|
||||
return caseInsensitiveSort(groups, 'name')
|
||||
}
|
||||
|
||||
createGroup() {
|
||||
this.form.id = null
|
||||
this.form.name = ''
|
||||
this.form.start = 1
|
||||
this.form.end = this.light?.chainCount ?? 1
|
||||
this.boolForm = true
|
||||
}
|
||||
|
||||
editGroup(group: GuiMiscellaneousStateEntryLightgroup) {
|
||||
this.form.id = group.id ?? null
|
||||
this.form.name = group.name
|
||||
this.form.start = group.start
|
||||
this.form.end = group.end
|
||||
this.boolForm = true
|
||||
}
|
||||
|
||||
closeForm() {
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
storeGroup() {
|
||||
this.$store.dispatch('gui/miscellaneous/storeLightgroup', {
|
||||
entry: this.light,
|
||||
lightgroup: this.form,
|
||||
})
|
||||
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
updateGroup() {
|
||||
this.$store.dispatch('gui/miscellaneous/updateLightgroup', {
|
||||
entry: this.light,
|
||||
lightgroup: this.form,
|
||||
})
|
||||
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
deleteGroup(groupId: string) {
|
||||
this.$store.dispatch('gui/miscellaneous/deleteLightgroup', {
|
||||
entry: this.light,
|
||||
lightgroupId: groupId,
|
||||
})
|
||||
}
|
||||
|
||||
existsGroupName(name: string) {
|
||||
return (
|
||||
this.groups.findIndex(
|
||||
(group: GuiMacrosStateMacrogroup) => group.name === name && group.id != this.form.id
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -0,0 +1,467 @@
|
||||
<template>
|
||||
<div>
|
||||
<template v-if="boolForm">
|
||||
<v-card-text>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.MiscellaneousTab.CreatePreset') }}</h3>
|
||||
<settings-row :title="$t('Settings.MiscellaneousTab.Name').toString()">
|
||||
<v-text-field
|
||||
v-model="form.name"
|
||||
hide-details="auto"
|
||||
:rules="[rules.required, rules.presetUnique]"
|
||||
dense
|
||||
outlined></v-text-field>
|
||||
</settings-row>
|
||||
<v-divider class="my-2"></v-divider>
|
||||
<settings-row :title="$t('Settings.MiscellaneousTab.Color').toString()">
|
||||
<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"
|
||||
: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"
|
||||
: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"
|
||||
: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"
|
||||
:min="0"
|
||||
:max="255"
|
||||
:dec="1"
|
||||
:step="1"
|
||||
:has-spinner="true"
|
||||
@submit="onColorInput" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</settings-row>
|
||||
</v-card-text>
|
||||
<v-card-actions class="d-flex justify-end">
|
||||
<v-btn text @click="closeForm">{{ $t('Settings.Cancel') }}</v-btn>
|
||||
<v-btn v-if="form.id !== null" text color="primary" @click="updatePreset">
|
||||
{{ $t('Settings.Update') }}
|
||||
</v-btn>
|
||||
<v-btn v-else text color="primary" @click="storePreset">{{ $t('Settings.Store') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-card-text>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.MiscellaneousTab.LightPresets', { name: light.name }) }}</h3>
|
||||
<template v-if="light">
|
||||
<template v-if="presets.length">
|
||||
<div v-for="(preset, index) in presets" :key="preset.id">
|
||||
<v-divider v-if="index" class="my-2"></v-divider>
|
||||
<settings-row
|
||||
:title="preset.name"
|
||||
:sub-title="entryDescriptionText(preset)"
|
||||
:dynamic-slot-width="true">
|
||||
<v-btn small outlined class="ml-3" @click="editPreset(preset)">
|
||||
<v-icon left small>{{ mdiPencil }}</v-icon>
|
||||
{{ $t('Settings.Edit') }}
|
||||
</v-btn>
|
||||
<v-btn
|
||||
small
|
||||
outlined
|
||||
class="ml-3 minwidth-0 px-2"
|
||||
color="error"
|
||||
@click="deletePreset(preset.id)">
|
||||
<v-icon small>{{ mdiDelete }}</v-icon>
|
||||
</v-btn>
|
||||
</settings-row>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">
|
||||
{{ $t('Settings.MiscellaneousTab.NoPresetFound') }}
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="mb-0 text-center font-italic">
|
||||
{{ $t('Settings.MiscellaneousTab.UnableToLoadPreset') }}
|
||||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-card-text>
|
||||
<v-card-actions class="d-flex justify-end">
|
||||
<v-btn text @click="$emit('close')">{{ $t('Settings.Close') }}</v-btn>
|
||||
<v-btn text color="primary" @click="createPreset">
|
||||
{{ $t('Settings.MiscellaneousTab.AddPreset') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { mdiDelete, mdiPencil } from '@mdi/js'
|
||||
import { caseInsensitiveSort, convertName } from '@/plugins/helpers'
|
||||
import { PrinterStateLight } from '@/store/printer/types'
|
||||
import { GuiMiscellaneousStateEntry, GuiMiscellaneousStateEntryPreset } from '@/store/gui/miscellaneous/types'
|
||||
import { ColorPickerProps } from '@jaames/iro/dist/ColorPicker.d'
|
||||
import iro from '@jaames/iro'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import { IroColor } from '@irojs/iro-core'
|
||||
|
||||
interface ColorData {
|
||||
red: number | null
|
||||
green: number | null
|
||||
blue: number | null
|
||||
white: number | null
|
||||
}
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SettingsRow,
|
||||
},
|
||||
})
|
||||
export default class SettingsMiscellaneousTabLightPresets extends Mixins(BaseMixin) {
|
||||
mdiDelete = mdiDelete
|
||||
mdiPencil = mdiPencil
|
||||
|
||||
convertName = convertName
|
||||
|
||||
private boolForm = false
|
||||
|
||||
private form: {
|
||||
id: string | null
|
||||
name: string
|
||||
red: number | null
|
||||
green: number | null
|
||||
blue: number | null
|
||||
white: number | null
|
||||
} = {
|
||||
id: null,
|
||||
name: '',
|
||||
red: null,
|
||||
green: null,
|
||||
blue: null,
|
||||
white: null,
|
||||
}
|
||||
|
||||
private rules = {
|
||||
required: (value: string) => value !== '' || 'required',
|
||||
presetUnique: (value: string) => !this.existsPresetName(value) || 'Name already exists',
|
||||
min: (value: number) => value >= 0 || 'Must be minimum 0',
|
||||
max: (value: number) => value <= 255 || 'Must be smaller then 256',
|
||||
}
|
||||
|
||||
@Prop({ type: Object, default: null })
|
||||
declare light: PrinterStateLight | null
|
||||
|
||||
get entry() {
|
||||
return this.$store.getters['gui/miscellaneous/getEntry']({
|
||||
type: this.light?.type,
|
||||
name: this.light?.name,
|
||||
}) as GuiMiscellaneousStateEntry | null
|
||||
}
|
||||
|
||||
get presets() {
|
||||
if (!this.entry) return []
|
||||
|
||||
const presets: GuiMiscellaneousStateEntryPreset[] = []
|
||||
Object.entries(this.entry.presets).forEach(([key, preset]) => {
|
||||
presets.push({
|
||||
...preset,
|
||||
id: key,
|
||||
})
|
||||
})
|
||||
window.console.log('getEntryPresets', presets)
|
||||
|
||||
return caseInsensitiveSort(presets, 'name')
|
||||
}
|
||||
|
||||
get existRed() {
|
||||
return this.light?.colorOrder.indexOf('R') !== -1
|
||||
}
|
||||
|
||||
get existGreen() {
|
||||
return this.light?.colorOrder.indexOf('G') !== -1
|
||||
}
|
||||
|
||||
get existBlue() {
|
||||
return this.light?.colorOrder.indexOf('B') !== -1
|
||||
}
|
||||
|
||||
get existWhite() {
|
||||
return this.light?.colorOrder.indexOf('W') !== -1
|
||||
}
|
||||
|
||||
get colorRGB() {
|
||||
return `rgb(${Math.round(this.form.red ?? 0)}, ${Math.round(this.form.green ?? 0)}, ${Math.round(
|
||||
this.form.blue ?? 0
|
||||
)})`
|
||||
}
|
||||
|
||||
get colorRGBW() {
|
||||
return `rgba(255, 255, 255, ${(this.form.white ?? 0) / 255})`
|
||||
}
|
||||
|
||||
get redInt() {
|
||||
return Math.round(this.form.red ?? 0)
|
||||
}
|
||||
|
||||
get greenInt() {
|
||||
return Math.round(this.form.green ?? 0)
|
||||
}
|
||||
|
||||
get blueInt() {
|
||||
return Math.round(this.form.blue ?? 0)
|
||||
}
|
||||
|
||||
get whiteInt() {
|
||||
return Math.round(this.form.white ?? 0)
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
entryDescriptionText(preset: GuiMiscellaneousStateEntryPreset) {
|
||||
let output: string[] = []
|
||||
|
||||
if (this.light?.colorOrder.includes('R')) output.push(`R: ${preset.red}`)
|
||||
if (this.light?.colorOrder.includes('G')) output.push(`G: ${preset.green}`)
|
||||
if (this.light?.colorOrder.includes('B')) output.push(`B: ${preset.blue}`)
|
||||
if (this.light?.colorOrder.includes('W')) output.push(`W: ${preset.white}`)
|
||||
|
||||
return output.join(', ')
|
||||
}
|
||||
|
||||
createPreset() {
|
||||
this.form.id = null
|
||||
this.form.name = ''
|
||||
this.form.red = this.light?.colorOrder.indexOf('R') != -1 ? 0 : null
|
||||
this.form.green = this.light?.colorOrder.indexOf('G') != -1 ? 0 : null
|
||||
this.form.blue = this.light?.colorOrder.indexOf('B') != -1 ? 0 : null
|
||||
this.form.white = this.light?.colorOrder.indexOf('W') != -1 ? 0 : null
|
||||
this.boolForm = true
|
||||
}
|
||||
|
||||
editPreset(preset: GuiMiscellaneousStateEntryPreset) {
|
||||
this.form.id = preset.id ?? null
|
||||
this.form.name = preset.name
|
||||
this.form.red = this.light?.colorOrder.indexOf('R') != -1 ? preset.red : null
|
||||
this.form.green = this.light?.colorOrder.indexOf('G') != -1 ? preset.green : null
|
||||
this.form.blue = this.light?.colorOrder.indexOf('B') != -1 ? preset.blue : null
|
||||
this.form.white = this.light?.colorOrder.indexOf('W') != -1 ? preset.white : null
|
||||
this.boolForm = true
|
||||
}
|
||||
|
||||
closeForm() {
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
storePreset() {
|
||||
this.$store.dispatch('gui/miscellaneous/storePreset', {
|
||||
entry: this.light,
|
||||
preset: this.form,
|
||||
})
|
||||
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
updatePreset() {
|
||||
this.$store.dispatch('gui/miscellaneous/updatePreset', {
|
||||
entry: this.light,
|
||||
preset: this.form,
|
||||
})
|
||||
|
||||
this.boolForm = false
|
||||
}
|
||||
|
||||
deletePreset(presetId: string) {
|
||||
this.$store.dispatch('gui/miscellaneous/deletePreset', {
|
||||
entry: this.light,
|
||||
presetId: presetId,
|
||||
})
|
||||
}
|
||||
|
||||
existsPresetName(name: string) {
|
||||
return (
|
||||
this.presets.findIndex(
|
||||
(group: GuiMiscellaneousStateEntryPreset) => group.name === name && group.id != this.form.id
|
||||
) >= 0
|
||||
)
|
||||
}
|
||||
|
||||
@Debounce({ time: 250 })
|
||||
onColorRGBChanged(payload: IroColor) {
|
||||
const color: ColorData = {
|
||||
red: payload.red,
|
||||
green: payload.green,
|
||||
blue: payload.blue,
|
||||
white: this.form.white,
|
||||
}
|
||||
|
||||
this.colorChanged(color)
|
||||
}
|
||||
|
||||
@Debounce({ time: 250 })
|
||||
onColorWhiteChanged(payload: IroColor) {
|
||||
const color: ColorData = {
|
||||
red: this.form.red,
|
||||
green: this.form.green,
|
||||
blue: this.form.blue,
|
||||
white: this.form.white,
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
color.white = payload.alpha * 255
|
||||
|
||||
this.colorChanged(color)
|
||||
}
|
||||
|
||||
onColorInput(payload: { name: string; value: number }) {
|
||||
const color: ColorData = {
|
||||
red: this.form.red,
|
||||
green: this.form.green,
|
||||
blue: this.form.blue,
|
||||
white: this.form.white,
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
color[payload.name] = payload.value
|
||||
|
||||
this.colorChanged(color)
|
||||
}
|
||||
|
||||
colorChanged(color: ColorData) {
|
||||
this.form.red = color.red
|
||||
this.form.green = color.green
|
||||
this.form.blue = color.blue
|
||||
this.form.white = color.white
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -3,6 +3,9 @@
|
||||
<v-card v-if="!form.bool" flat>
|
||||
<v-card-text>
|
||||
<h3 class="text-h5 mb-3">{{ $t('Settings.RemotePrintersTab.RemotePrinters') }}</h3>
|
||||
<v-alert v-if="!canAddPrinters" :icon="mdiAlertOutline" type="warning" text>
|
||||
{{ $t('Settings.RemotePrintersTab.UseConfigJson') }}
|
||||
</v-alert>
|
||||
<div v-for="(printer, index) in printers" :key="printer.id">
|
||||
<v-divider v-if="index" class="my-2"></v-divider>
|
||||
<settings-row
|
||||
@@ -82,7 +85,7 @@ import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { GuiRemoteprintersStatePrinter } from '@/store/gui/remoteprinters/types'
|
||||
import { mdiCancel, mdiCheckboxMarkedCircle, mdiDelete, mdiPencil } from '@mdi/js'
|
||||
import { mdiCancel, mdiCheckboxMarkedCircle, mdiDelete, mdiPencil, mdiAlertOutline } from '@mdi/js'
|
||||
|
||||
interface printerForm {
|
||||
bool: boolean
|
||||
@@ -100,6 +103,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
|
||||
mdiCancel = mdiCancel
|
||||
mdiPencil = mdiPencil
|
||||
mdiDelete = mdiDelete
|
||||
mdiAlertOutline = mdiAlertOutline
|
||||
|
||||
private form: printerForm = {
|
||||
bool: false,
|
||||
@@ -114,7 +118,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get canAddPrinters() {
|
||||
return this.$store.state.configInstances.length === 0
|
||||
return this.$store.state.instancesDB !== 'json'
|
||||
}
|
||||
|
||||
get protocol() {
|
||||
|
||||
@@ -1,30 +1,3 @@
|
||||
<style lang="scss" scoped>
|
||||
._transition i::before {
|
||||
transition: transform 500ms;
|
||||
}
|
||||
._rotate-180:before {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.v-item-group {
|
||||
button:hover::before,
|
||||
button:focus::before {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
._menu-button {
|
||||
height: 40px;
|
||||
width: 62px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.25) !important;
|
||||
}
|
||||
._menu-button:hover {
|
||||
border-color: rgba(255, 255, 255, 1) !important;
|
||||
}
|
||||
._menu-button:focus {
|
||||
border: 2px solid var(--color-primary) !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-card v-if="!form.bool" flat>
|
||||
@@ -51,7 +24,11 @@
|
||||
</settings-row>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<v-card-actions class="d-flex justify-end">
|
||||
<v-card-actions>
|
||||
<v-btn v-if="existCrowsnestConf" text color="primary" @click="openCrowsnestConf">
|
||||
{{ $t('Settings.WebcamsTab.EditCrowsnestConf') }}
|
||||
</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text color="primary" @click="createWebcam">{{ $t('Settings.WebcamsTab.AddWebcam') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
@@ -66,7 +43,7 @@
|
||||
<v-row>
|
||||
<v-col class="col-12 col-sm-6">
|
||||
<v-row>
|
||||
<v-col class="d-flex align-center">
|
||||
<v-col class="d-flex">
|
||||
<v-item-group>
|
||||
<v-menu :offset-y="true" title="Icon">
|
||||
<template #activator="{ on, attrs }">
|
||||
@@ -112,6 +89,7 @@
|
||||
hide-details="auto"
|
||||
outlined
|
||||
:rules="[rules.required, rules.unique]"
|
||||
class="_webcam-settings-name-field"
|
||||
dense></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -154,7 +132,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="form.service === 'mjpegstreamer-adaptive'">
|
||||
<v-col class="py-2">
|
||||
<v-col class="py-2 col-6">
|
||||
<v-text-field
|
||||
v-model="form.targetFps"
|
||||
outlined
|
||||
@@ -162,23 +140,37 @@
|
||||
hide-details
|
||||
:label="$t('Settings.WebcamsTab.TargetFPS')"></v-text-field>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-1">
|
||||
<v-checkbox
|
||||
v-model="form.flipX"
|
||||
<v-col class="py-2 col-6">
|
||||
<v-select
|
||||
v-model="form.rotate"
|
||||
:items="rotateItems"
|
||||
outlined
|
||||
dense
|
||||
hide-details
|
||||
class="mt-1"
|
||||
:label="$t('Settings.WebcamsTab.FlipHorizontally')"></v-checkbox>
|
||||
:label="$t('Settings.WebcamsTab.Rotate')"></v-select>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="py-1">
|
||||
<v-col class="pt-1 pb-3">
|
||||
<div class="v-label v-label--active theme--dark text-subtitle-1">
|
||||
{{ $t('Settings.WebcamsTab.FlipWebcam') }}
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="mt-0">
|
||||
<v-col class="py-0">
|
||||
<v-checkbox
|
||||
v-model="form.flipX"
|
||||
class="mt-1"
|
||||
hide-details
|
||||
:label="$t('Settings.WebcamsTab.Horizontally')"></v-checkbox>
|
||||
</v-col>
|
||||
<v-col class="py-0">
|
||||
<v-checkbox
|
||||
v-model="form.flipY"
|
||||
hide-details
|
||||
class="mt-1"
|
||||
:label="$t('Settings.WebcamsTab.FlipVertically')"></v-checkbox>
|
||||
hide-details
|
||||
:label="$t('Settings.WebcamsTab.Vertically')"></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
@@ -207,7 +199,7 @@
|
||||
<v-btn text @click="form.bool = false">
|
||||
{{ $t('Settings.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text type="submit">
|
||||
<v-btn color="primary" text type="submit" :disabled="!form.name">
|
||||
{{
|
||||
form.id === null
|
||||
? $t('Settings.WebcamsTab.SaveWebcam')
|
||||
@@ -231,6 +223,7 @@ import Uv4lMjpeg from '@/components/webcams/Uv4lMjpeg.vue'
|
||||
import Ipstreamer from '@/components/webcams/Ipstreamer.vue'
|
||||
import { mdiMenuDown, mdiDelete, mdiPencil, mdiWebcam } from '@mdi/js'
|
||||
import WebcamMixin from '@/components/mixins/webcam'
|
||||
import { FileStateFile } from '@/store/files/types'
|
||||
|
||||
interface webcamForm {
|
||||
bool: boolean
|
||||
@@ -242,6 +235,7 @@ interface webcamForm {
|
||||
targetFps: number
|
||||
urlStream: string
|
||||
urlSnapshot: string
|
||||
rotate: number
|
||||
flipX: boolean
|
||||
flipY: boolean
|
||||
}
|
||||
@@ -272,6 +266,7 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
targetFps: 15,
|
||||
urlStream: '',
|
||||
urlSnapshot: '',
|
||||
rotate: 0,
|
||||
flipX: false,
|
||||
flipY: false,
|
||||
}
|
||||
@@ -281,6 +276,13 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamsTab.NameAlreadyExists'),
|
||||
}
|
||||
|
||||
private rotateItems = [
|
||||
{ value: 0, text: '0°' },
|
||||
{ value: 90, text: '90°' },
|
||||
{ value: 180, text: '180°' },
|
||||
{ value: 270, text: '270°' },
|
||||
]
|
||||
|
||||
declare $refs: {
|
||||
webcamForm: any
|
||||
}
|
||||
@@ -322,6 +324,18 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
return ''
|
||||
}
|
||||
|
||||
get configfiles() {
|
||||
return this.$store.getters['files/getDirectory']('config')?.childrens ?? []
|
||||
}
|
||||
|
||||
get crowsnestConf(): FileStateFile | null {
|
||||
return this.configfiles.find((file: FileStateFile) => file.filename === 'crowsnest.conf')
|
||||
}
|
||||
|
||||
get existCrowsnestConf(): boolean {
|
||||
return this.configfiles.findIndex((file: FileStateFile) => file.filename === 'crowsnest.conf') !== -1
|
||||
}
|
||||
|
||||
getSubtitle(webcam: GuiWebcamStateWebcam) {
|
||||
return 'URL: ' + (webcam.service === 'mjpegstreamer-adaptive' ? webcam.urlSnapshot : webcam.urlStream)
|
||||
}
|
||||
@@ -348,6 +362,7 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
this.form.targetFps = webcam.targetFps
|
||||
this.form.urlStream = webcam.urlStream
|
||||
this.form.urlSnapshot = webcam.urlSnapshot
|
||||
this.form.rotate = webcam.rotate ?? 0
|
||||
this.form.flipX = webcam.flipX
|
||||
this.form.flipY = webcam.flipY
|
||||
|
||||
@@ -368,6 +383,7 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
targetFps: this.form.targetFps,
|
||||
urlStream: this.form.urlStream,
|
||||
urlSnapshot: this.form.urlSnapshot,
|
||||
rotate: this.form.rotate,
|
||||
flipX: this.form.flipX,
|
||||
flipY: this.form.flipY,
|
||||
}
|
||||
@@ -392,6 +408,7 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
this.form.targetFps = 15
|
||||
this.form.urlStream = '/webcam/?action=stream'
|
||||
this.form.urlSnapshot = '/webcam/?action=snapshot'
|
||||
this.form.rotate = 0
|
||||
this.form.flipX = false
|
||||
this.form.flipY = false
|
||||
}
|
||||
@@ -399,5 +416,46 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
|
||||
setFormIcon(icon: string) {
|
||||
this.form.icon = icon
|
||||
}
|
||||
|
||||
openCrowsnestConf() {
|
||||
this.$store.dispatch('editor/openFile', {
|
||||
root: 'config',
|
||||
path: '/',
|
||||
filename: this.crowsnestConf?.filename,
|
||||
size: this.crowsnestConf?.size,
|
||||
permissions: this.crowsnestConf?.permissions,
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
._transition i::before {
|
||||
transition: transform 500ms;
|
||||
}
|
||||
._rotate-180:before {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.v-item-group {
|
||||
button:hover::before,
|
||||
button:focus::before {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
._menu-button {
|
||||
height: 40px;
|
||||
width: 62px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.25) !important;
|
||||
}
|
||||
._menu-button:hover {
|
||||
border-color: rgba(255, 255, 255, 1) !important;
|
||||
}
|
||||
._menu-button:focus {
|
||||
border: 2px solid var(--color-primary) !important;
|
||||
}
|
||||
}
|
||||
|
||||
._webcam-settings-name-field ::v-deep .v-text-field__details {
|
||||
margin-bottom: -12px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -38,7 +38,10 @@ export default class PrinterSelector extends Mixins(BaseMixin) {
|
||||
mdiChevronDown = mdiChevronDown
|
||||
|
||||
get displayMenuPoint() {
|
||||
return (this.remoteMode && this.countPrinters > 1) || (!this.remoteMode && this.countPrinters)
|
||||
return (
|
||||
(this.instancesDB !== 'moonraker' && this.countPrinters > 1) ||
|
||||
(this.instancesDB === 'moonraker' && this.countPrinters)
|
||||
)
|
||||
}
|
||||
|
||||
get printers() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<style>
|
||||
<style scoped>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
background: lightgray;
|
||||
@@ -19,7 +19,7 @@
|
||||
<div style="position: relative">
|
||||
<img
|
||||
ref="image"
|
||||
v-observe-visibility="visibilityChanged"
|
||||
v-observe-visibility="viewportVisibilityChanged"
|
||||
class="webcamImage"
|
||||
:style="webcamStyle"
|
||||
@load="onload" />
|
||||
@@ -44,6 +44,8 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
|
||||
private timerRestart: number | null = null
|
||||
private stream: ReadableStream | null = null
|
||||
private controller: AbortController | null = null
|
||||
private isVisibleViewport = false
|
||||
private isVisibleDocument = true
|
||||
|
||||
@Prop({ required: true })
|
||||
camSettings: any
|
||||
@@ -60,7 +62,10 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
|
||||
|
||||
get url() {
|
||||
const baseUrl = this.camSettings.urlStream
|
||||
const url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
|
||||
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
|
||||
url.port = this.hostPort.toString()
|
||||
|
||||
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
|
||||
|
||||
return decodeURIComponent(url.toString())
|
||||
}
|
||||
@@ -86,6 +91,7 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
startStream() {
|
||||
if (this.streamState) return
|
||||
this.streamState = true
|
||||
|
||||
const SOI = new Uint8Array(2)
|
||||
@@ -220,14 +226,20 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
|
||||
// this function check if you changed the browser tab
|
||||
documentVisibilityChanged() {
|
||||
const visibility = document.visibilityState
|
||||
this.visibilityChanged(visibility === 'visible')
|
||||
this.isVisibleDocument = visibility === 'visible'
|
||||
if (!this.isVisibleDocument) this.stopStream()
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
// this function is to stop the stream, on scroll or on collapse the webcam panel
|
||||
visibilityChanged(newVal: boolean) {
|
||||
if (newVal && this.streamState) return
|
||||
// this function checks if the webcam is in the viewport
|
||||
viewportVisibilityChanged(newVal: boolean) {
|
||||
this.isVisibleViewport = newVal
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
if (newVal) {
|
||||
// this function stops the stream on scroll or on collapse of the webcam panel
|
||||
visibilityChanged() {
|
||||
if (this.isVisibleViewport && this.isVisibleDocument) {
|
||||
this.startStream()
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
<style scoped>
|
||||
.webcamImage {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.webcamFpsOutput {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
@@ -17,7 +21,7 @@
|
||||
</div>
|
||||
<canvas
|
||||
ref="mjpegstreamerAdaptive"
|
||||
v-observe-visibility="visibilityChanged"
|
||||
v-observe-visibility="viewportVisibilityChanged"
|
||||
width="600"
|
||||
height="400"
|
||||
:style="webcamStyle"
|
||||
@@ -30,13 +34,15 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
private refresh = Math.ceil(Math.random() * Math.pow(10, 12))
|
||||
private isVisible = true
|
||||
private isVisibleDocument = true
|
||||
private isVisibleViewport = false
|
||||
private isLoaded = true
|
||||
private timer: number | undefined = undefined
|
||||
|
||||
@@ -64,8 +70,9 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
let transforms = ''
|
||||
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
|
||||
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
|
||||
if (this.camSettings.flipX ?? false) transforms += ' scaleX(-1)'
|
||||
if (this.camSettings.flipY ?? false) transforms += ' scaleY(-1)'
|
||||
if ((this.camSettings.rotate ?? 0) === 180) transforms += ' rotate(180deg)'
|
||||
if (transforms.trimStart().length) output.transform = transforms.trimStart()
|
||||
|
||||
if (this.aspectRatio) output.aspectRatio = this.aspectRatio
|
||||
@@ -77,6 +84,10 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
return this.currentFPS < 10 ? '0' + this.currentFPS.toString() : this.currentFPS
|
||||
}
|
||||
|
||||
get rotate() {
|
||||
return [90, 270].includes(this.camSettings.rotate ?? 0)
|
||||
}
|
||||
|
||||
refreshFrame() {
|
||||
if (this.isVisible) {
|
||||
this.refresh = new Date().getTime()
|
||||
@@ -84,6 +95,58 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
async setFrame() {
|
||||
const baseUrl = this.camSettings.urlSnapshot
|
||||
|
||||
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
|
||||
url.port = this.hostPort.toString()
|
||||
|
||||
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
|
||||
|
||||
url.searchParams.append('bypassCache', this.refresh.toString())
|
||||
|
||||
this.request_start_time = performance.now()
|
||||
this.currentFPS = this.time > 0 ? Math.round(1000 / this.time) : 0
|
||||
|
||||
let canvas = this.$refs.mjpegstreamerAdaptive
|
||||
if (canvas) {
|
||||
const ctx = canvas.getContext('2d')
|
||||
const frame: any = await this.loadImage(url.toString())
|
||||
|
||||
canvas.width = canvas.clientWidth
|
||||
if (this.rotate) {
|
||||
if (this.aspectRatio === null) this.aspectRatio = frame.height / frame.width
|
||||
canvas.height = canvas.clientWidth / (frame.height / frame.width)
|
||||
} else {
|
||||
if (this.aspectRatio === null) this.aspectRatio = frame.width / frame.height
|
||||
canvas.height = canvas.clientWidth * (frame.width / frame.height)
|
||||
}
|
||||
|
||||
if (this.rotate) {
|
||||
const scale = canvas.height / frame.width
|
||||
const x = canvas.width / 2
|
||||
const y = canvas.height / 2
|
||||
ctx.translate(x, y)
|
||||
ctx.rotate((this.camSettings.rotate * Math.PI) / 180)
|
||||
await ctx?.drawImage(
|
||||
frame,
|
||||
(-frame.width / 2) * scale,
|
||||
(-frame.height / 2) * scale,
|
||||
frame.width * scale,
|
||||
frame.height * scale
|
||||
)
|
||||
ctx.rotate(-((this.camSettings.rotate * Math.PI) / 180))
|
||||
ctx.translate(-x, -y)
|
||||
} else await ctx?.drawImage(frame, 0, 0, frame.width, frame.height, 0, 0, canvas.width, canvas.height)
|
||||
|
||||
this.isLoaded = true
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.onLoad()
|
||||
})
|
||||
}
|
||||
|
||||
onLoad() {
|
||||
this.isLoaded = true
|
||||
|
||||
@@ -105,35 +168,6 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
})
|
||||
}
|
||||
|
||||
async setFrame() {
|
||||
const baseUrl = this.camSettings.urlSnapshot
|
||||
const url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
|
||||
|
||||
url.searchParams.append('bypassCache', this.refresh.toString())
|
||||
|
||||
this.request_start_time = performance.now()
|
||||
this.currentFPS = this.time > 0 ? Math.round(1000 / this.time) : 0
|
||||
|
||||
let canvas = this.$refs.mjpegstreamerAdaptive
|
||||
if (canvas) {
|
||||
const ctx = canvas.getContext('2d')
|
||||
const frame: any = await this.loadImage(url.toString())
|
||||
|
||||
canvas.width = canvas.clientWidth
|
||||
canvas.height = canvas.clientWidth * (frame.height / frame.width)
|
||||
if (this.aspectRatio === null) {
|
||||
this.aspectRatio = frame.width / frame.height
|
||||
}
|
||||
|
||||
ctx?.drawImage(frame, 0, 0, frame.width, frame.height, 0, 0, canvas.width, canvas.height)
|
||||
this.isLoaded = true
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.onLoad()
|
||||
})
|
||||
}
|
||||
|
||||
loadImage(url: string) {
|
||||
return new Promise((r) => {
|
||||
let image = new Image()
|
||||
@@ -154,19 +188,40 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
|
||||
|
||||
documentVisibilityChanged() {
|
||||
const visibility = document.visibilityState
|
||||
this.visibilityChanged(visibility === 'visible')
|
||||
this.isVisibleDocument = visibility === 'visible'
|
||||
if (!this.isVisibleDocument) this.stopStream()
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
visibilityChanged(newVal: boolean) {
|
||||
if (newVal) {
|
||||
this.isVisible = true
|
||||
this.refreshFrame()
|
||||
viewportVisibilityChanged(newVal: boolean) {
|
||||
this.isVisibleViewport = newVal
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
visibilityChanged() {
|
||||
if (this.isVisibleViewport && this.isVisibleDocument) {
|
||||
this.startStream()
|
||||
return
|
||||
}
|
||||
|
||||
this.stopStream()
|
||||
}
|
||||
|
||||
startStream() {
|
||||
if (this.isVisible) return
|
||||
this.isVisible = true
|
||||
this.refreshFrame()
|
||||
}
|
||||
|
||||
stopStream() {
|
||||
this.isVisible = false
|
||||
clearTimeout(this.timer)
|
||||
this.timer = undefined
|
||||
}
|
||||
|
||||
@Watch('camSettings', { immediate: true, deep: true })
|
||||
camSettingsChanged() {
|
||||
this.aspectRatio = null
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -8,22 +8,24 @@
|
||||
<template>
|
||||
<img
|
||||
ref="webcamUv4lMjpegImage"
|
||||
v-observe-visibility="visibilityChanged"
|
||||
:src="url"
|
||||
:alt="camSettings.name"
|
||||
v-observe-visibility="viewportVisibilityChanged"
|
||||
:style="webcamStyle"
|
||||
class="webcamImage"
|
||||
@load="onload" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
|
||||
|
||||
@Component
|
||||
export default class Uv4lMjpeg extends Mixins(BaseMixin) {
|
||||
private aspectRatio: null | number = null
|
||||
private isVisible = false
|
||||
private isVisibleViewport = false
|
||||
private isVisibleDocument = true
|
||||
|
||||
@Prop({ required: true }) declare readonly camSettings: GuiWebcamStateWebcam
|
||||
@Prop({ default: null }) declare readonly printerUrl: string | null
|
||||
|
||||
@@ -33,7 +35,10 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
|
||||
|
||||
get url() {
|
||||
const baseUrl = this.camSettings.urlStream
|
||||
const url = new URL(baseUrl, this.printerUrl === null ? this.hostUrl.toString() : this.printerUrl)
|
||||
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
|
||||
url.port = this.hostPort.toString()
|
||||
|
||||
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
|
||||
|
||||
return decodeURIComponent(url.toString())
|
||||
}
|
||||
@@ -64,6 +69,8 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
startStream() {
|
||||
if (this.isVisible) return
|
||||
|
||||
if (this.$refs.webcamUv4lMjpegImage) this.$refs.webcamUv4lMjpegImage.setAttribute('src', this.url)
|
||||
}
|
||||
|
||||
@@ -74,13 +81,22 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
// this function checks if the browser tab was changed
|
||||
documentVisibilityChanged() {
|
||||
const visibility = document.visibilityState
|
||||
this.visibilityChanged(visibility === 'visible')
|
||||
this.isVisibleDocument = visibility === 'visible'
|
||||
if (!this.isVisibleDocument) this.stopStream()
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
visibilityChanged(newVal: boolean) {
|
||||
if (newVal) {
|
||||
// this function checks if the webcam is in the viewport
|
||||
viewportVisibilityChanged(newVal: boolean) {
|
||||
this.isVisibleViewport = newVal
|
||||
this.visibilityChanged()
|
||||
}
|
||||
|
||||
visibilityChanged() {
|
||||
if (this.isVisibleViewport && this.isVisibleDocument) {
|
||||
this.startStream()
|
||||
return
|
||||
}
|
||||
@@ -94,5 +110,11 @@ export default class Uv4lMjpeg extends Mixins(BaseMixin) {
|
||||
this.$refs.webcamUv4lMjpegImage.naturalWidth / this.$refs.webcamUv4lMjpegImage.naturalHeight
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('url')
|
||||
async urlChanged() {
|
||||
await this.stopStream()
|
||||
await this.startStream()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
+128
-52
@@ -1,10 +1,28 @@
|
||||
{
|
||||
"App": {
|
||||
"Notifications": {
|
||||
"DependencyDescription": "Den nuværende version af {name} understøtter ikke alle funktioner i Mainsail. Opdatér {name} til minimum version: {neededVersion}.",
|
||||
"DependencyName": "Afhængighed: {name}",
|
||||
"DismissAll": "Fjern alle",
|
||||
"KlipperWarnings": {
|
||||
"DeprecatedOption": "Funktionen \"{option}\" i sektion \"{section}\" er forældet.",
|
||||
"DeprecatedValue": "Værdien \"{value}\" i muligheden \"{option}\" i sektion \"{section}\" er forældet."
|
||||
}
|
||||
"DeprecatedOptionHeadline": "Forældet Klipper mulighed",
|
||||
"DeprecatedValue": "Værdien \"{value}\" i muligheden \"{option}\" i sektion \"{section}\" er forældet.",
|
||||
"DeprecatedValueHeadline": "Forældet Klipper værdi",
|
||||
"KlipperWarning": "Klipper advarsel"
|
||||
},
|
||||
"MoonrakerWarnings": {
|
||||
"MoonrakerComponent": "Moonraker: {component}",
|
||||
"MoonrakerFailedComponentDescription": "Der blev fundet en fejl under indlæsning af Moonraker komponenten '{component}'. Tjek logfilen og løs problemet.",
|
||||
"MoonrakerWarning": "Moonraker advarsel",
|
||||
"UnparsedConfigOption": "Upareret mulighed '{option}: {value}' fundet i sektionen: [{section}]. Denne mulighed er måske ikke længere tilgængelig, eller der kan være et problem under indlæsning af et modul. Dette vil resultere i en opstartsfejl.",
|
||||
"UnparsedConfigSection": "Upareret konfigurationssektion [{section}] fundet. Dette kan være på grund af en fejl under indlæsning af en komponent. Dette vil resultere i en opstartsfejl."
|
||||
},
|
||||
"Never": "aldrig",
|
||||
"NextReboot": "næste genstart",
|
||||
"NoNotification": "Ingen tilgængelig notifikationer",
|
||||
"Notifications": "Notifikationer",
|
||||
"Remind": "Påmind mig om:"
|
||||
},
|
||||
"NumberInput": {
|
||||
"GreaterOrEqualError": "Skal være større eller lig med {min}!",
|
||||
@@ -94,6 +112,7 @@
|
||||
"CheckMoonrakerLog": "Hvis denne besked vises flere gange, kig da i logfilen her:",
|
||||
"Connecting": "Forbinder med {host}",
|
||||
"Failed": "Forbindelse fejlede",
|
||||
"Initializing": "Initialiserer",
|
||||
"TryAgain": "Prøv igen"
|
||||
},
|
||||
"Console": {
|
||||
@@ -104,14 +123,21 @@
|
||||
"SendCode": "Send kode...",
|
||||
"SetupConsole": "Terminalindstillinger"
|
||||
},
|
||||
"Dialogs": {
|
||||
"StartPrint": {
|
||||
"Cancel": "Annuller",
|
||||
"DoYouWantToStartFilename": "Vil du begynde at printe: {filename}?",
|
||||
"Headline": "Start print",
|
||||
"Print": "print",
|
||||
"Timelapse": "Timelapse"
|
||||
}
|
||||
},
|
||||
"Editor": {
|
||||
"Cancel": "Annuller",
|
||||
"ConfigReference": "Konfigurationsreference",
|
||||
"DontSave": "Gem ikke",
|
||||
"Downloading": "Downloader",
|
||||
"FailedSave": "{filename} blev IKKE gemt!",
|
||||
"FileReadOnly": "Skrivebeskyttet",
|
||||
"Minimap": "Vis minikort",
|
||||
"SaveClose": "Gem & luk",
|
||||
"SaveRestart": "Gem & genstart",
|
||||
"SuccessfullySaved": "{filename} blev gemt.",
|
||||
@@ -129,17 +155,20 @@
|
||||
"Files": {
|
||||
"AddToQueue": "Tilføj til kø",
|
||||
"AllFiles": "Alle",
|
||||
"BedTemp": "Bed temperatur",
|
||||
"Cancel": "Annuller",
|
||||
"ChamberTemp": "Indelukke temperatur",
|
||||
"Create": "Opret",
|
||||
"CreateNewDirectory": "Ny mappe",
|
||||
"CurrentPath": "Du er her",
|
||||
"Delete": "Slet",
|
||||
"DeleteDirectory": "Slet mappe",
|
||||
"DeleteDirectoryQuestion": "Vil du slette mappen \"{name}\" og alt dens indhold?",
|
||||
"DeleteSelectedQuestion": "Vil du slette alle {count} valgte filer?",
|
||||
"Download": "Download",
|
||||
"Downloading": "Downloader",
|
||||
"EditFile": "Rediger Fil",
|
||||
"Empty": "Tom",
|
||||
"ExtruderTemp": "Hotend temperatur",
|
||||
"Filament": "Filament",
|
||||
"FilamentName": "Filament navn",
|
||||
"FilamentType": "Filament type",
|
||||
@@ -151,7 +180,12 @@
|
||||
"FreeDisk": "Ledig plads",
|
||||
"GCodeFiles": "G-Code Filer",
|
||||
"HiddenFiles": "Skjulte filer",
|
||||
"LastEndTime": "Sidste slut tid",
|
||||
"LastFilamentUsed": "Sidste filament forbrug",
|
||||
"LastModified": "Sidst ændret",
|
||||
"LastPrintDuration": "Sidste printtid",
|
||||
"LastStartTime": "Sidste start tid",
|
||||
"LastTotalDuration": "Sidste totale tid",
|
||||
"LayerHeight": "Laghøjde",
|
||||
"Name": "Navn",
|
||||
"NewDirectory": "Ny mappe",
|
||||
@@ -174,11 +208,14 @@
|
||||
"SuccessfullyRenamed": "{filename} omdøbt.",
|
||||
"SuccessfullyUploaded": "Upload af {filename} udført!",
|
||||
"Total": "Total",
|
||||
"Uploading": "Uploader",
|
||||
"UploadNewGcode": "Upload ny G-Code",
|
||||
"Used": "Brugt",
|
||||
"View3D": "Vis i 3D"
|
||||
},
|
||||
"FullscreenUpload": {
|
||||
"CannotUploadFile": "Kan ikke uploade filen!",
|
||||
"DropFilesToUploadFiles": "Drop filer her for at uploade"
|
||||
},
|
||||
"GCodeViewer": {
|
||||
"ClearLoadedFile": "Fjern",
|
||||
"ColorMode": "Farvevisning",
|
||||
@@ -223,6 +260,9 @@
|
||||
"ErrorKlipperNotReady": "Klipper er ikke klar. Kan ikke vise højdekort.",
|
||||
"Flat": "Fladt",
|
||||
"Heightmap": "Højdekort",
|
||||
"InvalidNameAlreadyExists": "Profilnavnet bruges allerede, vælg venligst et andet profilnavn.",
|
||||
"InvalidNameEmpty": "Feltet må ikke være tomt!",
|
||||
"InvalidNameReserved": "Profilnavnet 'default' er reserveret af systemet, vælg venligst et andet profilnavn",
|
||||
"Later": "Senere",
|
||||
"Mesh": "Mesh",
|
||||
"Name": "Navn",
|
||||
@@ -244,12 +284,15 @@
|
||||
"Wireframe": "Wireframe"
|
||||
},
|
||||
"History": {
|
||||
"AddNote": "Tilføj note",
|
||||
"AllJobs": "Alle job",
|
||||
"AvgPrinttime": "Gns. printtid",
|
||||
"Cancel": "Annuller",
|
||||
"CreateNote": "Gem note",
|
||||
"Delete": "Slet",
|
||||
"DeleteSelectedQuestion": "Er du sikker på du vil slette alle {count} valgte jobs?",
|
||||
"Details": "Detaljer",
|
||||
"EditNote": "Redigér note",
|
||||
"Empty": "Tom",
|
||||
"EndTime": "Sluttid",
|
||||
"EstimatedFilament": "Estimeret filament",
|
||||
@@ -270,12 +313,14 @@
|
||||
"LastModified": "Sidst ændret",
|
||||
"LayerHeight": "Laghøjde",
|
||||
"LongestPrinttime": "Længste print",
|
||||
"Note": "Note",
|
||||
"ObjectHeight": "Objekt Højde",
|
||||
"PrintDuration": "Print varighed",
|
||||
"PrintHistory": "Print historik",
|
||||
"PrintTime": "Print Tid",
|
||||
"PrinttimeAvg": "Printtid gns.",
|
||||
"Reprint": "Print igen",
|
||||
"Save": "Gem",
|
||||
"Search": "Søg",
|
||||
"SelectedFilamentUsed": "Filament brugt på valgte",
|
||||
"SelectedJobs": "Valgte jobs",
|
||||
@@ -309,6 +354,7 @@
|
||||
"JobQueue": "Jobkø",
|
||||
"Jobs": "Jobs",
|
||||
"Pause": "Pause",
|
||||
"RemoveFromQueue": "Fjern fra køen",
|
||||
"Start": "Start"
|
||||
},
|
||||
"Machine": {
|
||||
@@ -323,6 +369,7 @@
|
||||
"Delete": "Slet",
|
||||
"DeleteDirectory": "Slet mappe",
|
||||
"DeleteDirectoryQuestion": "Vil du slette mappen \"{name}\" og alt dens indhold?",
|
||||
"DeleteSelectedQuestion": "Vil du slette alle {count} valgte filer?",
|
||||
"Download": "Download",
|
||||
"EditFile": "Rediger fil",
|
||||
"Empty": "Tom",
|
||||
@@ -357,14 +404,14 @@
|
||||
"Logfiles": "Logfiler"
|
||||
},
|
||||
"SystemPanel": {
|
||||
"Constants": "Constants",
|
||||
"Constants": "Konstanter",
|
||||
"Cpu": "CPU",
|
||||
"HostDetails": "Host details",
|
||||
"LastStats": "Last stats",
|
||||
"Load": "Load",
|
||||
"Memory": "MEM",
|
||||
"NoMoreInfos": "No more Infos",
|
||||
"SystemLoad": "System Loads",
|
||||
"HostDetails": "Værtsdetaljer",
|
||||
"LastStats": "Sidste detaljer",
|
||||
"Load": "Belastning",
|
||||
"Memory": "RAM",
|
||||
"NoMoreInfos": "Ikke mere info",
|
||||
"SystemLoad": "Systembelastninger",
|
||||
"Values": {
|
||||
"Awake": "Vågen/Aktiv: {awake}",
|
||||
"Bandwidth": "Båndbredde: {bandwidth}/s",
|
||||
@@ -384,7 +431,7 @@
|
||||
"UpdatePanel": {
|
||||
"CheckForUpdates": "Tjek for opdateringer",
|
||||
"Commits": "Forpligtelse",
|
||||
"CommitsAvailabe": "Ingen commits tilgængelige | {count} commits tilgængelige | {count} commits tilgængelige",
|
||||
"CommitsAvailable": "Ingen commits tilgængelige | {count} commits tilgængelige | {count} commits tilgængelige",
|
||||
"CommitsOnDate": " Forpligtelse af {date}",
|
||||
"CommittedDaysAgo": "Forpligtelse delt for {days} dage siden",
|
||||
"CommittedHoursAgo": "Forpligtelse delt for {hours} timer siden",
|
||||
@@ -406,15 +453,31 @@
|
||||
}
|
||||
},
|
||||
"Panels": {
|
||||
"DependenciesPanel": {
|
||||
"Dependency": "Afhængighed | Afhængigheder",
|
||||
"DependencyDescription": "Din nuværende version af {name} understøtter ikke alle funktioner i Mainsail. Opdater {name} til mindst version {neededVersion}."
|
||||
},
|
||||
"ExtruderControlPanel": {
|
||||
"Allowed": "Tilladt",
|
||||
"EstimatedExtrusion": "Estimeret ekstrudering",
|
||||
"Extrude": "Extrude",
|
||||
"ExtruderTempTooLow": "Hotend temp. <",
|
||||
"Headline": "Extruder Kontrolpanel",
|
||||
"Retract": "Retract"
|
||||
"ExtrusionFactor": "Ekstruderingsfaktor",
|
||||
"ExtrusionFeedrate": "Ekstruderingsfødehastighed",
|
||||
"FilamentLength": "Filamentlængde",
|
||||
"FirmwareRetractionSettings": {
|
||||
"RetractLength": "Retract længde",
|
||||
"RetractSpeed": "Retract hastighed",
|
||||
"UnretractExtraLength": "Unretract ekstra længde",
|
||||
"UnretractSpeed": "Unretract hastighed"
|
||||
},
|
||||
"Headline": "Ekstruder Kontrolpanel",
|
||||
"LoadFilament": "Fød filament",
|
||||
"PressureAdvanceSettings": {
|
||||
"Advance": "Advance",
|
||||
"Extruder": "Ekstruder",
|
||||
"SmoothTime": "Smooth Time"
|
||||
},
|
||||
"Requested": "Anmodet",
|
||||
"Retract": "Retract",
|
||||
"TooLargeExtrusion": "Ekstruderingen er for lang!",
|
||||
"UnloadFilament": "Fjern filament"
|
||||
},
|
||||
"FarmPrinterPanel": {
|
||||
"ReconnectToPrinter": "Genopret forbindelse",
|
||||
@@ -424,31 +487,16 @@
|
||||
"KlippyStatePanel": {
|
||||
"FirmwareRestart": "Genstart alt",
|
||||
"KlipperCheck": "Check at Klipper service kører og at en UDS (Unix Domain Socket) er konfigureret.",
|
||||
"KlippyState": "Klippy-Status",
|
||||
"MoonrakerCannotConnect": "Moonraker kan ikke forbinde til Klipper!",
|
||||
"Restart": "Genstart"
|
||||
},
|
||||
"MachineSettingsPanel": {
|
||||
"FirmwareRetractionSettings": {
|
||||
"FirmwareRetraction": "Firmware Retraction",
|
||||
"RetractLength": "Retract længde",
|
||||
"RetractSpeed": "Retract hastighed",
|
||||
"UnretractExtraLength": "Unretract ekstra længde",
|
||||
"UnretractSpeed": "Unretract hastighed"
|
||||
},
|
||||
"Headline": "Printer indstillinger",
|
||||
"MotionSettings": {
|
||||
"Acceleration": "Acceleration",
|
||||
"MaxAccelToDecel": "Maks. accel. til decel.",
|
||||
"Motion": "Bevægelse",
|
||||
"SquareCornerVelocity": "Hastighed for 90° hjørne",
|
||||
"Velocity": "Hastighed (Feedrate)"
|
||||
},
|
||||
"PressureAdvanceSettings": {
|
||||
"Advance": "Advance",
|
||||
"Extruder": "Extruder",
|
||||
"PressureAdvance": "Pressure Advance",
|
||||
"SmoothTime": "Smooth Time"
|
||||
}
|
||||
},
|
||||
"MacrosPanel": {
|
||||
@@ -486,6 +534,8 @@
|
||||
"CancelPrint": "Afbryd print",
|
||||
"ClearPrintStats": "Slet printstatistik",
|
||||
"Difference": "Opvarmning",
|
||||
"EmptyGcodes": "Ingen G-kode tilgængelig.",
|
||||
"EmptyJobqueue": "Der er ingen jobs i kø.",
|
||||
"Estimate": "Estimeret",
|
||||
"ETA": "ETA",
|
||||
"ExcludeObject": {
|
||||
@@ -497,25 +547,29 @@
|
||||
},
|
||||
"Filament": "Filament",
|
||||
"File": "Fil",
|
||||
"Files": "Filer",
|
||||
"Flow": "Flow",
|
||||
"Headline": "Status",
|
||||
"Jobqueue": "Jobkø: ({count})",
|
||||
"JobqueueMoreFiles": "Ikke flere jobs | Et job til | {count} jobs tilbage",
|
||||
"Layer": "Lag",
|
||||
"Max": "maks",
|
||||
"ObjectHeight": "Objekt Højde",
|
||||
"PausePrint": "Pause print",
|
||||
"Print": "Reel printtid",
|
||||
"PrintTime": "Print Tid",
|
||||
"ReprintJob": "Print job igen",
|
||||
"Requested": "Anmodet",
|
||||
"ResumePrint": "Genoptag print",
|
||||
"Slicer": "Slicer",
|
||||
"Speed": "Hastighed",
|
||||
"Status": "Status",
|
||||
"Total": "Total",
|
||||
"Unknown": "Ukendt"
|
||||
},
|
||||
"TemperaturePanel": {
|
||||
"AutoscaleChart": "Autoskalér diagram",
|
||||
"Avg": "Gns",
|
||||
"Color": "Farve",
|
||||
"Cooldown": "Nedkøling",
|
||||
"Current": "Nuværende",
|
||||
"Dataset": {
|
||||
@@ -543,15 +597,11 @@
|
||||
"Absolute": "absolut",
|
||||
"ALL": "Alle",
|
||||
"Headline": "Kontrolpanel",
|
||||
"InvertX": "Invertér X",
|
||||
"InvertY": "Invertér Y",
|
||||
"InvertZ": "Invertér Z",
|
||||
"PleaseConfigureSteps": "Konfigurer steps",
|
||||
"Position": "Position",
|
||||
"QGL": "QGL",
|
||||
"Relative": "relativ",
|
||||
"SettingsInterfaceControl": "Indstillinger > Interface > Control",
|
||||
"SetupControls": "Kontrolindstillinger",
|
||||
"SpeedFactor": "Hastighed",
|
||||
"ZTilt": "Z Tilt"
|
||||
},
|
||||
@@ -559,11 +609,11 @@
|
||||
"All": "Alle",
|
||||
"FPS": "FPS",
|
||||
"Headline": "Webcam",
|
||||
"UnknownWebcamService": "Ukendt Webcam service",
|
||||
"UrlNotAvailable": "URL ikke tilgængelig"
|
||||
"NoWebcam": "Intet webcam tilgængeligt. Tilføj et under \"Interfaceindstillinger\" -> \"Webcams\".",
|
||||
"UnknownWebcamService": "Ukendt Webcam service"
|
||||
},
|
||||
"ZoffsetPanel": {
|
||||
"CurrentOffset": "Nuværende offset",
|
||||
"Clear": "Nulstil",
|
||||
"Headline": "Z-Offset",
|
||||
"Later": "Senere",
|
||||
"Ok": "OK",
|
||||
@@ -597,6 +647,7 @@
|
||||
},
|
||||
"SelectPrinterDialog": {
|
||||
"AddPrinter": "Tilføj Printer",
|
||||
"AddPrintersToJson": "Tilføj venligst Printere til config.json.",
|
||||
"CannotConnectTo": "Kan ikke forbinde med {host}.",
|
||||
"ChangePrinter": "Skift Printer",
|
||||
"Connecting": "Forbinder med {host}",
|
||||
@@ -628,6 +679,7 @@
|
||||
"EntryStyle": "Indtastnings-Design",
|
||||
"EntryStyleCompact": "Kompakt",
|
||||
"EntryStyleDefault": "Standard",
|
||||
"Filters": "Filtre",
|
||||
"Height": "Højde",
|
||||
"HideTemperatures": "Skjul temperaturer",
|
||||
"HideTimelapse": "Skjul Timelapse",
|
||||
@@ -641,21 +693,29 @@
|
||||
"Circle": "Cirkel",
|
||||
"Control": "Kontrol",
|
||||
"Cross": "Kryds",
|
||||
"EnableXYHoming": "Aktivér kombineret X & Y homing",
|
||||
"EstimatedExtrusionInfo": "Vis estimerede ekstruderingsinformationer",
|
||||
"EstimatedExtrusionInfoDescription": "Vis/Skjul information om estimerede ekstruderinger baseret på eksrtuderingsmængde og hastighed",
|
||||
"InvertXMovement": "Invertér X",
|
||||
"InvertYMovement": "Invertér Y",
|
||||
"InvertZMovement": "Invertér Z",
|
||||
"IsDefault": "Standard",
|
||||
"MaximumValues": "Maksimumværdier",
|
||||
"MaximumValuesVisibility": "Vis maksimumværdier",
|
||||
"MinimumValues": "Minimumsværdier",
|
||||
"MotorsOff": "Slukkede motorer{isDefault}",
|
||||
"MoveDistancesEInMm": "Distance E i mm",
|
||||
"MoveDistancesInMm": "Distance i mm",
|
||||
"MoveDistancesXYInMm": "Distance XY i mm",
|
||||
"MoveDistancesZInMm": "Distance Z i mm",
|
||||
"QuadGantryLevel": "Firarms nivellering {isDefault}",
|
||||
"SpeedEInMms": "Hastighed E i mm/s",
|
||||
"SpeedXY": "Hastighed XY",
|
||||
"SpeedZ": "Hastighed Z",
|
||||
"Style": "Stil",
|
||||
"ValueGreaterThan": "Værdi større end"
|
||||
"ValueGreaterThan": "Værdi større end {value}",
|
||||
"ZOffsetIncrements": "Z-offset trin (i mm)",
|
||||
"ZTiltAdjust": "Z-Tilt justering{isDefault}"
|
||||
},
|
||||
"DashboardTab": {
|
||||
"Dashboard": "Kontrolpanel",
|
||||
@@ -679,11 +739,12 @@
|
||||
},
|
||||
"GCodeViewerTab": {
|
||||
"BackgroundColor": "Baggrundsfarve",
|
||||
"ExtruderColor": "Extruder farve",
|
||||
"ExtruderColor": "Ekstruder farve",
|
||||
"GCodeViewer": "G-Code viser",
|
||||
"GridColor": "Grid farve",
|
||||
"MaxFeed": "Maksimum hastighed",
|
||||
"MinFeed": "Minimum hastighed",
|
||||
"ProgressColor": "Fremgangsfarve",
|
||||
"ShowAxes": "Vis akser"
|
||||
},
|
||||
"GeneralTab": {
|
||||
@@ -693,6 +754,14 @@
|
||||
"CalcEstimateTimeDescription": "Hvis flere er valgt vil et gennemsnit blive brugt",
|
||||
"CalcEtaTime": "Beregn sluttidspunkt for print",
|
||||
"CalcEtaTimeDescription": "Hvis flere er valgt vil et gennemsnit blive brugt",
|
||||
"CalcPrintProgress": "Fremgangsberegning",
|
||||
"CalcPrintProgressDescription": "Metode til beregning af fremgang.",
|
||||
"CalcPrintProgressItems": {
|
||||
"Filament": "Filament",
|
||||
"FileAbsolute": "Filposition (absolut)",
|
||||
"FileRelative": "Filposition (relativ)",
|
||||
"Slicer": "Slicer (M73)"
|
||||
},
|
||||
"CannotReadJson": "Kan ikke læse backup-fil",
|
||||
"DbConsoleHistory": "Terminal Historik",
|
||||
"DbHistoryJobs": "Jobhistorik",
|
||||
@@ -759,9 +828,13 @@
|
||||
"CustomGCode": "Brugerdefineret G-Code",
|
||||
"EditCooldown": "Rediger nedkøling",
|
||||
"EditHeadline": "Rediger forudindstilling",
|
||||
"ErrorInvalidValue": "Ugyldig værdi",
|
||||
"ErrorNameNotUnique": "Navnet er allerede i brug",
|
||||
"ErrorNameRequired": "Navn skal udfyldes",
|
||||
"Name": "Navn",
|
||||
"PreheatPresets": "Forudindstillinger",
|
||||
"PresetInfo": "Du skal indstille mindst én temperatur eller g-kode.",
|
||||
"PresetNamePlaceholder": "Navn (skal udfyldes)",
|
||||
"StoreButton": "Gem forudindstilling",
|
||||
"UpdateButton": "Opdater forudindstilling",
|
||||
"UpdateCooldown": "Opdater nedkøling"
|
||||
@@ -772,7 +845,8 @@
|
||||
"Hostname": "Værtsnavn",
|
||||
"Port": "Port",
|
||||
"RemotePrinters": "Printere",
|
||||
"UpdatePrinter": "Opdater printer"
|
||||
"UpdatePrinter": "Opdater printer",
|
||||
"UseConfigJson": "InstanceDB = JSON fundet. Brug venligst config.json til at ændre på printerlisten."
|
||||
},
|
||||
"TimelapseTab": {
|
||||
"Autorender": "Autorendering",
|
||||
@@ -784,12 +858,12 @@
|
||||
"duplicatelastframe": "Kopier sidste frame",
|
||||
"duplicatelastframeDescription": "Kopierer sidste frame i videoen",
|
||||
"Enabled": "Aktiveret",
|
||||
"EnabledDescription": "Hvis inaktiv, bliver G-Code makroer ignoreret og AutoRendering bliver sprunget over.",
|
||||
"EnabledDescription": "Hvis inaktiv, bliver G-Kode makroer ignoreret og AutoRendering bliver sprunget over.",
|
||||
"Extraoutputparams": "Ekstra output parametre",
|
||||
"ExtraoutputparamsDescription": "Definerer ekstra output parametre til FFMPEG. Bemærk: Udfyldning af dette felt vil deaktivere rotationsindstillinger",
|
||||
"FwRetract": "Firmware Retract",
|
||||
"FwRetractDescription": "Brug firmware retraction i timelapse makroen",
|
||||
"GcodeVerbose": "Beskrevet G-Code",
|
||||
"GcodeVerbose": "Beskrevet G-Kode",
|
||||
"GcodeVerboseDescription": "Hvis aktiv, vil G-Code skrive informationer i terminalen",
|
||||
"General": "Generelt",
|
||||
"HyperlapseCycle": "Hyperlapse cyklus tid",
|
||||
@@ -837,9 +911,9 @@
|
||||
"VariableFps": "Variabel FPS",
|
||||
"VariableFpsDescription": "Hvis aktiv, vil framrate blive beregnet ud fra ønsket længde.",
|
||||
"VariableFpsMax": "Variabel FPS maks",
|
||||
"VariableFpsMaxDescription": "",
|
||||
"VariableFpsMaxDescription": "Største værdi for variabel FPS",
|
||||
"VariableFpsMin": "Variabel FPS min",
|
||||
"VariableFpsMinDescription": ""
|
||||
"VariableFpsMinDescription": "Mindste værdi for variabel FPS"
|
||||
},
|
||||
"UiSettingsTab": {
|
||||
"BoolBigThumbnail": "Stor forhåndsvisning",
|
||||
@@ -872,8 +946,8 @@
|
||||
"AddWebcam": "Tilføj webcam",
|
||||
"CreateWebcam": "Nyt Webcam",
|
||||
"EditWebcam": "Rediger Webcam",
|
||||
"FlipHorizontally": "Vend webcam horisontalt",
|
||||
"FlipVertically": "Vend webcam vertikalt",
|
||||
"FlipWebcam": "Vend webcam-billedet:",
|
||||
"Horizontally": "horisontalt",
|
||||
"IconBed": "Bed",
|
||||
"IconCam": "Kamera",
|
||||
"IconDoor": "Dør",
|
||||
@@ -888,6 +962,7 @@
|
||||
"Name": "Navn",
|
||||
"NameAlreadyExists": "Navnet bruges allerede",
|
||||
"Required": "Krævet",
|
||||
"Rotate": "Rotér",
|
||||
"SaveWebcam": "Gem Webcam",
|
||||
"Service": "Service",
|
||||
"TargetFPS": "Ønsket FPS",
|
||||
@@ -895,6 +970,7 @@
|
||||
"UrlSnapshot": "URL Snapshot",
|
||||
"UrlStream": "URL Stream",
|
||||
"Uv4lMjpeg": "UV4L-MJPEG",
|
||||
"Vertically": "vertikalt",
|
||||
"Webcams": "Webcams"
|
||||
}
|
||||
},
|
||||
|
||||
+131
-41
@@ -21,6 +21,7 @@
|
||||
"Never": "nie",
|
||||
"NextReboot": "nächsten Reboot",
|
||||
"NoNotification": "Keine Benachrichtigung vorhanden",
|
||||
"Notifications": "Benachrichtigungen",
|
||||
"Remind": "Errinnere:"
|
||||
},
|
||||
"NumberInput": {
|
||||
@@ -106,11 +107,23 @@
|
||||
"UpdatingDone": "Aktualisierung {software} abgeschlossen!"
|
||||
}
|
||||
},
|
||||
"BedScrews": {
|
||||
"Abort": "abbrechen",
|
||||
"Adjusted": "angepasst",
|
||||
"Accept": "bestätigen",
|
||||
"Description": "Klick auf <b>ANGEPASST</b> wenn die aktuelle Schraube eingestellt wurde. Klick auf <b>BESTÄTIGEN</b> um fortzufahren ohne Anpassung.",
|
||||
"Headline": "Bettschrauben",
|
||||
"ScrewAccepted": "bestätigte Schrauben",
|
||||
"ScrewIndex": "Index der Schraube",
|
||||
"ScrewName": "Name der Schraube",
|
||||
"ScrewOutput": "{current} von {max}"
|
||||
},
|
||||
"ConnectionDialog": {
|
||||
"CannotConnectTo": "Kann keine Verbindung zu Moonraker ({host}) herstellen.",
|
||||
"CheckMoonrakerLog": "Wenn diese Meldung wiederholt erscheint, schaue bitte in die Logdatei unter:",
|
||||
"Connecting": "Verbinde zu {host}",
|
||||
"Failed": "Verbindung fehlgeschlagen",
|
||||
"Initializing": "Initialisieren",
|
||||
"TryAgain": "Erneut versuchen"
|
||||
},
|
||||
"Console": {
|
||||
@@ -121,18 +134,21 @@
|
||||
"SendCode": "Code senden...",
|
||||
"SetupConsole": "Einstellungen"
|
||||
},
|
||||
"Dialogs": {
|
||||
"StartPrint": {
|
||||
"Cancel": "abbrechen",
|
||||
"DoYouWantToStartFilename": "Willst du {filename} starten?",
|
||||
"Headline": "Starte Job",
|
||||
"Print": "drucken",
|
||||
"Timelapse": "Zeitraffer"
|
||||
}
|
||||
},
|
||||
"Editor": {
|
||||
"Cancel": "Abbrechen",
|
||||
"ConfigReference": "Konfig-Referenz",
|
||||
"DontSave": "Nicht speichern",
|
||||
"Downloading": "Herunterladen",
|
||||
"FailedSave": "{filename} konnte nicht hochgeladen werden!",
|
||||
"FileReadOnly": "schreibgeschützt",
|
||||
"KlipperRestartMethod": "Klipper Neustartmethode",
|
||||
"KlipperRestartMethodDescription": "Wählen der Neustartmethode die bei 'Speichern & Neustarten' verwendet wird, wenn Klipper-Konfigurationsdateien bearbeitet werden.",
|
||||
"Minimap": "Minimap anzeigen",
|
||||
"MoonrakerRestartInstance": "Moonraker Neustartinstanz",
|
||||
"MoonrakerRestartInstanceDescription": "Wählen der Moonraker-Instanz die bei 'Speichern & Neustarten' neu gestartet wird, wenn Moonraker-Konfigurationsdateien bearbeitet werden.",
|
||||
"SaveClose": "Speichern & schließen",
|
||||
"SaveRestart": "Speichern & Neustart",
|
||||
"SuccessfullySaved": "{filename} erfolgreich gespeichert.",
|
||||
@@ -150,17 +166,20 @@
|
||||
"Files": {
|
||||
"AddToQueue": "Zur Auftragswarteschlange hinzufügen",
|
||||
"AllFiles": "Alle",
|
||||
"BedTemp": "Bett Temp.",
|
||||
"Cancel": "Abbrechen",
|
||||
"ChamberTemp": "Kammer Temp.",
|
||||
"Create": "Erstellen",
|
||||
"CreateNewDirectory": "Ordner erstellen",
|
||||
"CurrentPath": "Aktueller Pfad",
|
||||
"Delete": "Löschen",
|
||||
"DeleteDirectory": "Verzeichnis löschen",
|
||||
"DeleteDirectoryQuestion": "Willst du wirklich das Verzeichnis \"{name}\" mit seinem gesamten Inhalt löschen?",
|
||||
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",
|
||||
"Download": "Herunterladen",
|
||||
"Downloading": "Herunterladen",
|
||||
"EditFile": "Datei bearbeiten",
|
||||
"Empty": "Leer",
|
||||
"ExtruderTemp": "Extruder Temp.",
|
||||
"Filament": "Filament",
|
||||
"FilamentName": "Filament Name",
|
||||
"FilamentType": "Filament Typ",
|
||||
@@ -171,8 +190,16 @@
|
||||
"Free": "Frei",
|
||||
"FreeDisk": "Freier Speicherplatz",
|
||||
"GCodeFiles": "G-Code Dateien",
|
||||
"GcodesRootDirectoryDoesntExists": "Keinen G-Code Ordner gefunden. Bitte überprüfe die Option \"path\" im Abschnitt [virtual_sdcard] in der Klipper Konfiguration.",
|
||||
"HiddenFiles": "Versteckte Dateien",
|
||||
"InvalidNameAlreadyExists": "Name existiert bereits, bitte wähle einen anderen Namen.",
|
||||
"InvalidNameEmpty": "Feld darf nicht leer sein!",
|
||||
"LastEndTime": "Letzte Endzeit",
|
||||
"LastFilamentUsed": "Letzter Filamentverbrauch",
|
||||
"LastModified": "Zuletzt geändert",
|
||||
"LastPrintDuration": "Letzte Druckzeit",
|
||||
"LastStartTime": "Letzte Startzeit",
|
||||
"LastTotalDuration": "Letzte Gesamtzeit",
|
||||
"LayerHeight": "Schichthöhe",
|
||||
"Name": "Name",
|
||||
"NewDirectory": "Neues Verzeichnis",
|
||||
@@ -195,7 +222,6 @@
|
||||
"SuccessfullyRenamed": "{filename} erfolgreich umbenannt.",
|
||||
"SuccessfullyUploaded": "Hochladen von {filename} erfolgreich!",
|
||||
"Total": "Gesamt",
|
||||
"Uploading": "Hochladen",
|
||||
"UploadNewGcode": "G-Code hochladen",
|
||||
"Used": "Belegt",
|
||||
"View3D": "3D Betrachtung"
|
||||
@@ -248,6 +274,9 @@
|
||||
"ErrorKlipperNotReady": "Klipper nicht bereit. Heightmap deaktiviert.",
|
||||
"Flat": "Flach",
|
||||
"Heightmap": "Heightmap",
|
||||
"InvalidNameAlreadyExists": "Das Profil existiert bereits, bitte wähle einen anderen Profilnamen.",
|
||||
"InvalidNameEmpty": "Feld darf nicht leer sein!",
|
||||
"InvalidNameReserved": "Das Profil 'default' ist reserviert, bitte wähle einen anderen Profilnamen.",
|
||||
"Later": "später",
|
||||
"Mesh": "Mesh",
|
||||
"Name": "Name",
|
||||
@@ -269,12 +298,15 @@
|
||||
"Wireframe": "Drahtgitter"
|
||||
},
|
||||
"History": {
|
||||
"AddNote": "Notiz hinzufügen",
|
||||
"AllJobs": "Alle",
|
||||
"AvgPrinttime": "Druckzeit - Ø",
|
||||
"Cancel": "abbrechen",
|
||||
"CreateNote": "Notiz anlegen",
|
||||
"Delete": "Löschen",
|
||||
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Jobs gelöscht werden?",
|
||||
"Details": "Details",
|
||||
"EditNote": "Notiz bearbeiten",
|
||||
"Empty": "leer",
|
||||
"EndTime": "Endzeit",
|
||||
"EstimatedFilament": "Geschätztes Filament",
|
||||
@@ -295,12 +327,14 @@
|
||||
"LastModified": "Zuletzt geändert",
|
||||
"LayerHeight": "Schichthöhe",
|
||||
"LongestPrinttime": "Druckzeit - längste",
|
||||
"Note": "Notiz",
|
||||
"ObjectHeight": "Objekthöhe",
|
||||
"PrintDuration": "Druckdauer",
|
||||
"PrintHistory": "Historie",
|
||||
"PrintTime": "Druckzeit",
|
||||
"PrinttimeAvg": "Druckzeit - Ø",
|
||||
"Reprint": "Erneut drucken",
|
||||
"Save": "speichern",
|
||||
"Search": "Suchen",
|
||||
"SelectedFilamentUsed": "Ausg. Filamentverbrauch",
|
||||
"SelectedJobs": "Ausg. Drucke",
|
||||
@@ -317,6 +351,7 @@
|
||||
"in_progress": "In Arbeit",
|
||||
"klippy_disconnect": "Klippy getrennt",
|
||||
"klippy_shutdown": "Klippy heruntergefahren",
|
||||
"Others": "Sonstige",
|
||||
"server_exit": "Server-Exit"
|
||||
},
|
||||
"TitleExportHistory": "Historie exportieren",
|
||||
@@ -342,6 +377,7 @@
|
||||
"AllFiles": "Alle",
|
||||
"Cancel": "Abbruch",
|
||||
"ConfigFiles": "Konfigurationsdateien",
|
||||
"ConfigRootDirectoryDoesntExists": "Keinen Konfigurations-Ordner gefunden. Bitte überprüfe die Option \"config_path\" im Abschnitt [file_manager] in der Moonraker Konfiguration.",
|
||||
"Create": "Erstellen",
|
||||
"CreateDirectory": "Verzeichnis erstellen",
|
||||
"CreateFile": "Datei erstellen",
|
||||
@@ -411,7 +447,7 @@
|
||||
"UpdatePanel": {
|
||||
"CheckForUpdates": "auf aktualisierungen prüfen",
|
||||
"Commits": "Commits",
|
||||
"CommitsAvailabe": "keine Einreichung verfügbar | {count} Einreichung verfügbar | {count} Einreichungen verfügbar",
|
||||
"CommitsAvailable": "keine Einreichung verfügbar | {count} Einreichung verfügbar | {count} Einreichungen verfügbar",
|
||||
"CommitsOnDate": "Engereicht am {date}",
|
||||
"CommittedDaysAgo": "eingereicht vor {days} Tagen",
|
||||
"CommittedHoursAgo": "eingereicht vor {hours} Stunden",
|
||||
@@ -432,16 +468,34 @@
|
||||
"UpToDate": "aktuell"
|
||||
}
|
||||
},
|
||||
"ManualProbe": {
|
||||
"Abort": "abbrechen",
|
||||
"Accept": "akzeptieren",
|
||||
"Advanced": "Erweitert",
|
||||
"Headline": "Manuelle Messung"
|
||||
},
|
||||
"Panels": {
|
||||
"ExtruderControlPanel": {
|
||||
"Allowed": "Erlaubt",
|
||||
"EstimatedExtrusion": "Geschätzte Extrusion:",
|
||||
"EstimatedExtrusion": "Extrusion:",
|
||||
"Extrude": "Extrudieren",
|
||||
"ExtruderTempTooLow": "Extruder Temp. <",
|
||||
"ExtrusionFactor": "Extrusionsfaktor",
|
||||
"ExtrusionFeedrate": "Extrusionsgeschwindigkeit",
|
||||
"FilamentLength": "Filamentlänge",
|
||||
"FirmwareRetractionSettings": {
|
||||
"RetractLength": "Rückzugslänge",
|
||||
"RetractSpeed": "Rückzuggeschwindigkeit",
|
||||
"UnretractExtraLength": "Zusätzliche Ausfahrlänge",
|
||||
"UnretractSpeed": "Ausfahrgeschwindigkeit"
|
||||
},
|
||||
"Headline": "Extruder",
|
||||
"LoadFilament": "Filament laden",
|
||||
"PressureAdvanceSettings": {
|
||||
"Advance": "Pressure Advance",
|
||||
"Extruder": "Extruder",
|
||||
"SmoothTime": "Smooth Time"
|
||||
},
|
||||
"Requested": "Angefordert",
|
||||
"Retract": "Rückzug",
|
||||
"TooLargeExtrusion": "Extrusion zu groß!",
|
||||
@@ -455,31 +509,17 @@
|
||||
"KlippyStatePanel": {
|
||||
"FirmwareRestart": "Firmware Neustart",
|
||||
"KlipperCheck": "Bitte überprüfen Sie, ob der Klipper-Dienst läuft und ein UDS (Unix Domain Socket) konfiguriert ist.",
|
||||
"KlippyState": "Klippy-Status",
|
||||
"MoonrakerCannotConnect": "Moonraker kann keine Verbindung zu Klipper herstellen!",
|
||||
"Restart": "Neustart"
|
||||
"Restart": "Neustart",
|
||||
"ServiceReports": "{service} meldet"
|
||||
},
|
||||
"MachineSettingsPanel": {
|
||||
"FirmwareRetractionSettings": {
|
||||
"FirmwareRetraction": "Firmware Rückzug",
|
||||
"RetractLength": "Rückzugslänge",
|
||||
"RetractSpeed": "Rückzuggeschwindigkeit",
|
||||
"UnretractExtraLength": "Zusätzliche Ausfahrlänge",
|
||||
"UnretractSpeed": "Ausfahrgeschwindigkeit"
|
||||
},
|
||||
"Headline": "Maschine",
|
||||
"MotionSettings": {
|
||||
"Acceleration": "Beschleunigung",
|
||||
"MaxAccelToDecel": "Max. Beschl. zu Verz.",
|
||||
"Motion": "Bewegung",
|
||||
"SquareCornerVelocity": "Eck-Geschwindigkeit",
|
||||
"Velocity": "Geschwindigkeit"
|
||||
},
|
||||
"PressureAdvanceSettings": {
|
||||
"Advance": "Pressure Advance",
|
||||
"Extruder": "Extruder",
|
||||
"PressureAdvance": "Pressure Advance",
|
||||
"SmoothTime": "Smooth Time"
|
||||
}
|
||||
},
|
||||
"MacrosPanel": {
|
||||
@@ -501,6 +541,12 @@
|
||||
},
|
||||
"MiscellaneousPanel": {
|
||||
"Headline": "Sonstiges",
|
||||
"Light": {
|
||||
"Blue": "blau",
|
||||
"Green": "grün",
|
||||
"Red": "rot",
|
||||
"White": "weiß"
|
||||
},
|
||||
"RunoutSensor": {
|
||||
"Detected": "erkannt",
|
||||
"Disabled": "deaktiviert",
|
||||
@@ -517,6 +563,8 @@
|
||||
"CancelPrint": "Druck abbrechen",
|
||||
"ClearPrintStats": "Druckstatistiken löschen",
|
||||
"Difference": "Unterschied",
|
||||
"EmptyGcodes": "Kein G-Code verfügbar.",
|
||||
"EmptyJobqueue": "Aktuell keine Datei in der Warteschlange.",
|
||||
"Estimate": "Schätzung",
|
||||
"ETA": "ETA",
|
||||
"ExcludeObject": {
|
||||
@@ -528,25 +576,29 @@
|
||||
},
|
||||
"Filament": "Filament",
|
||||
"File": "Datei",
|
||||
"Files": "Dateien",
|
||||
"Flow": "Fluss",
|
||||
"Headline": "Status",
|
||||
"Jobqueue": "Warteschlange ({count})",
|
||||
"JobqueueMoreFiles": "keine weiteren Aufträge | einen weiteren Auftrag | {count} weitere Aufträge",
|
||||
"Layer": "Schicht",
|
||||
"Max": "max",
|
||||
"ObjectHeight": "Objekthöhe",
|
||||
"PausePrint": "Druck pausieren",
|
||||
"Print": "Druck",
|
||||
"PrintTime": "Druckzeit",
|
||||
"ReprintJob": "Auftrag erneut drucken",
|
||||
"Requested": "Angefordert",
|
||||
"ResumePrint": "Druck fortführen",
|
||||
"Slicer": "Slicer",
|
||||
"Speed": "Geschwindigkeit",
|
||||
"Status": "Status",
|
||||
"Total": "Gesamt",
|
||||
"Unknown": "Unbekannt"
|
||||
},
|
||||
"TemperaturePanel": {
|
||||
"AutoscaleChart": "Autoskalierung",
|
||||
"Avg": "Ø",
|
||||
"Color": "Farbe",
|
||||
"Cooldown": "Abkühlen",
|
||||
"Current": "Aktuell",
|
||||
"Dataset": {
|
||||
@@ -574,20 +626,12 @@
|
||||
"Absolute": "absolut",
|
||||
"ALL": "ALLE",
|
||||
"Headline": "Werkzeugkopf",
|
||||
"InvertX": "X invertieren",
|
||||
"InvertY": "Y invertieren",
|
||||
"InvertZ": "Z invertieren",
|
||||
"OutOfRange": "Außerhalb der Maschinengrenze!",
|
||||
"PleaseConfigureSteps": "Bitte Schritte konfigurieren",
|
||||
"Position": "Position",
|
||||
"QGL": "QGL",
|
||||
"Relative": "relativ",
|
||||
"SettingsInterfaceControl": "Einstellungen > Interface > Steuerung",
|
||||
"SetupControls": "Setup-Steuerelemente",
|
||||
"SpeedFactor": "Geschwindigkeitsfaktor",
|
||||
"XOffset": "X-Versatz",
|
||||
"YOffset": "Y-Versatz",
|
||||
"ZOffset": "Z-Versatz",
|
||||
"ZTilt": "Z Tilt"
|
||||
},
|
||||
"WebcamPanel": {
|
||||
@@ -595,12 +639,10 @@
|
||||
"FPS": "FPS",
|
||||
"Headline": "Webcam",
|
||||
"NoWebcam": "Keine Webcam verfügbar. Füge eine Webcam unter \"Interface Einstellungen\" -> \"Webcams\".",
|
||||
"UnknownWebcamService": "Unbekannter Webcam Dienst",
|
||||
"UrlNotAvailable": "URL nicht verfügbar"
|
||||
"UnknownWebcamService": "Unbekannter Webcam Dienst"
|
||||
},
|
||||
"ZoffsetPanel": {
|
||||
"Clear": "Löschen",
|
||||
"CurrentOffset": "Aktueller Versatz",
|
||||
"Headline": "Z-Versatz",
|
||||
"Later": "Später",
|
||||
"Ok": "OK",
|
||||
@@ -634,6 +676,7 @@
|
||||
},
|
||||
"SelectPrinterDialog": {
|
||||
"AddPrinter": "Drucker hinzufügen",
|
||||
"AddPrintersToJson": "Bitte füge einen Drucker in der config.json hinzu.",
|
||||
"CannotConnectTo": "Kann keine Verbindung zu {host} herstellen.",
|
||||
"ChangePrinter": "Drucker ändern",
|
||||
"Connecting": "Verbinde zu {host}",
|
||||
@@ -641,7 +684,9 @@
|
||||
"EditPrinter": "Drucker bearbeiten",
|
||||
"Hello": "Hallo und willkommen im Remote-Modus von Mainsail!",
|
||||
"HostnameInvalid": "ungültiger Hostname/IP",
|
||||
"HostnameIp": "Hostname/IP",
|
||||
"HostnameRequired": "Hostname ist erforderlich",
|
||||
"Port": "Port",
|
||||
"PortRequired": "Port ist erforderlich",
|
||||
"RememberToAdd": "Bitte denk daran, {cors} in moonraker.conf unter 'cors_domains' hinzuzufügen.",
|
||||
"SelectPrinter": "Drucker auswählen",
|
||||
@@ -663,6 +708,7 @@
|
||||
"EntryStyle": "Stil der Einträge",
|
||||
"EntryStyleCompact": "kompakt",
|
||||
"EntryStyleDefault": "standard",
|
||||
"Filters": "Filter",
|
||||
"Height": "Höhe",
|
||||
"HideTemperatures": "Temperaturen ausblenden",
|
||||
"HideTimelapse": "Timelapse ausblenden",
|
||||
@@ -713,6 +759,10 @@
|
||||
"ConfirmUnsavedChanges": "Aufforderung zum Speichern oder Verwerfen nicht gespeicherter Änderungen",
|
||||
"ConfirmUnsavedChangesDescription": "Wenn aktiviert, dann ist eine Bestätigung notwendig um ungespeicherte Änderungen zu speichern/verwerfen. Wenn deaktiviert,dann werden Änderungen im Hintergrund verworfen.",
|
||||
"Editor": "Editor",
|
||||
"KlipperRestartMethod": "Klipper Neustartmethode",
|
||||
"KlipperRestartMethodDescription": "Wähle aus, welche Neustartmethode verwendet werden soll wenn 'Speichern & Neustarten' geklickt wir im Editor.",
|
||||
"MoonrakerRestartInstance": "Moonraker Neustartinstanz",
|
||||
"MoonrakerRestartInstanceDescription": "Wähle aus, welche Moonrakerinstanz neu gestartet werden soll wenn 'Speichern & Neustarten' im Editor geklickt wird.",
|
||||
"UseEscToClose": "ESC drücken um Editor zu schließen",
|
||||
"UseEscToCloseDescription": "Erlaubt es den Editor mit ESC zu schließen."
|
||||
},
|
||||
@@ -723,6 +773,7 @@
|
||||
"GridColor": "Gitterfarbe",
|
||||
"MaxFeed": "Max Vorschub",
|
||||
"MinFeed": "Min Vorschub",
|
||||
"ProgressColor": "Fortschrittsfarbe",
|
||||
"ShowAxes": "Zeige Achsen an"
|
||||
},
|
||||
"GeneralTab": {
|
||||
@@ -732,6 +783,14 @@
|
||||
"CalcEstimateTimeDescription": "Bei Mehrfachauswahl wird ein Durchschnitt berechnet",
|
||||
"CalcEtaTime": "ETA Berechnung",
|
||||
"CalcEtaTimeDescription": "Bei Mehrfachauswahl wird ein Durchschnitt berechnet",
|
||||
"CalcPrintProgress": "Berechnung des Druckfortschritts",
|
||||
"CalcPrintProgressDescription": "Methode zur Berechnung des Druckfortschritts.",
|
||||
"CalcPrintProgressItems": {
|
||||
"Filament": "Filament",
|
||||
"FileAbsolute": "Dateiposition (absolut)",
|
||||
"FileRelative": "Dateiposition (relativ)",
|
||||
"Slicer": "Slicer (M73)"
|
||||
},
|
||||
"CannotReadJson": "Sicherungsdatei kann nicht gelesen/analysiert werden.",
|
||||
"DbConsoleHistory": "Verlauf der Konsole",
|
||||
"DbHistoryJobs": "Historie Druckvorgänge",
|
||||
@@ -791,6 +850,30 @@
|
||||
"UnknownGroup": "Unbekannte Gruppe",
|
||||
"Warning": "Warnung"
|
||||
},
|
||||
"MiscellaneousTab": {
|
||||
"AddGroup": "Gruppe hinzufügen",
|
||||
"AddPreset": "Voreinstellung hinzufügen",
|
||||
"Color": "Farbe",
|
||||
"CreateGroup": "Gruppe erstellen",
|
||||
"CreatePreset": "Voreinstellung erstellen",
|
||||
"End": "Ende",
|
||||
"EndDescription": "Letzte LED von dieser Gruppe.",
|
||||
"Groups": "Gruppen",
|
||||
"GroupSubTitle": "Start: {start}, Ende: {end}",
|
||||
"LightGroups": "{name} - Gruppen",
|
||||
"LightPresets": "{name} - Voreinstellungen",
|
||||
"Miscellaneous": "Sonstiges",
|
||||
"Name": "Name",
|
||||
"NoDevicesFound": "Keine Komponente gefunden",
|
||||
"NoGroupFound": "Keine Gruppe gefunden",
|
||||
"NoPresetFound": "Keine Voreinstellungen gefunden",
|
||||
"Presets": "Voreinstellungen",
|
||||
"PresetSubTitle": "R: {red}, G: {green}, B: {blue}, W: {white}",
|
||||
"Start": "Start",
|
||||
"StartDescription": "Erste LED von dieser Gruppe.",
|
||||
"UnableToLoadLight": "Licht konnte nicht geladen werden",
|
||||
"UnableToLoadPreset": "Voreinstellung konnte nicht geladen werden"
|
||||
},
|
||||
"PresetsTab": {
|
||||
"AddPreset": "Preset hinzufügen",
|
||||
"Cooldown": "Abkühlen",
|
||||
@@ -815,8 +898,10 @@
|
||||
"Hostname": "Hostname",
|
||||
"Port": "Port",
|
||||
"RemotePrinters": "Remote Drucker",
|
||||
"UpdatePrinter": "Drucker aktualisieren"
|
||||
"UpdatePrinter": "Drucker aktualisieren",
|
||||
"UseConfigJson": "InstanceDB = JSON erkannt. Bitte bearbeite die config.json um die Druckerliste zu modifizieren."
|
||||
},
|
||||
"Store": "anlegen",
|
||||
"TimelapseTab": {
|
||||
"Autorender": "Autorender",
|
||||
"AutorenderDescription": "Wenn diese Option aktiviert ist, wird das Zeitraffervideo am Ende des Druckvorgangs automatisch gerendert",
|
||||
@@ -911,12 +996,14 @@
|
||||
"ShowWebcamInNavigation": "Zeige Webcam in der Navigation",
|
||||
"UiSettings": "UI-Einstellungen"
|
||||
},
|
||||
"Update": "speichern",
|
||||
"WebcamsTab": {
|
||||
"AddWebcam": "Webcam hinzufügen",
|
||||
"CreateWebcam": "Erstelle Webcam",
|
||||
"EditCrowsnestConf": "crowsnest.conf bearbeiten",
|
||||
"EditWebcam": "Webcam bearbeiten",
|
||||
"FlipHorizontally": "Webcam waagerecht spiegeln",
|
||||
"FlipVertically": "Webcam vertikal spiegeln",
|
||||
"FlipWebcam": "Webcam-Bild spiegeln:",
|
||||
"Horizontally": "horizontal",
|
||||
"IconBed": "Bett",
|
||||
"IconCam": "Kamera",
|
||||
"IconDoor": "Tür",
|
||||
@@ -931,6 +1018,7 @@
|
||||
"Name": "Name",
|
||||
"NameAlreadyExists": "Name existiert bereits",
|
||||
"Required": "benötigt",
|
||||
"Rotate": "Drehen",
|
||||
"SaveWebcam": "Webcam speichern",
|
||||
"Service": "Dienst",
|
||||
"TargetFPS": "Ziel FPS",
|
||||
@@ -938,6 +1026,7 @@
|
||||
"UrlSnapshot": "Schnappschuss URL",
|
||||
"UrlStream": "Stream URL",
|
||||
"Uv4lMjpeg": "UV4L-MJPEG",
|
||||
"Vertically": "vertikal",
|
||||
"Webcams": "Webcams"
|
||||
}
|
||||
},
|
||||
@@ -951,6 +1040,7 @@
|
||||
"Delete": "Löschen",
|
||||
"DeleteDirectory": "Verzeichnis löschen",
|
||||
"DeleteDirectoryQuestion": "Willst du wirklich das Verzeichnis \"{name}\" mit seinem gesamten Inhalt löschen?",
|
||||
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",
|
||||
"Download": "Download",
|
||||
"DuplicateLastframe": "Letztes Bild duplizieren",
|
||||
"Empty": "Keine fertigen Zeitraffer gefunden.",
|
||||
|
||||
Loaded 100 of 178 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user