Compare commits

...
55 Commits
Author SHA1 Message Date
github-actions 5997689ef8 chore: push version number to v2.7.1 2023-08-16 15:13:09 +00:00
Stefan Dej 218f85c81f fix: fix issue on tablet and smaller devices with the sidebar (#1518) 2023-08-16 17:11:36 +02:00
Samuel Wangandmeteyou caaf5e1606 locale(zh): Update Chinese (zh) localization (#1521)
Co-authored-by: meteyou <meteyou@gmail.com>
2023-08-16 17:10:07 +02:00
meteyou 57de746adc docs(changelog): update changelog 2023-08-12 16:08:49 +00:00
github-actions b0491deb93 chore: push version number to v2.7.0 2023-08-12 16:06:03 +00:00
DaviteuszandStefan Dej 90d76c1ffe locale(pl): Update Polish translation (#1515)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-10 22:07:35 +02:00
Stefan Dejandrackrick 1cd2541d6f feat: add nevermore to temperature panel (#1511)
Co-authored-by: rackrick <45207681+rackrick@users.noreply.github.com>
2023-08-09 23:40:48 +02:00
François LaBergeandStefan Dej 0c4b9e7551 feat: add a select all option on the backup and restore dialogs (#1448)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-09 23:40:12 +02:00
Stefan Dej 16165ec85f refactor: soft down info buttons in update manager (#1513) 2023-08-09 20:05:26 +02:00
Stefan Dej 69eaeb6557 feat: add option to hide FPS counter in webcams (#1488) 2023-08-09 20:04:48 +02:00
Stefan Dej e9c22d32bc feat: add an option to set the sidebar default state (#1462) 2023-08-09 01:08:49 +02:00
rackrick 98d9b0aa59 fix: fix cursor style for item name to be a pointer (#1514)
Signed-off-by: Patrick Stainbrook <patrick@hohestadt.de>
2023-08-09 00:56:34 +02:00
sddev0andSebastian Duerholt da157891a4 feat: hide axis controls during print (#1452)
Co-authored-by: Sebastian Duerholt <s.duerholt@gmail.com>
2023-08-07 23:43:20 +02:00
Stefan Dej 9883457e9d feat: add option to hide MCU/Host sensors in the temp panel (#1496) 2023-08-07 23:25:43 +02:00
Stefan Dej 15371adc3d feat: hide screws tilt adjust dialog, when using MAX_DEVIATION (#1474) 2023-08-07 23:25:00 +02:00
DaviteuszandStefan Dej fe7aee9307 locale(pl): Update Polish translation (#1502)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-07 23:03:29 +02:00
Samuel-0-0andStefan Dej dbb5f81206 locale(zh): Update Chinese (zh) localization (#1503)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-08-07 22:54:54 +02:00
meteyou 9e2e923a8f docs(changelog): update changelog 2023-07-30 19:26:46 +00:00
github-actions 1a12554821 chore: push version number to v2.6.2 2023-07-30 19:22:55 +00:00
Zhu QianandStefan Dej 7251a8c6ba locale(zh): update chinese locale (#1486)
Co-authored-by: Stefan Dej <meteyou@gmail.com>
2023-07-30 21:17:39 +02:00
Stefan Dej cda3098c9e fix: fix issue with cannot extrude after a Klipper restart (#1495) 2023-07-30 21:03:00 +02:00
Stefan Dej 9eb133bd85 fix: fix multiple issues in the refactored update manager (#1497) 2023-07-30 21:02:28 +02:00
Stefan Dej 6a4cca751c fix: fix issue with create/edit presets and refactor settings (#1499) 2023-07-30 21:01:05 +02:00
Stefan Dej d67ef3aa90 fix: use webcam name instead of UUID for timelapse plugin (#1492) 2023-07-30 12:41:08 +02:00
Stefan Dej aeee198239 fix: fix issue with camel-case object names in temperature panel (#1491) 2023-07-28 22:48:01 +02:00
Stefan Dej 5c40820108 fix: fix flip function in several webcam clients (#1487) 2023-07-27 23:02:51 +02:00
Stefan Dej e929c7cc0f fix: hide rpm in temperature_fans without tachometer_pin (#1489) 2023-07-27 09:42:07 +02:00
Stefan Dej 0b47a80b13 refactor: refactor SettingsRow (#1484) 2023-07-24 22:13:16 +02:00
Stefan Dej 8447be2ece fix: fix editor save & restart button behavior (#1483) 2023-07-24 22:08:50 +02:00
Daviteusz 0c5aca8baf locale(pl): Update Polish translation (#1482) 2023-07-24 19:27:21 +02:00
meteyou eceb442a4c docs(changelog): update changelog 2023-07-24 07:36:14 +00:00
github-actions 98160e1368 chore: push version number to v2.6.1 2023-07-24 07:32:51 +00:00
Stefan Dej f52b94c459 locale(tr): update turkish locale (#1480) 2023-07-24 09:32:00 +02:00
0cefa24e76 refactor: display errors and warnings in the update_manager (#1453)
Co-authored-by: th33xitus <domwil1091+github@gmail.com>
Co-authored-by: rackrick <45207681+rackrick@users.noreply.github.com>
2023-07-22 19:49:03 +02:00
Stefan Dej be253165a0 refactor: extract Presets and Settings from TemperaturePanel (#1465) 2023-07-22 15:07:30 +02:00
Stefan Dej 5b2bea51aa fix: fix issue with webcams in farm printers (#1469) 2023-07-22 15:07:12 +02:00
Stefan Dej db09bbe043 refactor: change SettingsGeneralTab file (#1475) 2023-07-22 15:06:55 +02:00
DaviteuszandWeblate 6758049d29 locale(pl): Update Polish translation (#1476)
Co-authored-by: Weblate <noreply@weblate.org>
2023-07-20 17:06:46 +02:00
antekmeco a58bef2a03 locale(pl): update polish locale (#1471) 2023-07-19 22:49:53 +02:00
dependabot[bot] a1d3dc9118 build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (#1470)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 18:41:57 +02:00
Stefan Dej 1895d2d905 fix: fix issue with CSV separator in contents (#1460) 2023-07-16 22:43:57 +02:00
Stefan Dej 7c81690c1e refactor: use moonraker webcam api instead of direct DB access (#1445) 2023-07-16 21:51:45 +02:00
Stefan Dej 039a446944 fix: fix issue with ETA and 12h time format (#1463) 2023-07-13 21:40:10 +02:00
Samuel-0-0 bcbef2f19a locale(zh): Update Chinese (zh) localization (#1459) 2023-07-12 21:43:58 +02:00
Jamin Collins 39590004da fix: avoid hitting 100% before print is complete (#1455) 2023-07-09 19:32:40 +02:00
Stefan Dej ef2d17cadd chore: add dev-dist to .gitignore (#1451)
This commit adds 'dev-dist' directory to .gitignore. 'dev-dist' is a folder that gets created when we build the application in development environment, it's not needed to be tracked as it only contains generated files.

Signed-off-by: Stefan Dej <meteyou@gmail.com>
2023-07-01 15:06:37 +02:00
Stefan Dej a7e70c75d0 fix: fix condition in restartServiceNameExists check (#1450) 2023-07-01 11:08:10 +02:00
Stefan Dej 21d3d39503 refactor: build version file for moonraker (#1449) 2023-07-01 08:41:43 +02:00
DaviteuszandWeblate d8441254db locale(pl): Update Polish translation (#1447)
Co-authored-by: Weblate <noreply@weblate.org>
2023-06-28 20:17:04 +02:00
Stefan Dej 6e7ef6554e fix: remove variable check in klipper config StreamParser (#1435) 2023-06-28 20:16:19 +02:00
dependabot[bot] 98a750922a build(deps): bump semver from 7.3.7 to 7.5.2 (#1443)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-25 00:11:28 +02:00
th33xitus 7da33523d1 fix: show delete dialog for single files too (#1442) 2023-06-25 00:11:05 +02:00
Stefan Dej 2962df21e5 chore(pwa): remove debug warnings in browser console (#1441) 2023-06-25 00:01:48 +02:00
DaviteuszandWeblate 73e503fc64 locale(pl): Update Polish translation (#1434)
Co-authored-by: Weblate <noreply@weblate.org>
2023-06-24 22:00:11 +02:00
meteyou 705065d65e docs(changelog): update changelog 2023-06-19 19:53:50 +00:00
128 changed files with 8393 additions and 5620 deletions

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ design
*.log
packages/test
dist
dev-dist
temp
.vuerc
.version
+145
View File
@@ -2,6 +2,151 @@
# Changelog
All notable changes to Mainsail will be documented in this file.
## [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
+2146 -1528
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "mainsail",
"version": "2.6.0",
"version": "2.7.1",
"private": true,
"decription": "a klipper web interface",
"author": {
@@ -51,7 +51,7 @@
"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",
@@ -94,13 +94,13 @@
"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": {
+47 -34
View File
@@ -1,37 +1,11 @@
<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-service-worker />
@@ -44,8 +18,8 @@
<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>
@@ -105,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
}
@@ -170,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')
@@ -311,3 +299,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>
+16 -8
View File
@@ -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
}
+1 -5
View File
@@ -70,7 +70,7 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return this.$store.state.naviDrawer
}
set naviDrawer(newVal: boolean) {
set naviDrawer(newVal) {
this.$store.dispatch('setNaviDrawer', newVal)
}
@@ -133,10 +133,6 @@ export default class TheSidebar extends Mixins(NavigationMixin, BaseMixin) {
return output
}
mounted() {
this.naviDrawer = this.$vuetify.breakpoint.lgAndUp
}
}
</script>
+35 -18
View File
@@ -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,31 @@ 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()
}
if (!confirmOnEmergencyStop) this.emergencyStop()
this.showEmergencyStopDialog = true
}
emergencyStop() {
@@ -342,14 +360,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;
}
+6 -2
View File
@@ -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' }
)
}
}
+98 -144
View File
@@ -14,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
@@ -33,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)',
@@ -57,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',
@@ -158,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: [
@@ -188,11 +202,7 @@ export default class TempChart extends Mixins(BaseMixin) {
],
},
},
],
dataset: {
source: [],
},
series: [],
]
}
get chart(): ECharts | null {
@@ -241,9 +251,14 @@ export default class TempChart extends Mixins(BaseMixin) {
}
}
mounted() {
this.initChart()
this.chartOptions.xAxis.axisLabel.formatter = this.timeFormat
get gridRight() {
return this.boolDisplayPwmAxis ? 25 : 15
}
get optionGridRight() {
if (this.boolDisplayPwmAxis) return 35
return 15
}
beforeDestroy() {
@@ -251,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">' +
@@ -338,24 +295,35 @@ 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) output += dataset.value[seriesNameTemperature].toFixed(1)
if (seriesNameTarget in dataset.value) output += ' / ' + dataset.value[seriesNameTarget].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
const value = (dataset.value[seriesName] * 100).toFixed(0)
output += ` [ ${value}% ]`
})
output += '</div>'
output += '</div>'
@@ -364,26 +332,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) {
@@ -396,14 +344,20 @@ 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', {}, { action: 'printer/tempHistory/init' })
}
}
}
</script>
@@ -65,13 +65,21 @@ export default class TheScrewsTiltAdjustDialog extends Mixins(BaseMixin, Control
return this.$store.state.printer.screws_tilt_adjust?.error ?? false
}
get max_deviation() {
return this.$store.state.printer.screws_tilt_adjust?.max_deviation ?? null
}
get results() {
return this.$store.state.printer.screws_tilt_adjust?.results ?? {}
}
get showDialog() {
// don't display the dialog, if the user disabled it in the UI settings
if (!this.boolScrewsTiltAdjustDialog) return false
// don't display the dialog, if the user add the MAX_DEVIATION attribute to the SCREWS_TILT_CALCULATE command
if (this.max_deviation !== null) return false
return this.error || Object.keys(this.results).length
}
+66
View File
@@ -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>
+2 -2
View File
@@ -175,13 +175,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,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
}
}
+28 -2
View File
@@ -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'
}
}
+30 -21
View File
@@ -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>
@@ -27,9 +25,9 @@
</v-list-item>
<v-list-item
v-for="webcam of printer_webcams"
:key="webcam.index"
: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>
@@ -47,12 +45,12 @@
<div
v-if="
printer.socket.isConnected &&
currentCamId !== 'off' &&
currentCamName !== 'off' &&
currentWebcam &&
'service' in currentWebcam
"
class="webcamContainer">
<webcam-wrapper :webcam="currentWebcam" :show-fps="false" />
<webcam-wrapper :webcam="currentWebcam" :printer-url="printerUrl" :show-fps="false" />
</div>
<v-card-title
class="white--text py-2"
@@ -122,6 +120,7 @@ import { mdiPrinter3d, mdiWebcam, mdiMenuDown, mdiWebcamOff, mdiFileOutline } fr
import { Debounce } from 'vue-debounce-decorator'
import WebcamMixin from '@/components/mixins/webcam'
import WebcamWrapper from '@/components/webcams/WebcamWrapper.vue'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
@Component({
components: {
@@ -156,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() {
@@ -199,18 +198,30 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin, WebcamMixin) {
}
get showWebcamSwitch() {
return this.printer.socket.isConnected && this.printer_webcams.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 currentWebcam() {
const currentCam = this.printer_webcams.find((webcam: any) => webcam.id === this.currentCamId)
get currentWebcam(): GuiWebcamStateWebcam | null {
const currentCam = this.printer_webcams?.find(
(webcam: GuiWebcamStateWebcam) => webcam.name === this.currentCamName
)
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() {
@@ -268,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>
+45 -21
View File
@@ -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">
@@ -372,7 +369,7 @@
<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="removeFile">
<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>
@@ -387,7 +384,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>
@@ -415,10 +412,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>
@@ -428,7 +422,7 @@
<v-text-field
ref="inputFieldRenameFile"
v-model="dialogRenameFile.newName"
:label="$t('Files.Name').toString()"
:label="$t('Files.Name')"
required
:rules="nameInputRules"
@update:error="(bool) => (isInvalidName = bool)"
@@ -445,7 +439,7 @@
</v-dialog>
<v-dialog v-model="dialogDuplicateFile.show" :max-width="400">
<panel
:title="$t('Files.DuplicateFile').toString()"
:title="$t('Files.DuplicateFile')"
card-class="gcode-files-duplicate-file-dialog"
:margin-bottom="false">
<template #buttons>
@@ -457,7 +451,7 @@
<v-text-field
ref="inputFieldDuplicateFile"
v-model="dialogDuplicateFile.newName"
:label="$t('Files.Name').toString()"
:label="$t('Files.Name')"
required
:rules="nameInputRules"
@update:error="(bool) => (isInvalidName = bool)"
@@ -474,7 +468,7 @@
</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>
@@ -503,7 +497,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>
@@ -523,18 +517,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>
@@ -545,7 +566,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">
@@ -783,6 +804,7 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
item: { ...this.contextMenu.item },
}
private deleteDialog = false
private deleteSelectedDialog = false
private isInvalidName = true
@@ -1379,6 +1401,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) {
+62 -23
View File
@@ -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">
@@ -216,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>
@@ -240,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>
@@ -267,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>
@@ -298,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>
@@ -329,7 +327,7 @@
</v-dialog>
<v-dialog v-model="dialogDuplicateFile.show" max-width="400">
<panel
:title="$t('Machine.ConfigFilesPanel.DuplicateFile').toString()"
:title="$t('Machine.ConfigFilesPanel.DuplicateFile')"
card-class="maschine-configfiles-duplicate-file-dialog"
:margin-bottom="false">
<template #buttons>
@@ -360,7 +358,7 @@
</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>
@@ -391,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>
@@ -422,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>
@@ -450,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">
@@ -461,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>
@@ -476,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 }})
@@ -692,6 +728,7 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
},
}
private deleteDialog = false
private deleteSelectedDialog = false
private isInvalidName = true
@@ -1164,6 +1201,8 @@ export default class ConfigFilesPanel extends Mixins(BaseMixin) {
{ path: this.absolutePath + '/' + this.contextMenu.item.filename },
{ action: 'files/getDeleteFile' }
)
this.deleteDialog = false
}
deleteSelectedFiles() {
+72 -591
View File
@@ -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.getDay() !== lastCommitDate.getDay()
) {
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>
+41 -5
View File
@@ -112,7 +112,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 +120,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 +143,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 +240,7 @@ import {
mdiDelete,
mdiCloseThick,
} from '@mdi/js'
import Panel from '@/components/ui/Panel.vue'
interface dialogRenameObject {
show: boolean
@@ -229,6 +256,7 @@ interface dialogAddBatchToQueue {
@Component({
components: {
Panel,
StartPrintDialog,
},
})
@@ -246,6 +274,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,6 +347,11 @@ 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;`
}
@@ -488,12 +522,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() {
+1 -1
View File
@@ -185,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() {
@@ -0,0 +1,170 @@
<template>
<responsive
:breakpoints="{
mobile: (el) => el.width <= 395,
}">
<template #default="{ el }">
<v-simple-table class="temperature-panel-table">
<thead>
<tr>
<th class="icon">&nbsp;</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" />
</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 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 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,280 @@
<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,
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 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)
}
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,113 @@
<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) {
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 })
}
}
</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,68 @@
<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="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 })
}
}
</script>
+20 -404
View File
@@ -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">&nbsp;</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>
@@ -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>
@@ -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>
@@ -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
@@ -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>
+10 -2
View File
@@ -94,11 +94,11 @@
<!-- MOVE TO CONTROL -->
<move-to-control class="py-0 pt-3"></move-to-control>
<!-- AXIS CONTROL -->
<v-container>
<v-container v-if="axisControlVisible">
<component :is="`${controlStyle}-control`"></component>
</v-container>
<!-- Z-OFFSET CONTROL -->
<v-divider></v-divider>
<v-divider :class="{ 'mt-3': !axisControlVisible }"></v-divider>
<v-container>
<zoffset-control></zoffset-control>
</v-container>
@@ -164,5 +164,13 @@ 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))
}
}
</script>
+6 -5
View File
@@ -28,7 +28,7 @@
<v-list-item-title>{{ $t('Panels.WebcamPanel.All') }}</v-list-item-title>
</v-list-item-content>
</v-list-item>
<v-list-item v-for="webcam of webcams" :key="webcam.id" link @click="currentCamId = webcam.id">
<v-list-item v-for="webcam of webcams" :key="webcam.name" link @click="currentCamId = webcam.name">
<v-list-item-icon class="mr-2">
<v-icon small class="mt-1">{{ convertWebcamIcon(webcam.icon) }}</v-icon>
</v-list-item-icon>
@@ -77,13 +77,14 @@ export default class WebcamPanel extends Mixins(BaseMixin, WebcamMixin) {
return this.$store.getters['gui/webcams/getWebcams']
}
// id changed to name with the refactoring of using moonraker webcam API
get currentCamId(): string {
if (this.webcams.length === 1) return this.webcams[0].id ?? 'all'
if (this.webcams.length === 1) return this.webcams[0].name ?? 'all'
let currentCamId = this.$store.state.gui.view.webcam.currentCam[this.currentPage ?? ''] ?? 'all'
if (this.webcams.findIndex((webcam: GuiWebcamStateWebcam) => webcam.id === currentCamId) !== -1)
if (this.webcams.findIndex((webcam: GuiWebcamStateWebcam) => webcam.name === currentCamId) !== -1)
return currentCamId
else if (currentCamId !== undefined && this.webcams.length === 1) return this.webcams[0].id ?? ''
else if (currentCamId !== undefined && this.webcams.length === 1) return this.webcams[0].name ?? ''
else return 'all'
}
@@ -92,7 +93,7 @@ export default class WebcamPanel extends Mixins(BaseMixin, WebcamMixin) {
}
get currentCam(): any {
const cam = this.webcams.find((cam: GuiWebcamStateWebcam) => cam.id === this.currentCamId)
const cam = this.webcams.find((cam: GuiWebcamStateWebcam) => cam.name === this.currentCamId)
return (
cam ?? {
@@ -0,0 +1,88 @@
<template>
<div>
<v-btn :loading="loadings.includes('backupDbButton')" small @click="openDialog">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
<v-dialog v-model="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Backup')"
card-class="mainsail-backup-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.BackupDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="backupableNamespaces"
select-all
@update:selectedCheckboxes="onSelectBackupCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('backupMainsail')" @click="backupMainsail">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabBackupDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
showDialog = false
backupableNamespaces: { value: string; label: string | TranslateResult }[] = []
backupCheckboxes: string[] = []
async mounted() {
this.backupableNamespaces = await this.loadBackupableNamespaces()
}
onSelectBackupCheckboxes(backupCheckboxes: string[]) {
this.backupCheckboxes = backupCheckboxes
}
async backupMainsail() {
await this.$store.dispatch('socket/addLoading', 'backupMainsail')
await this.$store.dispatch('gui/backupMoonrakerDB', this.backupCheckboxes)
await this.$store.dispatch('socket/removeLoading', 'backupMainsail')
this.closeDialog()
}
async openDialog() {
this.backupableNamespaces = await this.loadBackupableNamespaces()
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
}
</script>
@@ -0,0 +1,89 @@
<template>
<div>
<v-btn color="error" small @click="openDialog">
{{ $t('Settings.GeneralTab.FactoryReset') }}
</v-btn>
<v-dialog v-model="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.FactoryReset')"
card-class="mainsail-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.FactoryDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="resetableNamespaces"
select-all
@update:selectedCheckboxes="onSelectResetCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
:loading="loadings.includes('resetMainsail')"
@click="resetMainsailAction">
{{ $t('Settings.GeneralTab.Reset') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabResetDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
showDialog = false
resetableNamespaces: { value: string; label: string | TranslateResult }[] = []
resetCheckboxes: string[] = []
async mounted() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
}
onSelectResetCheckboxes(resetCheckboxes: string[]) {
this.resetCheckboxes = resetCheckboxes
}
resetMainsailAction() {
this.$store.dispatch('socket/addLoading', 'resetMainsail')
this.$store.dispatch('gui/resetMoonrakerDB', this.resetCheckboxes)
}
async openDialog() {
this.resetableNamespaces = await this.loadBackupableNamespaces()
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
}
</script>
@@ -0,0 +1,137 @@
<template>
<div>
<input ref="uploadBackupFile" type="file" :accept="['.json']" class="d-none" @change="uploadRestore" />
<v-btn small :loading="loadings.includes('restoreUploadButton')" class="ml-3" @click="restoreDb">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
<v-dialog :value="showDialog" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Restore')"
card-class="mainsail-restore-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="closeDialog">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.RestoreDialog') }}</p>
</v-col>
</v-row>
<v-row>
<checkbox-list
:options="restoreableNamespaces"
select-all
@update:selectedCheckboxes="onSelectRestoreCheckboxes" />
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('restoreMainsail')" @click="restoreDbAction">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
<script lang="ts">
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import { TranslateResult } from 'vue-i18n'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
import SettingsGeneralTabBackupDatabase from '@/components/settings/General/GeneralBackup.vue'
import Vue from 'vue'
@Component({
components: { SettingsGeneralTabBackupDatabase, Panel, SettingsRow, CheckboxList },
})
export default class SettingsGeneralTabRestoreDatabase extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
declare $refs: {
uploadBackupFile: HTMLInputElement
}
showDialog = false
restoreableNamespaces: { value: string; label: string | TranslateResult }[] = []
restoreCheckboxes: string[] = []
restoreObjects: any = {}
onSelectRestoreCheckboxes(backupCheckboxes: string[]) {
this.restoreCheckboxes = backupCheckboxes
}
async restoreDb() {
this.$refs?.uploadBackupFile?.click()
}
uploadRestore() {
if ((this.$refs.uploadBackupFile.files?.length ?? 0) === 0) {
window.console.error('No json uploaded')
return
}
// get file
// @ts-ignore
const backup = this.$refs?.uploadBackupFile?.files[0]
const reader = new FileReader()
reader.readAsText(backup, 'UTF-8')
reader.onload = (evt) => {
this.restoreableNamespaces = []
try {
this.restoreObjects = JSON.parse(evt?.target?.result + '')
const keys = Object.keys(this.restoreObjects)
this.restoreableNamespaces = keys.map((key) => {
const namespace = this.availableKeys.find((namespace) => namespace.value === key)
if (namespace) return namespace
return { value: key, label: key }
})
// sort restoreableNamespaces
this.restoreableNamespaces = this.restoreableNamespaces.sort(this.sortNamespaces)
this.openDialog()
} catch (e) {
Vue.$toast.error(this.$t('Settings.GeneralTab.CannotReadJson').toString())
}
}
reader.onerror = (evt) => {
window.console.error(evt)
}
// empty input file field
this.$refs.uploadBackupFile.value = ''
}
openDialog() {
this.showDialog = true
}
closeDialog() {
this.showDialog = false
}
restoreDbAction() {
this.$store.dispatch('socket/addLoading', 'restoreDbAction')
this.$store.dispatch('gui/restoreMoonrakerDB', {
dbCheckboxes: this.restoreCheckboxes,
restoreObjects: this.restoreObjects,
})
}
}
</script>
@@ -0,0 +1,56 @@
<template>
<settings-row :title="preset.name" :sub-title="subTitle">
<v-btn small outlined class="ml-3" @click="editPreset">
<v-icon left small>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
<v-btn small outlined class="ml-3 minwidth-0 px-2" color="error" @click="deletePreset">
<v-icon small>{{ mdiDelete }}</v-icon>
</v-btn>
</settings-row>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
import { convertName } from '@/plugins/helpers'
import { mdiDelete, mdiPencil } from '@mdi/js'
@Component({
components: { SettingsRow },
})
export default class PresetsEntry extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
@Prop({ required: true }) readonly preset!: GuiPresetsStatePreset
get subTitle() {
let output: string[] = []
Object.keys(this.preset.values).forEach((key: string) => {
const values = this.preset.values[key]
if (values.bool) {
const name = key.indexOf(' ') ? key.slice(key.indexOf(' ') + 1) : key
output.push(convertName(name) + ': ' + values.value + '°C')
}
})
if (this.preset.gcode) output.push(this.$t('Settings.PresetsTab.CustomGCode').toString())
return output.join(', ')
}
editPreset() {
this.$emit('edit', this.preset)
}
deletePreset() {
this.$store.dispatch('gui/presets/delete', this.preset.id)
}
}
</script>
@@ -0,0 +1,26 @@
<template>
<settings-row :title="$t('Settings.PresetsTab.Cooldown')">
<v-btn small outlined class="ml-3" @click="editCooldown">
<v-icon left small>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
</settings-row>
</template>
<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { mdiPencil } from '@mdi/js'
@Component({
components: { SettingsRow },
})
export default class PresetsEntryCooldown extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
editCooldown() {
this.$emit('edit')
}
}
</script>
@@ -0,0 +1,182 @@
<template>
<v-card flat>
<v-form v-model="valid" @submit.prevent="savePreset">
<v-card-title>{{ title }}</v-card-title>
<v-card-text>
<v-row v-if="boolInvalidMin" class="mt-3">
<v-col class="py-0">
<v-alert dense text type="error">{{ $t('Settings.PresetsTab.PresetInfo') }}</v-alert>
</v-col>
</v-row>
<settings-row :title="$t('Settings.PresetsTab.Name')">
<v-text-field
v-model="preset.name"
:placeholder="$t('Settings.PresetsTab.PresetNamePlaceholder')"
hide-details="auto"
:rules="[rules.required, rules.unique]"
dense
outlined />
</settings-row>
<div v-for="(value, key) of preset.values" :key="key">
<v-divider class="my-2" />
<settings-row :title="converNameObject(key)">
<v-checkbox v-model="value.bool" hide-details class="shrink mt-0" />
<v-text-field
v-model="value.value"
hide-details="auto"
:rules="[rules.invalid]"
type="number"
suffix="°C"
dense
outlined
hide-spin-buttons
@focus="$event.target.select()" />
</settings-row>
</div>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.PresetsTab.CustomGCode')">
<v-textarea v-model="preset.gcode" outlined hide-details />
</settings-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="closeForm">
{{ $t('Settings.Cancel') }}
</v-btn>
<v-btn color="primary" text type="submit" :disabled="!valid">
{{ storeButtonText }}
</v-btn>
</v-card-actions>
</v-form>
</v-card>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
import { convertName } from '@/plugins/helpers'
import { mdiDelete, mdiPencil } from '@mdi/js'
@Component({
components: { SettingsRow },
})
export default class PresetsForm extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
@Prop({ required: true }) readonly preset!: GuiPresetsStatePreset
valid = false
boolInvalidMin = false
private rules = {
required: (value: string) => value !== '' || this.$t('Settings.PresetsTab.ErrorNameRequired'),
unique: (value: string) => !this.existsPresetName(value) || this.$t('Settings.PresetsTab.ErrorNameNotUnique'),
invalid: (value: string) => parseFloat(value) >= 0 || this.$t('Settings.PresetsTab.ErrorInvalidValue'),
}
get title() {
if (this.preset.id === null) return this.$t('Settings.PresetsTab.CreateHeadline')
return this.$t('Settings.PresetsTab.EditHeadline')
}
get storeButtonText() {
if (this.preset.id === null) return this.$t('Settings.PresetsTab.StoreButton')
return this.$t('Settings.PresetsTab.UpdateButton')
}
get presets() {
return this.$store.getters['gui/presets/getPresets'] ?? []
}
get available_heaters() {
return (this.$store.state.printer?.heaters?.available_heaters ?? []).sort()
}
get available_temperature_fans() {
return (this.$store.state.printer?.heaters?.available_sensors ?? [])
.filter((name: string) => name.startsWith('temperature_fan '))
.sort()
}
mounted() {
const presetValues = Object.keys(this.preset.values)
// add missing heaters to preset
this.available_heaters
.filter((name: string) => !presetValues.includes(name))
.forEach((name: string) => {
this.preset.values[name] = {
bool: false,
type: 'heater',
value: 0,
}
})
// add missing temperature_fans to preset
this.available_temperature_fans
.filter((name: string) => !presetValues.includes(name))
.forEach((name: string) => {
this.preset.values[name] = {
bool: false,
type: 'temperature_fan',
value: 0,
}
})
// remove unused values from preset
presetValues
.filter(
(name: string) =>
!this.available_heaters.includes(name) && !this.available_temperature_fans.includes(name)
)
.forEach((name) => {
delete this.preset.values[name]
})
}
existsPresetName(name: string) {
return (
this.presets.findIndex(
(preset: GuiPresetsStatePreset) => preset.name === name && preset.id !== this.preset.id
) !== -1
)
}
converNameObject(name: string) {
return convertName(name.replace('temperature_fan ', ''))
}
closeForm() {
this.$emit('close')
}
savePreset() {
let setValues = 0
for (const key of Object.keys(this.preset.values)) {
if (this.preset.values[key].bool) setValues++
}
if (this.preset.gcode.length) setValues++
// stop here, when no values are set
if (setValues === 0) {
this.boolInvalidMin = true
return
}
// create new preset, if id === null
if (this.preset.id === null) {
this.$store.dispatch('gui/presets/store', { values: this.preset })
this.closeForm()
return
}
// update existing preset
this.$store.dispatch('gui/presets/update', { id: this.preset.id, values: this.preset })
this.closeForm()
}
}
</script>
@@ -0,0 +1,52 @@
<template>
<v-card flat>
<v-form @submit.prevent="saveCooldown">
<v-card-title>{{ $t('Settings.PresetsTab.EditCooldown') }}</v-card-title>
<v-card-text>
<settings-row :title="$t('Settings.PresetsTab.CustomGCode')">
<v-textarea v-model="gcode" outlined hide-details />
</settings-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="closeForm">
{{ $t('Settings.Cancel') }}
</v-btn>
<v-btn color="primary" text type="submit">
{{ $t('Settings.PresetsTab.UpdateCooldown') }}
</v-btn>
</v-card-actions>
</v-form>
</v-card>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { mdiDelete, mdiPencil } from '@mdi/js'
@Component({
components: { SettingsRow },
})
export default class PresetsFormCooldown extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
@Prop({ required: true }) readonly inputGcode!: string
gcode = ''
mounted() {
this.gcode = this.inputGcode
}
closeForm() {
this.$emit('close')
}
saveCooldown() {
this.$store.dispatch('gui/presets/saveSetting', { name: 'cooldownGcode', value: this.gcode })
this.closeForm()
}
}
</script>
@@ -35,6 +35,12 @@
</settings-row>
<v-divider class="my-2"></v-divider>
</template>
<settings-row
:title="$t('Settings.ControlTab.HideDuringPrint').toString()"
:dynamic-slot-width="true">
<v-switch v-model="hideDuringPrint" hide-details class="mt-0"></v-switch>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row
:title="$t('Settings.ControlTab.EnableXYHoming').toString()"
:dynamic-slot-width="true">
@@ -336,6 +342,14 @@ export default class SettingsControlTab extends Mixins(BaseMixin, ControlMixin)
this.$store.dispatch('gui/saveSetting', { name: 'control.style', value: newVal })
}
get hideDuringPrint(): Boolean {
return this.$store.state.gui.control.hideDuringPrint ?? false
}
set hideDuringPrint(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'control.hideDuringPrint', value: newVal })
}
get actionOptions() {
let actions = [
{
+7 -38
View File
@@ -6,25 +6,23 @@
:title="$t('Settings.EditorTab.UseEscToClose')"
:sub-title="$t('Settings.EditorTab.UseEscToCloseDescription')"
:dynamic-slot-width="true">
<v-switch v-model="escToClose" hide-details class="mt-0"></v-switch>
<v-switch v-model="escToClose" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.EditorTab.ConfirmUnsavedChanges')"
:sub-title="$t('Settings.EditorTab.ConfirmUnsavedChangesDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmUnsavedChanges" hide-details class="mt-0"></v-switch>
<v-switch v-model="confirmUnsavedChanges" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.EditorTab.TabSize')"
:sub-title="$t('Settings.EditorTab.TabSizeDescription')"
:dynamic-slot-width="true">
<v-select v-model="tabSize" :items="tabSizes" hide-details outlined dense attached></v-select>
<v-select v-model="tabSize" :items="tabSizes" hide-details outlined dense attached />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.EditorTab.KlipperRestartMethod')"
:sub-title="$t('Settings.EditorTab.KlipperRestartMethodDescription')">
@@ -34,23 +32,8 @@
hide-details
outlined
dense
attached></v-select>
attached />
</settings-row>
<v-divider class="my-2"></v-divider>
<template v-if="availableMoonrakerInstances.length > 1">
<settings-row
:title="$t('Settings.EditorTab.MoonrakerRestartInstance')"
:sub-title="$t('Settings.EditorTab.MoonrakerRestartInstanceDescription')">
<v-select
v-model="moonrakerRestartInstance"
:items="availableMoonrakerInstances"
hide-details
outlined
dense
attached></v-select>
</settings-row>
<v-divider class="my-2"></v-divider>
</template>
</v-card-text>
</v-card>
</div>
@@ -115,19 +98,5 @@ export default class SettingsEditorTab extends Mixins(BaseMixin) {
set klipperRestartMethod(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'editor.klipperRestartMethod', value: newVal })
}
get moonrakerRestartInstance() {
return this.$store.state.gui.editor.moonrakerRestartInstance
}
set moonrakerRestartInstance(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'editor.moonrakerRestartInstance', value: newVal })
}
get availableMoonrakerInstances() {
const available_instances = this.$store.state.server.system_info?.available_services ?? []
return available_instances.filter((name: string) => name.startsWith('moonraker')).sort()
}
}
</script>
+45 -464
View File
@@ -2,256 +2,56 @@
<div>
<v-card flat>
<v-card-text>
<settings-row :title="$t('Settings.GeneralTab.PrinterName').toString()">
<settings-row :title="$t('Settings.GeneralTab.PrinterName')">
<v-text-field v-model="printerName" hide-details outlined dense></v-text-field>
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.Language').toString()">
<v-select
v-model="currentLanguage"
:items="availableLanguages"
hide-details
outlined
dense
attach></v-select>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.Language')">
<v-select v-model="currentLanguage" :items="availableLanguages" hide-details outlined dense />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.DateFormat').toString()">
<v-select
v-model="dateFormat"
:items="dateFormatItems"
hide-details
outlined
dense
attach></v-select>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.DateFormat')">
<v-select v-model="dateFormat" :items="dateFormatItems" hide-details outlined dense />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.TimeFormat').toString()">
<v-select
v-model="timeFormat"
:items="timeFormatItems"
hide-details
outlined
dense
attach></v-select>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.TimeFormat')">
<v-select v-model="timeFormat" :items="timeFormatItems" hide-details outlined dense />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcPrintProgress').toString()"
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription').toString()">
<v-select
v-model="calcPrintProgress"
:items="calcPrintProgressItems"
hide-details
dense
outlined
attach></v-select>
:title="$t('Settings.GeneralTab.CalcPrintProgress')"
:sub-title="$t('Settings.GeneralTab.CalcPrintProgressDescription')">
<v-select v-model="calcPrintProgress" :items="calcPrintProgressItems" hide-details dense outlined />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcEstimateTime').toString()"
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription').toString()">
:title="$t('Settings.GeneralTab.CalcEstimateTime')"
:sub-title="$t('Settings.GeneralTab.CalcEstimateTimeDescription')">
<v-select
v-model="calcEstimateTime"
:items="calcEstimateItems"
multiple
hide-details
dense
outlined
attach></v-select>
outlined />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.GeneralTab.CalcEtaTime').toString()"
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription').toString()">
<v-select
v-model="calcEtaTime"
:items="calcEtaTimeItems"
multiple
hide-details
dense
outlined
attach></v-select>
:title="$t('Settings.GeneralTab.CalcEtaTime')"
:sub-title="$t('Settings.GeneralTab.CalcEtaTimeDescription')">
<v-select v-model="calcEtaTime" :items="calcEtaTimeItems" multiple hide-details dense outlined />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.MoonrakerDb').toString()" :dynamic-slot-width="true">
<input
ref="uploadBackupFile"
type="file"
:accept="['.json']"
class="d-none"
@change="uploadRestore" />
<v-btn :loading="loadings.includes('backupDbButton')" small @click="backupDb">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
<v-btn small :loading="loadings.includes('restoreUploadButton')" class="ml-3" @click="restoreDb">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.MainsailSettingsMoonrakerDb')" :dynamic-slot-width="true">
<settings-general-tab-backup-database />
<settings-general-tab-restore-database />
</settings-row>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.GeneralTab.FactoryReset').toString()" :dynamic-slot-width="true">
<v-btn color="error" small @click="resetMainsail">
{{ $t('Settings.GeneralTab.FactoryReset') }}
</v-btn>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.GeneralTab.FactoryReset')" :dynamic-slot-width="true">
<settings-general-tab-reset-database />
</settings-row>
</v-card-text>
</v-card>
<v-dialog v-model="dialogBackupMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Backup').toString()"
card-class="mainsail-backup-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogBackupMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.BackupDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in mainsailKeys">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"></v-checkbox>
<v-checkbox
v-if="availableNamespaces.includes('webcams')"
:label="$t('Settings.GeneralTab.DbWebcams')"
hide-details
class="mt-0"
@change="changeNamespace('webcams')"></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('backupMainsail')" @click="backupMainsail">
{{ $t('Settings.GeneralTab.Backup') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
<v-dialog v-model="dialogResetMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.FactoryReset').toString()"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogResetMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.FactoryDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in mainsailKeys">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
</template>
<v-checkbox
v-if="availableNamespaces.includes('timelapse')"
:label="$t('Settings.GeneralTab.DbTimelapseSettings')"
hide-details
class="mt-0"
@change="changeNamespace('timelapse')"></v-checkbox>
<v-checkbox
v-if="availableNamespaces.includes('webcams')"
:label="$t('Settings.GeneralTab.DbWebcams')"
hide-details
class="mt-0"
@change="changeNamespace('webcams')"></v-checkbox>
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryJobs')"
hide-details
class="mt-0"
@change="changeNamespace('history_jobs')"></v-checkbox>
<v-checkbox
v-if="moonrakerComponents.includes('history')"
:label="$t('Settings.GeneralTab.DbHistoryTotals')"
hide-details
class="mt-0"
@change="changeNamespace('history_totals')"></v-checkbox>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn
color="red"
:loading="loadings.includes('resetMainsail')"
@click="resetMainsailAction">
{{ $t('Settings.GeneralTab.Reset') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
<v-dialog v-model="dialogRestoreMainsail" persistent :width="360">
<panel
:title="$t('Settings.GeneralTab.Restore').toString()"
card-class="factory-reset-dialog"
:margin-bottom="false"
:icon="mdiHelpCircle">
<template #buttons>
<v-btn icon tile @click="dialogRestoreMainsail = false">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<v-row>
<v-col>
<p class="mb-0">{{ $t('Settings.GeneralTab.RestoreDialog') }}</p>
</v-col>
</v-row>
<v-row>
<v-col class="pl-6">
<template v-for="db in restoreableNamespaces">
<v-checkbox
:key="db.name"
:label="db.label"
hide-details
class="mt-0"
@change="changeNamespace(db.name)"></v-checkbox>
</template>
</v-col>
</v-row>
<v-row>
<v-col class="text-center">
<v-btn color="red" :loading="loadings.includes('restoreMainsail')" @click="restoreDbAction">
{{ $t('Settings.GeneralTab.Restore') }}
</v-btn>
</v-col>
</v-row>
</v-card-text>
</panel>
</v-dialog>
</div>
</template>
@@ -261,97 +61,27 @@ import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import Vue from 'vue'
import { mdiCloseThick, mdiHelpCircle } from '@mdi/js'
import CheckboxList from '@/components/inputs/CheckboxList.vue'
import SettingsGeneralTabBackupDatabase from '@/components/settings/General/GeneralBackup.vue'
import SettingsGeneralTabRestoreDatabase from '@/components/settings/General/GeneralRestore.vue'
import SettingsGeneralTabResetDatabase from '@/components/settings/General/GeneralReset.vue'
import SettingsGeneralDatabase from '@/components/mixins/settingsGeneralDatabase'
@Component({
components: { Panel, SettingsRow },
components: {
Panel,
SettingsRow,
CheckboxList,
SettingsGeneralTabBackupDatabase,
SettingsGeneralTabRestoreDatabase,
SettingsGeneralTabResetDatabase,
},
})
export default class SettingsGeneralTab extends Mixins(BaseMixin) {
export default class SettingsGeneralTab extends Mixins(BaseMixin, SettingsGeneralDatabase) {
mdiHelpCircle = mdiHelpCircle
mdiCloseThick = mdiCloseThick
private dialogBackupMainsail = false
private dialogResetMainsail = false
private dialogRestoreMainsail = false
private dbCheckboxes: string[] = []
private restoreableNamespaces: { name: string; label: string }[] = []
private restoreObjects: any = {}
private mainsailKeys: { name: string; label: string }[] = []
private availableNamespaces: string[] = []
declare $refs: {
uploadBackupFile: HTMLInputElement
}
get availableKeys() {
return [
{
name: 'general',
label: this.$t('Settings.GeneralTab.General').toString(),
},
{
name: 'console',
label: this.$t('Settings.ConsoleTab.Console').toString(),
},
{
name: 'control',
label: this.$t('Settings.ControlTab.Control').toString(),
},
{
name: 'dashboard',
label: this.$t('Settings.DashboardTab.Dashboard').toString(),
},
{
name: 'editor',
label: this.$t('Settings.EditorTab.Editor').toString(),
},
{
name: 'gcodeViewer',
label: this.$t('Settings.GCodeViewerTab.GCodeViewer').toString(),
},
{
name: 'gcodehistory',
label: this.$t('Settings.GeneralTab.DbConsoleHistory').toString(),
},
{
name: 'macros',
label: this.$t('Settings.MacrosTab.Macros').toString(),
},
{
name: 'notifications',
label: this.$t('App.Notifications.Notifications').toString(),
},
{
name: 'presets',
label: this.$t('Settings.PresetsTab.PreheatPresets').toString(),
},
{
name: 'remoteprinters',
label: this.$t('Settings.RemotePrintersTab.RemotePrinters').toString(),
},
{
name: 'timelapse',
label: this.$t('Settings.TimelapseTab.Timelapse').toString(),
},
{
name: 'uiSettings',
label: this.$t('Settings.UiSettingsTab.UiSettings').toString(),
},
{
name: 'view',
label: this.$t('Settings.GeneralTab.DbView').toString(),
},
{
name: 'webcams',
label: this.$t('Settings.WebcamsTab.Webcams').toString(),
},
]
}
get printerName() {
return this.$store.state.gui.general.printername
}
@@ -429,13 +159,13 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
value: '24hours',
text: this.$t('Settings.GeneralTab.24hours', {
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }),
}).toString(),
}),
},
{
value: '12hours',
text: this.$t('Settings.GeneralTab.12hours', {
time: date.toLocaleTimeString(userLocale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h12' }),
}).toString(),
}),
},
]
}
@@ -487,154 +217,5 @@ export default class SettingsGeneralTab extends Mixins(BaseMixin) {
set calcEtaTime(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'general.calcEtaTime', value: newVal })
}
get moonrakerDbNamespaces() {
return this.$store.state.server.dbNamespaces ?? []
}
get moonrakerComponents() {
return this.$store.state.server.components ?? []
}
async refreshNamespaces() {
this.availableNamespaces = []
const url = this.$store.getters['socket/getUrl'] + '/server/database/list'
const response = await fetch(url)
if (response) {
const objects = await response.json()
this.availableNamespaces = [...(objects.result?.namespaces || {})] ?? []
}
}
async refreshMainsailKeys() {
this.mainsailKeys = []
const url = this.$store.getters['socket/getUrl'] + '/server/database/item?namespace=mainsail'
const response = await fetch(url)
if (response) {
const objects = await response.json()
if (objects?.result?.value) {
Object.keys(objects?.result?.value).forEach((tmp: string) => {
if (tmp !== 'initVersion') {
const namespace = this.availableKeys.find((namespace) => namespace.name === tmp)
const tmpNamespace = namespace ? namespace : { name: tmp, label: tmp }
this.mainsailKeys.push(tmpNamespace)
}
})
this.mainsailKeys = this.mainsailKeys.sort((a, b) => {
if (a.name === 'general') return -1
if (b.name === '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
})
}
}
}
changeNamespace(name: string) {
if (this.dbCheckboxes.includes(name)) {
const index = this.dbCheckboxes.indexOf(name)
if (index >= 0) this.dbCheckboxes.splice(index, 1)
} else this.dbCheckboxes.push(name)
}
async resetMainsail() {
await this.refreshNamespaces()
if (this.availableNamespaces.includes('mainsail')) await this.refreshMainsailKeys()
else this.mainsailKeys = []
this.dbCheckboxes = []
this.dialogResetMainsail = true
}
async resetMainsailAction() {
await this.$store.dispatch('socket/addLoading', 'resetMainsail')
await this.$store.dispatch('gui/resetMoonrakerDB', this.dbCheckboxes)
}
async backupDb() {
await this.$store.dispatch('socket/addLoading', 'backupDbButton')
await this.refreshNamespaces()
if (this.availableNamespaces.includes('mainsail')) await this.refreshMainsailKeys()
else this.mainsailKeys = []
this.dbCheckboxes = []
this.dialogBackupMainsail = true
}
async backupMainsail() {
await this.$store.dispatch('socket/addLoading', 'backupMainsail')
await this.$store.dispatch('gui/backupMoonrakerDB', this.dbCheckboxes)
await this.$store.dispatch('socket/removeLoading', 'backupMainsail')
this.dialogBackupMainsail = false
}
async restoreDb() {
await this.$store.dispatch('socket/addLoading', 'restoreUploadButton')
this.$refs?.uploadBackupFile?.click()
}
uploadRestore() {
if (this.$refs.uploadBackupFile.files?.length) {
const backup = this.$refs.uploadBackupFile.files[0]
if (backup) {
const reader = new FileReader()
reader.readAsText(backup, 'UTF-8')
reader.onload = (evt) => {
this.restoreableNamespaces = []
try {
this.restoreObjects = JSON.parse(evt?.target?.result + '')
Object.keys(this.restoreObjects).forEach((tmp: string) => {
const namespace = this.availableKeys.find((namespace) => namespace.name === tmp)
const tmpNamespace = namespace ? namespace : { name: tmp, label: tmp }
this.restoreableNamespaces.push(tmpNamespace)
})
this.restoreableNamespaces = this.restoreableNamespaces.sort((a, b) => {
if (a.name === 'general') return -1
if (b.name === '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
})
this.dbCheckboxes = []
this.dialogRestoreMainsail = true
} catch (e) {
Vue.$toast.error(this.$t('Settings.GeneralTab.CannotReadJson') + '')
}
}
reader.onerror = (evt) => {
window.console.error(evt)
}
}
this.$refs.uploadBackupFile.value = ''
}
}
async restoreDbAction() {
this.$store.dispatch('socket/addLoading', 'restoreDbAction')
this.$store.dispatch('gui/restoreMoonrakerDB', {
dbCheckboxes: this.dbCheckboxes,
restoreObjects: this.restoreObjects,
})
}
}
</script>
+27 -294
View File
@@ -1,336 +1,69 @@
<template>
<div>
<v-card v-if="!form.bool && !cooldownForm.bool" flat>
<presets-form v-if="boolForm" :preset="formPreset" @close="boolForm = false" />
<presets-form-cooldown
v-else-if="boolFormCooldown"
:input-gcode="cooldownGcode"
@close="boolFormCooldown = false" />
<v-card v-else flat>
<v-card-text>
<h3 class="text-h5 mb-3">{{ $t('Settings.PresetsTab.PreheatPresets') }}</h3>
<div v-for="(preset, key) in presets" :key="preset.index">
<v-divider v-if="key" class="my-2"></v-divider>
<settings-row :title="preset.name" :sub-title="getSubTitle(preset)">
<v-btn small outlined class="ml-3" @click="editPreset(preset)">
<v-icon left small>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
<v-btn
small
outlined
class="ml-3 minwidth-0 px-2"
color="error"
@click="deletePreset(preset.id)">
<v-icon small>{{ mdiDelete }}</v-icon>
</v-btn>
</settings-row>
<v-divider v-if="key" class="my-2" />
<presets-entry :preset="preset" @edit="edit" />
</div>
<v-divider v-if="presets.length" class="my-2"></v-divider>
<settings-row :title="$t('Settings.PresetsTab.Cooldown').toString()">
<v-btn small outlined class="ml-3" @click="editCooldown">
<v-icon left small>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
</settings-row>
<v-divider v-if="presets.length" class="my-2" />
<presets-entry-cooldown @edit="boolFormCooldown = true" />
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text color="primary" @click="createPreset">{{ $t('Settings.PresetsTab.AddPreset') }}</v-btn>
</v-card-actions>
</v-card>
<v-card v-else-if="form.bool" flat>
<v-form v-model="form.valid" @submit.prevent="savePreset">
<v-card-title>
{{
form.id === null
? $t('Settings.PresetsTab.CreateHeadline')
: $t('Settings.PresetsTab.EditHeadline')
}}
</v-card-title>
<v-card-text>
<v-row v-if="form.boolInvalidMin" class="mt-3">
<v-col class="py-0">
<v-alert dense text type="error">{{ $t('Settings.PresetsTab.PresetInfo') }}</v-alert>
</v-col>
</v-row>
<settings-row :title="$t('Settings.PresetsTab.Name').toString()">
<v-text-field
v-model="form.name"
:placeholder="$t('Settings.PresetsTab.PresetNamePlaceholder')"
hide-details="auto"
:rules="[rules.required, rules.unique]"
:append-icon="form.name !== '' ? mdiCloseCircle : {}"
dense
outlined
@click:append="form.name !== '' ? (form.name = '') : {}"></v-text-field>
</settings-row>
<div v-for="heater of heaters" :key="heater.name">
<v-divider class="my-2"></v-divider>
<settings-row :title="convertName(heater.name)">
<v-checkbox
v-model="form.values[heater.name].bool"
hide-details
class="shrink mt-0"></v-checkbox>
<v-text-field
v-model="form.values[heater.name].value"
hide-details="auto"
:rules="[rules.invalid]"
type="number"
suffix="°C"
dense
outlined
hide-spin-buttons
@focus="$event.target.select()"></v-text-field>
</settings-row>
</div>
<div v-for="fan of temperatureFans" :key="'temperature_fan ' + fan.name">
<v-divider class="my-2"></v-divider>
<settings-row :title="convertName(fan.name)">
<v-checkbox
v-model="form.values['temperature_fan ' + fan.name].bool"
hide-details
class="shrink mt-0"></v-checkbox>
<v-text-field
v-model="form.values['temperature_fan ' + fan.name].value"
hide-details="auto"
:rules="[rules.invalid]"
type="number"
suffix="°C"
dense
outlined
hide-spin-buttons
@focus="$event.target.select()"></v-text-field>
</settings-row>
</div>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.PresetsTab.CustomGCode').toString()">
<v-textarea v-model="form.gcode" outlined hide-details></v-textarea>
</settings-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="form.bool = false">
{{ $t('Settings.Cancel') }}
</v-btn>
<v-btn color="primary" text type="submit" :disabled="!form.valid">
{{
form.id === null
? $t('Settings.PresetsTab.StoreButton')
: $t('Settings.PresetsTab.UpdateButton')
}}
</v-btn>
</v-card-actions>
</v-form>
</v-card>
<v-card v-else-if="cooldownForm.bool" flat>
<v-form v-model="cooldownForm.valid" @submit.prevent="saveCooldown">
<v-card-title>{{ $t('Settings.PresetsTab.EditCooldown') }}</v-card-title>
<v-card-text>
<settings-row :title="$t('Settings.PresetsTab.CustomGCode').toString()">
<v-textarea v-model="cooldownForm.gcode" outlined hide-details></v-textarea>
</settings-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="cooldownForm.bool = false">
{{ $t('Settings.Cancel') }}
</v-btn>
<v-btn color="primary" text type="submit">
{{ $t('Settings.PresetsTab.UpdateCooldown') }}
</v-btn>
</v-card-actions>
</v-form>
</v-card>
</div>
</template>
<script lang="ts">
import { convertName } from '@/plugins/helpers'
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { GuiPresetsStatePreset } from '@/store/gui/presets/types'
import { mdiDelete, mdiPencil, mdiCloseCircle } from '@mdi/js'
interface presetForm {
bool: boolean
valid: boolean
name: string
gcode: string
id: string | null
boolInvalidMin: boolean
values: {
[key: string]: {
bool: boolean
value: number
type: 'heater' | 'temperature_fan'
}
}
}
import { mdiDelete, mdiPencil } from '@mdi/js'
import PresetsEntry from '@/components/settings/Presets/PresetsEntry.vue'
import PresetsEntryCooldown from '@/components/settings/Presets/PresetsEntryCooldown.vue'
import PresetsForm from '@/components/settings/Presets/PresetsForm.vue'
@Component({
components: { SettingsRow },
components: { PresetsForm, PresetsEntryCooldown, PresetsEntry, SettingsRow },
})
export default class SettingsPresetsTab extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
mdiCloseCircle = mdiCloseCircle
convertName = convertName
boolForm = false
boolFormCooldown = false
private form: presetForm = {
bool: false,
valid: false,
name: '',
gcode: '',
id: null,
boolInvalidMin: false,
values: {},
}
private cooldownForm = {
bool: false,
valid: false,
gcode: '',
}
private rules = {
required: (value: string) => value !== '' || this.$t('Settings.PresetsTab.ErrorNameRequired'),
unique: (value: string) => !this.existsPresetName(value) || this.$t('Settings.PresetsTab.ErrorNameNotUnique'),
invalid: (value: string) => parseFloat(value) >= 0 || this.$t('Settings.PresetsTab.ErrorInvalidValue'),
}
formPreset: GuiPresetsStatePreset = {} as GuiPresetsStatePreset
get presets() {
return this.$store.getters['gui/presets/getPresets'] ?? []
}
get heaters() {
return this.$store.getters['printer/getHeaters'] ?? []
}
get temperatureFans() {
return this.$store.getters['printer/getTemperatureFans'] ?? []
}
get cooldownGcode() {
return this.$store.getters['gui/presets/getCooldownGcode']
}
existsPresetName(name: string) {
return (
this.presets.findIndex(
(preset: GuiPresetsStatePreset) => preset.name === name && preset.id !== this.form.id
) !== -1
)
}
getSubTitle(preset: GuiPresetsStatePreset) {
let output: string[] = []
Object.keys(preset.values).forEach((key: string) => {
const values = preset.values[key]
if (values.bool) {
const name = key.indexOf(' ') ? key.slice(key.indexOf(' ') + 1) : key
output.push(this.convertName(name) + ': ' + values.value + '°C')
}
})
if (preset.gcode) output.push(this.$t('Settings.PresetsTab.CustomGCode').toString())
return output.join(', ')
}
createPreset() {
this.clearForm()
this.form.bool = true
this.formPreset.id = null
this.formPreset.name = ''
this.formPreset.values = {}
this.formPreset.gcode = ''
this.boolForm = true
}
clearForm() {
this.form.bool = false
this.form.id = null
this.form.name = ''
this.form.gcode = ''
this.form.boolInvalidMin = false
this.form.values = {}
for (const heater of this.heaters) {
this.form.values[heater.name] = {
bool: true,
value: 0,
type: 'heater',
}
}
for (const fan of this.temperatureFans) {
this.form.values['temperature_fan ' + fan.name] = {
bool: true,
value: 0,
type: 'temperature_fan',
}
}
}
editPreset(preset: GuiPresetsStatePreset) {
this.form.name = preset.name
this.form.id = preset.id ?? null
this.form.gcode = preset.gcode
this.form.values = {}
for (const heater of this.heaters) {
if (heater.name in preset.values) this.form.values[heater.name] = { ...preset.values[heater.name] }
else
this.form.values[heater.name] = {
bool: false,
value: 0,
type: 'heater',
}
}
for (const fan of this.temperatureFans) {
if ('temperature_fan ' + fan.name in preset.values)
this.form.values['temperature_fan ' + fan.name] = { ...preset.values['temperature_fan ' + fan.name] }
else
this.form.values['temperature_fan ' + fan.name] = {
bool: false,
value: 0,
type: 'temperature_fan',
}
}
this.form.bool = true
}
savePreset() {
let setValues = 0
for (const key of Object.keys(this.form.values)) {
if (this.form.values[key].bool) setValues++
}
if (this.form.gcode.length) setValues++
if (setValues === 0) this.form.boolInvalidMin = true
else if (this.form.valid) {
const preset: GuiPresetsStatePreset = {
name: this.form.name,
gcode: this.form.gcode,
values: this.form.values,
}
if (this.form.id !== null) {
this.$store.dispatch('gui/presets/update', { id: this.form.id, values: preset })
} else this.$store.dispatch('gui/presets/store', { values: preset })
this.clearForm()
}
}
editCooldown() {
this.cooldownForm.gcode = this.cooldownGcode
this.cooldownForm.bool = true
}
saveCooldown() {
if (this.cooldownForm.valid) {
this.$store.dispatch('gui/presets/saveSetting', { name: 'cooldownGcode', value: this.cooldownForm.gcode })
this.cooldownForm.bool = false
}
}
deletePreset(id: string) {
this.$store.dispatch('gui/presets/delete', id)
edit(preset: GuiPresetsStatePreset) {
this.formPreset = { ...preset }
this.boolForm = true
}
}
</script>
+5 -4
View File
@@ -3,7 +3,7 @@
<v-col :class="firstColClasses">
<v-row class="d-flex flex-row">
<v-col v-if="loading" class="col-auto d-flex justify-center align-center pr-0">
<v-progress-circular indeterminate color="primary" :size="24"></v-progress-circular>
<v-progress-circular indeterminate color="primary" :size="24" />
</v-col>
<v-col v-else-if="icon" class="col-auto d-flex justify-center align-center pr-0">
<v-icon>{{ icon }}</v-icon>
@@ -15,7 +15,7 @@
</v-row>
</v-col>
<v-col :class="secondColClasses">
<slot></slot>
<slot />
</v-col>
</v-row>
</template>
@@ -23,6 +23,7 @@
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import { TranslateResult } from 'vue-i18n'
@Component
export default class SettingsRow extends Mixins(BaseMixin) {
@@ -33,10 +34,10 @@ export default class SettingsRow extends Mixins(BaseMixin) {
declare readonly icon: string
@Prop({ required: true })
declare readonly title: string
declare readonly title: string | TranslateResult
@Prop({ required: false })
declare readonly subTitle: string
declare readonly subTitle: string | TranslateResult
@Prop({ required: false, default: false })
declare readonly dynamicSlotWidth: boolean
@@ -4,8 +4,8 @@
<v-card-text>
<h3 class="text-h5 mb-3">{{ $t('Settings.TimelapseTab.General') }}</h3>
<settings-row
:title="$t('Settings.TimelapseTab.Enabled').toString()"
:sub-title="$t('Settings.TimelapseTab.EnabledDescription').toString()"
:title="$t('Settings.TimelapseTab.Enabled')"
:sub-title="$t('Settings.TimelapseTab.EnabledDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="enabled"
@@ -15,8 +15,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Autorender').toString()"
:sub-title="$t('Settings.TimelapseTab.AutorenderDescription').toString()"
:title="$t('Settings.TimelapseTab.Autorender')"
:sub-title="$t('Settings.TimelapseTab.AutorenderDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="autorender"
@@ -26,8 +26,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Camera').toString()"
:sub-title="$t('Settings.TimelapseTab.CameraDescription').toString()">
:title="$t('Settings.TimelapseTab.Camera')"
:sub-title="$t('Settings.TimelapseTab.CameraDescription')">
<v-select
v-model="camera"
:items="cameraOptions"
@@ -38,8 +38,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Mode').toString()"
:sub-title="$t('Settings.TimelapseTab.ModeDescription').toString()">
:title="$t('Settings.TimelapseTab.Mode')"
:sub-title="$t('Settings.TimelapseTab.ModeDescription')">
<v-select
v-model="mode"
:items="modeOptions"
@@ -51,8 +51,8 @@
<template v-if="mode === 'hyperlapse'">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.HyperlapseCycle').toString()"
:sub-title="$t('Settings.TimelapseTab.HyperlapseCycleDescription').toString()">
:title="$t('Settings.TimelapseTab.HyperlapseCycle')"
:sub-title="$t('Settings.TimelapseTab.HyperlapseCycleDescription')">
<v-text-field
v-model="hyperlapseCycle"
type="number"
@@ -66,8 +66,8 @@
</template>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.PreviewImage').toString()"
:sub-title="$t('Settings.TimelapseTab.PreviewImageDescription').toString()"
:title="$t('Settings.TimelapseTab.PreviewImage')"
:sub-title="$t('Settings.TimelapseTab.PreviewImageDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="previewimage"
@@ -77,8 +77,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.SaveFrames').toString()"
:sub-title="$t('Settings.TimelapseTab.SaveFramesDescription').toString()"
:title="$t('Settings.TimelapseTab.SaveFrames')"
:sub-title="$t('Settings.TimelapseTab.SaveFramesDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="saveframes"
@@ -88,8 +88,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.StreamDelayCompensation').toString()"
:sub-title="$t('Settings.TimelapseTab.StreamDelayCompensationDescription').toString()">
:title="$t('Settings.TimelapseTab.StreamDelayCompensation')"
:sub-title="$t('Settings.TimelapseTab.StreamDelayCompensationDescription')">
<v-text-field
v-model="stream_delay_compensation"
type="number"
@@ -102,8 +102,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.GcodeVerbose').toString()"
:sub-title="$t('Settings.TimelapseTab.GcodeVerboseDescription').toString()"
:title="$t('Settings.TimelapseTab.GcodeVerbose')"
:sub-title="$t('Settings.TimelapseTab.GcodeVerboseDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="gcode_verbose"
@@ -114,8 +114,8 @@
<v-divider class="my-2" />
<h3 class="text-h5 mt-6 mb-3">{{ $t('Settings.TimelapseTab.Parkhead') }}</h3>
<settings-row
:title="$t('Settings.TimelapseTab.Parkhead').toString()"
:sub-title="$t('Settings.TimelapseTab.ParkheadDescription').toString()"
:title="$t('Settings.TimelapseTab.Parkhead')"
:sub-title="$t('Settings.TimelapseTab.ParkheadDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="parkhead"
@@ -126,8 +126,8 @@
<template v-if="parkhead">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Parkpos').toString()"
:sub-title="$t('Settings.TimelapseTab.ParkposDescription').toString()">
:title="$t('Settings.TimelapseTab.Parkpos')"
:sub-title="$t('Settings.TimelapseTab.ParkposDescription')">
<v-select
v-model="parkpos"
:items="parkposOptions"
@@ -139,8 +139,8 @@
<template v-if="['x_only', 'custom'].includes(parkpos)">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.PosX').toString()"
:sub-title="$t('Settings.TimelapseTab.PosXDescription').toString()">
:title="$t('Settings.TimelapseTab.PosX')"
:sub-title="$t('Settings.TimelapseTab.PosXDescription')">
<v-text-field
v-model="park_custom_pos_x"
type="number"
@@ -155,8 +155,8 @@
<template v-if="['y_only', 'custom'].includes(parkpos)">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.PosY').toString()"
:sub-title="$t('Settings.TimelapseTab.PosYDescription').toString()">
:title="$t('Settings.TimelapseTab.PosY')"
:sub-title="$t('Settings.TimelapseTab.PosYDescription')">
<v-text-field
v-model="park_custom_pos_y"
type="number"
@@ -171,8 +171,8 @@
<template v-if="['x_only', 'y_only', 'custom'].includes(parkpos)">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.PosDZ').toString()"
:sub-title="$t('Settings.TimelapseTab.PosDZDescription').toString()">
:title="$t('Settings.TimelapseTab.PosDZ')"
:sub-title="$t('Settings.TimelapseTab.PosDZDescription')">
<v-text-field
v-model="park_custom_pos_dz"
type="number"
@@ -186,8 +186,8 @@
</template>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.TravelSpeed').toString()"
:sub-title="$t('Settings.TimelapseTab.TravelSpeedDescription').toString()">
:title="$t('Settings.TimelapseTab.TravelSpeed')"
:sub-title="$t('Settings.TimelapseTab.TravelSpeedDescription')">
<v-text-field
v-model="park_travel_speed"
type="number"
@@ -200,8 +200,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.FwRetract').toString()"
:sub-title="$t('Settings.TimelapseTab.FwRetractDescription').toString()"
:title="$t('Settings.TimelapseTab.FwRetract')"
:sub-title="$t('Settings.TimelapseTab.FwRetractDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="fw_retract"
@@ -212,8 +212,8 @@
<template v-if="!fw_retract">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.RetractSpeed').toString()"
:sub-title="$t('Settings.TimelapseTab.RetractSpeedDescription').toString()">
:title="$t('Settings.TimelapseTab.RetractSpeed')"
:sub-title="$t('Settings.TimelapseTab.RetractSpeedDescription')">
<v-text-field
v-model="park_retract_speed"
type="number"
@@ -226,8 +226,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.RetractDistance').toString()"
:sub-title="$t('Settings.TimelapseTab.RetractDistanceDescription').toString()">
:title="$t('Settings.TimelapseTab.RetractDistance')"
:sub-title="$t('Settings.TimelapseTab.RetractDistanceDescription')">
<v-text-field
v-model="park_retract_distance"
type="number"
@@ -236,12 +236,12 @@
outlined
dense
:disabled="blockedsettings.includes('park_retract_distance')"
hide-spin-buttons></v-text-field>
hide-spin-buttons />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.UnretractSpeed').toString()"
:sub-title="$t('Settings.TimelapseTab.UnretractSpeedDescription').toString()">
:title="$t('Settings.TimelapseTab.UnretractSpeed')"
:sub-title="$t('Settings.TimelapseTab.UnretractSpeedDescription')">
<v-text-field
v-model="park_extrude_speed"
type="number"
@@ -254,8 +254,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.UnretractDistance').toString()"
:sub-title="$t('Settings.TimelapseTab.UnretractDistanceDescription').toString()">
:title="$t('Settings.TimelapseTab.UnretractDistance')"
:sub-title="$t('Settings.TimelapseTab.UnretractDistanceDescription')">
<v-text-field
v-model="park_extrude_distance"
type="number"
@@ -269,8 +269,8 @@
</template>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.ParkTime').toString()"
:sub-title="$t('Settings.TimelapseTab.ParkTimeDescription').toString()">
:title="$t('Settings.TimelapseTab.ParkTime')"
:sub-title="$t('Settings.TimelapseTab.ParkTimeDescription')">
<v-text-field
v-model="park_time"
type="number"
@@ -285,8 +285,8 @@
<v-divider class="my-2" />
<h3 class="text-h5 mt-6 mb-3">{{ $t('Settings.TimelapseTab.RenderingOptions') }}</h3>
<settings-row
:title="$t('Settings.TimelapseTab.VariableFps').toString()"
:sub-title="$t('Settings.TimelapseTab.VariableFpsDescription').toString()"
:title="$t('Settings.TimelapseTab.VariableFps')"
:sub-title="$t('Settings.TimelapseTab.VariableFpsDescription')"
:dynamic-slot-width="true">
<v-switch
v-model="variable_fps"
@@ -297,8 +297,8 @@
<template v-if="variable_fps">
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Targetlength').toString()"
:sub-title="$t('Settings.TimelapseTab.TargetlengthDescription').toString()">
:title="$t('Settings.TimelapseTab.Targetlength')"
:sub-title="$t('Settings.TimelapseTab.TargetlengthDescription')">
<v-text-field
v-model="targetlength"
type="number"
@@ -307,12 +307,12 @@
outlined
dense
:disabled="blockedsettings.includes('targetlength')"
hide-spin-buttons></v-text-field>
hide-spin-buttons />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.VariableFpsMin').toString()"
:sub-title="$t('Settings.TimelapseTab.VariableFpsMinDescription').toString()">
:title="$t('Settings.TimelapseTab.VariableFpsMin')"
:sub-title="$t('Settings.TimelapseTab.VariableFpsMinDescription')">
<v-text-field
v-model="variable_fps_min"
type="number"
@@ -325,8 +325,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.VariableFpsMax').toString()"
:sub-title="$t('Settings.TimelapseTab.VariableFpsMaxDescription').toString()">
:title="$t('Settings.TimelapseTab.VariableFpsMax')"
:sub-title="$t('Settings.TimelapseTab.VariableFpsMaxDescription')">
<v-text-field
v-model="variable_fps_max"
type="number"
@@ -341,8 +341,8 @@
<template v-else>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.OutputFramerate').toString()"
:sub-title="$t('Settings.TimelapseTab.OutputFramerateDescription').toString()">
:title="$t('Settings.TimelapseTab.OutputFramerate')"
:sub-title="$t('Settings.TimelapseTab.OutputFramerateDescription')">
<v-text-field
v-model="output_framerate"
type="number"
@@ -356,8 +356,8 @@
</template>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.duplicatelastframe').toString()"
:sub-title="$t('Settings.TimelapseTab.duplicatelastframeDescription').toString()">
:title="$t('Settings.TimelapseTab.duplicatelastframe')"
:sub-title="$t('Settings.TimelapseTab.duplicatelastframeDescription')">
<v-text-field
v-model="duplicatelastframe"
type="number"
@@ -369,8 +369,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.ConstantRateFactor').toString()"
:sub-title="$t('Settings.TimelapseTab.ConstantRateFactorDescription').toString()">
:title="$t('Settings.TimelapseTab.ConstantRateFactor')"
:sub-title="$t('Settings.TimelapseTab.ConstantRateFactorDescription')">
<v-text-field
v-model="constant_rate_factor"
type="number"
@@ -382,8 +382,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Pixelformat').toString()"
:sub-title="$t('Settings.TimelapseTab.PixelformatDescription').toString()">
:title="$t('Settings.TimelapseTab.Pixelformat')"
:sub-title="$t('Settings.TimelapseTab.PixelformatDescription')">
<v-text-field
v-model="pixelformat"
type="text"
@@ -394,8 +394,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.TimeFormatCode').toString()"
:sub-title="$t('Settings.TimelapseTab.TimeFormatCodeDescription').toString()">
:title="$t('Settings.TimelapseTab.TimeFormatCode')"
:sub-title="$t('Settings.TimelapseTab.TimeFormatCodeDescription')">
<v-text-field
v-model="time_format_code"
type="text"
@@ -406,8 +406,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.TimelapseTab.Extraoutputparams').toString()"
:sub-title="$t('Settings.TimelapseTab.ExtraoutputparamsDescription').toString()">
:title="$t('Settings.TimelapseTab.Extraoutputparams')"
:sub-title="$t('Settings.TimelapseTab.ExtraoutputparamsDescription')">
<v-text-field
v-model="extraoutputparams"
type="text"
@@ -483,11 +483,11 @@ export default class SettingsTimelapseTab extends Mixins(BaseMixin) {
const output: any = []
webcams
.filter((webcam: GuiWebcamStateWebcam) => webcam.urlSnapshot !== '')
.filter((webcam: GuiWebcamStateWebcam) => webcam.snapshot_url !== '')
.forEach((webcam: GuiWebcamStateWebcam) => {
output.push({
text: webcam.name,
value: webcam.id,
value: webcam.name,
})
})
@@ -2,7 +2,7 @@
<div>
<v-card flat>
<v-card-text>
<settings-row :title="$t('Settings.UiSettingsTab.Logo').toString()">
<settings-row :title="$t('Settings.UiSettingsTab.Logo')">
<v-btn
v-if="logoColor.toLowerCase() !== defaultLogoColor.toLowerCase()"
small
@@ -19,11 +19,11 @@
:value="logoColor"
hide-mode-switch
mode="rgba"
@update:color="updateLogoColor"></v-color-picker>
@update:color="updateLogoColor" />
</v-menu>
</settings-row>
<v-divider class="my-2" />
<settings-row :title="$t('Settings.UiSettingsTab.Primary').toString()">
<settings-row :title="$t('Settings.UiSettingsTab.Primary')">
<v-btn
v-if="primaryColor.toLowerCase() !== defaultPrimaryColor.toLowerCase()"
small
@@ -45,8 +45,8 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.GcodeThumbnails').toString()"
:sub-title="$t('Settings.UiSettingsTab.GcodeThumbnailsDescription').toString()"
:title="$t('Settings.UiSettingsTab.GcodeThumbnails')"
:sub-title="$t('Settings.UiSettingsTab.GcodeThumbnailsDescription')"
:dynamic-slot-width="true">
<v-btn
outlined
@@ -54,27 +54,27 @@
color="primary"
href="https://docs.mainsail.xyz/overview/features/thumbnails"
target="_blank">
{{ $t('Settings.UiSettingsTab.Guide').toString() }}
{{ $t('Settings.UiSettingsTab.Guide') }}
</v-btn>
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolBigThumbnail').toString()"
:sub-title="$t('Settings.UiSettingsTab.BoolBigThumbnailDescription').toString()"
:title="$t('Settings.UiSettingsTab.BoolBigThumbnail')"
:sub-title="$t('Settings.UiSettingsTab.BoolBigThumbnailDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolBigThumbnail" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINT').toString()"
:sub-title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription').toString()"
:title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINT')"
:sub-title="$t('Settings.UiSettingsTab.DisplayCANCEL_PRINTDescription')"
:dynamic-slot-width="true">
<v-switch v-model="displayCancelPrint" hide-details class="mt-0"></v-switch>
<v-switch v-model="displayCancelPrint" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.LockSliders').toString()"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDescription').toString()"
:title="$t('Settings.UiSettingsTab.LockSliders')"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDescription')"
:dynamic-slot-width="true">
<v-switch v-model="lockSliders" hide-details class="mt-0" />
</settings-row>
@@ -82,8 +82,8 @@
<v-expand-transition>
<settings-row
v-show="lockSliders"
:title="$t('Settings.UiSettingsTab.LockSlidersDelay').toString()"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDelayDescription').toString()"
:title="$t('Settings.UiSettingsTab.LockSlidersDelay')"
:sub-title="$t('Settings.UiSettingsTab.LockSlidersDelayDescription')"
:dynamic-slot-width="true">
<v-text-field
v-model="lockSlidersDelay"
@@ -104,22 +104,22 @@
</v-expand-transition>
<v-divider v-show="lockSliders" class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStop').toString()"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription').toString()"
:title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStop')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnEmergencyStopDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmOnEmergencyStop" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChange').toString()"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription').toString()"
:title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChange')"
:sub-title="$t('Settings.UiSettingsTab.ConfirmOnPowerDeviceChangeDescription')"
:dynamic-slot-width="true">
<v-switch v-model="confirmOnPowerDeviceChange" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.NavigationStyle').toString()"
:sub-title="$t('Settings.UiSettingsTab.NavigationStyleDescription').toString()">
:title="$t('Settings.UiSettingsTab.NavigationStyle')"
:sub-title="$t('Settings.UiSettingsTab.NavigationStyleDescription')">
<v-select
v-model="navigationStyleSetting"
:items="navigationStyles"
@@ -130,15 +130,27 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButton').toString()"
:sub-title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription').toString()"
:title="$t('Settings.UiSettingsTab.DefaultNavigationState')"
:sub-title="$t('Settings.UiSettingsTab.DefaultNavigationStateDescription')">
<v-select
v-model="defaultNavigationStateSetting"
:items="defaultNavigationStateSettings"
class="mt-0"
hide-details
outlined
dense />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButton')"
:sub-title="$t('Settings.UiSettingsTab.BoolHideUploadAndPrintButtonDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolHideUploadAndPrintButton" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2"></v-divider>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.PowerDeviceName').toString()"
:sub-title="$t('Settings.UiSettingsTab.PowerDeviceNameDescription').toString()"
:title="$t('Settings.UiSettingsTab.PowerDeviceName')"
:sub-title="$t('Settings.UiSettingsTab.PowerDeviceNameDescription')"
:dynamic-slot-width="true">
<v-select
v-model="powerDeviceName"
@@ -150,43 +162,43 @@
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh').toString()"
:sub-title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription').toString()"
:title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMesh')"
:sub-title="$t('Settings.UiSettingsTab.HideSaveConfigButtonForBedMeshDescription')"
:dynamic-slot-width="true">
<v-switch v-model="hideSaveConfigForBedMash" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.DisableFanAnimation').toString()"
:sub-title="$t('Settings.UiSettingsTab.DisableFanAnimationDescription').toString()"
:title="$t('Settings.UiSettingsTab.DisableFanAnimation')"
:sub-title="$t('Settings.UiSettingsTab.DisableFanAnimationDescription')"
:dynamic-slot-width="true">
<v-switch v-model="disableFanAnimation" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ManualProbeDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.ManualProbeDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.ManualProbeDialog')"
:sub-title="$t('Settings.UiSettingsTab.ManualProbeDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolManualProbeDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.BedScrewsDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.BedScrewsDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.BedScrewsDialog')"
:sub-title="$t('Settings.UiSettingsTab.BedScrewsDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolBedScrewsDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialog').toString()"
:sub-title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription').toString()"
:title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialog')"
:sub-title="$t('Settings.UiSettingsTab.ScrewsTiltAdjustDialogDescription')"
:dynamic-slot-width="true">
<v-switch v-model="boolScrewsTiltAdjustDialog" hide-details class="mt-0" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.TempchartHeight').toString()"
:sub-title="$t('Settings.UiSettingsTab.TempchartHeightDescription').toString()">
:title="$t('Settings.UiSettingsTab.TempchartHeight')"
:sub-title="$t('Settings.UiSettingsTab.TempchartHeightDescription')">
<v-slider
v-model.lazy="tempchartHeight"
hide-details
@@ -195,6 +207,13 @@
:step="1"
:label="tempchartHeight + 'px'" />
</settings-row>
<v-divider class="my-2" />
<settings-row
:title="$t('Settings.UiSettingsTab.HideUpdateWarnings').toString()"
:sub-title="$t('Settings.UiSettingsTab.HideUpdateWarningsDescription').toString()"
:dynamic-slot-width="true">
<v-switch v-model="hideUpdateWarnings" hide-details class="mt-0" />
</settings-row>
</v-card-text>
</v-card>
</div>
@@ -217,8 +236,8 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
mdiRestart = mdiRestart
mdiTimerOutline = mdiTimerOutline
private defaultLogoColor = defaultLogoColor
private defaultPrimaryColor = defaultPrimaryColor
defaultLogoColor = defaultLogoColor
defaultPrimaryColor = defaultPrimaryColor
get logoColor() {
return this.$store.state.gui.uiSettings.logo
@@ -311,6 +330,31 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
]
}
get defaultNavigationStateSetting() {
return this.$store.state.gui.uiSettings.defaultNavigationStateSetting
}
set defaultNavigationStateSetting(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.defaultNavigationStateSetting', value: newVal })
}
get defaultNavigationStateSettings() {
return [
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateAlwaysOpen'),
value: 'alwaysOpen',
},
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateAlwaysClosed'),
value: 'alwaysClosed',
},
{
text: this.$t('Settings.UiSettingsTab.DefaultNavigationStateLastState'),
value: 'lastState',
},
]
}
get boolHideUploadAndPrintButton() {
return this.$store.state.gui.uiSettings.boolHideUploadAndPrintButton ?? false
}
@@ -401,6 +445,14 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.tempchartHeight', value: newVal })
}
get hideUpdateWarnings() {
return this.$store.state.gui.uiSettings.hideUpdateWarnings ?? false
}
set hideUpdateWarnings(newVal) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.hideUpdateWarnings', value: newVal })
}
clearColorObject(color: any): string {
if (typeof color === 'object' && 'hex' in color) color = color.hex
if (color.length > 7) color = color.substr(0, 7)
+48 -366
View File
@@ -1,28 +1,14 @@
<template>
<div>
<v-card v-if="!form.bool" flat>
<v-card v-if="!boolForm" flat>
<v-card-text>
<h3 class="text-h5 mb-3">{{ $t('Settings.WebcamsTab.Webcams') }}</h3>
<div v-for="webcam in webcams" :key="webcam.id">
<v-divider class="my-2" />
<settings-row
:title="webcam.name"
:icon="convertWebcamIcon(webcam.icon)"
:sub-title="getSubtitle(webcam)">
<v-btn small outlined @click="editWebcam(webcam)">
<v-icon small left>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
<v-btn
small
outlined
class="ml-3 minwidth-0 px-2"
color="error"
@click="deleteWebcam(webcam.id ?? '')">
<v-icon small>{{ mdiDelete }}</v-icon>
</v-btn>
</settings-row>
</div>
<webcam-list-entry
v-for="(webcam, index) in webcams"
:key="webcam.name"
:webcam="webcam"
:bool-border-top="index > 0"
@edit-webcam="editWebcam" />
</v-card-text>
<v-card-actions>
<v-btn v-if="existCrowsnestConf" text color="primary" @click="openCrowsnestConf">
@@ -33,161 +19,7 @@
</v-card-actions>
</v-card>
<v-card v-else flat>
<v-form ref="webcamForm" v-model="form.valid" @submit.prevent="saveWebcam">
<v-card-title>
{{
form.id === null ? $t('Settings.WebcamsTab.CreateWebcam') : $t('Settings.WebcamsTab.EditWebcam')
}}
</v-card-title>
<v-card-text>
<v-row>
<v-col class="col-12 col-sm-6">
<v-row>
<v-col class="d-flex">
<v-item-group>
<v-menu :offset-y="true" title="Icon">
<template #activator="{ on, attrs }">
<v-btn
class="px-2 mr-2 _transition _menu-button"
color="transparent"
v-bind="attrs"
elevation="0"
:ripple="false"
v-on="on"
@blur="selectIcon = !selectIcon"
@focus="selectIcon = !selectIcon">
<v-icon>{{ convertWebcamIcon(form.icon) }}</v-icon>
<v-icon
:class="!selectIcon ? '' : '_rotate-180'"
:color="!selectIcon ? '' : 'primary'"
class="pl-1 mr-n2">
{{ mdiMenuDown }}
</v-icon>
</v-btn>
</template>
<v-list dense class="py-0">
<v-list-item
v-for="icon of iconItems"
:key="icon.value"
link
@click="setFormIcon(icon.value)">
<v-list-item-icon class="mr-2">
<v-icon small class="mt-1">
{{ convertWebcamIcon(icon.value) }}
</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="icon.text" />
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
<v-text-field
v-model="form.name"
:label="$t('Settings.WebcamsTab.Name')"
hide-details="auto"
outlined
:rules="[rules.required, rules.unique]"
class="_webcam-settings-name-field"
dense />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-text-field
v-model="form.urlStream"
:label="$t('Settings.WebcamsTab.UrlStream')"
hide-details="auto"
outlined
dense
:rules="form.service !== 'mjpegstreamer-adaptive' ? [rules.required] : []" />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-text-field
v-model="form.urlSnapshot"
:label="$t('Settings.WebcamsTab.UrlSnapshot')"
hide-details="auto"
outlined
dense
:rules="form.service === 'mjpegstreamer-adaptive' ? [rules.required] : []" />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-select
v-model="form.service"
:items="serviceItems"
hide-details
outlined
dense
:label="$t('Settings.WebcamsTab.Service')"
attach />
</v-col>
</v-row>
<v-row v-if="form.service === 'mjpegstreamer-adaptive' || form.service === 'jmuxer-stream'">
<v-col class="py-2 col-6">
<v-text-field
v-model="form.targetFps"
outlined
dense
hide-details
:label="$t('Settings.WebcamsTab.TargetFPS')" />
</v-col>
<v-col class="py-2 col-6">
<v-select
v-model="form.rotate"
:items="rotateItems"
outlined
dense
hide-details
:label="$t('Settings.WebcamsTab.Rotate')" />
</v-col>
</v-row>
<v-row>
<v-col class="pt-1 pb-3">
<div class="v-label v-label--active theme--dark text-subtitle-1">
{{ $t('Settings.WebcamsTab.FlipWebcam') }}
</div>
</v-col>
</v-row>
<v-row class="mt-0">
<v-col class="py-0">
<v-checkbox
v-model="form.flipX"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.Horizontally')" />
</v-col>
<v-col class="py-0">
<v-checkbox
v-model="form.flipY"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.Vertically')" />
</v-col>
</v-row>
</v-col>
<v-col class="col-12 col-sm-6 text-center" align-self="center">
<webcam-wrapper :webcam="form" />
</v-col>
</v-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="form.bool = false">
{{ $t('Settings.Cancel') }}
</v-btn>
<v-btn color="primary" text type="submit" :disabled="!form.name">
{{
form.id === null
? $t('Settings.WebcamsTab.SaveWebcam')
: $t('Settings.WebcamsTab.UpdateWebcam')
}}
</v-btn>
</v-card-actions>
</v-form>
<webcam-form :webcam="formWebcam" :type="typeForm" @close="closeForm" />
</v-card>
</div>
</template>
@@ -196,98 +28,30 @@
import { Component, Mixins } from 'vue-property-decorator'
import BaseMixin from '../mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import { mdiMenuDown, mdiDelete, mdiPencil, mdiWebcam } from '@mdi/js'
import { mdiDelete, mdiPencil } from '@mdi/js'
import WebcamMixin from '@/components/mixins/webcam'
import { FileStateFile } from '@/store/files/types'
interface webcamForm {
bool: boolean
id: string | null
valid: boolean
name: string
icon: string
service: string
targetFps: number
urlStream: string
urlSnapshot: string
rotate: number
flipX: boolean
flipY: boolean
}
import WebcamForm from '@/components/settings/Webcams/WebcamForm.vue'
import WebcamListEntry from '@/components/settings/Webcams/WebcamListEntry.vue'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
@Component({
components: {
SettingsRow,
WebcamForm,
WebcamListEntry,
},
})
export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
mdiMenuDown = mdiMenuDown
private selectIcon: boolean = false
private form: webcamForm = {
bool: false,
id: null,
valid: false,
name: '',
icon: '',
service: '',
targetFps: 15,
urlStream: '',
urlSnapshot: '',
rotate: 0,
flipX: false,
flipY: false,
}
private rules = {
required: (value: string) => value !== '' || this.$t('Settings.WebcamsTab.Required'),
unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamsTab.NameAlreadyExists'),
}
private rotateItems = [
{ value: 0, text: '0°' },
{ value: 90, text: '90°' },
{ value: 180, text: '180°' },
{ value: 270, text: '270°' },
]
declare $refs: {
webcamForm: any
}
private boolForm = false
private typeForm: 'create' | 'edit' = 'create'
private formWebcam: GuiWebcamStateWebcam = {} as GuiWebcamStateWebcam
get webcams() {
return this.$store.getters['gui/webcams/getWebcams'] ?? []
}
get iconItems() {
return [
{ value: 'mdiPrinter3d', text: this.$t('Settings.WebcamsTab.IconPrinter') },
{ value: 'mdiPrinter3dNozzle', text: this.$t('Settings.WebcamsTab.IconNozzle') },
{ value: 'mdiRadiatorDisabled', text: this.$t('Settings.WebcamsTab.IconBed') },
{ value: 'mdiWebcam', text: this.$t('Settings.WebcamsTab.IconCam') },
{ value: 'mdiAlbum', text: this.$t('Settings.WebcamsTab.IconFilament') },
{ value: 'mdiDoor', text: this.$t('Settings.WebcamsTab.IconDoor') },
{ value: 'mdiRaspberryPi', text: this.$t('Settings.WebcamsTab.IconMcu') },
{ value: 'mdiCampfire', text: this.$t('Settings.WebcamsTab.IconHot') },
]
}
get serviceItems() {
return [
{ value: 'mjpegstreamer', text: this.$t('Settings.WebcamsTab.Mjpegstreamer') },
{ value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamsTab.MjpegstreamerAdaptive') },
{ value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamsTab.Uv4lMjpeg') },
{ value: 'ipstream', text: this.$t('Settings.WebcamsTab.Ipstream') },
{ value: 'webrtc-camerastreamer', text: this.$t('Settings.WebcamsTab.WebrtcCameraStreamer') },
{ value: 'webrtc-mediamtx', text: this.$t('Settings.WebcamsTab.WebrtcMediaMTX') },
{ value: 'hlsstream', text: this.$t('Settings.WebcamsTab.Hlsstream') },
{ value: 'jmuxer-stream', text: this.$t('Settings.WebcamsTab.JMuxerStream') },
{ value: 'webrtc-janus', text: this.$t('Settings.WebcamsTab.WebrtcJanus') },
]
return this.$store.state.gui.webcams.webcams ?? []
}
get configfiles() {
@@ -302,87 +66,6 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
return this.configfiles.findIndex((file: FileStateFile) => file.filename === 'crowsnest.conf') !== -1
}
getSubtitle(webcam: GuiWebcamStateWebcam) {
return 'URL: ' + (webcam.service === 'mjpegstreamer-adaptive' ? webcam.urlSnapshot : webcam.urlStream)
}
existsWebcamName(name: string) {
return (
this.webcams.findIndex(
(webcam: GuiWebcamStateWebcam) => webcam.name === name && webcam.id !== this.form.id
) !== -1
)
}
createWebcam() {
this.clearDialog()
this.form.bool = true
}
editWebcam(webcam: GuiWebcamStateWebcam) {
this.form.id = webcam.id ?? null
this.form.name = webcam.name
this.form.icon = webcam.icon
this.form.service = webcam.service
this.form.targetFps = webcam.targetFps
this.form.urlStream = webcam.urlStream
this.form.urlSnapshot = webcam.urlSnapshot
this.form.rotate = webcam.rotate ?? 0
this.form.flipX = webcam.flipX
this.form.flipY = webcam.flipY
this.form.bool = true
this.form.valid = false
this.$nextTick(() => {
this.$refs.webcamForm?.validate()
})
}
saveWebcam() {
if (this.form.valid) {
const values = {
name: this.form.name,
icon: this.form.icon,
service: this.form.service,
targetFps: this.form.targetFps,
urlStream: this.form.urlStream,
urlSnapshot: this.form.urlSnapshot,
rotate: this.form.rotate,
flipX: this.form.flipX,
flipY: this.form.flipY,
}
if (this.form.id !== null) this.$store.dispatch('gui/webcams/update', { id: this.form.id, values: values })
else this.$store.dispatch('gui/webcams/store', { values })
this.clearDialog()
}
}
deleteWebcam(id: string) {
this.$store.dispatch('gui/webcams/delete', id)
}
clearDialog() {
this.form.bool = false
this.form.id = null
this.form.name = ''
this.form.icon = mdiWebcam
this.form.service = 'mjpegstreamer-adaptive'
this.form.targetFps = 15
this.form.urlStream = '/webcam/?action=stream'
this.form.urlSnapshot = '/webcam/?action=snapshot'
this.form.rotate = 0
this.form.flipX = false
this.form.flipY = false
}
setFormIcon(icon: string) {
this.form.icon = icon
}
openCrowsnestConf() {
this.$store.dispatch('editor/openFile', {
root: 'config',
@@ -392,36 +75,35 @@ export default class SettingsWebcamsTab extends Mixins(BaseMixin, WebcamMixin) {
permissions: this.crowsnestConf?.permissions,
})
}
createWebcam() {
this.formWebcam = {
name: '',
enabled: true,
icon: 'mdiWebcam',
service: 'mjpegstreamer-adaptive',
target_fps: 15,
target_fps_idle: 15,
stream_url: '/webcam/?action=stream',
snapshot_url: '/webcam/?action=snapshot',
rotation: 0,
flip_horizontal: false,
flip_vertical: false,
extra_data: {},
}
this.typeForm = 'create'
this.boolForm = true
}
closeForm() {
this.boolForm = false
}
editWebcam(webcam: GuiWebcamStateWebcam) {
this.formWebcam = { ...webcam }
this.typeForm = 'edit'
this.boolForm = true
}
}
</script>
<style lang="scss" scoped>
._transition i::before {
transition: transform 500ms;
}
._rotate-180:before {
transform: rotate(180deg);
}
.v-item-group {
button:hover::before,
button:focus::before {
opacity: 0 !important;
}
._menu-button {
height: 40px;
width: 62px;
border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
._menu-button:hover {
border-color: rgba(255, 255, 255, 1) !important;
}
._menu-button:focus {
border: 2px solid var(--color-primary) !important;
}
}
._webcam-settings-name-field ::v-deep .v-text-field__details {
margin-bottom: -12px !important;
}
</style>
@@ -0,0 +1,354 @@
<template>
<v-form ref="webcamForm" v-model="valid" @submit.prevent="submit">
<v-card-title>{{ title }}</v-card-title>
<v-card-text>
<v-row>
<v-col class="col-12 col-sm-6">
<v-row>
<v-col class="d-flex">
<v-item-group>
<v-menu v-model="selectIcon" :offset-y="true" title="Icon">
<template #activator="{ on, attrs }">
<v-btn
class="px-2 mr-2 _transition _menu-button"
color="transparent"
v-bind="attrs"
elevation="0"
:ripple="false"
v-on="on">
<v-icon>{{ convertWebcamIcon(webcam.icon) }}</v-icon>
<v-icon :class="classIconButtonArrow" class="pl-1 mr-n2">
{{ mdiMenuDown }}
</v-icon>
</v-btn>
</template>
<v-list dense class="py-0">
<v-list-item
v-for="icon of iconItems"
:key="icon.value"
link
@click="webcam.icon = icon.value">
<v-list-item-icon class="mr-2">
<v-icon small class="mt-1">
{{ convertWebcamIcon(icon.value) }}
</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title v-text="icon.text" />
</v-list-item-content>
</v-list-item>
</v-list>
</v-menu>
</v-item-group>
<v-text-field
v-model="webcam.name"
:label="$t('Settings.WebcamsTab.Name')"
hide-details="auto"
outlined
:rules="[rules.required, rules.unique]"
class="_webcam-settings-name-field"
dense />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-text-field
v-model="webcam.stream_url"
:label="$t('Settings.WebcamsTab.UrlStream')"
hide-details="auto"
outlined
dense
:rules="rulesStreamUrl" />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-text-field
v-model="webcam.snapshot_url"
:label="$t('Settings.WebcamsTab.UrlSnapshot')"
hide-details="auto"
outlined
dense
:rules="rulesSnapshotUrl" />
</v-col>
</v-row>
<v-row>
<v-col class="py-2">
<v-select
v-model="webcam.service"
:items="serviceItems"
hide-details
outlined
dense
:label="$t('Settings.WebcamsTab.Service')" />
</v-col>
</v-row>
<v-row v-if="['mjpegstreamer-adaptive', 'jmuxer-stream'].includes(webcam.service)">
<v-col class="py-2 col-6">
<v-text-field
v-model="webcam.target_fps"
outlined
dense
hide-details
:label="$t('Settings.WebcamsTab.TargetFPS')" />
</v-col>
<v-col class="py-2 col-6">
<v-select
v-model="webcam.rotation"
:items="rotationItems"
outlined
dense
hide-details
:label="$t('Settings.WebcamsTab.Rotate')" />
</v-col>
</v-row>
<v-row v-if="hasFpsCounter">
<v-col class="pt-1 pb-3">
<v-checkbox
v-model="hideFps"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.HideFps')" />
</v-col>
</v-row>
<v-row>
<v-col class="pt-1 pb-3">
<div class="v-label v-label--active theme--dark text-subtitle-1">
{{ $t('Settings.WebcamsTab.FlipWebcam') }}
</div>
</v-col>
</v-row>
<v-row class="mt-0">
<v-col class="py-0">
<v-checkbox
v-model="webcam.flip_horizontal"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.Horizontally')" />
</v-col>
<v-col class="py-0">
<v-checkbox
v-model="webcam.flip_vertical"
class="mt-1"
hide-details
:label="$t('Settings.WebcamsTab.Vertically')" />
</v-col>
</v-row>
</v-col>
<v-col class="col-12 col-sm-6 text-center" align-self="center">
<webcam-wrapper :webcam="webcam" />
</v-col>
</v-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="closeForm">{{ $t('Settings.Cancel') }}</v-btn>
<v-btn color="primary" text type="submit" :disabled="!valid">{{ actionButtonText }}</v-btn>
</v-card-actions>
</v-form>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { mdiDelete, mdiPencil, mdiMenuDown } from '@mdi/js'
import WebcamMixin from '@/components/mixins/webcam'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
@Component({
components: {
SettingsRow,
},
})
export default class WebcamForm extends Mixins(BaseMixin, WebcamMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
mdiMenuDown = mdiMenuDown
@Prop({ type: Object, required: true }) private webcam!: GuiWebcamStateWebcam
@Prop({ type: String, default: 'create' }) readonly type!: 'create' | 'edit'
private selectIcon = false
private valid = false
private oldWebcamName = ''
private rules = {
required: (value: string) => value !== '' || this.$t('Settings.WebcamsTab.Required'),
unique: (value: string) => !this.existsWebcamName(value) || this.$t('Settings.WebcamsTab.NameAlreadyExists'),
}
get webcams() {
return this.$store.state.gui.webcams?.webcams ?? []
}
get title() {
if (this.type === 'create') return this.$t('Settings.WebcamsTab.CreateWebcam')
return this.$t('Settings.WebcamsTab.EditWebcam')
}
get actionButtonText() {
if (this.type === 'create') return this.$t('Settings.WebcamsTab.SaveWebcam')
return this.$t('Settings.WebcamsTab.UpdateWebcam')
}
get rotationItems() {
const options = [0, 90, 180, 270]
const output: { value: number; text: string }[] = []
options.forEach((value: number) => {
output.push({ value, text: `${value}°` })
})
return output
}
get rulesStreamUrl() {
let rules = []
if (this.webcam.service !== 'mjpegstreamer-adaptive') {
rules.push(this.rules.required)
}
return rules
}
get rulesSnapshotUrl() {
let rules = []
if (this.webcam.service === 'mjpegstreamer-adaptive') {
rules.push(this.rules.required)
}
return rules
}
get serviceItems() {
return [
{ value: 'mjpegstreamer', text: this.$t('Settings.WebcamsTab.Mjpegstreamer') },
{ value: 'mjpegstreamer-adaptive', text: this.$t('Settings.WebcamsTab.MjpegstreamerAdaptive') },
{ value: 'uv4l-mjpeg', text: this.$t('Settings.WebcamsTab.Uv4lMjpeg') },
{ value: 'ipstream', text: this.$t('Settings.WebcamsTab.Ipstream') },
{ value: 'webrtc-camerastreamer', text: this.$t('Settings.WebcamsTab.WebrtcCameraStreamer') },
{ value: 'webrtc-mediamtx', text: this.$t('Settings.WebcamsTab.WebrtcMediaMTX') },
{ value: 'hlsstream', text: this.$t('Settings.WebcamsTab.Hlsstream') },
{ value: 'jmuxer-stream', text: this.$t('Settings.WebcamsTab.JMuxerStream') },
{ value: 'webrtc-janus', text: this.$t('Settings.WebcamsTab.WebrtcJanus') },
]
}
get iconItems() {
return [
{ value: 'mdiPrinter3d', text: this.$t('Settings.WebcamsTab.IconPrinter') },
{ value: 'mdiPrinter3dNozzle', text: this.$t('Settings.WebcamsTab.IconNozzle') },
{ value: 'mdiRadiatorDisabled', text: this.$t('Settings.WebcamsTab.IconBed') },
{ value: 'mdiWebcam', text: this.$t('Settings.WebcamsTab.IconCam') },
{ value: 'mdiAlbum', text: this.$t('Settings.WebcamsTab.IconFilament') },
{ value: 'mdiDoor', text: this.$t('Settings.WebcamsTab.IconDoor') },
{ value: 'mdiRaspberryPi', text: this.$t('Settings.WebcamsTab.IconMcu') },
{ value: 'mdiCampfire', text: this.$t('Settings.WebcamsTab.IconHot') },
]
}
get classIconButtonArrow() {
let classes = ['_transition']
if (this.selectIcon) classes.push('_rotate-180')
return classes
}
get hasFpsCounter() {
return ['mjpegstreamer', 'mjpegstreamer-adaptive'].includes(this.webcam.service)
}
get hideFps() {
return this.webcam.extra_data?.hideFps ?? false
}
set hideFps(newVal) {
if (!('extra_data' in this.webcam)) {
this.webcam.extra_data = {
hideFps: newVal,
}
return
}
// @ts-ignore
this.webcam.extra_data.hideFps = newVal
}
mounted() {
this.oldWebcamName = this.webcam.name
}
existsWebcamName(name: string) {
name = name.toLowerCase().trim()
const count =
this.webcams.find((webcam: GuiWebcamStateWebcam) => webcam.name.toLowerCase().trim() === name)?.length ?? 0
// If we are creating a new webcam, we only want to check if the name already exists
if (this.type === 'create') return count !== 0
// If we are editing a webcam, we want to check if the name only exists once (the one we are editing)
return count >= 1
}
submit() {
if (this.type === 'create') {
this.save()
return
}
this.update()
}
async save() {
await this.$store.dispatch('gui/webcams/store', this.webcam)
this.$emit('close')
}
async update() {
await this.$store.dispatch('gui/webcams/update', { webcam: this.webcam, oldWebcamName: this.oldWebcamName })
this.$emit('close')
}
closeForm() {
this.$emit('close')
}
}
</script>
<style lang="scss" scoped>
::v-deep ._transition svg {
transition: transform 500ms;
}
::v-deep ._rotate-180 svg {
transform: rotate(180deg);
}
.v-item-group {
button:hover::before,
button:focus::before {
opacity: 0 !important;
}
._menu-button {
height: 40px;
width: 62px;
border: 1px solid rgba(255, 255, 255, 0.25) !important;
}
._menu-button:hover {
border-color: rgba(255, 255, 255, 1) !important;
}
._menu-button:focus {
border: 2px solid var(--color-primary) !important;
}
}
._webcam-settings-name-field ::v-deep .v-text-field__details {
margin-bottom: -12px !important;
}
</style>
@@ -0,0 +1,73 @@
<template>
<div>
<v-divider v-if="boolBorderTop" class="my-2" />
<settings-row :title="webcam.name" :icon="icon" :sub-title="subtitle">
<template v-if="webcam.source === 'database'">
<v-btn
class="minwidth-0 px-2"
small
outlined
:color="webcam.enabled ? '' : 'secondary'"
@click="toogleStatus">
<v-icon small>{{ mdiLightbulbOutline }}</v-icon>
</v-btn>
<v-btn class="ml-3" small outlined @click="edit">
<v-icon small left>{{ mdiPencil }}</v-icon>
{{ $t('Settings.Edit') }}
</v-btn>
<v-btn small outlined class="ml-3 minwidth-0 px-2" color="error" @click="deleteWebcam">
<v-icon small>{{ mdiDelete }}</v-icon>
</v-btn>
</template>
</settings-row>
</div>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import { mdiDelete, mdiPencil, mdiLightbulbOutline } from '@mdi/js'
import WebcamMixin from '@/components/mixins/webcam'
@Component({
components: {
SettingsRow,
},
})
export default class WebcamListEntry extends Mixins(BaseMixin, WebcamMixin) {
mdiPencil = mdiPencil
mdiDelete = mdiDelete
mdiLightbulbOutline = mdiLightbulbOutline
@Prop({ type: Object, default: () => {} }) private webcam!: GuiWebcamStateWebcam
@Prop({ type: Boolean, default: false }) private boolBorderTop!: boolean
get icon() {
return this.convertWebcamIcon(this.webcam.icon)
}
get subtitle() {
if (this.webcam.service === 'mjpegstreamer-adaptive') return `URL: ${this.webcam.snapshot_url}`
return `URL: ${this.webcam.stream_url}`
}
toogleStatus() {
let webcam = { ...this.webcam }
webcam.enabled = !webcam.enabled
this.$store.dispatch('gui/webcams/update', { webcam: webcam, oldWebcamName: webcam.name })
}
edit() {
this.$emit('edit-webcam', this.webcam)
}
deleteWebcam() {
this.$store.dispatch('gui/webcams/delete', this.webcam.name)
}
}
</script>
<style lang="scss" scoped></style>
+9 -7
View File
@@ -96,6 +96,15 @@ export default class Panel extends Mixins(BaseMixin) {
.icon-rotate-90 {
transform: rotate(90deg);
}
.panel-toolbar {
overflow-y: hidden;
}
::v-deep .panel-toolbar .v-btn {
height: 100% !important;
max-height: none;
}
</style>
<style lang="scss">
@@ -105,13 +114,6 @@ export default class Panel extends Mixins(BaseMixin) {
.v-card.panel .v-toolbar__content .subheading {
user-select: none;
}
.panel-toolbar {
overflow-y: hidden;
}
.panel-toolbar .v-btn {
height: 100% !important;
max-height: none;
}
.panel-toolbar .v-btn.v-btn--icon {
width: var(--panel-toolbar-icon-btn-width) !important;
}
+11 -15
View File
@@ -14,42 +14,38 @@
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import Hls from 'hls.js'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class Hlsstreamer extends Mixins(BaseMixin) {
export default class Hlsstreamer extends Mixins(BaseMixin, WebcamMixin) {
private aspectRatio: null | number = null
private isVisible = true
private hls: Hls | null = null
@Prop({ required: true })
camSettings: any
@Prop()
printerUrl: string | undefined
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
declare $refs: {
video: HTMLVideoElement
}
get url() {
if (!this.isVisible) return ''
return this.camSettings.urlStream || ''
return this.convertUrl(this.camSettings?.stream_url, this.printerUrl)
}
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
maxHeight: window.innerHeight - 155 + 'px',
maxWidth: 'auto',
}
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) return { transform: transforms.trimStart() }
if (this.aspectRatio) {
output.aspectRatio = this.aspectRatio
output.maxWidth = (window.innerHeight - 155) * this.aspectRatio + 'px'
+19 -21
View File
@@ -1,9 +1,3 @@
<style scoped>
.webcamImage {
width: 100%;
}
</style>
<template>
<video v-observe-visibility="visibilityChanged" :src="url" autoplay :style="webcamStyle" class="webcamImage" />
</template>
@@ -11,30 +5,28 @@
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class Ipstreamer extends Mixins(BaseMixin) {
export default class Ipstreamer extends Mixins(BaseMixin, WebcamMixin) {
private isVisible = true
@Prop({ required: true })
camSettings: any
@Prop()
printerUrl: string | undefined
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
get url() {
if (!this.isVisible) return ''
return this.camSettings.urlStream || ''
return this.convertUrl(this.camSettings?.stream_url, this.printerUrl)
}
get webcamStyle() {
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimLeft().length) return { transform: transforms.trimLeft() }
return ''
return {
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
}
}
visibilityChanged(isVisible: boolean) {
@@ -42,3 +34,9 @@ export default class Ipstreamer extends Mixins(BaseMixin) {
}
}
</script>
<style scoped>
.webcamImage {
width: 100%;
}
</style>
+14 -14
View File
@@ -14,33 +14,33 @@
import JMuxer from 'jmuxer'
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class JMuxerStreamer extends Mixins(BaseMixin) {
export default class JMuxerStreamer extends Mixins(BaseMixin, WebcamMixin) {
private jmuxer: JMuxer | null = null
private status: string = 'connecting'
@Prop({ required: true })
camSettings: any
@Prop()
printerUrl: string | undefined
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
declare $refs: {
video: HTMLVideoElement
}
get url() {
return this.camSettings.urlStream || ''
return this.convertUrl(this.camSettings?.stream_url, this.printerUrl)
}
get webcamStyle() {
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) return { transform: transforms.trimStart() }
return ''
return {
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
}
}
mounted() {
@@ -59,7 +59,7 @@ export default class JMuxerStreamer extends Mixins(BaseMixin) {
}
const video = this.$refs.video
const targetFps = this.camSettings.targetFps || 10
const targetFps = this.camSettings.target_fps || 10
this.jmuxer = new JMuxer({
node: video,
+12 -14
View File
@@ -23,9 +23,11 @@ import { Component, Mixins, Prop, Ref, Watch } from 'vue-property-decorator'
import { JanusJs, JanusSession, JanusStreamingPlugin } from 'typed_janus_js'
import BaseMixin from '@/components/mixins/base'
import { ConstructorOptions } from 'typed_janus_js/src/interfaces/janus'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class JanusStreamer extends Mixins(BaseMixin) {
export default class JanusStreamer extends Mixins(BaseMixin, WebcamMixin) {
private janusClient: JanusJs | null = null
private session: JanusSession | null = null
private handle: JanusStreamingPlugin | null = null
@@ -33,15 +35,12 @@ export default class JanusStreamer extends Mixins(BaseMixin) {
private aspectRatio: null | number = null
private status: string = 'connecting'
@Prop({ required: true })
camSettings: any
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) declare readonly printerUrl: string | null
@Ref() declare stream: HTMLVideoElement
get url() {
const baseUrl = this.camSettings.urlStream
const baseUrl = this.camSettings.stream_url
let url = new URL(baseUrl, this.printerUrl === null ? this.hostUrl.toString() : this.printerUrl)
url.port = '8188'
url.protocol = this.printerUrl?.startsWith('https') ? 'wss' : 'ws'
@@ -56,21 +55,20 @@ export default class JanusStreamer extends Mixins(BaseMixin) {
}
get streamId() {
const pathnameParts = new URL(this.camSettings.urlStream).pathname.split('/')
const pathnameParts = new URL(this.camSettings.stream_url).pathname.split('/')
return pathnameParts[pathnameParts.length - 1]
}
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
}
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) output.transform = transforms.trimStart()
if (this.aspectRatio) output.aspectRatio = this.aspectRatio
return output
@@ -132,7 +130,7 @@ export default class JanusStreamer extends Mixins(BaseMixin) {
@Watch('url')
async changedUrl() {
await this.session?.destroy({})
this.startStream()
await this.startStream()
}
}
</script>
+18 -18
View File
@@ -6,7 +6,7 @@
class="webcamImage"
:style="webcamStyle"
@load="onload" />
<span v-if="showFps" class="webcamFpsOutput">{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}</span>
<span v-if="showFpsCounter" class="webcamFpsOutput">{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}</span>
</div>
</template>
@@ -14,12 +14,14 @@
import Component from 'vue-class-component'
import { Mixins, Prop, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
const CONTENT_LENGTH = 'content-length'
const TYPE_JPEG = 'image/jpeg'
@Component
export default class Mjpegstreamer extends Mixins(BaseMixin) {
export default class Mjpegstreamer extends Mixins(BaseMixin, WebcamMixin) {
private currentFPS = 0
private streamState = false
private aspectRatio: null | number = null
@@ -32,11 +34,8 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
private isVisibleViewport = false
private isVisibleDocument = true
@Prop({ required: true })
camSettings: any
@Prop()
printerUrl: string | undefined
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
@Prop({ default: true }) declare showFps: boolean
@@ -46,26 +45,21 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
}
get url() {
const baseUrl = this.camSettings.urlStream
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
return decodeURIComponent(url.toString())
return this.convertUrl(this.camSettings?.stream_url, this.printerUrl)
}
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
maxHeight: window.innerHeight - 155 + 'px',
maxWidth: 'auto',
}
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) output.transform = transforms.trimStart()
if (this.aspectRatio) {
output.aspectRatio = this.aspectRatio
output.maxWidth = (window.innerHeight - 155) * this.aspectRatio + 'px'
@@ -78,6 +72,12 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
return this.currentFPS < 10 ? '0' + this.currentFPS.toString() : this.currentFPS
}
get showFpsCounter() {
if (!this.showFps) return false
return !(this.camSettings.extra_data?.hideFps ?? false)
}
startStream() {
if (this.streamState) return
this.streamState = true
@@ -10,7 +10,7 @@
height="400"
:style="webcamStyle"
:class="'webcamImage ' + (isLoaded ? '' : 'hiddenWebcam')"></canvas>
<span v-if="isLoaded && showFps" class="webcamFpsOutput">
<span v-if="isLoaded && showFpsCounter" class="webcamFpsOutput">
{{ $t('Panels.WebcamPanel.FPS') }}: {{ fpsOutput }}
</span>
</div>
@@ -20,9 +20,11 @@
import Component from 'vue-class-component'
import { Mixins, Prop, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
export default class MjpegstreamerAdaptive extends Mixins(BaseMixin, WebcamMixin) {
private refresh = Math.ceil(Math.random() * Math.pow(10, 12))
private isVisible = true
private isVisibleDocument = true
@@ -44,24 +46,22 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
mjpegstreamerAdaptive: any
}
@Prop({ required: true }) declare camSettings: any
@Prop() declare printerUrl: string | undefined
@Prop({ required: true }) declare camSettings: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
@Prop({ default: true }) declare showFps: boolean
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
maxHeight: window.innerHeight - 155 + 'px',
maxWidth: 'auto',
}
let transforms = ''
if (this.camSettings.flipX ?? false) transforms += ' scaleX(-1)'
if (this.camSettings.flipY ?? false) transforms += ' scaleY(-1)'
if ((this.camSettings.rotate ?? 0) === 180) transforms += ' rotate(180deg)'
if (transforms.trimStart().length) output.transform = transforms.trimStart()
if (this.aspectRatio) {
output.aspectRatio = this.aspectRatio
output.maxWidth = (window.innerHeight - 155) * this.aspectRatio + 'px'
@@ -74,8 +74,14 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
return this.currentFPS < 10 ? '0' + this.currentFPS.toString() : this.currentFPS
}
get showFpsCounter() {
if (!this.showFps) return false
return !(this.camSettings.extra_data?.hideFps ?? false)
}
get rotate() {
return [90, 270].includes(this.camSettings.rotate ?? 0)
return [90, 270].includes(this.camSettings.rotation ?? 0)
}
refreshFrame() {
@@ -86,9 +92,9 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
}
async setFrame() {
const baseUrl = this.camSettings.urlSnapshot
const baseUrl = this.camSettings.snapshot_url
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
let url = new URL(baseUrl, this.printerUrl === null ? this.hostUrl.toString() : this.printerUrl)
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
url.searchParams.append('bypassCache', this.refresh.toString())
@@ -115,7 +121,7 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
const x = canvas.width / 2
const y = canvas.height / 2
ctx.translate(x, y)
ctx.rotate((this.camSettings.rotate * Math.PI) / 180)
ctx.rotate((this.camSettings.rotation * Math.PI) / 180)
await ctx?.drawImage(
frame,
(-frame.width / 2) * scale,
@@ -123,7 +129,7 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
frame.width * scale,
frame.height * scale
)
ctx.rotate(-((this.camSettings.rotate * Math.PI) / 180))
ctx.rotate(-((this.camSettings.rotation * Math.PI) / 180))
ctx.translate(-x, -y)
} else await ctx?.drawImage(frame, 0, 0, frame.width, frame.height, 0, 0, canvas.width, canvas.height)
@@ -138,7 +144,7 @@ export default class MjpegstreamerAdaptive extends Mixins(BaseMixin) {
onLoad() {
this.isLoaded = true
const targetFps = this.camSettings.targetFps || 10
const targetFps = this.camSettings.target_fps || 10
const end_time = performance.now()
const current_time = end_time - this.start_time
this.time = this.time * this.time_smoothing + current_time * (1.0 - this.time_smoothing)
+9 -13
View File
@@ -13,42 +13,38 @@
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class Uv4lMjpeg extends Mixins(BaseMixin) {
export default class Uv4lMjpeg extends Mixins(BaseMixin, WebcamMixin) {
private aspectRatio: null | number = null
private isVisible = false
private isVisibleViewport = false
private isVisibleDocument = true
@Prop({ required: true }) declare readonly camSettings: GuiWebcamStateWebcam
@Prop() declare printerUrl: string | undefined
@Prop({ default: null }) readonly printerUrl!: string | null
declare $refs: {
webcamUv4lMjpegImage: HTMLImageElement
}
get url() {
const baseUrl = this.camSettings.urlStream
let url = new URL(baseUrl, this.printerUrl === undefined ? this.hostUrl.toString() : this.printerUrl)
if (baseUrl.startsWith('http') || baseUrl.startsWith('://')) url = new URL(baseUrl)
return decodeURIComponent(url.toString())
return this.convertUrl(this.camSettings?.stream_url, this.printerUrl)
}
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
maxHeight: window.innerHeight - 155 + 'px',
maxWidth: 'auto',
}
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) output.transform = transforms.trimStart()
if (this.aspectRatio) {
output.aspectRatio = this.aspectRatio
output.maxWidth = (window.innerHeight - 155) * this.aspectRatio + 'px'
+4 -3
View File
@@ -3,14 +3,14 @@
<template v-if="webcam.service === 'grid'">
<v-container v-if="webcams" fluid class="pb-4">
<v-row dense>
<v-col v-for="gridWebcam in webcams" :key="gridWebcam.id" cols="6">
<webcam-wrapper-item :webcam="gridWebcam" :show-fps="showFps" />
<v-col v-for="gridWebcam in webcams" :key="gridWebcam.name" cols="6">
<webcam-wrapper-item :webcam="gridWebcam" :printer-url="printerUrl" :show-fps="showFps" />
</v-col>
</v-row>
</v-container>
</template>
<template v-else>
<webcam-wrapper-item :webcam="webcam" :show-fps="showFps" />
<webcam-wrapper-item :webcam="webcam" :printer-url="printerUrl" :show-fps="showFps" />
</template>
</div>
</template>
@@ -30,6 +30,7 @@ import WebcamWrapperItem from '@/components/webcams/WebcamWrapperItem.vue'
export default class WebcamWrapper extends Mixins(BaseMixin) {
@Prop({ type: Object, required: true }) webcam!: GuiWebcamStateWebcam
@Prop({ type: Boolean, default: true }) showFps!: Boolean
@Prop({ type: String, default: null }) printerUrl!: string | null
get webcams(): GuiWebcamStateWebcam[] {
return this.$store.getters['gui/webcams/getWebcams']
+10 -9
View File
@@ -1,31 +1,31 @@
<template>
<div>
<template v-if="service === 'mjpegstreamer'">
<mjpegstreamer :cam-settings="webcam" :show-fps="showFps" />
<mjpegstreamer :cam-settings="webcam" :show-fps="showFps" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'mjpegstreamer-adaptive'">
<mjpegstreamer-adaptive :cam-settings="webcam" :show-fps="showFps" />
<mjpegstreamer-adaptive :cam-settings="webcam" :show-fps="showFps" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'uv4l-mjpeg'">
<uv4l-mjpeg :cam-settings="webcam" />
<uv4l-mjpeg :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'ipstream'">
<ipstreamer :cam-settings="webcam" />
<ipstreamer :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'hlsstream'">
<hlsstreamer :cam-settings="webcam" />
<hlsstreamer :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'jmuxer-stream'">
<j-muxer-stream :cam-settings="webcam" />
<j-muxer-stream :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'webrtc-camerastreamer'">
<webrtc-camera-streamer :cam-settings="webcam" />
<webrtc-camera-streamer :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'webrtc-janus'">
<janus-streamer :cam-settings="webcam" />
<janus-streamer :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else-if="service === 'webrtc-mediamtx'">
<webrtc-media-m-t-x :cam-settings="webcam" />
<webrtc-media-m-t-x :cam-settings="webcam" :printer-url="printerUrl" />
</template>
<template v-else>
<p class="text-center py-3 font-italic">{{ $t('Panels.WebcamPanel.UnknownWebcamService') }}</p>
@@ -55,6 +55,7 @@ import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
export default class WebcamWrapperItem extends Mixins(BaseMixin) {
@Prop({ type: Object, required: true }) webcam!: GuiWebcamStateWebcam
@Prop({ type: Boolean, default: true }) showFps!: Boolean
@Prop({ default: null }) printerUrl!: string | null
get service() {
return this.webcam?.service ?? 'unknown'
+10 -12
View File
@@ -20,24 +20,23 @@
<script lang="ts">
import { Component, Mixins, Prop, Ref, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class WebrtcCameraStreamer extends Mixins(BaseMixin) {
export default class WebrtcCameraStreamer extends Mixins(BaseMixin, WebcamMixin) {
private pc: RTCPeerConnection | null = null
private useStun = false
private remote_pc_id: string | null = null
private aspectRatio: null | number = null
private status: string = 'connecting'
@Prop({ required: true })
camSettings: any
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) declare readonly printerUrl: string | null
@Ref() declare stream: HTMLVideoElement
get url() {
const baseUrl = this.camSettings.urlStream
const baseUrl = this.camSettings.stream_url
let url = new URL(baseUrl, this.printerUrl === null ? this.hostUrl.toString() : this.printerUrl)
url.port = this.hostPort.toString()
@@ -48,15 +47,14 @@ export default class WebrtcCameraStreamer extends Mixins(BaseMixin) {
get webcamStyle() {
const output = {
transform: 'none',
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
aspectRatio: 16 / 9,
}
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) output.transform = transforms.trimStart()
if (this.aspectRatio) output.aspectRatio = this.aspectRatio
return output
+17 -14
View File
@@ -20,13 +20,14 @@
<script lang="ts">
import { Component, Mixins, Prop, Ref, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
@Component
export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin) {
@Prop({ required: true }) camSettings: any
@Ref()
declare video: HTMLVideoElement
export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin, WebcamMixin) {
@Prop({ required: true }) readonly camSettings!: GuiWebcamStateWebcam
@Prop({ default: null }) readonly printerUrl!: string | null
@Ref() declare video: HTMLVideoElement
// webrtc player vars
private terminated: boolean = false
@@ -46,20 +47,22 @@ export default class WebrtcRTSPSimpleServer extends Mixins(BaseMixin) {
}
get webcamStyle() {
let transforms = ''
if ('flipX' in this.camSettings && this.camSettings.flipX) transforms += ' scaleX(-1)'
if ('flipX' in this.camSettings && this.camSettings.flipY) transforms += ' scaleY(-1)'
if (transforms.trimStart().length) return { transform: transforms.trimStart() }
return ''
return {
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
}
}
get url() {
if (this.camSettings.urlStream.startsWith('http')) {
return this.camSettings.urlStream.replace('http', 'ws') + 'ws'
let baseUrl = this.camSettings.stream_url
if (baseUrl.startsWith('http')) {
baseUrl = baseUrl.replace('http', 'ws') + 'ws'
}
return this.camSettings.urlStream
return this.convertUrl(baseUrl, this.printerUrl)
}
// stop and restart the video if the url changes
-2
View File
@@ -794,8 +794,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Metoda restartu Klipperu",
"KlipperRestartMethodDescription": "Vyberte metodu restartu, která se použije při editaci konfiguračních souborů Klipperu v \"Uložit a restartovat\".",
"MoonrakerRestartInstance": "Restart instance Moonrakeru",
"MoonrakerRestartInstanceDescription": "Vyberte, která služba Moonrakeru se restartuje v \"Uložit a restartovat\", když se editují konfigurační soubory Moonrakeru.",
"UseEscToClose": "Použít ESC pro zavření editoru",
"UseEscToCloseDescription": "Umožňuje použití klávesy ESC k zavření editoru"
},
-2
View File
@@ -793,8 +793,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Metode for genstart af Klipper",
"KlipperRestartMethodDescription": "Vælg hvilken metode der skal bruges ved brug af 'Gem & Genstart' når der redigeres i Klipper config filer.",
"MoonrakerRestartInstance": "Genstart Moonraker instans",
"MoonrakerRestartInstanceDescription": "Vælg hvilken instans af Moonraker servicen der skal genstartes ved brug af 'Gem & Genstart' når der redigeres i Moonraker config filer.",
"UseEscToClose": "Tryk ESC for at lukke Editor.",
"UseEscToCloseDescription": "Tillader at ESC lukker Editor"
},
+44 -9
View File
@@ -184,6 +184,7 @@
"DeleteDirectory": "Verzeichnis löschen",
"DeleteDirectoryQuestion": "Willst du wirklich das Verzeichnis \"{name}\" mit seinem gesamten Inhalt löschen?",
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",
"DeleteSingleFileQuestion": "Soll die Datei \"{name}\" wirklich gelöscht werden?",
"Download": "Herunterladen",
"Duplicate": "duplizieren",
"DuplicateFile": "Datei duplizieren",
@@ -321,6 +322,7 @@
"CreateNote": "Notiz anlegen",
"Delete": "Löschen",
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Jobs gelöscht werden?",
"DeleteSingleJobQuestion": "Soll der Job wirklich gelöscht werden?",
"Details": "Details",
"EditNote": "Notiz bearbeiten",
"Empty": "leer",
@@ -408,6 +410,7 @@
"DeleteDirectory": "Verzeichnis löschen",
"DeleteDirectoryQuestion": "Verzeichnis \"{name}\" und den gesamten Inhalt löschen?",
"DeleteSelectedQuestion": "{count} ausgewählte Elemente löschen?",
"DeleteSingleFileQuestion": "Soll die Datei \"{name}\" wirklich gelöscht werden?",
"Download": "Herunterladen",
"Duplicate": "duplizieren",
"DuplicateFile": "Datei duplizieren",
@@ -475,27 +478,51 @@
}
},
"UpdatePanel": {
"CheckForUpdates": "auf aktualisierungen prüfen",
"Abort": "abbrechen",
"AreYouSure": "Bist du dir sicher?",
"CheckForUpdates": "auf Aktualisierungen prüfen",
"Close": "schließen",
"CommitHistory": "Commit Verlauf",
"Commits": "Commits",
"CommitsAvailable": "keine Einreichung verfügbar | {count} Einreichung verfügbar | {count} Einreichungen verfügbar",
"CommitsOnDate": "Engereicht am {date}",
"CommitsOnDate": "Eingereicht am {date}",
"CommittedDaysAgo": "eingereicht vor {days} Tagen",
"CommittedHoursAgo": "eingereicht vor {hours} Stunden",
"CommittedOnDate": "eingereicht am {date}",
"CommittedYesterday": "eingereicht gestern",
"ConfigChanges": "Konfigurationsänderungen",
"CountPackagesCanBeUpgraded": "{count} Pakete können aktualisiert werden",
"Detached": "abgetrennt",
"Dirty": "kompromittiert",
"ERROR": "FEHLER",
"GenericUpdateQuestion": "Überprüfe den Commit-Verlauf (falls verfügbar) und die GitHub-Projektseite von diesem Projekt, um festzustellen, ob manuelle Anpassungen nach dieser Aktualisierung erforderlich sind.",
"GitHubPage": "GitHub Projektseite",
"HardRecovery": "Harte Wiederherstellung",
"InitUpdateManager": "Der Update Manager ist noch nicht initialisiert. Dies ist normal, wenn das System zum ersten Mal gestartet wird. Bitte klicke auf die Aktualisierungsschaltfläche, um alle Komponenten zu initialisieren.",
"Invalid": "ungültig",
"IUnderstandTheRisks": "Ich habe die Risiken verstanden",
"LinkToGithub": "Link zu GitHub",
"KlipperUpdateQuestionFirmware": "Dadurch wird die Klipper-Host-Software aktualisiert. Steuerplatinen, auf denen die Klipper-Firmware läuft, müssen möglicherweise mit einer neu kompilierten Firmware geflasht werden, bevor die Maschine wieder in Betrieb genommen werden kann.",
"KlipperUpdateQuestionConfig": "Dieses Update kann Änderungen an den Konfigurationsparametern enthalten, die in der Datei printer.cfg geändert werden müssen; Informationen hierzu findest du im Änderungsprotokoll.",
"MoonrakerUpdateQuestion": "Dadurch wird die Moonraker-API aktualisiert. Möglicherweise sind Änderungen an der Datei moonraker.conf erforderlich, damit die Maschine wieder verwendet werden kann.",
"MoreCommitsInfo": "Hier können maximal 30 Commits angezeigt werden. Um alle Commits zu sehen, klicke bitte auf den folgenden Link:",
"Notification": {
"Detached": "Ein abgetrennter Zustand ist weder ein Fehler noch ein Problem. Es bedeutet nur, dass im lokalen Repository zusätzliche Commits existieren, die im entfernten Repository nicht vorhanden sind.",
"Dirty": "Das lokale Repository wurde geändert und kann in diesem Zustand nicht aktualisiert werden. Bitte stelle wieder ein saubers Repository her."
},
"OSPackages": "OS-Pakete",
"PackagesCanBeUpgraded": "Paketupdates sind verfügbar",
"SoftRecovery": "einfache Wiederherstellung",
"StartUpdate": "Aktualisierung starten",
"System": "System",
"ThesePackagesCanBeUpgrade": "Diese Systempakete können aktualisiert werden:",
"Unknown": "unbekannt",
"Update": "update",
"UpdateAll": "Alle Komponenten updaten",
"UpdateManager": "Update Manager",
"UpdateWarning": "Aktualisierungswarnung: {name}",
"Upgrade": "upgrade",
"UpToDate": "aktuell"
"UpgradeableSystemPackages": "Aktualisierbare Systempakete",
"UpToDate": "aktuell",
"WebClientUpdateQuestion": "In einigen Fällen kann die Aktualisierung des Webclients Änderungen mit sich bringen, die zu Inkompatibilitäten führen können. Weitere Informationen sind in den Veröffentlichungshinweisen zu finden."
}
},
"ManualProbe": {
@@ -653,6 +680,7 @@
"Temperature": "Aktuelle Temperatur"
},
"Headline": "Temperaturen",
"HideMcuHostSensors": "Host/MCU Sensoren ausblenden",
"Max": "max",
"Min": "min",
"Name": "Name",
@@ -767,6 +795,7 @@
"Circle": "Kreis",
"Control": "Steuerung",
"Cross": "Kreuz",
"HideDuringPrint": "Achsensteuerung während des Drucks ausblenden",
"EnableXYHoming": "Aktiviere kombiniertes X & Y homing",
"EstimatedExtrusionInfo": "Zeige Info zur geschätzten Extrusion",
"EstimatedExtrusionInfoDescription": "Anzeigen/ausblenden der Info zur geschätzten Extrusion, basierend auf Extrusionmenge und Extrusionsgeschwindigkeit",
@@ -806,8 +835,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Klipper Neustartmethode",
"KlipperRestartMethodDescription": "Wähle aus, welche Neustartmethode verwendet werden soll wenn 'Speichern & Neustarten' geklickt wir im Editor.",
"MoonrakerRestartInstance": "Moonraker Neustartinstanz",
"MoonrakerRestartInstanceDescription": "Wähle aus, welche Moonrakerinstanz neu gestartet werden soll wenn 'Speichern & Neustarten' im Editor geklickt wird.",
"UseEscToClose": "ESC drücken um Editor zu schließen",
"UseEscToCloseDescription": "Erlaubt es den Editor mit ESC zu schließen.",
"TabSize": "TAB Größe",
@@ -848,7 +875,6 @@
"DbHistoryTotals": "Historie Gesamtzähler",
"DbTimelapseSettings": "Zeitraffer Einstellungen",
"DbView": "Ansichtseinstellungen",
"DbWebcams": "Webcams",
"EstimateValues": {
"Filament": "Filament",
"File": "Datei",
@@ -858,7 +884,7 @@
"FactoryReset": "Werkseinstellungen",
"General": "Allgemein",
"Language": "Sprache",
"MoonrakerDb": "Moonraker Datenbank",
"MainsailSettingsMoonrakerDb": "Mainsail Einstellungen in Moonraker DB",
"PrinterName": "Druckername",
"Reset": "zurücksetzen",
"Restore": "Wiederherstellung",
@@ -1034,6 +1060,11 @@
"ConfirmOnEmergencyStopDescription": "Zeige vor einem Notstop einen Bestätigungsdialog.",
"ConfirmOnPowerDeviceChange": "Bestätigung für Änderung der Stromversorgung von Geräten",
"ConfirmOnPowerDeviceChangeDescription": "Zeige vor Änderung der Stromversorgung von Geräten einen Bestätigungsdialog.",
"DefaultNavigationState": "Standard Navigationszustand",
"DefaultNavigationStateAlwaysClosed": "immer geschlossen",
"DefaultNavigationStateAlwaysOpen": "immer geöffnet",
"DefaultNavigationStateDescription": "Welchen zustand soll die Navigation normalerweise haben?",
"DefaultNavigationStateLastState": "letzter Zustand",
"DisableFanAnimation": "Lüfteranimation deaktivieren",
"DisableFanAnimationDescription": "Dies kann die Last im Browser senken.",
"DisplayCANCEL_PRINT": "Zeige CANCEL_PRINT an",
@@ -1043,6 +1074,8 @@
"Guide": "Leitfaden",
"HideSaveConfigButtonForBedMesh": "SAVE_CONFIG Schaltfläche ausblenden bei bed_mesh Änderungen",
"HideSaveConfigButtonForBedMeshDescription": "SAVE_CONFIG nicht anzeigen, wenn nur das Speichern eines bed_mesh in Klipper aussteht.",
"HideUpdateWarnings": "Aktualisierungswarnungen ausblenden",
"HideUpdateWarningsDescription": "Mit dieser Option werden alle Aktualisierungswarnungen im Aktualisierungsmanager ausgeblendet.",
"LockSliders": "Sperre Schieberegler auf Touchscreen Geräten",
"LockSlidersDelay": "Verzögerung der Sperre für Schieberegler",
"LockSlidersDelayDescription": "Schieberegler werden nach einer bestimmten Verzögerung gesperrt. Wenn 0 oder leer, dann sperren Schieberegler nur nach wechseln/neuladen der Seite.",
@@ -1071,6 +1104,7 @@
"EditWebcam": "Webcam bearbeiten",
"FlipWebcam": "Webcam-Bild spiegeln:",
"Hlsstream": "HLS-Stream",
"HideFps": "FPS-Anzeige verstecken",
"Horizontally": "horizontal",
"IconBed": "Bett",
"IconCam": "Kamera",
@@ -1120,6 +1154,7 @@
"DeleteDirectory": "Verzeichnis löschen",
"DeleteDirectoryQuestion": "Willst du wirklich das Verzeichnis \"{name}\" mit seinem gesamten Inhalt löschen?",
"DeleteSelectedQuestion": "Sollen wirklich {count} ausgewählte Dateien gelöscht werden?",
"DeleteSingleFileQuestion": "Soll die Datei \"{name}\" wirklich gelöscht werden?",
"Download": "Download",
"DuplicateLastframe": "Letztes Bild duplizieren",
"Empty": "Keine fertigen Zeitraffer gefunden.",
+46 -8
View File
@@ -184,6 +184,7 @@
"DeleteDirectory": "Delete Directory",
"DeleteDirectoryQuestion": "Do you really want to delete the \"{name}\" directory with all its contents?",
"DeleteSelectedQuestion": "Do you really want to delete {count} selected files?",
"DeleteSingleFileQuestion": "Do you really want to delete the file \"{name}\"?",
"Download": "Download",
"Duplicate": "Duplicate",
"DuplicateFile": "Duplicate File",
@@ -321,6 +322,7 @@
"Chart": "Chart",
"Delete": "Delete",
"DeleteSelectedQuestion": "Do you really want to delete {count} selected jobs?",
"DeleteSingleJobQuestion": "Do you really want to delete the job?",
"Details": "Details",
"EditNote": "Edit Note",
"Empty": "empty",
@@ -408,6 +410,7 @@
"DeleteDirectory": "Delete Directory",
"DeleteDirectoryQuestion": "Delete directory \"{name}\" and all its contents?",
"DeleteSelectedQuestion": "Delete {count} selected elements?",
"DeleteSingleFileQuestion": "Do you really want to delete the file \"{name}\"?",
"Download": "Download",
"Duplicate": "Duplicate",
"DuplicateFile": "Duplicate File",
@@ -475,7 +478,11 @@
}
},
"UpdatePanel": {
"Abort": "Abort",
"AreYouSure": "Are you sure?",
"CheckForUpdates": "Check for updates",
"Close": "Close",
"CommitHistory": "Commit History",
"Commits": "Commits",
"CommitsAvailable": "no commits available | {count} commit available | {count} commits available",
"CommitsOnDate": "Commits on {date}",
@@ -483,19 +490,40 @@
"CommittedHoursAgo": "committed {hours} hours ago",
"CommittedOnDate": "committed on {date}",
"CommittedYesterday": "committed yesterday",
"Corrupt": "corrupt",
"ConfigChanges": "Config Changes",
"CountPackagesCanBeUpgraded": "{count} packages can be upgraded",
"Detached": "detached",
"Dirty": "dirty",
"ERROR": "ERROR",
"GenericUpdateQuestion": "Check the commit history (if available) and the GitHub page for this project to see if any manual adjustments are necessary for this update.",
"GitHubPage": "GitHub Page",
"HardRecovery": "Hard Recovery",
"InitUpdateManager": "The Update Manager has not been initialized yet. This is normal when you start the system for the first time. Please click on the refresh button to initialize all components.",
"Invalid": "invalid",
"IUnderstandTheRisks": "I understand the risks",
"LinkToGithub": "Link to GitHub",
"KlipperUpdateQuestionFirmware": "This will update the Klipper host software. Control boards running the Klipper firmware may need to be flashed with recompiled firmware before the machine can be put back into service.",
"KlipperUpdateQuestionConfig": "This update may also contain changes to config parameters that would need to be modified in the printer.cfg file, see the change log for details.",
"MoonrakerUpdateQuestion": "This will update the Moonraker API. Changes to the moonraker.conf file may be required to continue using the machine.",
"MoreCommitsInfo": "A maximum of 30 commits can be displayed here. To see all commits, please click on the following link:",
"Notification": {
"Detached": "Detached state is not an error nor is it a problem. It only means that additional commits exist in the local repository that do not exist in the remote repository.",
"Dirty": "The local repository has been modified and cannot be updated in this state. Please recover this repository."
},
"OSPackages": "OS-Packages",
"PackagesCanBeUpgraded": "packages can be upgraded",
"SoftRecovery": "Soft Recovery",
"StartUpdate": "Start Update",
"System": "System",
"ThesePackagesCanBeUpgrade": "These system packages can be upgraded:",
"Unknown": "unknown",
"Update": "update",
"UpdateAll": "Update all components",
"UpdateManager": "Update Manager",
"UpdateWarning": "Update warning: {name}",
"Upgrade": "upgrade",
"UpToDate": "up-to-date"
"UpgradeableSystemPackages": "Upgradeable System Packages",
"UpToDate": "up-to-date",
"WebClientUpdateQuestion": "In some cases updating the web client could have changes that may cause incompatibility. See the release notes for more information."
}
},
"ManualProbe": {
@@ -653,6 +681,7 @@
"Temperature": "current temperature"
},
"Headline": "Temperatures",
"HideMcuHostSensors": "Hide Host/MCU Sensors",
"Max": "max",
"Min": "min",
"Name": "Name",
@@ -767,6 +796,7 @@
"Circle": "Circle",
"Control": "Control",
"Cross": "Cross",
"HideDuringPrint": "Hide axis controls during print",
"EnableXYHoming": "Enable combined X & Y axes homing",
"EstimatedExtrusionInfo": "Show estimated extrusion info",
"EstimatedExtrusionInfoDescription": "Show / Hide info for estimated extrusions based on extrusion amount and feedrate",
@@ -806,8 +836,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Klipper restart method",
"KlipperRestartMethodDescription": "Select which restart method will be used on 'Save & Restart' when editing Klipper config files.",
"MoonrakerRestartInstance": "Moonraker restart instance",
"MoonrakerRestartInstanceDescription": "Select which Moonraker service will restart on 'Save & Restart' when editing Moonraker config files.",
"UseEscToClose": "Use ESC to close editor",
"UseEscToCloseDescription": "Allows the ESC key to close the editor",
"TabSize": "TAB Size",
@@ -846,9 +874,9 @@
"DbConsoleHistory": "Console History",
"DbHistoryJobs": "History Jobs",
"DbHistoryTotals": "History Totals",
"DBNavigation": "Navigation",
"DbTimelapseSettings": "Timelapse Settings",
"DbView": "View Settings",
"DbWebcams": "Webcams",
"EstimateValues": {
"Filament": "Filament",
"File": "File",
@@ -858,12 +886,13 @@
"FactoryReset": "Factory reset",
"General": "General",
"Language": "Language",
"MoonrakerDb": "Moonraker DB",
"MainsailSettingsMoonrakerDb": "Mainsail Settings in Moonraker DB",
"PrinterName": "Printer Name",
"Reset": "reset",
"Restore": "Restore",
"RestoreDialog": "Please select all the sections you want to restore:",
"TimeFormat": "Time Format"
"TimeFormat": "Time Format",
"Everything": "Everything"
},
"InterfaceSettings": "Interface Settings",
"MacrosTab": {
@@ -1034,6 +1063,11 @@
"ConfirmOnEmergencyStopDescription": "Show a confirmation dialog on Emergency Stop",
"ConfirmOnPowerDeviceChange": "Require confirm on Device Power changes",
"ConfirmOnPowerDeviceChangeDescription": "Show a confirmation dialog on Device Power changes",
"DefaultNavigationState": "Navigation default state",
"DefaultNavigationStateAlwaysClosed": "always closed",
"DefaultNavigationStateAlwaysOpen": "always open",
"DefaultNavigationStateDescription": "Which state should have the navigation per default.",
"DefaultNavigationStateLastState": "last state",
"DisableFanAnimation": "Disable fan animation",
"DisableFanAnimationDescription": "This can reduce some load in your Browser.",
"DisplayCANCEL_PRINT": "Display CANCEL_PRINT",
@@ -1043,6 +1077,8 @@
"Guide": "Guide",
"HideSaveConfigButtonForBedMesh": "Hide SAVE_CONFIG button for bed_mesh changes",
"HideSaveConfigButtonForBedMeshDescription": "Hide SAVE_CONFIG, if only bed_mesh changes are pending to be saved in Klipper.",
"HideUpdateWarnings": "Hide Update Warnings",
"HideUpdateWarningsDescription": "This option will hide all update warnings in the update manager.",
"LockSliders": "Lock sliders on touchscreen devices",
"LockSlidersDelay": "Slider lock delay",
"LockSlidersDelayDescription": "Sliders will lock after a given delay. If set to 0 or left blank, sliders will only lock on page change/reload.",
@@ -1070,6 +1106,7 @@
"EditCrowsnestConf": "Edit crowsnest.conf",
"EditWebcam": "Edit Webcam",
"FlipWebcam": "Flip webcam image:",
"HideFps": "Hide FPS counter",
"Horizontally": "horizontally",
"IconBed": "Bed",
"IconCam": "Cam",
@@ -1120,6 +1157,7 @@
"DeleteDirectory": "Delete Directory",
"DeleteDirectoryQuestion": "Do you really want to delete the \"{name}\" directory with all its contents?",
"DeleteSelectedQuestion": "Do you really want to delete {count} selected files?",
"DeleteSingleFileQuestion": "Do you really want to delete the file \"{name}\"?",
"Download": "Download",
"DuplicateLastframe": "Duplicate last frame",
"Empty": "No finished timelapse found.",
-2
View File
@@ -723,8 +723,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Metodo de reinicio de klipper",
"KlipperRestartMethodDescription": "Elija metodo de reinicio que sera usado cuando editamos configuracion de klipper y presionamos \"Guardar y Reiniciar\"",
"MoonrakerRestartInstance": "Instancia de Moonraker a reinicar",
"MoonrakerRestartInstanceDescription": "Elija que instacia de moonrker se reiniciara cuando editando configuracionde monnraker presionemos \"Guardar y reiniciar\" ",
"UseEscToClose": "Use ESC para cerrar",
"UseEscToCloseDescription": "Permite que la tecla ESC cierre el editor"
},
+2 -3
View File
@@ -777,8 +777,6 @@
"Editor": "Editeur",
"KlipperRestartMethod": "Méthode de redémarrage de Klipper",
"KlipperRestartMethodDescription": "Choisissez la méthode utilisée pour redémarrer Klipper lors d'un appui sur 'Save & Restart' après édition des fichiers de configuration.",
"MoonrakerRestartInstance": "Redémarrage Moonraker",
"MoonrakerRestartInstanceDescription": "Choisissez quel service Moonraker doit redémarrer lors d'un appui sur 'Save & Restart' après édition des fichiers de configuration.",
"UseEscToClose": "Utiliser la touche \"esc\" pour fermer l'éditeur",
"UseEscToCloseDescription": "Autoriser la touche \"esc\" de fermer l'éditeur."
},
@@ -831,7 +829,8 @@
"12hours": "12-heures ({time})",
"24hours": "24-heures ({time})",
"DateFormat": "Format de la date",
"TimeFormat": "Format de l'heure"
"TimeFormat": "Format de l'heure",
"Everything": "Tout"
},
"InterfaceSettings": "Réglages interface",
"MacrosTab": {
-2
View File
@@ -722,8 +722,6 @@
"Editor": "Szerkesztő",
"KlipperRestartMethod": "Klipper újraindítási mód",
"KlipperRestartMethodDescription": "Válaszd ki milyen újraindítási módot használjunk a 'Ment és Újraindít' esetén, amikor a klipper konfig fájlait szerkeszted.",
"MoonrakerRestartInstance": "Moonraker példány Újraindítása",
"MoonrakerRestartInstanceDescription": "Válaszd ki melyik Moonraker szolgáltatást indítsuk újra a 'Ment és Újraindít' esetén, amikor a Moonraker konfig fájlait szerkeszted.",
"UseEscToClose": "Kilépéshez nyomd meg az ESC gombot",
"UseEscToCloseDescription": "Az ESC gomb megnyomása bezárja a szerkesztőt",
"TabSize": "TAB Méret",
-2
View File
@@ -794,8 +794,6 @@
"Editor": "エディター",
"KlipperRestartMethod": "Klipper再始動の方法",
"KlipperRestartMethodDescription": "Klipperの設定ファイルを編集する際に'保存して再始動'での再始動方法を選択してください。",
"MoonrakerRestartInstance": "Moonraker インスタンスの再始動",
"MoonrakerRestartInstanceDescription": "Moonrakerの設定ファイルを編集する際に'保存して再始動'で、どのMoonrakerサービスを再始動するか選択してください。",
"UseEscToClose": "ESCキーでエディターを終了します。",
"UseEscToCloseDescription": "ESCキーでエディターを終了できます。"
},
-2
View File
@@ -801,8 +801,6 @@
"Editor": "파일 편집기",
"KlipperRestartMethod": "클리퍼 재시작 방법",
"KlipperRestartMethodDescription": "printer.cfg 파일을 수정 후, '저장 및 다시 시작'을 클릭할 때 사용할 다시 시작 방법을 선택합니다",
"MoonrakerRestartInstance": "문래커 재시작 방법",
"MoonrakerRestartInstanceDescription": "moonraker.conf 파일을 수정할 때 '저장 및 다시 시작'을 클릭할 때 사용할 문래커 서비스를 선택합니다",
"UseEscToClose": "ESC키를 눌러 종료",
"UseEscToCloseDescription": "ESC 키를 눌렀을 때 파일 편집기를 종료하며 만약 비활성화 했을 경우 ESC 키를 누르는 즉시 기존 입력 값은 모두 취소됩니다"
},
-2
View File
@@ -799,8 +799,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Klipper restart methode",
"KlipperRestartMethodDescription": "Selecteerd welke herstart methode gebruikt wordt bij 'Save & Restart' na het bewerken van de Klipper config files.",
"MoonrakerRestartInstance": "Moonraker instantie herstarten",
"MoonrakerRestartInstanceDescription": "Selecteer welke Moonraker service herstart na 'Save & Restart' bij het bewerken van Moonraker config bestanden.",
"UseEscToClose": "Gebruik ESC om de editor te sluiten",
"UseEscToCloseDescription": "Laat de ESC toets de editor sluiten"
},
+83 -44
View File
@@ -1,7 +1,7 @@
{
"App": {
"Notifications": {
"DependencyDescription": "Aktualna {name} wersja nie wspiera wszystkich funkcji Mainsail. Zaktualizuj {name} conajmniej do wersji {neededVersion}.",
"DependencyDescription": "Aktualna wersja {name} nie wspiera wszystkich funkcji Mainsail. Zaktualizuj {name} conajmniej do wersji {neededVersion}.",
"DependencyName": "Zależność: {name}",
"DismissAll": "Odrzuć wszystko",
"KlipperWarnings": {
@@ -104,8 +104,13 @@
"Empty": "Puste",
"Recovering": "Odzyskiwanie {software}...",
"RecoveringDone": "Odzyskiwanie {software} zakończone!",
"Updating": "Aktualizacja {software}...",
"Updating": "Aktualizowanie {software}...",
"UpdatingDone": "Aktualizacja {software} zakończona!"
},
"TheServiceWorker": {
"DescriptionNeedUpdate": "Lokalna pamięć podręczna jest nieaktualna i wymaga aktualizacji. Kliknij poniższy przycisk, aby zaktualizować pamięć podręczną.",
"TitleNeedUpdate": "PWA wymaga aktualizacji",
"Update": "aktualizuj"
}
},
"ConnectionDialog": {
@@ -129,7 +134,7 @@
"Cancel": "Anuluj",
"DoYouWantToStartFilename": "Czy chcesz rozpocząć druk {filename}?",
"Headline": "Rozpocznij",
"Print": "wydruk",
"Print": "drukuj",
"Timelapse": "Timelapse"
}
},
@@ -148,7 +153,7 @@
"Uploading": "Wgrywanie"
},
"EmergencyStopDialog": {
"AreYouSure": "Jesteś pewien?",
"AreYouSure": "Czy na pewno?",
"EmergencyStop": "Awaryjny STOP",
"No": "Nie",
"Yes": "Tak"
@@ -188,7 +193,7 @@
"Name": "Nazwa",
"NewDirectory": "Nowy katalog",
"NozzleDiameter": "Średnica dyszy",
"ObjectHeight": "Wysokość objektu",
"ObjectHeight": "Wysokość obiektu",
"Preheat": "Podgrzej",
"PrintedFiles": "Wydrukowane pliki",
"PrintStart": "Start wydruku",
@@ -212,7 +217,7 @@
"AddBatchToQueue": "Dodaj serię do kolejki",
"GcodesRootDirectoryDoesntExists": "Nie znaleziono katalogu G-Code. Sprawdź opcję \"path\" w sekcji [virtual_sdcard] konfiguracji Klippera.",
"ScanMeta": "Skanuj metadane",
"BedTemp": "Temp. łóżka",
"BedTemp": "Temp. stołu",
"ChamberTemp": "Temp. komory",
"Count": "Ilość",
"DuplicateFile": "Powielony plik",
@@ -220,7 +225,8 @@
"InvalidNameEmpty": "Pole wejściowe nie może być puste!",
"ExtruderTemp": "Temp. ekstrudera",
"Duplicate": "Duplikat",
"ScanMetaSuccess": "Pomyślnie przeskanowano metadane z: {filename}."
"ScanMetaSuccess": "Pomyślnie przeskanowano metadane z: {filename}.",
"DeleteSingleFileQuestion": "Czy na pewno chcesz usunąć plik \"{name}\"?"
},
"FullscreenUpload": {
"CannotUploadFile": "Błąd wgrywania pliku!",
@@ -275,7 +281,7 @@
"Later": "Później",
"Mesh": "Siatka",
"Name": "Nazwa",
"NoBedMeshHasBeenLoadedYet": "Nie została jeszcze wgrana żadna siatka.",
"NoBedMeshHasBeenLoadedYet": "Nie wczytano siatki stołu.",
"NoProfile": "Brak profili",
"Ok": "Ok",
"Probed": "Zmierzone",
@@ -362,7 +368,8 @@
"TotalPrinttime": "Łączny czas drukowania",
"TotalTime": "Całkowity czas druku",
"Chart": "Wykres",
"Table": "Tabela"
"Table": "Tabela",
"DeleteSingleJobQuestion": "Czy na pewno chcesz usunąć zadanie?"
},
"JobQueue": {
"AllJobs": "Wszystkie wydruki",
@@ -415,7 +422,8 @@
"Used": "Używane",
"ConfigRootDirectoryDoesntExists": "Nie znaleziono katalogu konfiguracyjnego. Sprawdź opcję \"config_path\" w sekcji [file_manager] konfiguracji Moonrakera.",
"Duplicate": "Duplikat",
"DuplicateFile": "Powielony plik"
"DuplicateFile": "Powielony plik",
"DeleteSingleFileQuestion": "Czy na pewno chcesz usunąć plik \"{name}\"?"
},
"EndstopPanel": {
"Endstop": "Krańcówka",
@@ -460,26 +468,47 @@
},
"UpdatePanel": {
"CheckForUpdates": "Sprawdź dostępność aktualizacji",
"Commits": "Wydane",
"CommitsAvailable": "Brak nowych wydań | {count} dostępnych wydań| {count} dostępnych wydań",
"CommitsOnDate": "Wydano {date}",
"Commits": "Zmiany",
"CommitsAvailable": "Brak nowych wydań | {count} dostępne wydanie | {count} dostępnych wydań",
"CommitsOnDate": "Zmiany w {date}",
"CommittedDaysAgo": "Wydano {days} dni temu",
"CommittedHoursAgo": "Wydano {hours} godzin temu",
"CommittedOnDate": "Wydano {date}",
"CommittedYesterday": "Wydano wczoraj",
"Detached": "Osobne",
"Dirty": "Brudne",
"ERROR": "BŁĄD",
"Dirty": "brudny",
"Invalid": "Nieprawidłowe",
"OSPackages": "Pakiety systemowe",
"PackagesCanBeUpgraded": "pakiety mogą być zaktualizowane",
"System": "System",
"Unknown": "Nieznane",
"Unknown": "nieznany",
"Update": "Aktualizuj",
"UpdateAll": "Zaktualizuj wszystko",
"UpdateManager": "Menadżer aktualizacji",
"Upgrade": "Uaktualnij",
"UpToDate": "Aktualne"
"UpToDate": "aktualny",
"Abort": "Przerwij",
"GenericUpdateQuestion": "Sprawdź historię zmian (jeśli jest dostępna) i stronę GitHub dla tego projektu, aby sprawdzić, czy konieczne są jakiekolwiek ręczne korekty dla tej aktualizacji.",
"InitUpdateManager": "Menedżer aktualizacji nie został jeszcze zainicjowany. Jest to normalne zjawisko podczas pierwszego uruchomienia systemu. Kliknij przycisk odświeżania, aby zainicjować wszystkie komponenty.",
"MoonrakerUpdateQuestion": "Spowoduje to aktualizację API Moonraker. Zmiany w pliku moonraker.conf mogą być wymagane do dalszego korzystania z urządzenia.",
"StartUpdate": "Rozpocznij aktualizację",
"ThesePackagesCanBeUpgrade": "Te pakiety systemowe mogą być zaktualizowane:",
"WebClientUpdateQuestion": "W niektórych przypadkach aktualizacja klienta sieciowego może spowodować zmiany, które mogą spowodować niezgodność. Więcej informacji można znaleźć w uwagach wydania.",
"AreYouSure": "Czy na pewno?",
"Close": "Zamknij",
"CommitHistory": "Historia zmian",
"ConfigChanges": "Zmiany konfiguracji",
"CountPackagesCanBeUpgraded": "Można uaktualnić {count} pakietów",
"GitHubPage": "Strona GitHub",
"HardRecovery": "Przywróć twardo",
"IUnderstandTheRisks": "Rozumiem ryzyko",
"LinkToGithub": "Link do GitHub",
"KlipperUpdateQuestionFirmware": "Spowoduje to aktualizację oprogramowania hosta Klipper. Płyty sterujące z działającym firmware Klipper mogą wymagać flashowania ponownie skompilowanym firmware przed przywróceniem urządzenia do pracy.",
"KlipperUpdateQuestionConfig": "Ta aktualizacja może również zawierać zmiany w parametrach konfiguracyjnych, które będą musiały zostać zmodyfikowane w pliku printer.cfg, szczegóły można znaleźć w dzienniku zmian.",
"MoreCommitsInfo": "Można tu wyświetlić maksymalnie 30 zmian. Aby zobaczyć wszystkie zmiany, kliknij poniższy link:",
"SoftRecovery": "Przywróć miękko",
"UpdateWarning": "Ostrzeżenie o aktualizacji: {name}",
"UpgradeableSystemPackages": "Pakiety systemowe, które można uaktualnić",
"Corrupt": "uszkodzone"
}
},
"Panels": {
@@ -643,7 +672,8 @@
"Target": "Docelowa",
"TemperaturesInChart": "Temperatura [°C]",
"TempTooHigh": "Temperatura zbyt wysoka dla {name}! (max: {max})",
"TempTooLow": "Temperatura zbyt mała dla {name}! (min: {min})"
"TempTooLow": "Temperatura zbyt mała dla {name}! (min: {min})",
"HideMcuHostSensors": "Ukryj czujniki hosta/MCU"
},
"ToolheadControlPanel": {
"Absolute": "Absolutna",
@@ -671,7 +701,7 @@
"Ok": "Okej",
"Save": "Zapisz",
"SaveConfig": "ZAPISZ KONFIGURACJĘ",
"SaveInfoDescription": "Nowe przesunięcie osi z zostało przeliczone i zarejestrowane. Kliknij na \"ZAPISZ KONFIGURACJĘ\" aby zapisać nowe przesunięcie w drukarka.cfg i uruchom ponownie Klippera.",
"SaveInfoDescription": "Nowe przesunięcie Z zostało obliczone i zarejestrowane. Kliknij przycisk \"ZAPISZ KONFIGURACJĘ\", aby zapisać ją w pliku printer.cfg i zrestartować Klipper.",
"SaveInfoDescriptionPrint": "Nowe przesunięcie Z zostało obliczone i zarejestrowane. Po wydrukowaniu kliknij \"ZAPISZ KONFIGURACJĘ\" na górnym pasku, aby zapisać ją w pliku printer.cfg i zrestartować Klipper.",
"SaveInfoHeadline": "Informacja",
"ToEndstop": "Do krańcówki",
@@ -679,7 +709,7 @@
}
},
"PowerDeviceChangeDialog": {
"AreYouSure": "Jesteś pewien?",
"AreYouSure": "Czy na pewno?",
"No": "Nie",
"TurnDeviceOff": "Wyłącz {device}",
"TurnDeviceOn": "Włącz {device}",
@@ -767,7 +797,8 @@
"Style": "Styl",
"ValueGreaterThan": "Wartość musi być większa niż {value}",
"ZOffsetIncrements": "Wzrost offsetu osi Z (w mm)",
"ZTiltAdjust": "Dostosuj Z-Tilt {isDefault}"
"ZTiltAdjust": "Dostosuj Z-Tilt {isDefault}",
"HideDuringPrint": "Ukryj sterowanie osiami podczas drukowania"
},
"DashboardTab": {
"Dashboard": "Sterowanie",
@@ -779,15 +810,13 @@
},
"Edit": "Edytuj",
"EditorTab": {
"ConfirmUnsavedChanges": "Potwierdź aby zapisać lub anulować niezapisane zmiany",
"ConfirmUnsavedChanges": "Potwierdź, aby zapisać lub anulować niezapisane zmiany",
"ConfirmUnsavedChangesDescription": "Jeżeli włączone, edytor wymaga potwierdzenia zapisania zmian lub anulowania. Jeżeli wyłączone, edytor nie wymaga potwierdzenia.",
"Editor": "Edytor",
"KlipperRestartMethod": "Metoda restartu Klippera",
"KlipperRestartMethodDescription": "Wybierz która metoda ponownego uruchomienia ma być używana podczas 'Zapisz i Uruchom ponownie' podczas edytowania plików konfiguracyjnych Klippera.",
"MoonrakerRestartInstance": "Ponowne uruchomienie instancji Moonrakera",
"MoonrakerRestartInstanceDescription": "Wybierz która metoda ponownego uruchomienia ma być używana podczas 'Zapisz i Uruchom ponownie' podczas edytowania plików konfiguracyjnych Moonrakera.",
"UseEscToClose": "Naciśnij ESC aby wyjść z Edytora",
"UseEscToCloseDescription": "Pozwala aby móc zamknąć edytor za pomocą ESC",
"UseEscToClose": "Naciśnij ESC, aby wyjść z edytora",
"UseEscToCloseDescription": "Umożliwia zamknięcie edytora za pomocą klawisza ESC",
"TabSize": "Rozmiar tabulacji",
"TabSizeDescription": "Ustawia, ile spacji powinno być używanych do wcięcia przy użyciu tabulacji (TAB)",
"Spaces": "Spacje: {count}"
@@ -811,11 +840,8 @@
"CalcEtaTimeDescription": "Po wybraniu kilku opcji zostanie obliczona średnia.",
"CannotReadJson": "Brak możliwości przeczytania/przeanalizowania pliku kopii zapasowej.",
"DbConsoleHistory": "Historia Konsoli",
"DbHistoryJobs": "Historia wydruków",
"DbHistoryTotals": "Historia łącznie",
"DbTimelapseSettings": "Ustawienia timelapse",
"DbView": "Ustawienia",
"DbWebcams": "Kamery",
"EstimateValues": {
"Filament": "Filament",
"File": "Plik",
@@ -823,9 +849,8 @@
},
"FactoryDialog": "Proszę wybrać wszystkie sekcje które mają zostać zresetowane:",
"FactoryReset": "Ustawienia fabryczne",
"General": "Ogólny",
"General": "Ogólne",
"Language": "Język",
"MoonrakerDb": "Baza danych Moonraker",
"PrinterName": "Nazwa drukarki",
"Reset": "reset",
"Restore": "Przywróć",
@@ -841,7 +866,10 @@
"FileRelative": "Pozycja pliku (względna)",
"Slicer": "Slicer (M73)"
},
"DateFormat": "Format daty"
"DateFormat": "Format daty",
"MainsailSettingsMoonrakerDb": "Ustawienia Mainsail w bazie danych Moonraker",
"DBNavigation": "Nawigacja",
"Everything": "Wszystko"
},
"InterfaceSettings": "Ustawienia interfejsu",
"MacrosTab": {
@@ -905,7 +933,7 @@
"Port": "Port",
"RemotePrinters": "Drukarki",
"UpdatePrinter": "Aktualizuj drukarkę",
"UseConfigJson": "Wykryto bazę danych JSON. Aby zmodyfikować listę drukarek, proszę skorzystać z pliku config.json."
"UseConfigJson": "Wykryto bazę danych JSON. Użyj pliku config.json, aby zmodyfikować listę drukarek."
},
"TimelapseTab": {
"Autorender": "Autorenderowanie",
@@ -979,14 +1007,14 @@
"BoolBigThumbnailDescription": "Pokazuj dużą miniaturkę podczas wydruku.",
"BoolHideUploadAndPrintButton": "Ukryj przycisk \"Wgraj i drukuj\"",
"BoolHideUploadAndPrintButtonDescription": "Pokazuj lub ukrywaj przycisk \"Prześlij i drukuj\" na górnym pasku.",
"ConfirmOnEmergencyStop": "Potwierdzenie Nagłego Zatrzymania",
"ConfirmOnEmergencyStopDescription": "Pokazuj dialog potwierdzenia po naciśnięciu Nagłego Zatrzymania",
"ConfirmOnEmergencyStop": "Potwierdzenie awaryjnego zatrzymania",
"ConfirmOnEmergencyStopDescription": "Pokazuj dialog potwierdzenia po naciśnięciu Awaryjny STOP",
"ConfirmOnPowerDeviceChange": "Potwierdzenie dla zmiany zasilania urządzenia",
"ConfirmOnPowerDeviceChangeDescription": "Wyświetlaj okno dialogowe potwierdzenia przy zmianach zasilania urządzenia.",
"ConfirmOnPowerDeviceChangeDescription": "Wyświetlaj okno dialogowe potwierdzenia przy zmianach zasilania urządzenia",
"DisplayCANCEL_PRINT": "Pokazuj przycisk ANULUJ_WYDRUK",
"DisplayCANCEL_PRINTDescription": "Pokazuje przycisk ANULUJ_WYDRUK permamentnie - brak potrzeby drugiej warstwy.",
"GcodeThumbnails": "Pokazuj miniaturki",
"GcodeThumbnailsDescription": "Wciśnij aby przejść na stronę z pomocnikiem dot. włączenia funkcji.",
"GcodeThumbnailsDescription": "Kliknij przycisk, aby przejść do instrukcji.",
"Guide": "Przewodnik",
"LockSliders": "Zablokuj suwaki na ekranie dotykowym",
"LockSlidersDelay": "Opóźnienie blokady suwaków",
@@ -998,7 +1026,7 @@
"NavigationStyleIconsAndText": "Ikony + Tekst",
"NavigationStyleIconsOnly": "Tylko ikony",
"Primary": "Podstawowe",
"UiSettings": "Ustawienia interfejsu",
"UiSettings": "Interfejs",
"DisableFanAnimation": "Wyłącz animację wentylatora",
"DisableFanAnimationDescription": "To może zmniejszyć obciążenie przeglądarki.",
"HideSaveConfigButtonForBedMeshDescription": "Ukryj przycisk \"Zapisz konfigurację\", jeśli oczekują jedynie zmiany w siatce stołu do zapisania w Klipperze.",
@@ -1012,7 +1040,14 @@
"ScrewsTiltAdjustDialog": "Okno dialogowe regulacji nachylenia śrubami",
"TempchartHeight": "Wykres temperatury - wysokość",
"TempchartHeightDescription": "Modyfikuj wysokość wykresu temperatury w panelu sterowania.",
"PowerDeviceName": "Urządzenie zasilające drukarkę"
"PowerDeviceName": "Urządzenie zasilające drukarkę",
"HideUpdateWarnings": "Ukryj ostrzeżenia o aktualizacji",
"HideUpdateWarningsDescription": "Ta opcja ukryje wszystkie ostrzeżenia o aktualizacjach w menedżerze aktualizacji.",
"DefaultNavigationState": "Domyślny stan nawigacji",
"DefaultNavigationStateAlwaysClosed": "zawsze zamknięty",
"DefaultNavigationStateDescription": "Który stan powinien mieć domyślną nawigację?",
"DefaultNavigationStateAlwaysOpen": "zawsze otwarty",
"DefaultNavigationStateLastState": "ostatni stan"
},
"WebcamsTab": {
"AddWebcam": "Dodaj kamerę",
@@ -1048,7 +1083,9 @@
"Hlsstream": "Strumień HLS",
"JMuxerStream": "Nieskompresowany strumień h264 (jmuxer)",
"Rotate": "Obróć",
"WebrtcCameraStreamer": "WebRTC (camera-streamer)"
"WebrtcCameraStreamer": "WebRTC (camera-streamer)",
"WebrtcMediaMTX": "WebRTC (MediaMTX / rtsp-simple-server)",
"HideFps": "Ukryj wskaźnik kl./s"
},
"MiscellaneousTab": {
"AddGroup": "dodaj grupę",
@@ -1128,7 +1165,8 @@
"Used": "Używane",
"Variable": "Zmienne",
"Video": "Filmy",
"DeleteSelectedQuestion": "Czy na pewno chcesz usunąć {count} wybranych plików?"
"DeleteSelectedQuestion": "Czy na pewno chcesz usunąć {count} wybranych plików?",
"DeleteSingleFileQuestion": "Czy na pewno chcesz usunąć plik \"{name}\"?"
},
"title": "Polski",
"BedScrews": {
@@ -1136,7 +1174,7 @@
"Accept": "Akceptuj",
"Description": "Kliknij <b>WYREGULOWANO</b>, jeśli bieżąca śruba została wyregulowana. Kliknij <b>AKCEPTUJ</b>, aby kontynuować bez regulacji.",
"Adjusted": "wyregulowano",
"Headline": "Śruby łóżka",
"Headline": "Śruby stołu",
"ScrewAccepted": "Śruby zaakceptowane",
"ScrewIndex": "Indeks śrub",
"ScrewName": "Nazwa śruby",
@@ -1152,6 +1190,7 @@
"ErrorText": "Wystąpił problem podczas procesu sondowania.",
"Accept": "Akceptuj",
"Base": "Podstawa",
"Headline": "Regulacja nachylenia śrubami"
"Headline": "Regulacja nachylenia śrubami",
"Retry": "ponów"
}
}
-2
View File
@@ -807,8 +807,6 @@
"Editor": "Editor",
"KlipperRestartMethod": "Método para reiniciar Klipper",
"KlipperRestartMethodDescription": "Selecione o método de reinicialização que será usado em 'Salvar e Reiniciar' ao editar arquivos de configuração do Klipper.",
"MoonrakerRestartInstance": "Reiniciar a instância do Moonraker",
"MoonrakerRestartInstanceDescription": "Selecione qual serviço do Moonraker será reiniciado em 'Salvar e Reiniciar' ao editar arquivos de configuração do Moonraker.",
"Spaces": "Espaços: {count}",
"TabSize": "Tamanho TAB",
"TabSizeDescription": "Ajusta quantos espaços devem ser usados para a indentação de TAB.",
-2
View File
@@ -801,8 +801,6 @@
"Editor": "Редактор",
"KlipperRestartMethod": "Способ перезапуска Klipper",
"KlipperRestartMethodDescription": "Выберите какой способ перезапуска Klipper будет использоваться, после нажатия 'СОХРАНИТЬ И ПЕРЕЗАПУСТИТЬ' при редактировании конфигурационных файлов Klipper.",
"MoonrakerRestartInstance": "Способ перезапуска Moonraker",
"MoonrakerRestartInstanceDescription": "Выберите какой способ перезапуска Moonraker будет использоваться, после нажатия 'СОХРАНИТЬ И ПЕРЕЗАПУСТИТЬ' при редактировании конфигурационных файлов Moonraker.",
"UseEscToClose": "Использование клавиши ESC",
"UseEscToCloseDescription": "Позволяет использовать клавишу ESC для закрытия редактора",
"TabSize": "Размер табуляции",
-2
View File
@@ -620,8 +620,6 @@
"Editor": "Redigerare",
"KlipperRestartMethod": "Klipper omstartsmetod",
"KlipperRestartMethodDescription": "Välj vilken omstartsmetod som ska användas på 'Spara och starta om' vid redigering av Klipper-konfigurationsfiler.",
"MoonrakerRestartInstance": "Starta om Moonraker instans",
"MoonrakerRestartInstanceDescription": "Välj vilken Moonraker-tjänst som ska startas om under \"Spara och starta om\" när du redigerar Moonraker-konfigurationsfiler.",
"UseEscToClose": "Använd ESC för att stänga redigeringsprogrammet",
"UseEscToCloseDescription": "Tillåter att ESC-tangenten stänger redigeraren"
},
+579 -476
View File
File diff suppressed because it is too large. Load diff
-2
View File
@@ -735,8 +735,6 @@
"Editor": "Редактор",
"KlipperRestartMethod": "Метод перезапуску Klipper",
"KlipperRestartMethodDescription": "Виберіть, який метод перезавантаження буде використовуватися на 'Зберегти та перезапустити' під час редагування файлів конфігурації Klipper..",
"MoonrakerRestartInstance": "Інстанція перезапуску Moonraker",
"MoonrakerRestartInstanceDescription": "Виберіть, яка послуга Moonraker перезапуститься на 'Зберегти та перезапустити' під час редагування файлів конфігурації Moonraker.",
"UseEscToClose": "Використовуйте ESC для закриття редактора",
"UseEscToCloseDescription": "Дозволяє клавішу ESC закрити редактор"
},
+70 -31
View File
@@ -30,6 +30,11 @@
"NoEmptyAllowedError": "输入值不能为空!"
},
"Printers": "打印机集群",
"TheServiceWorker": {
"DescriptionNeedUpdate": "本地缓存已过时,需要进行更新。请点击下面的按钮来更新缓存。",
"TitleNeedUpdate": "PWA需要更新",
"Update": "更新"
},
"ThrottledStates": {
"DescriptionCurrentlyThrottled": "树莓派ARM核心当前被限制。",
"DescriptionFrequencyCapped": "树莓派ARM最高频率目前限制在1.2 GHz。",
@@ -39,20 +44,20 @@
"DescriptionPreviouslyUnderVolted": "自从开机以来树莓派供电电压至少有一次低于4.65V。",
"DescriptionTemperatureLimitActive": "树莓派uC(仅3A+/3B+)温度目前超过软件限值(默认60C)。",
"DescriptionUnderVoltageDetected": "树莓派供电电压目前低于4.65V",
"TitleCurrentlyThrottled": "当前受到限制",
"TitleFrequencyCapped": "频率上限",
"TitlePreviouslyFrequencyCapped": "历史频率上限",
"TitlePreviouslyTemperatureLimited": "历史温度限制",
"TitlePreviouslyThrottled": "历史限制",
"TitlePreviouslyUnderVolted": "历史电压过低",
"TitleTemperatureLimitActive": "温度限制",
"TitleUnderVoltageDetected": "检测到电压过低"
"TitleCurrentlyThrottled": "受限提醒",
"TitleFrequencyCapped": "频率上限提醒",
"TitlePreviouslyFrequencyCapped": "频率上限提醒",
"TitlePreviouslyTemperatureLimited": "温度限制提醒",
"TitlePreviouslyThrottled": "受限提醒",
"TitlePreviouslyUnderVolted": "电压过低提醒",
"TitleTemperatureLimitActive": "温度限制提醒",
"TitleUnderVoltageDetected": "电压过低提醒"
},
"Titles": {
"Complete": "已完成 - {filename}",
"Error": "错误",
"Pause": "暂停打印",
"PrinterOff": "关闭打印机",
"PrinterOff": "打印机已关闭",
"Printing": "已打印 {percent}% - {filename}",
"PrintingETA": "已打印 {percent}% - 预估: {eta} - {filename}"
},
@@ -179,6 +184,7 @@
"DeleteDirectory": "删除文件夹",
"DeleteDirectoryQuestion": "你确定要删除\"{name}\"和里面的所有内容吗?",
"DeleteSelectedQuestion": "你确定要删除选中的{count}个文件?",
"DeleteSingleFileQuestion": "你确定要删除文件\"{name}\"吗?",
"Download": "下载",
"Duplicate": "复制",
"DuplicateFile": "复制文件",
@@ -316,6 +322,7 @@
"Chart": "图表",
"Delete": "删除",
"DeleteSelectedQuestion": "你是否要删除已选中的{count}个任务?",
"DeleteSingleJobQuestion": "你是否要删除这个任务?",
"Details": "详情",
"EditNote": "编辑便条",
"Empty": "没有内容",
@@ -403,6 +410,7 @@
"DeleteDirectory": "删除文件夹",
"DeleteDirectoryQuestion": "你确定删除\"{name}\"文件夹和里面的所有内容吗?",
"DeleteSelectedQuestion": "删除已选中的{count}个项目?",
"DeleteSingleFileQuestion": "你确定要删除文件\"{name}\"吗?",
"Download": "下载",
"Duplicate": "复制",
"DuplicateFile": "复制文件",
@@ -470,27 +478,48 @@
}
},
"UpdatePanel": {
"Abort": "放弃",
"AreYouSure": "你确定吗?",
"CheckForUpdates": "检查更新",
"Close": "关闭",
"CommitHistory": "查看提交记录",
"Commits": "提交",
"CommitsAvailable": "没有新的提交 | 有{count}个提交 | 有{count}个提交",
"CommitsOnDate": "提交日期{date}",
"CommitsOnDate": "提交于{date}",
"CommittedDaysAgo": "{days}天前提交",
"CommittedHoursAgo": "{hours}小时前提交",
"CommittedOnDate": "提交于{date}",
"CommittedYesterday": "昨天提交",
"Corrupt": "破坏",
"ConfigChanges": "查看变更日志",
"CountPackagesCanBeUpgraded": "有{count}个软件包可以更新",
"Detached": "独立分支",
"Dirty": "被污染",
"ERROR": "错误",
"Dirty": "被修改",
"GenericUpdateQuestion": "检查提交历史(如果有的话)和该项目的 GitHub 页面,以查看是否需要对此更新进行手动调整。",
"GitHubPage": "GitHub页面",
"HardRecovery": "版本回退(清空修改内容)",
"InitUpdateManager": "更新管理器尚未初始化。这是在您首次启动系统时的正常现象。请点击刷新按钮来初始化所有组件。",
"Invalid": "无效",
"IUnderstandTheRisks": "我已了解此风险",
"LinkToGithub": "链接到GitHub",
"KlipperUpdateQuestionFirmware": "此操作将更新Klipper主机软件。运行Klipper固件的打印机控制板,可能需要更新到最新编译的固件后才能使用。",
"KlipperUpdateQuestionConfig": "此更新还可能包含对配置参数的更改,这些更改需要修改printer.cfg文件,有关详细信息请参阅更改日志。",
"MoonrakerUpdateQuestion": "此操作将更新Moonraker API。可能需要更改moonraker.conf文件才能继续使用打印机。",
"MoreCommitsInfo": "这里最多可以显示30个提交。要查看所有提交,请单击以下链接:",
"OSPackages": "操作系统软件包",
"PackagesCanBeUpgraded": "数据包可以更新",
"SoftRecovery": "版本回退(保留修改内容)",
"StartUpdate": "开始更新",
"System": "系统",
"ThesePackagesCanBeUpgrade": "这些系统软件包可以升级:",
"Unknown": "未知",
"Update": "更新",
"UpdateAll": "更新全部组件",
"UpdateManager": "更新管理",
"Upgrade": "更新",
"UpToDate": "已经更新到最新"
"UpdateWarning": "更新警告: {name}",
"Upgrade": "升级",
"UpgradeableSystemPackages": "可升级的系统软件包",
"UpToDate": "已是最新版本",
"WebClientUpdateQuestion": "在某些情况下,更新Web客户端可能会有导致不兼容的更改。有关详细信息,请参阅发行说明。"
}
},
"ManualProbe": {
@@ -617,7 +646,7 @@
"Accept": "接受",
"AtLayer": "所在层",
"Call": "调用",
"DescriptionPauseAtLayerActive": "此功能已激活,会在层{layer}时调用\"{call}\"。如果重复调用命令,此设置将会被覆盖。",
"DescriptionPauseAtLayerActive": "此功能已激活,会在第{layer}层时调用\"{call}\"。如果重复调用命令,此设置将会被覆盖。",
"DescriptionPauseNextLayerActive": "此功能已激活,将在下一层调用\"{call}\"。",
"Layer": "层",
"NextLayer": "下一层",
@@ -648,6 +677,7 @@
"Temperature": "当前温度"
},
"Headline": "温度",
"HideMcuHostSensors": "隐藏Host/MCU传感器",
"Max": "最高",
"Min": "最低",
"Name": "名称",
@@ -728,7 +758,7 @@
"HostnameRequired": "需要配置主机名称/IP地址",
"Port": "Moonraker服务端口",
"PortRequired": "需要配置Moonraker服务端口",
"RememberToAdd": "请在moonraker.conf的'cors_domains'标签中添加{cors}",
"RememberToAdd": "请在moonraker.conf的'cors_domains'标签中添加'{cors}'",
"SelectPrinter": "选择打印机",
"TryAgain": "重试",
"UpdatePrinter": "更新打印机",
@@ -762,6 +792,7 @@
"Circle": "圆形",
"Control": "控制",
"Cross": "交叉",
"HideDuringPrint": "打印期间隐藏轴控制",
"EnableXYHoming": "显示X&Y轴归零按钮",
"EstimatedExtrusionInfo": "显示预估的挤出信息",
"EstimatedExtrusionInfoDescription": "显示/隐藏根据挤出量和进给速度预估的挤出信息",
@@ -801,8 +832,6 @@
"Editor": "编辑器",
"KlipperRestartMethod": "Klipper重启方法",
"KlipperRestartMethodDescription": "编辑完Klipper配置文件并按下\"保存并重启\"按钮后,使用哪种重启方法。",
"MoonrakerRestartInstance": "重启Moonraker实例",
"MoonrakerRestartInstanceDescription": "编辑完Moonraker配置文件并按下\"保存并重启\"按钮后,重启哪个Moonraker服务。",
"UseEscToClose": "使用ESC关闭编辑器",
"UseEscToCloseDescription": "允许使用ESC键关闭编辑器",
"TabSize": "TAB长度",
@@ -839,11 +868,9 @@
"CannotReadJson": "无法读取/解析备份文件。",
"DateFormat": "日期格式",
"DbConsoleHistory": "控制台历史记录",
"DbHistoryJobs": "历史任务",
"DbHistoryTotals": "历史统计",
"DBNavigation": "侧边栏",
"DbTimelapseSettings": "延时摄影设置",
"DbView": "视图设置",
"DbWebcams": "摄像头",
"EstimateValues": {
"Filament": "耗材用量",
"File": "Gcode文件",
@@ -853,12 +880,13 @@
"FactoryReset": "恢复默认设置",
"General": "通用",
"Language": "界面语言",
"MoonrakerDb": "Moonraker数据库",
"MainsailSettingsMoonrakerDb": "在Moonraker数据库中的Mainsail设置",
"PrinterName": "打印机名称",
"Reset": "重启",
"Restore": "恢复",
"RestoreDialog": "请选择你想要恢复的项:",
"TimeFormat": "时间格式"
"TimeFormat": "时间格式",
"Everything": "全部"
},
"InterfaceSettings": "Mainsail设置",
"MacrosTab": {
@@ -948,7 +976,7 @@
"Port": "Moonraker服务端口",
"RemotePrinters": "打印机",
"UpdatePrinter": "更新打印机",
"UseConfigJson": "检测到InstanceDB = JSON。请使用 config.json 来修改打印机列表。"
"UseConfigJson": "检测到InstanceDB参数为JSON。请使用 config.json 来修改打印机列表。"
},
"Store": "存储",
"TimelapseTab": {
@@ -1029,6 +1057,11 @@
"ConfirmOnEmergencyStopDescription": "在按下\"紧急停止\"时显示确认对话框",
"ConfirmOnPowerDeviceChange": "控制设备电源时需要确认",
"ConfirmOnPowerDeviceChangeDescription": "控制设备电源时显示确认对话框",
"DefaultNavigationState": "侧边栏默认状态",
"DefaultNavigationStateAlwaysClosed": "始终隐藏",
"DefaultNavigationStateAlwaysOpen": "始终显示",
"DefaultNavigationStateDescription": "侧边栏默认显示状态。",
"DefaultNavigationStateLastState": "上一次的状态",
"DisableFanAnimation": "关闭风扇动画",
"DisableFanAnimationDescription": "这会一定程度减少浏览器的资源消耗",
"DisplayCANCEL_PRINT": "显示\"取消打印\"按钮",
@@ -1038,12 +1071,14 @@
"Guide": "指南",
"HideSaveConfigButtonForBedMesh": "仅bed_mesh更改时隐藏\"保存配置\"按钮",
"HideSaveConfigButtonForBedMeshDescription": "如果只有bed_mesh更改需要保存到Klipper时,隐藏\"保存配置\"按钮。",
"HideUpdateWarnings": "隐藏更新警告",
"HideUpdateWarningsDescription": "此选项将在更新管理器中隐藏所有的更新警告。",
"LockSliders": "在触摸屏设备上锁定滑动条",
"LockSlidersDelay": "滑动条锁定延迟时间",
"LockSlidersDelayDescription": "滑动条将在给定延迟时间后锁定。如果设置为0或留空,滑动条将仅在页面更改/重新加载后锁定",
"LockSlidersDescription": "在允许更改之前需要解锁触摸屏上的滑动条",
"Logo": "Logo颜色",
"ManualProbeDialog": "手动探针助手对话框",
"ManualProbeDialog": "手动Probe助手对话框",
"ManualProbeDialogDescription": "显示 PROBE_CALIBRATE 或 Z_ENDSTOP_CALIBRATE 的辅助程序对话框。",
"NavigationStyle": "导航栏样式",
"NavigationStyleDescription": "更改导航栏外观",
@@ -1065,6 +1100,7 @@
"EditCrowsnestConf": "编辑 crowsnest.conf",
"EditWebcam": "编辑摄像头",
"FlipWebcam": "翻转摄像头图像:",
"HideFps": "隐藏FPS数值显示",
"Horizontally": "水平",
"IconBed": "热床",
"IconCam": "摄像头",
@@ -1077,9 +1113,9 @@
"Ipstream": "IP摄像头",
"Hlsstream": "HLS视频流",
"WebrtcJanus": "WebRTC (janus-gateway)",
"Mjpegstreamer": "MJPEG视频流",
"MjpegstreamerAdaptive": "自适应MJPEG视频流(试验性)",
"JMuxerStream": "裸h264视频流 (jmuxer)",
"Mjpegstreamer": "MJPEG-Streamer",
"MjpegstreamerAdaptive": "Adaptive MJPEG-Streamer (试验性)",
"JMuxerStream": "原始h264视频流 (jmuxer)",
"Name": "名称",
"NameAlreadyExists": "名称已经存在",
"Required": "需要填写名称",
@@ -1093,14 +1129,16 @@
"Uv4lMjpeg": "UV4L-MJPEG",
"Vertically": "垂直",
"Webcams": "摄像头",
"WebrtcCameraStreamer": "WebRTC (摄像头视频流)"
"WebrtcCameraStreamer": "WebRTC (camera-streamer)",
"WebrtcMediaMTX": "WebRTC (MediaMTX / rtsp-simple-server)"
}
},
"ScrewsTiltAdjust": {
"Accept": "接受",
"Base": "底座",
"ErrorText": "探测过程中出现了问题。",
"Headline": "螺丝倾斜调整"
"Headline": "螺丝倾斜调整",
"Retry": "重试"
},
"Timelapse": {
"AllFiles": "全部文件",
@@ -1113,6 +1151,7 @@
"DeleteDirectory": "删除文件夹",
"DeleteDirectoryQuestion": "你确定要删除\"{name}\"文件夹和里面所有的文件吗?",
"DeleteSelectedQuestion": "你确定要删除选中的{count}个文件吗?",
"DeleteSingleFileQuestion": "你确定要删除文件\"{name}\"吗?",
"Download": "下载",
"DuplicateLastframe": "重复最后一帧",
"Empty": "没有已完成的延时摄影文件",
-2
View File
@@ -773,8 +773,6 @@
"Editor": "編輯器",
"KlipperRestartMethod": "Klipper重新啟動方法",
"KlipperRestartMethodDescription": "編輯完Klipper設定檔案並按下\"儲存並重新啟動\"按鈕後,使用哪種重新啟動方法。",
"MoonrakerRestartInstance": "重新啟動Moonraker",
"MoonrakerRestartInstanceDescription": "編輯完Moonraker設定檔案並按下\"儲存並重新啟動\"按鈕後,重新啟動哪個Moonraker服務。",
"Spaces": "空間: {count}",
"TabSize": "標籤大小",
"UseEscToClose": "使用 ESC 關閉編輯器",
+1 -46
View File
@@ -291,22 +291,6 @@ export const klipper_config: StreamParser<any> = {
return jinja2Element(stream)
}
return gcode.token(stream, state, state.gcodeZeroPos ?? stream.pos)
} else if (state.variable) {
if (stream.sol()) {
stream.eatSpace()
}
if (stream.match(/^\s*{[%#]?/)) {
state.klipperMacroJinja = true
if (stream.string.includes('{%')) {
state.klipperMacroJinjaPctStack.push('{%')
} else {
state.klipperMacroJinjaBraceStack.push('{')
}
return 'tag'
}
if (state.klipperMacroJinja) {
return jinja2Element(stream)
}
} else if (state.pair) {
stream.eatSpace()
if (ch !== ',') {
@@ -324,15 +308,12 @@ export const klipper_config: StreamParser<any> = {
if (state.was && stream.indentation() === 0) {
state.pair = false
state.gcode = false
state.variable = false
state.was = false
}
if (!state.pair && !state.gcode && !state.variable && stream.sol()) {
if (!state.pair && !state.gcode && stream.sol()) {
if (stream.match(/^(?:[A-Za-z]*_?gcode|enable):/)) {
state.gcode = true
} else if (stream.match(/^variable_[a-zA-Z]+:/)) {
state.variable = true
} else {
stream.match(/^.+?:\s*/)
state.pair = !stream.eol()
@@ -341,30 +322,6 @@ export const klipper_config: StreamParser<any> = {
return 'atom'
}
if (state.variable) {
if (stream.sol() || stream.eol()) {
state.variable = false
return null
}
if (stream.match(/^\s*{[%#]?/)) {
state.klipperMacroJinja = true
if (stream.string.includes('{%')) {
state.klipperMacroJinjaPctStack.push('{%')
} else {
state.klipperMacroJinjaBraceStack.push('{')
}
return 'tag'
} else {
// no Jinja in variable
state.pair = true
// state.variable = false
}
if (state.klipperMacroJinja) {
stream.eatSpace()
return jinja2Element(stream)
}
}
if (state.pair) {
if (ch === ':') {
stream.next()
@@ -395,7 +352,6 @@ export const klipper_config: StreamParser<any> = {
pair: false,
was: false,
gcode: false,
variable: false,
klipperMacro: false,
gcodeZeroPos: null,
klipperMacroJinja: false,
@@ -414,7 +370,6 @@ interface StreamParserKlipperConfigState {
pair: boolean
was: boolean
gcode: boolean
variable: boolean
gcodeZeroPos: number | null
klipperMacro: boolean
klipperMacroJinja: boolean
+31
View File
@@ -0,0 +1,31 @@
import fs from 'fs'
import path from 'path'
import { version } from '../../package.json'
import { PluginOption } from 'vite'
/**
* Custom build plugin to write the version in a dedicated release_info.json file after bundling
*/
export default function buildReleaseInfo(): PluginOption {
return {
name: 'build-release_info',
writeBundle: () => {
setImmediate(async () => {
const versionIdentifier = version.toString()
const releaseInfoFile = await fs.promises.open(
path.resolve(__dirname, '../../dist/release_info.json'),
'w'
)
await releaseInfoFile.writeFile(
JSON.stringify({
project_name: 'mainsail',
project_owner: 'mainsail-crew',
version: `v${versionIdentifier}`,
})
)
await releaseInfoFile.close()
})
},
}
}
+1 -3
View File
@@ -127,11 +127,9 @@ export const actions: ActionTree<EditorState, RootState> = {
Vue.$toast.success(i18n.t('Editor.SuccessfullySaved', { filename: data.item.path }).toString())
if (payload.restartServiceName === 'klipper') {
const klipperRestartMethod = getters['getKlipperRestartMethod']
//dispatch('server/addEvent', { message: 'FIRMWARE_RESTART', type: 'command' })
Vue.$socket.emit('printer.gcode.script', { script: klipperRestartMethod })
} else if (payload.restartServiceName === 'moonraker') {
const moonrakerRestartInstance = getters['getMoonrakerRestartInstance']
Vue.$socket.emit('machine.services.restart', { service: moonrakerRestartInstance })
Vue.$socket.emit('server.restart', {})
} else if (payload.restartServiceName !== null) {
Vue.$socket.emit('machine.services.restart', { service: payload.restartServiceName })
}
-9
View File
@@ -5,13 +5,4 @@ export const getters: GetterTree<EditorState, any> = {
getKlipperRestartMethod: (state, getters, rootState) => {
return rootState.gui.editor?.klipperRestartMethod ?? 'FIRMWARE_RESTART'
},
getMoonrakerRestartInstance: (state, getters, rootState) => {
const available_services = rootState.server?.system_info?.available_services ?? []
const setting = rootState.gui.editor?.moonrakerRestartInstance ?? 'moonraker'
if (available_services.includes(setting)) return setting
return 'moonraker'
},
}
+5 -8
View File
@@ -230,13 +230,10 @@ export const actions: ActionTree<FarmPrinterState, RootState> = {
})
}
if (payload.namespaces.includes('webcams')) {
dispatch('sendObj', {
method: 'server.database.get_item',
params: { namespace: 'webcams' },
action: 'getWebcamsData',
})
}
dispatch('sendObj', {
method: 'server.webcams.list',
action: 'getWebcamsData',
})
},
getMainsailData({ commit }, payload) {
@@ -244,6 +241,6 @@ export const actions: ActionTree<FarmPrinterState, RootState> = {
},
getWebcamsData({ commit }, payload) {
commit('setWebcamsData', payload.value)
commit('setWebcamsData', payload.webcams)
},
}
+2 -10
View File
@@ -52,7 +52,7 @@ export const getters: GetterTree<FarmPrinterState, any> = {
if (state.data.print_stats.state === 'printing') {
const percent = getters['getPrintPercent']
return Math.round(percent * 100) + '% Printing'
return Math.floor(percent * 100) + '% Printing'
}
return state.data.print_stats.state.charAt(0).toUpperCase() + state.data.print_stats.state.slice(1)
@@ -308,14 +308,6 @@ export const getters: GetterTree<FarmPrinterState, any> = {
},
getPrinterWebcams: (state) => {
const webcams: GuiWebcamStateWebcam[] = []
if (state.data.webcams) {
Object.keys(state.data.webcams).forEach((id: string) => {
webcams.push({ ...state.data?.webcams[id], id })
})
}
return webcams
return state.data.webcams.filter((webcam: GuiWebcamStateWebcam) => webcam.enabled)
},
}
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff. Show more