Compare commits
225
Commits
v2.2.0-beta3
...
v2.4.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
655d2fd339 | ||
|
|
0735ed37a9 | ||
|
|
d96070f336 | ||
|
|
d259abb749 | ||
|
|
3e06c5fd66 | ||
|
|
288e5110f4 | ||
|
|
41ca5244cc | ||
|
|
3d4b5451ae | ||
|
|
dc17ff1158 | ||
|
|
de23cb6243 | ||
|
|
94d7f0dc16 | ||
|
|
45c52e3571 | ||
|
|
03640e239b | ||
|
|
4c24fa7284 | ||
|
|
12483ee63b | ||
|
|
bae712540e | ||
|
|
31664b5f38 | ||
|
|
ba5aea2b88 | ||
|
|
a6e38df012 | ||
|
|
bc0018dadc | ||
|
|
1a659d30d2 | ||
|
|
d0bf0bde11 | ||
|
|
d87fe4173d | ||
|
|
f8c66af48b | ||
|
|
da14c44873 | ||
|
|
20adf79e7c | ||
|
|
2aa181c7f5 | ||
|
|
c9ab0782bf | ||
|
|
6f8cfaa276 | ||
|
|
4760b9d9f1 | ||
|
|
d6015be734 | ||
|
|
837623e0a1 | ||
|
|
7c28027189 | ||
|
|
a88c9ba083 | ||
|
|
128baea88c | ||
|
|
cca17a8822 | ||
|
|
685665bd46 | ||
|
|
d1cfe7251d | ||
|
|
05dea0c78b | ||
|
|
d05efe26c4 | ||
|
|
835c5dacd2 | ||
|
|
57bb268ea0 | ||
|
|
d5cafaaa06 | ||
|
|
8cba020fb2 | ||
|
|
a305f243da | ||
|
|
666c942b18 | ||
|
|
f01f421c1c | ||
|
|
285b8b9b6f | ||
|
|
feadc73847 | ||
|
|
ceca6ce2f7 | ||
|
|
ff37c7de32 | ||
|
|
829e7a497d | ||
|
|
37c9fa8657 | ||
|
|
6a40e6047d | ||
|
|
78b9864d11 | ||
|
|
950dea1e08 | ||
|
|
27c57eef68 | ||
|
|
f65bc9f0b9 | ||
|
|
e150a4ef32 | ||
|
|
a70bd12c19 | ||
|
|
3ec2ee2793 | ||
|
|
e411175b7f | ||
|
|
3f67d1d4c5 | ||
|
|
12dd1c9e31 | ||
|
|
2b2057648d | ||
|
|
42f7851636 | ||
|
|
175a90aae5 | ||
|
|
1e9120e709 | ||
|
|
4e8b6de72a | ||
|
|
c37ea7f0ed | ||
|
|
f22d4d09c8 | ||
|
|
4a450fc563 | ||
|
|
eb4c5678ba | ||
|
|
fe04944c79 | ||
|
|
6fefc98da6 | ||
|
|
0570568322 | ||
|
|
9a5b230ffa | ||
|
|
da569fc9f7 | ||
|
|
719b5c4b01 | ||
|
|
28e1ec384d | ||
|
|
6387431ce8 | ||
|
|
fd79316799 | ||
|
|
05672b55c1 | ||
|
|
cbb70759f5 | ||
|
|
99075fb259 | ||
|
|
14f6799489 | ||
|
|
24d5668a65 | ||
|
|
2b5ea0f66e | ||
|
|
e75f0bcee8 | ||
|
|
8e562c7bba | ||
|
|
5f2f7ddc9f | ||
|
|
349372fd64 | ||
|
|
157e099964 | ||
|
|
fe9995882a | ||
|
|
d8377ac6e5 | ||
|
|
b16c1cfdd2 | ||
|
|
8c1f09d909 | ||
|
|
1f71d2dbbc | ||
|
|
f55b58a2a9 | ||
|
|
8d7e4c1ea4 | ||
|
|
4357b8c9d6 | ||
|
|
46f0879677 | ||
|
|
1d117ed82f | ||
|
|
2eb34007e1 | ||
|
|
4c9aab5a2d | ||
|
|
98439b916b | ||
|
|
24932c088f | ||
|
|
69f30ed460 | ||
|
|
1709001c8b | ||
|
|
f277193082 | ||
|
|
8af3f92a60 | ||
|
|
79bc61780c | ||
|
|
2b626474b4 | ||
|
|
09ab1077a1 | ||
|
|
c2ddac3e2f | ||
|
|
9474ae614d | ||
|
|
fa2f07fc22 | ||
|
|
afb041a5fa | ||
|
|
f27a7770a9 | ||
|
|
5ce78fae4a | ||
|
|
6f68709f21 | ||
|
|
8ab59b642a | ||
|
|
2d7a5b5845 | ||
|
|
a4e268e543 | ||
|
|
f4ed91e515 | ||
|
|
15b12a68e5 | ||
|
|
7f57f8b9aa | ||
|
|
1f9d8e86be | ||
|
|
7536bce10d | ||
|
|
4bd2d28f4b | ||
|
|
6b6ca698e6 | ||
|
|
c514b3f130 | ||
|
|
46aa7cc7c6 | ||
|
|
d1c1b077d8 | ||
|
|
ea8e8e8caa | ||
|
|
3beeacb4ee | ||
|
|
7da894d55e | ||
|
|
d48d05bebe | ||
|
|
5f3d80dd5b | ||
|
|
e5d4e6243a | ||
|
|
1e0645be6e | ||
|
|
eb1d3c1475 | ||
|
|
1e62b5bce5 | ||
|
|
6661e031fb | ||
|
|
8a000e38a4 | ||
|
|
229a6759cf | ||
|
|
dfc91df681 | ||
|
|
38d2c883b1 | ||
|
|
b5c92cbcab | ||
|
|
642d5a0cb5 | ||
|
|
a9669ad809 | ||
|
|
753f050795 | ||
|
|
443b7f9dc8 | ||
|
|
8438c0a86b | ||
|
|
308518a25c | ||
|
|
de911d21fc | ||
|
|
911387755f | ||
|
|
8367f01bce | ||
|
|
21ad4c16e7 | ||
|
|
6b18300b5d | ||
|
|
1c84e6ec6d | ||
|
|
0d4c0149b4 | ||
|
|
5029f4d9d5 | ||
|
|
94338ba5d4 | ||
|
|
04159fc49c | ||
|
|
a30a001290 | ||
|
|
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 | ||
|
|
dfaccb39a5 | ||
|
|
ff0d50239c | ||
|
|
fb4bfb3f57 | ||
|
|
86638effdd | ||
|
|
6ffb771eeb | ||
|
|
bbf2832238 | ||
|
|
c7fc694fca | ||
|
|
4aec550a90 | ||
|
|
3011928ca3 | ||
|
|
d657db36d6 | ||
|
|
fd89ff7ba3 | ||
|
|
cc888a3924 | ||
|
|
5cbcebb771 | ||
|
|
bc841609ba | ||
|
|
fccd8321bb | ||
|
|
04a39361c3 | ||
|
|
090cda6350 | ||
|
|
ad6015b69f | ||
|
|
76cedb174e | ||
|
|
0da85e0e20 | ||
|
|
9e64fb139d | ||
|
|
257c31790f | ||
|
|
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,145 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
type: string
|
||||
description: New version number in X.Y.Z
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
push-version-number:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone develop repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
ref: 'develop'
|
||||
|
||||
- name: get-npm-version
|
||||
id: package-version
|
||||
uses: martinbeentjes/npm-get-version-action@main
|
||||
|
||||
- name: Push version number
|
||||
if: steps.package-version.outputs.current-version != github.event.inputs.version
|
||||
shell: bash
|
||||
run: |
|
||||
npm version --no-git-tag-version ${{ github.event.inputs.version }}
|
||||
|
||||
- name: git add & commit & push
|
||||
if: steps.package-version.outputs.current-version != github.event.inputs.version
|
||||
uses: EndBug/add-and-commit@v9
|
||||
with:
|
||||
add: 'package.json package-lock.json'
|
||||
default_author: github_actions
|
||||
message: 'chore: push version number to v${{ github.event.inputs.version }}'
|
||||
push: true
|
||||
|
||||
update-master-branch:
|
||||
needs: ['push-version-number']
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: everlytic/branch-merge@1.1.5
|
||||
with:
|
||||
github_token: ${{ secrets.PAT }}
|
||||
source_ref: 'develop'
|
||||
target_branch: 'master'
|
||||
commit_message_template: '[Automated] Merged {source_ref} into target {target_branch}'
|
||||
|
||||
release:
|
||||
needs: ['update-master-branch']
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'master'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Move build out of dist
|
||||
shell: bash
|
||||
run: mv ./dist/mainsail.zip ./mainsail.zip
|
||||
|
||||
- name: Get latest tag
|
||||
id: latest_tag
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate a changelog
|
||||
uses: orhun/git-cliff-action@v1
|
||||
id: generate-changelog
|
||||
with:
|
||||
config: ./cliff-release.toml
|
||||
args: ${{ steps.latest_tag.outputs.TAG_NAME }}..HEAD
|
||||
|
||||
- name: Create release and upload build
|
||||
uses: softprops/action-gh-release@v1
|
||||
id: create-release
|
||||
with:
|
||||
name: v${{ github.event.inputs.version }}
|
||||
tag_name: v${{ github.event.inputs.version }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: ./mainsail.zip
|
||||
body: ${{ steps.generate-changelog.outputs.content }}
|
||||
|
||||
- name: Copy remote configs to dist
|
||||
shell: bash
|
||||
run: cp ./remote/* ./dist/
|
||||
|
||||
- name: Upload to remote server
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.3.3
|
||||
with:
|
||||
server: ${{ secrets.REMOTEHOST }}
|
||||
username: ${{ secrets.REMOTEUSER }}
|
||||
password: ${{ secrets.REMOTEPASSWORD }}
|
||||
dangerous-clean-slate: true
|
||||
local-dir: ./dist/
|
||||
|
||||
update-changelog:
|
||||
needs: ['release']
|
||||
name: Generate changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'develop'
|
||||
token: ${{ secrets.PAT }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get latest tag
|
||||
id: latest_tag
|
||||
shell: bash
|
||||
run: |
|
||||
echo "TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate a changelog
|
||||
uses: orhun/git-cliff-action@v1
|
||||
id: git-cliff
|
||||
with:
|
||||
config: cliff.toml
|
||||
args: v0.0.4..${{ steps.latest_tag.outputs.TAG_NAME }}
|
||||
env:
|
||||
OUTPUT: ${{ github.workspace }}/CHANGELOG.md
|
||||
|
||||
- name: Show CHANGELOG
|
||||
run: |
|
||||
cat CHANGELOG.md
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: 'docs(changelog): update changelog'
|
||||
file_pattern: CHANGELOG.md
|
||||
@@ -0,0 +1,56 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
|
||||
# Both `issue_comment` and `scheduled` event types are required for this Action
|
||||
# to work properly.
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v5
|
||||
with:
|
||||
days-before-stale: 14
|
||||
days-before-close: 7
|
||||
exempt-all-milestones: true
|
||||
close-issue-reason: not_planned
|
||||
only-labels: '❔ User Input'
|
||||
labels-to-remove-when-unstale: '❔ User Input,💤 Stale'
|
||||
stale-issue-label: '💤 Stale'
|
||||
stale-pr-label: '💤 Stale'
|
||||
stale-issue-message: |
|
||||
Ahoi!
|
||||
|
||||
It looks like there hasn't been any recent updates on
|
||||
this issue. If you created this issue and no longer
|
||||
consider it to get merged, then please login to github
|
||||
and close it. Otherwise, if there is no further activity
|
||||
on this issue, it will be automatically closedwithin the
|
||||
next 7 days.
|
||||
|
||||
Fair wind and a following sea!
|
||||
~ Your friendly MainsailGithubBot
|
||||
|
||||
*PS: I'm just an automated script, not a real sailor.*
|
||||
stale-pr-message: |
|
||||
Ahoi!
|
||||
|
||||
It looks like there hasn't been any recent updates on
|
||||
this pull request. If you created this pull request and
|
||||
no longer consider it to get merged, then please login
|
||||
to github and close it. Otherwise, if there is no further
|
||||
activity on this pull request, it will be automatically
|
||||
closed within the next 7 days.
|
||||
|
||||
Fair wind and a following sea!
|
||||
~ Your friendly MainsailGithubBot
|
||||
|
||||
*PS: I'm just an automated script, not a real sailor.*
|
||||
@@ -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
|
||||
@@ -1,42 +0,0 @@
|
||||
name: Update changelog
|
||||
|
||||
on:
|
||||
# Update the changelog after pushing a new tag
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
# Update the changelog by invoking this workflow manually
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
changelog:
|
||||
name: Generate changelog
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get latest tag
|
||||
run: |
|
||||
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"
|
||||
id: latest_tag
|
||||
- name: Generate a changelog
|
||||
uses: orhun/git-cliff-action@v1
|
||||
id: git-cliff
|
||||
with:
|
||||
config: cliff.toml
|
||||
args: v0.0.4..${{ steps.latest_tag.outputs.TAG_NAME }}
|
||||
env:
|
||||
OUTPUT: CHANGELOG.md
|
||||
|
||||
- name: show CHANGELOG
|
||||
run: |
|
||||
cat CHANGELOG.md
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: 'chore(changelog): update changelog'
|
||||
file_pattern: CHANGELOG.md
|
||||
branch: develop
|
||||
@@ -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>_
|
||||
|
||||
@@ -84,6 +84,14 @@ Do you need help or just want to talk? Join our active community on [Discord](ht
|
||||
Did you find a bug or did you thought of a feature?
|
||||
Please create an [Issue](https://github.com/mainsail-crew/mainsail/issues) in GitHub and let us know.
|
||||
|
||||
## Official Sponsors
|
||||
|
||||
<p align='center'>
|
||||
<img src="https://raw.githubusercontent.com/mainsail-crew/docs/master/assets/img/logo-bigtreetech.png" alt='Mainsail logo' width="150">
|
||||
</p>
|
||||
|
||||
**BIGTREETECH** is the official mainboard partner of Mainsail. BIGTREETECH is committed to developing innovative and competitive products to better serve the 3D printing community.
|
||||
|
||||
## Support Mainsail
|
||||
|
||||
Mainsail is primarily developed and maintained by meteyou. To keep the project going he invests his free time, almost
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
# configuration file for git-cliff (0.1.0)
|
||||
|
||||
[changelog]
|
||||
# changelog header
|
||||
header = """
|
||||
# What's Changed
|
||||
"""
|
||||
# template for the changelog body
|
||||
# https://tera.netlify.app/docs/#introduction
|
||||
body = """
|
||||
{% for group, commits in commits | group_by(attribute="group") %}\
|
||||
### {{ group | split(pat="$") | last | upper_first }}
|
||||
{% for commit in commits
|
||||
| filter(attribute="scope")
|
||||
| sort(attribute="scope") %}
|
||||
- **{{commit.scope}}**: {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})\
|
||||
{%- if commit.breaking %}
|
||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||
{%- endif -%}
|
||||
|
||||
{%- endfor -%}
|
||||
{%- for commit in commits %}
|
||||
{%- if commit.scope -%}
|
||||
{% else -%}
|
||||
{% raw %}\n{% endraw %}\
|
||||
- {{ commit.message | upper_first | trim }} | [{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }})\
|
||||
{%- if commit.breaking %}
|
||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||
{%- endif -%}
|
||||
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% raw %}\n{% endraw %}
|
||||
{% endfor %}\n\
|
||||
"""
|
||||
# remove the leading and trailing whitespaces from the template
|
||||
trim = true
|
||||
# changelog footer
|
||||
footer = """
|
||||
"""
|
||||
|
||||
[git]
|
||||
# allow only conventional commits
|
||||
# https://www.conventionalcommits.org
|
||||
conventional_commits = true
|
||||
filter_unconventional = true
|
||||
# regex for parsing and grouping commits
|
||||
commit_parsers = [
|
||||
{ message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits
|
||||
{ message = "^chore\\(changelog\\): update changelog", group = "Changelog", skip = true}, # Old redundant commits
|
||||
{ message = "^chore: push version number to", group = "9$Other", skip = true}, # Old redundant commits
|
||||
{ message = "^feat(\\(.*\\))?:", group = "1$Features"},
|
||||
{ message = "^feature(\\(.*\\))?:", group = "1$Features"},
|
||||
{ message = "^fix(\\(.*\\))?:", group = "2$Bug Fixes and Improvements"},
|
||||
{ message = "^docs(\\(.*\\))?:", group = "7$Documentation"},
|
||||
{ message = "^perf(\\(.*\\))?:", group = "3$Performance"},
|
||||
{ message = "^refactor(\\(.*\\))?:", group = "4$Refactor"},
|
||||
{ message = "^style(\\(.*\\))?:", group = "5$Styling"},
|
||||
{ message = "^test(\\(.*\\))?:", group = "9$Other"},
|
||||
{ message = "^locale(\\(.*\\))?:", group = "6$Localization"},
|
||||
{ message = "^chore(\\(.*\\))?:", group = "9$Other"},
|
||||
{ body = ".*security", group = "Security"},
|
||||
]
|
||||
# filter out the commits that are not matched by commit parsers
|
||||
filter_commits = true
|
||||
ignore_tags="v*-(beta|rc)*"
|
||||
# glob pattern for matching git tags
|
||||
tag_pattern = "v[0-9]*"
|
||||
+14
-14
@@ -17,7 +17,7 @@ body = """
|
||||
## [unreleased]
|
||||
{% endif %}\
|
||||
{% for group, commits in commits | group_by(attribute="group") %}\
|
||||
### {{ group | upper_first }}
|
||||
### {{ group | split(pat="$") | last | upper_first }}
|
||||
{% for commit in commits
|
||||
| filter(attribute="scope")
|
||||
| sort(attribute="scope") %}
|
||||
@@ -25,7 +25,6 @@ body = """
|
||||
{%- if commit.breaking %}
|
||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||
{%- endif -%}
|
||||
|
||||
{%- endfor -%}
|
||||
{%- for commit in commits %}
|
||||
{%- if commit.scope -%}
|
||||
@@ -35,7 +34,6 @@ body = """
|
||||
{%- if commit.breaking %}
|
||||
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
|
||||
{%- endif -%}
|
||||
|
||||
{% endif -%}
|
||||
{% endfor -%}
|
||||
{% raw %}\n{% endraw %}
|
||||
@@ -55,16 +53,18 @@ filter_unconventional = false
|
||||
# regex for parsing and grouping commits
|
||||
commit_parsers = [
|
||||
{ message = "^docs\\(changelog\\):", group = "Changelog", skip = true}, # Old redundant commits
|
||||
{ message = "^feat(\\(.*\\))?:", group = "Features"},
|
||||
{ message = "^feature(\\(.*\\))?:", group = "Features"},
|
||||
{ message = "^fix(\\(.*\\))?:", group = "Bug Fixes"},
|
||||
{ message = "^docs(\\(.*\\))?:", group = "Documentation"},
|
||||
{ message = "^perf(\\(.*\\))?:", group = "Performance"},
|
||||
{ message = "^refactor(\\(.*\\))?:", group = "Refactor"},
|
||||
{ message = "^style(\\(.*\\))?:", group = "Styling"},
|
||||
{ message = "^test(\\(.*\\))?:", group = "Testing"},
|
||||
{ message = "^locale(\\(.*\\))?:", group = "Localization"},
|
||||
{ message = "^chore(\\(.*\\))?:", group = "Miscellaneous Tasks", skip = true}, # chore tasks are not relevant for the changelog
|
||||
{ message = "^chore\\(changelog\\): update changelog", group = "Changelog", skip = true}, # Old redundant commits
|
||||
{ message = "^chore: push version number to", group = "9$Other", skip = true}, # Old redundant commits
|
||||
{ message = "^feat(\\(.*\\))?:", group = "1$Features"},
|
||||
{ message = "^feature(\\(.*\\))?:", group = "1$Features"},
|
||||
{ message = "^fix(\\(.*\\))?:", group = "2$Bug Fixes and Improvements"},
|
||||
{ message = "^docs(\\(.*\\))?:", group = "7$Documentation"},
|
||||
{ message = "^perf(\\(.*\\))?:", group = "3$Performance"},
|
||||
{ message = "^refactor(\\(.*\\))?:", group = "4$Refactor"},
|
||||
{ message = "^style(\\(.*\\))?:", group = "5$Styling"},
|
||||
{ message = "^test(\\(.*\\))?:", group = "9$Other"},
|
||||
{ message = "^locale(\\(.*\\))?:", group = "6$Localization"},
|
||||
{ message = "^chore(\\(.*\\))?:", group = "9$Other"},
|
||||
{ body = ".*security", group = "Security"},
|
||||
{ message = "release v2.1.2", group = "Release"}, # workaround for v2.1.2 release
|
||||
]
|
||||
@@ -72,4 +72,4 @@ commit_parsers = [
|
||||
filter_commits = true
|
||||
ignore_tags="v*-(beta|rc)*"
|
||||
# glob pattern for matching git tags
|
||||
tag_pattern = "v[0-9]*"
|
||||
tag_pattern = "v[0-9]*"
|
||||
@@ -0,0 +1,13 @@
|
||||
import { defineConfig } from 'cypress'
|
||||
|
||||
export default defineConfig({
|
||||
e2e: {
|
||||
// We've imported your old cypress plugins here.
|
||||
// You may want to clean this up later by importing these.
|
||||
setupNodeEvents(on, config) {
|
||||
// @ts-ignore
|
||||
return require('./cypress/plugins/index.js')(on, config)
|
||||
},
|
||||
baseUrl: 'http://localhost:4173',
|
||||
},
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"baseUrl": "http://localhost:4173"
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
+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-beta3",
|
||||
"version": "2.4.1",
|
||||
"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": []
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.html [L]
|
||||
</IfModule>
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"defaultLocale": "en",
|
||||
"hostname": null,
|
||||
"port": null,
|
||||
"instancesDB": "browser",
|
||||
"instances": []
|
||||
}
|
||||
+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() {
|
||||
|
||||
+106
-25
@@ -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')
|
||||
}
|
||||
@@ -301,3 +333,52 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .ͼ1 .cm-panel.cm-search *:focus:not(.focus-visible) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox'] {
|
||||
width: 2.2em;
|
||||
height: 2.2em;
|
||||
color: dodgerblue;
|
||||
vertical-align: middle;
|
||||
-webkit-appearance: none;
|
||||
border: 10px;
|
||||
outline: 0;
|
||||
flex-grow: 0;
|
||||
border-radius: 4px;
|
||||
background: var(--v-toolbar-base);
|
||||
transition: background 300ms;
|
||||
cursor: pointer;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
/* Pseudo element for check styling */
|
||||
|
||||
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']::before {
|
||||
content: '';
|
||||
color: transparent;
|
||||
display: block;
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
border-radius: inherit;
|
||||
border: 2px;
|
||||
background-color: transparent;
|
||||
background-size: contain;
|
||||
box-shadow: inset 0 0 0 1px #ccd3d8;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* Checked */
|
||||
|
||||
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked {
|
||||
background-color: var(--color-primary);
|
||||
}
|
||||
|
||||
::v-deep .ͼ1 .cm-panel.cm-search input[type='checkbox']:checked::before {
|
||||
box-shadow: none;
|
||||
background-color: var(--color-primary);
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E %3Cpath d='M15.88 8.29L10 14.17l-1.88-1.88a.996.996 0 1 0-1.41 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7a.996.996 0 0 0 0-1.41c-.39-.39-1.03-.39-1.42 0z' fill='%23fffff'/%3E %3C/svg%3E");
|
||||
}
|
||||
</style>
|
||||
@@ -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"
|
||||
@@ -91,7 +63,7 @@
|
||||
class="button-min-width-auto px-3 emergency-button"
|
||||
:loading="loadings.includes('topbarEmergencyStop')"
|
||||
@click="btnEmergencyStop">
|
||||
<v-icon class="mr-md-2">{{ mdiAlertCircleOutline }}</v-icon>
|
||||
<v-icon class="mr-md-2">{{ mdiAlertOctagonOutline }}</v-icon>
|
||||
<span class="d-none d-md-inline">{{ $t('App.TopBar.EmergencyStop') }}</span>
|
||||
</v-btn>
|
||||
<the-notification-menu></the-notification-menu>
|
||||
@@ -112,10 +84,10 @@
|
||||
</v-snackbar>
|
||||
<v-dialog v-model="showEmergencyStopDialog" width="400" :fullscreen="isMobile">
|
||||
<panel
|
||||
:title="$t('EmergencyStopDialog.EmergencyStop')"
|
||||
:title="$t('EmergencyStopDialog.EmergencyStop').toString()"
|
||||
toolbar-color="error"
|
||||
card-class="emergency-stop-dialog"
|
||||
:icon="mdiAlertCircleOutline"
|
||||
:icon="mdiAlertOctagonOutline"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="showEmergencyStopDialog = false">
|
||||
@@ -147,7 +119,7 @@ import PrinterSelector from '@/components/ui/PrinterSelector.vue'
|
||||
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||
import TheNotificationMenu from '@/components/notifications/TheNotificationMenu.vue'
|
||||
import { topbarHeight } from '@/store/variables'
|
||||
import { mdiAlertCircleOutline, mdiContentSave, mdiFileUpload, mdiClose, mdiCloseThick } from '@mdi/js'
|
||||
import { mdiAlertOctagonOutline, mdiContentSave, mdiFileUpload, mdiClose, mdiCloseThick } from '@mdi/js'
|
||||
|
||||
type uploadSnackbar = {
|
||||
status: boolean
|
||||
@@ -173,7 +145,7 @@ type uploadSnackbar = {
|
||||
},
|
||||
})
|
||||
export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
mdiAlertCircleOutline = mdiAlertCircleOutline
|
||||
mdiAlertOctagonOutline = mdiAlertOctagonOutline
|
||||
mdiContentSave = mdiContentSave
|
||||
mdiFileUpload = mdiFileUpload
|
||||
mdiClose = mdiClose
|
||||
@@ -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) {
|
||||
@@ -273,14 +256,14 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
|
||||
async uploadAndStart() {
|
||||
if (this.$refs.fileUploadAndStart?.files.length) {
|
||||
this.$store.dispatch('socket/addLoading', { name: 'btnUploadAndStart' })
|
||||
await this.$store.dispatch('socket/addLoading', { name: 'btnUploadAndStart' })
|
||||
let successFiles = []
|
||||
for (const file of this.$refs.fileUploadAndStart?.files || []) {
|
||||
const result = await this.doUploadAndStart(file)
|
||||
successFiles.push(result)
|
||||
}
|
||||
|
||||
this.$store.dispatch('socket/removeLoading', { name: 'btnUploadAndStart' })
|
||||
await this.$store.dispatch('socket/removeLoading', { name: 'btnUploadAndStart' })
|
||||
for (const file of successFiles) {
|
||||
const text = this.$t('App.TopBar.UploadOfFileSuccessful', { file: file }).toString()
|
||||
this.$toast.success(text)
|
||||
@@ -344,3 +327,32 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.topbar .v-toolbar__content {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.button-min-width-auto {
|
||||
min-width: auto !important;
|
||||
}
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.topbar .v-btn {
|
||||
height: 100% !important;
|
||||
max-height: none;
|
||||
}
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.topbar .v-btn.v-btn--icon {
|
||||
/*noinspection CssUnresolvedCustomProperty*/
|
||||
width: var(--topbar-icon-btn-width) !important;
|
||||
}
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
@media (min-width: 768px) {
|
||||
header.topbar {
|
||||
z-index: 8 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -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-6 mt-sm-3">
|
||||
<v-btn
|
||||
v-for="(offset, index) in offsetsZ"
|
||||
:key="`offsetsDown-${index}`"
|
||||
small
|
||||
class="_btn-qs flex-grow-1 px-1"
|
||||
@click="sendTestZ((offset * -1).toString())">
|
||||
<v-icon v-if="index === 0" left small class="mr-1 ml-n1">
|
||||
{{ mdiArrowCollapseDown }}
|
||||
</v-icon>
|
||||
<span>−{{ offset }}</span>
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-container>
|
||||
</sub-panel>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn text :loading="loadingAbort" @click="sendAbort">
|
||||
{{ $t('ManualProbe.Abort') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text :loading="loadingAccept" @click="sendAccept">
|
||||
{{ $t('ManualProbe.Accept') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
|
||||
import {
|
||||
mdiArrowCollapseDown,
|
||||
mdiArrowExpandUp,
|
||||
mdiInformation,
|
||||
mdiPlusThick,
|
||||
mdiMinusThick,
|
||||
mdiChevronTripleLeft,
|
||||
mdiChevronTripleRight,
|
||||
mdiCloseThick,
|
||||
} from '@mdi/js'
|
||||
@Component({
|
||||
components: { Panel, Responsive },
|
||||
})
|
||||
export default class TheManualProbeDialog extends Mixins(BaseMixin) {
|
||||
mdiArrowCollapseDown = mdiArrowCollapseDown
|
||||
mdiArrowExpandUp = mdiArrowExpandUp
|
||||
mdiInformation = mdiInformation
|
||||
mdiPlusThick = mdiPlusThick
|
||||
mdiMinusThick = mdiMinusThick
|
||||
mdiChevronTripleLeft = mdiChevronTripleLeft
|
||||
mdiChevronTripleRight = mdiChevronTripleRight
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
get showDialog() {
|
||||
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 / this.max
|
||||
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,40 +1,26 @@
|
||||
<style scoped>
|
||||
._spin_button_group {
|
||||
width: 24px;
|
||||
margin-top: -6px;
|
||||
margin-left: -6px;
|
||||
margin-bottom: -6px;
|
||||
}
|
||||
|
||||
.v-input--has-state {
|
||||
margin-bottom: -18px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<form @submit.prevent="submit">
|
||||
<v-text-field
|
||||
v-model.number="value"
|
||||
v-model="value"
|
||||
:label="label"
|
||||
:suffix="unit"
|
||||
:error="invalidInput()"
|
||||
:error-messages="inputErrors()"
|
||||
:error="invalidInput"
|
||||
:error-messages="inputErrors"
|
||||
:disabled="disabled"
|
||||
:step="step"
|
||||
:min="min"
|
||||
:max="max"
|
||||
:dec="dec"
|
||||
type="number"
|
||||
hide-spin-buttons
|
||||
hide-details="auto"
|
||||
outlined
|
||||
dense
|
||||
class="d-flex align-top"
|
||||
@blur="value = target"
|
||||
@blur="value = target.toString()"
|
||||
@focus="$event.target.select()"
|
||||
@keydown="checkInvalidChars">
|
||||
<template v-if="defaultValue" #append>
|
||||
<v-icon @click="resetToDefault">{{ value !== defaultValue ? mdiRestart : '' }}</v-icon>
|
||||
<v-icon @click="resetToDefault">{{ value !== defaultValue.toString() ? mdiRestart : '' }}</v-icon>
|
||||
</template>
|
||||
<template v-if="hasSpinner" #append-outer>
|
||||
<div class="_spin_button_group">
|
||||
@@ -74,7 +60,7 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
||||
mdiChevronUp = mdiChevronUp
|
||||
mdiChevronDown = mdiChevronDown
|
||||
|
||||
private value: number = 0
|
||||
private value: string = '0'
|
||||
private error: boolean = false
|
||||
private invalidChars: string[] = ['e', 'E', '+']
|
||||
|
||||
@@ -123,40 +109,44 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
||||
declare readonly outputErrorMsg: boolean
|
||||
|
||||
created(): void {
|
||||
this.value = this.target
|
||||
this.value = this.target.toString()
|
||||
}
|
||||
|
||||
@Watch('target')
|
||||
updateTarget(): void {
|
||||
this.value = this.target
|
||||
this.value = this.target.toString()
|
||||
}
|
||||
|
||||
incrementValue(): void {
|
||||
if (this.value + this.step * this.spinnerFactor < this.max! || this.max === null) {
|
||||
this.value = Math.round((this.value + this.step * this.spinnerFactor) * 10 ** this.dec) / 10 ** this.dec
|
||||
} else {
|
||||
this.value = this.max
|
||||
}
|
||||
if (this.inputValue + this.step * this.spinnerFactor < this.max! || this.max === null) {
|
||||
this.value = (
|
||||
Math.round((this.inputValue + this.step * this.spinnerFactor) * 10 ** this.dec) /
|
||||
10 ** this.dec
|
||||
).toString()
|
||||
} else this.value = this.max.toString()
|
||||
|
||||
this.submit()
|
||||
}
|
||||
|
||||
decrementValue(): void {
|
||||
if (this.value - this.step * this.spinnerFactor > this.min) {
|
||||
this.value = Math.round((this.value - this.step * this.spinnerFactor) * 10 ** this.dec) / 10 ** this.dec
|
||||
} else {
|
||||
this.value = this.min
|
||||
}
|
||||
if (this.inputValue - this.step * this.spinnerFactor > this.min) {
|
||||
this.value = (
|
||||
Math.round((this.inputValue - this.step * this.spinnerFactor) * 10 ** this.dec) /
|
||||
10 ** this.dec
|
||||
).toString()
|
||||
} else this.value = this.min.toString()
|
||||
|
||||
this.submit()
|
||||
}
|
||||
|
||||
resetToDefault(): void {
|
||||
this.value = this.defaultValue
|
||||
this.value = this.defaultValue.toString()
|
||||
this.submit()
|
||||
}
|
||||
|
||||
submit(): void {
|
||||
if (this.invalidInput()) return
|
||||
this.$emit('submit', { name: this.param, value: this.value })
|
||||
if (this.invalidInput) return
|
||||
this.$emit('submit', { name: this.param, value: this.inputValue })
|
||||
}
|
||||
|
||||
// input validation //
|
||||
@@ -166,27 +156,44 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
||||
if (this.invalidChars.includes(event.key)) event.preventDefault()
|
||||
}
|
||||
|
||||
invalidInput(): boolean {
|
||||
return this.value.toString() === '' || this.value < this.min || (this.value > this.max! && this.max !== null)
|
||||
// this function only parse this.value, to escape an empty input
|
||||
get inputValue(): number {
|
||||
if (this.value.toString() === '') return 0
|
||||
|
||||
return parseFloat(this.value.replace(',', '.'))
|
||||
}
|
||||
|
||||
inputErrors() {
|
||||
get invalidInput(): boolean {
|
||||
return this.inputErrors.length > 0
|
||||
}
|
||||
|
||||
get inputErrors() {
|
||||
if (!this.outputErrorMsg) return []
|
||||
|
||||
const errors = []
|
||||
if (this.value.toString() === '') {
|
||||
// "Input must not be empty!"
|
||||
errors.push(this.$t('App.NumberInput.NoEmptyAllowedError'))
|
||||
}
|
||||
if (this.max === null && this.value < this.min) {
|
||||
if (this.max === null && this.inputValue < this.min) {
|
||||
// "Must be grater or equal than {min}!"
|
||||
errors.push(this.$t('App.NumberInput.GreaterOrEqualError', { min: this.min }))
|
||||
}
|
||||
if (this.max !== null && (this.value > this.max! || this.value < this.min)) {
|
||||
if (this.max !== null && (this.inputValue > this.max! || this.inputValue < this.min)) {
|
||||
// "Must be between {min} and {max}!"
|
||||
errors.push(this.$t('App.NumberInput.MustBeBetweenError', { min: this.min, max: this.max }))
|
||||
}
|
||||
|
||||
return errors
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
._spin_button_group {
|
||||
width: 24px;
|
||||
margin-top: -6px;
|
||||
margin-left: -6px;
|
||||
margin-bottom: -6px;
|
||||
}
|
||||
|
||||
.v-input--has-state {
|
||||
margin-bottom: -18px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,40 +1,18 @@
|
||||
<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">
|
||||
<v-text-field
|
||||
v-model="value"
|
||||
suffix="°C"
|
||||
type="number"
|
||||
dense
|
||||
outlined
|
||||
hide-details
|
||||
hide-spin-buttons
|
||||
class="_temp-input pr-1"
|
||||
@blur="value = target"
|
||||
@focus="$event.target.select()"
|
||||
@keyup.enter="setTemps"></v-text-field>
|
||||
<form @submit.prevent="setTemps">
|
||||
<v-text-field
|
||||
v-model="value"
|
||||
suffix="°C"
|
||||
type="number"
|
||||
dense
|
||||
outlined
|
||||
hide-details
|
||||
hide-spin-buttons
|
||||
class="_temp-input pr-1"
|
||||
@blur="value = target"
|
||||
@focus="$event.target.select()"></v-text-field>
|
||||
</form>
|
||||
<v-menu v-if="presets" :offset-y="true" left title="Preheat">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
@@ -56,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>
|
||||
@@ -123,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}`
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,6 @@ export default class ControlMixin extends Vue {
|
||||
return this.$store.state.printer?.gcode_move?.absolute_coordinates ?? true
|
||||
}
|
||||
|
||||
get homedAxes(): string {
|
||||
return this.$store.state.printer?.toolhead?.homed_axes ?? ''
|
||||
}
|
||||
|
||||
get enableXYHoming(): boolean {
|
||||
return this.$store.state.gui.control.enableXYHoming
|
||||
}
|
||||
@@ -47,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
|
||||
|
||||
@@ -63,6 +63,26 @@ export default class ControlMixin extends Vue {
|
||||
return this.$store.getters['gui/getDefaultControlActionButton']
|
||||
}
|
||||
|
||||
/**
|
||||
* Axes home states
|
||||
*/
|
||||
|
||||
get homedAxes(): string {
|
||||
return this.$store.state.printer?.toolhead?.homed_axes ?? ''
|
||||
}
|
||||
|
||||
get xAxisHomed(): boolean {
|
||||
return this.homedAxes.includes('x')
|
||||
}
|
||||
|
||||
get yAxisHomed(): boolean {
|
||||
return this.homedAxes.includes('y')
|
||||
}
|
||||
|
||||
get zAxisHomed(): boolean {
|
||||
return this.homedAxes.includes('z')
|
||||
}
|
||||
|
||||
doHome() {
|
||||
this.$store.dispatch('server/addEvent', { message: 'G28', type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: 'G28' }, { loading: 'homeAll' })
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import Component from 'vue-class-component'
|
||||
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'
|
||||
import {
|
||||
mdiArrowCollapseVertical,
|
||||
mdiCodeTags,
|
||||
mdiConsoleLine,
|
||||
mdiDipSwitch,
|
||||
mdiEngine,
|
||||
mdiGamepad,
|
||||
mdiInformation,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiThermometerLines,
|
||||
mdiWebcam,
|
||||
} from '@mdi/js'
|
||||
|
||||
@Component
|
||||
export default class DashboardMixin extends BaseMixin {
|
||||
get macroMode() {
|
||||
return this.$store.state.gui.macros.mode ?? 'simple'
|
||||
}
|
||||
|
||||
get macrogroups() {
|
||||
return this.$store.getters['gui/macros/getAllMacrogroups'] ?? []
|
||||
}
|
||||
@@ -20,74 +25,6 @@ export default class DashboardMixin extends BaseMixin {
|
||||
return this.$store.getters['gui/webcams/getWebcams'] ?? []
|
||||
}
|
||||
|
||||
get missingPanelsMobile() {
|
||||
const panels = [...this.$store.state.gui.dashboard.mobileLayout]
|
||||
|
||||
return this.checkMissingPanels(panels)
|
||||
}
|
||||
|
||||
get missingPanelsTablet() {
|
||||
const panels = [
|
||||
...this.$store.state.gui.dashboard.tabletLayout1,
|
||||
...this.$store.state.gui.dashboard.tabletLayout2,
|
||||
]
|
||||
|
||||
return this.checkMissingPanels(panels)
|
||||
}
|
||||
|
||||
get missingPanelsDesktop() {
|
||||
const panels = [
|
||||
...this.$store.state.gui.dashboard.desktopLayout1,
|
||||
...this.$store.state.gui.dashboard.desktopLayout2,
|
||||
]
|
||||
|
||||
return this.checkMissingPanels(panels)
|
||||
}
|
||||
|
||||
get missingPanelsWidescreen() {
|
||||
const panels = [
|
||||
...this.$store.state.gui.dashboard.widescreenLayout1,
|
||||
...this.$store.state.gui.dashboard.widescreenLayout2,
|
||||
...this.$store.state.gui.dashboard.widescreenLayout3,
|
||||
]
|
||||
|
||||
return this.checkMissingPanels(panels)
|
||||
}
|
||||
|
||||
get allPossiblePanels() {
|
||||
let allPanels = [...allDashboardPanels]
|
||||
|
||||
// remove macros panel and add macrogroups panels if macroMode === expert
|
||||
if (this.macroMode === 'expert') {
|
||||
this.macrogroups.forEach((group: GuiMacrosStateMacrogroup) => {
|
||||
allPanels.push('macrogroup_' + group.id)
|
||||
})
|
||||
|
||||
allPanels = allPanels.filter((name) => name !== 'macros')
|
||||
}
|
||||
|
||||
// remove webcam panel, if no webcam exists
|
||||
if (this.webcams.length === 0) {
|
||||
allPanels = allPanels.filter((name) => name !== 'webcam')
|
||||
}
|
||||
|
||||
return allPanels
|
||||
}
|
||||
|
||||
checkMissingPanels(panels: any[]) {
|
||||
const missingPanels: any[] = []
|
||||
|
||||
this.allPossiblePanels.forEach((panelname) => {
|
||||
if (!panels.find((panel) => panel.name === panelname))
|
||||
missingPanels.push({
|
||||
name: panelname,
|
||||
visible: true,
|
||||
})
|
||||
})
|
||||
|
||||
return missingPanels
|
||||
}
|
||||
|
||||
getPanelName(name: string) {
|
||||
if (name.startsWith('macrogroup_')) {
|
||||
const groupId = name.split('_')[1] ?? ''
|
||||
@@ -102,9 +39,37 @@ 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`)
|
||||
}
|
||||
|
||||
convertPanelnameToIcon(name: string): string {
|
||||
if (name.startsWith('macrogroup_')) return mdiCodeTags
|
||||
|
||||
switch (name) {
|
||||
case 'webcam':
|
||||
return mdiWebcam
|
||||
case 'zoffset':
|
||||
return mdiArrowCollapseVertical
|
||||
case 'toolhead-control':
|
||||
return mdiGamepad
|
||||
case 'macros':
|
||||
return mdiCodeTags
|
||||
case 'miscellaneous':
|
||||
return mdiDipSwitch
|
||||
case 'temperature':
|
||||
return mdiThermometerLines
|
||||
case 'miniconsole':
|
||||
return mdiConsoleLine
|
||||
case 'machine-settings':
|
||||
return mdiEngine
|
||||
case 'extruder-control':
|
||||
return mdiPrinter3dNozzle
|
||||
|
||||
default:
|
||||
return mdiInformation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import Vue from 'vue'
|
||||
import Component from 'vue-class-component'
|
||||
import {
|
||||
mdiAlbum,
|
||||
mdiCampfire,
|
||||
mdiDoor,
|
||||
mdiRadiatorDisabled,
|
||||
mdiPrinter3d,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiRaspberryPi,
|
||||
mdiWebcam,
|
||||
} from '@mdi/js'
|
||||
|
||||
@Component
|
||||
export default class WebcamMixin extends Vue {
|
||||
convertWebcamIcon(iconName: string): string {
|
||||
switch (iconName) {
|
||||
case 'mdiAlbum':
|
||||
return mdiAlbum
|
||||
case 'mdiCampfire':
|
||||
return mdiCampfire
|
||||
case 'mdiDoor':
|
||||
return mdiDoor
|
||||
case 'mdiRadiatorDisabled':
|
||||
return mdiRadiatorDisabled
|
||||
case 'mdiPrinter3d':
|
||||
return mdiPrinter3d
|
||||
case 'mdiPrinter3dNozzle':
|
||||
return mdiPrinter3dNozzle
|
||||
case 'mdiRaspberryPi':
|
||||
return mdiRaspberryPi
|
||||
|
||||
default:
|
||||
return mdiWebcam
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<v-alert text :color="alertColor" border="left">
|
||||
<v-alert :class="`notification-menu-entry--priority-${entry.priority}`" text :color="alertColor" border="left">
|
||||
<v-row align="start">
|
||||
<v-col class="grow">
|
||||
<div class="notification-menu-entry__headline mb-1 text-subtitle-1">
|
||||
@@ -15,7 +15,9 @@
|
||||
<span :class="`${alertColor}--text`">{{ entry.title }}</span>
|
||||
</template>
|
||||
</div>
|
||||
<p class="text-body-2 mb-0 text--disabled font-weight-light" v-html="formatedText"></p>
|
||||
<p
|
||||
class="notification-menu-entry__description text-body-2 mb-0 text--disabled font-weight-light"
|
||||
v-html="formatedText"></p>
|
||||
</v-col>
|
||||
<v-col
|
||||
v-if="entry.priority !== 'critical'"
|
||||
@@ -117,7 +119,10 @@ export default class NotificationMenuEntry extends Mixins(BaseMixin) {
|
||||
declare readonly parentState: boolean
|
||||
|
||||
get formatedText() {
|
||||
return this.entry.description.replace(/\[([^\]]+)\]\(([^)]+)\)/, '<a href="$2" target="_blank">$1</a>')
|
||||
return this.entry.description.replace(
|
||||
/(\bhttps?:\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gim,
|
||||
'<a href="$1" target="_blank" class="' + this.alertColor + '--text">$1</a>'
|
||||
)
|
||||
}
|
||||
|
||||
get alertColor() {
|
||||
@@ -153,4 +158,12 @@ export default class NotificationMenuEntry extends Mixins(BaseMixin) {
|
||||
.notification-menu-entry__headline {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.notification-menu-entry__description {
|
||||
max-width: 292px;
|
||||
}
|
||||
|
||||
.notification-menu-entry--priority-critical .notification-menu-entry__description {
|
||||
max-width: 336px;
|
||||
}
|
||||
</style>
|
||||
@@ -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')
|
||||
Whitespace-only changes.
@@ -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>
|
||||
@@ -117,22 +56,17 @@
|
||||
<responsive :breakpoints="{ large: (el) => el.width >= 640 }">
|
||||
<template #default="{ el }">
|
||||
<!-- TOOL SELECTOR BUTTONS -->
|
||||
<v-container v-if="extruders.length > 1" class="pb-1">
|
||||
<v-container v-if="toolchangeMacros.length > 1" class="pb-1">
|
||||
<v-item-group class="_btn-group py-0">
|
||||
<v-btn
|
||||
v-for="extruder in extruders"
|
||||
:key="extruder.key"
|
||||
:class="extruder.key === activeExtruder ? 'primary--text' : {}"
|
||||
:value="extruder.key"
|
||||
v-for="tool in toolchangeMacros"
|
||||
:key="tool.name"
|
||||
:class="tool.active ? 'primary--text' : {}"
|
||||
:disabled="isPrinting"
|
||||
dense
|
||||
class="flex-grow-1 px-0"
|
||||
@click="activateExtruder(extruder.key)">
|
||||
{{
|
||||
toolchangeMacros.length === extruders.length
|
||||
? toolchangeMacros[extruders.indexOf(extruder)]
|
||||
: extruder.name
|
||||
}}
|
||||
@click="doSend(tool.name)">
|
||||
{{ tool.name }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-container>
|
||||
@@ -151,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>
|
||||
@@ -347,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>
|
||||
@@ -362,16 +309,22 @@ import {
|
||||
mdiArrowUpBold,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiPrinter3dNozzleOutline,
|
||||
mdiLocationEnter,
|
||||
mdiLocationExit,
|
||||
mdiDotsVertical,
|
||||
mdiDiameterVariant,
|
||||
} from '@mdi/js'
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import { PrinterStateExtruder } 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'
|
||||
|
||||
@@ -379,47 +332,70 @@ import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
||||
components: {
|
||||
Panel,
|
||||
PressureAdvanceSettings,
|
||||
FirmwareRetractionSettings,
|
||||
NumberInput,
|
||||
Responsive,
|
||||
ToolSlider,
|
||||
},
|
||||
})
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin) {
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiArrowUpBold = mdiArrowUpBold
|
||||
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 toolchangeMacros(): string[] {
|
||||
let tools: string[] = []
|
||||
for (let i = 0; i < this.extruders.length; i++) {
|
||||
this.$store.getters['printer/getMacros'].forEach((m: any) => {
|
||||
if (`T${i}`.includes(m.name.toUpperCase())) tools.push(`T${i}`)
|
||||
})
|
||||
}
|
||||
return tools
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getMacros']
|
||||
}
|
||||
|
||||
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 toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
||||
return this.$store.getters['printer/getToolchangeMacros']
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
@@ -485,7 +461,11 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get extrudedLength(): number {
|
||||
return Math.round(this.feedamount * this.extrudeFactor * (this.filamentDiameter / this.nozzleDiameter))
|
||||
return Math.round(
|
||||
this.feedamount *
|
||||
this.extrudeFactor *
|
||||
(Math.pow(this.filamentDiameter, 2) / Math.pow(this.nozzleDiameter, 2))
|
||||
)
|
||||
}
|
||||
|
||||
get volumetricFlow(): number {
|
||||
@@ -512,22 +492,6 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
activateExtruder(extruder: string): void {
|
||||
/**
|
||||
* If toolchange macros in the form of T{n} are found, use those
|
||||
* otherwise use the regular 'ACTIVATE_EXTRUDER' Klipper command
|
||||
*/
|
||||
let gcode: string
|
||||
if (this.toolchangeMacros.length === this.extruders.length) {
|
||||
gcode = `T${this.extruders.findIndex((ex: any) => ex.key === extruder)}`
|
||||
} else {
|
||||
gcode = `ACTIVATE_EXTRUDER EXTRUDER=${extruder}`
|
||||
}
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
|
||||
sendRetract(): void {
|
||||
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
@@ -539,17 +503,50 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin) {
|
||||
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"
|
||||
@@ -18,20 +18,20 @@
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="currentCamId = 'off'">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ mdiWebcamOff }}</v-icon>
|
||||
<v-list-item-icon class="mr-2">
|
||||
<v-icon small class="mt-1">{{ mdiWebcamOff }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t('Panels.FarmPrinterPanel.WebcamOff') }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-for="webcam of printer_webcams"
|
||||
v-for="webcam of supportedPrinterWebcams"
|
||||
:key="webcam.index"
|
||||
link
|
||||
@click="currentCamId = webcam.id">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ webcam.icon }}</v-icon>
|
||||
<v-list-item-icon class="mr-2">
|
||||
<v-icon small class="mt-1">{{ convertWebcamIcon(webcam.icon) }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title v-text="webcam.name"></v-list-item-title>
|
||||
@@ -45,21 +45,28 @@
|
||||
<div>
|
||||
<v-img ref="imageDiv" :height="imageHeight" :src="printer_image" class="d-flex align-end">
|
||||
<div
|
||||
v-if="printer.socket.isConnected && currentCamId !== 'off' && currentWebcam"
|
||||
v-if="
|
||||
printer.socket.isConnected &&
|
||||
currentCamId !== 'off' &&
|
||||
currentWebcam &&
|
||||
'service' in currentWebcam
|
||||
"
|
||||
class="webcamContainer">
|
||||
<template v-if="'service' in currentWebcam && currentWebcam.service === 'mjpegstreamer'">
|
||||
<webcam-mjpegstreamer
|
||||
:cam-settings="currentWebcam"
|
||||
:printer-url="printerUrl"
|
||||
:show-fps="false"></webcam-mjpegstreamer>
|
||||
</template>
|
||||
<template
|
||||
v-if="'service' in currentWebcam && currentWebcam.service === 'mjpegstreamer-adaptive'">
|
||||
<webcam-mjpegstreamer-adaptive
|
||||
:cam-settings="currentWebcam"
|
||||
:printer-url="printerUrl"
|
||||
:show-fps="false"></webcam-mjpegstreamer-adaptive>
|
||||
</template>
|
||||
<webcam-mjpegstreamer
|
||||
v-if="currentWebcam.service === 'mjpegstreamer'"
|
||||
:cam-settings="currentWebcam"
|
||||
:printer-url="printerUrl"
|
||||
:show-fps="false"></webcam-mjpegstreamer>
|
||||
<webcam-mjpegstreamer-adaptive
|
||||
v-else-if="currentWebcam.service === 'mjpegstreamer-adaptive'"
|
||||
:cam-settings="currentWebcam"
|
||||
:printer-url="printerUrl"
|
||||
:show-fps="false"></webcam-mjpegstreamer-adaptive>
|
||||
<webcam-uv4l-mjpeg
|
||||
v-else-if="currentWebcam.service === 'uv4l-mjpeg'"
|
||||
:cam-settings="currentWebcam"
|
||||
:printer-url="printerUrl"
|
||||
:show-fps="false"></webcam-uv4l-mjpeg>
|
||||
</div>
|
||||
<v-card-title
|
||||
class="white--text py-2"
|
||||
@@ -125,20 +132,24 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import { FarmPrinterState } from '@/store/farm/printer/types'
|
||||
import Mjpegstreamer from '@/components/webcams/Mjpegstreamer.vue'
|
||||
import MjpegstreamerAdaptive from '@/components/webcams/MjpegstreamerAdaptive.vue'
|
||||
import Uv4lMjpeg from '@/components/webcams/Uv4lMjpeg.vue'
|
||||
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiPrinter3d, mdiWebcam, mdiMenuDown, mdiWebcamOff, mdiFileOutline } from '@mdi/js'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
|
||||
import WebcamMixin from '@/components/mixins/webcam'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Panel,
|
||||
'webcam-mjpegstreamer': Mjpegstreamer,
|
||||
'webcam-mjpegstreamer-adaptive': MjpegstreamerAdaptive,
|
||||
'webcam-uv4l-mjpeg': Uv4lMjpeg,
|
||||
'mainsail-logo': MainsailLogo,
|
||||
},
|
||||
})
|
||||
export default class FarmPrinterPanel extends Mixins(BaseMixin) {
|
||||
export default class FarmPrinterPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
mdiPrinter3d = mdiPrinter3d
|
||||
mdiWebcam = mdiWebcam
|
||||
mdiMenuDown = mdiMenuDown
|
||||
@@ -207,13 +218,19 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get showWebcamSwitch() {
|
||||
return this.printer.socket.isConnected && this.printer_webcams.length > 0
|
||||
return this.printer.socket.isConnected && this.supportedPrinterWebcams.length > 0
|
||||
}
|
||||
|
||||
get printer_webcams() {
|
||||
return this.$store.getters['farm/' + this.printer._namespace + '/getPrinterWebcams']
|
||||
}
|
||||
|
||||
get supportedPrinterWebcams() {
|
||||
return this.printer_webcams.filter((webcam: GuiWebcamStateWebcam) =>
|
||||
['mjpegstreamer', 'mjpegstreamer-adaptive', 'uv4l-mjpeg'].includes(webcam.service)
|
||||
)
|
||||
}
|
||||
|
||||
get currentWebcam() {
|
||||
const currentCam = this.printer_webcams.find((webcam: any) => webcam.id === this.currentCamId)
|
||||
if (currentCam) return currentCam
|
||||
|
||||
@@ -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[]) {
|
||||
@@ -1126,14 +1071,6 @@ export default class GcodefilesPanel extends Mixins(BaseMixin) {
|
||||
})
|
||||
}
|
||||
|
||||
created() {
|
||||
this.$socket.emit(
|
||||
'server.files.get_directory',
|
||||
{ path: 'gcodes/' + this.currentPath },
|
||||
{ action: 'files/getDirectory' }
|
||||
)
|
||||
}
|
||||
|
||||
clickRow(item: FileStateGcodefile, force = false) {
|
||||
if (!this.contextMenu.shown || force) {
|
||||
if (force) this.contextMenu.shown = false
|
||||
@@ -1148,13 +1085,12 @@ 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) {
|
||||
let path = this.currentPath.slice(7)
|
||||
if (path != '') path += '/'
|
||||
const filename = path + item.filename
|
||||
let filename = [this.currentPath, item.filename].join('/')
|
||||
if (filename.startsWith('/')) filename = filename.slice(1)
|
||||
|
||||
this.$store.dispatch('server/jobQueue/addToQueue', [filename])
|
||||
}
|
||||
@@ -1163,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
|
||||
@@ -1176,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',
|
||||
@@ -1299,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,
|
||||
@@ -1326,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() {
|
||||
@@ -1359,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)
|
||||
@@ -1382,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,
|
||||
})
|
||||
}}
|
||||
@@ -96,7 +86,11 @@
|
||||
<template v-if="networkInterfaces">
|
||||
<div v-for="(interfaceStats, interfaceName) in networkInterfaces" :key="interfaceName">
|
||||
<span class="text-no-wrap">
|
||||
{{ interfaceName }}{{ getIpAddress(interfaceStats.details.ip_addresses) }}:
|
||||
{{ interfaceName }}
|
||||
<template v-if="'details' in interfaceStats">
|
||||
{{ getIpAddress(interfaceStats.details.ip_addresses) }}
|
||||
</template>
|
||||
:
|
||||
</span>
|
||||
<span class="text-no-wrap">
|
||||
{{
|
||||
@@ -225,6 +219,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 +261,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() {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
</td>
|
||||
<td class="pr-2">
|
||||
<template v-if="item.isFirst">
|
||||
<template v-if="item.isFirst && !printerIsPrinting">
|
||||
<v-btn icon color="success" class="float-right minwidth-0 mt-1" @click="startJobqueue">
|
||||
<v-icon>{{ mdiPlay }}</v-icon>
|
||||
</v-btn>
|
||||
@@ -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>
|
||||
@@ -122,13 +120,13 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
mdiCloseCircle = mdiCloseCircle
|
||||
|
||||
private boolShowObjects = false
|
||||
private boolFirstLoad = true
|
||||
|
||||
declare $refs: {
|
||||
bigThumbnail: any
|
||||
}
|
||||
|
||||
private activeTab = 'files'
|
||||
private lastFilename = ''
|
||||
|
||||
get jobs() {
|
||||
return this.$store.getters['server/jobQueue/getJobs']
|
||||
@@ -239,13 +237,16 @@ 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 (this.current_filename === '' && newVal !== '') this.activeTab = 'status'
|
||||
if (this.boolFirstLoad && newVal !== '') {
|
||||
this.boolFirstLoad = false
|
||||
this.activeTab = 'status'
|
||||
}
|
||||
if (newVal === '') this.activeTab = 'files'
|
||||
else if (this.lastFilename !== newVal) this.activeTab = 'status'
|
||||
|
||||
this.lastFilename = newVal
|
||||
}
|
||||
|
||||
clearDisplayMessage() {
|
||||
@@ -281,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,13 +149,13 @@
|
||||
{{ 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>
|
||||
</div>
|
||||
<div v-if="object.rpm !== null">
|
||||
<small :class="object.rpmClass">{{ object.rpm }}</small>
|
||||
<small :class="object.rpmClass">{{ object.rpm }} RPM</small>
|
||||
</div>
|
||||
</td>
|
||||
<td class="target">
|
||||
@@ -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>
|
||||
@@ -17,7 +17,7 @@
|
||||
#buttons>
|
||||
<v-menu left offset-y :close-on-content-click="false" class="pa-0">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
<v-btn icon tile v-bind="attrs" :disabled="['printing'].includes(printer_state)" v-on="on">
|
||||
<v-icon>{{ mdiDotsVertical }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
@@ -1,114 +1,7 @@
|
||||
<style lang="scss" scoped>
|
||||
svg {
|
||||
max-height: 350px;
|
||||
min-height: 275px;
|
||||
user-select: none;
|
||||
filter: drop-shadow(0px 10px 10px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
svg a {
|
||||
stroke: hsl(0, 0%, 10%);
|
||||
stroke-width: 0.3px;
|
||||
}
|
||||
|
||||
svg a.step {
|
||||
transition: fill 750ms ease-out;
|
||||
}
|
||||
|
||||
svg a.step:hover {
|
||||
fill: hsl(215, 0%, 50%) !important;
|
||||
transition: fill 100ms ease-in;
|
||||
}
|
||||
|
||||
svg a.step:active {
|
||||
fill: hsl(215, 0%, 70%) !important;
|
||||
}
|
||||
|
||||
svg a.step.inner {
|
||||
fill: #666;
|
||||
}
|
||||
svg a.step.inner-mid {
|
||||
fill: #555;
|
||||
}
|
||||
svg a.step.outer-mid {
|
||||
fill: #444;
|
||||
}
|
||||
svg a.step.outer {
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
svg g#stepsZ,
|
||||
svg g#stepsXY {
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 3px;
|
||||
fill: white;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust text {
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 3px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
svg g#home_buttons text {
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 5px;
|
||||
fill: black;
|
||||
}
|
||||
|
||||
svg g.home_button,
|
||||
svg a#home_all_center {
|
||||
fill: var(--color-warning);
|
||||
transition: opacity 250ms;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust,
|
||||
svg a#stepper_off {
|
||||
transition: opacity 250ms;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust.warning,
|
||||
svg a#stepper_off.warning {
|
||||
fill: var(--color-warning);
|
||||
}
|
||||
|
||||
svg a#tilt_adjust.primary,
|
||||
svg a#stepper_off.primary {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
|
||||
svg g.home_button.homed,
|
||||
svg a#home_all_center.homed {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
|
||||
svg g.home_button:hover,
|
||||
svg a#home_all_center:hover,
|
||||
svg a#tilt_adjust:hover,
|
||||
svg a#stepper_off:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust text,
|
||||
svg a#tilt_adjust #tilt_icon,
|
||||
svg a#stepper_off #stepper_off_icon,
|
||||
svg g#home_buttons .home-icon {
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust #tilt_icon,
|
||||
svg a#stepper_off #stepper_off_icon {
|
||||
fill: #000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<v-row>
|
||||
<v-col class="pa-0">
|
||||
<v-col class="pa-0 mt-1">
|
||||
<svg
|
||||
width="100%"
|
||||
height="100%"
|
||||
@@ -120,13 +13,13 @@ svg a#stepper_off #stepper_off_icon {
|
||||
<rect x="0" y="0" width="62" height="62" style="fill: none" />
|
||||
<g id="home_buttons" transform="matrix(0.804902,0,0,1,0.0430241,0)">
|
||||
<!-- HOME X BUTTON -->
|
||||
<a @click="doHomeX">
|
||||
<a :class="xHomeClass" @click="doHomeX">
|
||||
<g
|
||||
id="home_x"
|
||||
transform="matrix(0.707107,-0.707107,0.707107,0.707107,-1.41799,4.05689)">
|
||||
<g
|
||||
id="home_button_x"
|
||||
:class="'home_button' + (homedAxes.includes('x') ? ' homed' : '')"
|
||||
class="home_button"
|
||||
transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)">
|
||||
<path :d="pathHomeButtonTop" />
|
||||
</g>
|
||||
@@ -135,20 +28,20 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
<g
|
||||
id="Icon"
|
||||
class="home-icon"
|
||||
class="home_icon"
|
||||
transform="matrix(0.147059,0,0,0.147059,2.10662,2.08254)">
|
||||
<path :d="homeIcon" style="fill-rule: nonzero" />
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
<!-- HOME Y BUTTON -->
|
||||
<a @click="doHomeY">
|
||||
<a :class="yHomeClass" @click="doHomeY">
|
||||
<g
|
||||
id="home_y"
|
||||
transform="matrix(0.707107,0.707107,-0.707107,0.707107,57.8807,-1.41799)">
|
||||
<g
|
||||
id="home_button_y"
|
||||
:class="'home_button' + (homedAxes.includes('y') ? ' homed' : '')"
|
||||
class="home_button"
|
||||
transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)">
|
||||
<path :d="pathHomeButtonTop" />
|
||||
</g>
|
||||
@@ -157,20 +50,20 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
<g
|
||||
id="icon"
|
||||
class="home-icon"
|
||||
class="home_icon"
|
||||
transform="matrix(0.147059,0,0,0.147059,2.10662,2.08254)">
|
||||
<path :d="homeIcon" style="fill-rule: nonzero" />
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
<!-- HOME Z BUTTON -->
|
||||
<a @click="doHomeZ">
|
||||
<a :class="zHomeClass" @click="doHomeZ">
|
||||
<g
|
||||
id="home_z"
|
||||
transform="matrix(-0.707107,0.707107,-0.707107,-0.707107,63.3555,57.8807)">
|
||||
<g
|
||||
id="home_button_z"
|
||||
:class="'home_button ' + (homedAxes.includes('z') ? ' homed' : '')"
|
||||
class="home_button"
|
||||
transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)">
|
||||
<path :d="pathHomeButtonBottom" />
|
||||
</g>
|
||||
@@ -179,20 +72,20 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
<g
|
||||
id="icon1"
|
||||
class="home-icon"
|
||||
class="home_icon"
|
||||
transform="matrix(0.147059,0,0,0.147059,2.10662,2.08254)">
|
||||
<path :d="homeIcon" style="fill-rule: nonzero" />
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
<!-- HOME XY BUTTON -->
|
||||
<a v-if="enableXYHoming" @click="doHomeXY">
|
||||
<a v-if="enableXYHoming" :class="xyHomeClass" @click="doHomeXY">
|
||||
<g
|
||||
id="home_xy"
|
||||
transform="matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)">
|
||||
<g
|
||||
id="home_button_xy"
|
||||
:class="'home_button' + (homedAxes.includes('xy') ? ' homed' : '')"
|
||||
class="home_button"
|
||||
transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)">
|
||||
<path :d="pathHomeButtonBottom" />
|
||||
</g>
|
||||
@@ -201,35 +94,34 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
<g
|
||||
id="icon2"
|
||||
class="home-icon"
|
||||
class="home_icon"
|
||||
transform="matrix(0.147059,0,0,0.147059,2.10662,2.08254)">
|
||||
<path :d="homeIcon" style="fill-rule: nonzero" />
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
<!-- HOME ALL BUTTON -->
|
||||
<a v-if="!enableXYHoming" @click="doHome">
|
||||
<a v-else :class="xyzHomeClass" @click="doHome">
|
||||
<g
|
||||
id="home_all"
|
||||
transform="matrix(-0.707107,-0.707107,0.707107,-0.707107,4.05689,63.3555)">
|
||||
<g
|
||||
id="home_button_all"
|
||||
:class="'home_button' + (homedAxes.includes('xyz') ? ' homed' : '')"
|
||||
class="home_button"
|
||||
transform="matrix(0.68689,0.68689,-0.68689,0.68689,3.87132,0.962447)">
|
||||
<path :d="pathHomeButtonBottom" />
|
||||
</g>
|
||||
<g
|
||||
id="icon3"
|
||||
class="home-icon"
|
||||
class="home_icon"
|
||||
transform="matrix(0.29377,0,0,0.29377,0.346087,1.64241)">
|
||||
<path :d="homeIcon" style="fill-rule: nonzero" />
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
<a v-if="enableXYHoming" @click="doHome">
|
||||
<g
|
||||
id="home_all_center"
|
||||
:class="'home_button' + (homedAxes.includes('xyz') ? ' homed' : '')">
|
||||
<!-- HOME ALL BUTTON IN THE CENTER -->
|
||||
<a v-if="enableXYHoming" :class="xyzHomeClass" @click="doHome">
|
||||
<g id="home_all_center" class="home_button">
|
||||
<circle id="home_button_all_center" cx="31" cy="31" r="5" />
|
||||
</g>
|
||||
<g id="icon4" class="home-icon" transform="scale(0.3) translate(91.25,91.25)">
|
||||
@@ -241,7 +133,10 @@ svg a#stepper_off #stepper_off_icon {
|
||||
<g id="step_buttons" transform="matrix(0.804902,0,0,1,0.0430241,0)">
|
||||
<!-- Z STEPS BUTTONS -->
|
||||
<g id="Z" transform="matrix(1.24239,0,0,1,-0.0534526,0)">
|
||||
<g id="Bottom" transform="matrix(-1,-1.52149e-16,9.85721e-17,-1,114.34,62)">
|
||||
<g
|
||||
id="Bottom"
|
||||
:class="zStepClass"
|
||||
transform="matrix(-1,-1.52149e-16,9.85721e-17,-1,114.34,62)">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -290,7 +185,7 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</a>
|
||||
</g>
|
||||
<g id="Top">
|
||||
<g id="Top" :class="zStepClass">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -343,7 +238,7 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</g>
|
||||
<!-- Z STEP BUTTON TEXT -->
|
||||
<g id="stepsZ" transform="matrix(1,0,0,1,40,0)">
|
||||
<g id="stepsZ" :class="zStepClass" transform="matrix(1,0,0,1,40,0)">
|
||||
<g transform="matrix(1,0,0,1,0.483899,4.07983)">
|
||||
<text x="30.7px" y="19.056px" text-anchor="middle">
|
||||
{{ stepsZ.length >= 0 ? stepsZ[0] : '--' }}
|
||||
@@ -367,7 +262,7 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
<!-- XY STEP BUTTONS -->
|
||||
<g id="XY">
|
||||
<g id="Right">
|
||||
<g id="Right" :class="xStepClass">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -417,7 +312,10 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</a>
|
||||
</g>
|
||||
<g id="Left" transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,61.9767,61.9767)">
|
||||
<g
|
||||
id="Left"
|
||||
:class="xStepClass"
|
||||
transform="matrix(-1,-1.22465e-16,1.22465e-16,-1,61.9767,61.9767)">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -467,7 +365,10 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</a>
|
||||
</g>
|
||||
<g id="Bottom1" transform="matrix(6.12323e-17,1,-1,6.12323e-17,61.9767,-1.77705e-14)">
|
||||
<g
|
||||
id="Bottom1"
|
||||
:class="yStepClass"
|
||||
transform="matrix(6.12323e-17,1,-1,6.12323e-17,61.9767,-1.77705e-14)">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -517,7 +418,10 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</a>
|
||||
</g>
|
||||
<g id="Top1" transform="matrix(6.12323e-17,-1,1,6.12323e-17,7.10543e-15,61.9767)">
|
||||
<g
|
||||
id="Top1"
|
||||
:class="yStepClass"
|
||||
transform="matrix(6.12323e-17,-1,1,6.12323e-17,7.10543e-15,61.9767)">
|
||||
<a
|
||||
class="step inner"
|
||||
@click="
|
||||
@@ -569,7 +473,7 @@ svg a#stepper_off #stepper_off_icon {
|
||||
</g>
|
||||
</g>
|
||||
<!-- XY STEP BUTTON TEXT -->
|
||||
<g id="stepsXY">
|
||||
<g id="stepsXY" :class="stepTextClass">
|
||||
<g transform="matrix(1,0,0,1,0.483899,4.07983)">
|
||||
<text x="30.5px" y="19.056px" text-anchor="middle">
|
||||
{{ stepsXY.length >= 0 ? stepsXY[0] : '--' }}
|
||||
@@ -617,7 +521,7 @@ svg a#stepper_off #stepper_off_icon {
|
||||
<path :d="zTiltIcon2" />
|
||||
</g>
|
||||
</a>
|
||||
<a v-else id="stepper_off" :class="homedAxes !== '' ? 'primary' : 'warning'" @click="doSend('M84')">
|
||||
<a v-else id="stepper_off" :class="motorsOffClass" @click="doSend('M84')">
|
||||
<circle id="stepper_off_button" cx="70.92" cy="31" r="5" />
|
||||
<g id="stepper_off_icon" transform="scale(0.3) translate(224,91)">
|
||||
<path :d="engineOffIcon" />
|
||||
@@ -710,10 +614,89 @@ export default class CircleControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
return Array.from(new Set([...(steps ?? [])])).sort((a, b) => a - b)
|
||||
}
|
||||
|
||||
get isPrinting() {
|
||||
return ['printing'].includes(this.printer_state)
|
||||
}
|
||||
|
||||
get stepTextClass() {
|
||||
if (!this.homedAxes.includes('xy') || this.isPrinting) return ['disabled']
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
get xStepClass() {
|
||||
if (!this.homedAxes.includes('x') || this.isPrinting) return ['disabled']
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
get yStepClass() {
|
||||
if (!this.homedAxes.includes('y') || this.isPrinting) return ['disabled']
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
get zStepClass() {
|
||||
if (!this.homedAxes.includes('z') || this.isPrinting) return ['disabled']
|
||||
|
||||
return []
|
||||
}
|
||||
|
||||
get xHomeClass() {
|
||||
let classes = []
|
||||
if (this.homedAxes.includes('x')) classes.push('homed')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get yHomeClass() {
|
||||
let classes = []
|
||||
if (this.homedAxes.includes('y')) classes.push('homed')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get xyHomeClass() {
|
||||
let classes = []
|
||||
if (this.homedAxes.includes('xy')) classes.push('homed')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get xyzHomeClass() {
|
||||
let classes = []
|
||||
if (this.homedAxes.includes('xyz')) classes.push('homed')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get zHomeClass() {
|
||||
let classes = []
|
||||
if (this.homedAxes.includes('z')) classes.push('homed')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get colorSpecialButton() {
|
||||
if (this.existsQGL) return this.colorQuadGantryLevel
|
||||
else if (this.existsZtilt) return this.colorZTilt
|
||||
else return 'warning'
|
||||
let classes = []
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
if (this.existsQGL) classes.push(this.colorQuadGantryLevel)
|
||||
else if (this.existsZtilt) classes.push(this.colorZTilt)
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get motorsOffClass() {
|
||||
let classes = []
|
||||
classes.push(this.homedAxes !== '' ? 'primary' : 'warning')
|
||||
if (this.isPrinting) classes.push('disabled')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
clickSpecialButton() {
|
||||
@@ -722,3 +705,128 @@ export default class CircleControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
svg {
|
||||
max-height: 350px;
|
||||
min-height: 275px;
|
||||
user-select: none;
|
||||
filter: drop-shadow(0px 10px 10px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
svg a {
|
||||
stroke: hsl(0, 0%, 10%);
|
||||
stroke-width: 0.3px;
|
||||
}
|
||||
|
||||
svg a.step {
|
||||
transition: fill 750ms ease-out;
|
||||
}
|
||||
|
||||
svg a.step:hover {
|
||||
fill: hsl(215, 0%, 50%) !important;
|
||||
transition: fill 100ms ease-in;
|
||||
}
|
||||
|
||||
svg a.step:active {
|
||||
fill: hsl(215, 0%, 70%) !important;
|
||||
}
|
||||
|
||||
svg a.step.inner {
|
||||
fill: #666;
|
||||
}
|
||||
svg a.step.inner-mid {
|
||||
fill: #555;
|
||||
}
|
||||
svg a.step.outer-mid {
|
||||
fill: #444;
|
||||
}
|
||||
svg a.step.outer {
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
svg .disabled a.step {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
svg g#stepsZ,
|
||||
svg g#stepsXY {
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 3px;
|
||||
fill: white;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust text {
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 3px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
svg g#home_buttons text {
|
||||
font-family: 'Roboto-Regular', 'Roboto', sans-serif;
|
||||
font-size: 5px;
|
||||
fill: black;
|
||||
}
|
||||
|
||||
svg g.home_button,
|
||||
svg a#home_all_center {
|
||||
fill: var(--color-warning);
|
||||
transition: opacity 250ms;
|
||||
}
|
||||
|
||||
svg a.disabled {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
svg a.disabled .home_button path,
|
||||
svg a.disabled circle {
|
||||
fill: rgb(92, 92, 92);
|
||||
}
|
||||
|
||||
svg g#stepsXY.disabled text,
|
||||
svg g#stepsZ.disabled text {
|
||||
fill: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
svg a#tilt_adjust,
|
||||
svg a#stepper_off {
|
||||
transition: opacity 250ms;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust.warning,
|
||||
svg a#stepper_off.warning {
|
||||
fill: var(--color-warning);
|
||||
}
|
||||
|
||||
svg a#tilt_adjust.primary,
|
||||
svg a#stepper_off.primary {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
|
||||
svg .homed g.home_button,
|
||||
svg .homed a#home_all_center {
|
||||
fill: var(--color-primary);
|
||||
}
|
||||
|
||||
svg g.home_button:hover,
|
||||
svg a#home_all_center:hover,
|
||||
svg a#tilt_adjust:hover,
|
||||
svg a#stepper_off:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust text,
|
||||
svg a#tilt_adjust #tilt_icon,
|
||||
svg a#stepper_off #stepper_off_icon,
|
||||
svg g#home_buttons .home_icon {
|
||||
pointer-events: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
svg a#tilt_adjust #tilt_icon,
|
||||
svg a#stepper_off #stepper_off_icon {
|
||||
fill: #000;
|
||||
}
|
||||
</style>
|
||||
@@ -417,20 +417,5 @@ export default class CrossControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
get stepsReversed() {
|
||||
return Array.from(new Set([...(this.stepsAll ?? [])])).sort((a, b) => a - b)
|
||||
}
|
||||
|
||||
/**
|
||||
* Axes home states
|
||||
*/
|
||||
get xAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('x') ?? false
|
||||
}
|
||||
|
||||
get yAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('y') ?? false
|
||||
}
|
||||
|
||||
get zAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('z') ?? 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,48 +111,6 @@ export default class MoveToControl extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.input.z.pos = newVal
|
||||
}
|
||||
|
||||
/**
|
||||
* Axes home states
|
||||
*/
|
||||
get xAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('x') ?? false
|
||||
}
|
||||
|
||||
get yAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('y') ?? false
|
||||
}
|
||||
|
||||
get zAxisHomed(): boolean {
|
||||
return this.$store.state.printer.toolhead?.homed_axes.includes('z') ?? false
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*/
|
||||
@@ -170,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>
|
||||
@@ -11,23 +11,25 @@
|
||||
<v-menu :offset-y="true" title="Webcam">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn text tile v-bind="attrs" v-on="on">
|
||||
<v-icon v-if="'icon' in currentCam" small class="mr-2">{{ currentCam.icon }}</v-icon>
|
||||
<v-icon v-if="'icon' in currentCam" small class="mr-2">
|
||||
{{ convertWebcamIcon(currentCam.icon) }}
|
||||
</v-icon>
|
||||
<span class="d-none d-md-block">{{ 'name' in currentCam ? currentCam.name : 'unknown' }}</span>
|
||||
<v-icon small>{{ mdiMenuDown }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="currentCamId = 'all'">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ mdiViewGrid }}</v-icon>
|
||||
<v-list-item-icon class="mr-2">
|
||||
<v-icon small class="mt-1">{{ mdiViewGrid }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t('Panels.WebcamPanel.All') }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-list-item v-for="webcam of webcams" :key="webcam.id" link @click="currentCamId = webcam.id">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ webcam.icon }}</v-icon>
|
||||
<v-list-item-icon class="mr-2">
|
||||
<v-icon small class="mt-1">{{ convertWebcamIcon(webcam.icon) }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title v-text="webcam.name"></v-list-item-title>
|
||||
@@ -78,6 +80,7 @@ import BaseMixin from '../mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
|
||||
import { mdiMenuDown, mdiViewGrid, mdiWebcam } from '@mdi/js'
|
||||
import WebcamMixin from '@/components/mixins/webcam'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -89,7 +92,7 @@ import { mdiMenuDown, mdiViewGrid, mdiWebcam } from '@mdi/js'
|
||||
'webcam-grid': WebcamGrid,
|
||||
},
|
||||
})
|
||||
export default class WebcamPanel extends Mixins(BaseMixin) {
|
||||
export default class WebcamPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
@Prop({ default: 'dashboard' }) declare currentPage?: string
|
||||
|
||||
mdiWebcam = mdiWebcam
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<settings-dashboard-sortable viewport-name="desktop" :column="1" />
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<settings-dashboard-sortable viewport-name="desktop" :column="2" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn color="error" @click="resetLayout">{{ $t('Settings.DashboardTab.ResetLayout') }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import SettingsDashboardSortable from '@/components/settings/Dashboard/Sortable.vue'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SettingsDashboardSortable,
|
||||
},
|
||||
})
|
||||
export default class SettingsDashboardTabDesktop extends Mixins(DashboardMixin) {
|
||||
resetLayout() {
|
||||
this.$store.dispatch('gui/resetLayout', 'desktopLayout1')
|
||||
this.$store.dispatch('gui/resetLayout', 'desktopLayout2')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<settings-dashboard-sortable viewport-name="mobile" :column="0" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn color="error" @click="resetLayout">{{ $t('Settings.DashboardTab.ResetLayout') }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import SettingsDashboardSortable from '@/components/settings/Dashboard/Sortable.vue'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SettingsDashboardSortable,
|
||||
},
|
||||
})
|
||||
export default class SettingsDashboardTabMobile extends Mixins(DashboardMixin) {
|
||||
resetLayout() {
|
||||
this.$store.dispatch('gui/resetLayout', 'mobileLayout')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<v-card class="mx-auto fill-height" max-width="300" tile>
|
||||
<v-list class="fill-height" dense>
|
||||
<v-list-item v-if="column < 2">
|
||||
<v-row>
|
||||
<v-col class="col-auto pr-0 pl-8">
|
||||
<v-icon>{{ mdiInformation }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ $t('Panels.StatusPanel.Headline') }}
|
||||
</v-col>
|
||||
<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="layout"
|
||||
handle=".handle"
|
||||
class="v-list-item-group fill-height"
|
||||
ghost-class="ghost"
|
||||
:group="groupname">
|
||||
<transition-group>
|
||||
<settings-dashboard-sortable-item
|
||||
v-for="element in layout"
|
||||
:key="`item-${element.name}`"
|
||||
:name="element.name"
|
||||
:visible="element.visible"
|
||||
@change-visible="changeVisible" />
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</v-list>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import draggable from 'vuedraggable'
|
||||
import { mdiInformation, mdiLock } from '@mdi/js'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import SettingsDashboardSortableItem from '@/components/settings/Dashboard/SortableItem.vue'
|
||||
|
||||
@Component({
|
||||
components: { SettingsDashboardSortableItem, draggable },
|
||||
})
|
||||
export default class SettingsDashboardSortable extends Mixins(DashboardMixin) {
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
mdiInformation = mdiInformation
|
||||
mdiLock = mdiLock
|
||||
|
||||
@Prop({ type: String, required: true }) declare readonly viewportName: string
|
||||
@Prop({ type: Number, required: false, default: 1 }) declare readonly column: number
|
||||
|
||||
get layoutname() {
|
||||
if (this.column) return `${this.viewportName}Layout${this.column}`
|
||||
|
||||
return `${this.viewportName}Layout`
|
||||
}
|
||||
|
||||
get groupname() {
|
||||
return `${this.viewportName}Viewport`
|
||||
}
|
||||
|
||||
get layout() {
|
||||
return this.$store.getters['gui/getPanels'](this.viewportName, this.column)
|
||||
}
|
||||
|
||||
set layout(newVal) {
|
||||
newVal = newVal.filter((element: any) => element !== undefined)
|
||||
|
||||
this.$store.dispatch('gui/saveSetting', { name: `dashboard.${this.layoutname}`, value: newVal })
|
||||
}
|
||||
|
||||
changeVisible(name: string, newVal: boolean) {
|
||||
const index = this.layout.findIndex((element: any) => element.name === name)
|
||||
if (index !== -1) {
|
||||
this.layout[index].visible = newVal
|
||||
this.$store.dispatch('gui/saveSetting', {
|
||||
name: `dashboard.${this.layoutname}`,
|
||||
value: this.layout,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/deep/ .ghost {
|
||||
opacity: 0.5;
|
||||
background: #c8ebfb;
|
||||
}
|
||||
|
||||
.v-list-item-group > span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<v-list-item>
|
||||
<v-row>
|
||||
<v-col class="col-auto px-0">
|
||||
<v-icon class="handle pr-2">{{ mdiDragVertical }}</v-icon>
|
||||
<v-icon>{{ icon }}</v-icon>
|
||||
</v-col>
|
||||
<v-col class="pr-0 text-truncate">
|
||||
{{ panelname }}
|
||||
</v-col>
|
||||
<v-col class="col-auto pl-2">
|
||||
<v-icon
|
||||
:color="checkboxColor"
|
||||
@click.stop="$emit('change-visible', name, !visible)"
|
||||
v-html="checkboxIcon" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import draggable from 'vuedraggable'
|
||||
import { mdiCheckboxBlankOutline, mdiCheckboxMarked, mdiDragVertical, mdiInformation } from '@mdi/js'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
|
||||
@Component({
|
||||
components: { draggable },
|
||||
})
|
||||
export default class SettingsDashboardSortableItem extends Mixins(DashboardMixin) {
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
mdiInformation = mdiInformation
|
||||
mdiDragVertical = mdiDragVertical
|
||||
|
||||
@Prop({ type: String, required: true }) declare readonly name: string
|
||||
@Prop({ type: Boolean, required: true }) declare readonly visible: boolean
|
||||
|
||||
get panelname() {
|
||||
return this.getPanelName(this.name)
|
||||
}
|
||||
|
||||
get icon() {
|
||||
return this.convertPanelnameToIcon(this.name)
|
||||
}
|
||||
|
||||
get checkboxColor() {
|
||||
if (this.visible) return 'primary'
|
||||
|
||||
return 'grey lighten-1'
|
||||
}
|
||||
|
||||
get checkboxIcon() {
|
||||
if (this.visible) return mdiCheckboxMarked
|
||||
|
||||
return mdiCheckboxBlankOutline
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.handle {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<settings-dashboard-sortable viewport-name="tablet" :column="1" />
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-6">
|
||||
<settings-dashboard-sortable viewport-name="tablet" :column="2" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn color="error" @click="resetLayout">{{ $t('Settings.DashboardTab.ResetLayout') }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import SettingsDashboardSortable from '@/components/settings/Dashboard/Sortable.vue'
|
||||
@Component({
|
||||
components: {
|
||||
SettingsDashboardSortable,
|
||||
},
|
||||
})
|
||||
export default class SettingsDashboardTabTablet extends Mixins(DashboardMixin) {
|
||||
resetLayout() {
|
||||
this.$store.dispatch('gui/resetLayout', 'tabletLayout1')
|
||||
this.$store.dispatch('gui/resetLayout', 'tabletLayout2')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,43 @@
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12 col-md-4">
|
||||
<settings-dashboard-sortable viewport-name="widescreen" :column="1" />
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-4">
|
||||
<settings-dashboard-sortable viewport-name="widescreen" :column="2" />
|
||||
</v-col>
|
||||
<v-col class="col-12 col-md-4">
|
||||
<settings-dashboard-sortable viewport-name="widescreen" :column="3" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<v-btn color="error" @click="resetLayout">{{ $t('Settings.DashboardTab.ResetLayout') }}</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import DashboardMixin from '@/components/mixins/dashboard'
|
||||
import SettingsDashboardSortable from '@/components/settings/Dashboard/Sortable.vue'
|
||||
@Component({
|
||||
components: {
|
||||
SettingsDashboardSortable,
|
||||
},
|
||||
})
|
||||
export default class SettingsDashboardTabWidescreen extends Mixins(DashboardMixin) {
|
||||
resetLayout() {
|
||||
this.$store.dispatch('gui/resetLayout', 'widescreenLayout1')
|
||||
this.$store.dispatch('gui/resetLayout', 'widescreenLayout2')
|
||||
this.$store.dispatch('gui/resetLayout', 'widescreenLayout3')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Loaded 100 of 200 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user