From b8484c6eb2bd2e7e8b89a0e85f07add74c4f60f1 Mon Sep 17 00:00:00 2001 From: Donavan Becker Date: Sat, 11 Nov 2023 08:10:52 -0600 Subject: [PATCH 01/34] trigger attach-artifacts --- .github/workflows/Attach Artifacts.yml | 2 ++ .github/workflows/release.yml | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Attach Artifacts.yml b/.github/workflows/Attach Artifacts.yml index 7f0203286..1fd752f94 100644 --- a/.github/workflows/Attach Artifacts.yml +++ b/.github/workflows/Attach Artifacts.yml @@ -2,6 +2,8 @@ name: Manually Attach Artifacts ( If the automation fails ) run-name: Manually Attach Artifacts against ${{ github.event.inputs.tag }} on: + repository_dispatch: + types: [attach-artifacts] workflow_dispatch: inputs: tag: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5691ac3cb..3f524197c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,9 +61,7 @@ jobs: tar -C $(pwd)/package --owner=0 --group=0 --format=posix -czvf homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz . shasum -a 256 homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz > SHASUMS256.txt - - name: Attach Bundle - uses: AButler/upload-release-assets@v2.0 + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v2 with: - files: 'homebridge-config-ui-x-${{ github.event.release.tag_name }}.tar.gz;SHASUMS256.txt' - repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ github.event.release.tag_name }} + event-type: attach-artifacts From c1734bb85cf74a2cfbb4fb82ce44d43e74e68347 Mon Sep 17 00:00:00 2001 From: Suthep Yonphimai Date: Sat, 11 Nov 2023 21:57:05 +0700 Subject: [PATCH 02/34] Update th.json (#1688) --- ui/src/i18n/th.json | 66 ++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/ui/src/i18n/th.json b/ui/src/i18n/th.json index 03fd768cf..9df306b8b 100644 --- a/ui/src/i18n/th.json +++ b/ui/src/i18n/th.json @@ -1,5 +1,5 @@ { - "--language": "Thai, Tajski", + "--language": "Thai, ภาษาไทย", "accessories.button_add_room": "เพิ่มห้อง", "accessories.button_create_room": "สร้างห้อง", "accessories.button_toggle_hidden": "ซ่อนการสลับ", @@ -81,8 +81,8 @@ "child_bridge.label_bridge_restart_child_bridges": "รีสตาร์ท Child Bridges", "child_bridge.label_bridge_settings": "การตั้งค่า Bridge", "child_bridge.label_child_bridges": "Child Bridge", - "child_bridge.label_child_start": "Start child bridge", - "child_bridge.label_child_stop": "Stop child bridge", + "child_bridge.label_child_start": "เริ่มการทำงาน child bridge", + "child_bridge.label_child_stop": "หยุดการทำงาน child bridge", "child_bridge.message_about": "Homebridge ช่วยให้คุณสามารถเรียกใช้แพลตฟอร์มปลั๊กอินหรืออุปกรณ์เสริมแยกจาก Child Bridge สิ่งนี้สามารถปรับปรุงการตอบสนองทั่วไปและความน่าเชื่อถือของ Homebridge", "child_bridge.message_child_bridges_must_be_paired_separately": "แพลตฟอร์ม Child Bridgeหรืออุปกรณ์เสริมแต่ละตัวจะต้องจับคู่กับ HomeKit แยกกัน.", "child_bridge.message_must_configure_plugin_first": "คุณต้องกำหนดค่าปลั๊กอินนี้ก่อนจึงจะจัดการการตั้งค่า Bridge ได้", @@ -133,9 +133,9 @@ "menu.docker.label_settings": "การตั้งค่า", "menu.docker.label_startup_script": "สคริปต์เริ่มต้น", "menu.docker.label_terminal": "เทอร์มินอล", - "menu.hbrestart.confirm_button": "Restart Homebridge", - "menu.hbrestart.confirmation": "Are you sure you want to restart Homebridge?", - "menu.hbrestart.title": "Restart Homebridge", + "menu.hbrestart.confirm_button": "รีสตาร์ท Homebridge", + "menu.hbrestart.confirmation": "คุณแน่ใจหรือไม่ว่าต้องการรีสตาร์ท Homebridge?", + "menu.hbrestart.title": "รีสตาร์ท Homebridge", "menu.label_accessories": "อุปกรณ์เสริม", "menu.label_config": "การตั้งค่า", "menu.label_plugins": "ปลั๊กอิน", @@ -171,8 +171,8 @@ "platform.linux.shutdown.title_shutting_down_server": "กำลังปิดเซิร์ฟเวอร์", "platform.version.message_service_restart_required": "คำเตือน: Homebridge UI รุ่น{{ uiVersion }} ได้รับการติดตั้งแล้ว แต่บริการเซิร์ฟเวอร์ยังคงทำงานอยู่ รุ่น{{ serverVersion }}.", "platform.version.title_service_restart_required": "จำเป็นต้องรีสตาร์ทบริการ", - "plugins.button_api_documentation": "API Documentation", - "plugins.button_homepage": "Plugin Homepage", + "plugins.button_api_documentation": "เอกสาร API", + "plugins.button_homepage": "ปลั๊กอิน Homepage", "plugins.button_install": "ติดตั้ง", "plugins.button_settings": "การตั้งค่า", "plugins.button_uninstall": "ถอนการติดตั้ง", @@ -182,10 +182,10 @@ "plugins.donate.message_learn_more": "เรียนรู้เพิ่มเติมเกี่ยวกับลิงก์การบริจาคในปลั๊กอิน", "plugins.donate.tile_donate_to": "บริจาคให้ {{ author }}", "plugins.manage.button_restart_now": "รีสตาร์ท Homebridge ทันที", - "plugins.manage.child_bridge_button_restart_now": "Restart Child Bridges", - "plugins.manage.child_bridge_button_restart_now_one": "Restart Child Bridge", - "plugins.manage.child_bridge_restart_failed": "Plugin restart failed, please restart Homebridge manually.", - "plugins.manage.child_bridge_restart_success": "Plugin restart successful.", + "plugins.manage.child_bridge_button_restart_now": "รีสตาร์ท Child Bridges", + "plugins.manage.child_bridge_button_restart_now_one": "รีสตาร์ท Child Bridge", + "plugins.manage.child_bridge_restart_failed": "การรีสตาร์ทปลั๊กอินล้มเหลว โปรดรีสตาร์ท Homebridge ด้วยตนเอง", + "plugins.manage.child_bridge_restart_success": "รีสตาร์ทปลั๊กอินสำเร็จ", "plugins.manage.disable": "ปิดการใช้งาน", "plugins.manage.enable": "เปิดการใช้งาน", "plugins.manage.json_config": "การกำหนดค่า JSON", @@ -193,8 +193,8 @@ "plugins.manage.label_installed": "ติดตั้งแล้ว", "plugins.manage.label_manual_update_required": "จำเป็นต้องมีการอัปเดตด้วยตนเอง", "plugins.manage.label_online_updates_not_supported_on_windows": "Windows ไม่รองรับการอัปเดตออนไลน์ คุณจะต้องอัปเกรด Homebridge ด้วยตนเองหลังจากหยุดบริการ Homebridge", - "plugins.manage.label_release_notes": "Release Notes", - "plugins.manage.label_release_notes_beta": "Beta Information", + "plugins.manage.label_release_notes": "บันทึกประจำรุ่น", + "plugins.manage.label_release_notes_beta": "ข้อมูลเกี่ยวกับรุ่นเบต้า", "plugins.manage.label_uninstall": "ถอนการติดตั้ง", "plugins.manage.label_uninstalled": "นำออกแล้ว", "plugins.manage.label_update": "อัปเดท", @@ -204,14 +204,14 @@ "plugins.manage.message_install_alternate_version": "ติดตั้งเวอร์ชันก่อนหน้า", "plugins.manage.message_select_version_to_install": "เลือกเวอร์ชันที่จะติดตั้ง", "plugins.manage.message_thanks_for_updating": "ขอบคุณที่ติดตั้ง {{ pluginName }} เวอร์ชันล่าสุด", - "plugins.manage.message_thanks_for_updating_restart": "Please restart Homebridge for the changes to apply.", - "plugins.manage.message_thanks_for_updating_restart_child_bridges": "Please restart the plugin's child bridges for the changes to apply.", + "plugins.manage.message_thanks_for_updating_restart": "โปรดรีสตาร์ท Homebridge เพื่อให้การเปลี่ยนแปลงมีผล", + "plugins.manage.message_thanks_for_updating_restart_child_bridges": "โปรดรีสตาร์ท child bridges ของปลั๊กอินเพื่อให้การเปลี่ยนแปลงมีผล", "plugins.manage.message_uninstall_remove_config_required": "หากคุณกำลังลบปลั๊กอินนี้อย่างถาวรตรวจสอบให้แน่ใจว่าคุณได้ลบการกำหนดค่าใด ๆ สำหรับปลั๊กอินนี้ใน config.json ก่อนที่จะรีสตาร์ท Homebridge", "plugins.manage.message_uninstall_remove_confirmation": "แน่ใจไหมว่าต้องการถอนการติดตั้ง {{ pluginName }}?", "plugins.manage.message_uninstall_remove_plugin_config": "ลบ Plugin Config ด้วยหรือไม่", - "plugins.manage.modal_verified_cta": "More Info", - "plugins.manage.modal_verified_message": "Homebridge plugins that are marked as verified have been reviewed by the Homebridge project team to ensure they meet various requirements that encourage best practices and a trouble-free user experience.", - "plugins.manage.modal_verified_title": "Verified Plugins", + "plugins.manage.modal_verified_cta": "ข้อมูลเพิ่มเติม", + "plugins.manage.modal_verified_message": "ปลั๊กอิน Homebridge ที่ทำเครื่องหมายว่าตรวจสอบแล้วได้รับการตรวจสอบโดยทีมงานโครงการ Homebridge เพื่อให้แน่ใจว่าเป็นไปตามข้อกำหนดต่างๆ ที่ส่งเสริมแนวทางปฏิบัติที่ดีที่สุดและประสบการณ์ผู้ใช้ที่ปราศจากปัญหา", + "plugins.manage.modal_verified_title": "ปลั๊กอินที่ได้รับการตรวจสอบแล้ว", "plugins.node_update.are_you_sure_you_want_to_update": "แน่ใจไหมว่าต้องการอัปเดต {{ pluginName }}?", "plugins.node_update.homebridge_node_version_too_low": "Homebridge รุ่น{{latestVersion}} ต้องการ Node.js รุ่น{{minVersion}} หรือใหม่กว่า. โดยที่คุณกำลังใช้ Node.js {{ installedVersion }}.", "plugins.node_update.node_version_too_low": "{{ pluginName }} ปลั๊กอินแนะนำให้ทำงานบน Node.js รุ่น{{ minVersion }} หรือใหม่กว่า. โดยที่คุณกำลังใช้ Node.js {{ installedVersion }}.", @@ -236,7 +236,7 @@ "plugins.status_installed": "ติดตั้งแล้ว", "plugins.status_not_installed": "ไม่ได้ติดตั้ง", "plugins.status_update_available": "มีการอัปเดต", - "plugins.status_update_beta_available": "Beta Update Available", + "plugins.status_update_beta_available": "มีการอัปเดตรุ่นเบต้า", "plugins.toast_failed_to_load_plugins": "โหลดปลั๊กอินไม่สำเร็จ", "plugins.tooltip_update_plugin_to": "อัปเดตปลั๊กอินเป็น รุ่น{{latestVersion}}", "reset.accessories_will_may_need_to_be_reconfigured": "หลังจากดำเนินการนี้แล้วอุปกรณ์เสริมบางอย่างอาจต้องได้รับการกำหนดค่าใหม่ใน HomeKit หรือเพิ่มเข้าไปใหม่ในระบบอัตโนมัติของคุณ", @@ -316,7 +316,7 @@ "status.plugins_out_of_date": "ปลั๊กอินล้าสมัย", "status.services.label_not_running": "ไม่ทำงาน", "status.services.label_running": "กำลังทำงาน", - "status.services.label_running_on_port": "Port: {{port}}", + "status.services.label_running_on_port": "พอร์ต: {{port}}", "status.services.label_starting": "กำลังเริ่มทำงาน…", "status.uptime.title_uptime": "ระยะเวลาเปิดบริการ", "status.widget.accessories.label_choose_accessories_to_display": "เลือกอุปกรณ์เสริมที่จะแสดงในวิดเจ็ตนี้จากแท็บอุปกรณ์เสริม", @@ -343,15 +343,15 @@ "status.widget.label_temperature_units_system_default": "ค่าเริ่มต้นของระบบ", "status.widget.label_unlock_layout": "ปลดล็อกเค้าโครง", "status.widget.systeminfo.label_config_path": "เส้นทางกำหนดค่า", - "status.widget.systeminfo.label_disabled": "Disabled", + "status.widget.systeminfo.label_disabled": "ปิดการใช้", "status.widget.systeminfo.label_docker": "Docker", - "status.widget.systeminfo.label_enabled": "Enabled", - "status.widget.systeminfo.label_glibc_warning": "Version is too low for updating Node.js to newer versions - https://homebridge.io/w/JJSun", + "status.widget.systeminfo.label_enabled": "เปิดใช้", + "status.widget.systeminfo.label_glibc_warning": "เวอร์ชันต่ำเกินไปสำหรับการอัปเดต Node.js เป็นเวอร์ชันที่ใหม่กว่า - https://homebridge.io/w/JJSun", "status.widget.systeminfo.label_hostname": "ชื่อโฮสต์", "status.widget.systeminfo.label_ipv4": "IPv4", "status.widget.systeminfo.label_ipv6": "IPv6", - "status.widget.systeminfo.label_no": "No", - "status.widget.systeminfo.label_nodejs_path": "Node.js Path", + "status.widget.systeminfo.label_no": "ไม่", + "status.widget.systeminfo.label_nodejs_path": พาธของ Node.js", "status.widget.systeminfo.label_nodejs_version": "รุ่นของ Node.js", "status.widget.systeminfo.label_os": "ระบบปฏิบัติการ", "status.widget.systeminfo.label_plugin_path": "เส้นทางปลั๊กอิน", @@ -360,13 +360,13 @@ "status.widget.systeminfo.label_storage_path": "เส้นทางการจัดเก็บ", "status.widget.systeminfo.label_synology_package": "แพ็คเกจ Synology", "status.widget.systeminfo.label_timezone": "เขตเวลา", - "status.widget.systeminfo.label_yes": "Yes", - "status.widget.systeminfo.modal_glibc_cta": "More Info", - "status.widget.systeminfo.modal_glibc_message": "This message indicates that your operating system does not support newer versions of Node.js. To resolve this and be able to install updated versions of Node.js in the future, you will need to update your operating system to a more recent version.", - "status.widget.systeminfo.modal_glibc_title": "OS Update", - "status.widget.systeminfo.modal_servicemode_cta": "More Info", - "status.widget.systeminfo.modal_servicemode_message": "Standalone mode is no longer recommended. Setting up Homebridge and Homebridge UI with hb-service has the same benefits of standalone mode but is much easier to setup and maintain.", - "status.widget.systeminfo.modal_servicemode_title": "Service Mode", + "status.widget.systeminfo.label_yes": "ใช่", + "status.widget.systeminfo.modal_glibc_cta": "ข้อมูลเพิ่มเติม", + "status.widget.systeminfo.modal_glibc_message": "ข้อความนี้ระบุว่าระบบปฏิบัติการของคุณไม่รองรับ Node.js เวอร์ชันใหม่กว่า เพื่อแก้ไขปัญหานี้และสามารถติดตั้ง Node.js เวอร์ชันอัปเดตได้ในอนาคต คุณจะต้องอัปเดตระบบปฏิบัติการเป็นเวอร์ชันล่าสุด", + "status.widget.systeminfo.modal_glibc_title": "อัพเดตระบบปฏิบัติการ", + "status.widget.systeminfo.modal_servicemode_cta": "ข้อมูลเพิ่มเติม", + "status.widget.systeminfo.modal_servicemode_message": "ไม่แนะนำให้ใช้โหมดสแตนด์อโลนอีกต่อไป การตั้งค่า Homebridge และ Homebridge UI ด้วย hb-service มีข้อดีเหมือนกับโหมดสแตนด์อโลน แต่การตั้งค่าและบำรุงรักษาได้ง่ายกว่ามาก", + "status.widget.systeminfo.modal_servicemode_title": "โหมดบริการ", "status.widget.title_manage_widget": "จัดการวิดเจ็ต", "status.widget.uptime.label_process": "โปรเซส", "status.widget.uptime.label_server": "เซิร์ฟเวอร์", From a8dceaef1a12c52e16b10cac548cf835ce9953fd Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Sat, 11 Nov 2023 18:00:50 +0000 Subject: [PATCH 03/34] test plugin logs --- ui/package-lock.json | 7 +++ ui/package.json | 1 + ui/src/app/core/log.service.ts | 18 +++++- .../manage-plugins/manage-plugins.module.ts | 2 + .../plugin-log-modal.component.html | 16 +++++ .../plugin-log-modal.component.scss | 0 .../plugin-log-modal.component.ts | 62 +++++++++++++++++++ .../plugin-card/plugin-card.component.html | 4 ++ .../plugin-card/plugin-card.component.ts | 10 +++ ui/src/i18n/th.json | 2 +- 10 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html create mode 100644 ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.scss create mode 100644 ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.ts diff --git a/ui/package-lock.json b/ui/package-lock.json index 32bc42d15..d150443b0 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -66,6 +66,7 @@ "@angular/language-service": "^14.3.0", "@fortawesome/fontawesome-free": "^6.4.2", "@types/emoji-js": "^3.5.2", + "@types/file-saver": "^2.0.7", "@types/node": "^18.18.9", "@types/qrcode": "^1.5.5", "@types/semver": "^7.5.5", @@ -3616,6 +3617,12 @@ "@types/send": "*" } }, + "node_modules/@types/file-saver": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.7.tgz", + "integrity": "sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==", + "dev": true + }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", diff --git a/ui/package.json b/ui/package.json index ef080dffb..b8c9c566b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -68,6 +68,7 @@ "@angular/language-service": "^14.3.0", "@fortawesome/fontawesome-free": "^6.4.2", "@types/emoji-js": "^3.5.2", + "@types/file-saver": "^2.0.7", "@types/node": "^18.18.9", "@types/qrcode": "^1.5.5", "@types/semver": "^7.5.5", diff --git a/ui/src/app/core/log.service.ts b/ui/src/app/core/log.service.ts index 8d2ef4f46..fffd652e9 100644 --- a/ui/src/app/core/log.service.ts +++ b/ui/src/app/core/log.service.ts @@ -18,6 +18,7 @@ export class LogService { private webLinksAddon: WebLinksAddon; private resize: Subject; private elementResize: Subject | undefined; + private pluginName: string; constructor( private $ws: WsService, @@ -26,7 +27,10 @@ export class LogService { startTerminal( targetElement: ElementRef, termOpts: ITerminalOptions = {}, - elementResize?: Subject) { + elementResize?: Subject, + pluginName?: string, + ) { + this.pluginName = pluginName; // handle element resize events this.elementResize = elementResize; @@ -75,8 +79,16 @@ export class LogService { }); // subscribe to incoming data events from server to client - this.io.socket.on('stdout', data => { - this.term.write(data); + this.io.socket.on('stdout', (data: string) => { + if (this.pluginName) { + const regexPattern = new RegExp(`\\[.+?\] \\[(${pluginName})\].+?\\n`, 'g'); + (data.match(regexPattern) || []).forEach((line: string) => { + this.term.write(line + '\r'); + console.log(line); + }); + } else { + this.term.write(data); + } }); // handle resize events from the client diff --git a/ui/src/app/core/manage-plugins/manage-plugins.module.ts b/ui/src/app/core/manage-plugins/manage-plugins.module.ts index 3529e3349..2a55597a2 100644 --- a/ui/src/app/core/manage-plugins/manage-plugins.module.ts +++ b/ui/src/app/core/manage-plugins/manage-plugins.module.ts @@ -17,6 +17,7 @@ import { NodeUpdateRequiredModalComponent } from './node-update-required-modal/n import { ManualPluginConfigModalComponent } from './manual-plugin-config-modal/manual-plugin-config-modal.component'; import { SelectPreviousVersionComponent } from './select-previous-version/select-previous-version.component'; import { BridgePluginsModalComponent } from './bridge-plugins-modal/bridge-plugins-modal.component'; +import { PluginLogModalComponent } from '@/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component'; @NgModule({ declarations: [ @@ -28,6 +29,7 @@ import { BridgePluginsModalComponent } from './bridge-plugins-modal/bridge-plugi ManualPluginConfigModalComponent, SelectPreviousVersionComponent, BridgePluginsModalComponent, + PluginLogModalComponent, ], imports: [ CommonModule, diff --git a/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html new file mode 100644 index 000000000..3426bcd74 --- /dev/null +++ b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html @@ -0,0 +1,16 @@ + diff --git a/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.scss b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.ts b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.ts new file mode 100644 index 000000000..a32eb9389 --- /dev/null +++ b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.ts @@ -0,0 +1,62 @@ +import { + Component, + ElementRef, + HostListener, + Input, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { ToastrService } from 'ngx-toastr'; + +import { ApiService } from '@/app/core/api.service'; +import { TranslateService } from '@ngx-translate/core'; +import { LogService } from '@/app/core/log.service'; +import { Subject } from 'rxjs'; + +@Component({ + selector: 'app-plugin-log-modal', + templateUrl: './plugin-log-modal.component.html', + styleUrls: ['./plugin-log-modal.component.scss'], +}) +export class PluginLogModalComponent implements OnInit, OnDestroy { + @Input() plugin: any; + @ViewChild('pluginlogoutput', { static: true }) termTarget: ElementRef; + private resizeEvent = new Subject(); + + constructor( + public activeModal: NgbActiveModal, + private $api: ApiService, + private $log: LogService, + private $toastr: ToastrService, + private $translate: TranslateService, + ) { } + + ngOnInit(): void { + this.getPluginLog(); + } + + @HostListener('window:resize', ['$event']) + onWindowResize(event) { + this.resizeEvent.next(undefined); + } + + getPluginLog() { + // Get the plugin name as configured in the config file + this.$api.get(`/config-editor/plugin/${this.plugin.name}`).subscribe( + (result) => { + const logAlias = this.plugin.name === 'homebridge-config-ui-x' ? 'Homebridge UI' : result[0].name; + this.$log.startTerminal(this.termTarget, {}, this.resizeEvent, logAlias); + }, + (err) => { + this.$toastr.error(`${err.error.message || err.message}`, this.$translate.instant('toast.title_error')); + this.activeModal.dismiss(); + }, + ); + } + + ngOnDestroy() { + this.$log.destroyTerminal(); + } +} diff --git a/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html b/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html index 58bee0e16..1ffaa8896 100644 --- a/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html +++ b/ui/src/app/modules/plugins/plugin-card/plugin-card.component.html @@ -112,6 +112,10 @@

{{ 'plugins.manage.message_install_alternate_version' | translate }} + - - - diff --git a/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.ts b/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.ts index 18ca7c191..d0bc87665 100644 --- a/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.ts +++ b/ui/src/app/core/manage-plugins/custom-plugins/custom-plugins.component.ts @@ -9,6 +9,7 @@ import { environment } from '@/environments/environment'; import { ApiService } from '@/app/core/api.service'; import { WsService } from '@/app/core/ws.service'; import { NotificationService } from '@/app/core/notification.service'; +import { Router } from '@angular/router'; @Component({ selector: 'app-custom-plugins', @@ -29,8 +30,10 @@ export class CustomPluginsComponent implements OnInit, OnDestroy { public loading = true; public saveInProgress = false; + public justSavedAndExited = false; public pluginSpinner = false; public uiLoaded = false; + public childBridges: any[] = []; private basePath: string; private iframe: HTMLIFrameElement; @@ -57,6 +60,7 @@ export class CustomPluginsComponent implements OnInit, OnDestroy { private $translate: TranslateService, private $toastr: ToastrService, private $api: ApiService, + private $router: Router, private $ws: WsService, private $notification: NotificationService, ) { } @@ -402,7 +406,7 @@ export class CustomPluginsComponent implements OnInit, OnDestroy { /** * Fired when a custom form is cancelled or submitted * - * @param action + * @param formEvent */ formActionEvent(formEvent: 'cancel' | 'submit') { this.iframe.contentWindow.postMessage({ @@ -428,16 +432,17 @@ export class CustomPluginsComponent implements OnInit, OnDestroy { return await this.$api.post(`/config-editor/plugin/${encodeURIComponent(this.plugin.name)}`, this.pluginConfig) .toPromise() .then(data => { - this.$toastr.success( - this.$translate.instant('plugins.settings.toast_restart_required'), - this.$translate.instant('plugins.settings.toast_plugin_config_saved'), - ); + // this.$toastr.success( + // this.$translate.instant('plugins.settings.toast_restart_required'), + // this.$translate.instant('plugins.settings.toast_plugin_config_saved'), + // ); this.saveInProgress = false; - this.$notification.configUpdated.next(undefined); + // this.$notification.configUpdated.next(undefined); if (exit) { - this.activeModal.close(); + this.getChildBridges(); + this.justSavedAndExited = true; } }) .catch(err => { @@ -446,6 +451,47 @@ export class CustomPluginsComponent implements OnInit, OnDestroy { }); } + getChildBridges(): any[] { + try { + this.$api.get('/status/homebridge/child-bridges').subscribe((data: any[]) => { + data.forEach((bridge) => { + if (this.plugin.name === bridge.plugin) { + this.childBridges.push(bridge); + } + }); + }); + return this.childBridges; + } catch (err) { + this.$toastr.error(err.message, this.$translate.instant('toast.title_error')); + return []; + } + } + + public onRestartHomebridgeClick() { + this.$router.navigate(['/restart']); + this.activeModal.close(); + } + + public async onRestartChildBridgeClick() { + try { + for (const bridge of this.childBridges) { + await this.$api.put(`/server/restart/${bridge.username}`, {}).toPromise(); + } + this.$toastr.success( + this.$translate.instant('plugins.manage.child_bridge_restart_success'), + this.$translate.instant('toast.title_success'), + ); + } catch (err) { + this.$notification.configUpdated.next(undefined); // highlight the restart icon in the navbar + this.$toastr.error( + this.$translate.instant('plugins.manage.child_bridge_restart_failed'), + this.$translate.instant('toast.title_error'), + ); + } finally { + this.activeModal.close(); + } + } + deletePluginConfig() { this.updateConfigBlocks([]); this.savePluginConfig(true); diff --git a/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html index be638a437..81ff6bed0 100644 --- a/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html +++ b/ui/src/app/core/manage-plugins/plugin-log-modal/plugin-log-modal.component.html @@ -7,7 +7,6 @@ diff --git a/ui/src/i18n/en.json b/ui/src/i18n/en.json index ac10cc355..6ee58837f 100644 --- a/ui/src/i18n/en.json +++ b/ui/src/i18n/en.json @@ -170,7 +170,7 @@ "platform.linux.shutdown.message_server_will_power_down": "The server will power down shortly.", "platform.linux.shutdown.title_shutting_down_server": "Shutting Down Server", "platform.version.message_service_restart_required": "WARNING: Homebridge UI v{{ uiVersion }} has been installed, but the server service is still running v{{ serverVersion }}.", - "platform.version.title_service_restart_required": "Service Restart Required", + "platform.version.title_service_restart_required": "Homebridge Restart Required", "plugins.button_api_documentation": "API Documentation", "plugins.button_homepage": "Plugin Homepage", "plugins.button_install": "Install", From 71ad624427433a83fb098103dd40e3e3e555b513 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:32:04 +0000 Subject: [PATCH 27/34] consistent modal footers --- ui/.eslintrc.json | 7 ++ ui/package-lock.json | 42 +++++++++++ ui/package.json | 5 +- ui/src/app/app-routing.module.ts | 9 ++- ui/src/app/app.component.ts | 9 +-- ui/src/app/app.module.ts | 24 +++---- .../core/accessories/accessories.module.ts | 70 +++++++++---------- .../core/accessories/accessories.service.ts | 8 +-- .../accessory-tile.component.ts | 1 - .../info-modal/info-modal.component.html | 12 +++- .../info-modal/info-modal.component.ts | 2 +- .../airpurifier/airpurifier.component.ts | 3 +- .../airpurifier.manage.component.html | 4 +- .../airpurifier.manage.component.ts | 5 +- .../airqualitysensor.component.ts | 2 +- .../batteryservice.component.ts | 2 +- .../contactsensor/contactsensor.component.ts | 2 +- .../accessories/types/door/door.component.ts | 3 +- .../types/door/door.manage.component.html | 2 +- .../types/door/door.manage.component.ts | 5 +- .../accessories/types/fan/fan.component.ts | 3 +- .../types/fan/fan.manage.component.html | 4 +- .../types/fan/fan.manage.component.ts | 5 +- .../types/fanv2/fanv2.component.ts | 3 +- .../types/fanv2/fanv2.manage.component.html | 4 +- .../types/fanv2/fanv2.manage.component.ts | 5 +- .../garagedooropener.component.ts | 2 +- .../heatercooler/heatercooler.component.ts | 3 +- .../heatercooler.manage.component.html | 4 +- .../heatercooler.manage.component.ts | 5 +- .../humidifierdehumidifier.component.ts | 3 +- ...midifierdehumidifier.manage.component.html | 4 +- ...humidifierdehumidifier.manage.component.ts | 5 +- .../humiditysensor.component.ts | 2 +- .../types/leaksensor/leaksensor.component.ts | 2 +- .../types/lightbulb/lightbulb.component.ts | 3 +- .../lightbulb/lightbulb.manage.component.html | 4 +- .../lightbulb/lightbulb.manage.component.ts | 5 +- .../lightsensor/lightsensor.component.ts | 2 +- .../lockmechanism/lockmechanism.component.ts | 2 +- .../motionsensor/motionsensor.component.ts | 2 +- .../occupancysensor.component.ts | 2 +- .../types/outlet/outlet.component.ts | 2 +- .../securitysystem.component.ts | 3 +- .../securitysystem.manage.component.html | 4 +- .../securitysystem.manage.component.ts | 2 +- .../smokesensor/smokesensor.component.ts | 2 +- .../types/speaker/speaker.component.ts | 3 +- .../speaker/speaker.manage.component.html | 4 +- .../types/speaker/speaker.manage.component.ts | 5 +- .../statelessprogrammableswitch.component.ts | 2 +- .../types/switch/switch.component.ts | 2 +- .../types/television/television.component.ts | 2 +- .../temperaturesensor.component.ts | 2 +- .../types/thermostat/thermostat.component.ts | 3 +- .../thermostat.manage.component.html | 4 +- .../thermostat/thermostat.manage.component.ts | 5 +- .../types/unknown/unknown.component.ts | 2 +- .../types/valve/valve.component.ts | 12 ++-- .../types/valve/valve.manage.component.html | 4 +- .../types/valve/valve.manage.component.ts | 4 +- .../types/window/window.component.ts | 3 +- .../types/window/window.manage.component.html | 2 +- .../types/window/window.manage.component.ts | 5 +- .../windowcovering.component.ts | 3 +- .../windowcovering.manage.component.html | 4 +- .../windowcovering.manage.component.ts | 5 +- ui/src/app/core/api.service.ts | 5 +- ui/src/app/core/auth/admin.guard.ts | 10 ++- ui/src/app/core/auth/auth.guard.ts | 10 ++- ui/src/app/core/auth/auth.module.ts | 17 ++--- ui/src/app/core/auth/auth.service.ts | 3 +- .../backup-restore.component.html | 32 ++++++--- .../backup-restore.component.ts | 12 ++-- .../scheduled-backups.component.html | 26 +++---- .../scheduled-backups.component.ts | 3 +- .../components/confirm/confirm.component.html | 28 ++++---- .../components/confirm/confirm.component.ts | 9 +-- .../information/information.component.html | 25 ++++--- .../components/qrcode/qrcode.component.ts | 8 ++- .../schema-form/schema-form.component.ts | 7 +- ui/src/app/core/core.module.ts | 19 +++-- .../json-schema-form-patch.directive.ts | 12 +++- .../core/directives/longclick.directive.ts | 9 ++- ui/src/app/core/directives/rtl.directive.ts | 7 +- ui/src/app/core/locales.ts | 37 +++++----- ui/src/app/core/log.service.ts | 11 ++- .../bridge-plugins-modal.component.html | 24 +++---- .../bridge-plugins-modal.component.ts | 3 +- .../custom-plugins.component.html | 31 ++++---- .../custom-plugins.component.ts | 16 +++-- .../custom-plugins/custom-plugins.module.ts | 10 ++- .../custom-plugins/custom-plugins.service.ts | 3 +- .../homebridge-deconz.component.ts | 3 +- ...homebridge-google-smarthome.component.html | 2 +- .../homebridge-google-smarthome.component.ts | 12 ++-- .../homebridge-hue.component.ts | 3 +- .../manage-plugins-modal.component.html | 17 +++-- .../manage-plugins-modal.component.ts | 12 ++-- .../manage-plugins/manage-plugins.module.ts | 17 +++-- .../manage-plugins/manage-plugins.service.ts | 15 ++-- .../manual-plugin-config-modal.component.html | 20 +++--- .../manual-plugin-config-modal.component.ts | 5 +- .../node-update-required-modal.component.html | 34 +++++---- .../node-update-required-modal.component.ts | 5 +- .../plugin-log-modal.component.html | 2 +- .../plugin-log-modal.component.ts | 5 +- .../select-previous-version.component.html | 25 +++---- .../select-previous-version.component.ts | 3 +- .../settings-plugins-modal.component.html | 15 ++-- .../settings-plugins-modal.component.ts | 7 +- .../uninstall-plugins-modal.component.html | 24 ++++--- .../uninstall-plugins-modal.component.ts | 3 +- ui/src/app/core/mobile-detect.service.ts | 1 - ui/src/app/core/pipes/convert-temp.pipe.ts | 1 - ui/src/app/core/settings.service.ts | 5 +- ui/src/app/core/terminal.service.ts | 11 ++- ui/src/app/core/ws.service.ts | 3 +- .../accessories/accessories-routing.module.ts | 2 +- .../accessories/accessories.component.scss | 5 +- .../accessories/accessories.component.ts | 11 ++- .../modules/accessories/accessories.module.ts | 15 ++-- .../add-room-modal.component.html | 28 +++++--- .../add-room-modal.component.ts | 2 +- .../config-editor-routing.module.ts | 2 +- .../config-editor/config-editor.component.ts | 15 ++-- .../config-editor/config-editor.module.ts | 7 +- .../config-editor/config-editor.resolver.ts | 8 ++- .../config.restore-backup.component.html | 20 ++++-- .../config.restore-backup.component.ts | 3 +- ui/src/app/modules/login/login.component.ts | 7 +- ui/src/app/modules/login/login.guard.ts | 8 ++- ui/src/app/modules/login/login.module.ts | 3 +- .../app/modules/logs/logs-routing.module.ts | 2 +- ui/src/app/modules/logs/logs.component.ts | 20 ++++-- ui/src/app/modules/logs/logs.module.ts | 3 +- .../container-restart.component.ts | 5 +- .../docker/docker-routing.module.ts | 4 +- .../platform-tools/docker/docker.module.ts | 7 +- .../startup-script.component.ts | 7 +- .../startup-script/startup-script.resolver.ts | 8 ++- .../linux/linux-routing.module.ts | 2 +- .../platform-tools/linux/linux.module.ts | 3 +- .../restart-linux/restart-linux.component.ts | 5 +- .../shutdown-linux.component.ts | 5 +- .../platform-tools-routing.module.ts | 2 +- .../platform-tools/platform-tools.module.ts | 3 +- .../terminal/terminal-routing.module.ts | 2 +- .../terminal/terminal.component.ts | 10 ++- .../terminal/terminal.module.ts | 3 +- .../donate-modal/donate-modal.component.html | 30 +++++--- .../donate-modal/donate-modal.component.ts | 7 +- .../plugin-card/plugin-card.component.ts | 13 ++-- .../modules/plugins/plugins-routing.module.ts | 2 +- .../app/modules/plugins/plugins.component.ts | 11 ++- ui/src/app/modules/plugins/plugins.module.ts | 13 ++-- .../app/modules/restart/restart.component.ts | 7 +- ui/src/app/modules/restart/restart.module.ts | 5 +- ...ll-cached-accessories-modal.component.html | 24 ++++--- ...ngle-cached-accessory-modal.component.html | 16 +++-- ...single-cached-accessory-modal.component.ts | 2 +- .../reset-homebridge-modal.component.html | 21 ++++-- .../reset-homebridge-modal.component.ts | 4 +- .../select-network-interfaces.component.html | 24 ++++--- .../settings/settings-routing.module.ts | 5 +- .../modules/settings/settings.component.ts | 22 +++--- .../app/modules/settings/settings.module.ts | 17 ++--- .../unpair-accessory-modal.component.html | 16 +++-- .../unpair-accessory-modal.component.ts | 2 +- .../setup-wizard-routing.module.ts | 1 - .../setup-wizard/setup-wizard.component.ts | 14 ++-- .../setup-wizard/setup-wizard.guard.ts | 9 ++- .../setup-wizard/setup-wizard.module.ts | 7 +- ui/src/app/modules/status/status.component.ts | 13 ++-- ui/src/app/modules/status/status.module.ts | 34 +++++---- .../widget-add/widget-add.component.html | 38 +++++----- .../status/widget-add/widget-add.component.ts | 3 +- .../widget-control.component.html | 23 +++--- .../widget-control.component.ts | 12 +++- .../accessories-widget.component.ts | 12 ++-- .../child-bridge-widget.component.ts | 8 ++- .../clock-widget/clock-widget.component.ts | 7 +- .../cpu-widget/cpu-widget.component.ts | 16 +++-- .../hap-qrcode-widget.component.ts | 9 ++- .../homebridge-logs-widget.component.ts | 10 ++- .../homebridge-status-widget.component.ts | 7 +- .../memory-widget/memory-widget.component.ts | 15 ++-- .../network-widget.component.ts | 15 ++-- .../system-info-widget.component.ts | 7 +- .../terminal-widget.component.ts | 10 ++- .../uptime-widget/uptime-widget.component.ts | 7 +- .../weather-widget.component.ts | 12 ++-- .../status/widgets/widgets.component.ts | 28 +++++--- .../users/users-add/users-add.component.ts | 3 +- .../users-disable2fa.component.html | 26 ++++--- .../users-disable2fa.component.ts | 5 +- .../users/users-edit/users-edit.component.ts | 5 +- .../app/modules/users/users-routing.module.ts | 2 +- .../users-setup2fa.component.html | 23 +++--- .../users-setup2fa.component.ts | 13 ++-- ui/src/app/modules/users/users.component.ts | 9 ++- ui/src/app/modules/users/users.module.ts | 15 ++-- ui/src/app/modules/users/users.resolver.ts | 8 ++- ui/src/app/shared/layout/layout.component.ts | 23 +++--- .../restart-options-modal.component.html | 41 +++++++---- .../restart-options-modal.component.ts | 2 +- ui/src/i18n/bg.json | 2 + ui/src/i18n/ca.json | 2 + ui/src/i18n/cs.json | 2 + ui/src/i18n/de.json | 2 + ui/src/i18n/en.json | 2 + ui/src/i18n/es.json | 2 + ui/src/i18n/fr.json | 2 + ui/src/i18n/he.json | 2 + ui/src/i18n/hu.json | 2 + ui/src/i18n/id.json | 2 + ui/src/i18n/it.json | 2 + ui/src/i18n/ja.json | 2 + ui/src/i18n/ko.json | 2 + ui/src/i18n/mk.json | 2 + ui/src/i18n/nl.json | 2 + ui/src/i18n/no.json | 2 + ui/src/i18n/pl.json | 2 + ui/src/i18n/pt-BR.json | 2 + ui/src/i18n/pt.json | 2 + ui/src/i18n/ru.json | 2 + ui/src/i18n/sl.json | 2 + ui/src/i18n/sv.json | 2 + ui/src/i18n/th.json | 2 + ui/src/i18n/tr.json | 2 + ui/src/i18n/uk.json | 2 + ui/src/i18n/zh-CN.json | 2 + ui/src/i18n/zh-TW.json | 2 + ui/src/main.ts | 3 - 234 files changed, 1144 insertions(+), 880 deletions(-) diff --git a/ui/.eslintrc.json b/ui/.eslintrc.json index adba90d63..a0e6a99bf 100644 --- a/ui/.eslintrc.json +++ b/ui/.eslintrc.json @@ -19,6 +19,8 @@ "plugin:@angular-eslint/ng-cli-compat--formatting-add-on", "plugin:@angular-eslint/template/process-inline-templates" ], + "plugins": [ + "import", "import-newlines", "sort-exports"], "rules": { "@angular-eslint/component-selector": [ "error", @@ -77,7 +79,12 @@ ], "id-blacklist": "off", "id-match": "off", + "import-newlines/enforce": ["error", 3], + "import/no-extraneous-dependencies": "off", + "import/order": ["warn", { "alphabetize": { "order": "asc" }, "newlines-between": "never" }], "no-underscore-dangle": "off", + "sort-exports/sort-exports": ["warn", { "sortDir": "asc" }], + "sort-imports": ["warn", { "ignoreDeclarationSort": true }], "space-before-function-paren": "error" } }, diff --git a/ui/package-lock.json b/ui/package-lock.json index ecf82a358..7245e387d 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -67,6 +67,7 @@ "@fortawesome/fontawesome-free": "^6.4.2", "@types/emoji-js": "^3.5.2", "@types/file-saver": "^2.0.7", + "@types/lodash-es": "^4.17.11", "@types/node": "^18.18.9", "@types/qrcode": "^1.5.5", "@types/semver": "^7.5.5", @@ -77,8 +78,10 @@ "codelyzer": "^6.0.2", "eslint": "^8.53.0", "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^41.1.2", "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-sort-exports": "^0.8.0", "ts-node": "^10.9.1", "typescript": "^4.8.4" } @@ -3650,6 +3653,21 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/lodash": { + "version": "4.14.201", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.201.tgz", + "integrity": "sha512-y9euML0cim1JrykNxADLfaG0FgD1g/yTHwUs/Jg9ZIU7WKj2/4IW9Lbb1WZbvck78W/lfGXFfe+u2EGfIJXdLQ==", + "dev": true + }, + "node_modules/@types/lodash-es": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.11.tgz", + "integrity": "sha512-eCw8FYAWHt2DDl77s+AMLLzPn310LKohruumpucZI4oOFJkIgnlaJcy23OKMJxx4r9PeTF13Gv6w+jqjWQaYUg==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -7384,6 +7402,21 @@ "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" } }, + "node_modules/eslint-plugin-import-newlines": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-import-newlines/-/eslint-plugin-import-newlines-1.3.4.tgz", + "integrity": "sha512-Lmf/BbK+EQKUfjKPcZpslE/KTGYlgaI8ZJ/sYzdbb3BVTg5+GmLBLHBjsUKNEVRM1SEhDTF/didtOSYKi4tSnQ==", + "dev": true, + "bin": { + "import-linter": "lib/index.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, "node_modules/eslint-plugin-import/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -7479,6 +7512,15 @@ "eslint": ">=2.0.0" } }, + "node_modules/eslint-plugin-sort-exports": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sort-exports/-/eslint-plugin-sort-exports-0.8.0.tgz", + "integrity": "sha512-5x7kJNjIS5bSyehFJ6Gk2gh2wUPt/rmhwDHF8JPDicSH7bvrLRFdlkhHu74YqYBjEySHYaOZVoKNP90TjI0v6w==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", diff --git a/ui/package.json b/ui/package.json index 08221e920..07b36e2ae 100644 --- a/ui/package.json +++ b/ui/package.json @@ -7,7 +7,7 @@ "ng": "ng", "start": "ng serve", "build": "ng build --configuration production --output-path=../public --source-map=false --aot=true", - "lint": "ng lint" + "lint": "ng lint --fix" }, "private": true, "dependencies": { @@ -69,6 +69,7 @@ "@fortawesome/fontawesome-free": "^6.4.2", "@types/emoji-js": "^3.5.2", "@types/file-saver": "^2.0.7", + "@types/lodash-es": "^4.17.11", "@types/node": "^18.18.9", "@types/qrcode": "^1.5.5", "@types/semver": "^7.5.5", @@ -79,8 +80,10 @@ "codelyzer": "^6.0.2", "eslint": "^8.53.0", "eslint-plugin-import": "^2.29.0", + "eslint-plugin-import-newlines": "^1.3.4", "eslint-plugin-jsdoc": "^41.1.2", "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-sort-exports": "^0.8.0", "ts-node": "^10.9.1", "typescript": "^4.8.4" }, diff --git a/ui/src/app/app-routing.module.ts b/ui/src/app/app-routing.module.ts index 083715a25..ea035624d 100644 --- a/ui/src/app/app-routing.module.ts +++ b/ui/src/app/app-routing.module.ts @@ -1,19 +1,18 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -import { AuthGuard } from '@/app/core/auth/auth.guard'; +import { RouterModule, Routes } from '@angular/router'; import { AdminGuard } from '@/app/core/auth/admin.guard'; +import { AuthGuard } from '@/app/core/auth/auth.guard'; import { LoginComponent } from '@/app/modules/login/login.component'; import { LoginGuard } from '@/app/modules/login/login.guard'; +import { RestartComponent } from '@/app/modules/restart/restart.component'; import { SetupWizardGuard } from '@/app/modules/setup-wizard/setup-wizard.guard'; +import { StatusComponent } from '@/app/modules/status/status.component'; import { LayoutComponent } from '@/app/shared/layout/layout.component'; /* * The status and restart modules should not be lazy loaded * to ensure restarts after an update go smoothly */ -import { RestartComponent } from '@/app/modules/restart/restart.component'; -import { StatusComponent } from '@/app/modules/status/status.component'; const routes: Routes = [ { diff --git a/ui/src/app/app.component.ts b/ui/src/app/app.component.ts index cfc370ac2..004cdd256 100644 --- a/ui/src/app/app.component.ts +++ b/ui/src/app/app.component.ts @@ -1,7 +1,6 @@ import { Component } from '@angular/core'; -import { Router, NavigationEnd } from '@angular/router'; +import { NavigationEnd, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; - import { SettingsService } from '@/app/core/settings.service'; @Component({ @@ -57,11 +56,7 @@ export class AppComponent { // watch for lang changes translate.onLangChange.subscribe(() => { - if (rtlLanguages.includes(translate.currentLang)) { - $settings.rtl = true; - } else { - $settings.rtl = false; - } + $settings.rtl = rtlLanguages.includes(translate.currentLang); }); const browserLang = languages.find(x => x === translate.getBrowserLang() || x === translate.getBrowserCultureLang()); diff --git a/ui/src/app/app.module.ts b/ui/src/app/app.module.ts index de649d6a5..efbc158dd 100644 --- a/ui/src/app/app.module.ts +++ b/ui/src/app/app.module.ts @@ -1,24 +1,22 @@ +import { HttpClientModule } from '@angular/common/http'; +import { LOCALE_ID, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { HttpClientModule } from '@angular/common/http'; -import { NgModule, LOCALE_ID } from '@angular/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { ToastrModule } from 'ngx-toastr'; import { TranslateModule, TranslateService } from '@ngx-translate/core'; -import { MonacoEditorModule } from 'ngx-monaco-editor'; import { DragulaModule } from 'ng2-dragula'; - -import { CoreModule } from '@/app/core/core.module'; -import { AuthModule } from '@/app/core/auth/auth.module'; -import { onMonacoLoad } from '@/app/core/monaco-editor.service'; -import { supportedLocales } from '@/app/core/locales'; - -import { AppComponent } from './app.component'; +import { MonacoEditorModule } from 'ngx-monaco-editor'; +import { ToastrModule } from 'ngx-toastr'; import { AppRoutingModule } from './app-routing.module'; -import { LayoutComponent } from './shared/layout/layout.component'; +import { AppComponent } from './app.component'; +import { LoginModule } from './modules/login/login.module'; import { RestartModule } from './modules/restart/restart.module'; import { StatusModule } from './modules/status/status.module'; -import { LoginModule } from './modules/login/login.module'; +import { LayoutComponent } from './shared/layout/layout.component'; +import { AuthModule } from '@/app/core/auth/auth.module'; +import { CoreModule } from '@/app/core/core.module'; +import { supportedLocales } from '@/app/core/locales'; +import { onMonacoLoad } from '@/app/core/monaco-editor.service'; import { RestartOptionsModalComponent } from '@/app/shared/layout/restart-options-modal/restart-options-modal.component'; @NgModule({ diff --git a/ui/src/app/core/accessories/accessories.module.ts b/ui/src/app/core/accessories/accessories.module.ts index 94fa94cb5..bda482932 100644 --- a/ui/src/app/core/accessories/accessories.module.ts +++ b/ui/src/app/core/accessories/accessories.module.ts @@ -1,61 +1,59 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { NgxMdModule } from 'ngx-md'; import { InlineSVGModule } from 'ng-inline-svg'; import { NouisliderModule } from 'ng2-nouislider'; - -import { CoreModule } from '@/app/core/core.module'; +import { NgxMdModule } from 'ngx-md'; import { AccessoriesService } from './accessories.service'; - -import { SwitchComponent } from './types/switch/switch.component'; -import { StatelessprogrammableswitchComponent } from './types/statelessprogrammableswitch/statelessprogrammableswitch.component'; -import { ThermostatComponent } from './types/thermostat/thermostat.component'; -import { ThermostatManageComponent } from './types/thermostat/thermostat.manage.component'; -import { OutletComponent } from './types/outlet/outlet.component'; +import { AccessoryTileComponent } from './accessory-tile/accessory-tile.component'; +import { InfoModalComponent } from './info-modal/info-modal.component'; +import { AirpurifierComponent } from './types/airpurifier/airpurifier.component'; +import { AirpurifierManageComponent } from './types/airpurifier/airpurifier.manage.component'; +import { AirqualitysensorComponent } from './types/airqualitysensor/airqualitysensor.component'; +import { BatteryserviceComponent } from './types/batteryservice/batteryservice.component'; +import { ContactsensorComponent } from './types/contactsensor/contactsensor.component'; +import { DoorComponent } from './types/door/door.component'; +import { DoorManageComponent } from './types/door/door.manage.component'; import { FanComponent } from './types/fan/fan.component'; import { FanManageComponent } from './types/fan/fan.manage.component'; import { Fanv2Component } from './types/fanv2/fanv2.component'; import { Fanv2ManageComponent } from './types/fanv2/fanv2.manage.component'; -import { UnknownComponent } from './types/unknown/unknown.component'; +import { GaragedooropenerComponent } from './types/garagedooropener/garagedooropener.component'; +import { HeaterCoolerComponent } from './types/heatercooler/heatercooler.component'; +import { HeaterCoolerManageComponent } from './types/heatercooler/heatercooler.manage.component'; +import { HumidifierDehumidifierComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.component'; +import { HumidifierDehumidifierManageComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.manage.component'; +import { HumiditysensorComponent } from './types/humiditysensor/humiditysensor.component'; +import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsystem.component'; +import { LeaksensorComponent } from './types/leaksensor/leaksensor.component'; import { LightbulbComponent } from './types/lightbulb/lightbulb.component'; import { LightbulbManageComponent } from './types/lightbulb/lightbulb.manage.component'; import { LightsensorComponent } from './types/lightsensor/lightsensor.component'; import { LockmechanismComponent } from './types/lockmechanism/lockmechanism.component'; -import { TemperaturesensorComponent } from './types/temperaturesensor/temperaturesensor.component'; -import { GaragedooropenerComponent } from './types/garagedooropener/garagedooropener.component'; import { MotionsensorComponent } from './types/motionsensor/motionsensor.component'; import { OccupancysensorComponent } from './types/occupancysensor/occupancysensor.component'; -import { HumiditysensorComponent } from './types/humiditysensor/humiditysensor.component'; -import { AirqualitysensorComponent } from './types/airqualitysensor/airqualitysensor.component'; -import { WindowcoveringComponent } from './types/windowcovering/windowcovering.component'; -import { WindowcoveringManageComponent } from './types/windowcovering/windowcovering.manage.component'; -import { WindowComponent } from './types/window/window.component'; -import { WindowManageComponent } from './types/window/window.manage.component'; -import { DoorComponent } from './types/door/door.component'; -import { DoorManageComponent } from './types/door/door.manage.component'; -import { TelevisionComponent } from './types/television/television.component'; -import { ContactsensorComponent } from './types/contactsensor/contactsensor.component'; -import { BatteryserviceComponent } from './types/batteryservice/batteryservice.component'; -import { SpeakerComponent } from './types/speaker/speaker.component'; -import { SpeakerManageComponent } from './types/speaker/speaker.manage.component'; +import { OutletComponent } from './types/outlet/outlet.component'; import { SecuritysystemComponent } from './types/securitysystem/securitysystem.component'; import { SecuritysystemManageComponent } from './types/securitysystem/securitysystem.manage.component'; -import { LeaksensorComponent } from './types/leaksensor/leaksensor.component'; import { SmokesensorComponent } from './types/smokesensor/smokesensor.component'; +import { SpeakerComponent } from './types/speaker/speaker.component'; +import { SpeakerManageComponent } from './types/speaker/speaker.manage.component'; +import { StatelessprogrammableswitchComponent } from './types/statelessprogrammableswitch/statelessprogrammableswitch.component'; +import { SwitchComponent } from './types/switch/switch.component'; +import { TelevisionComponent } from './types/television/television.component'; +import { TemperaturesensorComponent } from './types/temperaturesensor/temperaturesensor.component'; +import { ThermostatComponent } from './types/thermostat/thermostat.component'; +import { ThermostatManageComponent } from './types/thermostat/thermostat.manage.component'; +import { UnknownComponent } from './types/unknown/unknown.component'; import { ValveComponent } from './types/valve/valve.component'; import { ValveManageComponent } from './types/valve/valve.manage.component'; -import { IrrigationSystemComponent } from './types/irrigationsystem/irrigationsystem.component'; -import { AirpurifierComponent } from './types/airpurifier/airpurifier.component'; -import { AirpurifierManageComponent } from './types/airpurifier/airpurifier.manage.component'; -import { HeaterCoolerComponent } from './types/heatercooler/heatercooler.component'; -import { HeaterCoolerManageComponent } from './types/heatercooler/heatercooler.manage.component'; -import { HumidifierDehumidifierComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.component'; -import { HumidifierDehumidifierManageComponent } from './types/humidifierdehumidifier/humidifierdehumidifier.manage.component'; -import { InfoModalComponent } from './info-modal/info-modal.component'; -import { AccessoryTileComponent } from './accessory-tile/accessory-tile.component'; +import { WindowComponent } from './types/window/window.component'; +import { WindowManageComponent } from './types/window/window.manage.component'; +import { WindowcoveringComponent } from './types/windowcovering/windowcovering.component'; +import { WindowcoveringManageComponent } from './types/windowcovering/windowcovering.manage.component'; +import { CoreModule } from '@/app/core/core.module'; @NgModule({ declarations: [ diff --git a/ui/src/app/core/accessories/accessories.service.ts b/ui/src/app/core/accessories/accessories.service.ts index d51f61588..f1bd00451 100644 --- a/ui/src/app/core/accessories/accessories.service.ts +++ b/ui/src/app/core/accessories/accessories.service.ts @@ -1,12 +1,11 @@ import { Injectable } from '@angular/core'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceType } from '@oznu/hap-client'; import { ToastrService } from 'ngx-toastr'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { Subject } from 'rxjs'; - -import { WsService, IoNamespace } from '../ws.service'; -import { AuthService } from '../auth/auth.service'; import { ApiService } from '../api.service'; +import { AuthService } from '../auth/auth.service'; +import { IoNamespace, WsService } from '../ws.service'; import { ServiceTypeX } from './accessories.interfaces'; import { InfoModalComponent } from './info-modal/info-modal.component'; @@ -320,5 +319,4 @@ export class AccessoriesService { this.roomsOrdered = false; delete this.accessoryLayout; } - } diff --git a/ui/src/app/core/accessories/accessory-tile/accessory-tile.component.ts b/ui/src/app/core/accessories/accessory-tile/accessory-tile.component.ts index f5ef6094f..dedb98a0a 100644 --- a/ui/src/app/core/accessories/accessory-tile/accessory-tile.component.ts +++ b/ui/src/app/core/accessories/accessory-tile/accessory-tile.component.ts @@ -16,5 +16,4 @@ export class AccessoryTileComponent implements OnInit { ngOnInit(): void { } - } diff --git a/ui/src/app/core/accessories/info-modal/info-modal.component.html b/ui/src/app/core/accessories/info-modal/info-modal.component.html index 502a8a4f0..cf54515bd 100644 --- a/ui/src/app/core/accessories/info-modal/info-modal.component.html +++ b/ui/src/app/core/accessories/info-modal/info-modal.component.html @@ -1,8 +1,7 @@ - \ No newline at end of file + + diff --git a/ui/src/app/core/accessories/info-modal/info-modal.component.ts b/ui/src/app/core/accessories/info-modal/info-modal.component.ts index 1691fdd03..c29688fd7 100644 --- a/ui/src/app/core/accessories/info-modal/info-modal.component.ts +++ b/ui/src/app/core/accessories/info-modal/info-modal.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '@/app/core/accessories/accessories.interfaces'; diff --git a/ui/src/app/core/accessories/types/airpurifier/airpurifier.component.ts b/ui/src/app/core/accessories/types/airpurifier/airpurifier.component.ts index 00453509f..18c50c823 100644 --- a/ui/src/app/core/accessories/types/airpurifier/airpurifier.component.ts +++ b/ui/src/app/core/accessories/types/airpurifier/airpurifier.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { AirpurifierManageComponent } from './airpurifier.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.html b/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.html index 776f6099b..fd62c300b 100644 --- a/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.html +++ b/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.html @@ -2,7 +2,7 @@ @@ -33,4 +33,4 @@
{{ 'accessories.control.label_rotation_speed' | translate }} - \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.ts b/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.ts index 98d65c89a..aa4a7a445 100644 --- a/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.ts +++ b/ui/src/app/core/accessories/types/airpurifier/airpurifier.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-airpurifier-manage', diff --git a/ui/src/app/core/accessories/types/airqualitysensor/airqualitysensor.component.ts b/ui/src/app/core/accessories/types/airqualitysensor/airqualitysensor.component.ts index 5f1723509..fa3d08e6d 100644 --- a/ui/src/app/core/accessories/types/airqualitysensor/airqualitysensor.component.ts +++ b/ui/src/app/core/accessories/types/airqualitysensor/airqualitysensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/batteryservice/batteryservice.component.ts b/ui/src/app/core/accessories/types/batteryservice/batteryservice.component.ts index feacfff8d..c2b36dec0 100644 --- a/ui/src/app/core/accessories/types/batteryservice/batteryservice.component.ts +++ b/ui/src/app/core/accessories/types/batteryservice/batteryservice.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/contactsensor/contactsensor.component.ts b/ui/src/app/core/accessories/types/contactsensor/contactsensor.component.ts index 3d8f4f502..21fb8186a 100644 --- a/ui/src/app/core/accessories/types/contactsensor/contactsensor.component.ts +++ b/ui/src/app/core/accessories/types/contactsensor/contactsensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/door/door.component.ts b/ui/src/app/core/accessories/types/door/door.component.ts index eb6aea236..45c524a01 100644 --- a/ui/src/app/core/accessories/types/door/door.component.ts +++ b/ui/src/app/core/accessories/types/door/door.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { DoorManageComponent } from './door.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/door/door.manage.component.html b/ui/src/app/core/accessories/types/door/door.manage.component.html index b9297b831..6d7a2dc18 100644 --- a/ui/src/app/core/accessories/types/door/door.manage.component.html +++ b/ui/src/app/core/accessories/types/door/door.manage.component.html @@ -2,7 +2,7 @@ diff --git a/ui/src/app/core/accessories/types/door/door.manage.component.ts b/ui/src/app/core/accessories/types/door/door.manage.component.ts index fcaf6ee8b..be8f4ab5b 100644 --- a/ui/src/app/core/accessories/types/door/door.manage.component.ts +++ b/ui/src/app/core/accessories/types/door/door.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-door-manage', diff --git a/ui/src/app/core/accessories/types/fan/fan.component.ts b/ui/src/app/core/accessories/types/fan/fan.component.ts index 56e04f41f..535b182e7 100644 --- a/ui/src/app/core/accessories/types/fan/fan.component.ts +++ b/ui/src/app/core/accessories/types/fan/fan.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { FanManageComponent } from './fan.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/fan/fan.manage.component.html b/ui/src/app/core/accessories/types/fan/fan.manage.component.html index a6be9f8e8..466670101 100644 --- a/ui/src/app/core/accessories/types/fan/fan.manage.component.html +++ b/ui/src/app/core/accessories/types/fan/fan.manage.component.html @@ -2,7 +2,7 @@ @@ -34,4 +34,4 @@
{{ 'accessories.control.label_rotation_speed' | translate }} - \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/fan/fan.manage.component.ts b/ui/src/app/core/accessories/types/fan/fan.manage.component.ts index 1fc4ca4a6..aec170939 100644 --- a/ui/src/app/core/accessories/types/fan/fan.manage.component.ts +++ b/ui/src/app/core/accessories/types/fan/fan.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-fan-manage', diff --git a/ui/src/app/core/accessories/types/fanv2/fanv2.component.ts b/ui/src/app/core/accessories/types/fanv2/fanv2.component.ts index 4e47a9769..59ab69cd9 100644 --- a/ui/src/app/core/accessories/types/fanv2/fanv2.component.ts +++ b/ui/src/app/core/accessories/types/fanv2/fanv2.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { Fanv2ManageComponent } from './fanv2.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.html b/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.html index 43f58c172..14ace7fea 100644 --- a/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.html +++ b/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.html @@ -2,7 +2,7 @@ @@ -34,4 +34,4 @@
{{ 'accessories.control.label_rotation_speed' | translate }} - \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.ts b/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.ts index 7e74d32aa..ed2ae1919 100644 --- a/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.ts +++ b/ui/src/app/core/accessories/types/fanv2/fanv2.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-fanv2-manage', diff --git a/ui/src/app/core/accessories/types/garagedooropener/garagedooropener.component.ts b/ui/src/app/core/accessories/types/garagedooropener/garagedooropener.component.ts index c77c24bb4..b7717425b 100644 --- a/ui/src/app/core/accessories/types/garagedooropener/garagedooropener.component.ts +++ b/ui/src/app/core/accessories/types/garagedooropener/garagedooropener.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/heatercooler/heatercooler.component.ts b/ui/src/app/core/accessories/types/heatercooler/heatercooler.component.ts index 5ecafae76..d9af0dd8e 100644 --- a/ui/src/app/core/accessories/types/heatercooler/heatercooler.component.ts +++ b/ui/src/app/core/accessories/types/heatercooler/heatercooler.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { HeaterCoolerManageComponent } from './heatercooler.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.html b/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.html index 7fcda58d4..c3e7f87ab 100644 --- a/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.html +++ b/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.html @@ -2,7 +2,7 @@ @@ -63,4 +63,4 @@
{{ 'accessories.control.label_target_temperature' | translate }}
- \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.ts b/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.ts index 15cc52f02..ff4d17603 100644 --- a/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.ts +++ b/ui/src/app/core/accessories/types/heatercooler/heatercooler.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-heatercooler-manage', diff --git a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.component.ts b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.component.ts index fe94fba22..5423dabe6 100644 --- a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.component.ts +++ b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { HumidifierDehumidifierManageComponent } from './humidifierdehumidifier.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.html b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.html index 61d898a68..5bd80ec8e 100644 --- a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.html +++ b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.html @@ -2,7 +2,7 @@ @@ -65,4 +65,4 @@
{{ 'accessories.control.label_target_humidity' | translate }}
- \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.ts b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.ts index 262eb9e62..56f97a7e7 100644 --- a/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.ts +++ b/ui/src/app/core/accessories/types/humidifierdehumidifier/humidifierdehumidifier.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-humidifierdehumidifier-manage', diff --git a/ui/src/app/core/accessories/types/humiditysensor/humiditysensor.component.ts b/ui/src/app/core/accessories/types/humiditysensor/humiditysensor.component.ts index ed7acf3e4..9f04d7f6e 100644 --- a/ui/src/app/core/accessories/types/humiditysensor/humiditysensor.component.ts +++ b/ui/src/app/core/accessories/types/humiditysensor/humiditysensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/leaksensor/leaksensor.component.ts b/ui/src/app/core/accessories/types/leaksensor/leaksensor.component.ts index 69a91d857..7704a7b17 100644 --- a/ui/src/app/core/accessories/types/leaksensor/leaksensor.component.ts +++ b/ui/src/app/core/accessories/types/leaksensor/leaksensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/lightbulb/lightbulb.component.ts b/ui/src/app/core/accessories/types/lightbulb/lightbulb.component.ts index fca9bcf1d..1d59eecea 100644 --- a/ui/src/app/core/accessories/types/lightbulb/lightbulb.component.ts +++ b/ui/src/app/core/accessories/types/lightbulb/lightbulb.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { LightbulbManageComponent } from './lightbulb.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.html b/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.html index 33055c32a..999cd0836 100644 --- a/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.html +++ b/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.html @@ -2,7 +2,7 @@ @@ -34,4 +34,4 @@
{{ 'accessories.control.label_brightness' | translate }}
- \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.ts b/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.ts index 3b13e081f..45b201473 100644 --- a/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.ts +++ b/ui/src/app/core/accessories/types/lightbulb/lightbulb.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-lightbulb-manage', diff --git a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts index 0553d7e1e..82ee865bb 100644 --- a/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts +++ b/ui/src/app/core/accessories/types/lightsensor/lightsensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/lockmechanism/lockmechanism.component.ts b/ui/src/app/core/accessories/types/lockmechanism/lockmechanism.component.ts index a6ee068d8..b69c82bdf 100644 --- a/ui/src/app/core/accessories/types/lockmechanism/lockmechanism.component.ts +++ b/ui/src/app/core/accessories/types/lockmechanism/lockmechanism.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/motionsensor/motionsensor.component.ts b/ui/src/app/core/accessories/types/motionsensor/motionsensor.component.ts index 83ad7d7c6..da3c41a3b 100644 --- a/ui/src/app/core/accessories/types/motionsensor/motionsensor.component.ts +++ b/ui/src/app/core/accessories/types/motionsensor/motionsensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/occupancysensor/occupancysensor.component.ts b/ui/src/app/core/accessories/types/occupancysensor/occupancysensor.component.ts index 72d71a7dc..f6cd0a53e 100644 --- a/ui/src/app/core/accessories/types/occupancysensor/occupancysensor.component.ts +++ b/ui/src/app/core/accessories/types/occupancysensor/occupancysensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/outlet/outlet.component.ts b/ui/src/app/core/accessories/types/outlet/outlet.component.ts index 8bb6b30db..d2dbc7eed 100644 --- a/ui/src/app/core/accessories/types/outlet/outlet.component.ts +++ b/ui/src/app/core/accessories/types/outlet/outlet.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/securitysystem/securitysystem.component.ts b/ui/src/app/core/accessories/types/securitysystem/securitysystem.component.ts index 38d491b7e..0b804d662 100644 --- a/ui/src/app/core/accessories/types/securitysystem/securitysystem.component.ts +++ b/ui/src/app/core/accessories/types/securitysystem/securitysystem.component.ts @@ -1,6 +1,5 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; - import { ServiceTypeX } from '../../accessories.interfaces'; import { SecuritysystemManageComponent } from './securitysystem.manage.component'; diff --git a/ui/src/app/core/accessories/types/securitysystem/securitysystem.manage.component.html b/ui/src/app/core/accessories/types/securitysystem/securitysystem.manage.component.html index 9c06dc856..752bdc866 100644 --- a/ui/src/app/core/accessories/types/securitysystem/securitysystem.manage.component.html +++ b/ui/src/app/core/accessories/types/securitysystem/securitysystem.manage.component.html @@ -2,7 +2,7 @@ @@ -25,4 +25,4 @@
{{ 'accessories.control.label_speaker_volume' | translate }} - \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/speaker/speaker.manage.component.ts b/ui/src/app/core/accessories/types/speaker/speaker.manage.component.ts index d7713324b..18f682d04 100644 --- a/ui/src/app/core/accessories/types/speaker/speaker.manage.component.ts +++ b/ui/src/app/core/accessories/types/speaker/speaker.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-speaker-manage', diff --git a/ui/src/app/core/accessories/types/statelessprogrammableswitch/statelessprogrammableswitch.component.ts b/ui/src/app/core/accessories/types/statelessprogrammableswitch/statelessprogrammableswitch.component.ts index d92aaab45..02ec9a730 100644 --- a/ui/src/app/core/accessories/types/statelessprogrammableswitch/statelessprogrammableswitch.component.ts +++ b/ui/src/app/core/accessories/types/statelessprogrammableswitch/statelessprogrammableswitch.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/switch/switch.component.ts b/ui/src/app/core/accessories/types/switch/switch.component.ts index 638658bba..4cd065023 100644 --- a/ui/src/app/core/accessories/types/switch/switch.component.ts +++ b/ui/src/app/core/accessories/types/switch/switch.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/television/television.component.ts b/ui/src/app/core/accessories/types/television/television.component.ts index 086f5705d..be9c451a4 100644 --- a/ui/src/app/core/accessories/types/television/television.component.ts +++ b/ui/src/app/core/accessories/types/television/television.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/temperaturesensor/temperaturesensor.component.ts b/ui/src/app/core/accessories/types/temperaturesensor/temperaturesensor.component.ts index 3ac6f7234..6ac628ebc 100644 --- a/ui/src/app/core/accessories/types/temperaturesensor/temperaturesensor.component.ts +++ b/ui/src/app/core/accessories/types/temperaturesensor/temperaturesensor.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/thermostat/thermostat.component.ts b/ui/src/app/core/accessories/types/thermostat/thermostat.component.ts index b1cc457b0..83a468a52 100644 --- a/ui/src/app/core/accessories/types/thermostat/thermostat.component.ts +++ b/ui/src/app/core/accessories/types/thermostat/thermostat.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { ThermostatManageComponent } from './thermostat.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.html b/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.html index 1bf646d5f..c7d727d03 100644 --- a/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.html +++ b/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.html @@ -2,7 +2,7 @@ @@ -39,4 +39,4 @@
{{ 'accessories.control.label_target_temperature' | translate }}
- \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.ts b/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.ts index e7001d36a..16c22f879 100644 --- a/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.ts +++ b/ui/src/app/core/accessories/types/thermostat/thermostat.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-thermostat-manage', diff --git a/ui/src/app/core/accessories/types/unknown/unknown.component.ts b/ui/src/app/core/accessories/types/unknown/unknown.component.ts index 46c0e6fcf..b31773bfe 100644 --- a/ui/src/app/core/accessories/types/unknown/unknown.component.ts +++ b/ui/src/app/core/accessories/types/unknown/unknown.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ diff --git a/ui/src/app/core/accessories/types/valve/valve.component.ts b/ui/src/app/core/accessories/types/valve/valve.component.ts index 98c0a4082..16887d61c 100644 --- a/ui/src/app/core/accessories/types/valve/valve.component.ts +++ b/ui/src/app/core/accessories/types/valve/valve.component.ts @@ -1,10 +1,14 @@ -import { Component, OnInit, Input, OnDestroy, OnChanges } from '@angular/core'; +import { + Component, + Input, + OnDestroy, + OnInit, +} from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { Subscription, interval } from 'rxjs'; +import { filter } from 'rxjs/operators'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { ValveManageComponent } from './valve.manage.component'; -import { interval, Subscription } from 'rxjs'; -import { filter } from 'rxjs/operators'; @Component({ selector: 'app-valve', diff --git a/ui/src/app/core/accessories/types/valve/valve.manage.component.html b/ui/src/app/core/accessories/types/valve/valve.manage.component.html index 1d8ad3886..dfaf834ed 100644 --- a/ui/src/app/core/accessories/types/valve/valve.manage.component.html +++ b/ui/src/app/core/accessories/types/valve/valve.manage.component.html @@ -3,7 +3,7 @@ @@ -16,4 +16,4 @@ diff --git a/ui/src/app/core/accessories/types/window/window.manage.component.ts b/ui/src/app/core/accessories/types/window/window.manage.component.ts index aad6b8faf..a06db1b0e 100644 --- a/ui/src/app/core/accessories/types/window/window.manage.component.ts +++ b/ui/src/app/core/accessories/types/window/window.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-window-manage', diff --git a/ui/src/app/core/accessories/types/windowcovering/windowcovering.component.ts b/ui/src/app/core/accessories/types/windowcovering/windowcovering.component.ts index 73ab97218..53ed63999 100644 --- a/ui/src/app/core/accessories/types/windowcovering/windowcovering.component.ts +++ b/ui/src/app/core/accessories/types/windowcovering/windowcovering.component.ts @@ -1,7 +1,6 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { ServiceTypeX } from '../../accessories.interfaces'; - import { WindowcoveringManageComponent } from './windowcovering.manage.component'; @Component({ diff --git a/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.html b/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.html index 768c67106..6efd3dcde 100644 --- a/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.html +++ b/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.html @@ -2,7 +2,7 @@ @@ -32,4 +32,4 @@
- \ No newline at end of file + diff --git a/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.ts b/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.ts index e5ef5742c..7ce61b599 100644 --- a/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.ts +++ b/ui/src/app/core/accessories/types/windowcovering/windowcovering.manage.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { ServiceTypeX } from '../../accessories.interfaces'; - import { Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { ServiceTypeX } from '../../accessories.interfaces'; @Component({ selector: 'app-windowcovering-manage', diff --git a/ui/src/app/core/api.service.ts b/ui/src/app/core/api.service.ts index af5be53ef..730ef4bd3 100644 --- a/ui/src/app/core/api.service.ts +++ b/ui/src/app/core/api.service.ts @@ -1,8 +1,7 @@ -import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; - -import { environment } from '@/environments/environment'; +import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; +import { environment } from '@/environments/environment'; @Injectable({ providedIn: 'root', diff --git a/ui/src/app/core/auth/admin.guard.ts b/ui/src/app/core/auth/admin.guard.ts index 9f07c168b..35f53b507 100644 --- a/ui/src/app/core/auth/admin.guard.ts +++ b/ui/src/app/core/auth/admin.guard.ts @@ -1,8 +1,12 @@ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; -import { Observable } from 'rxjs'; +import { +ActivatedRouteSnapshot, +CanActivate, +Router, +RouterStateSnapshot, +} from '@angular/router'; import { ToastrService } from 'ngx-toastr'; - +import { Observable } from 'rxjs'; import { AuthService } from './auth.service'; @Injectable({ diff --git a/ui/src/app/core/auth/auth.guard.ts b/ui/src/app/core/auth/auth.guard.ts index d30a92178..c9e533e3f 100644 --- a/ui/src/app/core/auth/auth.guard.ts +++ b/ui/src/app/core/auth/auth.guard.ts @@ -1,8 +1,12 @@ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; - -import { SettingsService } from '@/app/core/settings.service'; +import { + ActivatedRouteSnapshot, + CanActivate, + Router, + RouterStateSnapshot, +} from '@angular/router'; import { AuthService } from './auth.service'; +import { SettingsService } from '@/app/core/settings.service'; @Injectable({ providedIn: 'root', diff --git a/ui/src/app/core/auth/auth.module.ts b/ui/src/app/core/auth/auth.module.ts index 69470a17b..aa8acd713 100644 --- a/ui/src/app/core/auth/auth.module.ts +++ b/ui/src/app/core/auth/auth.module.ts @@ -1,16 +1,14 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { JwtModule } from '@auth0/angular-jwt'; import { TranslateModule } from '@ngx-translate/core'; - -import { environment } from '@/environments/environment'; -import { AuthService } from './auth.service'; -import { AuthGuard } from './auth.guard'; import { AdminGuard } from './admin.guard'; +import { AuthGuard } from './auth.guard'; +import { AuthService } from './auth.service'; +import { environment } from '@/environments/environment'; -// token getter -export const tokenGetter = () => localStorage.getItem(environment.jwt.tokenKey); +const tokenGetter = () => localStorage.getItem(environment.jwt.tokenKey); @NgModule({ imports: [ @@ -35,4 +33,7 @@ export const tokenGetter = () => localStorage.getItem(environment.jwt.tokenKey); ], exports: [], }) -export class AuthModule { } +class AuthModule { } + +// token getter +export { AuthModule, tokenGetter }; diff --git a/ui/src/app/core/auth/auth.service.ts b/ui/src/app/core/auth/auth.service.ts index 56b8c1795..15acf0e95 100644 --- a/ui/src/app/core/auth/auth.service.ts +++ b/ui/src/app/core/auth/auth.service.ts @@ -1,10 +1,9 @@ import { Injectable } from '@angular/core'; import { JwtHelperService } from '@auth0/angular-jwt'; import * as dayjs from 'dayjs'; - -import { environment } from '@/environments/environment'; import { ApiService } from '@/app/core/api.service'; import { SettingsService } from '@/app/core/settings.service'; +import { environment } from '@/environments/environment'; interface UserInterface { username?: string; diff --git a/ui/src/app/core/backup-restore/backup-restore.component.html b/ui/src/app/core/backup-restore/backup-restore.component.html index 4809ef947..54389b513 100644 --- a/ui/src/app/core/backup-restore/backup-restore.component.html +++ b/ui/src/app/core/backup-restore/backup-restore.component.html @@ -1,8 +1,7 @@ - diff --git a/ui/src/app/core/backup-restore/scheduled-backups/scheduled-backups.component.ts b/ui/src/app/core/backup-restore/scheduled-backups/scheduled-backups.component.ts index a220fefac..e09229f87 100644 --- a/ui/src/app/core/backup-restore/scheduled-backups/scheduled-backups.component.ts +++ b/ui/src/app/core/backup-restore/scheduled-backups/scheduled-backups.component.ts @@ -1,9 +1,8 @@ import { Component, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; -import { ToastrService } from 'ngx-toastr'; import { saveAs } from 'file-saver'; - +import { ToastrService } from 'ngx-toastr'; import { ApiService } from '@/app/core/api.service'; @Component({ diff --git a/ui/src/app/core/components/confirm/confirm.component.html b/ui/src/app/core/components/confirm/confirm.component.html index 0a9c12ffe..ec49c40c1 100644 --- a/ui/src/app/core/components/confirm/confirm.component.html +++ b/ui/src/app/core/components/confirm/confirm.component.html @@ -1,20 +1,24 @@ -
- -
+
diff --git a/ui/src/app/core/manage-plugins/settings-plugins-modal/settings-plugins-modal.component.ts b/ui/src/app/core/manage-plugins/settings-plugins-modal/settings-plugins-modal.component.ts index 4e9fe81d1..182710103 100644 --- a/ui/src/app/core/manage-plugins/settings-plugins-modal/settings-plugins-modal.component.ts +++ b/ui/src/app/core/manage-plugins/settings-plugins-modal/settings-plugins-modal.component.ts @@ -1,12 +1,11 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; import { v4 as uuid } from 'uuid'; - import { ApiService } from '@/app/core/api.service'; -import { SettingsService } from '@/app/core/settings.service'; import { NotificationService } from '@/app/core/notification.service'; +import { SettingsService } from '@/app/core/settings.service'; export interface PluginConfigBlock { config: Record; diff --git a/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.html b/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.html index c0ae2d6ac..01bcac9a7 100644 --- a/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.html +++ b/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.html @@ -1,8 +1,7 @@ -
- diff --git a/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.ts b/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.ts index 2b6dde754..4fc6d7305 100644 --- a/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.ts +++ b/ui/src/app/core/manage-plugins/uninstall-plugins-modal/uninstall-plugins-modal.component.ts @@ -1,8 +1,7 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; import { ManagePluginsModalComponent } from '@/app/core/manage-plugins/manage-plugins-modal/manage-plugins-modal.component'; diff --git a/ui/src/app/core/mobile-detect.service.ts b/ui/src/app/core/mobile-detect.service.ts index ba6871db6..fcfae9299 100644 --- a/ui/src/app/core/mobile-detect.service.ts +++ b/ui/src/app/core/mobile-detect.service.ts @@ -1,5 +1,4 @@ import { Injectable } from '@angular/core'; - import * as MobileDetect from 'mobile-detect'; const preventDefault = (e) => { diff --git a/ui/src/app/core/pipes/convert-temp.pipe.ts b/ui/src/app/core/pipes/convert-temp.pipe.ts index e85b73f8b..e0f00a9c1 100644 --- a/ui/src/app/core/pipes/convert-temp.pipe.ts +++ b/ui/src/app/core/pipes/convert-temp.pipe.ts @@ -1,5 +1,4 @@ import { Pipe, PipeTransform } from '@angular/core'; - import { SettingsService } from '@/app/core/settings.service'; @Pipe({ name: 'convertTemp' }) diff --git a/ui/src/app/core/settings.service.ts b/ui/src/app/core/settings.service.ts index b2d847745..e2c446d4d 100644 --- a/ui/src/app/core/settings.service.ts +++ b/ui/src/app/core/settings.service.ts @@ -1,11 +1,10 @@ import { Injectable } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { ToastrService } from 'ngx-toastr'; import { TranslateService } from '@ngx-translate/core'; +import * as dayjs from 'dayjs'; +import { ToastrService } from 'ngx-toastr'; import { Subject } from 'rxjs'; import { first } from 'rxjs/operators'; -import * as dayjs from 'dayjs'; - import { ApiService } from '@/app/core/api.service'; interface EnvInterface { diff --git a/ui/src/app/core/terminal.service.ts b/ui/src/app/core/terminal.service.ts index 763a1728f..0c4fd7c69 100644 --- a/ui/src/app/core/terminal.service.ts +++ b/ui/src/app/core/terminal.service.ts @@ -1,11 +1,10 @@ -import { Injectable, ElementRef } from '@angular/core'; -import { Terminal, ITerminalOptions } from 'xterm'; -import { FitAddon } from 'xterm-addon-fit'; -import { WebLinksAddon } from 'xterm-addon-web-links'; +import { ElementRef, Injectable } from '@angular/core'; import { Subject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; - -import { WsService, IoNamespace } from '@/app/core/ws.service'; +import { ITerminalOptions, Terminal } from 'xterm'; +import { FitAddon } from 'xterm-addon-fit'; +import { WebLinksAddon } from 'xterm-addon-web-links'; +import { IoNamespace, WsService } from '@/app/core/ws.service'; @Injectable({ providedIn: 'root', diff --git a/ui/src/app/core/ws.service.ts b/ui/src/app/core/ws.service.ts index cafa8d93d..c0d260727 100644 --- a/ui/src/app/core/ws.service.ts +++ b/ui/src/app/core/ws.service.ts @@ -2,9 +2,8 @@ import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { Subject } from 'rxjs'; import { connect } from 'socket.io-client'; - -import { environment } from '@/environments/environment'; import { AuthService } from '@/app/core/auth/auth.service'; +import { environment } from '@/environments/environment'; export interface IoNamespace { connected?: Subject; diff --git a/ui/src/app/modules/accessories/accessories-routing.module.ts b/ui/src/app/modules/accessories/accessories-routing.module.ts index 516077f1d..303e27644 100644 --- a/ui/src/app/modules/accessories/accessories-routing.module.ts +++ b/ui/src/app/modules/accessories/accessories-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { AccessoriesComponent } from './accessories.component'; const routes: Routes = [ diff --git a/ui/src/app/modules/accessories/accessories.component.scss b/ui/src/app/modules/accessories/accessories.component.scss index 864fb047c..5ea4dd349 100644 --- a/ui/src/app/modules/accessories/accessories.component.scss +++ b/ui/src/app/modules/accessories/accessories.component.scss @@ -1,5 +1,3 @@ - - .room-title { margin-left: 10px; @media (max-width: 575px) { @@ -24,3 +22,6 @@ } } +a:hover { + text-decoration: none !important; +} diff --git a/ui/src/app/modules/accessories/accessories.component.ts b/ui/src/app/modules/accessories/accessories.component.ts index 3d5d83dab..439c33103 100644 --- a/ui/src/app/modules/accessories/accessories.component.ts +++ b/ui/src/app/modules/accessories/accessories.component.ts @@ -1,14 +1,13 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; -import { ToastrService } from 'ngx-toastr'; -import { TranslateService } from '@ngx-translate/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService } from '@ngx-translate/core'; import { DragulaService } from 'ng2-dragula'; +import { ToastrService } from 'ngx-toastr'; import { Subscription } from 'rxjs'; - -import { SettingsService } from '@/app/core/settings.service'; +import { AddRoomModalComponent } from './add-room-modal/add-room-modal.component'; import { AccessoriesService } from '@/app/core/accessories/accessories.service'; import { MobileDetectService } from '@/app/core/mobile-detect.service'; -import { AddRoomModalComponent } from './add-room-modal/add-room-modal.component'; +import { SettingsService } from '@/app/core/settings.service'; @Component({ selector: 'app-accessories', diff --git a/ui/src/app/modules/accessories/accessories.module.ts b/ui/src/app/modules/accessories/accessories.module.ts index 89395f5c3..d1ff9605f 100644 --- a/ui/src/app/modules/accessories/accessories.module.ts +++ b/ui/src/app/modules/accessories/accessories.module.ts @@ -1,18 +1,15 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; - -import { TranslateModule } from '@ngx-translate/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; import { DragulaModule } from 'ng2-dragula'; - -import { CoreModule } from '@/app/core/core.module'; -import { AccessoriesCoreModule } from '@/app/core/accessories/accessories.module'; import { AccessoriesRoutingModule } from './accessories-routing.module'; -import { DragHerePlaceholderComponent } from './drag-here-placeholder/drag-here-placeholder.component'; -import { AddRoomModalComponent } from './add-room-modal/add-room-modal.component'; - import { AccessoriesComponent } from './accessories.component'; +import { AddRoomModalComponent } from './add-room-modal/add-room-modal.component'; +import { DragHerePlaceholderComponent } from './drag-here-placeholder/drag-here-placeholder.component'; +import { AccessoriesCoreModule } from '@/app/core/accessories/accessories.module'; +import { CoreModule } from '@/app/core/core.module'; @NgModule({ declarations: [ diff --git a/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.html b/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.html index b2429715a..3bb85f515 100644 --- a/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.html +++ b/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.html @@ -1,12 +1,11 @@ - diff --git a/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.ts b/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.ts index 76146a102..a9bb21ba7 100644 --- a/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.ts +++ b/ui/src/app/modules/accessories/add-room-modal/add-room-modal.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; @Component({ diff --git a/ui/src/app/modules/config-editor/config-editor-routing.module.ts b/ui/src/app/modules/config-editor/config-editor-routing.module.ts index 6a8bc4e1f..11129b987 100644 --- a/ui/src/app/modules/config-editor/config-editor-routing.module.ts +++ b/ui/src/app/modules/config-editor/config-editor-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { ConfigEditorComponent } from './config-editor.component'; import { ConfigEditorResolver } from './config-editor.resolver'; diff --git a/ui/src/app/modules/config-editor/config-editor.component.ts b/ui/src/app/modules/config-editor/config-editor.component.ts index 8a5f061f5..147f535db 100644 --- a/ui/src/app/modules/config-editor/config-editor.component.ts +++ b/ui/src/app/modules/config-editor/config-editor.component.ts @@ -1,17 +1,16 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { ToastrService } from 'ngx-toastr'; -import { NgxEditorModel } from 'ngx-monaco-editor'; +import { TranslateService } from '@ngx-translate/core'; import * as JSON5 from 'json5'; - +import { NgxEditorModel } from 'ngx-monaco-editor'; +import { ToastrService } from 'ngx-toastr'; +import { ConfigRestoreBackupComponent } from './config-restore-backup/config.restore-backup.component'; import { ApiService } from '@/app/core/api.service'; -import { SettingsService } from '@/app/core/settings.service'; -import { NotificationService } from '@/app/core/notification.service'; import { MobileDetectService } from '@/app/core/mobile-detect.service'; import { MonacoEditorService } from '@/app/core/monaco-editor.service'; -import { ConfigRestoreBackupComponent } from './config-restore-backup/config.restore-backup.component'; +import { NotificationService } from '@/app/core/notification.service'; +import { SettingsService } from '@/app/core/settings.service'; @Component({ selector: 'app-config', diff --git a/ui/src/app/modules/config-editor/config-editor.module.ts b/ui/src/app/modules/config-editor/config-editor.module.ts index c2bf0dfe6..6497841f3 100644 --- a/ui/src/app/modules/config-editor/config-editor.module.ts +++ b/ui/src/app/modules/config-editor/config-editor.module.ts @@ -1,14 +1,13 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { MonacoEditorModule } from 'ngx-monaco-editor'; - import { ConfigEditorRoutingModule } from './config-editor-routing.module'; -import { ConfigRestoreBackupComponent } from './config-restore-backup/config.restore-backup.component'; import { ConfigEditorComponent } from './config-editor.component'; import { ConfigEditorResolver } from './config-editor.resolver'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { ConfigRestoreBackupComponent } from './config-restore-backup/config.restore-backup.component'; @NgModule({ declarations: [ diff --git a/ui/src/app/modules/config-editor/config-editor.resolver.ts b/ui/src/app/modules/config-editor/config-editor.resolver.ts index 17b125d33..e4470d485 100644 --- a/ui/src/app/modules/config-editor/config-editor.resolver.ts +++ b/ui/src/app/modules/config-editor/config-editor.resolver.ts @@ -1,7 +1,11 @@ import { Injectable } from '@angular/core'; -import { Resolve, RouterStateSnapshot, ActivatedRouteSnapshot, Router } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + Router, + RouterStateSnapshot, +} from '@angular/router'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; @Injectable() diff --git a/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.html b/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.html index 0323ccc0e..92877329f 100644 --- a/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.html +++ b/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.html @@ -3,8 +3,7 @@ -
@@ -27,10 +26,17 @@

- diff --git a/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.ts b/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.ts index 407ab19ef..b18409fac 100644 --- a/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.ts +++ b/ui/src/app/modules/config-editor/config-restore-backup/config.restore-backup.component.ts @@ -1,8 +1,7 @@ import { Component, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; @Component({ diff --git a/ui/src/app/modules/login/login.component.ts b/ui/src/app/modules/login/login.component.ts index 70c869033..a214fe603 100644 --- a/ui/src/app/modules/login/login.component.ts +++ b/ui/src/app/modules/login/login.component.ts @@ -1,11 +1,10 @@ import { Component, OnInit, ViewChild } from '@angular/core'; -import { Validators, FormGroup, FormControl } from '@angular/forms'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { debounceTime } from 'rxjs/operators'; - -import { environment } from '@/environments/environment'; -import { SettingsService } from '@/app/core/settings.service'; import { AuthService } from '@/app/core/auth/auth.service'; +import { SettingsService } from '@/app/core/settings.service'; +import { environment } from '@/environments/environment'; @Component({ selector: 'app-login', diff --git a/ui/src/app/modules/login/login.guard.ts b/ui/src/app/modules/login/login.guard.ts index 2bfd48161..2d3a1fbe1 100644 --- a/ui/src/app/modules/login/login.guard.ts +++ b/ui/src/app/modules/login/login.guard.ts @@ -1,6 +1,10 @@ import { Injectable } from '@angular/core'; -import { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; - +import { + ActivatedRouteSnapshot, + CanActivate, + Router, + RouterStateSnapshot, +} from '@angular/router'; import { AuthService } from '@/app/core/auth/auth.service'; import { SettingsService } from '@/app/core/settings.service'; diff --git a/ui/src/app/modules/login/login.module.ts b/ui/src/app/modules/login/login.module.ts index 38f58aece..9458b52f9 100644 --- a/ui/src/app/modules/login/login.module.ts +++ b/ui/src/app/modules/login/login.module.ts @@ -1,8 +1,7 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TranslateModule } from '@ngx-translate/core'; - import { LoginComponent } from './login.component'; import { LoginGuard } from './login.guard'; diff --git a/ui/src/app/modules/logs/logs-routing.module.ts b/ui/src/app/modules/logs/logs-routing.module.ts index f4b5320b9..dfa38a5a5 100644 --- a/ui/src/app/modules/logs/logs-routing.module.ts +++ b/ui/src/app/modules/logs/logs-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { LogsComponent } from './logs.component'; const routes: Routes = [ diff --git a/ui/src/app/modules/logs/logs.component.ts b/ui/src/app/modules/logs/logs.component.ts index b8341b35c..ff750cc8e 100644 --- a/ui/src/app/modules/logs/logs.component.ts +++ b/ui/src/app/modules/logs/logs.component.ts @@ -1,15 +1,21 @@ -import { Component, OnInit, HostListener, OnDestroy, ViewChild, ElementRef } from '@angular/core'; -import { HttpResponse, HttpErrorResponse } from '@angular/common/http'; -import { TranslateService } from '@ngx-translate/core'; +import { HttpErrorResponse, HttpResponse } from '@angular/common/http'; +import { + Component, + ElementRef, + HostListener, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; -import { Subject } from 'rxjs'; +import { TranslateService } from '@ngx-translate/core'; import { saveAs } from 'file-saver'; import { ToastrService } from 'ngx-toastr'; - -import { SettingsService } from '@/app/core/settings.service'; +import { Subject } from 'rxjs'; import { ApiService } from '@/app/core/api.service'; -import { LogService } from '@/app/core/log.service'; import { ConfirmComponent } from '@/app/core/components/confirm/confirm.component'; +import { LogService } from '@/app/core/log.service'; +import { SettingsService } from '@/app/core/settings.service'; @Component({ selector: 'app-logs', diff --git a/ui/src/app/modules/logs/logs.module.ts b/ui/src/app/modules/logs/logs.module.ts index 117d93731..f69ed5395 100644 --- a/ui/src/app/modules/logs/logs.module.ts +++ b/ui/src/app/modules/logs/logs.module.ts @@ -1,7 +1,6 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; - import { LogsRoutingModule } from './logs-routing.module'; import { LogsComponent } from './logs.component'; diff --git a/ui/src/app/modules/platform-tools/docker/container-restart/container-restart.component.ts b/ui/src/app/modules/platform-tools/docker/container-restart/container-restart.component.ts index 090a6a4cc..5da2a80fc 100644 --- a/ui/src/app/modules/platform-tools/docker/container-restart/container-restart.component.ts +++ b/ui/src/app/modules/platform-tools/docker/container-restart/container-restart.component.ts @@ -1,11 +1,10 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; -import { WsService } from '@/app/core/ws.service'; import { SettingsService } from '@/app/core/settings.service'; +import { WsService } from '@/app/core/ws.service'; @Component({ selector: 'app-container-restart', diff --git a/ui/src/app/modules/platform-tools/docker/docker-routing.module.ts b/ui/src/app/modules/platform-tools/docker/docker-routing.module.ts index ec44b7a82..5a159a01b 100644 --- a/ui/src/app/modules/platform-tools/docker/docker-routing.module.ts +++ b/ui/src/app/modules/platform-tools/docker/docker-routing.module.ts @@ -1,7 +1,7 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { StartupScriptComponent } from './startup-script/startup-script.component'; +import { RouterModule, Routes } from '@angular/router'; import { ContainerRestartComponent } from './container-restart/container-restart.component'; +import { StartupScriptComponent } from './startup-script/startup-script.component'; import { StartupScriptResolver } from './startup-script/startup-script.resolver'; const routes: Routes = [ diff --git a/ui/src/app/modules/platform-tools/docker/docker.module.ts b/ui/src/app/modules/platform-tools/docker/docker.module.ts index 83a56ec0e..7d55493e5 100644 --- a/ui/src/app/modules/platform-tools/docker/docker.module.ts +++ b/ui/src/app/modules/platform-tools/docker/docker.module.ts @@ -1,15 +1,14 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; import { MonacoEditorModule } from 'ngx-monaco-editor'; - -import { CoreModule } from '@/app/core/core.module'; +import { ContainerRestartComponent } from './container-restart/container-restart.component'; import { DockerRoutingModule } from './docker-routing.module'; import { StartupScriptComponent } from './startup-script/startup-script.component'; -import { ContainerRestartComponent } from './container-restart/container-restart.component'; import { StartupScriptResolver } from './startup-script/startup-script.resolver'; +import { CoreModule } from '@/app/core/core.module'; @NgModule({ declarations: [ diff --git a/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.component.ts b/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.component.ts index dc33827e2..09667d443 100644 --- a/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.component.ts +++ b/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.component.ts @@ -1,13 +1,12 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { ToastrService } from 'ngx-toastr'; import { NgxEditorModel } from 'ngx-monaco-editor'; - -import { SettingsService } from '@/app/core/settings.service'; +import { ToastrService } from 'ngx-toastr'; import { ApiService } from '@/app/core/api.service'; import { MobileDetectService } from '@/app/core/mobile-detect.service'; import { MonacoEditorService } from '@/app/core/monaco-editor.service'; +import { SettingsService } from '@/app/core/settings.service'; @Component({ selector: 'app-startup-script', diff --git a/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.resolver.ts b/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.resolver.ts index 96b2b7077..af1f055f4 100644 --- a/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.resolver.ts +++ b/ui/src/app/modules/platform-tools/docker/startup-script/startup-script.resolver.ts @@ -1,7 +1,11 @@ import { Injectable } from '@angular/core'; -import { Resolve, RouterStateSnapshot, ActivatedRouteSnapshot, Router } from '@angular/router'; +import { + ActivatedRouteSnapshot, + Resolve, + Router, + RouterStateSnapshot, +} from '@angular/router'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; @Injectable() diff --git a/ui/src/app/modules/platform-tools/linux/linux-routing.module.ts b/ui/src/app/modules/platform-tools/linux/linux-routing.module.ts index ba77a1c2b..b7936f1f9 100644 --- a/ui/src/app/modules/platform-tools/linux/linux-routing.module.ts +++ b/ui/src/app/modules/platform-tools/linux/linux-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { LinuxComponent } from './linux.component'; import { RestartLinuxComponent } from './restart-linux/restart-linux.component'; import { ShutdownLinuxComponent } from './shutdown-linux/shutdown-linux.component'; diff --git a/ui/src/app/modules/platform-tools/linux/linux.module.ts b/ui/src/app/modules/platform-tools/linux/linux.module.ts index 4827c7687..7474afee2 100644 --- a/ui/src/app/modules/platform-tools/linux/linux.module.ts +++ b/ui/src/app/modules/platform-tools/linux/linux.module.ts @@ -1,7 +1,6 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; import { TranslateModule } from '@ngx-translate/core'; - import { CoreModule } from '../../../../app/core/core.module'; import { LinuxRoutingModule } from './linux-routing.module'; import { LinuxComponent } from './linux.component'; diff --git a/ui/src/app/modules/platform-tools/linux/restart-linux/restart-linux.component.ts b/ui/src/app/modules/platform-tools/linux/restart-linux/restart-linux.component.ts index 7bdadfa9a..2e2f265c9 100644 --- a/ui/src/app/modules/platform-tools/linux/restart-linux/restart-linux.component.ts +++ b/ui/src/app/modules/platform-tools/linux/restart-linux/restart-linux.component.ts @@ -1,11 +1,10 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; -import { WsService } from '@/app/core/ws.service'; import { SettingsService } from '@/app/core/settings.service'; +import { WsService } from '@/app/core/ws.service'; @Component({ selector: 'app-restart-linux', diff --git a/ui/src/app/modules/platform-tools/linux/shutdown-linux/shutdown-linux.component.ts b/ui/src/app/modules/platform-tools/linux/shutdown-linux/shutdown-linux.component.ts index 4fb6938de..37c454874 100644 --- a/ui/src/app/modules/platform-tools/linux/shutdown-linux/shutdown-linux.component.ts +++ b/ui/src/app/modules/platform-tools/linux/shutdown-linux/shutdown-linux.component.ts @@ -1,11 +1,10 @@ -import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { ToastrService } from 'ngx-toastr'; - import { ApiService } from '@/app/core/api.service'; -import { WsService } from '@/app/core/ws.service'; import { SettingsService } from '@/app/core/settings.service'; +import { WsService } from '@/app/core/ws.service'; @Component({ selector: 'app-shutdown-linux', diff --git a/ui/src/app/modules/platform-tools/platform-tools-routing.module.ts b/ui/src/app/modules/platform-tools/platform-tools-routing.module.ts index ca630aeab..1cd085b5f 100644 --- a/ui/src/app/modules/platform-tools/platform-tools-routing.module.ts +++ b/ui/src/app/modules/platform-tools/platform-tools-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; const routes: Routes = [ { diff --git a/ui/src/app/modules/platform-tools/platform-tools.module.ts b/ui/src/app/modules/platform-tools/platform-tools.module.ts index 57d8b29a8..3e4877f79 100644 --- a/ui/src/app/modules/platform-tools/platform-tools.module.ts +++ b/ui/src/app/modules/platform-tools/platform-tools.module.ts @@ -1,6 +1,5 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; - +import { NgModule } from '@angular/core'; import { PlatformToolsRoutingModule } from './platform-tools-routing.module'; @NgModule({ diff --git a/ui/src/app/modules/platform-tools/terminal/terminal-routing.module.ts b/ui/src/app/modules/platform-tools/terminal/terminal-routing.module.ts index 0f67a8f9c..bfe75a2d4 100644 --- a/ui/src/app/modules/platform-tools/terminal/terminal-routing.module.ts +++ b/ui/src/app/modules/platform-tools/terminal/terminal-routing.module.ts @@ -1,5 +1,5 @@ import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; +import { RouterModule, Routes } from '@angular/router'; import { TerminalComponent } from './terminal.component'; const routes: Routes = [ diff --git a/ui/src/app/modules/platform-tools/terminal/terminal.component.ts b/ui/src/app/modules/platform-tools/terminal/terminal.component.ts index e4e932f0d..2f4de24ce 100644 --- a/ui/src/app/modules/platform-tools/terminal/terminal.component.ts +++ b/ui/src/app/modules/platform-tools/terminal/terminal.component.ts @@ -1,6 +1,12 @@ -import { Component, OnInit, HostListener, OnDestroy, ViewChild, ElementRef } from '@angular/core'; +import { + Component, + ElementRef, + HostListener, + OnDestroy, + OnInit, + ViewChild, +} from '@angular/core'; import { Subject } from 'rxjs'; - import { TerminalService } from '@/app/core/terminal.service'; @Component({ diff --git a/ui/src/app/modules/platform-tools/terminal/terminal.module.ts b/ui/src/app/modules/platform-tools/terminal/terminal.module.ts index b7028721b..62da9654e 100644 --- a/ui/src/app/modules/platform-tools/terminal/terminal.module.ts +++ b/ui/src/app/modules/platform-tools/terminal/terminal.module.ts @@ -1,6 +1,5 @@ -import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; - +import { NgModule } from '@angular/core'; import { TerminalRoutingModule } from './terminal-routing.module'; import { TerminalComponent } from './terminal.component'; diff --git a/ui/src/app/modules/plugins/donate-modal/donate-modal.component.html b/ui/src/app/modules/plugins/donate-modal/donate-modal.component.html index eca2a23c1..1a5ecb4f3 100644 --- a/ui/src/app/modules/plugins/donate-modal/donate-modal.component.html +++ b/ui/src/app/modules/plugins/donate-modal/donate-modal.component.html @@ -3,13 +3,21 @@ -
-
@@ -26,8 +25,13 @@