Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3845f94f6 | ||
|
|
5b62b97420 | ||
|
|
6884326cd9 | ||
|
|
c8a1e8cb79 | ||
|
|
e445fbe5cc | ||
|
|
09a994d854 | ||
|
|
1a7aca6680 | ||
|
|
a3e74aa57a | ||
|
|
cd1b9b85bd | ||
|
|
4970d0218a | ||
|
|
82e3dd8b18 | ||
|
|
3994a8ebe8 | ||
|
|
8a43ecafd1 | ||
|
|
d8430f54ed | ||
|
|
5734f1cd1d | ||
|
|
7d86df0c81 | ||
|
|
2670eb6447 | ||
|
|
5eb50bbcec | ||
|
|
79a5f9a7e4 | ||
|
|
8fc0d5c23c | ||
|
|
a28c6fdb03 | ||
|
|
b7914f8de6 | ||
|
|
2b73cce47a | ||
|
|
890b9969ae | ||
|
|
79014acf7f | ||
|
|
f3fcce3252 | ||
|
|
e1dd59db15 | ||
|
|
7ae958934f | ||
|
|
bf04ec312e | ||
|
|
09c2526642 | ||
|
|
a0ad7e84ab | ||
|
|
9a2328ba69 | ||
|
|
5007646ff0 | ||
|
|
c87586aebb | ||
|
|
ecaa894fbb | ||
|
|
e0f51667eb | ||
|
|
9f08afc138 | ||
|
|
fd293d21ec | ||
|
|
1aa9f341fa | ||
|
|
98d99d2d11 | ||
|
|
18a5c732b2 | ||
|
|
871688f3c8 | ||
|
|
c725fb09f5 | ||
|
|
54ce2e029c | ||
|
|
5997689ef8 | ||
|
|
218f85c81f | ||
|
|
caaf5e1606 | ||
|
|
57de746adc | ||
|
|
c9dc251e35 | ||
|
|
b0491deb93 | ||
|
|
90d76c1ffe | ||
|
|
1cd2541d6f | ||
|
|
0c4b9e7551 | ||
|
|
16165ec85f | ||
|
|
69eaeb6557 | ||
|
|
e9c22d32bc | ||
|
|
98d9b0aa59 | ||
|
|
da157891a4 | ||
|
|
9883457e9d | ||
|
|
15371adc3d | ||
|
|
fe7aee9307 | ||
|
|
dbb5f81206 | ||
|
|
9e2e923a8f | ||
|
|
1b763e23ef | ||
|
|
1a12554821 | ||
|
|
7251a8c6ba | ||
|
|
cda3098c9e | ||
|
|
9eb133bd85 | ||
|
|
6a4cca751c | ||
|
|
d67ef3aa90 | ||
|
|
aeee198239 | ||
|
|
5c40820108 | ||
|
|
e929c7cc0f | ||
|
|
0b47a80b13 | ||
|
|
8447be2ece | ||
|
|
0c5aca8baf | ||
|
|
eceb442a4c | ||
|
|
4d241fc4b4 | ||
|
|
98160e1368 | ||
|
|
f52b94c459 | ||
|
|
0cefa24e76 | ||
|
|
be253165a0 | ||
|
|
5b2bea51aa | ||
|
|
db09bbe043 | ||
|
|
6758049d29 | ||
|
|
a58bef2a03 | ||
|
|
a1d3dc9118 | ||
|
|
1895d2d905 | ||
|
|
7c81690c1e | ||
|
|
039a446944 | ||
|
|
bcbef2f19a | ||
|
|
39590004da | ||
|
|
ef2d17cadd | ||
|
|
a7e70c75d0 | ||
|
|
21d3d39503 | ||
|
|
d8441254db | ||
|
|
6e7ef6554e | ||
|
|
98a750922a | ||
|
|
7da33523d1 | ||
|
|
2962df21e5 | ||
|
|
73e503fc64 | ||
|
|
705065d65e | ||
|
|
c07606a13c | ||
|
|
7966270ea7 | ||
|
|
c6a3bbc1ca | ||
|
|
f5aee3e20d | ||
|
|
8fc275086a | ||
|
|
2752cfc975 | ||
|
|
6ce0f4f074 | ||
|
|
5abf417303 | ||
|
|
5b55727485 | ||
|
|
4a41430f40 | ||
|
|
8682dd7855 | ||
|
|
cff7b32f02 | ||
|
|
8a34656e82 | ||
|
|
30efd6496e | ||
|
|
2b4b881c55 | ||
|
|
7468f882c1 | ||
|
|
f9556e27b3 | ||
|
|
630d67efc5 | ||
|
|
a85ec9d0d7 | ||
|
|
b94840736f | ||
|
|
9c3c56bd56 | ||
|
|
23cc6b18e5 | ||
|
|
d4f1bf209d | ||
|
|
8481408029 | ||
|
|
d578c2a107 | ||
|
|
080a713f4c | ||
|
|
140d796f51 | ||
|
|
23da8818c3 | ||
|
|
34e3e69e5e | ||
|
|
ea274c6d4a | ||
|
|
a08f9ac9a5 | ||
|
|
8bbd5bdb0f | ||
|
|
74816c5c21 | ||
|
|
40e8f9cd63 | ||
|
|
4d7ffbe090 | ||
|
|
ec53b974fd | ||
|
|
a3316eb23b | ||
|
|
e6505fe55a | ||
|
|
6484a41eca | ||
|
|
0e86652d1c | ||
|
|
bb710794d2 | ||
|
|
f701dfbcf8 | ||
|
|
301e8386b8 | ||
|
|
ab777d5e04 | ||
|
|
c598d6260d | ||
|
|
370d7d4142 | ||
|
|
faf09f24f9 | ||
|
|
dd262f74b0 | ||
|
|
ad8d8efb6a | ||
|
|
df83c9d8cc | ||
|
|
6b68be1121 | ||
|
|
3584c0393f | ||
|
|
8a199a00b6 | ||
|
|
c18a9594e6 | ||
|
|
85ea45fbe9 | ||
|
|
44f4079dac | ||
|
|
ec1b32eaaf | ||
|
|
531b75fffd | ||
|
|
7301ae986a | ||
|
|
0f01a8f994 | ||
|
|
7ad25e3851 | ||
|
|
eac516e0e6 | ||
|
|
350bc1927a |
No files matched your search
@@ -0,0 +1,51 @@
|
||||
<!--
|
||||
For Work In Progress Pull Requests, please use the Draft PR feature,
|
||||
see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details.
|
||||
|
||||
For a timely review/response, please avoid force-pushing additional
|
||||
commits if your PR already received reviews or comments.
|
||||
|
||||
We use squash-merge to merge PRs, so the commit history is clean, but we use the PR title as the commit message.
|
||||
So we recommend you to use the PR title with conventional commits type prefixes. We use the following prefixes for the PR title:
|
||||
- feat: A new feature
|
||||
- fix: A bug fix
|
||||
- docs: Documentation only changes
|
||||
- style: Changes that do not affect the meaning of the code (white-space, formatting, etc)
|
||||
- refactor: A code change that neither fixes a bug nor adds a feature
|
||||
- perf: A code change that improves performance
|
||||
- test: Adding missing tests or correcting existing tests
|
||||
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
|
||||
- locale: Changes to the translations
|
||||
|
||||
You can found more information about Conventional Commits here: https://www.conventionalcommits.org/en/v1.0.0/.
|
||||
|
||||
Before submitting a Pull Request, please ensure you've done the following:
|
||||
- 📖 Read the Mainsail Contributing Guidelines: https://github.com/mainsail-crew/mainsail/blob/HEAD/CONTRIBUTING.md#-submitting-a-pull-request-pr.
|
||||
- 📖 Read the Mainsail Code of Conduct: https://github.com/mainsail-crew/mainsail/blob/HEAD/.github/CODE_OF_CONDUCT.md.
|
||||
- 👷♀️ Create small PRs. In most cases, this will be possible.
|
||||
- ✅ Provide tests for your changes.
|
||||
- 📝 Use descriptive commit messages.
|
||||
- 📗 Update any related documentation and include any relevant screenshots.
|
||||
-->
|
||||
|
||||
## Description
|
||||
|
||||
<!--
|
||||
Please do not leave this blank
|
||||
This PR [adds/removes/fixes/replaces] the [feature/bug/etc].
|
||||
-->
|
||||
|
||||
## Related Tickets & Documents
|
||||
|
||||
<!--
|
||||
Please use this format link issue numbers: Fixes #123
|
||||
https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
|
||||
-->
|
||||
|
||||
## Mobile & Desktop Screenshots/Recordings
|
||||
|
||||
<!-- Visual changes require screenshots -->
|
||||
|
||||
## [optional] Are there any post-deployment tasks we need to perform?
|
||||
|
||||
<!-- note: PRs with deleted sections will be marked invalid -->
|
||||
@@ -0,0 +1,21 @@
|
||||
# Set update schedule for GitHub Actions
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: 'github-actions'
|
||||
directory: '/'
|
||||
schedule:
|
||||
# Check for updates to GitHub Actions every week
|
||||
interval: 'weekly'
|
||||
|
||||
- package-ecosystem: 'npm'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
allow:
|
||||
# Ignore major updates to all dependencies. We're using old versions of some packages that are incompatible with newer versions of other packages.
|
||||
- dependency-name: '*'
|
||||
update-type: 'semver:non-major'
|
||||
dependency-type: 'direct'
|
||||
assignees:
|
||||
- 'meteyou'
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
auto-analyze:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
if: contains(steps.changed-file-package-json.outputs.modified_files, 'package.json')
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
|
||||
@@ -23,12 +23,12 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- name: Fetch repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: '16'
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Copy output
|
||||
run: cp ${{ github.workspace }}/dist/mainsail.zip mainsail-latest.zip
|
||||
|
||||
- uses: actions/upload-artifact@v2.2.4
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: mainsail-latest.zip
|
||||
path: mainsail-latest.zip
|
||||
@@ -8,7 +8,7 @@ jobs:
|
||||
if: contains(github.event.pull_request.labels.*.name, 'analyze')
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- uses: preactjs/compressed-size-action@v2
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
run: sudo apt install -y jq
|
||||
|
||||
- name: Fetch repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
echo "::set-output name=$file::|${file##*/}|${MISSING}|${UNUSED}|"
|
||||
done
|
||||
- name: Comment PR
|
||||
uses: thollander/actions-comment-pull-request@v1
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
message: |
|
||||
Language file analysis report:
|
||||
|
||||
@@ -25,22 +25,22 @@ jobs:
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- name: Fetch repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linters
|
||||
uses: wearerequired/lint-action@v1
|
||||
uses: wearerequired/lint-action@v2
|
||||
with:
|
||||
eslint: true
|
||||
prettier: true
|
||||
eslint_dir: src
|
||||
eslint_extensions: ts,vue
|
||||
eslint_extensions: ts,vue,json
|
||||
@@ -16,4 +16,4 @@ jobs:
|
||||
action:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/label-actions@v2
|
||||
- uses: dessant/label-actions@v3
|
||||
@@ -22,10 +22,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
@@ -41,13 +41,13 @@ jobs:
|
||||
type=edge,branch=develop
|
||||
type=ref,event=tag
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone develop repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
ref: 'develop'
|
||||
@@ -53,7 +53,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fetch repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: 'master'
|
||||
fetch-depth: 0
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
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
|
||||
uses: orhun/git-cliff-action@v2
|
||||
id: generate-changelog
|
||||
with:
|
||||
config: ./cliff-release.toml
|
||||
@@ -101,12 +101,13 @@ jobs:
|
||||
run: cp ./remote/* ./dist/
|
||||
|
||||
- name: Upload to remote server
|
||||
uses: SamKirkland/FTP-Deploy-Action@4.3.3
|
||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
||||
with:
|
||||
server: ${{ secrets.REMOTEHOST }}
|
||||
username: ${{ secrets.REMOTEUSER }}
|
||||
password: ${{ secrets.REMOTEPASSWORD }}
|
||||
dangerous-clean-slate: true
|
||||
exclude: .htaccess
|
||||
local-dir: ./dist/
|
||||
|
||||
update-changelog:
|
||||
|
||||
@@ -14,12 +14,12 @@ jobs:
|
||||
# container: cypress/browsers:node16.13.2-chrome97-ff96
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
node-version: 20
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -4,6 +4,7 @@ design
|
||||
*.log
|
||||
packages/test
|
||||
dist
|
||||
dev-dist
|
||||
temp
|
||||
.vuerc
|
||||
.version
|
||||
@@ -14,6 +15,7 @@ temp
|
||||
package-lock.json
|
||||
*.local
|
||||
.env
|
||||
.vscode
|
||||
|
||||
cypress/screenshots/
|
||||
cypress/videos/
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
"semi": false,
|
||||
"printWidth": 120,
|
||||
"bracketSameLine": true,
|
||||
"trailingComma": "es5",
|
||||
"htmlWhitespaceSensitivity": "ignore",
|
||||
"overrides": [
|
||||
{
|
||||
|
||||
+231
@@ -2,6 +2,237 @@
|
||||
# Changelog
|
||||
All notable changes to Mainsail will be documented in this file.
|
||||
|
||||
## [2.7.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.7.1) - 2023-08-16
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Fix issue on tablet and smaller devices with the sidebar (#1518) | [218f85c](218f85c81feafecc80043e26e880f45be5bc5e3d)
|
||||
|
||||
### Localization
|
||||
|
||||
- **zh**: Update Chinese (zh) localization (#1521) | [caaf5e1](caaf5e16062d12f765d2e7d6c985dbc351e34336)
|
||||
|
||||
## [2.7.0](https://github.com/mainsail-crew/mainsail/releases/tag/v2.7.0) - 2023-08-12
|
||||
### Features
|
||||
|
||||
- Hide screws tilt adjust dialog, when using MAX_DEVIATION (#1474) | [15371ad](15371adc3d550817663aabca6c2f4b76fd585e4f)
|
||||
- Add option to hide MCU/Host sensors in the temp panel (#1496) | [9883457](9883457e9d622c16f6edb8e368c77b99e6728085)
|
||||
- Hide axis controls during print (#1452) | [da15789](da157891a44bc6a6b9cdec87e0e8fb2c0f060dba)
|
||||
- Add an option to set the sidebar default state (#1462) | [e9c22d3](e9c22d32bc3615360407caf544ed5751f30adb09)
|
||||
- Add option to hide FPS counter in webcams (#1488) | [69eaeb6](69eaeb65573c5dda5773c5f9c60fa249d136c213)
|
||||
- Add a select all option on the backup and restore dialogs (#1448) | [0c4b9e7](0c4b9e75516c55bfe6678ce3a66ed8e281295ace)
|
||||
- Add nevermore to temperature panel (#1511) | [1cd2541](1cd2541d6f2f7d567f33b00708fe055b929df3dd)
|
||||
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Fix cursor style for item name to be a pointer (#1514) | [98d9b0a](98d9b0aa597ab482314876b11d261c81aae1bbf9)
|
||||
|
||||
### Refactor
|
||||
|
||||
- Soft down info buttons in update manager (#1513) | [16165ec](16165ec85f05a92edcd52f57be869ea31f8b0460)
|
||||
|
||||
### Localization
|
||||
|
||||
- **pl**: Update Polish translation (#1502) | [fe7aee9](fe7aee9307cca63ae993c062e2d9a84a6f215856)
|
||||
- **pl**: Update Polish translation (#1515) | [90d76c1](90d76c1ffeea42bc59f6d7dcc9374eee600f2cc7)
|
||||
- **zh**: Update Chinese (zh) localization (#1503) | [dbb5f81](dbb5f81206d4d161eb0593b9d5e8c7b5189ffc2d)
|
||||
|
||||
## [2.6.2](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.2) - 2023-07-30
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Fix editor save & restart button behavior (#1483) | [8447be2](8447be2ecee64fa4a3c0211ac57f42c3adf1d050)
|
||||
- Hide rpm in temperature_fans without tachometer_pin (#1489) | [e929c7c](e929c7cc0f45074f40407420b3585d9c02284fa1)
|
||||
- Fix flip function in several webcam clients (#1487) | [5c40820](5c4082010890e0b341754f42673affe7d1ca9d99)
|
||||
- Fix issue with camel-case object names in temperature panel (#1491) | [aeee198](aeee1982398acca803f7f4eae7b7b39a29253179)
|
||||
- Use webcam name instead of UUID for timelapse plugin (#1492) | [d67ef3a](d67ef3aa908601b6bb87353957bcc97ea4f829ea)
|
||||
- Fix issue with create/edit presets and refactor settings (#1499) | [6a4cca7](6a4cca751c88e89ddf5f2cc0f09a58f097a461af)
|
||||
- Fix multiple issues in the refactored update manager (#1497) | [9eb133b](9eb133bd85530ac08416e94f02ebe19f060bc095)
|
||||
- Fix issue with cannot extrude after a Klipper restart (#1495) | [cda3098](cda3098c9e09a054aa7baa69a3195e0a73f43e54)
|
||||
|
||||
### Refactor
|
||||
|
||||
- Refactor SettingsRow (#1484) | [0b47a80](0b47a80b133e6093aecdb0d7d87b718899dff0c7)
|
||||
|
||||
### Localization
|
||||
|
||||
- **pl**: Update Polish translation (#1482) | [0c5aca8](0c5aca8baffb65198f43a7d3b2b57571d8e911c9)
|
||||
- **zh**: Update chinese locale (#1486) | [7251a8c](7251a8c6bae2b92395de4c8c23e8e8e3900df66a)
|
||||
|
||||
## [2.6.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.1) - 2023-07-24
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Show delete dialog for single files too (#1442) | [7da3352](7da33523d1ec7c4a3206400fb92803685176167e)
|
||||
- Remove variable check in klipper config StreamParser (#1435) | [6e7ef65](6e7ef6554ec88ceb29f66b4d6a5d5f21ef77671b)
|
||||
- Fix condition in restartServiceNameExists check (#1450) | [a7e70c7](a7e70c75d0009ffed14e8717ad8286f91e4e7e8a)
|
||||
- Avoid hitting 100% before print is complete (#1455) | [3959000](39590004da7ca22fef82fbd148b31683c462bb13)
|
||||
- Fix issue with ETA and 12h time format (#1463) | [039a446](039a446944f05ea241574c65040d520bbbef0e9b)
|
||||
- Fix issue with CSV separator in contents (#1460) | [1895d2d](1895d2d90591946c792faaf3f62c52865f27cd62)
|
||||
- Fix issue with webcams in farm printers (#1469) | [5b2bea5](5b2bea51aab79aabfab02825cdce45be351c1c6f)
|
||||
|
||||
### Refactor
|
||||
|
||||
- Build version file for moonraker (#1449) | [21d3d39](21d3d395039ec855d062a5ee5e5b43e2d858f402)
|
||||
- Use moonraker webcam api instead of direct DB access (#1445) | [7c81690](7c81690c1e299c804edb4ede0acab7d77d1dedbe)
|
||||
- Change SettingsGeneralTab file (#1475) | [db09bbe](db09bbe043b2e43053779709f5260c7275bc4969)
|
||||
- Extract Presets and Settings from TemperaturePanel (#1465) | [be25316](be253165a003c50fd992f43c586ce5315dc2352d)
|
||||
- Display errors and warnings in the update_manager (#1453) | [0cefa24](0cefa24e766c568a56127bfd55272735383cb45e)
|
||||
|
||||
### Localization
|
||||
|
||||
- **pl**: Update Polish translation (#1434) | [73e503f](73e503fc6448ae174dd7f9d59236c820bd4b6631)
|
||||
- **pl**: Update Polish translation (#1447) | [d844125](d8441254db04d672fe2137f64e39127f524c4769)
|
||||
- **pl**: Update polish locale (#1471) | [a58bef2](a58bef2a03479262b4ee5db2b5d103e8dc2194c5)
|
||||
- **pl**: Update Polish translation (#1476) | [6758049](6758049d29c7410bcdedec689eaca503952b2c7e)
|
||||
- **tr**: Update turkish locale (#1480) | [f52b94c](f52b94c459ad759e160a568d3b6f366b0e65f484)
|
||||
- **zh**: Update Chinese (zh) localization (#1459) | [bcbef2f](bcbef2f19af4746b941ddcb29c98ff5f071611d0)
|
||||
|
||||
### Other
|
||||
|
||||
- **pwa**: Remove debug warnings in browser console (#1441) | [2962df2](2962df21e512baad6976dc502d6234c2969da686)
|
||||
- Add dev-dist to .gitignore (#1451) | [ef2d17c](ef2d17cadde566e8b713031cb7292d65ca1bec12)
|
||||
|
||||
## [2.6.0](https://github.com/mainsail-crew/mainsail/releases/tag/v2.6.0) - 2023-06-19
|
||||
### Features
|
||||
|
||||
- Allow negative time estimate in slicer (#1372) | [e6505fe](e6505fe55a30878045cea6611c119b9f3601ab33)
|
||||
- Customize sidebar navi (#1336) | [a3316eb](a3316eb23bf35eb139c9ba183cfc3a731d013c1d)
|
||||
- Add AHT10 to additionalSensors (#1378) | [ec53b97](ec53b974fd3e3d32bfa01e06919c8f51014545e4)
|
||||
- Add function to duplicate gcode files (#1321) | [4d7ffbe](4d7ffbe090611fb82e1524c8428ea3fc4290c410)
|
||||
- Add jmuxer-stream webcam type, supporting raw h264 (#1342) | [40e8f9c](40e8f9cd63d685b611935e1ceee70e2dfd331eda)
|
||||
- Add options to disable klipper helper dialogs (#1319) | [74816c5](74816c5c2126d8320028602aa55b075bfd9db647)
|
||||
- Add facility to Scan Metadata from G-code Files (#1316) | [8bbd5bd](8bbd5bdb0f2ea26b57e1b4977b222c023f7ffa44)
|
||||
- Allows adjustable tab size in file editor (#1354) | [ea274c6](ea274c6d4a4445ff47c1b5c60d0dca94e5c8cdcd)
|
||||
- Add printer name to browser tab while printing or complete (#1371) | [140d796](140d796f518cbb2eb72b2394a02c9dfa504fe1fd)
|
||||
- Add an option to change the height of the temperatur chart (#1391) | [d578c2a](d578c2a107a5b6d4026699d165ab597587c300a4)
|
||||
- Updating WebRTC with camera-streamer signaling protocol (#1417) | [b948407](b94840736fa26fbb9b5690e40c2ebf87c7f3ec32)
|
||||
- Add portuguese/brazil translate (#1407) | [630d67e](630d67efc50766857e6b1b8a69605fd7c502dbe6)
|
||||
- Add bed aspect ratio to heightmap graph (#1420) | [2b4b881](2b4b881c5529834ca1bd4c3f14db44c997b935ba)
|
||||
- Add WebRTC (MediaMTX / rtsp-simple-server) webcam mode (#1318) | [8682dd7](8682dd785551ac10cec7783fd455f56b9ae340c0)
|
||||
- Add retry button to ScrewsTiltAdjust helper dialog (#1429) | [2752cfc](2752cfc975bfe4391657bf03e62db5f5317c523b)
|
||||
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Find LOAD & UNLOAD_FILAMENT macros case-insensitive (#1335) | [df83c9d](df83c9d8cc61ecd11c320ec90a9083fdd675d3bf)
|
||||
- Fix thumbnail guide link in settings (#1337) | [ad8d8ef](ad8d8efb6a41f1d4162ef9d08720a3a19442b1e6)
|
||||
- Fix configuration guide link for thumbnails (#1338) | [faf09f2](faf09f24f9765397acbde3b6af8c9a521e3616d4)
|
||||
- Fix miscellaneous slider + button for fans/outputs with max power (#1344) | [c598d62](c598d6260dca0f107f219ee67600c0b969addc6a)
|
||||
- Add gcode offset to live position in gcodeviewer (#1341) | [ab777d5](ab777d5e04be5bda396096293bd974a6d96307bf)
|
||||
- Fix zip file timestamp (#1375) | [f701dfb](f701dfbcf8e1a5aec5aefb6abee7854a61257eb2)
|
||||
- Make the correct notification appear on gcode file move (#1376) | [bb71079](bb710794d277e7116628386250e2b8cb3d3122c1)
|
||||
- Fix issue when moving a file to the root directory (#1377) | [6484a41](6484a41eca007920495d07d7c009dee720b4f1c6)
|
||||
- DisableFanAnimation getter getting wrong value (#1381) | [a08f9ac](a08f9ac9a5709ad624274cf4a322a55b81d1b347)
|
||||
- Check only not empty filename for metadata in farm printers (#1392) | [f9556e2](f9556e27b34489d3abd5d62429c1d908c60dc946)
|
||||
- Fix navigation to display allPrinters (#1423) | [8a34656](8a34656e82603940197ddc5f399b28eb32848cb1)
|
||||
|
||||
### Refactor
|
||||
|
||||
- Improve syntax highlighting and change theme in editor (#1200) | [080a713](080a713f4cbd8a994099c2ebaf802d43a06e2ad9)
|
||||
- Add webcam-wrapper component (#1422) | [cff7b32](cff7b32f02a8dc81eda2b101ffbf7354cd88a886)
|
||||
- Refactor Panel.vue (#1427) | [5abf417](5abf4173031fe8fb23ded02679d0997d0620ecc7)
|
||||
- Remove unused import in FarmPrinterPanel.vue (#1428) | [6ce0f4f](6ce0f4f0748fea887acc4767098d2ddae3635245)
|
||||
|
||||
### Styling
|
||||
|
||||
- Fix eslint issue in SettingsNavigationTabItem (#1383) | [23da881](23da8818c344eb8f77366f16cac6ca1237d3cda8)
|
||||
|
||||
### Localization
|
||||
|
||||
- **de**: Update German localization (#1424) | [4a41430](4a41430f4006f1d4d131c6aa4cf0d6e26adef4b6)
|
||||
- **en**: Remove unused key (#1425) | [5b55727](5b55727485e276e714d69a83cabff0a959a8389d)
|
||||
- **ko**: Update Korean localization (#1368) | [0e86652](0e86652d1c0cd0b933c77599658461f4764cc931)
|
||||
- **pl**: Update Polish language (#1411) | [a85ec9d](a85ec9d0d746d5c8ea9838a71656e11af676196b)
|
||||
- **ru**: Update russian localization (#1394) | [7468f88](7468f882c1b0c45051edb64ab8cb90ab82616feb)
|
||||
- **zh**: Fix translation (#1418) | [30efd64](30efd6496ec2475e68a022e37bd006340a168049)
|
||||
- **zh_TW**: Update Chinese localization (#1386) | [8481408](84814080291e6f037230491c3e273ddd49ed6e53)
|
||||
|
||||
### Documentation
|
||||
|
||||
- Add Contributing section in README.md (#1339) | [dd262f7](dd262f74b0a82761de04180c7baf730c9854f71f)
|
||||
- Fix broken coding standards link in contributing doc (#1415) | [d4f1bf2](d4f1bf209d15763e45f67dfec799fbee78090e47)
|
||||
|
||||
### Other
|
||||
|
||||
- Exclude htaccess file on upload to my.mainsail.xyz (#1347) | [370d7d4](370d7d414287bd12a1aa7ffa18a5c6ef4f746d4a)
|
||||
- Add PULL_REQUEST_TEMPLATE (#1340) | [301e838](301e8386b823c4c005172f33cfb0969d4e1b8d20)
|
||||
- Add PWA caching and cache updater (#1421) | [8fc2750](8fc275086addfc55ff805452b8f8fa4ccb6feb2a)
|
||||
- Update ftp upload action in release workflow (#1430) | [7966270](7966270ea783f5c79549ba325c9bb11e6a0e3447)
|
||||
|
||||
## [2.5.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.5.1) - 2023-04-02
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Missing M117 output in status panel (#1309) | [0f01a8f](0f01a8f994953c6518a0ece4870b0328387c5cb1)
|
||||
- Disallow non-ascii chars in bed_mesh name (#1311) | [7301ae9](7301ae986abea0b71281f62979098bb99b362469)
|
||||
- Fix issue of empty Screws tilt adjust helper dialog (#1329) | [44f4079](44f4079dacbe88ce84c27ea32080d95756d5e468)
|
||||
- Fix invalid name input checks (#1312) | [85ea45f](85ea45fbe9b34d9a19ed1a3fcaed95514c3977e5)
|
||||
|
||||
### Localization
|
||||
|
||||
- **cz**: Add Czech localization (#1327) | [531b75f](531b75fffd2e22c60764e10c4ed1786449d9cad5)
|
||||
- **de**: Update German localization (#1326) | [ec1b32e](ec1b32eaaf83222591d822b233bdcff54f428560)
|
||||
|
||||
### Other
|
||||
|
||||
- Update caniuse (#1330) | [c18a959](c18a9594e6c9cc61ff0a7ac68b2206aa73cce697)
|
||||
|
||||
## [2.5.0](https://github.com/mainsail-crew/mainsail/releases/tag/v2.5.0) - 2023-03-12
|
||||
### Features
|
||||
|
||||
- Add multi download to ConfigFilesPanel.vue (#1194) | [712d681](712d68136b62ddb825c7620071e155571322b927)
|
||||
- Add table view for print status stats (#1192) | [7ac6a72](7ac6a723b4f2def8d46beb050457cb0ffc725be3)
|
||||
- Add new CodeStream control to Gcodeviewer (#1224) | [1a32147](1a32147d68938e9c1155b535f9212d9858947d45)
|
||||
- Add support for cnc mode in g-code viewer (#1239) | [727fc72](727fc722af2a9213670ae4a21d0a1683c24e8fc2)
|
||||
- Hide/ignore .git directories in file init process (#1227) | [051b896](051b89662b4576f6821c6b8bb66d116db6905397)
|
||||
- Log rollover function for klipper and moonraker (#1243) | [b6fe84f](b6fe84f19d66cbbcf3170855b3c19c13a3fdb135)
|
||||
- Add power button on dashboard to switch printer on (#1254) | [d29ce0a](d29ce0a4f02f7be305f337c9a27ed32d02da5d64)
|
||||
- Add button to hide SAVE_CONFIG button for pending bed_mesh (#1255) | [0f94e80](0f94e80135f426fb558a96a2c419d22180d0c328)
|
||||
- Add HLS Support for webcams (#1258) | [6b9b695](6b9b69501a6718ea9ae83037a8b43af52b826573)
|
||||
- Add helper display for screws_tilt_adjust (#1261) | [c904b7b](c904b7ba71144236fe3c6dff9fa82d636a1b9bec)
|
||||
- Add jobs to queue in batches (#1253) | [b3ce868](b3ce868dec2f9dd6fb9932650e61e219b5944c5c)
|
||||
- Add function to send PAUSE at a specific layer change (#1230) | [cec3a9f](cec3a9fe33ea931c7496ea1f4bef8af47c51566c)
|
||||
- Add x_only and y_only option in timelapse park position (#1231) | [2a924bc](2a924bcd27e539452f7c5928b339cedb87cb8d0e)
|
||||
- Support a color or colour variable from tool change macros (#1244) | [e0e90bc](e0e90bcdaf36a490dc45a505436eb6bbde04e6e5)
|
||||
- Max webcam height to fit on the screen (#1246) | [43dc843](43dc843eca753154d698f045f7e2d9433d115aa0)
|
||||
- Add WebRTC (camera streamer) support (#1275) | [6703721](67037215933acf0603a6e1130cc835b98274d3ed)
|
||||
- Allow fan animations to be disabled to save browser perf. (#1232) | [47feaef](47feaef6718c03ea4ef4130210c958fb60cb2be5)
|
||||
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
- Hide temperature sensors with `_` at first char (#1195) | [e21439d](e21439d061e2abe566919f5c62b019bc92e89a1f)
|
||||
- Add webcam rotate to timelapse preview (#1198) | [c2ecc84](c2ecc845cadcb998875f3ab8069a5f76afe86ed9)
|
||||
- Fix ExcludeObjectDialogMap for delta printers (#1217) | [034ff81](034ff81e4970469f3b4e96ca504e091e792ec326)
|
||||
- G-Code Viewer UI fixes (#1240) | [9c4fb54](9c4fb547b55e424ca1ddd334b43b6998da32b5b4)
|
||||
- Fix dateTime output in print history detail dialog (#1248) | [2b7bf2a](2b7bf2a3f43ee8b3d8c14be2d84263abac936c4b)
|
||||
- Hide unused panels on dashboard (#1233) | [e7eb94f](e7eb94faa1696237890ef8fe546db379067cc5dc)
|
||||
- Fix cancel button in rollover logs dialog (#1256) | [c65527d](c65527ddf21ff6d5ea87dee6a29d2710e29c049a)
|
||||
- Fix output of klippy state, if UDS path/address dont fit (#1263) | [a8bf9e9](a8bf9e9559aab80747871fdbce94c429a2360596)
|
||||
- Fix position of webcam fps (#1278) | [f3c4295](f3c42954f1119157631772622786af7db28a7f98)
|
||||
- Fix browser title, when printer is off (#1300) | [3e49847](3e49847fc3668295a67c1edcbed28a5e68f2c7a3)
|
||||
- Only display PAUSE AT LAYER button, when the macros exists (#1291) | [a3a71c8](a3a71c8f15357467f85f9169dc20ef52aff2a535)
|
||||
|
||||
### Refactor
|
||||
|
||||
- Use moonraker zip function (#1245) | [8782c89](8782c89d71613f3552976e7d0ba60fb6138e580d)
|
||||
- Rename download zip name (#1252) | [22ccab8](22ccab831b24e2746b6dd7a775225e59b9bf5e1e)
|
||||
- HLS streamer - improve latency (#1268) | [6a2a1ba](6a2a1baaabc52e85abf6aa05b1cac9bc8fbbf8b7)
|
||||
- Change jobqueue entry attribute to hyphenated names (#1271) | [92438bf](92438bf8a7f8a0e29162460205321fa25a124ec7)
|
||||
- Add ENABLE=1 to SET_PAUSE_AT_LAYER/NEXT_LAYER (#1293) | [1a6969e](1a6969eeea2ef4df8b32a1df3b6e5b4369591dcf)
|
||||
|
||||
### Localization
|
||||
|
||||
- **da**: Update Danish localization (#1288) | [c42f09a](c42f09acc98ed9aba9d4911a36bc6d17e351ddf3)
|
||||
- **de**: Update German localization (#1277) | [0e4d104](0e4d104d20fd578ea8252d6791bce24e66608396)
|
||||
- **fr**: Update French localization (#1289) | [c1a5018](c1a50180d0269377b5ec67bca51aed9aedcd8f12)
|
||||
- **ja**: Update Japanese localization (#1270) | [b0cdbb4](b0cdbb48f3347e5262f24eca14788d5c248359e5)
|
||||
- **nl**: Update NL locale (#1282) | [3743023](3743023514507577b88540362bc8fbeae086add3)
|
||||
- **zh**: Update locale (#1269) | [328530a](328530a6a39a62d797c9c20aabf010dc89264152)
|
||||
- **zh**: Update Chinese (zh) localization (#1284) | [2f868b5](2f868b537d5a42dcac1d76dfc69729037ae3f450)
|
||||
- Remove unused locale `PresetSubTitle` (#1264) | [3b5d7f1](3b5d7f146b0a5a160b0586e9d9938692895ded09)
|
||||
|
||||
### Other
|
||||
|
||||
- Add .vscode to .gitignore (#1290) | [1bbbc0c](1bbbc0c0a8ddd8ad8bf1dc3db53c07b63590dd5d)
|
||||
- Add armv6 support for Docker image (#1285) | [52d0ea4](52d0ea4ec57b94582386666fc6389e7d260741f4)
|
||||
- Update gcodeviewer from v3.2.0 to v3.2.2 (#1303) | [9665fb9](9665fb9a387a05796b26aefa276a869425099a00)
|
||||
|
||||
## [2.4.1](https://github.com/mainsail-crew/mainsail/releases/tag/v2.4.1) - 2022-12-10
|
||||
### Bug Fixes and Improvements
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ Before you work on a PR and submit it, please pay attention to the following gui
|
||||
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)
|
||||
3. Follow our [Code Standards](https://docs.mainsail.xyz/overview/developement/code-standards)
|
||||
4. If there is an issue describing the problem you're fixing or a discussion of a feature you are implementing, make sure to link it in the PRs body.
|
||||
|
||||
- You can also add `fix #<id>` or `fixes #<id>` in the PR body where `<id>` is the issue id.
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Builder stage, builds the application in node
|
||||
#
|
||||
FROM --platform=$BUILDPLATFORM node:18-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM node:20-alpine as builder
|
||||
|
||||
RUN apk add zip
|
||||
|
||||
|
||||
@@ -100,6 +100,19 @@ every day. To motivate him (☕🍺😜) there are several ways to support him:
|
||||
[](https://www.patreon.com/meteyou)
|
||||
[](https://ko-fi.com/mainsail)
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions to Mainsail are always welcome!
|
||||
|
||||
- 📥 Pull requests and 🌟 Stars are always welcome.
|
||||
- Read our [contributing guidelines](CONTRIBUTING.md) to get started,
|
||||
or find us on [Discord](https://discord.gg/mainsail), we will take the time to guide you.
|
||||
|
||||
Looking for a first issue to tackle?
|
||||
|
||||
- We tag issues with [](https://github.com/mainsail-crew/mainsail/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) when we think they are well suited for people who are new to the codebase or OSS in general.
|
||||
- [Talk to us](https://discord.gg/mainsail), we'll find something that suits your skills and learning interest.
|
||||
|
||||
## Credit, sources and inspiration
|
||||
|
||||
- [Kevin O'Connor](https://github.com/KevinOConnor) for the awesome 3D printer firmware [Klipper](https://github.com/KevinOConnor/klipper)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
||||
Generated
+2707
-9194
File diff suppressed because it is too large.
Load diff
+18
-13
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mainsail",
|
||||
"version": "2.5.0",
|
||||
"version": "2.8.0",
|
||||
"private": true,
|
||||
"decription": "a klipper web interface",
|
||||
"author": {
|
||||
@@ -36,12 +36,15 @@
|
||||
"@sindarius/gcodeviewer": "^3.2.2",
|
||||
"@types/node": "^18.0.0",
|
||||
"@types/overlayscrollbars": "^1.12.1",
|
||||
"@uiw/codemirror-theme-vscode": "^4.19.11",
|
||||
"axios": "^0.27.0",
|
||||
"codemirror": "^6.0.1",
|
||||
"core-js": "^3.16.0",
|
||||
"detect-browser": "^5.3.0",
|
||||
"echarts": "^5.2.2",
|
||||
"echarts-gl": "^2.0.8",
|
||||
"hls.js": "^1.3.3",
|
||||
"jmuxer": "^2.0.5",
|
||||
"js-sha256": "^0.9.0",
|
||||
"lodash.kebabcase": "^4.1.1",
|
||||
"lodash.throttle": "^4.1.1",
|
||||
@@ -49,7 +52,8 @@
|
||||
"overlayscrollbars-vue": "^0.2.2",
|
||||
"regenerator-runtime": "^0.13.9",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"semver": "^7.3.5",
|
||||
"semver": "^7.5.2",
|
||||
"typed_janus_js": "^1.0.14",
|
||||
"uuid": "^9.0.0",
|
||||
"vue": "^2.7.10",
|
||||
"vue-class-component": "^7.2.6",
|
||||
@@ -69,34 +73,35 @@
|
||||
"@intlify/vite-plugin-vue-i18n": "^2.5.0",
|
||||
"@mdi/js": "^7.0.0",
|
||||
"@types/file-saver": "^2.0.5",
|
||||
"@types/jmuxer": "^2.0.3",
|
||||
"@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/eslint-config-typescript": "^11.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||
"@typescript-eslint/parser": "^6.0.0",
|
||||
"@vue/eslint-config-typescript": "^12.0.0",
|
||||
"autoprefixer": "^10.4.2",
|
||||
"cypress": "^10.0.0",
|
||||
"cypress": "^13.2.0",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-jsonc": "^2.2.1",
|
||||
"eslint-plugin-vue": "^9.0.0",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "^3.0.0",
|
||||
"sass": "~1.32",
|
||||
"start-server-and-test": "^1.14.0",
|
||||
"typescript": "^4.5.5",
|
||||
"unplugin-vue-components": "^0.22.0",
|
||||
"vite": "^3.0.0",
|
||||
"unplugin-vue-components": "^0.22.12",
|
||||
"vite": "^3.2.7",
|
||||
"vite-plugin-checker": "^0.5.0",
|
||||
"vite-plugin-package-version": "^1.0.2",
|
||||
"vite-plugin-pwa": "^0.13.0",
|
||||
"vite-plugin-pwa": "^0.16.4",
|
||||
"vite-plugin-vue2": "^2.0.1",
|
||||
"vue-debounce-decorator": "^1.0.1",
|
||||
"vue-i18n-extract": "^2.0.7",
|
||||
"vue-router": "^3.5.2",
|
||||
"vue-template-compiler": "^2.6.14",
|
||||
"workbox-core": "^6.4.2"
|
||||
"workbox-core": "^7.0.0"
|
||||
},
|
||||
"postcss": {
|
||||
"plugins": {
|
||||
@@ -114,6 +119,6 @@
|
||||
"last 2 edge major versions"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^16 || ^18"
|
||||
"node": "^18 || ^20"
|
||||
}
|
||||
}
|
||||
+63
-41
@@ -1,50 +1,25 @@
|
||||
<style>
|
||||
@import './assets/styles/fonts.css';
|
||||
@import './assets/styles/toastr.css';
|
||||
@import './assets/styles/page.scss';
|
||||
@import './assets/styles/sidebar.scss';
|
||||
@import './assets/styles/utils.scss';
|
||||
@import './assets/styles/updateManager.scss';
|
||||
|
||||
:root {
|
||||
--app-height: 100%;
|
||||
}
|
||||
|
||||
#content {
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-btn:not(.v-btn--outlined).primary {
|
||||
/*noinspection CssUnresolvedCustomProperty*/
|
||||
color: var(--v-btn-text-primary);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<v-app dark :style="cssVars">
|
||||
<template v-if="socketIsConnected && guiIsReady">
|
||||
<the-sidebar></the-sidebar>
|
||||
<the-topbar></the-topbar>
|
||||
|
||||
<the-sidebar />
|
||||
<the-topbar />
|
||||
<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>
|
||||
<router-view />
|
||||
</v-container>
|
||||
</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-service-worker />
|
||||
<the-update-dialog />
|
||||
<the-editor />
|
||||
<the-timelapse-rendering-snackbar />
|
||||
<the-fullscreen-upload />
|
||||
<the-upload-snackbar />
|
||||
<the-manual-probe-dialog />
|
||||
<the-bed-screws-dialog />
|
||||
<the-screws-tilt-adjust-dialog />
|
||||
</template>
|
||||
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'"></the-select-printer-dialog>
|
||||
<the-connecting-dialog v-else></the-connecting-dialog>
|
||||
<the-select-printer-dialog v-else-if="instancesDB !== 'moonraker'" />
|
||||
<the-connecting-dialog v-else />
|
||||
</v-app>
|
||||
</template>
|
||||
|
||||
@@ -104,13 +79,27 @@ export default class App extends Mixins(BaseMixin) {
|
||||
return this.$store.getters['files/getMainBackground']
|
||||
}
|
||||
|
||||
get naviDrawer(): boolean {
|
||||
return this.$store.state.naviDrawer
|
||||
}
|
||||
|
||||
get navigationStyle() {
|
||||
return this.$store.state.gui.uiSettings.navigationStyle
|
||||
}
|
||||
|
||||
get mainStyle() {
|
||||
let style = ''
|
||||
let style: any = {
|
||||
paddingLeft: '0',
|
||||
}
|
||||
|
||||
if (this.mainBackground !== null) {
|
||||
style = 'background-image: url(' + this.mainBackground + ');'
|
||||
style.backgroundImage = 'url(' + this.mainBackground + ')'
|
||||
}
|
||||
|
||||
// overwrite padding left for the sidebar
|
||||
if (this.naviDrawer && this.navigationStyle === 'iconsAndText') style.paddingLeft = '220px'
|
||||
if (this.naviDrawer && this.navigationStyle === 'iconsOnly') style.paddingLeft = '56px'
|
||||
|
||||
return style
|
||||
}
|
||||
|
||||
@@ -169,7 +158,7 @@ export default class App extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get print_percent(): number {
|
||||
return Math.round(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
return Math.floor(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
}
|
||||
|
||||
@Watch('language')
|
||||
@@ -194,8 +183,9 @@ export default class App extends Mixins(BaseMixin) {
|
||||
|
||||
@Watch('current_file')
|
||||
current_fileChanged(newVal: string): void {
|
||||
if (newVal !== '')
|
||||
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
||||
if (newVal === '') return
|
||||
|
||||
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
||||
}
|
||||
|
||||
@Watch('primaryColor')
|
||||
@@ -287,6 +277,7 @@ export default class App extends Mixins(BaseMixin) {
|
||||
@Watch('print_percent')
|
||||
print_percentChanged(newVal: number): void {
|
||||
this.drawFavicon(newVal)
|
||||
this.refreshSpoolman()
|
||||
}
|
||||
|
||||
@Watch('printerIsPrinting')
|
||||
@@ -294,6 +285,12 @@ export default class App extends Mixins(BaseMixin) {
|
||||
this.drawFavicon(this.print_percent)
|
||||
}
|
||||
|
||||
refreshSpoolman(): void {
|
||||
if (this.moonrakerComponents.includes('spoolman')) {
|
||||
this.$store.dispatch('server/spoolman/refreshActiveSpool', null, { root: true })
|
||||
}
|
||||
}
|
||||
|
||||
appHeight() {
|
||||
this.$nextTick(() => {
|
||||
const doc = document.documentElement
|
||||
@@ -309,3 +306,28 @@ export default class App extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@import './assets/styles/fonts.css';
|
||||
@import './assets/styles/toastr.css';
|
||||
@import './assets/styles/page.scss';
|
||||
@import './assets/styles/sidebar.scss';
|
||||
@import './assets/styles/utils.scss';
|
||||
@import './assets/styles/updateManager.scss';
|
||||
|
||||
:root {
|
||||
--app-height: 100%;
|
||||
}
|
||||
|
||||
#content {
|
||||
background-attachment: fixed;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.v-btn:not(.v-btn--outlined).primary {
|
||||
/*noinspection CssUnresolvedCustomProperty*/
|
||||
color: var(--v-btn-text-primary);
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 100;
|
||||
src: local('Roboto Thin'), local('Roboto-Thin'), url(/fonts/roboto-thin.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto Thin'),
|
||||
local('Roboto-Thin'),
|
||||
url(/fonts/roboto-thin.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -14,7 +17,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 300;
|
||||
src: local('Roboto Light'), local('Roboto-Light'), url(/fonts/roboto-light.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto Light'),
|
||||
local('Roboto-Light'),
|
||||
url(/fonts/roboto-light.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -24,7 +30,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 400;
|
||||
src: local('Roboto'), local('Roboto-Regular'), url(/fonts/roboto-regular.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto'),
|
||||
local('Roboto-Regular'),
|
||||
url(/fonts/roboto-regular.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -34,7 +43,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 500;
|
||||
src: local('Roboto Medium'), local('Roboto-Medium'), url(/fonts/roboto-medium.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto Medium'),
|
||||
local('Roboto-Medium'),
|
||||
url(/fonts/roboto-medium.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -44,7 +56,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 700;
|
||||
src: local('Roboto Bold'), local('Roboto-Bold'), url(/fonts/roboto-bold.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto Bold'),
|
||||
local('Roboto-Bold'),
|
||||
url(/fonts/roboto-bold.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -54,7 +69,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 900;
|
||||
src: local('Roboto Black'), local('Roboto-Black'), url(/fonts/roboto-black.woff2) format('woff2');
|
||||
src:
|
||||
local('Roboto Black'),
|
||||
local('Roboto-Black'),
|
||||
url(/fonts/roboto-black.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -64,7 +82,10 @@
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
font-weight: 400;
|
||||
src: local('Roboto Mono'), local('Roboto-Mono'), url(/fonts/robotoMono-regular.woff) format('woff');
|
||||
src:
|
||||
local('Roboto Mono'),
|
||||
local('Roboto-Mono'),
|
||||
url(/fonts/robotoMono-regular.woff) format('woff');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC,
|
||||
U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
@@ -239,27 +239,35 @@ export default class TheEditor extends Mixins(BaseMixin) {
|
||||
if (!this.isWriteable) return null
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return null
|
||||
|
||||
// check for generic services <service>.conf (like moonraker.conf, crowsnest.conf, sonar.conf)
|
||||
if (this.availableServices.includes(this.filenameWithoutExtension) && this.fileExtension === 'conf')
|
||||
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'
|
||||
|
||||
// old webcam service DEPRECATED
|
||||
if (this.filename.startsWith('webcam') && ['conf', 'txt'].includes(this.fileExtension)) return 'webcamd'
|
||||
|
||||
// check for mooncord config files
|
||||
if (this.filename.startsWith('mooncord') && this.fileExtension === 'json') return 'mooncord'
|
||||
|
||||
// fallback for moonraker with multi instances
|
||||
if (this.filename === 'moonraker.conf') return 'moonraker'
|
||||
|
||||
// all .cfg files will be klipper config files
|
||||
if (this.fileExtension === 'cfg') return 'klipper'
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get restartServiceNameExists() {
|
||||
if (this.restartServiceName) return true
|
||||
// hide the button, if there is no service found
|
||||
if (this.restartServiceName === null) return false
|
||||
|
||||
// klipper and moonraker uses specific api calls instead of generic service restart
|
||||
if (['klipper', 'moonraker'].includes(this.restartServiceName)) return true
|
||||
|
||||
return this.availableServices.includes(this.restartServiceName)
|
||||
}
|
||||
|
||||
get moonrakerRestartInstance() {
|
||||
return this.$store.state.gui.editor.moonrakerRestartInstance
|
||||
}
|
||||
|
||||
get confirmUnsavedChanges() {
|
||||
return this.$store.state.gui.editor.confirmUnsavedChanges ?? false
|
||||
}
|
||||
|
||||
@@ -116,8 +116,14 @@ export default class TheFullscreenUpload extends Mixins(BaseMixin) {
|
||||
z-index: 99999;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
transition: visibility 200ms, opacity 200ms;
|
||||
font: bold 42px Oswald, DejaVu Sans, Tahoma, sans-serif;
|
||||
transition:
|
||||
visibility 200ms,
|
||||
opacity 200ms;
|
||||
font:
|
||||
bold 42px Oswald,
|
||||
DejaVu Sans,
|
||||
Tahoma,
|
||||
sans-serif;
|
||||
}
|
||||
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<v-dialog v-model="showDialog" persistent max-width="400" class="mx-0">
|
||||
<panel
|
||||
:title="$t('App.TheServiceWorker.TitleNeedUpdate')"
|
||||
card-class="service-worker-dialog"
|
||||
:margin-bottom="false">
|
||||
<v-card-text>
|
||||
<p>{{ $t('App.TheServiceWorker.DescriptionNeedUpdate') }}</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn text color="primary" @click="update">{{ $t('App.TheServiceWorker.Update') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class TheServiceWorker extends Mixins(BaseMixin) {
|
||||
showDialog = false
|
||||
updateSW: ((reloadPage?: boolean | undefined) => Promise<void>) | null = null
|
||||
|
||||
onOfflineReady() {
|
||||
window.console.info('PWA is offline ready')
|
||||
}
|
||||
|
||||
onNeedRefresh() {
|
||||
window.console.warn('PWA needs to refresh')
|
||||
this.showDialog = true
|
||||
}
|
||||
|
||||
onRegistered() {
|
||||
window.console.debug('PWA is registered')
|
||||
}
|
||||
|
||||
onRegisterError(error: any) {
|
||||
window.console.error('PWA registration error:', error)
|
||||
}
|
||||
|
||||
update() {
|
||||
this.updateSW?.(true)
|
||||
this.showDialog = false
|
||||
}
|
||||
|
||||
async mounted() {
|
||||
const { registerSW } = await import('virtual:pwa-register')
|
||||
this.updateSW = registerSW({
|
||||
immediate: true,
|
||||
onOfflineReady: this.onOfflineReady,
|
||||
onNeedRefresh: this.onNeedRefresh,
|
||||
onRegistered: this.onRegistered,
|
||||
onRegisterError: this.onRegisterError,
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -55,7 +55,7 @@
|
||||
ref="settingsScroll"
|
||||
:class="'settings-tabs ' + (isMobile ? '' : 'height500')"
|
||||
:options="{ overflowBehavior: { x: 'hidden' } }">
|
||||
<component :is="'settings-' + activeTab + '-tab'" @scrollToTop="scrollToTop"></component>
|
||||
<component :is="'settings-' + activeTab + '-tab'" @scrollToTop="scrollToTop" />
|
||||
</overlay-scrollbars>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -80,6 +80,7 @@ import SettingsDashboardTab from '@/components/settings/SettingsDashboardTab.vue
|
||||
import SettingsGCodeViewerTab from '@/components/settings/SettingsGCodeViewerTab.vue'
|
||||
import SettingsEditorTab from '@/components/settings/SettingsEditorTab.vue'
|
||||
import SettingsTimelapseTab from '@/components/settings/SettingsTimelapseTab.vue'
|
||||
import SettingsNavigationTab from '@/components/settings/SettingsNavigationTab.vue'
|
||||
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import {
|
||||
@@ -98,6 +99,7 @@ import {
|
||||
mdiVideo3d,
|
||||
mdiWebcam,
|
||||
mdiDipSwitch,
|
||||
mdiMenu,
|
||||
} from '@mdi/js'
|
||||
import SettingsMiscellaneousTab from '@/components/settings/SettingsMiscellaneousTab.vue'
|
||||
@Component({
|
||||
@@ -116,6 +118,7 @@ import SettingsMiscellaneousTab from '@/components/settings/SettingsMiscellaneou
|
||||
SettingsEditorTab,
|
||||
SettingsTimelapseTab,
|
||||
SettingsMiscellaneousTab,
|
||||
SettingsNavigationTab,
|
||||
},
|
||||
})
|
||||
export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
||||
@@ -194,6 +197,11 @@ export default class TheSettingsMenu extends Mixins(BaseMixin) {
|
||||
name: 'miscellaneous',
|
||||
title: this.$t('Settings.MiscellaneousTab.Miscellaneous'),
|
||||
},
|
||||
{
|
||||
icon: mdiMenu,
|
||||
name: 'navigation',
|
||||
title: this.$t('Settings.NavigationTab.Navigation'),
|
||||
},
|
||||
]
|
||||
|
||||
if (this.moonrakerComponents.includes('timelapse')) {
|
||||
|
||||
+44
-154
@@ -1,46 +1,3 @@
|
||||
<style>
|
||||
.nav-logo {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.small-list-item {
|
||||
height: var(--sidebar-menu-item-height);
|
||||
}
|
||||
|
||||
.no-text-decoration {
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.no-background:before {
|
||||
background-color: rgba(255, 255, 255, 0) !important;
|
||||
}
|
||||
|
||||
.no-border {
|
||||
border: 0 !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
.active-nav-item {
|
||||
border-right: 4px solid var(--v-primary-base);
|
||||
}
|
||||
|
||||
.menu-item-icon {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.menu-item-title {
|
||||
line-height: 30px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.nav-scrollbar {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<v-navigation-drawer
|
||||
:key="navigationStyle"
|
||||
@@ -59,78 +16,27 @@
|
||||
v-if="isMobile"
|
||||
router
|
||||
to="/"
|
||||
:class="
|
||||
'sidebar-logo no-text-decoration no-background no-border ' +
|
||||
(navigationStyle === 'iconsOnly' ? 'pa-0 justify-center' : '')
|
||||
"
|
||||
:class="mobileLogoClass"
|
||||
:style="'height: ' + topbarHeight + 'px'"
|
||||
:ripple="false">
|
||||
<template v-if="sidebarLogo">
|
||||
<img :src="sidebarLogo" :style="logoCssVars" class="nav-logo" alt="Logo" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<mainsail-logo
|
||||
:color="logoColor"
|
||||
:style="logoCssVars"
|
||||
class="nav-logo"
|
||||
:ripple="false"></mainsail-logo>
|
||||
<mainsail-logo :color="logoColor" :style="logoCssVars" class="nav-logo" :ripple="false" />
|
||||
</template>
|
||||
<template v-if="navigationStyle !== 'iconsOnly'">
|
||||
<span class="text-h6 font-weight-regular text-truncate">{{ printerName }}</span>
|
||||
</template>
|
||||
</v-list-item>
|
||||
<template v-if="countPrinters">
|
||||
<v-tooltip right :open-delay="500" :disabled="navigationStyle !== 'iconsOnly'">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-list-item
|
||||
router
|
||||
to="/allPrinters"
|
||||
class="small-list-item mt-1"
|
||||
v-bind="attrs"
|
||||
v-on="on">
|
||||
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
|
||||
<v-icon>{{ mdiViewDashboardOutline }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title tile class="menu-item-title">
|
||||
{{ $t('App.Printers') }}
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<span>{{ $t('App.Printers') }}</span>
|
||||
</v-tooltip>
|
||||
<v-divider class="my-1"></v-divider>
|
||||
</template>
|
||||
<div v-for="(category, index) in naviPoints" :key="index">
|
||||
<v-tooltip right :open-delay="500" :disabled="navigationStyle !== 'iconsOnly'">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-list-item
|
||||
router
|
||||
:to="category.path"
|
||||
class="small-list-item"
|
||||
v-bind="attrs"
|
||||
v-on="on">
|
||||
<v-list-item-icon class="my-3 mr-3 menu-item-icon">
|
||||
<v-icon>{{ category.icon }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title tile class="menu-item-title">
|
||||
{{ $t(`Router.${category.title}`) }}
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</template>
|
||||
<span>{{ $t(`Router.${category.title}`) }}</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
<sidebar-item v-for="(category, index) in visibleNaviPoints" :key="index" :item="category" />
|
||||
</v-list-item-group>
|
||||
</v-list>
|
||||
</overlay-scrollbars>
|
||||
<template #append>
|
||||
<v-list-item class="small-list-item mb-2">
|
||||
<v-list-item-icon class="menu-item-icon">
|
||||
<about-dialog></about-dialog>
|
||||
<about-dialog />
|
||||
</v-list-item-icon>
|
||||
</v-list-item>
|
||||
</template>
|
||||
@@ -139,37 +45,32 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import routes, { AppRoute } from '@/routes'
|
||||
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 AboutDialog from '@/components/dialogs/AboutDialog.vue'
|
||||
import { navigationWidth, topbarHeight } from '@/store/variables'
|
||||
import MainsailLogo from '@/components/ui/MainsailLogo.vue'
|
||||
import { mdiViewDashboardOutline } from '@mdi/js'
|
||||
import SidebarItem from '@/components/ui/SidebarItem.vue'
|
||||
import NavigationMixin from '@/components/mixins/navigation'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
SidebarItem,
|
||||
TheSelectPrinterDialog,
|
||||
AboutDialog,
|
||||
MainsailLogo,
|
||||
},
|
||||
})
|
||||
export default class TheSidebar extends Mixins(BaseMixin) {
|
||||
export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
|
||||
navigationWidth = navigationWidth
|
||||
topbarHeight = topbarHeight
|
||||
|
||||
/**
|
||||
* Icons
|
||||
*/
|
||||
mdiViewDashboardOutline = mdiViewDashboardOutline
|
||||
|
||||
get naviDrawer(): boolean {
|
||||
return this.$store.state.naviDrawer
|
||||
}
|
||||
|
||||
set naviDrawer(newVal: boolean) {
|
||||
set naviDrawer(newVal) {
|
||||
this.$store.dispatch('setNaviDrawer', newVal)
|
||||
}
|
||||
|
||||
@@ -181,45 +82,12 @@ export default class TheSidebar extends Mixins(BaseMixin) {
|
||||
return this.$store.getters['files/getSidebarBackground']
|
||||
}
|
||||
|
||||
get naviPoints(): AppRoute[] {
|
||||
return routes.filter((element) => {
|
||||
return element.showInNavi && this.showInNavi(element)
|
||||
})
|
||||
}
|
||||
|
||||
get klippy_state(): string {
|
||||
return this.$store.state.server.klippy_state
|
||||
}
|
||||
|
||||
get boolNaviWebcam(): boolean {
|
||||
return this.$store.state.gui.uiSettings.boolWebcamNavi
|
||||
}
|
||||
|
||||
get moonrakerComponents(): string[] {
|
||||
return this.$store.state.server.components
|
||||
}
|
||||
|
||||
get registeredDirectories(): string[] {
|
||||
return this.$store.state.server.registered_directories
|
||||
}
|
||||
|
||||
get klipperConfigfileSettings(): PrinterStateKlipperConfig[] {
|
||||
return this.$store.state.printer.configfile?.settings ?? {}
|
||||
}
|
||||
|
||||
get currentPage(): string {
|
||||
return this.$route.fullPath
|
||||
}
|
||||
|
||||
get countPrinters() {
|
||||
return this.$store.getters['farm/countPrinters']
|
||||
}
|
||||
|
||||
get boolNaviTemp(): boolean {
|
||||
if (!this.isMobile && this.$vuetify.breakpoint.mdAndDown) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
return !this.isMobile && this.$vuetify.breakpoint.mdAndDown
|
||||
}
|
||||
|
||||
get sidebarCssVars(): any {
|
||||
@@ -255,20 +123,42 @@ export default class TheSidebar extends Mixins(BaseMixin) {
|
||||
return {}
|
||||
}
|
||||
|
||||
showInNavi(route: AppRoute): boolean {
|
||||
if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) return false
|
||||
else if (route.title === 'Webcam' && !this.boolNaviWebcam) return false
|
||||
else if (route.moonrakerComponent && !this.moonrakerComponents.includes(route.moonrakerComponent)) return false
|
||||
else if (route.registeredDirectory && !this.registeredDirectories.includes(route.registeredDirectory))
|
||||
return false
|
||||
else if (route.klipperComponent && !(route.klipperComponent in this.klipperConfigfileSettings)) return false
|
||||
else if (route.klipperIsConnected && !this.klippyIsConnected) return false
|
||||
get mobileLogoClass() {
|
||||
const output = ['sidebar-logo', 'no-text-decoration', 'no-background', 'no-border']
|
||||
|
||||
return true
|
||||
}
|
||||
if (this.navigationStyle === 'iconsOnly') {
|
||||
output.push('pa-0')
|
||||
output.push('justify-center')
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
||||
return output
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.no-text-decoration {
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.no-background:before {
|
||||
background-color: rgba(255, 255, 255, 0) !important;
|
||||
}
|
||||
|
||||
.no-border {
|
||||
border: 0 !important;
|
||||
}
|
||||
|
||||
.nav-logo {
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
.menu-item-icon {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.nav-scrollbar {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -238,7 +238,9 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get powerDevices() {
|
||||
return this.$store.getters['server/power/getDevices']
|
||||
const devices = this.$store.getters['server/power/getDevices'] ?? []
|
||||
|
||||
return devices.filter((device: ServerPowerStateDevice) => !device.device.startsWith('_'))
|
||||
}
|
||||
|
||||
get service_states() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-app-bar app elevate-on-scroll :height="topbarHeight" class="topbar pa-0" clipped-left>
|
||||
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer"></v-app-bar-nav-icon>
|
||||
<v-app-bar-nav-icon tile @click.stop="naviDrawer = !naviDrawer" />
|
||||
<router-link to="/">
|
||||
<template v-if="sidebarLogo">
|
||||
<img
|
||||
@@ -17,12 +17,12 @@
|
||||
class="nav-logo ml-4 mr-1 d-none d-sm-flex"
|
||||
router
|
||||
to="/"
|
||||
:ripple="false"></mainsail-logo>
|
||||
:ripple="false" />
|
||||
</template>
|
||||
</router-link>
|
||||
<v-toolbar-title class="text-no-wrap ml-0 pl-2 mr-2">{{ printerName }}</v-toolbar-title>
|
||||
<printer-selector v-if="countPrinters"></printer-selector>
|
||||
<v-spacer></v-spacer>
|
||||
<printer-selector v-if="countPrinters" />
|
||||
<v-spacer />
|
||||
<input
|
||||
ref="fileUploadAndStart"
|
||||
type="file"
|
||||
@@ -66,9 +66,9 @@
|
||||
<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>
|
||||
<the-settings-menu></the-settings-menu>
|
||||
<the-top-corner-menu></the-top-corner-menu>
|
||||
<the-notification-menu />
|
||||
<the-settings-menu />
|
||||
<the-top-corner-menu />
|
||||
</v-app-bar>
|
||||
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
|
||||
<strong>{{ $t('App.TopBar.Uploading') }} {{ uploadSnackbar.filename }}</strong>
|
||||
@@ -84,7 +84,7 @@
|
||||
</v-snackbar>
|
||||
<v-dialog v-model="showEmergencyStopDialog" width="400" :fullscreen="isMobile">
|
||||
<panel
|
||||
:title="$t('EmergencyStopDialog.EmergencyStop').toString()"
|
||||
:title="$t('EmergencyStopDialog.EmergencyStop')"
|
||||
toolbar-color="error"
|
||||
card-class="emergency-stop-dialog"
|
||||
:icon="mdiAlertOctagonOutline"
|
||||
@@ -96,7 +96,7 @@
|
||||
</template>
|
||||
<v-card-text>{{ $t('EmergencyStopDialog.AreYouSure') }}</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-spacer />
|
||||
<v-btn text @click="showEmergencyStopDialog = false">{{ $t('EmergencyStopDialog.No') }}</v-btn>
|
||||
<v-btn color="primary" text @click="emergencyStop">{{ $t('EmergencyStopDialog.Yes') }}</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -245,13 +245,34 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
)
|
||||
}
|
||||
|
||||
get defaultNavigationStateSetting() {
|
||||
return this.$store.state.gui?.uiSettings?.defaultNavigationStateSetting ?? 'alwaysOpen'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
//this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
||||
switch (this.defaultNavigationStateSetting) {
|
||||
case 'alwaysClosed':
|
||||
this.naviDrawer = false
|
||||
break
|
||||
|
||||
case 'lastState':
|
||||
this.naviDrawer = (localStorage.getItem('naviDrawer') ?? 'true') === 'true'
|
||||
break
|
||||
|
||||
default:
|
||||
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
|
||||
}
|
||||
}
|
||||
|
||||
btnEmergencyStop() {
|
||||
const confirmOnEmergencyStop = this.$store.state.gui.uiSettings.confirmOnEmergencyStop
|
||||
if (confirmOnEmergencyStop) {
|
||||
this.showEmergencyStopDialog = true
|
||||
} else {
|
||||
this.emergencyStop()
|
||||
return
|
||||
}
|
||||
|
||||
this.emergencyStop()
|
||||
}
|
||||
|
||||
emergencyStop() {
|
||||
@@ -342,14 +363,13 @@ export default class TheTopbar extends Mixins(BaseMixin) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped>
|
||||
/*noinspection CssUnusedSymbol*/
|
||||
.topbar .v-toolbar__content {
|
||||
::v-deep .topbar .v-toolbar__content {
|
||||
padding-top: 0 !important;
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
|
||||
.button-min-width-auto {
|
||||
min-width: auto !important;
|
||||
}
|
||||
|
||||
@@ -161,10 +161,14 @@ export default class TheUpdateDialog extends Mixins(BaseMixin) {
|
||||
this.complete &&
|
||||
['client', 'mainsail', 'full'].includes(this.application.toLowerCase())
|
||||
)
|
||||
window.location.reload(true)
|
||||
window.location.reload()
|
||||
else {
|
||||
this.$store.commit('server/updateManager/resetUpdateResponse')
|
||||
this.$socket.emit('machine.update.status', { refresh: false }, { action: 'server/updateManager/getStatus' })
|
||||
this.$socket.emit(
|
||||
'machine.update.status',
|
||||
{ refresh: false },
|
||||
{ action: 'server/updateManager/onUpdateStatus' }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+128
-145
@@ -5,7 +5,8 @@
|
||||
:option="chartOptions"
|
||||
:init-options="{ renderer: 'svg' }"
|
||||
:autoresize="true"
|
||||
style="height: 250px; width: 100%"></e-chart>
|
||||
:style="tempchartStyle"
|
||||
class="tempchart" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -13,11 +14,12 @@ import { convertName } from '@/plugins/helpers'
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import { PrinterTempHistoryStateSerie, PrinterTempHistoryStateSourceEntry } from '@/store/printer/tempHistory/types'
|
||||
import { PrinterTempHistoryStateSourceEntry } from '@/store/printer/tempHistory/types'
|
||||
|
||||
import type { ECharts } from 'echarts/core'
|
||||
import type { ECBasicOption } from 'echarts/types/dist/shared.d'
|
||||
import { mdiClock } from '@mdi/js'
|
||||
import { datasetTypesInPercents } from '@/store/variables'
|
||||
|
||||
interface echartsTooltipObj {
|
||||
[key: string]: any
|
||||
@@ -32,11 +34,48 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
private isVisible = true
|
||||
public chartOptions: ECBasicOption = {
|
||||
darkMode: true,
|
||||
renderer: 'svg',
|
||||
animation: false,
|
||||
tooltip: {
|
||||
get chartOptions(): ECBasicOption {
|
||||
return {
|
||||
darkMode: true,
|
||||
renderer: 'svg',
|
||||
animation: false,
|
||||
tooltip: this.tooltip,
|
||||
grid: {
|
||||
top: 35,
|
||||
right: this.gridRight,
|
||||
bottom: 30,
|
||||
left: 25,
|
||||
},
|
||||
legend: {
|
||||
animation: false,
|
||||
show: false,
|
||||
selected: this.selectedLegends,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
splitNumber: 5,
|
||||
minInterval: 60 * 1000,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.06)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
margin: 10,
|
||||
formatter: this.timeFormat,
|
||||
},
|
||||
},
|
||||
yAxis: this.yAxis,
|
||||
media: this.media,
|
||||
dataset: { source: this.source },
|
||||
series: this.series,
|
||||
}
|
||||
}
|
||||
|
||||
get tooltip() {
|
||||
return {
|
||||
animation: false,
|
||||
trigger: 'axis',
|
||||
backgroundColor: 'rgba(0,0,0,0.9)',
|
||||
@@ -56,38 +95,11 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5
|
||||
return obj
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: 35,
|
||||
right: 15,
|
||||
bottom: 30,
|
||||
left: 25,
|
||||
},
|
||||
legend: {
|
||||
animation: false,
|
||||
show: false,
|
||||
selected: {},
|
||||
},
|
||||
/*dataZoom: [{
|
||||
type: 'inside',
|
||||
}],*/
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
splitNumber: 5,
|
||||
minInterval: 60 * 1000,
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: 'rgba(255, 255, 255, 0.06)',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: 'rgba(255, 255, 255, 0.24)',
|
||||
margin: 10,
|
||||
formatter: this.timeFormat,
|
||||
},
|
||||
},
|
||||
yAxis: [
|
||||
}
|
||||
}
|
||||
|
||||
get yAxis() {
|
||||
return [
|
||||
{
|
||||
name: this.$t('Panels.TemperaturePanel.TemperaturesInChart'),
|
||||
type: 'value',
|
||||
@@ -157,15 +169,18 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
media: [
|
||||
]
|
||||
}
|
||||
|
||||
get media() {
|
||||
return [
|
||||
{
|
||||
query: {
|
||||
minWidth: 500,
|
||||
},
|
||||
option: {
|
||||
grid: {
|
||||
right: 15,
|
||||
right: this.optionGridRight,
|
||||
left: 40,
|
||||
},
|
||||
yAxis: [
|
||||
@@ -187,11 +202,7 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
dataset: {
|
||||
source: [],
|
||||
},
|
||||
series: [],
|
||||
]
|
||||
}
|
||||
|
||||
get chart(): ECharts | null {
|
||||
@@ -230,9 +241,24 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
return this.hours12Format ? '{hh}:{mm}' : '{HH}:{mm}'
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.initChart()
|
||||
this.chartOptions.xAxis.axisLabel.formatter = this.timeFormat
|
||||
get tempchartHeight() {
|
||||
return this.$store.state.gui.uiSettings.tempchartHeight ?? 250
|
||||
}
|
||||
|
||||
get tempchartStyle() {
|
||||
return {
|
||||
height: this.tempchartHeight + 'px',
|
||||
}
|
||||
}
|
||||
|
||||
get gridRight() {
|
||||
return this.boolDisplayPwmAxis ? 25 : 15
|
||||
}
|
||||
|
||||
get optionGridRight() {
|
||||
if (this.boolDisplayPwmAxis) return 35
|
||||
|
||||
return 15
|
||||
}
|
||||
|
||||
beforeDestroy() {
|
||||
@@ -240,75 +266,17 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
if (this.chart) this.chart.dispose()
|
||||
}
|
||||
|
||||
initChart() {
|
||||
this.chartOptions.series = this.series
|
||||
this.chartOptions.legend.selected = this.selectedLegends
|
||||
this.updateChartPwmAxis()
|
||||
}
|
||||
|
||||
updateChart() {
|
||||
if (this.chart && this.isVisible) {
|
||||
//const t0 = performance.now()
|
||||
const limitDate = new Date(Date.now() - this.maxHistory * 1000)
|
||||
let newSource = [...this.source].filter((entry: PrinterTempHistoryStateSourceEntry) => {
|
||||
return entry.date >= limitDate
|
||||
})
|
||||
|
||||
this.chart?.setOption(
|
||||
{
|
||||
dataset: {
|
||||
source: newSource,
|
||||
},
|
||||
},
|
||||
false,
|
||||
true
|
||||
)
|
||||
|
||||
//const t1 = performance.now()
|
||||
//window.console.debug('calc chart', (t1-t0).toFixed(), newSource.length, this.source.length)
|
||||
|
||||
// reset tempHistory if working sources are smaller than 80%
|
||||
if (this.source.length > 0 && newSource.length < this.maxHistory * 0.8) {
|
||||
this.$socket.emit('server.temperature_store', {}, { action: 'printer/tempHistory/init' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateChartPwmAxis() {
|
||||
if (this.boolDisplayPwmAxis) {
|
||||
this.chartOptions.yAxis[1].show = true
|
||||
this.chartOptions.grid.right = 25
|
||||
this.chartOptions.media[0].option.grid.right = 35
|
||||
} else {
|
||||
this.chartOptions.yAxis[1].show = false
|
||||
this.chartOptions.grid.right = 15
|
||||
this.chartOptions.media[0].option.grid.right = 15
|
||||
}
|
||||
}
|
||||
|
||||
visibilityChanged(isVisible: boolean) {
|
||||
this.isVisible = isVisible
|
||||
|
||||
if (isVisible) {
|
||||
this.initChart()
|
||||
}
|
||||
}
|
||||
|
||||
tooltipFormatter(datasets: any) {
|
||||
let output = ''
|
||||
|
||||
const mainDatasets = datasets.filter((dataset: any) => {
|
||||
if (dataset.seriesName === 'date') return false
|
||||
|
||||
const lastIndex = dataset.seriesName.lastIndexOf('-')
|
||||
if (lastIndex === -1) return true
|
||||
|
||||
const suffix = dataset.seriesName.slice(lastIndex + 1)
|
||||
return !['target', 'power', 'speed'].includes(suffix)
|
||||
})
|
||||
const mainDatasets = datasets.filter((dataset: any) => dataset.seriesName.endsWith('-temperature'))
|
||||
if (datasets.length) {
|
||||
let outputTime = datasets[0]['axisValueLabel']
|
||||
outputTime = outputTime.substr(outputTime.indexOf(' '))
|
||||
outputTime = outputTime.substring(outputTime.indexOf(' '))
|
||||
|
||||
output +=
|
||||
'<div class="row">' +
|
||||
@@ -327,24 +295,43 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
mainDatasets.forEach((dataset: any) => {
|
||||
const baseSeriesName = dataset.seriesName.substring(0, dataset.seriesName.lastIndexOf('-'))
|
||||
let displayName = baseSeriesName
|
||||
if (displayName.indexOf(' ') !== -1) {
|
||||
displayName = displayName.substring(displayName.indexOf(' ') + 1)
|
||||
}
|
||||
|
||||
output += '<div class="row">'
|
||||
|
||||
output += '<div class="col-auto py-0">'
|
||||
output += dataset.marker
|
||||
output += "<span class='ml-2'>" + convertName(dataset.seriesName) + ':</span>'
|
||||
output += "<span class='ml-2'>" + convertName(displayName) + ':</span>'
|
||||
output += '</div>'
|
||||
|
||||
output += '<div class="col text-right py-0 font-weight-bold">'
|
||||
|
||||
if (dataset.seriesName in dataset.value) output += dataset.value[dataset.seriesName].toFixed(1)
|
||||
if (dataset.seriesName + '-target' in dataset.value)
|
||||
output += ' / ' + dataset.value[dataset.seriesName + '-target'].toFixed(1)
|
||||
const seriesNameTemperature = `${baseSeriesName}-temperature`
|
||||
const seriesNameTarget = `${baseSeriesName}-target`
|
||||
|
||||
if (seriesNameTemperature in dataset.value) {
|
||||
const value = dataset.value[seriesNameTemperature]
|
||||
output += value !== null ? value.toFixed(1) : '--'
|
||||
}
|
||||
if (seriesNameTarget in dataset.value) {
|
||||
output += ' / '
|
||||
const value = dataset.value[seriesNameTemperature]
|
||||
output += value !== null ? value.toFixed(1) : '--'
|
||||
}
|
||||
output += '°C'
|
||||
|
||||
if (dataset.seriesName + '-power' in dataset.value)
|
||||
output += ' [ ' + (dataset.value[dataset.seriesName + '-power'] * 100).toFixed(0) + '% ]'
|
||||
if (dataset.seriesName + '-speed' in dataset.value)
|
||||
output += ' [ ' + (dataset.value[dataset.seriesName + '-speed'] * 100).toFixed(0) + '% ]'
|
||||
datasetTypesInPercents.forEach((attrKey) => {
|
||||
const seriesName = `${baseSeriesName}-${attrKey}`
|
||||
if (!(seriesName in dataset.value)) return
|
||||
|
||||
let value = dataset.value[seriesName]
|
||||
value = value !== null ? (dataset.value[seriesName] * 100).toFixed(0) : '--'
|
||||
output += ` [ ${value}% ]`
|
||||
})
|
||||
|
||||
output += '</div>'
|
||||
output += '</div>'
|
||||
@@ -353,26 +340,6 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
return output
|
||||
}
|
||||
|
||||
@Watch('series', { deep: true })
|
||||
seriesChanged(newVal: PrinterTempHistoryStateSerie[]) {
|
||||
if (this.chart && this.chart?.isDisposed() !== true) {
|
||||
this.chart.setOption(
|
||||
{
|
||||
series: newVal,
|
||||
},
|
||||
false,
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('source')
|
||||
sourceChanged() {
|
||||
if (this.chart?.isDisposed() !== true) {
|
||||
this.updateChart()
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('selectedLegends')
|
||||
selectedLegendsChanged(newVal: any, oldVal: any) {
|
||||
if (this.chart?.isDisposed() !== true) {
|
||||
@@ -385,14 +352,30 @@ export default class TempChart extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('boolDisplayPwmAxis')
|
||||
boolDisplayPwmAxisChanged() {
|
||||
this.updateChartPwmAxis()
|
||||
}
|
||||
@Watch('source')
|
||||
sourceChanged(newVal: PrinterTempHistoryStateSourceEntry[]) {
|
||||
// break if chart isn't initialized or not visible
|
||||
if (!this.chart || !this.isVisible) return
|
||||
|
||||
@Watch('hours12Format')
|
||||
hours12FormatChanged() {
|
||||
this.chartOptions.xAxis.axisLabel.formatter = this.timeFormat
|
||||
const limitDate = new Date(Date.now() - this.maxHistory * 1000)
|
||||
let newSource = newVal.filter((entry: PrinterTempHistoryStateSourceEntry) => {
|
||||
return entry.date >= limitDate
|
||||
})
|
||||
|
||||
// reset tempHistory if working sources are smaller than 80%
|
||||
if (newVal.length > 0 && newSource.length < this.maxHistory * 0.8) {
|
||||
this.$socket.emit(
|
||||
'server.temperature_store',
|
||||
{ include_monitors: true },
|
||||
{ action: 'printer/tempHistory/init' }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tempchart {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog v-model="showDialog" width="800" persistent :fullscreen="isMobile">
|
||||
<panel
|
||||
:title="$t('Panels.SpoolmanPanel.ChangeSpool')"
|
||||
:icon="mdiAdjust"
|
||||
card-class="spoolman-change-spool-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="close">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-title>
|
||||
<v-text-field
|
||||
v-model="search"
|
||||
:append-icon="mdiMagnify"
|
||||
:label="$t('Panels.SpoolmanPanel.Search')"
|
||||
outlined
|
||||
dense
|
||||
hide-details
|
||||
style="max-width: 300px" />
|
||||
<v-spacer />
|
||||
<v-btn
|
||||
:title="$t('Panels.SpoolmanPanel.Refresh')"
|
||||
class="px-2 minwidth-0 ml-3"
|
||||
:loading="loadings.includes('refreshSpools')"
|
||||
@click="refreshSpools">
|
||||
<v-icon>{{ mdiRefresh }}</v-icon>
|
||||
</v-btn>
|
||||
<v-btn
|
||||
:title="$t('Panels.SpoolmanPanel.OpenSpoolManager')"
|
||||
class="px-2 minwidth-0 ml-3"
|
||||
@click="openSpoolManager">
|
||||
<v-icon>{{ mdiDatabase }}</v-icon>
|
||||
</v-btn>
|
||||
</v-card-title>
|
||||
<v-card-text class="px-0 pb-0">
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="spools"
|
||||
item-key="id"
|
||||
:search="search"
|
||||
sort-by="last_used"
|
||||
:sort-desc="true"
|
||||
:custom-filter="customFilter">
|
||||
<template #no-data>
|
||||
<div class="text-center">{{ $t('Panels.SpoolmanPanel.NoSpools') }}</div>
|
||||
</template>
|
||||
<template #no-results>
|
||||
<div class="text-center">{{ $t('Panels.SpoolmanPanel.NoResults') }}</div>
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<SpoolmanChangeSpoolDialogRow :key="item.id" :spool="item" @set-spool="setSpool" />
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiCloseThick, mdiAdjust, mdiDatabase, mdiMagnify, mdiRefresh } from '@mdi/js'
|
||||
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||
import SpoolmanChangeSpoolDialogRow from '@/components/dialogs/SpoolmanChangeSpoolDialogRow.vue'
|
||||
@Component({
|
||||
components: { SpoolmanChangeSpoolDialogRow, Panel },
|
||||
})
|
||||
export default class SpoolmanChangeSpoolDialog extends Mixins(BaseMixin) {
|
||||
mdiAdjust = mdiAdjust
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiDatabase = mdiDatabase
|
||||
mdiMagnify = mdiMagnify
|
||||
mdiRefresh = mdiRefresh
|
||||
|
||||
@Prop({ required: true }) declare readonly showDialog: boolean
|
||||
|
||||
search = ''
|
||||
|
||||
get spools(): ServerSpoolmanStateSpool[] {
|
||||
return this.$store.state.server.spoolman.spools ?? []
|
||||
}
|
||||
|
||||
get headers() {
|
||||
return [
|
||||
{
|
||||
text: ' ',
|
||||
align: 'start',
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
text: this.$t('Panels.SpoolmanPanel.Filament'),
|
||||
align: 'start',
|
||||
value: 'filament.name',
|
||||
sortable: false,
|
||||
},
|
||||
{
|
||||
text: this.$t('Panels.SpoolmanPanel.Material'),
|
||||
align: 'center',
|
||||
value: 'filament.material',
|
||||
},
|
||||
{
|
||||
text: this.$t('Panels.SpoolmanPanel.LastUsed'),
|
||||
align: 'end',
|
||||
value: 'last_used',
|
||||
},
|
||||
{
|
||||
text: this.$t('Panels.SpoolmanPanel.Weight'),
|
||||
align: 'end',
|
||||
value: 'remaining_weight',
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
get spoolManagerUrl() {
|
||||
return this.$store.state.server.config.config?.spoolman?.server ?? null
|
||||
}
|
||||
|
||||
openSpoolManager() {
|
||||
window.open(this.spoolManagerUrl, '_blank')
|
||||
}
|
||||
|
||||
mounted() {
|
||||
this.refresh()
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.$store.dispatch('server/spoolman/refreshSpools')
|
||||
}
|
||||
|
||||
close() {
|
||||
this.$emit('close')
|
||||
}
|
||||
|
||||
refreshSpools() {
|
||||
this.$store.dispatch('server/spoolman/refreshSpools')
|
||||
}
|
||||
|
||||
customFilter(value: any, search: string, item: ServerSpoolmanStateSpool): boolean {
|
||||
const querySplits = search.toLowerCase().split(' ')
|
||||
const searchArray = [
|
||||
item.comment,
|
||||
item.filament.name,
|
||||
item.filament.vendor.name,
|
||||
item.filament.material,
|
||||
item.location,
|
||||
]
|
||||
|
||||
for (const query of querySplits) {
|
||||
const result = searchArray.some((q) => q?.toLowerCase().includes(query))
|
||||
|
||||
if (!result) return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
setSpool(spool: ServerSpoolmanStateSpool) {
|
||||
this.$store.dispatch('server/spoolman/setActiveSpool', spool.id)
|
||||
this.close()
|
||||
}
|
||||
|
||||
@Watch('showDialog')
|
||||
onShowDialogChanged(newVal: boolean) {
|
||||
if (newVal) this.search = ''
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<tr class="cursor-pointer" @click="setSpoolRow">
|
||||
<td style="width: 50px" class="pr-0 py-2">
|
||||
<spool-icon :color="color" style="width: 50px; float: left" class="mr-3" />
|
||||
</td>
|
||||
<td class="py-2" style="min-width: 300px">
|
||||
<strong class="text-no-wrap">{{ vendor }} - {{ name }}</strong>
|
||||
<template v-if="location">
|
||||
<br />
|
||||
{{ $t('Panels.SpoolmanPanel.Location') }}: {{ location }}
|
||||
</template>
|
||||
<template v-if="spool.comment">
|
||||
<br />
|
||||
{{ spool.comment }}
|
||||
</template>
|
||||
</td>
|
||||
<td class="text-center text-no-wrap">{{ material }}</td>
|
||||
<td class="text-right text-no-wrap">{{ last_used }}</td>
|
||||
<td class="text-right text-no-wrap">
|
||||
<strong>{{ remaining_weight_format }}</strong>
|
||||
<small class="ml-1">/ {{ total_weight_format }}</small>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||
@Component({})
|
||||
export default class SpoolmanChangeSpoolDialogRow extends Mixins(BaseMixin) {
|
||||
@Prop({ required: true }) declare readonly spool: ServerSpoolmanStateSpool
|
||||
get color() {
|
||||
const color = this.spool.filament?.color_hex ?? '000'
|
||||
|
||||
return `#${color}`
|
||||
}
|
||||
|
||||
get vendor() {
|
||||
return this.spool.filament?.vendor?.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this.spool.filament?.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get location() {
|
||||
return this.spool.location
|
||||
}
|
||||
|
||||
get material() {
|
||||
return this.spool.filament?.material ?? '--'
|
||||
}
|
||||
|
||||
get remaining_weight() {
|
||||
return this.spool.remaining_weight ?? 0
|
||||
}
|
||||
|
||||
get total_weight() {
|
||||
return this.spool.filament?.weight ?? 0
|
||||
}
|
||||
|
||||
get remaining_weight_format() {
|
||||
return `${this.remaining_weight.toFixed(0)}g`
|
||||
}
|
||||
|
||||
get total_weight_format() {
|
||||
if (this.total_weight < 1000) {
|
||||
return `${this.total_weight.toFixed(0)}g`
|
||||
}
|
||||
|
||||
let totalRound = Math.round(this.total_weight / 1000)
|
||||
if (totalRound !== this.total_weight / 1000) {
|
||||
totalRound = Math.round(this.total_weight / 100) / 10
|
||||
}
|
||||
|
||||
return `${totalRound}kg`
|
||||
}
|
||||
|
||||
get last_used() {
|
||||
const last_used = this.spool.last_used ?? null
|
||||
if (!last_used) return this.$t('Panels.SpoolmanPanel.Never')
|
||||
|
||||
const date = new Date(this.spool.last_used)
|
||||
const now = new Date()
|
||||
const diff = now.getTime() - date.getTime()
|
||||
|
||||
if (diff <= 1000 * 60 * 60 * 24) return this.$t('Panels.SpoolmanPanel.Today')
|
||||
if (diff <= 1000 * 60 * 60 * 24 * 2) return this.$t('Panels.SpoolmanPanel.Yesterday')
|
||||
if (diff <= 1000 * 60 * 60 * 24 * 14) {
|
||||
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
|
||||
|
||||
return this.$t('Panels.SpoolmanPanel.DaysAgo', { days })
|
||||
}
|
||||
|
||||
return date.toLocaleDateString()
|
||||
}
|
||||
|
||||
setSpoolRow() {
|
||||
this.$emit('set-spool', this.spool)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<v-dialog v-model="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||
<panel
|
||||
:title="$t('Panels.SpoolmanPanel.EjectSpool')"
|
||||
:icon="mdiEject"
|
||||
card-class="spoolman-eject-spool-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="close">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p class="body-2">{{ $t('Panels.SpoolmanPanel.EjectSpoolQuestion') }}</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn text @click="close">{{ $t('Panels.SpoolmanPanel.Cancel') }}</v-btn>
|
||||
<v-btn color="primary" text @click="removeSpool">
|
||||
{{ $t('Panels.SpoolmanPanel.EjectSpool') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiCloseThick, mdiEject } from '@mdi/js'
|
||||
@Component({
|
||||
components: { Panel },
|
||||
})
|
||||
export default class SpoolmanEjectSpoolDialog extends Mixins(BaseMixin) {
|
||||
mdiEject = mdiEject
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
@Prop({ required: true }) declare readonly showDialog: boolean
|
||||
|
||||
close() {
|
||||
this.$emit('close')
|
||||
}
|
||||
|
||||
removeSpool() {
|
||||
this.$store.dispatch('server/spoolman/setActiveSpool', 0)
|
||||
this.close()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,23 +1,26 @@
|
||||
<template>
|
||||
<v-dialog v-model="bool" :max-width="dialogWidth">
|
||||
<v-dialog v-model="bool" :max-width="dialogWidth" @click:outside="closeDialog" @keydown.esc="closeDialog">
|
||||
<v-card>
|
||||
<v-img v-if="file.big_thumbnail" contain :src="file.big_thumbnail"></v-img>
|
||||
<v-card-title class="headline">{{ $t('Dialogs.StartPrint.Headline') }}</v-card-title>
|
||||
<v-img v-if="file.big_thumbnail" contain :src="file.big_thumbnail" :style="bigThumbnailStyle" />
|
||||
<v-card-title class="text-h5">{{ $t('Dialogs.StartPrint.Headline') }}</v-card-title>
|
||||
<v-card-text class="pb-0">
|
||||
{{ $t('Dialogs.StartPrint.DoYouWantToStartFilename', { filename: file.filename }) }}
|
||||
<p class="body-2">
|
||||
{{ question }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<start-print-dialog-spoolman v-if="moonrakerComponents.includes('spoolman')" :file="file" />
|
||||
<template v-if="moonrakerComponents.includes('timelapse')">
|
||||
<v-divider class="mt-3 mb-2"></v-divider>
|
||||
<v-card-text class="pb-0">
|
||||
<v-divider v-if="!moonrakerComponents.includes('spoolman')" class="mt-3 mb-2" />
|
||||
<v-card-text class="py-0">
|
||||
<settings-row :title="$t('Dialogs.StartPrint.Timelapse')">
|
||||
<v-switch v-model="timelapseEnabled" hide-details class="mt-0"></v-switch>
|
||||
<v-switch v-model="timelapseEnabled" hide-details class="mt-0" />
|
||||
</settings-row>
|
||||
</v-card-text>
|
||||
<v-divider class="mt-2 mb-0"></v-divider>
|
||||
<v-divider class="mt-2 mb-0" />
|
||||
</template>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="closeDialog">{{ $t('Dialogs.StartPrint.Cancel') }}</v-btn>
|
||||
<v-spacer />
|
||||
<v-btn text @click="closeDialog">{{ $t('Dialogs.StartPrint.Cancel') }}</v-btn>
|
||||
<v-btn
|
||||
color="primary"
|
||||
text
|
||||
@@ -35,6 +38,9 @@ import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { FileStateGcodefile } from '@/store/files/types'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import { mdiPrinter3d } from '@mdi/js'
|
||||
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||
import { defaultBigThumbnailBackground } from '@/store/variables'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
@@ -42,6 +48,8 @@ import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
},
|
||||
})
|
||||
export default class StartPrintDialog extends Mixins(BaseMixin) {
|
||||
mdiPrinter3d = mdiPrinter3d
|
||||
|
||||
@Prop({ required: true, default: false })
|
||||
declare readonly bool: boolean
|
||||
|
||||
@@ -67,6 +75,43 @@ export default class StartPrintDialog extends Mixins(BaseMixin) {
|
||||
return this.file.big_thumbnail_width ?? 400
|
||||
}
|
||||
|
||||
get bigThumbnailBackground() {
|
||||
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||
}
|
||||
|
||||
get bigThumbnailStyle() {
|
||||
if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
|
||||
return {}
|
||||
}
|
||||
|
||||
return { backgroundColor: this.bigThumbnailBackground }
|
||||
}
|
||||
|
||||
get active_spool(): ServerSpoolmanStateSpool | null {
|
||||
return this.$store.state.server.spoolman.active_spool ?? null
|
||||
}
|
||||
|
||||
get filamentVendor() {
|
||||
return this.active_spool?.filament?.vendor?.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get filamentName() {
|
||||
return this.active_spool?.filament.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get filament() {
|
||||
return `${this.filamentVendor} - ${this.filamentName}`
|
||||
}
|
||||
|
||||
get question() {
|
||||
if (this.active_spool)
|
||||
return this.$t('Dialogs.StartPrint.DoYouWantToStartFilenameFilament', {
|
||||
filename: this.file?.filename ?? 'unknown',
|
||||
})
|
||||
|
||||
return this.$t('Dialogs.StartPrint.DoYouWantToStartFilename', { filename: this.file?.filename ?? 'unknown' })
|
||||
}
|
||||
|
||||
startPrint(filename = '') {
|
||||
filename = (this.currentPath + '/' + filename).substring(1)
|
||||
this.closeDialog()
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-divider class="mt-3 mb-0" />
|
||||
<v-card-text class="py-0 px-2">
|
||||
<spoolman-panel-active-spool
|
||||
v-if="activeSpoolId !== null"
|
||||
:small="true"
|
||||
class="my-0"
|
||||
@change-spool="showChangeSpoolDialog = true" />
|
||||
<v-alert v-for="alert in alerts" :key="alert.text" text :color="alert.color" class="mt-4 mx-3">
|
||||
{{ alert.text }}
|
||||
</v-alert>
|
||||
<div class="text-center">
|
||||
<v-btn color="primary" small class="mx-auto" @click="showChangeSpoolDialog = true">
|
||||
{{ buttonText }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-card-text>
|
||||
<v-divider :class="classSecondDivider" />
|
||||
<spoolman-change-spool-dialog :show-dialog="showChangeSpoolDialog" @close="showChangeSpoolDialog = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import SpoolmanPanelActiveSpool from '@/components/panels/Spoolman/SpoolmanPanelActiveSpool.vue'
|
||||
import { FileStateGcodefile } from '@/store/files/types'
|
||||
|
||||
@Component({
|
||||
components: { SpoolmanPanelActiveSpool },
|
||||
})
|
||||
export default class StartPrintDialogSpoolman extends Mixins(BaseMixin) {
|
||||
@Prop({ required: true }) readonly file!: FileStateGcodefile
|
||||
|
||||
showChangeSpoolDialog = false
|
||||
|
||||
get activeSpoolId() {
|
||||
let spoolId = this.$store.state.server.spoolman?.active_spool_id ?? null
|
||||
if (spoolId === 0) spoolId = null
|
||||
|
||||
return spoolId
|
||||
}
|
||||
|
||||
get activeSpool() {
|
||||
return this.$store.state.server.spoolman?.active_spool ?? null
|
||||
}
|
||||
|
||||
get classSecondDivider() {
|
||||
const classes = ['mt-4']
|
||||
|
||||
classes.push(this.moonrakerComponents.includes('timelapse') ? 'mb-2' : 'mb-0')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get buttonText() {
|
||||
if (this.activeSpoolId === null) return this.$t('Panels.SpoolmanPanel.SelectSpool') as string
|
||||
|
||||
return this.$t('Panels.SpoolmanPanel.ChangeSpool') as string
|
||||
}
|
||||
|
||||
get alerts() {
|
||||
let alerts = []
|
||||
|
||||
if (this.activeSpoolId === null) {
|
||||
alerts.push({
|
||||
text: this.$t('Panels.SpoolmanPanel.NoSpoolSelected'),
|
||||
color: 'orange',
|
||||
})
|
||||
|
||||
// No need to check for filament type mismatch if no spool is selected
|
||||
return alerts
|
||||
}
|
||||
|
||||
const gcodeFilamentType = this.file.filament_type ?? ''
|
||||
if (
|
||||
gcodeFilamentType !== '' &&
|
||||
this.activeSpool?.filament?.material?.toLowerCase() !== gcodeFilamentType.toLowerCase()
|
||||
) {
|
||||
alerts.push({
|
||||
text: this.$t('Panels.SpoolmanPanel.FilamentTypeMismatch', {
|
||||
fileType: gcodeFilamentType,
|
||||
spoolType: this.activeSpool?.filament?.material,
|
||||
}),
|
||||
color: 'warning',
|
||||
})
|
||||
}
|
||||
|
||||
const fileWeight = Math.round(this.file.filament_weight_total ?? 0)
|
||||
const spoolWeight = Math.round(this.activeSpool?.remaining_weight ?? 0)
|
||||
if (spoolWeight < fileWeight) {
|
||||
alerts.push({
|
||||
text: this.$t('Panels.SpoolmanPanel.TooLessFilament', {
|
||||
fileWeight,
|
||||
spoolWeight,
|
||||
}),
|
||||
color: 'warning',
|
||||
})
|
||||
}
|
||||
|
||||
return alerts
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -83,11 +83,17 @@ export default class TheBedScrewsDialog extends Mixins(BaseMixin, ControlMixin)
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
get showDialog() {
|
||||
if (!this.boolBedScrewsDialog) return false
|
||||
|
||||
const is_active = this.$store.state.printer.bed_screws?.is_active ?? false
|
||||
|
||||
return is_active && this.homedAxes.includes('xyz')
|
||||
}
|
||||
|
||||
get boolBedScrewsDialog() {
|
||||
return this.$store.state.gui.uiSettings.boolBedScrewsDialog ?? true
|
||||
}
|
||||
|
||||
get config() {
|
||||
return this.$store.state.printer.configfile?.settings?.bed_screws ?? {}
|
||||
}
|
||||
|
||||
@@ -120,9 +120,15 @@ export default class TheManualProbeDialog extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
get showDialog() {
|
||||
if (!this.boolManualProbeDialog) return false
|
||||
|
||||
return this.$store.state.printer.manual_probe?.is_active ?? false
|
||||
}
|
||||
|
||||
get boolManualProbeDialog() {
|
||||
return this.$store.state.gui.uiSettings.boolManualProbeDialog ?? true
|
||||
}
|
||||
|
||||
get offsetsZ() {
|
||||
const offsets = [1, 0.1, 0.05, 0.01, 0.005]
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<v-dialog :value="showDialog" width="400" persistent :fullscreen="isMobile">
|
||||
<panel
|
||||
:title="$t('ScrewsTiltAdjust.Headline').toString()"
|
||||
:title="$t('ScrewsTiltAdjust.Headline')"
|
||||
:icon="mdiArrowCollapseDown"
|
||||
card-class="manual_probe-dialog"
|
||||
:margin-bottom="false"
|
||||
@@ -22,11 +22,17 @@
|
||||
<v-card-text v-if="Object.keys(results).length">
|
||||
<template v-for="(result, name, index) of results">
|
||||
<v-divider v-if="index" :key="`result-divider-${name}`" class="my-1" />
|
||||
<the-screws-tilt-adjust-dialog-entry :key="`result-${name}`" :name="name" :result="result" />
|
||||
<the-screws-tilt-adjust-dialog-entry
|
||||
:key="`result-${name}-${name}`"
|
||||
:name="name.toString()"
|
||||
:result="result" />
|
||||
</template>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-spacer />
|
||||
<v-btn text @click="retryScrewsTiltAdjust">
|
||||
{{ $t('ScrewsTiltAdjust.Retry') }}
|
||||
</v-btn>
|
||||
<v-btn color="primary" text @click="clearScrewsTiltAdjust">
|
||||
{{ $t('ScrewsTiltAdjust.Accept') }}
|
||||
</v-btn>
|
||||
@@ -50,20 +56,45 @@ import TheScrewsTiltAdjustDialogEntry from '@/components/dialogs/TheScrewsTiltAd
|
||||
export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiArrowCollapseDown = mdiArrowCollapseDown
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
get state() {
|
||||
return this.$store.state.printer.screws_tilt_adjust ?? {}
|
||||
}
|
||||
|
||||
get error() {
|
||||
return this.state.error ?? false
|
||||
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
|
||||
}
|
||||
|
||||
get max_deviation() {
|
||||
return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null
|
||||
}
|
||||
|
||||
get results() {
|
||||
return this.state.results ?? {}
|
||||
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
|
||||
}
|
||||
|
||||
get showDialog() {
|
||||
// don't display the dialog, if the user disabled it in the UI settings
|
||||
if (!this.boolScrewsTiltAdjustDialog) return false
|
||||
|
||||
// don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command
|
||||
if (this.max_deviation !== null) return false
|
||||
|
||||
return this.error || Object.keys(this.results).length
|
||||
}
|
||||
|
||||
get boolScrewsTiltAdjustDialog() {
|
||||
return this.$store.state.gui.uiSettings.boolScrewsTiltAdjustDialog ?? true
|
||||
}
|
||||
|
||||
clearScrewsTiltAdjust() {
|
||||
this.$store.dispatch('printer/clearScrewsTiltAdjust')
|
||||
}
|
||||
|
||||
async retryScrewsTiltAdjust() {
|
||||
await this.$store.dispatch('printer/clearScrewsTiltAdjust')
|
||||
|
||||
this.doSend('SCREWS_TILT_CALCULATE')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -436,10 +436,23 @@ export default class Viewer extends Mixins(BaseMixin) {
|
||||
return this.$store.state.printer.print_stats?.filename ?? ''
|
||||
}
|
||||
|
||||
get currentPosition() {
|
||||
get livePosition() {
|
||||
return this.$store.state.printer.motion_report?.live_position ?? [0, 0, 0, 0]
|
||||
}
|
||||
|
||||
get gcodeOffset() {
|
||||
return this.$store.state.printer?.gcode_move?.homing_origin ?? [0, 0, 0]
|
||||
}
|
||||
|
||||
get currentPosition() {
|
||||
return [
|
||||
this.livePosition[0] - this.gcodeOffset[0],
|
||||
this.livePosition[1] - this.gcodeOffset[1],
|
||||
this.livePosition[2] - this.gcodeOffset[2],
|
||||
this.livePosition[3],
|
||||
]
|
||||
}
|
||||
|
||||
get showTrackingButton() {
|
||||
return this.printerIsPrinting && this.sdCardFilePath === this.loadedFile
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<v-col class="pl-6">
|
||||
<template v-if="selectAll">
|
||||
<v-checkbox
|
||||
v-model="selectAllModel"
|
||||
:label="$t('Settings.GeneralTab.Everything')"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
:indeterminate="selectAllIndeterminate"
|
||||
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
|
||||
<v-divider class="my-2" />
|
||||
</template>
|
||||
<template v-for="option in options">
|
||||
<v-checkbox
|
||||
:key="option.value"
|
||||
v-model="selectedCheckboxes"
|
||||
:label="option.label"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
:value="option.value"
|
||||
@change="$emit('update:selectedCheckboxes', selectedCheckboxes)"></v-checkbox>
|
||||
</template>
|
||||
</v-col>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '../mixins/base'
|
||||
import { computed } from 'vue'
|
||||
import { TranslateResult } from 'vue-i18n'
|
||||
|
||||
@Component
|
||||
export default class CheckboxList extends Mixins(BaseMixin) {
|
||||
@Prop({ required: true })
|
||||
declare readonly options: { label: string | TranslateResult; value: string }[]
|
||||
|
||||
@Prop({ type: Boolean, required: false, default: false })
|
||||
declare readonly selectAll: boolean
|
||||
|
||||
selectedCheckboxes: (string | TranslateResult)[] = []
|
||||
selectAllIndeterminate: boolean = false
|
||||
selectAllModel = computed<boolean>({
|
||||
get: this.getSelectAll,
|
||||
set: this.setSelectAll,
|
||||
})
|
||||
|
||||
getSelectAll(): boolean {
|
||||
this.selectAllIndeterminate = false
|
||||
if (0 < this.selectedCheckboxes.length && this.selectedCheckboxes.length < this.options.length) {
|
||||
this.selectAllIndeterminate = true
|
||||
return false
|
||||
}
|
||||
|
||||
return this.selectedCheckboxes.length == this.options.length
|
||||
}
|
||||
|
||||
setSelectAll(state: boolean) {
|
||||
if (state) {
|
||||
this.selectedCheckboxes = this.options.map((o) => o.value)
|
||||
return
|
||||
}
|
||||
|
||||
this.selectedCheckboxes = []
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -12,13 +12,14 @@ import BaseMixin from '../mixins/base'
|
||||
import { basicSetup } from 'codemirror'
|
||||
import { EditorView, keymap } from '@codemirror/view'
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import { mainsailTheme } from '@/plugins/codemirrorTheme'
|
||||
import { vscodeDark } from '@uiw/codemirror-theme-vscode'
|
||||
import { StreamLanguage } from '@codemirror/language'
|
||||
import { klipper_config } from '@/plugins/StreamParserKlipperConfig'
|
||||
import { gcode } from '@/plugins/StreamParserGcode'
|
||||
import { indentWithTab } from '@codemirror/commands'
|
||||
import { json } from '@codemirror/lang-json'
|
||||
import { css } from '@codemirror/lang-css'
|
||||
import { indentUnit } from '@codemirror/language'
|
||||
|
||||
@Component
|
||||
export default class Codemirror extends Mixins(BaseMixin) {
|
||||
@@ -81,8 +82,10 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
||||
|
||||
get cmExtensions() {
|
||||
const extensions = [
|
||||
EditorView.theme({}, { dark: true }),
|
||||
basicSetup,
|
||||
mainsailTheme,
|
||||
vscodeDark,
|
||||
indentUnit.of(' '.repeat(this.tabSize)),
|
||||
keymap.of([indentWithTab]),
|
||||
EditorView.updateListener.of((update) => {
|
||||
this.content = update.state?.doc.toString()
|
||||
@@ -103,5 +106,9 @@ export default class Codemirror extends Mixins(BaseMixin) {
|
||||
visibilityChanged(isVisible: boolean) {
|
||||
if (isVisible) this.cminstance?.focus()
|
||||
}
|
||||
|
||||
get tabSize() {
|
||||
return this.$store.state.gui.editor.tabSize || 2
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -59,7 +59,7 @@
|
||||
<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">
|
||||
<panel :title="macro.name" :card-class="`macro-params-mobile-${macro.name}`" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="paramsDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
@@ -101,6 +101,8 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import { GuiMacrosStateMacrogroupMacro } from '@/store/gui/macros/types'
|
||||
import { mdiCloseThick, mdiMenuDown, mdiRefresh } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { TranslateResult } from 'vue-i18n'
|
||||
import { PrinterStateMacro } from '@/store/printer/types'
|
||||
|
||||
interface param {
|
||||
type: 'int' | 'double' | 'string' | null
|
||||
@@ -128,13 +130,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
||||
private paramsDialog = false
|
||||
|
||||
@Prop({ required: true })
|
||||
declare readonly macro: GuiMacrosStateMacrogroupMacro
|
||||
declare readonly macro: GuiMacrosStateMacrogroupMacro | PrinterStateMacro
|
||||
|
||||
@Prop({ default: 'primary' })
|
||||
declare readonly color: string
|
||||
|
||||
@Prop({ default: null })
|
||||
declare readonly alias: string
|
||||
declare readonly alias: string | TranslateResult
|
||||
|
||||
@Prop({ default: false })
|
||||
declare readonly disabled: boolean
|
||||
@@ -199,9 +201,13 @@ export default class MacroButton extends Mixins(BaseMixin) {
|
||||
sendWithParams() {
|
||||
let params: string[] = []
|
||||
this.paramArray.forEach((paramname: string) => {
|
||||
if (this.params[paramname].value !== null && this.params[paramname].value !== '') {
|
||||
let value = this.params[paramname].value?.toString().trim()
|
||||
|
||||
if (this.params[paramname].value !== null && value !== '') {
|
||||
let tmp: string = paramname
|
||||
tmp += this.isGcodeStyle ? this.params[paramname].value : `=${this.params[paramname].value}`
|
||||
if (value?.includes(' ')) value = `"${value}"`
|
||||
|
||||
tmp += this.isGcodeStyle ? value : `=${value}`
|
||||
|
||||
params.push(tmp)
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</template>
|
||||
|
||||
<template #append>
|
||||
<v-icon :disabled="isLocked || sliderValue >= max" @click="increment">{{ mdiPlus }}</v-icon>
|
||||
<v-icon :disabled="isLocked || sliderValue >= 1" @click="increment">{{ mdiPlus }}</v-icon>
|
||||
</template>
|
||||
</v-slider>
|
||||
</v-card-text>
|
||||
|
||||
@@ -53,6 +53,7 @@ import Component from 'vue-class-component'
|
||||
import { Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiChevronDown, mdiChevronUp, mdiRestart } from '@mdi/js'
|
||||
import { TranslateResult } from 'vue-i18n'
|
||||
|
||||
@Component
|
||||
export default class NumberInput extends Mixins(BaseMixin) {
|
||||
@@ -65,48 +66,23 @@ export default class NumberInput extends Mixins(BaseMixin) {
|
||||
private invalidChars: string[] = ['e', 'E', '+']
|
||||
|
||||
// input field name and identifier
|
||||
@Prop({ type: String, required: true })
|
||||
declare readonly label: string
|
||||
|
||||
@Prop({ type: String, required: true })
|
||||
declare readonly param: string
|
||||
|
||||
@Prop({ required: true }) declare readonly label: TranslateResult | string
|
||||
@Prop({ type: String, required: true }) declare readonly param: string
|
||||
// props defining incoming data
|
||||
@Prop({ type: Number, required: true })
|
||||
declare readonly target: number
|
||||
|
||||
@Prop({ type: Number, required: false })
|
||||
declare readonly defaultValue: number
|
||||
|
||||
@Prop({ type: Number, required: true }) declare readonly target: number
|
||||
@Prop({ type: Number, required: false }) declare readonly defaultValue: number
|
||||
// props for internal processing
|
||||
@Prop({ type: Number, required: true })
|
||||
declare readonly min: number
|
||||
|
||||
@Prop({ type: Number, default: null })
|
||||
declare readonly max: number | null
|
||||
|
||||
@Prop({ type: Number, required: true })
|
||||
declare readonly dec: number
|
||||
|
||||
@Prop({ type: Number, required: false, default: 1 })
|
||||
declare readonly step: number
|
||||
|
||||
@Prop({ type: String, required: false })
|
||||
declare readonly unit: string
|
||||
|
||||
@Prop({ type: Number, required: true }) declare readonly min: number
|
||||
@Prop({ default: null }) declare readonly max: number | null
|
||||
@Prop({ type: Number, required: true }) declare readonly dec: number
|
||||
@Prop({ type: Number, required: false, default: 1 }) declare readonly step: number
|
||||
@Prop({ type: String, required: false }) declare readonly unit: string
|
||||
// spinner related props
|
||||
@Prop({ type: Boolean, required: false, default: false })
|
||||
declare readonly hasSpinner: boolean
|
||||
|
||||
@Prop({ type: Number, required: false, default: 1 })
|
||||
declare readonly spinnerFactor: number
|
||||
|
||||
@Prop({ type: Boolean, required: false, default: false }) declare readonly hasSpinner: boolean
|
||||
@Prop({ type: Number, required: false, default: 1 }) declare readonly spinnerFactor: number
|
||||
// props for general internal behaviour
|
||||
@Prop({ type: Boolean, required: false, default: false })
|
||||
declare readonly disabled: boolean
|
||||
|
||||
@Prop({ type: Boolean, required: false, default: false })
|
||||
declare readonly outputErrorMsg: boolean
|
||||
@Prop({ type: Boolean, required: false, default: false }) declare readonly disabled: boolean
|
||||
@Prop({ type: Boolean, required: false, default: false }) declare readonly outputErrorMsg: boolean
|
||||
|
||||
created(): void {
|
||||
this.value = this.target.toString()
|
||||
|
||||
@@ -85,6 +85,7 @@ import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiLockOpenVariantOutline, mdiLockOutline, mdiMinus, mdiPlus, mdiRestart } from '@mdi/js'
|
||||
import { TranslateResult } from 'vue-i18n'
|
||||
|
||||
@Component
|
||||
export default class ToolSlider extends Mixins(BaseMixin) {
|
||||
@@ -107,7 +108,7 @@ export default class ToolSlider extends Mixins(BaseMixin) {
|
||||
@Prop({ type: Number, required: true }) declare readonly target: number
|
||||
@Prop({ type: String, required: true }) declare readonly command: string
|
||||
@Prop({ type: String, default: '' }) declare readonly attributeName: string
|
||||
@Prop({ type: String, default: '' }) declare readonly label: string
|
||||
@Prop({ default: '' }) declare readonly label: string | TranslateResult
|
||||
@Prop({ type: String, default: '' }) declare readonly icon: string
|
||||
@Prop({ type: String, default: '%' }) declare readonly unit: string
|
||||
@Prop({ type: Number, default: 1 }) declare readonly attributeScale: number
|
||||
|
||||
@@ -47,6 +47,10 @@ export default class BaseMixin extends Vue {
|
||||
return this.klipperReadyForGui && ['printing', 'paused'].includes(this.printer_state)
|
||||
}
|
||||
|
||||
get printerIsPrintingOnly() {
|
||||
return this.klipperReadyForGui && this.printer_state === 'printing'
|
||||
}
|
||||
|
||||
get printerPowerDevice(): string {
|
||||
let deviceName = this.$store.state.gui.uiSettings.powerDeviceName ?? null
|
||||
if (deviceName === null) deviceName = 'printer'
|
||||
@@ -175,13 +179,13 @@ export default class BaseMixin extends Vue {
|
||||
}
|
||||
|
||||
get browserLocale() {
|
||||
return navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.language
|
||||
return 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
|
||||
if (setting === null && this.browserLocale === 'en-US') return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import Vue from 'vue'
|
||||
import { Component } from 'vue-property-decorator'
|
||||
@Component
|
||||
export default class ExtruderMixin extends Vue {
|
||||
get activeExtruder(): string {
|
||||
return this.$store.state.printer.toolhead?.extruder
|
||||
}
|
||||
|
||||
get activeExtruderSettings(): any {
|
||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]
|
||||
}
|
||||
|
||||
get filamentDiameter(): number {
|
||||
return this.activeExtruderSettings?.filament_diameter ?? 1.75
|
||||
}
|
||||
|
||||
get nozzleDiameter(): number {
|
||||
return this.activeExtruderSettings?.nozzle_diameter ?? 0.4
|
||||
}
|
||||
|
||||
get feedamount(): number {
|
||||
return parseFloat(this.$store.state.gui.control.extruder.feedamount)
|
||||
}
|
||||
|
||||
get feedrate(): number {
|
||||
return parseFloat(this.$store.state.gui.control.extruder.feedrate)
|
||||
}
|
||||
|
||||
get extrudeFactor() {
|
||||
return this.$store.state.printer?.gcode_move?.extrude_factor ?? 1
|
||||
}
|
||||
|
||||
get extrudePossible(): boolean {
|
||||
return this.$store.getters['printer/getExtrudePossible']
|
||||
}
|
||||
|
||||
get minExtrudeTemp(): number {
|
||||
return this.activeExtruderSettings?.min_extrude_temp ?? 170
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
import Component from 'vue-class-component'
|
||||
import routes, { AppRoute } from '@/routes'
|
||||
import { Mixins, Watch } from 'vue-property-decorator'
|
||||
import { mdiLinkVariant, mdiViewDashboardOutline } from '@mdi/js'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { PrinterStateKlipperConfig } from '@/store/printer/types'
|
||||
import { GuiNavigationStateEntry } from '@/store/gui/navigation/types'
|
||||
|
||||
export interface NaviPoint {
|
||||
type: 'link' | 'route'
|
||||
title: string
|
||||
to?: string
|
||||
href?: string
|
||||
target?: string
|
||||
icon: string
|
||||
position: number
|
||||
visible: boolean
|
||||
}
|
||||
|
||||
@Component
|
||||
export default class NavigationMixin extends Mixins(BaseMixin) {
|
||||
private customNaviLinks: NaviPoint[] = []
|
||||
|
||||
get countPrinters() {
|
||||
return this.$store.getters['farm/countPrinters']
|
||||
}
|
||||
|
||||
get routesNaviPoints(): NaviPoint[] {
|
||||
const points: NaviPoint[] = []
|
||||
|
||||
if (this.countPrinters) {
|
||||
points.push({
|
||||
title: this.$t('App.Printers'),
|
||||
icon: mdiViewDashboardOutline,
|
||||
to: '/allPrinters',
|
||||
position: 0,
|
||||
visible: true,
|
||||
} as NaviPoint)
|
||||
}
|
||||
|
||||
routes
|
||||
.filter((element) => {
|
||||
return element.showInNavi && this.showInNavi(element)
|
||||
})
|
||||
.forEach((element) => {
|
||||
const [position, visible] = this.getUiSettings({
|
||||
type: 'route',
|
||||
title: element.title ?? 'unknown',
|
||||
visible: true,
|
||||
position: element.position ?? 999,
|
||||
})
|
||||
|
||||
points.push({
|
||||
type: 'route',
|
||||
title: this.$t(`Router.${element.title}`),
|
||||
icon: element.icon,
|
||||
to: element.path,
|
||||
position,
|
||||
visible,
|
||||
} as NaviPoint)
|
||||
})
|
||||
|
||||
if (this.customNaviLinks.length) {
|
||||
this.customNaviLinks.forEach((element) => {
|
||||
const [position, visible] = this.getUiSettings({
|
||||
type: 'link',
|
||||
title: element.title ?? 'unknown',
|
||||
visible: element.visible ?? true,
|
||||
position: element.position ?? 999,
|
||||
})
|
||||
|
||||
points.push({
|
||||
type: 'link',
|
||||
title: element.title,
|
||||
icon: element.icon,
|
||||
href: element.href,
|
||||
target: element.target,
|
||||
position,
|
||||
visible,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
return points
|
||||
}
|
||||
|
||||
get naviPoints(): NaviPoint[] {
|
||||
return this.routesNaviPoints.sort((a, b) => a.position - b.position)
|
||||
}
|
||||
|
||||
get visibleNaviPoints(): NaviPoint[] {
|
||||
return this.naviPoints.filter((entry) => entry.visible)
|
||||
}
|
||||
|
||||
get uiSettings(): GuiNavigationStateEntry[] {
|
||||
return this.$store.state.gui.navigation.entries
|
||||
}
|
||||
|
||||
get klippy_state(): string {
|
||||
return this.$store.state.server.klippy_state
|
||||
}
|
||||
|
||||
get boolNaviWebcam(): boolean {
|
||||
return this.$store.state.gui.uiSettings.boolWebcamNavi
|
||||
}
|
||||
|
||||
get moonrakerComponents(): string[] {
|
||||
return this.$store.state.server.components
|
||||
}
|
||||
|
||||
get registeredDirectories(): string[] {
|
||||
return this.$store.state.server.registered_directories
|
||||
}
|
||||
|
||||
get klipperConfigfileSettings(): PrinterStateKlipperConfig[] {
|
||||
return this.$store.state.printer.configfile?.settings ?? {}
|
||||
}
|
||||
|
||||
get sidebarNaviFile(): string {
|
||||
return this.$store.getters['files/getCustomNaviPoints']
|
||||
}
|
||||
|
||||
get webcamCount(): number {
|
||||
return this.$store.getters['gui/webcams/getWebcams'].length
|
||||
}
|
||||
|
||||
@Watch('sidebarNaviFile', { immediate: true })
|
||||
async sidebarNaviFileChanged(newVal: string) {
|
||||
this.customNaviLinks = []
|
||||
|
||||
// stop if no file is set
|
||||
if (!newVal) return
|
||||
|
||||
const content = await fetch(newVal)
|
||||
.then((res) => res.json())
|
||||
.catch((err) => {
|
||||
window.console.error('Unable to parse .theme/navi.json.')
|
||||
throw err
|
||||
})
|
||||
|
||||
content.forEach((item: NaviPoint) => {
|
||||
this.customNaviLinks.push({
|
||||
title: item.title ?? 'Unknown',
|
||||
icon: item.icon ?? mdiLinkVariant,
|
||||
href: item.href ?? '#',
|
||||
target: item.target ?? undefined,
|
||||
position: item.position ?? 999,
|
||||
} as NaviPoint)
|
||||
})
|
||||
}
|
||||
|
||||
showInNavi(route: AppRoute): boolean {
|
||||
if (['shutdown', 'error', 'disconnected'].includes(this.klippy_state) && !route.alwaysShow) return false
|
||||
else if (route.title === 'Webcam' && this.webcamCount === 0) return false
|
||||
else if (route.moonrakerComponent && !this.moonrakerComponents.includes(route.moonrakerComponent)) return false
|
||||
else if (route.registeredDirectory && !this.registeredDirectories.includes(route.registeredDirectory))
|
||||
return false
|
||||
else if (route.klipperComponent && !(route.klipperComponent in this.klipperConfigfileSettings)) return false
|
||||
else if (route.klipperIsConnected && !this.klippyIsConnected) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
getUiSettings(entry: GuiNavigationStateEntry): [number, boolean] {
|
||||
const index = this.uiSettings.findIndex((point) => {
|
||||
return point.title === entry.title && point.type === entry.type
|
||||
})
|
||||
|
||||
if (index === -1) return [entry.position, entry.visible]
|
||||
|
||||
return [this.uiSettings[index].position, this.uiSettings[index].visible]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
import Component from 'vue-class-component'
|
||||
import BaseMixin from './base'
|
||||
import { TranslateResult } from 'vue-i18n'
|
||||
|
||||
@Component
|
||||
export default class SettingsGeneralDatabase extends BaseMixin {
|
||||
get availableKeys() {
|
||||
return [
|
||||
// gui namespace
|
||||
{
|
||||
value: 'general',
|
||||
label: this.$t('Settings.GeneralTab.General'),
|
||||
},
|
||||
{
|
||||
value: 'control',
|
||||
label: this.$t('Settings.ControlTab.Control'),
|
||||
},
|
||||
{
|
||||
value: 'dashboard',
|
||||
label: this.$t('Settings.DashboardTab.Dashboard'),
|
||||
},
|
||||
{
|
||||
value: 'editor',
|
||||
label: this.$t('Settings.EditorTab.Editor'),
|
||||
},
|
||||
{
|
||||
value: 'gcodeViewer',
|
||||
label: this.$t('Settings.GCodeViewerTab.GCodeViewer'),
|
||||
},
|
||||
{
|
||||
value: 'navigation',
|
||||
label: this.$t('Settings.GeneralTab.DBNavigation'),
|
||||
},
|
||||
{
|
||||
value: 'uiSettings',
|
||||
label: this.$t('Settings.UiSettingsTab.UiSettings'),
|
||||
},
|
||||
{
|
||||
value: 'view',
|
||||
label: this.$t('Settings.GeneralTab.DbView'),
|
||||
},
|
||||
|
||||
// gui modules
|
||||
{
|
||||
value: 'console',
|
||||
label: this.$t('Settings.ConsoleTab.Console'),
|
||||
},
|
||||
{
|
||||
value: 'gcodehistory',
|
||||
label: this.$t('Settings.GeneralTab.DbConsoleHistory'),
|
||||
},
|
||||
{
|
||||
value: 'macros',
|
||||
label: this.$t('Settings.MacrosTab.Macros'),
|
||||
},
|
||||
{
|
||||
value: 'notifications',
|
||||
label: this.$t('App.Notifications.Notifications'),
|
||||
},
|
||||
{
|
||||
value: 'presets',
|
||||
label: this.$t('Settings.PresetsTab.PreheatPresets'),
|
||||
},
|
||||
{
|
||||
value: 'remoteprinters',
|
||||
label: this.$t('Settings.RemotePrintersTab.RemotePrinters'),
|
||||
},
|
||||
{
|
||||
value: 'timelapse',
|
||||
label: this.$t('Settings.TimelapseTab.Timelapse'),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
async loadBackupableNamespaces() {
|
||||
// init namespaces
|
||||
let backupableNamespaces: { value: string; label: string | TranslateResult }[] = []
|
||||
|
||||
// load DB namespaces from moonraker
|
||||
const urlRequestDbList = this.$store.getters['socket/getUrl'] + '/server/database/list'
|
||||
const availableNamespaces = await fetch(urlRequestDbList)
|
||||
// read json
|
||||
.then((response) => response?.json())
|
||||
// extract result namespaces
|
||||
.then((response) => response?.result?.namespaces ?? [])
|
||||
.catch(() => {
|
||||
window.console.error('Cannot load Moonraker DB namespaces')
|
||||
return []
|
||||
})
|
||||
|
||||
// load mainsail keys, if mainsail namespace exists
|
||||
if (availableNamespaces.includes('mainsail')) {
|
||||
const urlRequestMainsailNamespace =
|
||||
this.$store.getters['socket/getUrl'] + '/server/database/item?namespace=mainsail'
|
||||
backupableNamespaces = await fetch(urlRequestMainsailNamespace)
|
||||
// read json
|
||||
.then((response) => response?.json())
|
||||
// extract result object
|
||||
.then((response) => response?.result?.value ?? {})
|
||||
// extract keys from mainsail gui object
|
||||
.then((objects) => Object.keys(objects))
|
||||
// filter initVersion
|
||||
.then((keys) => keys.filter((key) => key !== 'initVersion'))
|
||||
// convert to locale
|
||||
.then((keys) =>
|
||||
keys.map((key) => {
|
||||
const namespace = this.availableKeys.find((namespace) => namespace.value === key)
|
||||
if (namespace) return namespace
|
||||
|
||||
// fallback return key name
|
||||
return { value: key, label: key }
|
||||
})
|
||||
)
|
||||
|
||||
backupableNamespaces = backupableNamespaces.sort(this.sortNamespaces)
|
||||
}
|
||||
|
||||
// add timelapse if exists
|
||||
if (availableNamespaces.includes('timelapse')) {
|
||||
backupableNamespaces.push({
|
||||
value: 'timelapse',
|
||||
label: this.$t('Settings.GeneralTab.DbTimelapseSettings'),
|
||||
})
|
||||
}
|
||||
|
||||
// add webcams if exists
|
||||
if (availableNamespaces.includes('webcams')) {
|
||||
backupableNamespaces.push({
|
||||
value: 'webcams',
|
||||
label: this.$t('Settings.WebcamsTab.Webcams'),
|
||||
})
|
||||
}
|
||||
|
||||
return backupableNamespaces
|
||||
}
|
||||
|
||||
sortNamespaces(
|
||||
a: { value: string; label: string | TranslateResult },
|
||||
b: { value: string; label: string | TranslateResult }
|
||||
) {
|
||||
if (a.value === 'general') return -1
|
||||
if (b.value === 'general') return 1
|
||||
|
||||
const stringA = a.label.toString().toLowerCase()
|
||||
const stringB = b.label.toString().toLowerCase()
|
||||
|
||||
if (stringA < stringB) return -1
|
||||
if (stringA > stringB) return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue'
|
||||
import Component from 'vue-class-component'
|
||||
import {
|
||||
mdiAlbum,
|
||||
@@ -10,9 +9,23 @@ import {
|
||||
mdiRaspberryPi,
|
||||
mdiWebcam,
|
||||
} from '@mdi/js'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class WebcamMixin extends Vue {
|
||||
export default class WebcamMixin extends Mixins(BaseMixin) {
|
||||
convertUrl(baseUrl: string, printerUrl: string | null) {
|
||||
let url = new URL(baseUrl, this.hostUrl.toString())
|
||||
|
||||
// use printerURL if it exists
|
||||
if (printerUrl !== null) url = new URL(baseUrl, printerUrl)
|
||||
|
||||
// overwrite url to baseUrl, if it is an absolute URL
|
||||
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
|
||||
|
||||
return decodeURIComponent(url.toString())
|
||||
}
|
||||
|
||||
convertWebcamIcon(iconName: string): string {
|
||||
switch (iconName) {
|
||||
case 'mdiAlbum':
|
||||
@@ -34,4 +47,17 @@ export default class WebcamMixin extends Vue {
|
||||
return mdiWebcam
|
||||
}
|
||||
}
|
||||
|
||||
generateTransform(flip_horizontal: boolean, flip_vertical: boolean, rotation: number) {
|
||||
let transforms = ''
|
||||
if (flip_horizontal) transforms += ' scaleX(-1)'
|
||||
if (flip_vertical) transforms += ' scaleY(-1)'
|
||||
if (rotation === 180) transforms += ' rotate(180deg)'
|
||||
|
||||
// return transform when exist
|
||||
if (transforms.trimStart().length) return transforms.trimStart()
|
||||
|
||||
// return none as fallback
|
||||
return 'none'
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<v-container v-if="showEstimatedExtrusion" class="pa-0 ma-0 pb-1">
|
||||
<div style="font-size: 0.8em" class="text--disabled text-caption font-weight-light d-flex justify-center">
|
||||
<span>
|
||||
{{ $t('Panels.ExtruderControlPanel.EstimatedExtrusion') }} ~ {{ extrudedLength }} mm @
|
||||
{{ volumetricFlow }} mm³/s -
|
||||
<v-icon x-small style="opacity: 0.4; margin-top: -2px">
|
||||
{{ mdiDiameterVariant }}
|
||||
</v-icon>
|
||||
{{ nozzleDiameter }} mm
|
||||
</span>
|
||||
</div>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiDiameterVariant } from '@mdi/js'
|
||||
import ExtruderMixin from '@/components/mixins/extruder'
|
||||
|
||||
@Component({})
|
||||
export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderMixin) {
|
||||
mdiDiameterVariant = mdiDiameterVariant
|
||||
|
||||
get showEstimatedExtrusion() {
|
||||
return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo ?? true
|
||||
}
|
||||
|
||||
get extrudedLength(): number {
|
||||
return Math.round(
|
||||
this.feedamount *
|
||||
this.extrudeFactor *
|
||||
(Math.pow(this.filamentDiameter, 2) / Math.pow(this.nozzleDiameter, 2))
|
||||
)
|
||||
}
|
||||
|
||||
get volumetricFlow(): number {
|
||||
return Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * 10) / 10
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<responsive :breakpoints="{ large: (el) => el.width >= 640 }">
|
||||
<template #default="{ el }">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.FilamentLength')"
|
||||
param="feedamount"
|
||||
:target="feedamount"
|
||||
:disabled="printerIsPrintingOnly"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="100"
|
||||
:step="0.01"
|
||||
:min="0.01"
|
||||
:max="maxExtrudeOnlyDistance"
|
||||
:dec="2"
|
||||
unit="mm"
|
||||
:submit-on-blur="true"
|
||||
@submit="setFeedamount" />
|
||||
<v-item-group class="_btn-group pt-3">
|
||||
<v-btn
|
||||
v-for="value in feedamountsSorted"
|
||||
:key="value"
|
||||
:disabled="printerIsPrintingOnly"
|
||||
dense
|
||||
class="_btn-qs flex-grow-1 px-0"
|
||||
@click="setFeedamount({ value })">
|
||||
{{ value }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFeedrate')"
|
||||
param="feedrate"
|
||||
:target="feedrate"
|
||||
:disabled="printerIsPrintingOnly"
|
||||
:has-spinner="true"
|
||||
:output-error-msg="true"
|
||||
:spinner-factor="100"
|
||||
:step="0.01"
|
||||
:min="0.01"
|
||||
:max="null"
|
||||
:dec="2"
|
||||
type="number"
|
||||
unit="mm/s"
|
||||
@submit="setFeedrate" />
|
||||
<v-item-group class="_btn-group pt-3">
|
||||
<v-btn
|
||||
v-for="value in feedratesSorted"
|
||||
:key="value"
|
||||
:disabled="printerIsPrintingOnly"
|
||||
dense
|
||||
class="_btn-qs flex-grow-1 px-0"
|
||||
@click="setFeedrate({ value })">
|
||||
{{ value }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-col>
|
||||
<!-- EXTRUDE AND RETRACT BUTTON LARGE SIZED PANEL -->
|
||||
<v-col v-if="el.is.large" class="col-3 d-flex align-center flex-column justify-center">
|
||||
<!-- RETRACT -->
|
||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="mb-4" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnRetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendRetract()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<!-- EXTRUDE -->
|
||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnDetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendExtrude()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}: {{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- EXTRUDE AND RETRACT BUTTON SMALL AND MEDIUM SIZED PANEL -->
|
||||
<v-row v-if="!el.is.large">
|
||||
<v-col class="pa-0">
|
||||
<div class="d-flex justify-space-around">
|
||||
<div class="d-flex align-center">
|
||||
<!-- RETRACT -->
|
||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnRetract')"
|
||||
:disabled="
|
||||
!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly
|
||||
"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendRetract()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<!-- EXTRUDE -->
|
||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnDetract')"
|
||||
:disabled="
|
||||
!extrudePossible || tooLargeExtrusion || printerIsPrintingOnly
|
||||
"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendExtrude()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</template>
|
||||
</responsive>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { mdiArrowDownBold, mdiArrowUpBold, mdiPrinter3dNozzle } from '@mdi/js'
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import ToolSlider from '@/components/inputs/ToolSlider.vue'
|
||||
import ExtruderMixin from '@/components/mixins/extruder'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
NumberInput,
|
||||
Responsive,
|
||||
ToolSlider,
|
||||
},
|
||||
})
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ExtruderMixin) {
|
||||
mdiArrowDownBold = mdiArrowDownBold
|
||||
mdiArrowUpBold = mdiArrowUpBold
|
||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||
|
||||
get feedamounts(): number[] {
|
||||
return this.$store.state.gui.control.extruder?.feedamounts ?? []
|
||||
}
|
||||
|
||||
get feedrates(): number[] {
|
||||
return this.$store.state.gui.control.extruder?.feedrates ?? []
|
||||
}
|
||||
|
||||
get feedamountsSorted(): number[] {
|
||||
return [...this.feedamounts].sort((a, b) => {
|
||||
return b - a
|
||||
})
|
||||
}
|
||||
|
||||
get feedratesSorted(): number[] {
|
||||
return [...this.feedrates].sort((a, b) => {
|
||||
return b - a
|
||||
})
|
||||
}
|
||||
|
||||
setFeedamount(params: { value: number }): void {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamount', value: params.value })
|
||||
}
|
||||
|
||||
setFeedrate(params: { value: number }): void {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrate', value: params.value })
|
||||
}
|
||||
|
||||
get maxExtrudeOnlyDistance(): number {
|
||||
return this.activeExtruderSettings?.max_extrude_only_distance ?? 50
|
||||
}
|
||||
|
||||
get tooLargeExtrusion(): boolean {
|
||||
return this.feedamount * this.extrudeFactor > this.maxExtrudeOnlyDistance
|
||||
}
|
||||
|
||||
@Watch('maxExtrudeOnlyDistance', { immediate: true })
|
||||
onMaxExtrudeOnlyDistanceChange(): void {
|
||||
/**
|
||||
* If, while switching from ex. A to ex. B, the feedamount
|
||||
* from ex. an exceeds the maxExtrudeOnlyDistance of ex. B,
|
||||
* set the feedamount to maxExtrudeOnlyDistance of ex. B
|
||||
*/
|
||||
if (this.feedamount > this.maxExtrudeOnlyDistance) {
|
||||
this.setFeedamount({ value: this.maxExtrudeOnlyDistance })
|
||||
}
|
||||
}
|
||||
|
||||
sendRetract(): void {
|
||||
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
|
||||
}
|
||||
|
||||
sendExtrude(): void {
|
||||
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style 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,86 @@
|
||||
<template>
|
||||
<div v-if="toolchangeMacros.length > 1">
|
||||
<v-row v-for="(row, index) in rows" :key="'row_' + index" class="mt-0">
|
||||
<v-col>
|
||||
<v-item-group class="_btn-group py-0 px-3">
|
||||
<extruder-control-panel-tools-item v-for="macro in row" :key="macro.name" :macro="macro" />
|
||||
</v-item-group>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { mdiPrinter3dNozzle } from '@mdi/js'
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import { PrinterStateMacro, PrinterStateToolchangeMacro } from '@/store/printer/types'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
|
||||
@Component({})
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getMacros']
|
||||
}
|
||||
|
||||
get toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
||||
return this.macros
|
||||
.filter((macro: PrinterStateMacro) => macro.name.toUpperCase().match(/^T\d+/))
|
||||
.sort((a: PrinterStateMacro, b: PrinterStateMacro) => {
|
||||
const numberA = parseInt(a.name.slice(1))
|
||||
const numberB = parseInt(b.name.slice(1))
|
||||
|
||||
return numberA - numberB
|
||||
})
|
||||
}
|
||||
|
||||
get rows() {
|
||||
const cols = 6
|
||||
let rows = []
|
||||
|
||||
for (let i = 0; i < this.toolchangeMacros.length; i += cols) {
|
||||
rows.push(this.toolchangeMacros.slice(i, i + cols))
|
||||
}
|
||||
|
||||
return rows
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style 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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<v-btn
|
||||
:disabled="printerIsPrintingOnly"
|
||||
dense
|
||||
class="flex-grow-1 px-0"
|
||||
:style="buttonStyle"
|
||||
@click="doSend(macro.name)">
|
||||
<span v-if="color != null" class="_extruderColorState mr-1" :style="dotStyle" />
|
||||
{{ macro.name }}
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import { PrinterStateMacro } from '@/store/printer/types'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
})
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
@Prop({ type: Object }) macro!: PrinterStateMacro
|
||||
|
||||
get active() {
|
||||
return this.macro.variables.active ?? false
|
||||
}
|
||||
|
||||
get color() {
|
||||
const color = this.macro.variables.color ?? this.macro.variables.colour ?? null
|
||||
if (color === '' || color === 'undefined') return null
|
||||
|
||||
return color
|
||||
}
|
||||
|
||||
get primaryColor(): string {
|
||||
return this.$store.state.gui.uiSettings.primary
|
||||
}
|
||||
|
||||
get primaryTextColor(): string {
|
||||
let splits = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(this.primaryColor)
|
||||
if (splits) {
|
||||
const r = parseInt(splits[1], 16) * 0.2126
|
||||
const g = parseInt(splits[2], 16) * 0.7152
|
||||
const b = parseInt(splits[3], 16) * 0.0722
|
||||
const perceivedLightness = (r + g + b) / 255
|
||||
|
||||
return perceivedLightness > 0.7 ? '#222' : '#fff'
|
||||
}
|
||||
|
||||
return '#ffffff'
|
||||
}
|
||||
|
||||
get warningColor(): string {
|
||||
return this.$vuetify?.theme?.currentTheme?.warning?.toString() ?? '#ff8300'
|
||||
}
|
||||
|
||||
get buttonStyle() {
|
||||
let backgroundColor = ''
|
||||
if (this.active) {
|
||||
backgroundColor = this.homedAxes.includes('xyz') ? this.primaryColor : this.warningColor
|
||||
}
|
||||
|
||||
const textColor = this.active ? this.primaryTextColor : ''
|
||||
|
||||
return {
|
||||
color: textColor,
|
||||
'background-color': backgroundColor,
|
||||
}
|
||||
}
|
||||
|
||||
get dotStyle() {
|
||||
return {
|
||||
'border-color': this.active ? this.primaryTextColor : '',
|
||||
'background-color': '#' + this.color,
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
._extruderColorState {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border-radius: 50%;
|
||||
border: 1px solid lightgray;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<v-container class="pb-1">
|
||||
<tool-slider
|
||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFactor')"
|
||||
:icon="mdiPrinter3dNozzleOutline"
|
||||
:target="extrudeFactor"
|
||||
:min="1"
|
||||
:max="200"
|
||||
:multi="100"
|
||||
:step="1"
|
||||
:has-input-field="true"
|
||||
command="M221"
|
||||
attribute-name="S" />
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiPrinter3dNozzleOutline } from '@mdi/js'
|
||||
import ExtruderMixin from '@/components/mixins/extruder'
|
||||
|
||||
@Component({})
|
||||
export default class PressureAdvanceSettings extends Mixins(BaseMixin, ExtruderMixin) {
|
||||
mdiPrinter3dNozzleOutline = mdiPrinter3dNozzleOutline
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<div v-if="existsFirmwareRetraction">
|
||||
<v-divider />
|
||||
<v-container>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
small: (el) => el.width <= 350,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-row>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractLength')"
|
||||
param="RETRACT_LENGTH"
|
||||
:target="retractLength"
|
||||
:default-value="defaultRetractLength"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="10"
|
||||
:step="0.01"
|
||||
:min="0"
|
||||
:max="null"
|
||||
:dec="2"
|
||||
unit="mm"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.RetractSpeed')"
|
||||
param="RETRACT_SPEED"
|
||||
:target="retractSpeed"
|
||||
:default-value="defaultRetractSpeed"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="5"
|
||||
:step="1"
|
||||
:min="1"
|
||||
:max="null"
|
||||
:dec="0"
|
||||
unit="mm/s"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="
|
||||
$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractExtraLength')
|
||||
"
|
||||
param="UNRETRACT_EXTRA_LENGTH"
|
||||
:target="unretractExtraLength"
|
||||
:default-value="defaultUnretractExtraLength"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="10"
|
||||
:step="0.01"
|
||||
:min="0"
|
||||
:max="null"
|
||||
:dec="2"
|
||||
unit="mm"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.FirmwareRetractionSettings.UnretractSpeed')"
|
||||
param="UNRETRACT_SPEED"
|
||||
:target="unretractSpeed"
|
||||
:default-value="defaultUnretractSpeed"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="5"
|
||||
:step="1"
|
||||
:min="1"
|
||||
:max="null"
|
||||
:dec="0"
|
||||
unit="mm/s"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</responsive>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
|
||||
@Component({
|
||||
components: { Panel, NumberInput, Responsive },
|
||||
})
|
||||
export default class FirmwareRetractionSettings extends Mixins(BaseMixin, ControlMixin) {
|
||||
get retractLength(): number {
|
||||
return Math.floor((this.$store.state.printer?.firmware_retraction?.retract_length ?? 0) * 100) / 100
|
||||
}
|
||||
|
||||
get retractSpeed(): number {
|
||||
return Math.trunc(this.$store.state.printer?.firmware_retraction?.retract_speed ?? 20)
|
||||
}
|
||||
|
||||
get unretractExtraLength(): number {
|
||||
return Math.floor((this.$store.state.printer?.firmware_retraction?.unretract_extra_length ?? 0) * 100) / 100
|
||||
}
|
||||
|
||||
get unretractSpeed(): number {
|
||||
return Math.trunc(this.$store.state.printer?.firmware_retraction?.unretract_speed ?? 10)
|
||||
}
|
||||
|
||||
get defaultRetractLength(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.retract_length ?? 0) * 100
|
||||
) / 100
|
||||
)
|
||||
}
|
||||
|
||||
get defaultRetractSpeed(): number {
|
||||
return Math.trunc(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.retract_speed ?? 20)
|
||||
}
|
||||
|
||||
get defaultUnretractExtraLength(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.unretract_extra_length ?? 0) *
|
||||
100
|
||||
) / 100
|
||||
)
|
||||
}
|
||||
|
||||
get defaultUnretractSpeed(): number {
|
||||
return Math.trunc(this.$store.state.printer?.configfile?.settings?.firmware_retraction?.unretract_speed ?? 0)
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
sendCmd(params: { name: string; value: number }): void {
|
||||
const gcode = `SET_RETRACTION ${params.name}=${params.value}`
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div v-if="show">
|
||||
<v-divider />
|
||||
<v-container>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
small: (el) => el.width <= 350,
|
||||
medium: (el) => el.width > 350 && el.width <= 500,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-row>
|
||||
<v-col v-if="allExtruders.length > 1" :class="{ 'col-12': el.is.small || el.is.medium }">
|
||||
<div class="d-flex align-center">
|
||||
<v-btn
|
||||
v-if="selectedExtruder !== activeExtruder"
|
||||
icon
|
||||
plain
|
||||
@click="resetToActiveExtruder">
|
||||
<v-icon>{{ mdiRestart }}</v-icon>
|
||||
</v-btn>
|
||||
<v-select
|
||||
v-model="selectedExtruder"
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder')"
|
||||
:items="allExtruders"
|
||||
:value="activeExtruder"
|
||||
hide-details
|
||||
outlined
|
||||
dense />
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance')"
|
||||
param="ADVANCE"
|
||||
:target="pressureAdvance"
|
||||
:default-value="defaultPressureAdvance"
|
||||
:extruder="selectedExtruder"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:min="0"
|
||||
:max="null"
|
||||
:step="0.001"
|
||||
:dec="3"
|
||||
unit="s"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime')"
|
||||
param="SMOOTH_TIME"
|
||||
:target="smoothTime"
|
||||
:default-value="defaultSmoothTime"
|
||||
:extruder="selectedExtruder"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="10"
|
||||
:min="0"
|
||||
:max="0.2"
|
||||
:step="0.001"
|
||||
:dec="3"
|
||||
unit="s"
|
||||
@submit="sendCmd" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</responsive>
|
||||
</v-container>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import { mdiRestart } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { NumberInput, Panel, Responsive },
|
||||
})
|
||||
export default class PressureAdvanceSettings extends Mixins(BaseMixin) {
|
||||
mdiRestart = mdiRestart
|
||||
|
||||
private extruders: string[] = []
|
||||
private selectedExtruder = ''
|
||||
|
||||
resetToActiveExtruder(): void {
|
||||
this.selectedExtruder = this.$store.state.printer.toolhead?.extruder
|
||||
}
|
||||
|
||||
get show(): boolean {
|
||||
return !(this.$store.getters['printer/getExtruderSteppers'].length > 0)
|
||||
}
|
||||
|
||||
get allExtruders(): string[] {
|
||||
Object.keys(this.$store.state.printer).forEach((e) => {
|
||||
if (e.startsWith('extruder') && !this.extruders.includes(e)) this.extruders.push(e)
|
||||
})
|
||||
this.extruders.length === 1 ? this.resetToActiveExtruder() : {}
|
||||
|
||||
return this.extruders
|
||||
}
|
||||
|
||||
get activeExtruder(): string {
|
||||
this.resetToActiveExtruder()
|
||||
return this.$store.state.printer.toolhead?.extruder
|
||||
}
|
||||
|
||||
get pressureAdvance(): number {
|
||||
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000) / 1000
|
||||
}
|
||||
|
||||
get smoothTime(): number {
|
||||
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.smooth_time ?? 0.04) * 1000) / 1000
|
||||
}
|
||||
|
||||
get defaultPressureAdvance(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000
|
||||
) / 1000
|
||||
)
|
||||
}
|
||||
|
||||
get defaultSmoothTime(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]
|
||||
?.pressure_advance_smooth_time ?? 0.04) * 1000
|
||||
) / 1000
|
||||
)
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
sendCmd(params: { name: string; value: number }): void {
|
||||
const gcode = `SET_PRESSURE_ADVANCE EXTRUDER=${this.selectedExtruder} ${params.name}=${params.value}`
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<panel
|
||||
v-if="klipperReadyForGui && extruders.length"
|
||||
v-if="showPanel"
|
||||
:icon="mdiPrinter3dNozzle"
|
||||
:title="$t('Panels.ExtruderControlPanel.Headline').toString()"
|
||||
:title="$t('Panels.ExtruderControlPanel.Headline')"
|
||||
:collapsible="true"
|
||||
card-class="extruder-control-panel">
|
||||
card-class="extruder-control-panel"
|
||||
class="pb-1">
|
||||
<!-- PANEL-HEADER 3-DOT-MENU -->
|
||||
<template #buttons>
|
||||
<v-menu v-if="showFilamentMacros" :offset-y="true" :close-on-content-click="false" left>
|
||||
@@ -21,8 +22,8 @@
|
||||
<div v-on="on">
|
||||
<macro-button
|
||||
:macro="unloadFilamentMacro"
|
||||
:alias="$t('Panels.ExtruderControlPanel.UnloadFilament').toString()"
|
||||
:disabled="!canExecuteUnloadMacro || isPrinting"
|
||||
:alias="$t('Panels.ExtruderControlPanel.UnloadFilament')"
|
||||
:disabled="!canExecuteUnloadMacro || printerIsPrintingOnly"
|
||||
color="#272727" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -39,8 +40,8 @@
|
||||
<div v-on="on">
|
||||
<macro-button
|
||||
:macro="loadFilamentMacro"
|
||||
:alias="$t('Panels.ExtruderControlPanel.LoadFilament').toString()"
|
||||
:disabled="!canExecuteLoadMacro || isPrinting"
|
||||
:alias="$t('Panels.ExtruderControlPanel.LoadFilament')"
|
||||
:disabled="!canExecuteLoadMacro || printerIsPrintingOnly"
|
||||
color="#272727" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -53,320 +54,56 @@
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</template>
|
||||
<responsive :breakpoints="{ large: (el) => el.width >= 640 }">
|
||||
<template #default="{ el }">
|
||||
<!-- TOOL SELECTOR BUTTONS -->
|
||||
<v-container v-if="toolchangeMacros.length > 1" class="pb-1">
|
||||
<v-item-group class="_btn-group py-0">
|
||||
<v-btn
|
||||
v-for="tool in toolchangeMacros"
|
||||
:key="tool.name"
|
||||
:class="tool.active ? 'primary--text' : {}"
|
||||
:disabled="isPrinting"
|
||||
:style="{ 'background-color': '#' + tool.color }"
|
||||
dense
|
||||
class="flex-grow-1 px-0"
|
||||
@click="doSend(tool.name)">
|
||||
{{ tool.name }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-container>
|
||||
<!-- EXTRUSION FACTOR SLIDER -->
|
||||
<v-container class="pb-1">
|
||||
<tool-slider
|
||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFactor').toString()"
|
||||
:icon="mdiPrinter3dNozzleOutline"
|
||||
:target="extrudeFactor"
|
||||
:min="1"
|
||||
:max="200"
|
||||
:multi="100"
|
||||
:step="1"
|
||||
:has-input-field="true"
|
||||
command="M221"
|
||||
attribute-name="S"></tool-slider>
|
||||
</v-container>
|
||||
<!-- PRESSURE ADVANCE SETTINGS -->
|
||||
<template v-if="!(extruderSteppers.length > 0)">
|
||||
<v-divider></v-divider>
|
||||
<pressure-advance-settings></pressure-advance-settings>
|
||||
</template>
|
||||
<!-- 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>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.FilamentLength').toString()"
|
||||
param="feedamount"
|
||||
:target="feedamount"
|
||||
:disabled="isPrinting"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="100"
|
||||
:step="0.01"
|
||||
:min="0.01"
|
||||
:max="maxExtrudeOnlyDistance"
|
||||
:dec="2"
|
||||
unit="mm"
|
||||
:submit-on-blur="true"
|
||||
@submit="setFeedamount"></number-input>
|
||||
<v-item-group class="_btn-group pt-3">
|
||||
<v-btn
|
||||
v-for="value in feedamountsSorted"
|
||||
:key="value"
|
||||
:disabled="isPrinting"
|
||||
dense
|
||||
class="_btn-qs flex-grow-1 px-0"
|
||||
@click="setFeedamount({ value })">
|
||||
{{ value }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.ExtrusionFeedrate').toString()"
|
||||
param="feedrate"
|
||||
:target="feedrate"
|
||||
:disabled="isPrinting"
|
||||
:has-spinner="true"
|
||||
:output-error-msg="true"
|
||||
:spinner-factor="100"
|
||||
:step="0.01"
|
||||
:min="0.01"
|
||||
:max="null"
|
||||
:dec="2"
|
||||
type="number"
|
||||
unit="mm/s"
|
||||
@submit="setFeedrate"></number-input>
|
||||
<v-item-group class="_btn-group pt-3">
|
||||
<v-btn
|
||||
v-for="value in feedratesSorted"
|
||||
:key="value"
|
||||
:disabled="isPrinting"
|
||||
dense
|
||||
class="_btn-qs flex-grow-1 px-0"
|
||||
@click="setFeedrate({ value })">
|
||||
{{ value }}
|
||||
</v-btn>
|
||||
</v-item-group>
|
||||
</v-col>
|
||||
<!-- EXTRUDE AND RETRACT BUTTON LARGE SIZED PANEL -->
|
||||
<v-col v-if="el.is.large" class="col-3 d-flex align-center flex-column justify-center">
|
||||
<!-- RETRACT -->
|
||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="mb-4" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnRetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendRetract()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<!-- EXTRUDE -->
|
||||
<v-tooltip left :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnDetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendExtrude()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}: {{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- EXTRUDE AND RETRACT BUTTON SMALL AND MEDIUM SIZED PANEL -->
|
||||
<v-row v-if="!el.is.large" :class="{ 'pb-1': !showEstimatedExtrusion }">
|
||||
<v-col class="pa-0">
|
||||
<div class="d-flex justify-space-around">
|
||||
<div class="d-flex align-center">
|
||||
<!-- RETRACT -->
|
||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnRetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendRetract()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowUpBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Retract') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}:
|
||||
{{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<!-- EXTRUDE -->
|
||||
<v-tooltip top :disabled="extrudePossible && !tooLargeExtrusion" color="secondary">
|
||||
<template #activator="{ on }">
|
||||
<div class="pt-1 pb-2 px-3" v-on="on">
|
||||
<v-btn
|
||||
:loading="loadings.includes('btnDetract')"
|
||||
:disabled="!extrudePossible || tooLargeExtrusion || isPrinting"
|
||||
small
|
||||
class="_btn-extruder-cmd"
|
||||
@click="sendExtrude()">
|
||||
<v-icon small class="mr-1">{{ mdiArrowDownBold }}</v-icon>
|
||||
{{ $t('Panels.ExtruderControlPanel.Extrude') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<span v-show="!extrudePossible">
|
||||
{{ $t('Panels.ExtruderControlPanel.ExtruderTempTooLow') }}
|
||||
{{ minExtrudeTemp }} °C
|
||||
</span>
|
||||
<span v-show="tooLargeExtrusion">
|
||||
{{ $t('Panels.ExtruderControlPanel.TooLargeExtrusion') }}
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Requested') }}:
|
||||
{{ feedamount * extrudeFactor }} mm
|
||||
<br />
|
||||
{{ $t('Panels.ExtruderControlPanel.Allowed') }}:
|
||||
{{ maxExtrudeOnlyDistance }} mm
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<!-- EXTRUSION ESTIMATION NOTE -->
|
||||
<v-container v-if="showEstimatedExtrusion" class="pa-0 ma-0 pb-2">
|
||||
<div
|
||||
v-if="filamentDiameter && nozzleDiameter"
|
||||
style="font-size: 0.8em"
|
||||
class="text--disabled text-caption font-weight-light d-flex justify-center">
|
||||
<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>
|
||||
</responsive>
|
||||
<!-- TOOL SELECTOR BUTTONS -->
|
||||
<extruder-control-panel-tools />
|
||||
<!-- EXTRUSION FACTOR SLIDER -->
|
||||
<extrusion-factor-settings />
|
||||
<!-- PRESSURE ADVANCE SETTINGS -->
|
||||
<pressure-advance-settings />
|
||||
<!-- FIRMWARE RETRACTION SETTINGS -->
|
||||
<firmware-retraction-settings />
|
||||
<v-divider class="pb-1" />
|
||||
<!-- EXTRUDER INPUTS AND QUICKSELECTS -->
|
||||
<extruder-control-panel-control />
|
||||
<!-- EXTRUSION ESTIMATION NOTE -->
|
||||
<estimated-extrusion-output />
|
||||
</panel>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
mdiArrowDownBold,
|
||||
mdiArrowUpBold,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiPrinter3dNozzleOutline,
|
||||
mdiDotsVertical,
|
||||
mdiDiameterVariant,
|
||||
} from '@mdi/js'
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
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 { mdiPrinter3dNozzle, mdiDotsVertical } from '@mdi/js'
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import { PrinterStateExtruder, PrinterStateMacro } from '@/store/printer/types'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
import Panel from '@/components/ui/Panel.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'
|
||||
import ExtruderMixin from '@/components/mixins/extruder'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Panel,
|
||||
PressureAdvanceSettings,
|
||||
FirmwareRetractionSettings,
|
||||
NumberInput,
|
||||
Responsive,
|
||||
ToolSlider,
|
||||
},
|
||||
})
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiArrowUpBold = mdiArrowUpBold
|
||||
mdiArrowDownBold = mdiArrowDownBold
|
||||
export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin, ExtruderMixin) {
|
||||
mdiPrinter3dNozzle = mdiPrinter3dNozzle
|
||||
mdiPrinter3dNozzleOutline = mdiPrinter3dNozzleOutline
|
||||
mdiDotsVertical = mdiDotsVertical
|
||||
mdiDiameterVariant = mdiDiameterVariant
|
||||
|
||||
private heatWaitGcodes = ['printer.extruder.can_extrude', 'TEMPERATURE_WAIT', 'M109']
|
||||
|
||||
get isPrinting(): boolean {
|
||||
return ['printing'].includes(this.printer_state)
|
||||
get showPanel(): boolean {
|
||||
return this.klipperReadyForGui && this.extruders.length > 0
|
||||
}
|
||||
|
||||
get macros() {
|
||||
return this.$store.getters['printer/getMacros']
|
||||
}
|
||||
|
||||
get toolchangeMacros(): PrinterStateToolchangeMacro[] {
|
||||
return this.$store.getters['printer/getToolchangeMacros']
|
||||
get loadFilamentMacro(): PrinterStateMacro | undefined {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name.toUpperCase() === 'LOAD_FILAMENT')
|
||||
}
|
||||
|
||||
get loadFilamentMacro() {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name === 'LOAD_FILAMENT')
|
||||
}
|
||||
|
||||
get unloadFilamentMacro() {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name === 'UNLOAD_FILAMENT')
|
||||
get unloadFilamentMacro(): PrinterStateMacro | undefined {
|
||||
return this.macros.find((macro: PrinterStateMacro) => macro.name.toUpperCase() === 'UNLOAD_FILAMENT')
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -376,13 +113,13 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
|
||||
get canExecuteLoadMacro(): boolean {
|
||||
if (this.extrudePossible) return true
|
||||
|
||||
return this.heatWaitGcodes.some((gcode) => this.loadFilamentMacro.prop.gcode.includes(gcode))
|
||||
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))
|
||||
return this.heatWaitGcodes.some((gcode) => this.unloadFilamentMacro?.prop.gcode.includes(gcode))
|
||||
}
|
||||
|
||||
get showFilamentMacros(): boolean {
|
||||
@@ -392,162 +129,5 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
|
||||
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
|
||||
}
|
||||
|
||||
get filamentDiameter(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.filament_diameter ?? 1.75
|
||||
}
|
||||
|
||||
get nozzleDiameter(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.nozzle_diameter ?? 0.4
|
||||
}
|
||||
|
||||
get feedamounts(): number[] {
|
||||
return this.$store.state.gui.control.extruder?.feedamounts ?? []
|
||||
}
|
||||
|
||||
get feedrates(): number[] {
|
||||
return this.$store.state.gui.control.extruder?.feedrates ?? []
|
||||
}
|
||||
|
||||
get feedamountsSorted(): number[] {
|
||||
return [...this.feedamounts].sort((a, b) => {
|
||||
return b - a
|
||||
})
|
||||
}
|
||||
|
||||
get feedratesSorted(): number[] {
|
||||
return [...this.feedrates].sort((a, b) => {
|
||||
return b - a
|
||||
})
|
||||
}
|
||||
|
||||
get feedamount(): number {
|
||||
return parseFloat(this.$store.state.gui.control.extruder.feedamount)
|
||||
}
|
||||
|
||||
setFeedamount(params: { value: number }): void {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedamount', value: params.value })
|
||||
}
|
||||
|
||||
get feedrate(): number {
|
||||
return parseFloat(this.$store.state.gui.control.extruder.feedrate)
|
||||
}
|
||||
|
||||
setFeedrate(params: { value: number }): void {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'control.extruder.feedrate', value: params.value })
|
||||
}
|
||||
|
||||
get extrudePossible(): boolean {
|
||||
return this.$store.getters['printer/getExtrudePossible']
|
||||
}
|
||||
|
||||
get minExtrudeTemp(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.min_extrude_temp ?? 170
|
||||
}
|
||||
|
||||
get maxExtrudeOnlyDistance(): number {
|
||||
return this.$store.state.printer.configfile?.settings?.[this.activeExtruder]?.max_extrude_only_distance ?? 50
|
||||
}
|
||||
|
||||
get tooLargeExtrusion(): boolean {
|
||||
return this.feedamount * this.extrudeFactor > this.maxExtrudeOnlyDistance
|
||||
}
|
||||
|
||||
get extrudedLength(): number {
|
||||
return Math.round(
|
||||
this.feedamount *
|
||||
this.extrudeFactor *
|
||||
(Math.pow(this.filamentDiameter, 2) / Math.pow(this.nozzleDiameter, 2))
|
||||
)
|
||||
}
|
||||
|
||||
get volumetricFlow(): number {
|
||||
return Math.round(Math.pow(this.filamentDiameter / 2, 2) * Math.PI * this.feedrate * 10) / 10
|
||||
}
|
||||
|
||||
get extrudeFactor() {
|
||||
return this.$store.state.printer?.gcode_move?.extrude_factor ?? 1
|
||||
}
|
||||
|
||||
get showEstimatedExtrusion() {
|
||||
return this.$store.state.gui.control.extruder.showEstimatedExtrusionInfo
|
||||
}
|
||||
|
||||
@Watch('maxExtrudeOnlyDistance', { immediate: true })
|
||||
onMaxExtrudeOnlyDistanceChange(): void {
|
||||
/**
|
||||
* If, while switching from ex. A to ex. B, the feedamount
|
||||
* from ex. A exceeds the maxExtrudeOnlyDistance of ex. B,
|
||||
* set the feedamount to maxExtrudeOnlyDistance of ex. B
|
||||
*/
|
||||
if (this.feedamount > this.maxExtrudeOnlyDistance) {
|
||||
this.setFeedamount({ value: this.maxExtrudeOnlyDistance })
|
||||
}
|
||||
}
|
||||
|
||||
sendRetract(): void {
|
||||
const gcode = `M83\nG1 E-${this.feedamount} F${this.feedrate * 60}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnRetract' })
|
||||
}
|
||||
|
||||
sendExtrude(): void {
|
||||
const gcode = `M83\nG1 E${this.feedamount} F${this.feedrate * 60}`
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode }, { loading: 'btnDetract' })
|
||||
}
|
||||
}
|
||||
</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>
|
||||
@@ -1,152 +0,0 @@
|
||||
<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>
|
||||
@@ -1,133 +0,0 @@
|
||||
<template>
|
||||
<v-container>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
small: (el) => el.width <= 350,
|
||||
medium: (el) => el.width > 350 && el.width <= 500,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-row>
|
||||
<v-col v-if="allExtruders.length > 1" :class="{ 'col-12': el.is.small || el.is.medium }">
|
||||
<div class="d-flex align-center">
|
||||
<v-btn v-if="selectedExtruder !== activeExtruder" icon plain @click="resetToActiveExtruder">
|
||||
<v-icon>{{ mdiRestart }}</v-icon>
|
||||
</v-btn>
|
||||
<v-select
|
||||
v-model="selectedExtruder"
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Extruder').toString()"
|
||||
:items="allExtruders"
|
||||
:value="activeExtruder"
|
||||
hide-details
|
||||
outlined
|
||||
dense></v-select>
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.Advance').toString()"
|
||||
param="ADVANCE"
|
||||
:target="pressureAdvance"
|
||||
:default-value="defaultPressureAdvance"
|
||||
:extruder="selectedExtruder"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:min="0"
|
||||
:max="null"
|
||||
:step="0.001"
|
||||
:dec="3"
|
||||
unit="s"
|
||||
@submit="sendCmd"></number-input>
|
||||
</v-col>
|
||||
<v-col :class="{ 'col-12': el.is.small }">
|
||||
<number-input
|
||||
:label="$t('Panels.ExtruderControlPanel.PressureAdvanceSettings.SmoothTime').toString()"
|
||||
param="SMOOTH_TIME"
|
||||
:target="smoothTime"
|
||||
:default-value="defaultSmoothTime"
|
||||
:extruder="selectedExtruder"
|
||||
:output-error-msg="true"
|
||||
:has-spinner="true"
|
||||
:spinner-factor="10"
|
||||
:min="0"
|
||||
:max="0.2"
|
||||
:step="0.001"
|
||||
:dec="3"
|
||||
unit="s"
|
||||
@submit="sendCmd"></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 NumberInput from '@/components/inputs/NumberInput.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import Responsive from '@/components/ui/Responsive.vue'
|
||||
import { mdiRestart } from '@mdi/js'
|
||||
|
||||
@Component({
|
||||
components: { NumberInput, Panel, Responsive },
|
||||
})
|
||||
export default class PressureAdvanceSettings extends Mixins(BaseMixin) {
|
||||
mdiRestart = mdiRestart
|
||||
|
||||
private extruders: string[] = []
|
||||
private selectedExtruder = ''
|
||||
|
||||
resetToActiveExtruder(): void {
|
||||
this.selectedExtruder = this.$store.state.printer.toolhead?.extruder
|
||||
}
|
||||
|
||||
get allExtruders(): string[] {
|
||||
Object.keys(this.$store.state.printer).forEach((e) => {
|
||||
if (e.startsWith('extruder') && !this.extruders.includes(e)) this.extruders.push(e)
|
||||
})
|
||||
this.extruders.length === 1 ? this.resetToActiveExtruder() : {}
|
||||
|
||||
return this.extruders
|
||||
}
|
||||
|
||||
get activeExtruder(): string {
|
||||
this.resetToActiveExtruder()
|
||||
return this.$store.state.printer.toolhead?.extruder
|
||||
}
|
||||
|
||||
get pressureAdvance(): number {
|
||||
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000) / 1000
|
||||
}
|
||||
|
||||
get smoothTime(): number {
|
||||
return Math.floor((this.$store.state.printer?.[this.selectedExtruder]?.smooth_time ?? 0.04) * 1000) / 1000
|
||||
}
|
||||
|
||||
get defaultPressureAdvance(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]?.pressure_advance ?? 0) * 1000
|
||||
) / 1000
|
||||
)
|
||||
}
|
||||
|
||||
get defaultSmoothTime(): number {
|
||||
return (
|
||||
Math.floor(
|
||||
(this.$store.state.printer.configfile?.settings?.[this.selectedExtruder]
|
||||
?.pressure_advance_smooth_time ?? 0.04) * 1000
|
||||
) / 1000
|
||||
)
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
sendCmd(params: { name: string; value: number }): void {
|
||||
const gcode = `SET_PRESSURE_ADVANCE EXTRUDER=${this.selectedExtruder} ${params.name}=${params.value}`
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -2,10 +2,8 @@
|
||||
<panel
|
||||
:icon="mdiPrinter3d"
|
||||
:title="printer_name"
|
||||
:card-class="
|
||||
'farmprinter-panel ' +
|
||||
(!printer.socket.isConnected && !printer.socket.isConnecting ? 'disabledPrinter' : '')
|
||||
"
|
||||
card-class="farmprinter-panel"
|
||||
:class="panelClass"
|
||||
:loading="printer.socket.isConnecting"
|
||||
:toolbar-color="isCurrentPrinter ? 'primary' : ''">
|
||||
<template #buttons>
|
||||
@@ -17,7 +15,7 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="currentCamId = 'off'">
|
||||
<v-list-item link @click="currentCamName = 'off'">
|
||||
<v-list-item-icon class="mr-2">
|
||||
<v-icon small class="mt-1">{{ mdiWebcamOff }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
@@ -26,15 +24,15 @@
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-for="webcam of supportedPrinterWebcams"
|
||||
:key="webcam.index"
|
||||
v-for="webcam of printer_webcams"
|
||||
:key="webcam.name"
|
||||
link
|
||||
@click="currentCamId = webcam.id">
|
||||
@click="currentCamName = webcam.name">
|
||||
<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>
|
||||
<v-list-item-title v-text="webcam.name" />
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
@@ -47,26 +45,12 @@
|
||||
<div
|
||||
v-if="
|
||||
printer.socket.isConnected &&
|
||||
currentCamId !== 'off' &&
|
||||
currentCamName !== 'off' &&
|
||||
currentWebcam &&
|
||||
'service' in currentWebcam
|
||||
"
|
||||
class="webcamContainer">
|
||||
<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>
|
||||
<webcam-wrapper :webcam="currentWebcam" :printer-url="printerUrl" :show-fps="false" />
|
||||
</div>
|
||||
<v-card-title
|
||||
class="white--text py-2"
|
||||
@@ -130,22 +114,18 @@
|
||||
import { Component, Mixins, Prop, Ref, Vue } from 'vue-property-decorator'
|
||||
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'
|
||||
import WebcamWrapper from '@/components/webcams/WebcamWrapper.vue'
|
||||
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Panel,
|
||||
'webcam-mjpegstreamer': Mjpegstreamer,
|
||||
'webcam-mjpegstreamer-adaptive': MjpegstreamerAdaptive,
|
||||
'webcam-uv4l-mjpeg': Uv4lMjpeg,
|
||||
'webcam-wrapper': WebcamWrapper,
|
||||
'mainsail-logo': MainsailLogo,
|
||||
},
|
||||
})
|
||||
@@ -175,12 +155,12 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
return this.$store.getters['farm/' + this.printer._namespace + '/isCurrentPrinter']
|
||||
}
|
||||
|
||||
get currentCamId() {
|
||||
return this.$store.getters['farm/' + this.printer._namespace + '/getSetting']('currentCamId', 'off')
|
||||
get currentCamName() {
|
||||
return this.$store.getters['farm/' + this.printer._namespace + '/getSetting']('currentCamName', 'off')
|
||||
}
|
||||
|
||||
set currentCamId(newVal) {
|
||||
this.$store.dispatch('farm/' + this.printer._namespace + '/setSettings', { currentCamId: newVal })
|
||||
set currentCamName(newVal) {
|
||||
this.$store.dispatch('farm/' + this.printer._namespace + '/setSettings', { currentCamName: newVal })
|
||||
}
|
||||
|
||||
get printer_name() {
|
||||
@@ -218,24 +198,30 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
}
|
||||
|
||||
get showWebcamSwitch() {
|
||||
return this.printer.socket.isConnected && this.supportedPrinterWebcams.length > 0
|
||||
if (this.printer_webcams.length == 0) return false
|
||||
|
||||
return this.printer.socket.isConnected
|
||||
}
|
||||
|
||||
get printer_webcams() {
|
||||
get printer_webcams(): GuiWebcamStateWebcam[] {
|
||||
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(): GuiWebcamStateWebcam | null {
|
||||
const currentCam = this.printer_webcams?.find(
|
||||
(webcam: GuiWebcamStateWebcam) => webcam.name === this.currentCamName
|
||||
)
|
||||
}
|
||||
|
||||
get currentWebcam() {
|
||||
const currentCam = this.printer_webcams.find((webcam: any) => webcam.id === this.currentCamId)
|
||||
if (currentCam) return currentCam
|
||||
|
||||
return false
|
||||
return null
|
||||
}
|
||||
|
||||
get panelClass(): string[] {
|
||||
let output = []
|
||||
|
||||
if (!this.printer.socket.isConnected && !this.printer.socket.isConnecting) output.push('disabledPrinter')
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
clickPrinter() {
|
||||
@@ -293,10 +279,8 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
.v-overlay {
|
||||
top: 48px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
.farmprinter-panel {
|
||||
::v-deep .farmprinter-panel {
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:title="$t('Files.GCodeFiles').toString()"
|
||||
:icon="mdiFileDocumentMultipleOutline"
|
||||
card-class="gcode-files-panel">
|
||||
<panel :title="$t('Files.GCodeFiles')" :icon="mdiFileDocumentMultipleOutline" card-class="gcode-files-panel">
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col class="col-12 d-flex align-center">
|
||||
@@ -243,6 +240,7 @@
|
||||
<v-tooltip
|
||||
top
|
||||
content-class="tooltip__content-opacity1"
|
||||
:color="bigThumbnailTooltipColor"
|
||||
:disabled="!item.big_thumbnail">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image>
|
||||
@@ -255,16 +253,16 @@
|
||||
v-bind="attrs"
|
||||
v-on="on" />
|
||||
<div slot="preloader">
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-progress-circular indeterminate color="primary" />
|
||||
</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>
|
||||
<span>
|
||||
<img :src="item.big_thumbnail" width="250" :alt="item.filename" />
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -307,7 +305,7 @@
|
||||
:bool="dialogPrintFile.show"
|
||||
:file="dialogPrintFile.item"
|
||||
:current-path="currentPath"
|
||||
@closeDialog="closeStartPrint"></start-print-dialog>
|
||||
@closeDialog="closeStartPrint" />
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item
|
||||
@@ -345,6 +343,13 @@
|
||||
<v-icon class="mr-1">{{ mdiVideo3d }}</v-icon>
|
||||
{{ $t('Files.View3D') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="!contextMenu.item.isDirectory"
|
||||
:disabled="!isGcodeFile(contextMenu.item)"
|
||||
@click="scanMeta(contextMenu.item)">
|
||||
<v-icon class="mr-1">{{ mdiMagnify }}</v-icon>
|
||||
{{ $t('Files.ScanMeta') }}
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" @click="downloadFile">
|
||||
<v-icon class="mr-1">{{ mdiCloudDownload }}</v-icon>
|
||||
{{ $t('Files.Download') }}
|
||||
@@ -361,7 +366,11 @@
|
||||
<v-icon class="mr-1">{{ mdiRenameBox }}</v-icon>
|
||||
{{ $t('Files.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" class="red--text" @click="removeFile">
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" @click="duplicateFile(contextMenu.item)">
|
||||
<v-icon class="mr-1">{{ mdiContentCopy }}</v-icon>
|
||||
{{ $t('Files.Duplicate') }}
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" class="red--text" @click="deleteDialog = true">
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Files.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -376,7 +385,7 @@
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.NewDirectory').toString()"
|
||||
:title="$t('Files.NewDirectory')"
|
||||
card-class="gcode-files-new-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -391,7 +400,7 @@
|
||||
:label="$t('Files.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keypress.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -404,10 +413,7 @@
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.RenameFile').toString()"
|
||||
card-class="gcode-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<panel :title="$t('Files.RenameFile')" 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>
|
||||
@@ -417,10 +423,10 @@
|
||||
<v-text-field
|
||||
ref="inputFieldRenameFile"
|
||||
v-model="dialogRenameFile.newName"
|
||||
:label="$t('Files.Name').toString()"
|
||||
:label="$t('Files.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -432,9 +438,38 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDuplicateFile.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.DuplicateFile')"
|
||||
card-class="gcode-files-duplicate-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="dialogDuplicateFile.show = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
ref="inputFieldDuplicateFile"
|
||||
v-model="dialogDuplicateFile.newName"
|
||||
:label="$t('Files.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="duplicateFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="dialogDuplicateFile.show = false">{{ $t('Files.Cancel') }}</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="duplicateFileAction">
|
||||
{{ $t('Files.Duplicate') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.RenameDirectory').toString()"
|
||||
:title="$t('Files.RenameDirectory')"
|
||||
card-class="gcode-files-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -449,7 +484,7 @@
|
||||
:label="$t('Files.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -463,7 +498,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.DeleteDirectory').toString()"
|
||||
:title="$t('Files.DeleteDirectory')"
|
||||
card-class="gcode-files-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -483,18 +518,45 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE SINGLE FILE DIALOG -->
|
||||
<v-dialog v-model="deleteDialog" max-width="400">
|
||||
<panel :title="$t('Files.Delete')" card-class="gcode-files-delete-dialog" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
{{ $t('Files.DeleteSingleFileQuestion', { name: contextMenu.item.filename }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteDialog = false">
|
||||
{{ $t('Files.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="error" text @click="removeFile">
|
||||
{{ $t('Files.Delete') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE MULTIPLE FILES DIALOG -->
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.Delete').toString()"
|
||||
card-class="gcode-files-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<panel :title="$t('Files.Delete')" card-class="gcode-files-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('Files.DeleteSelectedQuestion', { count: selectedFiles.length }) }}</p>
|
||||
<p v-if="selectedFiles.length === 1" class="mb-0">
|
||||
{{ $t('Files.DeleteSingleFileQuestion', { name: selectedFiles[0].filename }) }}
|
||||
</p>
|
||||
<p v-else class="mb-0">{{ $t('Files.DeleteSelectedQuestion', { count: selectedFiles.length }) }}</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -505,7 +567,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogAddBatchToQueue.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.AddToQueue').toString()"
|
||||
:title="$t('Files.AddToQueue')"
|
||||
card-class="gcode-files-add-to-queue-dialog"
|
||||
:icon="mdiPlaylistPlus"
|
||||
:margin-bottom="false">
|
||||
@@ -556,7 +618,7 @@
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Watch } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { validGcodeExtensions } from '@/store/variables'
|
||||
import { defaultBigThumbnailBackground, validGcodeExtensions } from '@/store/variables'
|
||||
import { formatFilesize, formatPrintTime, sortFiles } from '@/plugins/helpers'
|
||||
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
@@ -586,6 +648,7 @@ import {
|
||||
mdiUpload,
|
||||
mdiVideo3d,
|
||||
mdiFileDocumentEditOutline,
|
||||
mdiContentCopy,
|
||||
} from '@mdi/js'
|
||||
import StartPrintDialog from '@/components/dialogs/StartPrintDialog.vue'
|
||||
import ControlMixin from '@/components/mixins/control'
|
||||
@@ -636,6 +699,7 @@ interface tableColumnSetting {
|
||||
export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiChevronDown = mdiChevronDown
|
||||
mdiChevronUp = mdiChevronUp
|
||||
mdiContentCopy = mdiContentCopy
|
||||
mdiFile = mdiFile
|
||||
mdiFileDocumentMultipleOutline = mdiFileDocumentMultipleOutline
|
||||
mdiMagnify = mdiMagnify
|
||||
@@ -665,6 +729,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
declare $refs: {
|
||||
fileUpload: HTMLInputElement
|
||||
inputFieldRenameFile: HTMLInputElement
|
||||
inputFieldDuplicateFile: HTMLInputElement
|
||||
inputFieldCreateDirectory: HTMLInputElement
|
||||
inputFieldRenameDirectory: HTMLInputElement
|
||||
}
|
||||
@@ -722,6 +787,12 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogDuplicateFile: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private dialogRenameDirectory: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
@@ -734,6 +805,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
item: { ...this.contextMenu.item },
|
||||
}
|
||||
|
||||
private deleteDialog = false
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private isInvalidName = true
|
||||
@@ -1030,6 +1102,18 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.countPerPage', value: newVal })
|
||||
}
|
||||
|
||||
get bigThumbnailBackground() {
|
||||
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||
}
|
||||
|
||||
get bigThumbnailTooltipColor() {
|
||||
if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return this.bigThumbnailBackground
|
||||
}
|
||||
|
||||
getStatusIcon(status: string | null) {
|
||||
return this.$store.getters['server/history/getPrintStatusIcon'](status)
|
||||
}
|
||||
@@ -1251,7 +1335,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
|
||||
await addElementToItems('gcodes/' + this.currentPath, this.selectedFiles)
|
||||
const date = new Date()
|
||||
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDay()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
||||
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDate()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
||||
|
||||
this.$socket.emit(
|
||||
'server.files.zip',
|
||||
@@ -1284,6 +1368,24 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
)
|
||||
}
|
||||
|
||||
duplicateFile(item: FileStateGcodefile) {
|
||||
this.dialogDuplicateFile.item = item
|
||||
this.dialogDuplicateFile.newName = item.filename
|
||||
this.dialogDuplicateFile.show = true
|
||||
|
||||
setTimeout(() => {
|
||||
this.$refs.inputFieldDuplicateFile?.focus()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
duplicateFileAction() {
|
||||
this.dialogDuplicateFile.show = false
|
||||
this.$socket.emit('server.files.copy', {
|
||||
source: 'gcodes' + this.currentPath + '/' + this.dialogDuplicateFile.item.filename,
|
||||
dest: 'gcodes' + this.currentPath + '/' + this.dialogDuplicateFile.newName,
|
||||
})
|
||||
}
|
||||
|
||||
renameDirectory(item: FileStateGcodefile) {
|
||||
this.dialogRenameDirectory.item = item
|
||||
this.dialogRenameDirectory.newName = item.filename
|
||||
@@ -1312,6 +1414,8 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
{ path: 'gcodes' + this.currentPath + '/' + this.contextMenu.item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
this.deleteDialog = false
|
||||
}
|
||||
|
||||
deleteDirectory(item: FileStateGcodefile) {
|
||||
@@ -1376,6 +1480,12 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
this.$router.push({ path: '/viewer', query: { filename: 'gcodes' + this.currentPath + '/' + item.filename } })
|
||||
}
|
||||
|
||||
scanMeta(item: FileStateFile) {
|
||||
this.$store.dispatch('files/scanMetadata', {
|
||||
filename: 'gcodes' + this.currentPath + '/' + item.filename,
|
||||
})
|
||||
}
|
||||
|
||||
deleteSelectedFiles() {
|
||||
this.selectedFiles.forEach((item: FileStateGcodefile) => {
|
||||
if (item.isDirectory) {
|
||||
|
||||
@@ -1,18 +1,8 @@
|
||||
<style>
|
||||
.history-jobs-table th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.history-jobs-table th.text-start {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:icon="mdiFileDocumentMultipleOutline"
|
||||
:title="$t('History.PrintHistory').toString()"
|
||||
:title="$t('History.PrintHistory')"
|
||||
card-class="history-list-panel">
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
@@ -234,7 +224,7 @@
|
||||
<v-icon class="mr-1">{{ mdiPrinter }}</v-icon>
|
||||
{{ $t('History.Reprint') }}
|
||||
</v-list-item>
|
||||
<v-list-item class="red--text" @click="deleteJob(contextMenu.item)">
|
||||
<v-list-item class="red--text" @click="deleteDialog = true">
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('History.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -246,7 +236,7 @@
|
||||
persistent
|
||||
@keydown.esc="detailsDialog.boolShow = false">
|
||||
<panel
|
||||
:title="$t('History.JobDetails').toString()"
|
||||
:title="$t('History.JobDetails')"
|
||||
:icon="mdiUpdate"
|
||||
card-class="history-detail-dialog"
|
||||
:margin-bottom="false">
|
||||
@@ -430,18 +420,47 @@
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE SINGLE FILE DIALOG -->
|
||||
<v-dialog v-model="deleteDialog" max-width="400">
|
||||
<panel :title="$t('History.Delete')" card-class="history-delete-dialog" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
{{ $t('History.DeleteSingleJobQuestion') }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteDialog = false">
|
||||
{{ $t('History.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="error" text @click="deleteJob">
|
||||
{{ $t('History.Delete') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE MULTIPLE FILES DIALOG -->
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('History.Delete').toString()"
|
||||
card-class="history-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<panel :title="$t('History.Delete')" card-class="history-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('History.DeleteSelectedQuestion', { count: selectedJobs.length }) }}</p>
|
||||
<p v-if="selectedJobs.length === 1" class="mb-0">
|
||||
{{ $t('History.DeleteSingleJobQuestion') }}
|
||||
</p>
|
||||
<p v-else class="mb-0">
|
||||
{{ $t('History.DeleteSelectedQuestion', { count: selectedJobs.length }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -555,6 +574,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
type: 'create',
|
||||
}
|
||||
|
||||
private deleteDialog = false
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
get jobs() {
|
||||
@@ -918,12 +938,14 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
this.$socket.emit('printer.print.start', { filename: item.filename }, { action: 'switchToDashboard' })
|
||||
}
|
||||
|
||||
deleteJob(item: ServerHistoryStateJob) {
|
||||
deleteJob() {
|
||||
this.$socket.emit(
|
||||
'server.history.delete_job',
|
||||
{ uid: item.job_id },
|
||||
{ uid: this.contextMenu.item.job_id },
|
||||
{ action: 'server/history/getDeletedJobs' }
|
||||
)
|
||||
|
||||
this.deleteDialog = false
|
||||
}
|
||||
|
||||
deleteSelectedJobs() {
|
||||
@@ -940,7 +962,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
exportHistory() {
|
||||
const checkString = parseFloat('1.23').toLocaleString()
|
||||
const checkString = parseFloat('1.23').toLocaleString(this.browserLocale)
|
||||
const decimalSeparator = checkString.indexOf(',') >= 0 ? ',' : '.'
|
||||
const csvSeperator = decimalSeparator === ',' ? ';' : ','
|
||||
|
||||
@@ -989,7 +1011,14 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
})
|
||||
}
|
||||
|
||||
const csvContent = 'data:text/csv;charset=utf-8,' + content.map((e) => e.join(csvSeperator)).join('\n')
|
||||
// escape fields with the csvSeperator in the content
|
||||
// prettier-ignore
|
||||
const csvContent =
|
||||
'data:text/csv;charset=utf-8,' +
|
||||
content.map((entry) =>
|
||||
entry.map((field) => (field.indexOf(csvSeperator) === -1 ? field : `"${field}"`)).join(csvSeperator)
|
||||
).join('\n')
|
||||
|
||||
const link = document.createElement('a')
|
||||
link.setAttribute('href', encodeURI(csvContent))
|
||||
link.setAttribute('download', 'print_history.csv')
|
||||
@@ -1022,7 +1051,7 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
default:
|
||||
switch (typeof value) {
|
||||
case 'number':
|
||||
return value?.toLocaleString(undefined, { useGrouping: false }) ?? 0
|
||||
return value?.toLocaleString(this.browserLocale, { useGrouping: false }) ?? 0
|
||||
|
||||
case 'string':
|
||||
if (escapeChar !== null && value.includes(escapeChar)) value = '"' + value + '"'
|
||||
@@ -1082,3 +1111,13 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .history-jobs-table th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
::v-deep .history-jobs-table th.text-start {
|
||||
padding-right: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,9 +1,7 @@
|
||||
<style scoped></style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.ConfigFiles').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.ConfigFiles')"
|
||||
card-class="machine-configfiles-panel"
|
||||
:icon="mdiInformation"
|
||||
:collapsible="true">
|
||||
@@ -203,6 +201,10 @@
|
||||
<v-icon class="mr-1">{{ mdiRenameBox }}</v-icon>
|
||||
{{ $t('Machine.ConfigFilesPanel.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item v-if="!contextMenu.item.isDirectory" @click="duplicateFile(contextMenu.item)">
|
||||
<v-icon class="mr-1">{{ mdiContentCopy }}</v-icon>
|
||||
{{ $t('Machine.ConfigFilesPanel.Duplicate') }}
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
@click="renameDirectory(contextMenu.item)">
|
||||
@@ -212,7 +214,7 @@
|
||||
<v-list-item
|
||||
v-if="!contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
class="red--text"
|
||||
@click="removeFile">
|
||||
@click="deleteDialog = true">
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Machine.ConfigFilesPanel.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -236,7 +238,7 @@
|
||||
dialogImage.item.svg = null
|
||||
">
|
||||
<panel
|
||||
:title="dialogImage.item.name"
|
||||
:title="dialogImage.item.name ?? ''"
|
||||
card-class="maschine-configfiles-imageviewer-dialog"
|
||||
style="position: relative">
|
||||
<template #buttons>
|
||||
@@ -263,7 +265,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateFile').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateFile')"
|
||||
card-class="maschine-configfiles-create-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -278,7 +280,7 @@
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="createFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -294,7 +296,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameFile').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameFile')"
|
||||
card-class="maschine-configfiles-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -309,7 +311,7 @@
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -323,9 +325,40 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDuplicateFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.DuplicateFile')"
|
||||
card-class="maschine-configfiles-duplicate-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="dialogDuplicateFile.show = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
ref="inputDialoDuplicateFileName"
|
||||
v-model="dialogDuplicateFile.newName"
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="duplicateFileAction" />
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn color="" text @click="dialogDuplicateFile.show = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn :disabled="isInvalidName" color="primary" text @click="duplicateFileAction">
|
||||
{{ $t('Machine.ConfigFilesPanel.Duplicate') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateDirectory').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.CreateDirectory')"
|
||||
card-class="maschine-configfiles-create-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -340,7 +373,7 @@
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -356,7 +389,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameDirectory').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.RenameDirectory')"
|
||||
card-class="maschine-configfiles-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -371,7 +404,7 @@
|
||||
:label="$t('Machine.ConfigFilesPanel.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -387,7 +420,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.DeleteDirectory').toString()"
|
||||
:title="$t('Machine.ConfigFilesPanel.DeleteDirectory')"
|
||||
card-class="maschine-configfiles-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -415,10 +448,42 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE SINGLE FILE DIALOG -->
|
||||
<v-dialog v-model="deleteDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.Delete')"
|
||||
card-class="maschine-configfiles-delete-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
{{
|
||||
$t('Machine.ConfigFilesPanel.DeleteSingleFileQuestion', { name: contextMenu.item.filename })
|
||||
}}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteDialog = false">
|
||||
{{ $t('Machine.ConfigFilesPanel.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="error" text @click="removeFile">
|
||||
{{ $t('Machine.ConfigFilesPanel.Delete') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE MULTIPLE FILES DIALOG -->
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Machine.ConfigFilesPanel.Delete').toString()"
|
||||
card-class="gcode-files-delete-selected-dialog"
|
||||
:title="$t('Machine.ConfigFilesPanel.Delete')"
|
||||
card-class="maschine-configfiles-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteSelectedDialog = false">
|
||||
@@ -426,7 +491,12 @@
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
<p v-if="selectedFiles.length === 1" class="mb-0">
|
||||
{{
|
||||
$t('Machine.ConfigFilesPanel.DeleteSingleFileQuestion', { name: selectedFiles[0].filename })
|
||||
}}
|
||||
</p>
|
||||
<p v-else class="mb-0">
|
||||
{{ $t('Machine.ConfigFilesPanel.DeleteSelectedQuestion', { count: selectedFiles.length }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
@@ -441,6 +511,7 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<v-snackbar v-model="uploadSnackbar.status" :timeout="-1" :value="true" fixed right bottom dark>
|
||||
<span v-if="uploadSnackbar.max > 1" class="mr-1">
|
||||
({{ uploadSnackbar.number }}/{{ uploadSnackbar.max }})
|
||||
@@ -484,6 +555,7 @@ import {
|
||||
mdiDelete,
|
||||
mdiCloseThick,
|
||||
mdiLockOutline,
|
||||
mdiContentCopy,
|
||||
} from '@mdi/js'
|
||||
|
||||
interface contextMenu {
|
||||
@@ -550,6 +622,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
mdiDelete = mdiDelete
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiLockOutline = mdiLockOutline
|
||||
mdiContentCopy = mdiContentCopy
|
||||
|
||||
sortFiles = sortFiles
|
||||
formatFilesize = formatFilesize
|
||||
@@ -558,6 +631,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
fileUpload: HTMLInputElement
|
||||
inputDialogCreateFileName: HTMLInputElement
|
||||
inputDialogRenameFileName: HTMLInputElement
|
||||
inputDialogDuplicateFileName: HTMLInputElement
|
||||
inputDialogCreateDirectoryName: HTMLInputElement
|
||||
inputDialogRenameDirectoryName: HTMLInputElement
|
||||
}
|
||||
@@ -598,6 +672,16 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
modified: new Date(),
|
||||
},
|
||||
}
|
||||
private dialogDuplicateFile: dialogRenameObject = {
|
||||
show: false,
|
||||
newName: '',
|
||||
item: {
|
||||
isDirectory: false,
|
||||
filename: '',
|
||||
permissions: '',
|
||||
modified: new Date(),
|
||||
},
|
||||
}
|
||||
private dialogCreateDirectory = {
|
||||
show: false,
|
||||
name: '',
|
||||
@@ -644,6 +728,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
},
|
||||
}
|
||||
|
||||
private deleteDialog = false
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private isInvalidName = true
|
||||
@@ -962,8 +1047,14 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
await addElementToItems(this.absolutePath, this.selectedFiles)
|
||||
|
||||
const date = new Date()
|
||||
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDay()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
||||
const month = (date.getMonth() + 1).toString().padStart(2, '0')
|
||||
const day = date.getDate().toString().padStart(2, '0')
|
||||
const hours = date.getHours().toString().padStart(2, '0')
|
||||
const minutes = date.getMinutes().toString().padStart(2, '0')
|
||||
const seconds = date.getSeconds().toString().padStart(2, '0')
|
||||
const timestamp = `${date.getFullYear()}${month}${day}-${hours}${minutes}${seconds}`
|
||||
|
||||
this.$socket.emit(
|
||||
'server.files.zip',
|
||||
@@ -1086,12 +1177,32 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
|
||||
)
|
||||
}
|
||||
|
||||
duplicateFile(item: FileStateFile) {
|
||||
this.dialogDuplicateFile.item = item
|
||||
this.dialogDuplicateFile.newName = item.filename
|
||||
this.dialogDuplicateFile.show = true
|
||||
|
||||
setTimeout(() => {
|
||||
this.$refs.inputDialogDuplicateFileName?.focus()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
duplicateFileAction() {
|
||||
this.dialogDuplicateFile.show = false
|
||||
this.$socket.emit('server.files.copy', {
|
||||
source: (this.absolutePath + '/' + this.dialogDuplicateFile.item.filename).slice(1),
|
||||
dest: (this.absolutePath + '/' + this.dialogDuplicateFile.newName).slice(1),
|
||||
})
|
||||
}
|
||||
|
||||
removeFile() {
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: this.absolutePath + '/' + this.contextMenu.item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
this.deleteDialog = false
|
||||
}
|
||||
|
||||
deleteSelectedFiles() {
|
||||
|
||||
@@ -1,63 +1,3 @@
|
||||
<style lang="scss" scoped>
|
||||
.cursor--pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
ul.commits {
|
||||
list-style: none;
|
||||
|
||||
li {
|
||||
border-color: rgb(48, 54, 61);
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-width: 0;
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.v-timeline.groupedCommits {
|
||||
.v-timeline-item__dot--small {
|
||||
width: 18px;
|
||||
height: 15px;
|
||||
margin-top: 2px;
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
content: ' ';
|
||||
position: relative;
|
||||
width: 18px;
|
||||
height: 2px;
|
||||
top: 7px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline-item__inner-dot {
|
||||
background-color: #1e1e1e !important;
|
||||
border: 2px solid rgba(255, 255, 255, 0.5) !important;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-left: 5px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
@@ -85,578 +25,119 @@ ul.commits {
|
||||
<span>{{ $t('Machine.UpdatePanel.CheckForUpdates') }}</span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<v-card-text class="px-0 py-0">
|
||||
<v-container py-0 px-0>
|
||||
<div v-for="(value, key, index) of updateableSoftwares" :key="key">
|
||||
<v-divider v-if="index" class="my-0"></v-divider>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ 'name' in value ? value.name : key }}</strong>
|
||||
<br />
|
||||
<span
|
||||
:class="getVersionClickable(value) ? 'primary--text cursor--pointer' : ''"
|
||||
@click="openCommitsOverlay(key, value)">
|
||||
<v-icon v-if="getVersionClickable(value)" small color="primary" class="mr-1">
|
||||
{{ mdiInformation }}
|
||||
</v-icon>
|
||||
{{ getVersionOutput(value) }}
|
||||
</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<template v-if="getRecoveryOptions(value)">
|
||||
<v-menu :offset-y="true" title="Webcam">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
v-bind="attrs"
|
||||
v-on="on">
|
||||
<v-icon small class="mr-1">{{ getBtnIcon(value) }}</v-icon>
|
||||
{{ getBtnText(value) }}
|
||||
<v-icon small>{{ mdiMenuDown }}</v-icon>
|
||||
</v-chip>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item @click="recovery(key, false)">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ mdiReload }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>Soft Recovery</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-list-item @click="recovery(key, true)">
|
||||
<v-list-item-icon class="mr-0">
|
||||
<v-icon small>{{ mdiReload }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>Hard Recovery</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="getBtnColor(value)"
|
||||
:disabled="getBtnDisabled(value)"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
@click="updateModule(key)">
|
||||
<v-icon small class="mr-1">{{ getBtnIcon(value) }}</v-icon>
|
||||
{{ getBtnText(value) }}
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
<template v-if="'system' in version_info">
|
||||
<v-divider class="my-0 border-top-2"></v-divider>
|
||||
<v-row class="pt-2">
|
||||
<v-col class="col-auto pl-6 text-no-wrap">
|
||||
<strong>{{ $t('Machine.UpdatePanel.System') }}</strong>
|
||||
<br />
|
||||
<v-tooltip v-if="version_info.system.package_count > 0" top :max-width="300">
|
||||
<template #activator="{ on, attrs }">
|
||||
<span v-bind="attrs" v-on="on">
|
||||
{{ version_info.system.package_count }}
|
||||
{{ $t('Machine.UpdatePanel.PackagesCanBeUpgraded') }}
|
||||
</span>
|
||||
</template>
|
||||
<span>{{ version_info.system.package_list.join(', ') }}</span>
|
||||
</v-tooltip>
|
||||
<span v-if="version_info.system.package_count === 0">
|
||||
{{ $t('Machine.UpdatePanel.OSPackages') }}
|
||||
</span>
|
||||
</v-col>
|
||||
<v-col class="pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="version_info.system.package_count ? 'primary' : 'green'"
|
||||
:disabled="!version_info.system.package_count || printer_state === 'printing'"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
@click="updateSystem">
|
||||
<v-icon small class="mr-1">
|
||||
{{ version_info.system.package_count ? mdiProgressUpload : mdiCheck }}
|
||||
</v-icon>
|
||||
{{
|
||||
version_info.system.package_count
|
||||
? $t('Machine.UpdatePanel.Upgrade')
|
||||
: $t('Machine.UpdatePanel.UpToDate')
|
||||
}}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-card-text class="px-0 py-0 update-manager-list">
|
||||
<template v-if="checkInitState">
|
||||
<template v-for="(module, index) in modules">
|
||||
<v-divider v-if="index" :key="'divider_' + module.name" class="my-0" />
|
||||
<update-panel-entry :key="module.name" :repo="module.data" />
|
||||
</template>
|
||||
<template v-if="existsSystemModul">
|
||||
<v-divider v-if="modules.length" class="my-0" />
|
||||
<update-panel-entry-system />
|
||||
</template>
|
||||
<template v-if="showUpdateAll">
|
||||
<v-divider class="mb-0 mt-2 border-top-2"></v-divider>
|
||||
<v-row class="pt-3">
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
text
|
||||
color="primary"
|
||||
small
|
||||
:disabled="['printing', 'paused'].includes(printer_state)"
|
||||
@click="updateAll">
|
||||
<v-icon left>{{ mdiProgressUpload }}</v-icon>
|
||||
{{ $t('Machine.UpdatePanel.UpdateAll') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-divider class="mb-0 mt-2 border-top-2" />
|
||||
<update-panel-entry-all />
|
||||
</template>
|
||||
</v-container>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-row class="mt-0 mb-0">
|
||||
<v-col class="px-6">
|
||||
<v-alert class="mb-0" text dense type="info" border="left">
|
||||
{{ $t('Machine.UpdatePanel.InitUpdateManager') }}
|
||||
</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
<v-dialog v-model="commitsOverlay.bool" persistent max-width="800">
|
||||
<panel
|
||||
:title="$t('Machine.UpdatePanel.Commits')"
|
||||
:icon="mdiUpdate"
|
||||
:margin-bottom="false"
|
||||
card-class="machine-update-commits-dialog">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="commitsOverlay.bool = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text class="py-0 px-0">
|
||||
<overlay-scrollbars style="max-height: 400px" :options="{ overflowBehavior: { x: 'hidden' } }">
|
||||
<v-row>
|
||||
<v-col class="pt-3 pl-0">
|
||||
<v-timeline class="groupedCommits" align-top dense>
|
||||
<v-timeline-item
|
||||
v-for="group of commitsOverlay.groupedCommits"
|
||||
:key="group.date.getTime()"
|
||||
small>
|
||||
<v-row class="pt-0">
|
||||
<v-col class="pr-12">
|
||||
<h3 class="caption">
|
||||
{{
|
||||
$t('Machine.UpdatePanel.CommitsOnDate', {
|
||||
date: new Date(group.date).toLocaleDateString(
|
||||
language,
|
||||
dateOptions
|
||||
),
|
||||
})
|
||||
}}
|
||||
</h3>
|
||||
<ul class="commits mt-3 pl-0">
|
||||
<li
|
||||
v-for="commit of group.commits"
|
||||
:key="commit.sha"
|
||||
class="commit px-3 py-2">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<h4 class="subtitle-2 text--white mb-0">
|
||||
{{ commit.subject }}
|
||||
<v-chip
|
||||
v-if="!openCommits.includes(commit.sha)"
|
||||
outlined
|
||||
label
|
||||
x-small
|
||||
class="ml-2 px-2"
|
||||
@click="openCommits.push(commit.sha)">
|
||||
<v-icon small>{{ mdiDotsHorizontal }}</v-icon>
|
||||
</v-chip>
|
||||
</h4>
|
||||
<p
|
||||
v-if="openCommits.includes(commit.sha)"
|
||||
class="caption text--secondary mb-2"
|
||||
style="white-space: pre-line"
|
||||
v-html="commit.message"></p>
|
||||
<p class="caption mb-0">
|
||||
<span
|
||||
class="font-weight-bold text-decoration-none white--text">
|
||||
{{ commit.author }}
|
||||
</span>
|
||||
<span>{{ convertCommitDate(commit.date) }}</span>
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col class="col-auto pt-4">
|
||||
<v-chip
|
||||
outlined
|
||||
label
|
||||
small
|
||||
:href="
|
||||
'https://github.com/' +
|
||||
commitsOverlay.owner +
|
||||
'/' +
|
||||
commitsOverlay.repoName +
|
||||
'/commit/' +
|
||||
commit.sha
|
||||
"
|
||||
target="_blank">
|
||||
{{ commit.sha.substr(0, 6) }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</li>
|
||||
</ul>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</overlay-scrollbars>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '../../mixins/base'
|
||||
import semver from 'semver'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { ServerUpdateMangerStateVersionInfoGitRepoCommits } from '@/store/server/updateManager/types'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import DateTimeFormatOptions = VueI18n.DateTimeFormatOptions
|
||||
import {
|
||||
mdiRefresh,
|
||||
mdiAlertCircle,
|
||||
mdiCheck,
|
||||
mdiHelpCircleOutline,
|
||||
mdiInformation,
|
||||
mdiMenuDown,
|
||||
mdiProgressUpload,
|
||||
mdiReload,
|
||||
mdiDotsHorizontal,
|
||||
mdiCloseThick,
|
||||
mdiUpdate,
|
||||
} from '@mdi/js'
|
||||
|
||||
interface groupedCommit {
|
||||
date: Date
|
||||
commits: ServerUpdateMangerStateVersionInfoGitRepoCommits[]
|
||||
}
|
||||
|
||||
interface commitsOverlay {
|
||||
bool: boolean
|
||||
owner: string
|
||||
modul: string
|
||||
repoName: string
|
||||
commits: ServerUpdateMangerStateVersionInfoGitRepoCommits[]
|
||||
groupedCommits: groupedCommit[]
|
||||
}
|
||||
import UpdatePanelEntry from '@/components/panels/Machine/UpdatePanel/Entry.vue'
|
||||
import UpdatePanelEntrySystem from '@/components/panels/Machine/UpdatePanel/EntrySystem.vue'
|
||||
import UpdatePanelEntryAll from '@/components/panels/Machine/UpdatePanel/EntryAll.vue'
|
||||
import { mdiRefresh, mdiInformation, mdiCloseThick, mdiUpdate } from '@mdi/js'
|
||||
import { ServerUpdateManagerStateGuiList } from '@/store/server/updateManager/types'
|
||||
import semver from 'semver'
|
||||
|
||||
@Component({
|
||||
components: { Panel },
|
||||
components: { Panel, UpdatePanelEntry, UpdatePanelEntrySystem, UpdatePanelEntryAll },
|
||||
})
|
||||
export default class UpdatePanel extends Mixins(BaseMixin) {
|
||||
mdiCheck = mdiCheck
|
||||
mdiRefresh = mdiRefresh
|
||||
mdiInformation = mdiInformation
|
||||
mdiMenuDown = mdiMenuDown
|
||||
mdiReload = mdiReload
|
||||
mdiProgressUpload = mdiProgressUpload
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiDotsHorizontal = mdiDotsHorizontal
|
||||
mdiUpdate = mdiUpdate
|
||||
|
||||
private openCommits: string[] = []
|
||||
|
||||
private dateOptions: DateTimeFormatOptions = {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
}
|
||||
|
||||
private commitsOverlay: commitsOverlay = {
|
||||
bool: false,
|
||||
owner: '',
|
||||
modul: '',
|
||||
repoName: '',
|
||||
commits: [],
|
||||
groupedCommits: [],
|
||||
}
|
||||
|
||||
get language() {
|
||||
return this.$store.state.gui.general.language ?? 'en'
|
||||
}
|
||||
|
||||
get enableUpdateManager() {
|
||||
return this.$store.state.server.components.includes('update_manager')
|
||||
}
|
||||
|
||||
get version_info() {
|
||||
return this.$store.state.server.updateManager.version_info
|
||||
get modules() {
|
||||
return this.$store.getters['server/updateManager/getUpdateManagerList'] ?? []
|
||||
}
|
||||
|
||||
get updateableSoftwares() {
|
||||
return this.$store.getters['server/updateManager/getUpdateableSoftwares']
|
||||
get existsSystemModul() {
|
||||
return 'system' in this.$store.state.server.updateManager
|
||||
}
|
||||
|
||||
get systemPackagesCount() {
|
||||
return this.$store.state.server.updateManager?.system?.package_count ?? 0
|
||||
}
|
||||
|
||||
get checkInitState() {
|
||||
const initModules = this.modules.filter(
|
||||
(module: ServerUpdateManagerStateGuiList) => module.data.remote_version !== '?'
|
||||
)
|
||||
|
||||
return initModules.length > 0
|
||||
}
|
||||
|
||||
get showUpdateAll() {
|
||||
let updateableModuls = 0
|
||||
let count = 0
|
||||
|
||||
Object.keys(this.updateableSoftwares).forEach((modulename) => {
|
||||
const module = this.updateableSoftwares[modulename]
|
||||
this.modules.forEach((module: ServerUpdateManagerStateGuiList) => {
|
||||
// check git repos for updates
|
||||
if (module.type === 'git' && module.data?.commits_behind?.length) {
|
||||
count++
|
||||
return
|
||||
}
|
||||
|
||||
// check client web for updates
|
||||
if (
|
||||
'version' in module &&
|
||||
'remote_version' in module &&
|
||||
semver.valid(module.remote_version) &&
|
||||
semver.valid(module.version) &&
|
||||
semver.gt(module.remote_version, module.version)
|
||||
)
|
||||
updateableModuls++
|
||||
module.type === 'web' &&
|
||||
semver.valid(module.data?.remote_version) &&
|
||||
semver.valid(module.data?.version) &&
|
||||
semver.gt(module.data?.remote_version, module.data?.version)
|
||||
) {
|
||||
count++
|
||||
return
|
||||
}
|
||||
})
|
||||
|
||||
if (this.version_info?.system?.package_count > 0) updateableModuls++
|
||||
return updateableModuls > 1
|
||||
// check system packages for upgrades
|
||||
if (this.systemPackagesCount > 0) count++
|
||||
|
||||
return count > 1
|
||||
}
|
||||
|
||||
btnSync() {
|
||||
this.$socket.emit(
|
||||
'machine.update.status',
|
||||
{ refresh: true },
|
||||
{ action: 'server/updateManager/getStatus', loading: 'loadingBtnSyncUpdateManager' }
|
||||
{ action: 'server/updateManager/onUpdateStatus', loading: 'loadingBtnSyncUpdateManager' }
|
||||
)
|
||||
}
|
||||
|
||||
getBtnColor(object: any) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('debug_enabled' in object && !object.debug_enabled && 'detached' in object && object.detached)
|
||||
return 'orange'
|
||||
if ('is_dirty' in object && object.is_dirty) return 'orange'
|
||||
if ('is_valid' in object && !object.is_valid) return 'red'
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
)
|
||||
return 'primary'
|
||||
|
||||
if ((object.commits_behind ?? []).length) return 'primary'
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
(object.version === '?' || object.remote_version === '?')
|
||||
)
|
||||
return 'gray'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
|
||||
return 'red'
|
||||
}
|
||||
|
||||
getBtnText(object: any) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('debug_enabled' in object && !object.debug_enabled && 'detached' in object && object.detached)
|
||||
return this.$t('Machine.UpdatePanel.Detached')
|
||||
if ('is_valid' in object && !object.is_valid) return this.$t('Machine.UpdatePanel.Invalid')
|
||||
if ('is_dirty' in object && object.is_dirty) return this.$t('Machine.UpdatePanel.Dirty')
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
)
|
||||
return this.$t('Machine.UpdatePanel.Update')
|
||||
|
||||
if ((object.commits_behind ?? []).length) return this.$t('Machine.UpdatePanel.Update')
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
(object.version === '?' || object.remote_version === '?')
|
||||
)
|
||||
return this.$t('Machine.UpdatePanel.Unknown')
|
||||
|
||||
return this.$t('Machine.UpdatePanel.UpToDate')
|
||||
}
|
||||
|
||||
return this.$t('Machine.UpdatePanel.ERROR')
|
||||
}
|
||||
|
||||
getBtnIcon(object: any) {
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ('debug_enabled' in object && !object.debug_enabled && 'detached' in object && object.detached)
|
||||
return mdiAlertCircle
|
||||
if ('is_valid' in object && !object.is_valid) return mdiAlertCircle
|
||||
if ('is_dirty' in object && object.is_dirty) return mdiAlertCircle
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
)
|
||||
return mdiProgressUpload
|
||||
|
||||
if ((object.commits_behind ?? []).length) return mdiProgressUpload
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
(object.version === '?' || object.remote_version === '?')
|
||||
)
|
||||
return mdiHelpCircleOutline
|
||||
|
||||
return mdiCheck
|
||||
}
|
||||
|
||||
return 'ERROR'
|
||||
}
|
||||
|
||||
getBtnDisabled(object: any) {
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return true
|
||||
|
||||
if ('is_valid' in object && !object.is_valid) return false
|
||||
if ('is_dirty' in object && object.is_dirty) return false
|
||||
|
||||
if (typeof object === 'object' && object !== false) {
|
||||
if ((object.commits_behind ?? []).length) return false
|
||||
|
||||
if (
|
||||
'version' in object &&
|
||||
'remote_version' in object &&
|
||||
semver.valid(object.remote_version) &&
|
||||
semver.valid(object.version) &&
|
||||
semver.gt(object.remote_version, object.version)
|
||||
)
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
getVersionOutput(object: any) {
|
||||
const local_version = object.version ?? '?'
|
||||
const remote_version = object.remote_version ?? '?'
|
||||
const commits_behind = object.commits_behind ?? []
|
||||
|
||||
let output = ''
|
||||
if ('remote_alias' in object && object.remote_alias !== 'origin') output += object.remote_alias
|
||||
if ('branch' in object && !['master', 'main'].includes(object.branch)) {
|
||||
if (output !== '') output += '/'
|
||||
|
||||
output += object.branch
|
||||
}
|
||||
if (output !== '') output += ': '
|
||||
|
||||
if (semver.valid(remote_version) && semver.valid(local_version) && semver.gt(remote_version, local_version))
|
||||
output += local_version + ' > ' + remote_version
|
||||
else if (commits_behind.length)
|
||||
output +=
|
||||
local_version +
|
||||
' > ' +
|
||||
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
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
getVersionClickable(object: any) {
|
||||
return 'commits_behind' in object && object.commits_behind.length
|
||||
}
|
||||
|
||||
getRecoveryOptions(object: any) {
|
||||
if ('is_valid' in object && !object.is_valid) return true
|
||||
else if ('is_dirty' in object && object.is_dirty) return true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
updateAll() {
|
||||
this.$socket.emit('machine.update.full', {})
|
||||
}
|
||||
|
||||
updateModule(key: string) {
|
||||
if (['klipper', 'moonraker'].includes(key)) this.$socket.emit('machine.update.' + key, {})
|
||||
else this.$socket.emit('machine.update.client', { name: key })
|
||||
}
|
||||
|
||||
recovery(name: string, hard: boolean) {
|
||||
this.$socket.emit('machine.update.recover', { name: name, hard: hard })
|
||||
}
|
||||
|
||||
updateSystem() {
|
||||
this.$socket.emit('machine.update.system', {})
|
||||
}
|
||||
|
||||
openCommitsOverlay(key: string, object: any) {
|
||||
if ('commits_behind' in object && 'owner' in object && object.commits_behind.length) {
|
||||
this.openCommits = []
|
||||
this.commitsOverlay.owner = object.owner
|
||||
this.commitsOverlay.modul = key
|
||||
this.commitsOverlay.repoName = object.repo_name ?? key
|
||||
this.commitsOverlay.commits = object.commits_behind
|
||||
this.commitsOverlay.groupedCommits = []
|
||||
|
||||
let lastDate: null | Date = null
|
||||
let tmpCommits: ServerUpdateMangerStateVersionInfoGitRepoCommits[] = []
|
||||
|
||||
object.commits_behind.forEach((commit: any) => {
|
||||
const commitDate = new Date(commit.date * 1000)
|
||||
if (
|
||||
lastDate === null ||
|
||||
commitDate.getFullYear() !== lastDate.getFullYear() ||
|
||||
commitDate.getMonth() !== lastDate.getMonth() ||
|
||||
commitDate.getDay() !== lastDate.getDay()
|
||||
) {
|
||||
if (tmpCommits.length && lastDate !== null) {
|
||||
this.commitsOverlay.groupedCommits.push({
|
||||
date: lastDate,
|
||||
commits: [...tmpCommits],
|
||||
})
|
||||
}
|
||||
|
||||
lastDate = commitDate
|
||||
tmpCommits = []
|
||||
}
|
||||
|
||||
tmpCommits.push(commit)
|
||||
})
|
||||
|
||||
if (lastDate && tmpCommits.length) {
|
||||
this.commitsOverlay.groupedCommits.push({
|
||||
date: lastDate,
|
||||
commits: [...tmpCommits],
|
||||
})
|
||||
}
|
||||
|
||||
this.commitsOverlay.bool = true
|
||||
}
|
||||
}
|
||||
|
||||
convertCommitDate(timestamp: number) {
|
||||
const commitDay = new Date(timestamp * 1000)
|
||||
commitDay.setHours(0, 0, 0, 0)
|
||||
const todayDay = new Date()
|
||||
todayDay.setHours(0, 0, 0, 0)
|
||||
const diff = Math.floor(todayDay.getTime() - commitDay.getTime()) / (1000 * 60 * 60 * 24)
|
||||
|
||||
if (diff === 0) {
|
||||
const diffHours = Math.floor((new Date().getTime() - timestamp * 1000) / (1000 * 60 * 60))
|
||||
|
||||
return this.$t('Machine.UpdatePanel.CommittedHoursAgo', { hours: diffHours })
|
||||
} else if (diff === 1) return this.$t('Machine.UpdatePanel.CommittedYesterday')
|
||||
else if (diff < 29) return this.$t('Machine.UpdatePanel.CommittedDaysAgo', { days: diff })
|
||||
else
|
||||
return this.$t('Machine.UpdatePanel.CommittedOnDate', {
|
||||
date: commitDay.toLocaleDateString(this.language, this.dateOptions),
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .update-manager-list > div:last-child > div.row {
|
||||
padding-bottom: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,371 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ repo.name }}</strong>
|
||||
<br />
|
||||
<template v-if="type === 'git_repo' && commitsBehind.length">
|
||||
<a class="info--text cursor--pointer" @click="boolShowCommitList = true">
|
||||
<v-icon small color="info" class="mr-1">{{ mdiUpdate }}</v-icon>
|
||||
{{ versionOutput }}
|
||||
</a>
|
||||
</template>
|
||||
<template v-else-if="type === 'web' && webUpdatable">
|
||||
<a class="info--text text-decoration-none" :href="webLinkRelease" target="_blank">
|
||||
<v-icon small color="info" class="mr-1">{{ mdiUpdate }}</v-icon>
|
||||
{{ versionOutput }}
|
||||
</a>
|
||||
</template>
|
||||
<span v-else>{{ versionOutput }}</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
v-if="anomalies.length > 0"
|
||||
small
|
||||
label
|
||||
:outlined="!toggleAnomalies"
|
||||
color="grey"
|
||||
class="minwidth-0 px-1 mr-2"
|
||||
@click="toggleAnomalies = !toggleAnomalies">
|
||||
<v-icon small>{{ toggleAnomalies ? mdiInformationOutline : mdiInformation }}</v-icon>
|
||||
</v-chip>
|
||||
<template v-if="!isValid">
|
||||
<v-menu :offset-y="true">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="btnColor"
|
||||
:disabled="btnDisabled"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
v-bind="attrs"
|
||||
v-on="on">
|
||||
<v-icon small class="mr-1">{{ btnIcon }}</v-icon>
|
||||
{{ btnText }}
|
||||
<v-icon small>{{ mdiMenuDown }}</v-icon>
|
||||
</v-chip>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item v-if="!isCorrupt" @click="doRecovery(false)">
|
||||
<v-list-item-icon class="mr-0 pt-1">
|
||||
<v-icon small>{{ mdiReload }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t('Machine.UpdatePanel.SoftRecovery') }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
<v-list-item :disabled="!existsRecoveryUrl" @click="doRecovery(true)">
|
||||
<v-list-item-icon class="mr-0 pt-1">
|
||||
<v-icon small>{{ mdiReload }}</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title>{{ $t('Machine.UpdatePanel.HardRecovery') }}</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</template>
|
||||
<v-chip
|
||||
v-else
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="btnColor"
|
||||
:disabled="btnDisabled"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
@click="clickUpdate">
|
||||
<v-icon small class="mr-1">{{ btnIcon }}</v-icon>
|
||||
{{ btnText }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="warnings.length" class="mt-0">
|
||||
<v-col class="px-6 pt-0">
|
||||
<v-alert
|
||||
v-for="(message, index) in warnings"
|
||||
:key="'warnings_' + index"
|
||||
dense
|
||||
text
|
||||
color="orange"
|
||||
border="left"
|
||||
:icon="mdiCloseCircle">
|
||||
<p class="text--disabled mb-0">{{ message }}</p>
|
||||
</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-show="toggleAnomalies" class="mt-0">
|
||||
<v-col class="px-6 pt-0">
|
||||
<v-alert
|
||||
v-for="(message, index) in anomalies"
|
||||
:key="'anomalies_' + index"
|
||||
dense
|
||||
text
|
||||
color="grey"
|
||||
border="left"
|
||||
:icon="mdiInformation">
|
||||
{{ message }}
|
||||
</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<git-commits-list
|
||||
v-if="type === 'git_repo'"
|
||||
:bool-show-dialog="boolShowCommitList"
|
||||
:repo="repo"
|
||||
@close-dialog="closeCommitList" />
|
||||
<update-hint
|
||||
:bool-show-dialog="boolShowUpdateHint"
|
||||
:repo="repo"
|
||||
@open-commit-history="boolShowCommitList = true"
|
||||
@do-update="doUpdate"
|
||||
@close-dialog="closeShowUpdateHint" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerUpdateManagerStateGitRepo } from '@/store/server/updateManager/types'
|
||||
import {
|
||||
mdiCloseCircle,
|
||||
mdiCheck,
|
||||
mdiHelpCircleOutline,
|
||||
mdiInformation,
|
||||
mdiInformationOutline,
|
||||
mdiMenuDown,
|
||||
mdiProgressUpload,
|
||||
mdiReload,
|
||||
mdiUpdate,
|
||||
} from '@mdi/js'
|
||||
import semver from 'semver'
|
||||
import GitCommitsList from '@/components/panels/Machine/UpdatePanel/GitCommitsList.vue'
|
||||
import UpdateHint from '@/components/panels/Machine/UpdatePanel/UpdateHint.vue'
|
||||
@Component({
|
||||
components: { GitCommitsList, UpdateHint },
|
||||
})
|
||||
export default class UpdatePanelEntry extends Mixins(BaseMixin) {
|
||||
mdiInformation = mdiInformation
|
||||
mdiMenuDown = mdiMenuDown
|
||||
mdiReload = mdiReload
|
||||
mdiCloseCircle = mdiCloseCircle
|
||||
mdiUpdate = mdiUpdate
|
||||
mdiInformationOutline = mdiInformationOutline
|
||||
|
||||
boolShowCommitList = false
|
||||
boolShowUpdateHint = false
|
||||
|
||||
toggleAnomalies = false
|
||||
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo
|
||||
|
||||
get name() {
|
||||
return this.repo.name ?? 'UNKNOWN'
|
||||
}
|
||||
|
||||
get type() {
|
||||
return this.repo.configured_type
|
||||
}
|
||||
|
||||
get localVersion() {
|
||||
const version = this.repo.version ?? '?'
|
||||
|
||||
if (!semver.valid(version)) return null
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
get remoteVersion() {
|
||||
const version = this.repo.remote_version ?? '?'
|
||||
|
||||
if (!semver.valid(version)) return null
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
get branch() {
|
||||
return this.repo.branch ?? 'master'
|
||||
}
|
||||
|
||||
get remoteAlias() {
|
||||
return this.repo.remote_alias ?? 'origin'
|
||||
}
|
||||
|
||||
get branchOutput() {
|
||||
if (this.remoteAlias !== 'origin') return `${this.remoteAlias}/${this.branch}`
|
||||
if (!['master', 'main'].includes(this.branch)) return this.branch
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get commitsBehind() {
|
||||
return this.repo.commits_behind ?? []
|
||||
}
|
||||
|
||||
get fullVersionString() {
|
||||
return this.repo.full_version_string ?? null
|
||||
}
|
||||
|
||||
get versionOutput() {
|
||||
let output = this.branchOutput ? `${this.branchOutput}: ` : ''
|
||||
|
||||
if (this.localVersion && this.remoteVersion && semver.gt(this.remoteVersion, this.localVersion)) {
|
||||
return `${output}${this.localVersion} > ${this.remoteVersion}`
|
||||
}
|
||||
|
||||
if (this.commitsBehind.length) {
|
||||
const tmp = this.$tc('Machine.UpdatePanel.CommitsAvailable', this.commitsBehind.length, {
|
||||
count: this.commitsBehind.length,
|
||||
}).toString()
|
||||
|
||||
if (this.localVersion) return `${output}${this.localVersion} > ${tmp}`
|
||||
|
||||
return `${output}${tmp}`
|
||||
}
|
||||
|
||||
if (this.fullVersionString) return this.fullVersionString
|
||||
if (this.localVersion) return this.localVersion
|
||||
|
||||
return 'UNKNOWN'
|
||||
}
|
||||
|
||||
get configuredType() {
|
||||
return this.repo.configured_type ?? 'git_repo'
|
||||
}
|
||||
|
||||
get isValid() {
|
||||
return this.repo.is_valid ?? true
|
||||
}
|
||||
|
||||
get isDirty() {
|
||||
return this.repo.is_dirty ?? false
|
||||
}
|
||||
|
||||
get isCorrupt() {
|
||||
return this.repo.corrupt ?? false
|
||||
}
|
||||
|
||||
get debugEnabled() {
|
||||
return this.repo.debug_enabled ?? false
|
||||
}
|
||||
|
||||
get isDetached() {
|
||||
if (this.configuredType !== 'git_repo') return false
|
||||
|
||||
return !this.debugEnabled && (this.repo.detached ?? false)
|
||||
}
|
||||
|
||||
get existsRecoveryUrl() {
|
||||
const url = this.repo.recovery_url ?? '?'
|
||||
|
||||
return url !== '?'
|
||||
}
|
||||
|
||||
get btnDisabled() {
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return true
|
||||
if (!this.isValid || this.isCorrupt || this.isDirty || this.commitsBehind.length) return false
|
||||
|
||||
return !(this.localVersion && this.remoteVersion && semver.gt(this.remoteVersion, this.localVersion))
|
||||
}
|
||||
|
||||
get btnIcon() {
|
||||
if (this.isDetached || !this.isValid || this.isCorrupt || this.isDirty) return mdiCloseCircle
|
||||
|
||||
if (
|
||||
this.commitsBehind.length ||
|
||||
(this.localVersion && this.remoteVersion && semver.gt(this.remoteVersion, this.localVersion))
|
||||
)
|
||||
return mdiProgressUpload
|
||||
|
||||
if (this.localVersion === null || this.remoteVersion === null) return mdiHelpCircleOutline
|
||||
|
||||
return mdiCheck
|
||||
}
|
||||
|
||||
get btnColor() {
|
||||
if (this.isCorrupt || this.isDetached || this.isDirty || !this.isValid) return 'orange'
|
||||
|
||||
if (
|
||||
this.commitsBehind.length ||
|
||||
(this.localVersion && this.remoteVersion && semver.gt(this.remoteVersion, this.localVersion))
|
||||
)
|
||||
return 'primary'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
|
||||
get btnText() {
|
||||
if (this.isCorrupt) return this.$t('Machine.UpdatePanel.Corrupt')
|
||||
if (this.isDetached) return this.$t('Machine.UpdatePanel.Detached')
|
||||
if (this.isDirty) return this.$t('Machine.UpdatePanel.Dirty')
|
||||
if (!this.isValid) return this.$t('Machine.UpdatePanel.Invalid')
|
||||
if (
|
||||
this.commitsBehind.length ||
|
||||
(this.localVersion && this.remoteVersion && semver.gt(this.remoteVersion, this.localVersion))
|
||||
)
|
||||
return this.$t('Machine.UpdatePanel.Update')
|
||||
|
||||
if (this.localVersion === null || this.remoteVersion === null) return this.$t('Machine.UpdatePanel.Unknown')
|
||||
|
||||
return this.$t('Machine.UpdatePanel.UpToDate')
|
||||
}
|
||||
|
||||
get anomalies() {
|
||||
return this.repo.anomalies ?? []
|
||||
}
|
||||
|
||||
get warnings() {
|
||||
return this.repo.warnings ?? []
|
||||
}
|
||||
|
||||
get webUpdatable() {
|
||||
if (!this.localVersion) return false
|
||||
if (!this.remoteVersion) return false
|
||||
|
||||
return semver.gt(this.remoteVersion, this.localVersion)
|
||||
}
|
||||
|
||||
get repo_name() {
|
||||
return this.repo.repo_name ?? this.repo.name ?? ''
|
||||
}
|
||||
|
||||
get webLinkRelease() {
|
||||
return `https://github.com/${this.repo.owner}/${this.repo_name}/releases/tag/${this.repo.remote_version}`
|
||||
}
|
||||
|
||||
get hideUpdateWarning() {
|
||||
return this.$store.state.gui.uiSettings.hideUpdateWarnings ?? false
|
||||
}
|
||||
|
||||
clickUpdate() {
|
||||
if (this.hideUpdateWarning) {
|
||||
this.doUpdate()
|
||||
return
|
||||
}
|
||||
|
||||
this.boolShowUpdateHint = true
|
||||
}
|
||||
|
||||
doUpdate() {
|
||||
if (['klipper', 'moonraker'].includes(this.repo.name)) {
|
||||
this.$socket.emit('machine.update.' + this.repo.name, {})
|
||||
return
|
||||
}
|
||||
|
||||
this.$socket.emit('machine.update.client', { name: this.repo.name })
|
||||
}
|
||||
|
||||
doRecovery(hard: boolean) {
|
||||
this.$socket.emit('machine.update.recover', { name: this.repo.name, hard: hard })
|
||||
}
|
||||
|
||||
closeCommitList() {
|
||||
this.boolShowCommitList = false
|
||||
}
|
||||
|
||||
closeShowUpdateHint() {
|
||||
this.boolShowUpdateHint = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-row class="pt-3">
|
||||
<v-col class="text-center">
|
||||
<v-btn
|
||||
text
|
||||
color="primary"
|
||||
small
|
||||
:disabled="['printing', 'paused'].includes(printer_state)"
|
||||
@click="clickUpdate">
|
||||
<v-icon left>{{ mdiProgressUpload }}</v-icon>
|
||||
{{ $t('Machine.UpdatePanel.UpdateAll') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<update-hint-all
|
||||
:bool-show-dialog="boolShowDialog"
|
||||
@close-dialog="boolShowDialog = false"
|
||||
@update-all="updateAll" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiProgressUpload } from '@mdi/js'
|
||||
import UpdateHintAll from '@/components/panels/Machine/UpdatePanel/UpdateHintAll.vue'
|
||||
@Component({
|
||||
components: { UpdateHintAll },
|
||||
})
|
||||
export default class UpdatePanelEntryAll extends Mixins(BaseMixin) {
|
||||
mdiProgressUpload = mdiProgressUpload
|
||||
|
||||
boolShowDialog = false
|
||||
|
||||
get hideUpdateWarning() {
|
||||
return this.$store.state.gui.uiSettings.hideUpdateWarnings ?? false
|
||||
}
|
||||
|
||||
clickUpdate() {
|
||||
if (this.hideUpdateWarning) {
|
||||
this.updateAll()
|
||||
return
|
||||
}
|
||||
|
||||
this.boolShowDialog = true
|
||||
}
|
||||
|
||||
updateAll() {
|
||||
this.$socket.emit('machine.update.full', {})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-row class="py-2">
|
||||
<v-col class="pl-6">
|
||||
<strong>{{ $t('Machine.UpdatePanel.System') }}</strong>
|
||||
<br />
|
||||
<template v-if="package_count">
|
||||
<a class="info--text cursor--pointer" @click="boolShowPackageList = true">
|
||||
<v-icon small color="info" class="mr-1">{{ mdiInformation }}</v-icon>
|
||||
{{ $t('Machine.UpdatePanel.CountPackagesCanBeUpgraded', { count: package_count }) }}
|
||||
</a>
|
||||
</template>
|
||||
<span v-else>{{ $t('Machine.UpdatePanel.OSPackages') }}</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto pr-6 text-right" align-self="center">
|
||||
<v-chip
|
||||
small
|
||||
label
|
||||
outlined
|
||||
:color="btnColor"
|
||||
:disabled="btnDisabled"
|
||||
class="minwidth-0 px-2 text-uppercase"
|
||||
@click="doUpdate">
|
||||
<v-icon small class="mr-1">{{ btnIcon }}</v-icon>
|
||||
{{ btnText }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<system-packages-list
|
||||
:bool-show-dialog="boolShowPackageList"
|
||||
:packages-list="package_list"
|
||||
@close-dialog="closePackagesList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiCheck, mdiInformation, mdiProgressUpload } from '@mdi/js'
|
||||
@Component
|
||||
export default class UpdatePanelEntrySystem extends Mixins(BaseMixin) {
|
||||
mdiInformation = mdiInformation
|
||||
|
||||
// to display the dialog for packages
|
||||
boolShowPackageList = false
|
||||
|
||||
get package_count() {
|
||||
return this.$store.state.server.updateManager?.system?.package_count ?? 0
|
||||
}
|
||||
|
||||
get package_list() {
|
||||
return this.$store.state.server.updateManager?.system?.package_list ?? []
|
||||
}
|
||||
|
||||
get btnDisabled() {
|
||||
// disable button if the printer is printing
|
||||
if (['printing', 'paused'].includes(this.printer_state)) return true
|
||||
|
||||
// disable button if no package is available to update
|
||||
return this.package_count === 0
|
||||
}
|
||||
|
||||
get btnIcon() {
|
||||
if (this.package_count) return mdiProgressUpload
|
||||
|
||||
return mdiCheck
|
||||
}
|
||||
|
||||
get btnColor() {
|
||||
// set button to primary, if updates are available
|
||||
if (this.package_count) return 'primary'
|
||||
|
||||
return 'green'
|
||||
}
|
||||
|
||||
get btnText() {
|
||||
if (this.package_count) return this.$t('Machine.UpdatePanel.Upgrade')
|
||||
|
||||
return this.$t('Machine.UpdatePanel.UpToDate')
|
||||
}
|
||||
|
||||
doUpdate() {
|
||||
this.$socket.emit('machine.update.system', {})
|
||||
}
|
||||
|
||||
closePackagesList() {
|
||||
this.boolShowPackageList = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -0,0 +1,164 @@
|
||||
<template>
|
||||
<v-dialog v-model="boolShowDialog" persistent max-width="800">
|
||||
<panel
|
||||
:title="$t('Machine.UpdatePanel.Commits')"
|
||||
:icon="mdiUpdate"
|
||||
:margin-bottom="false"
|
||||
card-class="machine-update-commits-dialog">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="closeDialog">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text class="py-0 px-0">
|
||||
<overlay-scrollbars style="max-height: 400px" :options="{ overflowBehavior: { x: 'hidden' } }">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-timeline class="groupedCommits" align-top dense>
|
||||
<git-commits-list-day
|
||||
v-for="group of groupedCommits"
|
||||
:key="group.date.getTime()"
|
||||
:repo="repo"
|
||||
:grouped-commits="group" />
|
||||
<v-timeline-item
|
||||
v-if="displayFullHistoryWaring"
|
||||
small
|
||||
class="git-commit-list-day git-commit-list-warning">
|
||||
<v-row class="pt-0">
|
||||
<v-col class="pr-12">
|
||||
<v-alert dense text type="info">
|
||||
<p>{{ $t('Machine.UpdatePanel.MoreCommitsInfo') }}</p>
|
||||
<div class="text-center mb-3">
|
||||
<v-btn :href="linkToGithub" target="_blank">
|
||||
{{ $t('Machine.UpdatePanel.LinkToGithub') }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-timeline-item>
|
||||
</v-timeline>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</overlay-scrollbars>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import {
|
||||
ServerUpdateManagerStateGitRepo,
|
||||
ServerUpdateManagerStateGitRepoCommit,
|
||||
ServerUpdateManagerStateGitRepoGroupedCommits,
|
||||
} from '@/store/server/updateManager/types'
|
||||
import { mdiUpdate, mdiCloseThick } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import GitCommitsListDay from '@/components/panels/Machine/UpdatePanel/GitCommitsListDay.vue'
|
||||
|
||||
@Component({
|
||||
components: { GitCommitsListDay, Panel },
|
||||
})
|
||||
export default class GitCommitsList extends Mixins(BaseMixin) {
|
||||
mdiUpdate = mdiUpdate
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
@Prop({ required: true }) readonly boolShowDialog!: boolean
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo | null
|
||||
|
||||
get commitsBehind(): ServerUpdateManagerStateGitRepoCommit[] {
|
||||
return this.repo?.commits_behind ?? []
|
||||
}
|
||||
|
||||
get groupedCommits() {
|
||||
let output: ServerUpdateManagerStateGitRepoGroupedCommits[] = []
|
||||
let lastCommit: ServerUpdateManagerStateGitRepoCommit | null = null
|
||||
|
||||
this.commitsBehind.forEach((commit: any) => {
|
||||
const lastCommitDate = new Date((lastCommit?.date ?? 0) * 1000)
|
||||
const commitDate = new Date(commit.date * 1000)
|
||||
|
||||
if (
|
||||
commitDate.getFullYear() !== lastCommitDate.getFullYear() ||
|
||||
commitDate.getMonth() !== lastCommitDate.getMonth() ||
|
||||
commitDate.getDate() !== lastCommitDate.getDate()
|
||||
) {
|
||||
output.push({
|
||||
date: commitDate,
|
||||
commits: [],
|
||||
})
|
||||
}
|
||||
|
||||
output[output.length - 1].commits.push(commit)
|
||||
lastCommit = commit
|
||||
})
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
get displayFullHistoryWaring() {
|
||||
return this.commitsBehind.length >= 30
|
||||
}
|
||||
|
||||
get lastCommit() {
|
||||
return this.commitsBehind.slice(-1)[0]
|
||||
}
|
||||
|
||||
get linkToGithub() {
|
||||
return `https://github.com/${this.repo?.owner}/${this.repo?.name}/commits/${this.repo?.branch}/?after=${this.lastCommit?.sha}+0`
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('close-dialog')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.groupedCommits {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
::v-deep {
|
||||
.git-commit-list-day {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 0;
|
||||
|
||||
.v-timeline-item__dot--small {
|
||||
width: 18px;
|
||||
height: 15px;
|
||||
margin-top: 2px;
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
content: ' ';
|
||||
position: relative;
|
||||
width: 18px;
|
||||
height: 2px;
|
||||
top: 7px;
|
||||
background: rgba(255, 255, 255, 0.5);
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.v-timeline-item__inner-dot {
|
||||
background-color: #1e1e1e !important;
|
||||
border: 2px solid rgba(255, 255, 255, 0.5) !important;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
margin-left: 5px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
&.git-commit-list-warning {
|
||||
.v-timeline-item__dot--small {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-timeline-item small class="git-commit-list-day">
|
||||
<v-row class="pt-0">
|
||||
<v-col class="pr-12">
|
||||
<h3 class="caption">
|
||||
{{ $t('Machine.UpdatePanel.CommitsOnDate', { date: groupedCommitsDate }) }}
|
||||
</h3>
|
||||
<ul class="commits mt-3 pl-0">
|
||||
<git-commits-list-day-commit
|
||||
v-for="commit of groupedCommits.commits"
|
||||
:key="commit.sha"
|
||||
:commit="commit"
|
||||
:repo="repo" />
|
||||
</ul>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-timeline-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import {
|
||||
ServerUpdateManagerStateGitRepo,
|
||||
ServerUpdateManagerStateGitRepoGroupedCommits,
|
||||
} from '@/store/server/updateManager/types'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import GitCommitsListDayCommit from '@/components/panels/Machine/UpdatePanel/GitCommitsListDayCommit.vue'
|
||||
|
||||
@Component({
|
||||
components: { Panel, GitCommitsListDayCommit },
|
||||
})
|
||||
export default class GitCommitsListDay extends Mixins(BaseMixin) {
|
||||
@Prop({ required: true }) readonly groupedCommits!: ServerUpdateManagerStateGitRepoGroupedCommits
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo
|
||||
|
||||
get groupedCommitsDate() {
|
||||
return new Date(this.groupedCommits.date).toLocaleDateString(this.browserLocale, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
ul.commits {
|
||||
list-style: none;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<li class="commit px-3 py-2">
|
||||
<v-row>
|
||||
<v-col>
|
||||
<h4 class="subtitle-2 text--white mb-0">
|
||||
{{ title }}
|
||||
<v-chip outlined label x-small class="ml-2 px-2" @click="showDetails = !showDetails">
|
||||
<v-icon small>{{ mdiDotsHorizontal }}</v-icon>
|
||||
</v-chip>
|
||||
</h4>
|
||||
<p
|
||||
v-if="showDetails"
|
||||
class="caption text--secondary mb-2"
|
||||
style="white-space: pre-line"
|
||||
v-html="message"></p>
|
||||
<p class="caption mb-0">
|
||||
<span class="font-weight-bold text-decoration-none white--text">
|
||||
{{ author }}
|
||||
</span>
|
||||
<span>{{ commitFormatDate }}</span>
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col class="col-auto pt-4">
|
||||
<v-chip outlined label small :href="commitHref" target="_blank">
|
||||
{{ commitShortSha }}
|
||||
</v-chip>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiDotsHorizontal } from '@mdi/js'
|
||||
import {
|
||||
ServerUpdateManagerStateGitRepo,
|
||||
ServerUpdateManagerStateGitRepoCommit,
|
||||
} from '@/store/server/updateManager/types'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
|
||||
@Component({
|
||||
components: { Panel },
|
||||
})
|
||||
export default class GitCommitsListDayCommit extends Mixins(BaseMixin) {
|
||||
mdiDotsHorizontal = mdiDotsHorizontal
|
||||
|
||||
@Prop({ required: true }) readonly commit!: ServerUpdateManagerStateGitRepoCommit
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo
|
||||
|
||||
showDetails = false
|
||||
|
||||
get title() {
|
||||
return this.commit.subject
|
||||
}
|
||||
|
||||
get message() {
|
||||
return this.commit.message
|
||||
}
|
||||
|
||||
get author() {
|
||||
return this.commit.author
|
||||
}
|
||||
|
||||
get commitFormatDate() {
|
||||
const commitDay = new Date(this.commit.date * 1000)
|
||||
commitDay.setHours(0, 0, 0, 0)
|
||||
const todayDay = new Date()
|
||||
todayDay.setHours(0, 0, 0, 0)
|
||||
const diff = Math.floor(todayDay.getTime() - commitDay.getTime()) / (1000 * 60 * 60 * 24)
|
||||
|
||||
if (diff === 0) {
|
||||
const diffHours = Math.floor((new Date().getTime() - this.commit.date * 1000) / (1000 * 60 * 60))
|
||||
|
||||
return this.$t('Machine.UpdatePanel.CommittedHoursAgo', { hours: diffHours })
|
||||
} else if (diff === 1) return this.$t('Machine.UpdatePanel.CommittedYesterday')
|
||||
else if (diff < 29) return this.$t('Machine.UpdatePanel.CommittedDaysAgo', { days: diff })
|
||||
else
|
||||
return this.$t('Machine.UpdatePanel.CommittedOnDate', {
|
||||
date: commitDay.toLocaleDateString(this.browserLocale, {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
get repo_name() {
|
||||
return this.repo.repo_name ?? this.repo.name ?? ''
|
||||
}
|
||||
|
||||
get commitHref() {
|
||||
return `https://github.com/${this.repo.owner}/${this.repo_name}/commit/${this.commit.sha}`
|
||||
}
|
||||
|
||||
get commitShortSha() {
|
||||
return this.commit.sha.substring(0, 6)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
li.commit {
|
||||
border-color: rgb(48, 54, 61);
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-bottom-width: 0;
|
||||
|
||||
&:first-child {
|
||||
border-top-left-radius: 6px;
|
||||
border-top-right-radius: 6px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-left-radius: 6px;
|
||||
border-bottom-right-radius: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<v-dialog v-model="boolShowDialog" persistent max-width="800">
|
||||
<panel
|
||||
:title="$t('Machine.UpdatePanel.UpgradeableSystemPackages')"
|
||||
:icon="mdiPackageVariantClosed"
|
||||
:margin-bottom="false"
|
||||
card-class="machine-update-system-packages-list-dialog">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="closeDialog">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<p>{{ $t('Machine.UpdatePanel.ThesePackagesCanBeUpgrade') }}</p>
|
||||
<p class="system-packages-list">{{ packagesList.join(', ') }}</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn text color="primary" @click="closeDialog">{{ $t('Machine.UpdatePanel.Close') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiCloseThick, mdiPackageVariantClosed } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
|
||||
@Component({
|
||||
components: { Panel },
|
||||
})
|
||||
export default class SystemPackagesList extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiPackageVariantClosed = mdiPackageVariantClosed
|
||||
|
||||
@Prop({ required: true }) readonly boolShowDialog!: boolean
|
||||
@Prop({ required: true }) readonly packagesList!: string[]
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('close-dialog')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.system-packages-list {
|
||||
font-family: monospace;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,71 @@
|
||||
<template>
|
||||
<v-dialog v-model="boolShowDialog" persistent max-width="600">
|
||||
<panel
|
||||
:title="$t('Machine.UpdatePanel.AreYouSure')"
|
||||
:icon="mdiProgressQuestion"
|
||||
:margin-bottom="false"
|
||||
card-class="machine-update-hint-dialog">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="closeDialog">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<update-hint-alert :repo="repo" @open-commit-history="openCommitHistory" />
|
||||
<div>
|
||||
<v-checkbox
|
||||
v-model="checkboxUpdateQuestion"
|
||||
:label="$t('Machine.UpdatePanel.IUnderstandTheRisks')"
|
||||
hide-details />
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-divider />
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn text @click="closeDialog">{{ $t('Machine.UpdatePanel.Abort') }}</v-btn>
|
||||
<v-btn text color="primary" :disabled="!checkboxUpdateQuestion" @click="doUpdate">
|
||||
{{ $t('Machine.UpdatePanel.StartUpdate') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerUpdateManagerStateGitRepo } from '@/store/server/updateManager/types'
|
||||
import { mdiProgressQuestion, mdiCloseThick } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import GitCommitsListDay from '@/components/panels/Machine/UpdatePanel/GitCommitsListDay.vue'
|
||||
import UpdateHintAlert from '@/components/panels/Machine/UpdatePanel/UpdateHintAlert.vue'
|
||||
|
||||
@Component({
|
||||
components: { GitCommitsListDay, Panel, UpdateHintAlert },
|
||||
})
|
||||
export default class UpdateHint extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiProgressQuestion = mdiProgressQuestion
|
||||
|
||||
checkboxUpdateQuestion = false
|
||||
|
||||
@Prop({ required: true }) readonly boolShowDialog!: boolean
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo
|
||||
|
||||
doUpdate() {
|
||||
this.$emit('do-update')
|
||||
}
|
||||
|
||||
openCommitHistory() {
|
||||
this.$emit('open-commit-history')
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('close-dialog')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<v-alert text dense border="left" color="orange" :icon="mdiAlertCircle">
|
||||
<template v-if="boolTitle">
|
||||
<strong>{{ $t('Machine.UpdatePanel.UpdateWarning', { name: formatName }) }}</strong>
|
||||
<br />
|
||||
</template>
|
||||
<p v-if="description1">{{ description1 }}</p>
|
||||
<p v-if="description2">{{ description2 }}</p>
|
||||
<div class="text-center">
|
||||
<v-btn
|
||||
v-if="configured_type === 'git_repo' && repo.commits_behind?.length"
|
||||
class="mx-2 mt-3 mt-sm-0"
|
||||
@click="openCommitHistory">
|
||||
<v-icon left small>{{ mdiEye }}</v-icon>
|
||||
{{ $t('Machine.UpdatePanel.CommitHistory') }}
|
||||
</v-btn>
|
||||
<v-btn v-if="externalLink" class="mx-2 mt-3 mt-sm-0" :href="externalLink" target="_blank">
|
||||
<v-icon left small>{{ mdiOpenInNew }}</v-icon>
|
||||
{{ externalLinkText }}
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-alert>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerUpdateManagerStateGitRepo } from '@/store/server/updateManager/types'
|
||||
import { mdiCloseThick, mdiAlertCircle, mdiEye, mdiOpenInNew } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import GitCommitsListDay from '@/components/panels/Machine/UpdatePanel/GitCommitsListDay.vue'
|
||||
import { capitalize } from '@/plugins/helpers'
|
||||
|
||||
@Component({
|
||||
components: { GitCommitsListDay, Panel },
|
||||
})
|
||||
export default class UpdateHintAlert extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiAlertCircle = mdiAlertCircle
|
||||
mdiEye = mdiEye
|
||||
mdiOpenInNew = mdiOpenInNew
|
||||
|
||||
@Prop({ required: true }) readonly repo!: ServerUpdateManagerStateGitRepo
|
||||
@Prop({ required: false, default: false }) readonly boolTitle!: boolean
|
||||
|
||||
get name() {
|
||||
return this.repo?.name ?? 'UNKNOWN'
|
||||
}
|
||||
|
||||
get formatName() {
|
||||
return capitalize(this.name)
|
||||
}
|
||||
|
||||
get configured_type() {
|
||||
return this.repo?.configured_type ?? 'UNKNOWN'
|
||||
}
|
||||
|
||||
get description1() {
|
||||
if (this.name === 'klipper') return this.$t('Machine.UpdatePanel.KlipperUpdateQuestionFirmware')
|
||||
if (this.name === 'moonraker') return this.$t('Machine.UpdatePanel.MoonrakerUpdateQuestion')
|
||||
if (this.configured_type === 'web') return this.$t('Machine.UpdatePanel.WebClientUpdateQuestion')
|
||||
|
||||
return this.$t('Machine.UpdatePanel.GenericUpdateQuestion')
|
||||
}
|
||||
|
||||
get description2() {
|
||||
if (this.name === 'klipper') return this.$t('Machine.UpdatePanel.KlipperUpdateQuestionConfig')
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get repo_name() {
|
||||
return this.repo.repo_name ?? this.repo.name ?? ''
|
||||
}
|
||||
|
||||
get externalLink() {
|
||||
if (this.name === 'klipper') return '//www.klipper3d.org/Config_Changes.html'
|
||||
if (this.name === 'moonraker') return '//moonraker.readthedocs.io/en/latest/changelog/'
|
||||
if (this.repo?.configured_type === 'web')
|
||||
return `//github.com/${this.repo.owner}/${this.repo_name}/releases/tag/${this.repo.remote_version}`
|
||||
|
||||
return `//github.com/${this.repo.owner}/${this.repo_name}`
|
||||
}
|
||||
|
||||
get externalLinkText() {
|
||||
if (['klipper', 'moonraker'].includes(this.name)) return this.$t('Machine.UpdatePanel.ConfigChanges')
|
||||
|
||||
return this.$t('Machine.UpdatePanel.GitHubPage')
|
||||
}
|
||||
|
||||
openCommitHistory() {
|
||||
this.$emit('open-commit-history')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<v-dialog v-model="boolShowDialog" persistent max-width="600">
|
||||
<panel
|
||||
:title="$t('Machine.UpdatePanel.AreYouSure')"
|
||||
:icon="mdiProgressQuestion"
|
||||
:margin-bottom="false"
|
||||
card-class="machine-update-hint-dialog">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="closeDialog">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<update-hint-alert
|
||||
v-for="repo of filteredModules"
|
||||
:key="repo.name"
|
||||
:repo="repo.data"
|
||||
:bool-title="true"
|
||||
@open-commit-history="openCommitHistory(repo.data)" />
|
||||
<div>
|
||||
<v-checkbox
|
||||
v-model="checkboxUpdateQuestion"
|
||||
:label="$t('Machine.UpdatePanel.IUnderstandTheRisks')"
|
||||
hide-details />
|
||||
</div>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<v-divider />
|
||||
<v-card-actions>
|
||||
<v-spacer />
|
||||
<v-btn text @click="closeDialog">{{ $t('Machine.UpdatePanel.Abort') }}</v-btn>
|
||||
<v-btn text color="primary" :disabled="!checkboxUpdateQuestion" @click="updateAll">
|
||||
{{ $t('Machine.UpdatePanel.StartUpdate') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
<git-commits-list
|
||||
:bool-show-dialog="boolShowCommitHistory"
|
||||
:repo="showCommitsRepo"
|
||||
@close-dialog="boolShowCommitHistory = false" />
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerUpdateManagerStateGitRepo, ServerUpdateManagerStateGuiList } from '@/store/server/updateManager/types'
|
||||
import { mdiProgressQuestion, mdiCloseThick } from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import GitCommitsListDay from '@/components/panels/Machine/UpdatePanel/GitCommitsListDay.vue'
|
||||
import UpdateHintAlert from '@/components/panels/Machine/UpdatePanel/UpdateHintAlert.vue'
|
||||
import semver from 'semver'
|
||||
|
||||
@Component({
|
||||
components: { GitCommitsListDay, Panel, UpdateHintAlert },
|
||||
})
|
||||
export default class UpdateHintAll extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiProgressQuestion = mdiProgressQuestion
|
||||
|
||||
checkboxUpdateQuestion = false
|
||||
boolShowCommitHistory = false
|
||||
showCommitsRepo: ServerUpdateManagerStateGitRepo | null = null
|
||||
|
||||
@Prop({ required: true }) readonly boolShowDialog!: boolean
|
||||
|
||||
get modules() {
|
||||
return this.$store.getters['server/updateManager/getUpdateManagerList'] ?? []
|
||||
}
|
||||
|
||||
get filteredModules() {
|
||||
return this.modules.filter((module: ServerUpdateManagerStateGuiList) => {
|
||||
// check git repos for updates
|
||||
if (module.type === 'git' && module.data?.commits_behind?.length) return true
|
||||
|
||||
// check client web for updates
|
||||
if (
|
||||
module.type === 'web' &&
|
||||
semver.valid(module.data?.remote_version) &&
|
||||
semver.valid(module.data?.version) &&
|
||||
semver.gt(module.data?.remote_version, module.data?.version)
|
||||
)
|
||||
return true
|
||||
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
openCommitHistory(repo: ServerUpdateManagerStateGitRepo) {
|
||||
this.showCommitsRepo = repo
|
||||
this.boolShowCommitHistory = true
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('close-dialog')
|
||||
}
|
||||
|
||||
updateAll() {
|
||||
this.$emit('update-all')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -30,7 +30,7 @@
|
||||
<v-divider class="mb-2"></v-divider>
|
||||
</template>
|
||||
<v-card-actions class="justify-center pb-3">
|
||||
<v-btn small href="https://docs.mainsail.xyz/configuration" target="_blank">
|
||||
<v-btn small href="https://docs.mainsail.xyz/setup/configuration" target="_blank">
|
||||
<v-icon small class="mr-1">{{ mdiInformation }}</v-icon>
|
||||
{{ $t('Panels.MinSettingsPanel.MoreInformation') }}
|
||||
</v-btn>
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
<style scoped lang="scss">
|
||||
.consoleTable {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.gcode-command-field {
|
||||
font-family: 'Roboto Mono', monospace;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<panel
|
||||
v-if="socketIsConnected && klipperState !== 'disconnected'"
|
||||
@@ -20,30 +10,37 @@
|
||||
<v-btn icon tile @click="clearConsole">
|
||||
<v-icon small>{{ mdiTrashCan }}</v-icon>
|
||||
</v-btn>
|
||||
<command-help-modal :in-toolbar="true" @onCommand="gcode = $event"></command-help-modal>
|
||||
<command-help-modal :in-toolbar="true" @onCommand="gcode = $event" />
|
||||
<v-menu
|
||||
:offset-y="true"
|
||||
:close-on-content-click="false"
|
||||
:title="$t('Panels.MiniconsolePanel.SetupConsole')">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
<v-icon small>{{ mdiFilter }}</v-icon>
|
||||
<v-icon small>{{ mdiCog }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item v-if="consoleDirection === 'shell'" class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="autoscroll"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.MiniconsolePanel.Autoscroll')" />
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hideWaitTemperatures"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.MiniconsolePanel.HideTemperatures')"></v-checkbox>
|
||||
:label="$t('Panels.MiniconsolePanel.HideTemperatures')" />
|
||||
</v-list-item>
|
||||
<v-list-item v-if="moonrakerComponents.includes('timelapse')" class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hideTlCommands"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.MiniconsolePanel.HideTimelapse')"></v-checkbox>
|
||||
:label="$t('Panels.MiniconsolePanel.HideTimelapse')" />
|
||||
</v-list-item>
|
||||
<v-list-item v-for="(filter, index) in customFilters" :key="index" class="minHeight36">
|
||||
<v-checkbox
|
||||
@@ -51,7 +48,7 @@
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="filter.name"
|
||||
@change="toggleFilter(filter)"></v-checkbox>
|
||||
@change="toggleFilter(filter)" />
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -93,7 +90,7 @@
|
||||
:events="events"
|
||||
:is-mini="true"
|
||||
@command-click="commandClick" />
|
||||
<v-divider></v-divider>
|
||||
<v-divider />
|
||||
</overlay-scrollbars>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@@ -109,7 +106,7 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import { CommandHelp, VTextareaType } from '@/store/printer/types'
|
||||
import ConsoleTable from '@/components/console/ConsoleTable.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiChevronDoubleRight, mdiConsoleLine, mdiFilter, mdiSend, mdiTrashCan } from '@mdi/js'
|
||||
import { mdiChevronDoubleRight, mdiCog, mdiConsoleLine, mdiSend, mdiTrashCan } from '@mdi/js'
|
||||
import CommandHelpModal from '@/components/CommandHelpModal.vue'
|
||||
|
||||
@Component({
|
||||
@@ -122,7 +119,7 @@ import CommandHelpModal from '@/components/CommandHelpModal.vue'
|
||||
export default class MiniconsolePanel extends Mixins(BaseMixin) {
|
||||
mdiTrashCan = mdiTrashCan
|
||||
mdiConsoleLine = mdiConsoleLine
|
||||
mdiFilter = mdiFilter
|
||||
mdiCog = mdiCog
|
||||
mdiSend = mdiSend
|
||||
mdiChevronDoubleRight = mdiChevronDoubleRight
|
||||
|
||||
@@ -155,13 +152,18 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
|
||||
|
||||
@Watch('events')
|
||||
eventsChanged() {
|
||||
if (this.consoleDirection === 'shell') {
|
||||
if (this.consoleDirection === 'shell' && this.autoscroll) {
|
||||
setTimeout(() => {
|
||||
this.scrollToBottom()
|
||||
}, 50)
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('autoscroll')
|
||||
autoscrollChanged(newVal: boolean) {
|
||||
if (newVal) this.scrollToBottom()
|
||||
}
|
||||
|
||||
clearConsole() {
|
||||
this.$store.dispatch('gui/console/clear')
|
||||
}
|
||||
@@ -194,6 +196,14 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
|
||||
return this.$store.state.gui.gcodehistory.entries ?? []
|
||||
}
|
||||
|
||||
get autoscroll(): boolean {
|
||||
return this.$store.state.gui.console.autoscroll ?? true
|
||||
}
|
||||
|
||||
set autoscroll(newVal) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'console.autoscroll', value: newVal })
|
||||
}
|
||||
|
||||
commandClick(msg: string): void {
|
||||
this.gcode = msg
|
||||
|
||||
@@ -325,3 +335,13 @@ export default class MiniconsolePanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.consoleTable {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.gcode-command-field {
|
||||
font-family: 'Roboto Mono', monospace;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<v-list-item three-line>
|
||||
<v-list-item-content :class="listItemContentClass">
|
||||
<div :class="overlineClass">#{{ id }} | {{ vendor }}</div>
|
||||
<v-list-item-title :class="listItemTitleClass">
|
||||
<span class="cursor-pointer" @click="clickSpool">{{ name }}</span>
|
||||
</v-list-item-title>
|
||||
<v-list-item-subtitle>{{ subtitle }}</v-list-item-subtitle>
|
||||
</v-list-item-content>
|
||||
|
||||
<v-list-item-avatar tile :size="avatarSize">
|
||||
<spool-icon :color="color" @click-spool="clickSpool" />
|
||||
</v-list-item-avatar>
|
||||
</v-list-item>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Component, Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import SpoolmanChangeSpoolDialog from '@/components/dialogs/SpoolmanChangeSpoolDialog.vue'
|
||||
import SpoolmanEjectSpoolDialog from '@/components/dialogs/SpoolmanEjectSpoolDialog.vue'
|
||||
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||
|
||||
@Component({
|
||||
components: { Panel, SpoolmanChangeSpoolDialog, SpoolmanEjectSpoolDialog },
|
||||
})
|
||||
export default class SpoolmanPanelActiveSpool extends Mixins(BaseMixin) {
|
||||
@Prop({ required: false, default: false }) readonly small!: boolean
|
||||
|
||||
get listItemContentClass() {
|
||||
if (this.small) return 'my-0'
|
||||
|
||||
return ''
|
||||
}
|
||||
|
||||
get overlineClass() {
|
||||
const classes = ['text-overline', 'mb-1']
|
||||
if (this.small) classes.push('line-height-auto')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get listItemTitleClass() {
|
||||
if (this.small) return ['text-h6', 'mb-1']
|
||||
|
||||
return ['text-h5', 'mb-1']
|
||||
}
|
||||
|
||||
get avatarSize() {
|
||||
if (this.small) return 60
|
||||
|
||||
return 80
|
||||
}
|
||||
|
||||
get active_spool(): ServerSpoolmanStateSpool | null {
|
||||
return this.$store.state.server.spoolman.active_spool ?? null
|
||||
}
|
||||
|
||||
get color() {
|
||||
const color = this.active_spool?.filament.color_hex ?? null
|
||||
if (color === null) return '#000'
|
||||
|
||||
return `#${color}`
|
||||
}
|
||||
|
||||
get id() {
|
||||
return this.active_spool?.id ?? 'XX'
|
||||
}
|
||||
|
||||
get vendor() {
|
||||
return this.active_spool?.filament?.vendor?.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this.active_spool?.filament.name ?? 'Unknown'
|
||||
}
|
||||
|
||||
get materialOutput() {
|
||||
const material = this.active_spool?.filament.material ?? null
|
||||
if (material === null) return null
|
||||
|
||||
return material
|
||||
}
|
||||
|
||||
get weightOutput() {
|
||||
let remaining = this.active_spool?.remaining_weight ?? null
|
||||
let total = this.active_spool?.filament.weight ?? null
|
||||
let unit = 'g'
|
||||
|
||||
if (remaining === null || total === null) return null
|
||||
remaining = Math.round(remaining)
|
||||
let totalRound = Math.floor(total / 1000)
|
||||
|
||||
if (total >= 1000) {
|
||||
if (totalRound !== total / 1000) {
|
||||
totalRound = Math.round(total / 100) / 10
|
||||
}
|
||||
|
||||
return `${remaining}g / ${totalRound}kg`
|
||||
}
|
||||
|
||||
return `${remaining} / ${total}${unit}`
|
||||
}
|
||||
|
||||
get lengthOutput() {
|
||||
let remaining = this.active_spool?.remaining_length ?? null
|
||||
|
||||
if (remaining === null) return null
|
||||
remaining = Math.round(remaining / 1000)
|
||||
|
||||
return `${remaining}m`
|
||||
}
|
||||
|
||||
get subtitle() {
|
||||
return [this.materialOutput, this.weightOutput, this.lengthOutput].filter((v) => v !== null).join(' | ')
|
||||
}
|
||||
|
||||
clickSpool() {
|
||||
this.$emit('change-spool')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.line-height-auto {
|
||||
line-height: 1;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div>
|
||||
<panel :icon="mdiAdjust" :title="title" card-class="spoolman-panel" :collapsible="true">
|
||||
<template #buttons>
|
||||
<v-btn icon tile :title="changeSpoolTooltip" @click="showChangeSpoolDialog = true">
|
||||
<v-icon>{{ mdiSwapVertical }}</v-icon>
|
||||
</v-btn>
|
||||
<v-menu :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>
|
||||
<v-btn small style="width: 100%" @click="showEjectSpoolDialog = true">
|
||||
<v-icon left>{{ mdiEject }}</v-icon>
|
||||
{{ $t('Panels.SpoolmanPanel.EjectSpool') }}
|
||||
</v-btn>
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-btn small style="width: 100%" @click="openSpoolManager">
|
||||
<v-icon left>{{ mdiOpenInNew }}</v-icon>
|
||||
{{ $t('Panels.SpoolmanPanel.OpenSpoolManager') }}
|
||||
</v-btn>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</template>
|
||||
<v-card-text v-if="active_spool === null">
|
||||
<v-row>
|
||||
<v-col class="text-center">
|
||||
<p class="text--disabled">{{ $t('Panels.SpoolmanPanel.NoActiveSpool') }}</p>
|
||||
<v-btn small color="primary" @click="showChangeSpoolDialog = true">
|
||||
{{ $t('Panels.SpoolmanPanel.SelectSpool') }}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
<spoolman-panel-active-spool v-else @change-spool="showChangeSpoolDialog = true" />
|
||||
</panel>
|
||||
<spoolman-change-spool-dialog :show-dialog="showChangeSpoolDialog" @close="showChangeSpoolDialog = false" />
|
||||
<spoolman-eject-spool-dialog :show-dialog="showEjectSpoolDialog" @close="showEjectSpoolDialog = false" />
|
||||
</div>
|
||||
</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 { mdiAdjust, mdiDotsVertical, mdiEject, mdiOpenInNew, mdiSwapVertical } from '@mdi/js'
|
||||
import SpoolmanChangeSpoolDialog from '@/components/dialogs/SpoolmanChangeSpoolDialog.vue'
|
||||
import SpoolmanEjectSpoolDialog from '@/components/dialogs/SpoolmanEjectSpoolDialog.vue'
|
||||
import { ServerSpoolmanStateSpool } from '@/store/server/spoolman/types'
|
||||
import SpoolmanPanelActiveSpool from '@/components/panels/Spoolman/SpoolmanPanelActiveSpool.vue'
|
||||
|
||||
@Component({
|
||||
components: { SpoolmanPanelActiveSpool, Panel, SpoolmanChangeSpoolDialog, SpoolmanEjectSpoolDialog },
|
||||
})
|
||||
export default class SpoolmanPanel extends Mixins(BaseMixin) {
|
||||
mdiAdjust = mdiAdjust
|
||||
mdiDotsVertical = mdiDotsVertical
|
||||
mdiEject = mdiEject
|
||||
mdiOpenInNew = mdiOpenInNew
|
||||
mdiSwapVertical = mdiSwapVertical
|
||||
|
||||
showChangeSpoolDialog = false
|
||||
showEjectSpoolDialog = false
|
||||
|
||||
get health() {
|
||||
return this.$store.state.server.spoolman.health ?? ''
|
||||
}
|
||||
|
||||
get title() {
|
||||
const headline = this.$t('Panels.SpoolmanPanel.Headline') as string
|
||||
|
||||
if (this.health === '' || this.health === 'healthy') return headline
|
||||
|
||||
return `${headline} (${this.health})`
|
||||
}
|
||||
|
||||
get changeSpoolTooltip(): string {
|
||||
if (this.active_spool === null) return this.$t('Panels.SpoolmanPanel.SelectSpool') as string
|
||||
|
||||
return this.$t('Panels.SpoolmanPanel.ChangeSpool') as string
|
||||
}
|
||||
|
||||
get active_spool(): ServerSpoolmanStateSpool | null {
|
||||
return this.$store.state.server.spoolman.active_spool ?? null
|
||||
}
|
||||
|
||||
get spoolManagerUrl() {
|
||||
return this.$store.state.server.config.config?.spoolman?.server ?? null
|
||||
}
|
||||
|
||||
openSpoolManager() {
|
||||
window.open(this.spoolManagerUrl, '_blank')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
@@ -20,7 +20,11 @@
|
||||
@click="showDialog(item)">
|
||||
<td class="pr-0 text-center" style="width: 32px">
|
||||
<template v-if="item.small_thumbnail">
|
||||
<v-tooltip top content-class="tooltip__content-opacity1" :disabled="!item.big_thumbnail">
|
||||
<v-tooltip
|
||||
top
|
||||
content-class="tooltip__content-opacity1"
|
||||
:disabled="!item.big_thumbnail"
|
||||
:color="bigThumbnailTooltipColor">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image class="d-flex">
|
||||
<img
|
||||
@@ -72,7 +76,7 @@
|
||||
:bool="showDialogBool"
|
||||
:file="dialogFile"
|
||||
:current-path="currentPath"
|
||||
@closeDialog="closeDialog"></start-print-dialog>
|
||||
@closeDialog="closeDialog" />
|
||||
<v-menu v-model="contextMenu.shown" :position-x="contextMenu.x" :position-y="contextMenu.y" absolute offset-y>
|
||||
<v-list>
|
||||
<v-list-item :disabled="printerIsPrinting || !klipperReadyForGui" @click="showDialog(contextMenu.item)">
|
||||
@@ -112,7 +116,7 @@
|
||||
<v-icon class="mr-1">{{ mdiRenameBox }}</v-icon>
|
||||
{{ $t('Files.Rename') }}
|
||||
</v-list-item>
|
||||
<v-list-item class="red--text" @click="removeFile(contextMenu.item)">
|
||||
<v-list-item class="red--text" @click="deleteDialog = true">
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Files.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -120,7 +124,7 @@
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogRenameFile.show" :max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.RenameFile').toString()"
|
||||
:title="$t('Files.RenameFile')"
|
||||
card-class="dashboard-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -143,9 +147,35 @@
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE FILE DIALOG -->
|
||||
<v-dialog v-model="deleteDialog" max-width="400">
|
||||
<panel :title="$t('Files.Delete')" card-class="gcode-files-delete-dialog" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
{{ $t('Files.DeleteSingleFileQuestion', { name: filename }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteDialog = false">
|
||||
{{ $t('Files.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="error" text @click="removeFile">
|
||||
{{ $t('Files.Delete') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<v-dialog v-model="dialogAddBatchToQueue.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Files.AddToQueue').toString()"
|
||||
:title="$t('Files.AddToQueue')"
|
||||
card-class="gcode-files-add-to-queue-dialog"
|
||||
:icon="mdiPlaylistPlus"
|
||||
:margin-bottom="false">
|
||||
@@ -214,6 +244,8 @@ import {
|
||||
mdiDelete,
|
||||
mdiCloseThick,
|
||||
} from '@mdi/js'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { defaultBigThumbnailBackground } from '@/store/variables'
|
||||
|
||||
interface dialogRenameObject {
|
||||
show: boolean
|
||||
@@ -229,6 +261,7 @@ interface dialogAddBatchToQueue {
|
||||
|
||||
@Component({
|
||||
components: {
|
||||
Panel,
|
||||
StartPrintDialog,
|
||||
},
|
||||
})
|
||||
@@ -246,6 +279,7 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin, ControlMixi
|
||||
mdiDelete = mdiDelete
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
private deleteDialog = false
|
||||
private showDialogBool = false
|
||||
private dialogFile: FileStateGcodefile = {
|
||||
isDirectory: false,
|
||||
@@ -318,10 +352,27 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin, ControlMixi
|
||||
return gcodes
|
||||
}
|
||||
|
||||
get filename() {
|
||||
const filename = this.contextMenu.item.filename.split('/')
|
||||
return filename[filename.length - 1]
|
||||
}
|
||||
|
||||
get styleContentTdWidth() {
|
||||
return `width: ${this.contentTdWidth}px;`
|
||||
}
|
||||
|
||||
get bigThumbnailBackground() {
|
||||
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||
}
|
||||
|
||||
get bigThumbnailTooltipColor() {
|
||||
if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return this.bigThumbnailBackground
|
||||
}
|
||||
|
||||
showContextMenu(e: any, item: FileStateGcodefile) {
|
||||
if (!this.contextMenu.shown) {
|
||||
e?.preventDefault()
|
||||
@@ -488,12 +539,14 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin, ControlMixi
|
||||
)
|
||||
}
|
||||
|
||||
removeFile(item: FileStateGcodefile) {
|
||||
removeFile() {
|
||||
this.$socket.emit(
|
||||
'server.files.delete_file',
|
||||
{ path: 'gcodes/' + item.filename },
|
||||
{ path: 'gcodes/' + this.contextMenu.item.filename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
this.deleteDialog = false
|
||||
}
|
||||
|
||||
mounted() {
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
@contextmenu="showContextMenu($event, item)">
|
||||
<td class="pr-0 text-center" style="width: 32px">
|
||||
<template v-if="smallThumbnail && bigThumbnail">
|
||||
<v-tooltip v-if="smallThumbnail && bigThumbnail" top content-class="tooltip__content-opacity1">
|
||||
<v-tooltip
|
||||
v-if="smallThumbnail && bigThumbnail"
|
||||
top
|
||||
content-class="tooltip__content-opacity1"
|
||||
:color="bigThumbnailTooltipColor">
|
||||
<template #activator="{ on, attrs }">
|
||||
<vue-load-image>
|
||||
<img slot="image" :src="smallThumbnail" width="32" height="32" v-bind="attrs" v-on="on" />
|
||||
@@ -116,6 +120,7 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import { ServerJobQueueStateJob } from '@/store/server/jobQueue/types'
|
||||
import { mdiChevronDown, mdiChevronUp, mdiCloseThick, mdiCounter, mdiFile, mdiPlay, mdiPlaylistRemove } from '@mdi/js'
|
||||
import NumberInput from '@/components/inputs/NumberInput.vue'
|
||||
import { defaultBigThumbnailBackground } from '@/store/variables'
|
||||
@Component({
|
||||
components: { NumberInput },
|
||||
})
|
||||
@@ -192,6 +197,18 @@ export default class StatusPanelJobqueueEntry extends Mixins(BaseMixin) {
|
||||
return output
|
||||
}
|
||||
|
||||
get bigThumbnailBackground() {
|
||||
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||
}
|
||||
|
||||
get bigThumbnailTooltipColor() {
|
||||
if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
|
||||
return undefined
|
||||
}
|
||||
|
||||
return this.bigThumbnailBackground
|
||||
}
|
||||
|
||||
formatPrintTime(totalSeconds: number) {
|
||||
if (totalSeconds) {
|
||||
let output = ''
|
||||
|
||||
@@ -239,12 +239,15 @@ export default class StatusPanelPrintstatusPrinting extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
formatDuration(seconds: number) {
|
||||
let h = Math.floor(seconds / 3600)
|
||||
seconds %= 3600
|
||||
let m = ('0' + Math.floor(seconds / 60)).slice(-2)
|
||||
let s = ('0' + (seconds % 60).toFixed(0)).slice(-2)
|
||||
let prefix = seconds < 0 ? '-' : ''
|
||||
let absSeconds = Math.abs(seconds)
|
||||
|
||||
return h + ':' + m + ':' + s
|
||||
let h = Math.floor(absSeconds / 3600)
|
||||
absSeconds %= 3600
|
||||
let m = ('0' + Math.floor(absSeconds / 60)).slice(-2)
|
||||
let s = ('0' + (absSeconds % 60).toFixed(0)).slice(-2)
|
||||
|
||||
return prefix + h + ':' + m + ':' + s
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -7,6 +7,7 @@
|
||||
tabindex="-1"
|
||||
class="d-flex align-end statusPanel-big-thumbnail"
|
||||
height="200"
|
||||
:style="thumbnailStyle"
|
||||
@focus="focusBigThumbnail"
|
||||
@blur="blurBigThumbnail">
|
||||
<v-card-title
|
||||
@@ -43,26 +44,34 @@
|
||||
:src="thumbnailSmall"
|
||||
width="32"
|
||||
height="32"
|
||||
:alt="current_filename"
|
||||
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" />
|
||||
</div>
|
||||
<div slot="error">
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</div>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
<span><img :src="thumbnailBig" width="250" /></span>
|
||||
<span><img :src="thumbnailBig" width="250" :alt="current_filename" /></span>
|
||||
</v-tooltip>
|
||||
</template>
|
||||
<template v-else-if="thumbnailSmall">
|
||||
<vue-load-image>
|
||||
<img slot="image" :src="thumbnailSmall" width="32" height="32" />
|
||||
<v-progress-circular
|
||||
slot="preloader"
|
||||
indeterminate
|
||||
color="primary"></v-progress-circular>
|
||||
<v-icon slot="error">{{ mdiFile }}</v-icon>
|
||||
<img
|
||||
slot="image"
|
||||
:src="thumbnailSmall"
|
||||
width="32"
|
||||
height="32"
|
||||
:alt="current_filename" />
|
||||
<div slot="preloader">
|
||||
<v-progress-circular indeterminate color="primary" />
|
||||
</div>
|
||||
<div slot="error">
|
||||
<v-icon>{{ mdiFile }}</v-icon>
|
||||
</div>
|
||||
</vue-load-image>
|
||||
</template>
|
||||
</v-col>
|
||||
@@ -77,13 +86,11 @@
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { thumbnailBigMin, thumbnailSmallMax, thumbnailSmallMin } from '@/store/variables'
|
||||
import { defaultBigThumbnailBackground, thumbnailBigMin, thumbnailSmallMax, thumbnailSmallMin } from '@/store/variables'
|
||||
import { mdiFileOutline, mdiFile } from '@mdi/js'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
|
||||
@Component({
|
||||
components: {},
|
||||
})
|
||||
@Component({})
|
||||
export default class StatusPanelPrintstatusThumbnail extends Mixins(BaseMixin) {
|
||||
mdiFileOutline = mdiFileOutline
|
||||
mdiFile = mdiFile
|
||||
@@ -178,6 +185,18 @@ export default class StatusPanelPrintstatusThumbnail extends Mixins(BaseMixin) {
|
||||
return this.current_filename && setting && this.thumbnailBig
|
||||
}
|
||||
|
||||
get bigThumbnailBackground() {
|
||||
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
|
||||
}
|
||||
|
||||
get thumbnailStyle() {
|
||||
if (defaultBigThumbnailBackground.toLowerCase() !== this.bigThumbnailBackground.toLowerCase()) {
|
||||
return { backgroundColor: this.bigThumbnailBackground }
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
focusBigThumbnail() {
|
||||
if (this.$refs.bigThumbnail) {
|
||||
const clientWidth = this.$refs.bigThumbnail.$el.clientWidth
|
||||
|
||||
@@ -57,13 +57,26 @@
|
||||
:show-dialog.sync="boolShowObjects"
|
||||
@update:showDialog="updateShowDialog"></status-panel-exclude-object>
|
||||
<status-panel-pause-at-layer-dialog :show-dialog.sync="boolShowPauseAtLayer" />
|
||||
<template v-if="display_message || print_stats_message">
|
||||
<template v-if="print_stats_message">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<span class="subtitle-2 d-block px-0 text--disabled">
|
||||
<v-icon class="mr-2" color="warning" small>{{ mdiAlertOutline }}</v-icon>
|
||||
{{ print_stats_message }}
|
||||
</span>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
<v-divider class="mt-0 mb-0"></v-divider>
|
||||
</template>
|
||||
<template v-if="display_message">
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col class="py-2">
|
||||
<span class="subtitle-2 d-block px-0 text--disabled">
|
||||
<v-icon class="mr-2" small>{{ mdiMessageProcessingOutline }}</v-icon>
|
||||
{{ print_stats_message ?? display_message }}
|
||||
{{ display_message }}
|
||||
</span>
|
||||
</v-col>
|
||||
<v-col class="col-auto py-2">
|
||||
@@ -110,6 +123,7 @@ import StatusPanelPrintstatusThumbnail from '@/components/panels/Status/Printsta
|
||||
import StatusPanelPauseAtLayerDialog from '@/components/panels/Status/PauseAtLayerDialog.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import {
|
||||
mdiAlertOutline,
|
||||
mdiBroom,
|
||||
mdiInformation,
|
||||
mdiPause,
|
||||
@@ -142,6 +156,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
mdiMessageProcessingOutline = mdiMessageProcessingOutline
|
||||
mdiCloseCircle = mdiCloseCircle
|
||||
mdiDotsVertical = mdiDotsVertical
|
||||
mdiAlertOutline = mdiAlertOutline
|
||||
|
||||
private boolShowObjects = false
|
||||
private boolShowPauseAtLayer = false
|
||||
@@ -170,7 +185,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get printPercent() {
|
||||
return Math.round(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
return Math.floor(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
}
|
||||
|
||||
get printerStateOutput() {
|
||||
@@ -274,11 +289,11 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get display_message() {
|
||||
return this.$store.state.printer.display_status?.message ?? ''
|
||||
return this.$store.state.printer.display_status?.message ?? null
|
||||
}
|
||||
|
||||
get print_stats_message() {
|
||||
return this.$store.state.printer.print_stats?.message ?? ''
|
||||
return this.$store.state.printer.print_stats?.message ?? null
|
||||
}
|
||||
|
||||
get layer_count() {
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
mobile: (el) => el.width <= 395,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-simple-table class="temperature-panel-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="icon"> </th>
|
||||
<th class="name">{{ $t('Panels.TemperaturePanel.Name') }}</th>
|
||||
<th v-if="!el.is.mobile" class="state">
|
||||
{{ $t('Panels.TemperaturePanel.State') }}
|
||||
</th>
|
||||
<th class="current">
|
||||
{{ $t('Panels.TemperaturePanel.Current') }}
|
||||
</th>
|
||||
<th class="target">
|
||||
{{ $t('Panels.TemperaturePanel.Target') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<temperature-panel-list-item
|
||||
v-for="objectName in heaterObjects"
|
||||
:key="objectName"
|
||||
:object-name="objectName"
|
||||
:is-responsive-mobile="el.is.mobile ?? false" />
|
||||
<temperature-panel-list-item-nevermore
|
||||
v-if="existsNevermoreFilter"
|
||||
:is-responsive-mobile="el.is.mobile ?? false" />
|
||||
<temperature-panel-list-item
|
||||
v-for="objectName in temperature_sensors"
|
||||
:key="objectName"
|
||||
:object-name="objectName"
|
||||
:is-responsive-mobile="el.is.mobile ?? false" />
|
||||
<template v-if="!hideMonitors">
|
||||
<temperature-panel-list-item
|
||||
v-for="objectName in monitors"
|
||||
:key="objectName"
|
||||
:object-name="objectName"
|
||||
:is-responsive-mobile="el.is.mobile ?? false" />
|
||||
</template>
|
||||
</tbody>
|
||||
</v-simple-table>
|
||||
</template>
|
||||
</responsive>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import TemperaturePanelListItemNevermore from '@/components/panels/Temperature/TemperaturePanelListItemNevermore.vue'
|
||||
|
||||
@Component({
|
||||
components: { TemperaturePanelListItemNevermore },
|
||||
})
|
||||
export default class TemperaturePanelList extends Mixins(BaseMixin) {
|
||||
get available_heaters() {
|
||||
return this.$store.state.printer?.heaters?.available_heaters ?? []
|
||||
}
|
||||
|
||||
get filteredHeaters() {
|
||||
return this.available_heaters
|
||||
.filter((fullName: string) => {
|
||||
const splits = fullName.split(' ')
|
||||
let name = splits[0]
|
||||
if (splits.length > 1) name = splits[1]
|
||||
|
||||
return !name.startsWith('_')
|
||||
})
|
||||
.sort(this.sortObjectName)
|
||||
}
|
||||
|
||||
get available_sensors() {
|
||||
return this.$store.state.printer?.heaters?.available_sensors ?? []
|
||||
}
|
||||
|
||||
get available_monitors() {
|
||||
return this.$store.state.printer?.heaters?.available_monitors ?? []
|
||||
}
|
||||
|
||||
get monitors() {
|
||||
return this.available_monitors.sort(this.sortObjectName)
|
||||
}
|
||||
|
||||
get temperature_fans() {
|
||||
return this.available_sensors
|
||||
.filter((name: string) => name.startsWith('temperature_fan') && !name.startsWith('temperature_fan _'))
|
||||
.sort(this.sortObjectName)
|
||||
}
|
||||
|
||||
get existsNevermoreFilter() {
|
||||
return 'nevermore' in this.$store.state.printer
|
||||
}
|
||||
|
||||
get hideMcuHostSensors(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.hideMcuHostSensors ?? false
|
||||
}
|
||||
|
||||
get hideMonitors(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.hideMonitors ?? false
|
||||
}
|
||||
|
||||
get temperature_sensors() {
|
||||
return this.available_sensors
|
||||
.filter((fullName: string) => {
|
||||
if (this.available_heaters.includes(fullName)) return false
|
||||
if (this.temperature_fans.includes(fullName)) return false
|
||||
|
||||
// hide MCU & Host sensors, if the function is enabled
|
||||
if (this.hideMcuHostSensors && this.checkMcuHostSensor(fullName)) return false
|
||||
|
||||
const splits = fullName.split(' ')
|
||||
let name = splits[0]
|
||||
if (splits.length > 1) name = splits[1]
|
||||
|
||||
return !name.startsWith('_')
|
||||
})
|
||||
.sort(this.sortObjectName)
|
||||
}
|
||||
|
||||
get heaterObjects() {
|
||||
return [...this.filteredHeaters, ...this.temperature_fans]
|
||||
}
|
||||
|
||||
get settings() {
|
||||
return this.$store.state.printer?.configfile?.settings ?? {}
|
||||
}
|
||||
|
||||
checkMcuHostSensor(fullName: string) {
|
||||
const settingsObject = this.settings[fullName.toLowerCase()] ?? {}
|
||||
const sensor_type = settingsObject.sensor_type ?? ''
|
||||
|
||||
return ['temperature_mcu', 'temperature_host'].includes(sensor_type)
|
||||
}
|
||||
|
||||
sortObjectName(a: string, b: string) {
|
||||
const splitsA = a.split(' ')
|
||||
let nameA = splitsA[0]
|
||||
if (splitsA.length > 1) nameA = splitsA[1]
|
||||
nameA = nameA.toUpperCase()
|
||||
|
||||
const splitsB = b.split(' ')
|
||||
let nameB = splitsB[0]
|
||||
if (splitsB.length > 1) nameB = splitsB[1]
|
||||
nameB = nameB.toUpperCase()
|
||||
|
||||
if (nameA < nameB) return -1
|
||||
if (nameA > nameB) return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.temperature-panel-table th,
|
||||
.temperature-panel-table ::v-deep td {
|
||||
padding-top: 5px !important;
|
||||
padding-bottom: 5px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table ::v-deep tr:hover {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table ::v-deep .icon {
|
||||
width: 24px;
|
||||
padding-right: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.temperature-panel-table ::v-deep .state {
|
||||
width: 100px;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table ::v-deep .current {
|
||||
width: 100px;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table ::v-deep .target {
|
||||
width: 140px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,284 @@
|
||||
<template>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<v-icon :color="iconColor" :class="iconClass" tabindex="-1" @click="showEditDialog = true">
|
||||
{{ icon }}
|
||||
</v-icon>
|
||||
</td>
|
||||
<td class="name">
|
||||
<span class="cursor-pointer" @click="showEditDialog = true">{{ formatName }}</span>
|
||||
</td>
|
||||
<td v-if="!isResponsiveMobile" class="state">
|
||||
<v-tooltip v-if="state !== null" top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<div v-bind="attrs" v-on="on">{{ formatState }}</div>
|
||||
</template>
|
||||
<span>{{ $t('Panels.TemperaturePanel.Avg') }}: {{ avgState }} %</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
<td class="current">
|
||||
<v-tooltip top :disabled="!(measured_min_temp !== null || measured_max_temp !== null)">
|
||||
<template #activator="{ on, attrs }">
|
||||
<span style="cursor: default" v-bind="attrs" v-on="on">
|
||||
{{ formatTemperature }}
|
||||
</span>
|
||||
</template>
|
||||
<span>
|
||||
{{ $t('Panels.TemperaturePanel.Max') }}: {{ measured_max_temp }}°C
|
||||
<br />
|
||||
{{ $t('Panels.TemperaturePanel.Min') }}: {{ measured_min_temp }}°C
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<div v-if="rpm !== null">
|
||||
<small :class="rpmClass">{{ rpm }} RPM</small>
|
||||
</div>
|
||||
<temperature-panel-list-item-additional-sensor
|
||||
v-if="additionalSensorName"
|
||||
:object-name="objectName"
|
||||
:additional-object-name="additionalSensorName" />
|
||||
</td>
|
||||
<td class="target">
|
||||
<temperature-input
|
||||
v-if="command !== null"
|
||||
:name="name"
|
||||
:target="target"
|
||||
:presets="presets"
|
||||
:min_temp="min_temp"
|
||||
:max_temp="max_temp"
|
||||
:command="command"
|
||||
:attribute-name="commandAttributeName" />
|
||||
</td>
|
||||
<temperature-panel-list-item-edit
|
||||
:bool-show="showEditDialog"
|
||||
:object-name="objectName"
|
||||
:name="name"
|
||||
:format-name="formatName"
|
||||
:additional-sensor-name="additionalSensorName"
|
||||
:icon="icon"
|
||||
:color="color"
|
||||
@close-dialog="showEditDialog = false" />
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { convertName } from '@/plugins/helpers'
|
||||
import {
|
||||
mdiFan,
|
||||
mdiFire,
|
||||
mdiMemory,
|
||||
mdiPrinter3dNozzle,
|
||||
mdiPrinter3dNozzleAlert,
|
||||
mdiRadiator,
|
||||
mdiRadiatorDisabled,
|
||||
mdiThermometer,
|
||||
} from '@mdi/js'
|
||||
import { additionalSensors, opacityHeaterActive, opacityHeaterInactive } from '@/store/variables'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItem extends Mixins(BaseMixin) {
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: Boolean, required: true }) readonly isResponsiveMobile!: boolean
|
||||
|
||||
showEditDialog = false
|
||||
|
||||
get printerObject() {
|
||||
if (!(this.objectName in this.$store.state.printer)) return {}
|
||||
|
||||
return this.$store.state.printer[this.objectName]
|
||||
}
|
||||
|
||||
get printerObjectSettings() {
|
||||
// convert objectName to lowercase, because klipper only user lowercase in configfile.settings
|
||||
const lowerCaseObjectName = this.objectName.toLowerCase()
|
||||
|
||||
if (!(lowerCaseObjectName in (this.$store.state.printer?.configfile?.settings ?? {}))) return {}
|
||||
|
||||
return this.$store.state.printer?.configfile?.settings[lowerCaseObjectName]
|
||||
}
|
||||
|
||||
get name() {
|
||||
const splits = this.objectName.split(' ')
|
||||
if (splits.length === 1) return this.objectName
|
||||
|
||||
return splits[1]
|
||||
}
|
||||
|
||||
get formatName() {
|
||||
return convertName(this.name)
|
||||
}
|
||||
|
||||
get icon() {
|
||||
// handle extruder icons
|
||||
if (this.objectName.startsWith('extruder')) {
|
||||
if (this.printerObject.can_extrude ?? false) return mdiPrinter3dNozzle
|
||||
|
||||
return mdiPrinter3dNozzleAlert
|
||||
}
|
||||
|
||||
// show heater_bed icon
|
||||
if (this.objectName === 'heater_bed') {
|
||||
if (
|
||||
(this.temperature !== null && this.temperature > 50) ||
|
||||
(this.target && this.temperature && this.temperature > this.target - 5)
|
||||
)
|
||||
return mdiRadiator
|
||||
|
||||
return mdiRadiatorDisabled
|
||||
}
|
||||
|
||||
// show heater_generic icon
|
||||
if (this.objectName.startsWith('heater_generic')) return mdiFire
|
||||
|
||||
// show heater_generic icon
|
||||
if (this.objectName.startsWith('tmc')) return mdiMemory
|
||||
|
||||
// show fan icon, if it is a fan
|
||||
if (this.isFan) return mdiFan
|
||||
|
||||
return mdiThermometer
|
||||
}
|
||||
|
||||
get color() {
|
||||
return this.$store.getters['printer/tempHistory/getDatasetColor'](this.objectName) ?? '#FFFFFF'
|
||||
}
|
||||
|
||||
get iconColor() {
|
||||
// set icon color to active, if no target exists (temperature_sensors) or a heater is active
|
||||
if (this.target === null || this.target > 0) return `${this.color}${opacityHeaterActive}`
|
||||
|
||||
return `${this.color}${opacityHeaterInactive}`
|
||||
}
|
||||
|
||||
get iconClass() {
|
||||
const classes = ['_no-focus-style', 'cursor-pointer']
|
||||
|
||||
// add icon animation, when it is a fan and state > 0
|
||||
if (this.isFan) {
|
||||
const disableFanAnimation = this.$store.state.gui?.uiSettings.disableFanAnimation ?? false
|
||||
|
||||
if (!disableFanAnimation && (this.state ?? 0) > 0) classes.push('icon-rotate')
|
||||
}
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get isFan() {
|
||||
return this.objectName.startsWith('temperature_fan')
|
||||
}
|
||||
|
||||
get state(): number | null {
|
||||
return this.printerObject.power ?? this.printerObject.speed ?? null
|
||||
}
|
||||
|
||||
get formatState() {
|
||||
if (this.state === null) return null
|
||||
if (this.target === 0 && this.state === 0) return 'off'
|
||||
|
||||
return `${Math.round(this.state * 100)} %`
|
||||
}
|
||||
|
||||
get avgPower() {
|
||||
return this.$store.getters['printer/tempHistory/getAvgPower'](this.name) ?? 0
|
||||
}
|
||||
|
||||
get avgSpeed() {
|
||||
return this.$store.getters['printer/tempHistory/getAvgSpeed'](this.name) ?? 0
|
||||
}
|
||||
|
||||
get avgState() {
|
||||
if ('power' in this.printerObject) return Math.round(this.avgPower)
|
||||
if ('speed' in this.printerObject) return Math.round(this.avgSpeed)
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get temperature(): number | null {
|
||||
return this.printerObject?.temperature ?? null
|
||||
}
|
||||
|
||||
get formatTemperature() {
|
||||
return `${this.temperature?.toFixed(1) ?? '--'}°C`
|
||||
}
|
||||
|
||||
get min_temp() {
|
||||
return parseInt(this.printerObjectSettings.min_temp ?? 0)
|
||||
}
|
||||
|
||||
get max_temp() {
|
||||
return parseInt(this.printerObjectSettings.max_temp ?? 0)
|
||||
}
|
||||
|
||||
get measured_min_temp() {
|
||||
return this.printerObject?.measured_min_temp?.toFixed(1) ?? null
|
||||
}
|
||||
|
||||
get measured_max_temp() {
|
||||
return this.printerObject?.measured_max_temp?.toFixed(1) ?? null
|
||||
}
|
||||
|
||||
get target() {
|
||||
return this.printerObject?.target ?? null
|
||||
}
|
||||
|
||||
get additionalSensorName() {
|
||||
if (this.objectName === 'z_thermal_adjust') return 'z_thermal_adjust'
|
||||
|
||||
const additionalSensorName = additionalSensors.find((sensorName) => {
|
||||
const objectName = `${sensorName} ${this.name}`
|
||||
|
||||
if (objectName in this.$store.state.printer) return true
|
||||
})
|
||||
|
||||
if (!additionalSensorName) return null
|
||||
|
||||
return `${additionalSensorName} ${this.name}`
|
||||
}
|
||||
|
||||
get rpm() {
|
||||
const rpm = this.printerObject.rpm ?? null
|
||||
|
||||
// return null when rpm doesn't exist
|
||||
if (rpm === null) return null
|
||||
|
||||
return parseInt(this.printerObject.rpm)
|
||||
}
|
||||
|
||||
get rpmClass() {
|
||||
if (this.rpm === 0 && (this.printerObject.speed ?? 0) > 0) return 'red--text'
|
||||
|
||||
return ''
|
||||
}
|
||||
|
||||
get presets() {
|
||||
return this.$store.getters['gui/presets/getPresetsFromHeater']({ name: this.objectName }) ?? []
|
||||
}
|
||||
|
||||
get command() {
|
||||
if (this.objectName.startsWith('temperature_fan')) return 'SET_TEMPERATURE_FAN_TARGET'
|
||||
if (this.objectName.startsWith('extruder') || this.objectName.startsWith('heater_'))
|
||||
return 'SET_HEATER_TEMPERATURE'
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get commandAttributeName() {
|
||||
if (this.command === 'SET_HEATER_TEMPERATURE') return 'HEATER'
|
||||
if (this.command === 'SET_TEMPERATURE_FAN_TARGET') return 'TEMPERATURE_FAN'
|
||||
|
||||
return ''
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .v-icon._no-focus-style:focus::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div>
|
||||
<temperature-panel-list-item-additional-sensor-value
|
||||
v-for="keyName of additionalValues"
|
||||
:key="keyName"
|
||||
:printer-object="printerObject"
|
||||
:object-name="objectName"
|
||||
:key-name="keyName" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemAdditionalSensor extends Mixins(BaseMixin) {
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly additionalObjectName!: string
|
||||
|
||||
get printerObject() {
|
||||
if (!(this.additionalObjectName in this.$store.state.printer)) return {}
|
||||
|
||||
return this.$store.state.printer[this.additionalObjectName]
|
||||
}
|
||||
|
||||
get additionalValues() {
|
||||
if (this.objectName === 'z_thermal_adjust') return ['current_z_adjust']
|
||||
|
||||
return Object.keys(this.printerObject).filter((key) => key !== 'temperature')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<div v-if="isVisible">
|
||||
<small>{{ formatValue }}</small>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemAdditionalSensorValue extends Mixins(BaseMixin) {
|
||||
@Prop({ type: Object, required: true }) readonly printerObject!: { [key: string]: number }
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly keyName!: string
|
||||
|
||||
get value() {
|
||||
const value = this.printerObject[this.keyName] ?? null
|
||||
if (isNaN(value)) return null
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
get formatValue() {
|
||||
let value = this.value?.toFixed(1)
|
||||
if (this.value === null) value = '--'
|
||||
|
||||
// get unit
|
||||
let unit: string | null = null
|
||||
switch (this.keyName) {
|
||||
case 'pressure':
|
||||
unit = 'hPa'
|
||||
break
|
||||
case 'humidity':
|
||||
unit = '%'
|
||||
break
|
||||
case 'current_z_adjust':
|
||||
unit = 'mm'
|
||||
break
|
||||
}
|
||||
|
||||
// format value for current_z_adjust
|
||||
if (this.keyName === 'current_z_adjust' && this.value) {
|
||||
value = this.value.toFixed(3)
|
||||
|
||||
// convert z_adjust value if it is smaller than 0.1 to μm
|
||||
if (Math.abs(this.value) < 0.1) {
|
||||
value = Math.round(this.value * 1000).toString()
|
||||
unit = 'μm'
|
||||
}
|
||||
}
|
||||
|
||||
return unit ? `${value} ${unit}` : value
|
||||
}
|
||||
|
||||
get guiSetting() {
|
||||
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
|
||||
name: this.objectName,
|
||||
sensor: this.keyName,
|
||||
})
|
||||
}
|
||||
|
||||
get isVisible() {
|
||||
if (this.value === null) return false
|
||||
|
||||
return this.guiSetting
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<v-dialog v-model="boolShow" persistent :width="400">
|
||||
<panel :title="formatName" :icon="icon" card-class="temperature-edit-heater-dialog" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="closeDialog">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text class="pt-6">
|
||||
<temperature-panel-list-item-edit-chart-serie
|
||||
v-for="dataset in chartSeries"
|
||||
:key="dataset"
|
||||
:object-name="objectName"
|
||||
:serie-name="dataset" />
|
||||
<temperature-panel-list-item-edit-additional-sensor
|
||||
v-for="additionalSensor in additionalValues"
|
||||
:key="additionalSensor"
|
||||
:object-name="objectName"
|
||||
:additional-sensor="additionalSensor" />
|
||||
<v-row>
|
||||
<v-col class="col-12 text-center pb-0">
|
||||
<v-color-picker
|
||||
hide-mode-switch
|
||||
mode="hexa"
|
||||
:value="color"
|
||||
class="mx-auto"
|
||||
@update:color="setChartColor" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiCloseThick } from '@mdi/js'
|
||||
import TemperaturePanelListItemEditChartSerie from '@/components/panels/Temperature/TemperaturePanelListItemEditChartSerie.vue'
|
||||
import TemperaturePanelListItemEditAdditionalSensor from '@/components/panels/Temperature/TemperaturePanelListItemEditAdditionalSensor.vue'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
|
||||
@Component({
|
||||
components: { TemperaturePanelListItemEditAdditionalSensor, TemperaturePanelListItemEditChartSerie },
|
||||
})
|
||||
export default class TemperaturePanelListItemEdit extends Mixins(BaseMixin) {
|
||||
mdiCloseThick = mdiCloseThick
|
||||
|
||||
@Prop({ type: Boolean, required: true }) readonly boolShow!: boolean
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly name!: string
|
||||
@Prop({ required: true }) readonly additionalSensorName!: string | null
|
||||
@Prop({ type: String, required: true }) readonly formatName!: string
|
||||
@Prop({ type: String, required: true }) readonly icon!: string
|
||||
@Prop({ type: String, required: true }) readonly color!: string
|
||||
|
||||
get chartSeries() {
|
||||
return this.$store.getters['printer/tempHistory/getSerieNames'](this.objectName) ?? []
|
||||
}
|
||||
|
||||
get printerObjectAdditionalSensor() {
|
||||
if (this.additionalSensorName === null || !(this.additionalSensorName in this.$store.state.printer)) return {}
|
||||
|
||||
return this.$store.state.printer[this.additionalSensorName]
|
||||
}
|
||||
|
||||
get additionalValues() {
|
||||
if (this.objectName === 'z_thermal_adjust') return ['current_z_adjust']
|
||||
if (this.objectName === 'nevermore') return ['temperature', 'pressure', 'humidity', 'rpm']
|
||||
|
||||
return Object.keys(this.printerObjectAdditionalSensor).filter((key) => key !== 'temperature')
|
||||
}
|
||||
|
||||
@Debounce(500)
|
||||
setChartColor(value: string | any): void {
|
||||
if (typeof value === 'object' && 'hex' in value) value = value.hex
|
||||
|
||||
this.$store.dispatch('gui/setChartColor', {
|
||||
objectName: this.objectName,
|
||||
value,
|
||||
})
|
||||
|
||||
this.$store.dispatch('printer/tempHistory/setColor', { name: this.objectName, value })
|
||||
}
|
||||
|
||||
closeDialog() {
|
||||
this.$emit('close-dialog')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="col-12 py-1">
|
||||
<v-checkbox v-model="value" :label="label" hide-details class="mt-0" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemEditAdditionalSensor extends Mixins(BaseMixin) {
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly additionalSensor!: string
|
||||
|
||||
get value() {
|
||||
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
|
||||
name: this.objectName,
|
||||
type: this.additionalSensor,
|
||||
})
|
||||
}
|
||||
|
||||
set value(newVal) {
|
||||
this.$store.dispatch('gui/setDatasetAdditionalSensorStatus', {
|
||||
objectName: this.objectName,
|
||||
dataset: this.additionalSensor,
|
||||
value: newVal,
|
||||
})
|
||||
}
|
||||
|
||||
get label() {
|
||||
return this.$t('Panels.TemperaturePanel.ShowNameInList', {
|
||||
name: this.additionalSensor,
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,42 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<v-col class="py-1">
|
||||
<v-checkbox v-model="value" :label="label" hide-details class="mt-0" />
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { capitalize } from '@/plugins/helpers'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemEditChartSerie extends Mixins(BaseMixin) {
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly serieName!: string
|
||||
|
||||
get value() {
|
||||
return this.$store.getters['gui/getDatasetValue']({ name: this.objectName, type: this.serieName })
|
||||
}
|
||||
|
||||
get label() {
|
||||
return this.$t('Panels.TemperaturePanel.ShowNameInChart', {
|
||||
name: this.formatSerieName,
|
||||
})
|
||||
}
|
||||
|
||||
set value(newVal) {
|
||||
this.$store.dispatch('gui/setChartDatasetStatus', {
|
||||
objectName: this.objectName,
|
||||
dataset: this.serieName,
|
||||
value: newVal,
|
||||
})
|
||||
}
|
||||
|
||||
get formatSerieName() {
|
||||
return capitalize(this.serieName)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<v-icon :color="iconColor" :class="iconClass" tabindex="-1" @click="showEditDialog = true">
|
||||
{{ mdiFan }}
|
||||
</v-icon>
|
||||
</td>
|
||||
<td class="name">
|
||||
<span class="cursor-pointer" @click="showEditDialog = true">Nevermore</span>
|
||||
</td>
|
||||
<td class="text-no-wrap text-center" colspan="3">
|
||||
<temperature-panel-list-item-nevermore-value
|
||||
:printer-object="printerObject"
|
||||
:small="false"
|
||||
object-name="nevermore"
|
||||
key-name="gas" />
|
||||
<temperature-panel-list-item-nevermore-value
|
||||
v-for="keyName in nevermoreValues"
|
||||
:key="keyName"
|
||||
:printer-object="printerObject"
|
||||
object-name="nevermore"
|
||||
:key-name="keyName" />
|
||||
<div v-if="rpm !== null">
|
||||
<small :class="rpmClass">{{ rpm }} RPM</small>
|
||||
</div>
|
||||
</td>
|
||||
<temperature-panel-list-item-edit
|
||||
:bool-show="showEditDialog"
|
||||
object-name="nevermore"
|
||||
name="nevermore"
|
||||
format-name="Nevermore"
|
||||
additional-sensor-name="nevermore"
|
||||
:icon="mdiFan"
|
||||
:color="color"
|
||||
@close-dialog="showEditDialog = false" />
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiFan } from '@mdi/js'
|
||||
import { opacityHeaterActive, opacityHeaterInactive } from '@/store/variables'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemNevermore extends Mixins(BaseMixin) {
|
||||
mdiFan = mdiFan
|
||||
|
||||
@Prop({ type: Boolean, required: true }) readonly isResponsiveMobile!: boolean
|
||||
|
||||
showEditDialog = false
|
||||
nevermoreValues = ['temperature', 'pressure', 'humidity']
|
||||
|
||||
get printerObject() {
|
||||
return this.$store.state.printer.nevermore ?? {}
|
||||
}
|
||||
|
||||
get color() {
|
||||
return this.$store.state.gui?.view?.tempchart?.datasetSettings?.nevermore?.color ?? '#ffffff'
|
||||
}
|
||||
|
||||
get iconColor() {
|
||||
// set icon color to active, if no target exists (temperature_sensors) or a heater is active
|
||||
if (this.state === null || this.state > 0) return `${this.color}${opacityHeaterActive}`
|
||||
|
||||
return `${this.color}${opacityHeaterInactive}`
|
||||
}
|
||||
|
||||
get iconClass() {
|
||||
const classes = ['_no-focus-style', 'cursor-pointer']
|
||||
|
||||
// add icon animation, when it is a fan and state > 0
|
||||
const disableFanAnimation = this.$store.state.gui?.uiSettings.disableFanAnimation ?? false
|
||||
|
||||
if (!disableFanAnimation && (this.state ?? 0) > 0) classes.push('icon-rotate')
|
||||
|
||||
return classes
|
||||
}
|
||||
|
||||
get state(): number | null {
|
||||
return this.printerObject.speed ?? null
|
||||
}
|
||||
|
||||
get rpm() {
|
||||
const rpm = this.printerObject.rpm ?? null
|
||||
|
||||
// return null when rpm doesn't exist
|
||||
if (rpm === null) return null
|
||||
|
||||
return parseInt(this.printerObject.rpm)
|
||||
}
|
||||
|
||||
get rpmClass() {
|
||||
if (this.rpm === 0 && (this.printerObject.speed ?? 0) > 0) return 'red--text'
|
||||
|
||||
return ''
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .v-icon._no-focus-style:focus::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
::v-deep .cursor-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div v-if="isVisible">
|
||||
<v-tooltip top :disabled="disableTooltip">
|
||||
<template #activator="{ on, attrs }">
|
||||
<span :style="cssStyle" v-bind="attrs" v-on="on">{{ formatValue }}</span>
|
||||
</template>
|
||||
<span>
|
||||
{{ $t('Panels.TemperaturePanel.Max') }}: {{ formatValue_max }}
|
||||
<br />
|
||||
{{ $t('Panels.TemperaturePanel.Min') }}: {{ formatValue_min }}
|
||||
</span>
|
||||
</v-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins, Prop } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelListItemNevermoreValue extends Mixins(BaseMixin) {
|
||||
@Prop({ type: Object, required: true }) readonly printerObject!: { [key: string]: number }
|
||||
@Prop({ type: String, required: true }) readonly objectName!: string
|
||||
@Prop({ type: String, required: true }) readonly keyName!: string
|
||||
@Prop({ type: Boolean, required: false, default: true }) readonly small!: boolean
|
||||
|
||||
get cssStyle() {
|
||||
let style = { cursor: 'default', fontSize: '1em' }
|
||||
if (this.small) style.fontSize = '0.8em'
|
||||
|
||||
return style
|
||||
}
|
||||
|
||||
get value() {
|
||||
const value = this.printerObject[this.keyName] ?? null
|
||||
if (isNaN(value)) return null
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
get intake_value(): number | null {
|
||||
const name = `intake_${this.keyName}`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get intake_value_min(): number | null {
|
||||
const name = `intake_${this.keyName}_min`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get intake_value_max(): number | null {
|
||||
const name = `intake_${this.keyName}_max`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get exhaust_value(): number | null {
|
||||
const name = `exhaust_${this.keyName}`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get exhaust_value_min(): number | null {
|
||||
const name = `exhaust_${this.keyName}_min`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get exhaust_value_max(): number | null {
|
||||
const name = `exhaust_${this.keyName}_max`
|
||||
|
||||
return this.printerObject[name] ?? null
|
||||
}
|
||||
|
||||
get unit(): string | null {
|
||||
switch (this.keyName) {
|
||||
case 'temperature':
|
||||
return '°C'
|
||||
case 'pressure':
|
||||
return 'hPa'
|
||||
case 'humidity':
|
||||
return '%'
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
get digits() {
|
||||
return ['gas', 'pressure'].includes(this.keyName) ? 0 : 1
|
||||
}
|
||||
|
||||
get formatValue() {
|
||||
return this.getFormatedValue(this.intake_value, this.exhaust_value)
|
||||
}
|
||||
|
||||
get formatValue_min() {
|
||||
return this.getFormatedValue(this.intake_value_min, this.exhaust_value_min)
|
||||
}
|
||||
|
||||
get formatValue_max() {
|
||||
return this.getFormatedValue(this.intake_value_max, this.exhaust_value_max)
|
||||
}
|
||||
|
||||
getFormatedValue(intake: number | null, exhaust: number | null): string {
|
||||
let intake_value = intake?.toFixed(this.digits)
|
||||
let exhaust_value = exhaust?.toFixed(this.digits)
|
||||
if (this.intake_value === null) intake_value = '--'
|
||||
if (this.exhaust_value === null) exhaust_value = '--'
|
||||
|
||||
// return only the value, if unit is null
|
||||
if (this.unit === null) return `${intake_value} > ${exhaust_value}`
|
||||
|
||||
return `${intake_value} ${this.unit} > ${exhaust_value} ${this.unit}`
|
||||
}
|
||||
|
||||
get disableTooltip() {
|
||||
return (
|
||||
this.intake_value_min === null ||
|
||||
this.exhaust_value_min === null ||
|
||||
this.intake_value_max === null ||
|
||||
this.exhaust_value_max === null
|
||||
)
|
||||
}
|
||||
|
||||
get guiSetting() {
|
||||
return this.$store.getters['gui/getDatasetAdditionalSensorValue']({
|
||||
name: this.objectName,
|
||||
sensor: this.keyName,
|
||||
})
|
||||
}
|
||||
|
||||
get isVisible() {
|
||||
if (this.intake_value === null && this.exhaust_value === null) return false
|
||||
|
||||
return this.guiSetting
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<div style="height: 100%">
|
||||
<v-menu v-if="presets.length" :offset-y="true" left>
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
text
|
||||
tile
|
||||
color="primary"
|
||||
v-bind="attrs"
|
||||
:disabled="['printing', 'paused'].includes(printer_state)"
|
||||
class="pa-1"
|
||||
v-on="on">
|
||||
<span class="d-none ml-1 d-md-block">{{ $t('Panels.TemperaturePanel.Presets') }}</span>
|
||||
<v-icon class="d-md-none">{{ mdiFire }}</v-icon>
|
||||
<v-icon>{{ mdiMenuDown }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item v-for="(preset, index) of presets" :key="index" link @click="preheat(preset)">
|
||||
<div class="d-flex align-center _preset-title">
|
||||
<v-icon small class="mr-1">{{ mdiFire }}</v-icon>
|
||||
<span style="padding-top: 2px">{{ preset.name }}</span>
|
||||
</div>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-divider class="_fix_transparency" />
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item link @click="cooldown">
|
||||
<div class="d-flex align-center _preset-title">
|
||||
<v-icon small color="primary" class="mr-1">{{ mdiSnowflake }}</v-icon>
|
||||
<span class="primary--text">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
|
||||
</div>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-btn
|
||||
v-else
|
||||
:icon="$vuetify.breakpoint.smAndDown"
|
||||
:text="$vuetify.breakpoint.mdAndUp"
|
||||
tile
|
||||
color="primary"
|
||||
@click="cooldown">
|
||||
<v-icon small>{{ mdiSnowflake }}</v-icon>
|
||||
<span class="d-none ml-1 d-md-inline">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
|
||||
import { mdiFire, mdiMenuDown, mdiSnowflake } from '@mdi/js'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelPresets extends Mixins(BaseMixin) {
|
||||
mdiFire = mdiFire
|
||||
mdiMenuDown = mdiMenuDown
|
||||
mdiSnowflake = mdiSnowflake
|
||||
|
||||
get presets(): GuiPresetsStatePreset[] {
|
||||
return this.$store.getters['gui/presets/getPresets'] ?? []
|
||||
}
|
||||
|
||||
get cooldownGcode(): string {
|
||||
return this.$store.getters['gui/presets/getCooldownGcode']
|
||||
}
|
||||
|
||||
preheat(preset: GuiPresetsStatePreset): void {
|
||||
for (const [name, attributes] of Object.entries(preset.values)) {
|
||||
if (attributes.bool) {
|
||||
const splits = name.split(' ')
|
||||
const printerObject = splits[0]
|
||||
let printerObjectName = splits[1] ?? splits[0]
|
||||
|
||||
// set default heater command
|
||||
let command = 'SET_HEATER_TEMPERATURE'
|
||||
let commandAttribute = 'HEATER'
|
||||
|
||||
// override command for temperature_fan
|
||||
if (printerObject === 'temperature_fan') {
|
||||
command = 'SET_TEMPERATURE_FAN_TARGET'
|
||||
commandAttribute = 'TEMPERATURE_FAN'
|
||||
}
|
||||
|
||||
// build gcode
|
||||
const gcode = `${command} ${commandAttribute}=${printerObjectName} TARGET=${attributes.value}`
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
|
||||
if (preset.gcode !== '') {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch('server/addEvent', { message: preset.gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: preset.gcode })
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
cooldown(): void {
|
||||
this.$store.dispatch('server/addEvent', { message: this.cooldownGcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: this.cooldownGcode })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
._preset-title {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/*
|
||||
workaround for fixing a transparency issue
|
||||
which is assumingly a vuetify bug
|
||||
*/
|
||||
._fix_transparency {
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<v-menu :offset-y="true" :close-on-content-click="false" :title="$t('Panels.TemperaturePanel.SetupTemperatures')">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
<v-icon small>{{ mdiCog }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="boolTempchart"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.ShowChart')" />
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hideMcuHostSensors"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.HideMcuHostSensors')" />
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="hideMonitors"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.HideMonitors')" />
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="autoscaleTempchart"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.AutoscaleChart')" />
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import BaseMixin from '@/components/mixins/base'
|
||||
import { mdiCog } from '@mdi/js'
|
||||
|
||||
@Component
|
||||
export default class TemperaturePanelSettings extends Mixins(BaseMixin) {
|
||||
mdiCog = mdiCog
|
||||
|
||||
get boolTempchart(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.boolTempchart ?? false
|
||||
}
|
||||
|
||||
set boolTempchart(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.boolTempchart', value: newVal })
|
||||
}
|
||||
|
||||
get autoscaleTempchart(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.autoscale ?? false
|
||||
}
|
||||
|
||||
set autoscaleTempchart(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.autoscale', value: newVal })
|
||||
}
|
||||
|
||||
get hideMcuHostSensors(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.hideMcuHostSensors ?? false
|
||||
}
|
||||
|
||||
set hideMcuHostSensors(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.hideMcuHostSensors', value: newVal })
|
||||
}
|
||||
|
||||
get hideMonitors(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.hideMonitors ?? false
|
||||
}
|
||||
|
||||
set hideMonitors(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.hideMonitors', value: newVal })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,433 +1,49 @@
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
v-if="klipperReadyForGui"
|
||||
:icon="mdiThermometerLines"
|
||||
:title="$t('Panels.TemperaturePanel.Headline').toString()"
|
||||
:collapsible="true"
|
||||
card-class="temperature-panel">
|
||||
<!-- PRESET MENU -->
|
||||
<template #buttons>
|
||||
<v-menu v-if="presets.length" :offset-y="true" left title="Preheat">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn
|
||||
text
|
||||
tile
|
||||
color="primary"
|
||||
v-bind="attrs"
|
||||
:disabled="['printing', 'paused'].includes(printer_state)"
|
||||
class="pa-1"
|
||||
v-on="on">
|
||||
<span class="d-none ml-1 d-md-block">{{ $t('Panels.TemperaturePanel.Presets') }}</span>
|
||||
<v-icon class="d-md-none">{{ mdiFire }}</v-icon>
|
||||
<v-icon>{{ mdiMenuDown }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list dense class="py-0">
|
||||
<v-list-item v-for="preset of presets" :key="preset.index" link @click="preheat(preset)">
|
||||
<div class="d-flex align-center _preset-title">
|
||||
<v-icon small class="mr-1">{{ mdiFire }}</v-icon>
|
||||
<span style="padding-top: 2px">{{ preset.name }}</span>
|
||||
</div>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<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">
|
||||
<v-icon small color="primary" class="mr-1">{{ mdiSnowflake }}</v-icon>
|
||||
<span class="primary--text">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
|
||||
</div>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<v-btn
|
||||
v-if="presets.length === 0"
|
||||
:icon="$vuetify.breakpoint.smAndDown"
|
||||
:text="$vuetify.breakpoint.mdAndUp"
|
||||
tile
|
||||
color="primary"
|
||||
@click="cooldown()">
|
||||
<v-icon small>{{ mdiSnowflake }}</v-icon>
|
||||
<span class="d-none ml-1 d-md-inline">{{ $t('Panels.TemperaturePanel.Cooldown') }}</span>
|
||||
</v-btn>
|
||||
<v-menu
|
||||
:offset-y="true"
|
||||
:close-on-content-click="false"
|
||||
:title="$t('Panels.TemperaturePanel.SetupTemperatures')">
|
||||
<template #activator="{ on, attrs }">
|
||||
<v-btn icon tile v-bind="attrs" v-on="on">
|
||||
<v-icon small>{{ mdiCog }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="boolTempchart"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.ShowChart')"></v-checkbox>
|
||||
</v-list-item>
|
||||
<v-list-item class="minHeight36">
|
||||
<v-checkbox
|
||||
v-model="autoscaleTempchart"
|
||||
class="mt-0"
|
||||
hide-details
|
||||
:label="$t('Panels.TemperaturePanel.AutoscaleChart')"></v-checkbox>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
<panel
|
||||
v-if="klipperReadyForGui"
|
||||
:icon="mdiThermometerLines"
|
||||
:title="$t('Panels.TemperaturePanel.Headline')"
|
||||
:collapsible="true"
|
||||
card-class="temperature-panel">
|
||||
<template #buttons>
|
||||
<temperature-panel-presets />
|
||||
<temperature-panel-settings />
|
||||
</template>
|
||||
<v-card-text class="pa-0">
|
||||
<temperature-panel-list />
|
||||
<template v-if="boolTempchart">
|
||||
<v-divider class="my-0" />
|
||||
<temp-chart />
|
||||
</template>
|
||||
<v-card-text class="pa-0">
|
||||
<responsive
|
||||
:breakpoints="{
|
||||
mobile: (el) => el.width <= 395,
|
||||
}">
|
||||
<template #default="{ el }">
|
||||
<v-simple-table class="temperature-panel-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="icon"> </th>
|
||||
<th class="name">{{ $t('Panels.TemperaturePanel.Name') }}</th>
|
||||
<th v-if="!el.is.mobile" class="state">
|
||||
{{ $t('Panels.TemperaturePanel.State') }}
|
||||
</th>
|
||||
<th class="current">
|
||||
{{ $t('Panels.TemperaturePanel.Current') }}
|
||||
</th>
|
||||
<th class="target">
|
||||
{{ $t('Panels.TemperaturePanel.Target') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(object, index) in temperatureObjects" :key="index">
|
||||
<td class="icon">
|
||||
<v-icon
|
||||
:color="object.iconColor"
|
||||
:class="`_no-focus-style ${object.iconClass}`"
|
||||
style="cursor: pointer"
|
||||
tabindex="-1"
|
||||
@click="openHeater(object)">
|
||||
{{ object.icon }}
|
||||
</v-icon>
|
||||
</td>
|
||||
<td class="name">
|
||||
<span style="cursor: pointer" @click="openHeater(object)">
|
||||
{{ convertName(object.name) }}
|
||||
</span>
|
||||
</td>
|
||||
<td v-if="!el.is.mobile" class="state">
|
||||
<v-tooltip v-if="object.state !== null" top>
|
||||
<template #activator="{ on, attrs }">
|
||||
<div v-bind="attrs" v-on="on">
|
||||
{{ object.state }}
|
||||
</div>
|
||||
</template>
|
||||
<span>{{ $t('Panels.TemperaturePanel.Avg') }}: {{ object.avgState }}</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
<td class="current">
|
||||
<v-tooltip
|
||||
top
|
||||
:disabled="
|
||||
!(
|
||||
object.measured_min_temp !== null ||
|
||||
object.measured_max_temp !== null
|
||||
)
|
||||
">
|
||||
<template #activator="{ on, attrs }">
|
||||
<span style="cursor: default" v-bind="attrs" v-on="on">
|
||||
{{ object.temperature.toFixed(1) }}°C
|
||||
</span>
|
||||
</template>
|
||||
<span>
|
||||
{{ $t('Panels.TemperaturePanel.Max') }}:
|
||||
{{ object.measured_max_temp }}°C
|
||||
<br />
|
||||
{{ $t('Panels.TemperaturePanel.Min') }}:
|
||||
{{ object.measured_min_temp }}°C
|
||||
</span>
|
||||
</v-tooltip>
|
||||
<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 }} RPM</small>
|
||||
</div>
|
||||
</td>
|
||||
<td class="target">
|
||||
<temperature-input
|
||||
v-if="object.command !== null"
|
||||
:name="object.name"
|
||||
:target="object.target"
|
||||
:presets="object.presets"
|
||||
:min_temp="object.min_temp"
|
||||
:max_temp="object.max_temp"
|
||||
:command="object.command"
|
||||
:attribute-name="object.commandAttributeName"></temperature-input>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</v-simple-table>
|
||||
</template>
|
||||
</responsive>
|
||||
</v-card-text>
|
||||
<v-card-text v-if="boolTempchart" class="pa-0 d-inline-block">
|
||||
<v-divider class="mt-0 mb-2"></v-divider>
|
||||
<v-row>
|
||||
<v-col class="py-0">
|
||||
<temp-chart></temp-chart>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
<!-- COLOR-PICKER -->
|
||||
<v-dialog v-model="editHeater.bool" persistent :width="400">
|
||||
<panel
|
||||
:title="convertName(editHeater.name)"
|
||||
:icon="editHeater.icon"
|
||||
card-class="temperature-edit-heater-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="editHeater.bool = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text class="pt-6">
|
||||
<v-row v-for="dataset in editHeater.chartSeries" :key="dataset">
|
||||
<v-col class="col-12 py-1">
|
||||
<v-checkbox
|
||||
v-model="editHeater['bool' + dataset.charAt(0).toUpperCase() + dataset.slice(1)]"
|
||||
:label="
|
||||
$t('Panels.TemperaturePanel.ShowNameInChart', {
|
||||
name: $t(`Panels.TemperaturePanel.Dataset.${capitalize(dataset)}`),
|
||||
})
|
||||
"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisible(dataset)"></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-for="additionalSensor in editHeater.additionalSensors" :key="additionalSensor.name">
|
||||
<v-col class="col-12 py-1">
|
||||
<v-checkbox
|
||||
v-model="additionalSensor.bool"
|
||||
:label="$t('Panels.TemperaturePanel.ShowNameInList', { name: additionalSensor.name })"
|
||||
hide-details
|
||||
class="mt-0"
|
||||
@change="setVisibleAdditionalSensor(additionalSensor)"></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-col class="col-12 text-center pb-0">
|
||||
<v-color-picker
|
||||
hide-mode-switch
|
||||
mode="hexa"
|
||||
:value="editHeater.color"
|
||||
class="mx-auto"
|
||||
@update:color="setChartColor"></v-color-picker>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
</div>
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Component from 'vue-class-component'
|
||||
import { Mixins } from 'vue-property-decorator'
|
||||
import { capitalize, convertName } from '@/plugins/helpers'
|
||||
import { Debounce } from 'vue-debounce-decorator'
|
||||
import { GuiPresetsStatePreset } from '@/store/gui/presets/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 { mdiCloseThick, mdiCog, mdiSnowflake, mdiFire, mdiMenuDown, mdiThermometerLines } from '@mdi/js'
|
||||
import { mdiCloseThick, mdiThermometerLines } from '@mdi/js'
|
||||
import TemperaturePanelPresets from '@/components/panels/Temperature/TemperaturePanelPresets.vue'
|
||||
|
||||
@Component({
|
||||
components: { Panel, TempChart, TemperatureInput, Responsive },
|
||||
components: { Panel, TempChart, TemperatureInput, Responsive, TemperaturePanelPresets },
|
||||
})
|
||||
export default class TemperaturePanel extends Mixins(BaseMixin, ControlMixin) {
|
||||
mdiSnowflake = mdiSnowflake
|
||||
mdiCloseThick = mdiCloseThick
|
||||
mdiCog = mdiCog
|
||||
mdiFire = mdiFire
|
||||
mdiMenuDown = mdiMenuDown
|
||||
mdiThermometerLines = mdiThermometerLines
|
||||
|
||||
convertName = convertName
|
||||
capitalize = capitalize
|
||||
|
||||
private editHeater: any = {
|
||||
bool: false,
|
||||
name: '',
|
||||
icon: '',
|
||||
boolTemperature: false,
|
||||
boolTarget: false,
|
||||
boolPower: false,
|
||||
boolSpeed: false,
|
||||
additionalSensors: {},
|
||||
color: '',
|
||||
}
|
||||
|
||||
get presets(): GuiPresetsStatePreset[] {
|
||||
return this.$store.getters['gui/presets/getPresets'] ?? []
|
||||
}
|
||||
|
||||
get cooldownGcode(): string {
|
||||
return this.$store.getters['gui/presets/getCooldownGcode']
|
||||
}
|
||||
|
||||
get boolTempchart(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.boolTempchart ?? false
|
||||
}
|
||||
|
||||
set boolTempchart(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.boolTempchart', value: newVal })
|
||||
}
|
||||
|
||||
get autoscaleTempchart(): boolean {
|
||||
return this.$store.state.gui.view.tempchart.autoscale ?? false
|
||||
}
|
||||
|
||||
set autoscaleTempchart(newVal: boolean) {
|
||||
this.$store.dispatch('gui/saveSetting', { name: 'view.tempchart.autoscale', value: newVal })
|
||||
}
|
||||
|
||||
get temperatureObjects() {
|
||||
const sensors = this.$store.getters['printer/getTemperatureObjects'] ?? []
|
||||
|
||||
return sensors.filter((sensor: PrinterStateTemperatureObject) => !sensor.name.startsWith('_'))
|
||||
}
|
||||
|
||||
preheat(preset: GuiPresetsStatePreset): void {
|
||||
for (const [name, attributes] of Object.entries(preset.values)) {
|
||||
if (attributes.bool) {
|
||||
let gcode = `SET_HEATER_TEMPERATURE HEATER=${name} TARGET=${attributes.value}`
|
||||
|
||||
if (attributes.type === 'temperature_fan') {
|
||||
const fanName = name.replace('temperature_fan ', '')
|
||||
gcode = `SET_TEMPERATURE_FAN_TARGET temperature_fan=${fanName} TARGET=${attributes.value}`
|
||||
}
|
||||
|
||||
this.$store.dispatch('server/addEvent', { message: gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: gcode })
|
||||
}
|
||||
}
|
||||
|
||||
if (preset.gcode !== '') {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch('server/addEvent', { message: preset.gcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: preset.gcode })
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
cooldown(): void {
|
||||
this.$store.dispatch('server/addEvent', { message: this.cooldownGcode, type: 'command' })
|
||||
this.$socket.emit('printer.gcode.script', { script: this.cooldownGcode })
|
||||
}
|
||||
|
||||
openHeater(object: PrinterStateTemperatureObject): void {
|
||||
this.editHeater.name = object.name
|
||||
this.editHeater.icon = object.icon
|
||||
|
||||
this.editHeater.color = object.chartColor
|
||||
this.editHeater.chartSeries = 'chartSeries' in object ? object.chartSeries : []
|
||||
this.editHeater.boolTemperature = this.$store.getters['gui/getDatasetValue']({
|
||||
name: object.name,
|
||||
type: 'temperature',
|
||||
})
|
||||
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.additionalSensors = object.additionalSensors
|
||||
|
||||
this.editHeater.bool = true
|
||||
}
|
||||
|
||||
setVisible(type: string): void {
|
||||
const serieName = 'bool' + type.charAt(0).toUpperCase() + type.slice(1)
|
||||
const value = this.editHeater[serieName]
|
||||
|
||||
const name = 'view.tempchart.datasetSettings.' + this.editHeater.name + '.' + type
|
||||
this.$store.dispatch('gui/saveSetting', { name, value })
|
||||
}
|
||||
|
||||
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)
|
||||
setChartColor(value: string | any): void {
|
||||
if (typeof value === 'object' && 'hex' in value) value = value.hex
|
||||
this.$store.commit('printer/tempHistory/setColor', { name: this.editHeater.name, value: value })
|
||||
|
||||
const name = 'view.tempchart.datasetSettings.' + this.editHeater.name + '.color'
|
||||
this.$store.dispatch('gui/saveSetting', { name, value })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.canvasjs-chart-tooltip > div {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
._preset-title {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.v-icon._no-focus-style:focus::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table th,
|
||||
.temperature-panel-table td {
|
||||
padding-top: 5px !important;
|
||||
padding-bottom: 5px !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table tr:hover {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table .icon {
|
||||
width: 24px;
|
||||
padding-right: 0 !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.temperature-panel-table .state {
|
||||
width: 100px;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table .current {
|
||||
width: 100px;
|
||||
text-align: right !important;
|
||||
}
|
||||
|
||||
.temperature-panel-table .target {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
/*
|
||||
workaround for fixing a transparency issue
|
||||
which is assumingly a vuetify bug
|
||||
*/
|
||||
._fix_transparency {
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
</style>
|
||||
@@ -1,21 +1,7 @@
|
||||
<style scoped>
|
||||
.v-data-table .v-data-table-header__icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.v-data-table th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.v-data-table .file-list-cursor:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<panel
|
||||
:title="$t('Timelapse.TimelapseFiles').toString()"
|
||||
:title="$t('Timelapse.TimelapseFiles')"
|
||||
:icon="mdiFileDocumentMultipleOutline"
|
||||
card-class="timelapse-files-panel">
|
||||
<v-card-text>
|
||||
@@ -217,7 +203,7 @@
|
||||
<v-list-item
|
||||
v-if="!contextMenu.item.isDirectory && contextMenu.item.permissions.includes('w')"
|
||||
class="red--text"
|
||||
@click="removeFile">
|
||||
@click="deleteDialog = true">
|
||||
<v-icon class="mr-1" color="error">{{ mdiDelete }}</v-icon>
|
||||
{{ $t('Timelapse.Delete') }}
|
||||
</v-list-item>
|
||||
@@ -232,7 +218,7 @@
|
||||
</v-menu>
|
||||
<v-dialog v-model="dialogRenameFile.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.RenameFile').toString()"
|
||||
:title="$t('Timelapse.RenameFile')"
|
||||
card-class="gcode-files-rename-file-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -247,7 +233,7 @@
|
||||
:label="$t('Timelapse.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keypress.enter="renameFileAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -261,7 +247,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogCreateDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.NewDirectory').toString()"
|
||||
:title="$t('Timelapse.NewDirectory')"
|
||||
card-class="gcode-files-new-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -276,7 +262,7 @@
|
||||
:label="$t('Timelapse.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keypress.enter="createDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -292,7 +278,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogRenameDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.RenameDirectory').toString()"
|
||||
:title="$t('Timelapse.RenameDirectory')"
|
||||
card-class="gcode-files-rename-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -307,7 +293,7 @@
|
||||
:label="$t('Timelapse.Name')"
|
||||
required
|
||||
:rules="nameInputRules"
|
||||
@update:error="isInvalidName = !isInvalidName"
|
||||
@update:error="(bool) => (isInvalidName = bool)"
|
||||
@keyup.enter="renameDirectoryAction"></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
@@ -323,7 +309,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogDeleteDirectory.show" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.DeleteDirectory').toString()"
|
||||
:title="$t('Timelapse.DeleteDirectory')"
|
||||
card-class="gcode-files-delete-directory-dialog"
|
||||
:margin-bottom="false">
|
||||
<template #buttons>
|
||||
@@ -347,7 +333,7 @@
|
||||
</v-dialog>
|
||||
<v-dialog v-model="boolVideoDialog" :max-width="700">
|
||||
<panel
|
||||
:title="$t('Timelapse.Video').toString()"
|
||||
:title="$t('Timelapse.Video')"
|
||||
:icon="mdiFileVideo"
|
||||
card-class="timelapse-video-dialog"
|
||||
:margin-bottom="false">
|
||||
@@ -380,18 +366,47 @@
|
||||
</v-card-text>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE SINGLE FILE DIALOG -->
|
||||
<v-dialog v-model="deleteDialog" max-width="400">
|
||||
<panel :title="$t('Timelapse.Delete')" card-class="timelapse-delete-dialog" :margin-bottom="false">
|
||||
<template #buttons>
|
||||
<v-btn icon tile @click="deleteDialog = false">
|
||||
<v-icon>{{ mdiCloseThick }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<v-card-text>
|
||||
<p class="mb-0">
|
||||
{{ $t('Timelapse.DeleteSingleFileQuestion', { name: contextMenu.item.filename }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="" text @click="deleteDialog = false">
|
||||
{{ $t('Timelapse.Cancel') }}
|
||||
</v-btn>
|
||||
<v-btn color="error" text @click="removeFile">
|
||||
{{ $t('Timelapse.Delete') }}
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</panel>
|
||||
</v-dialog>
|
||||
|
||||
<!-- CONFIRM DELETE MULTIPLE FILES DIALOG -->
|
||||
<v-dialog v-model="deleteSelectedDialog" max-width="400">
|
||||
<panel
|
||||
:title="$t('Timelapse.Delete').toString()"
|
||||
card-class="timelapse-delete-selected-dialog"
|
||||
:margin-bottom="false">
|
||||
<panel :title="$t('Timelapse.Delete')" 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>
|
||||
<p v-if="selectedFiles.length === 1" class="mb-0">
|
||||
{{ $t('Timelapse.DeleteSingleFileQuestion', { name: selectedFiles[0].filename }) }}
|
||||
</p>
|
||||
<p v-else class="mb-0">
|
||||
{{ $t('Timelapse.DeleteSelectedQuestion', { count: selectedFiles.length }) }}
|
||||
</p>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
@@ -513,6 +528,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
},
|
||||
}
|
||||
|
||||
private deleteDialog = false
|
||||
private deleteSelectedDialog = false
|
||||
|
||||
private isInvalidName = true
|
||||
@@ -730,7 +746,7 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
|
||||
await addElementToItems(this.currentPath, this.selectedFiles)
|
||||
const date = new Date()
|
||||
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDay()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
||||
const timestamp = `${date.getFullYear()}${date.getMonth()}${date.getDate()}-${date.getHours()}${date.getMinutes()}${date.getSeconds()}`
|
||||
|
||||
this.$socket.emit(
|
||||
'server.files.zip',
|
||||
@@ -837,6 +853,8 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
{ path: this.currentPath + '/' + previewFilename },
|
||||
{ action: 'files/getDeleteFile' }
|
||||
)
|
||||
|
||||
this.deleteDialog = false
|
||||
}
|
||||
|
||||
deleteDirectory(item: FileStateFile) {
|
||||
@@ -893,3 +911,17 @@ export default class TimelapseFilesPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.v-data-table .v-data-table-header__icon {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.v-data-table th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.v-data-table .file-list-cursor:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -202,10 +202,11 @@ import BaseMixin from '@/components/mixins/base'
|
||||
import SettingsRow from '@/components/settings/SettingsRow.vue'
|
||||
import Panel from '@/components/ui/Panel.vue'
|
||||
import { mdiFile, mdiInformation, mdiTextBoxSearchOutline, mdiCloseThick } from '@mdi/js'
|
||||
import WebcamMixin from '@/components/mixins/webcam'
|
||||
@Component({
|
||||
components: { Panel, SettingsRow },
|
||||
})
|
||||
export default class TimelapseStatusPanel extends Mixins(BaseMixin) {
|
||||
export default class TimelapseStatusPanel extends Mixins(BaseMixin, WebcamMixin) {
|
||||
mdiInformation = mdiInformation
|
||||
mdiFile = mdiFile
|
||||
mdiCloseThick = mdiCloseThick
|
||||
@@ -351,14 +352,13 @@ export default class TimelapseStatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get webcamStyle() {
|
||||
let transforms = []
|
||||
const scale = [0, 180].includes(this.camSettings.rotate) ? 1 : this.scale
|
||||
this.camSettings?.flipX ? transforms.push(`scaleX(-${scale})`) : transforms.push(`scaleX(${scale})`)
|
||||
this.camSettings?.flipY ? transforms.push(`scaleY(-${scale})`) : transforms.push(`scaleY(${scale})`)
|
||||
if (this.camSettings.rotate !== 0) transforms.push(`rotate(${this.camSettings.rotate}deg)`)
|
||||
if (transforms.length) return { transform: transforms.join(' ') }
|
||||
|
||||
return {}
|
||||
return {
|
||||
transform: this.generateTransform(
|
||||
this.camSettings.flip_horizontal ?? false,
|
||||
this.camSettings.flip_vertical ?? false,
|
||||
this.camSettings.rotation ?? 0
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
startRender() {
|
||||
|
||||
@@ -2,19 +2,11 @@
|
||||
<panel
|
||||
v-if="klipperReadyForGui"
|
||||
:icon="mdiGamepad"
|
||||
:title="$t('Panels.ToolheadControlPanel.Headline').toString()"
|
||||
:title="$t('Panels.ToolheadControlPanel.Headline')"
|
||||
:collapsible="true"
|
||||
card-class="toolhead-control-panel">
|
||||
<!-- PANEL-HEADER 3-DOT-MENU -->
|
||||
<template
|
||||
v-if="
|
||||
(controlStyle !== 'bars' && (existsZtilt || existsQGL)) ||
|
||||
existsBedScrews ||
|
||||
existsBedTilt ||
|
||||
existsDeltaCalibrate ||
|
||||
existsScrewsTilt
|
||||
"
|
||||
#buttons>
|
||||
<template v-if="showButtons" #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" :disabled="['printing'].includes(printer_state)" v-on="on">
|
||||
@@ -92,21 +84,21 @@
|
||||
</v-menu>
|
||||
</template>
|
||||
<!-- MOVE TO CONTROL -->
|
||||
<move-to-control class="py-0 pt-3"></move-to-control>
|
||||
<move-to-control class="py-0 pt-3" />
|
||||
<!-- AXIS CONTROL -->
|
||||
<v-container>
|
||||
<component :is="`${controlStyle}-control`"></component>
|
||||
<v-container v-if="axisControlVisible">
|
||||
<component :is="`${controlStyle}-control`" />
|
||||
</v-container>
|
||||
<!-- Z-OFFSET CONTROL -->
|
||||
<v-divider></v-divider>
|
||||
<v-divider :class="{ 'mt-3': !axisControlVisible }" />
|
||||
<v-container>
|
||||
<zoffset-control></zoffset-control>
|
||||
<zoffset-control />
|
||||
</v-container>
|
||||
<!-- SPEED FACTOR -->
|
||||
<v-divider></v-divider>
|
||||
<v-divider />
|
||||
<v-container>
|
||||
<tool-slider
|
||||
:label="$t('Panels.ToolheadControlPanel.SpeedFactor').toString()"
|
||||
:label="$t('Panels.ToolheadControlPanel.SpeedFactor')"
|
||||
:icon="mdiSpeedometer"
|
||||
:target="speedFactor"
|
||||
:min="1"
|
||||
@@ -116,7 +108,7 @@
|
||||
:dynamic-range="true"
|
||||
:has-input-field="true"
|
||||
command="M220"
|
||||
attribute-name="S"></tool-slider>
|
||||
attribute-name="S" />
|
||||
</v-container>
|
||||
</panel>
|
||||
</template>
|
||||
@@ -164,5 +156,19 @@ export default class ToolheadControlPanel extends Mixins(BaseMixin, ControlMixin
|
||||
get speedFactor(): number {
|
||||
return this.$store.state.printer?.gcode_move?.speed_factor ?? 1
|
||||
}
|
||||
|
||||
get isPrinting() {
|
||||
return ['printing'].includes(this.printer_state)
|
||||
}
|
||||
|
||||
get axisControlVisible() {
|
||||
return !(this.isPrinting && (this.$store.state.gui.control.hideDuringPrint ?? false))
|
||||
}
|
||||
|
||||
get showButtons() {
|
||||
if (this.controlStyle !== 'bars' && (this.existsZtilt || this.existsQGL)) return true
|
||||
|
||||
return this.existsBedScrews || this.existsBedTilt || this.existsDeltaCalibrate || this.existsScrewsTilt
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Loaded 100 of 217 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user