From 433dcff5db91211e91ea239c4530fba26377aaad Mon Sep 17 00:00:00 2001 From: sepehr Date: Thu, 16 Oct 2025 17:34:28 +0300 Subject: [PATCH] feat: settings redesign and core improvements - Redesign settings interface with improved UX - Enhanced dashboard functionality - Improved device detail views - Updated core data providers - Minor snippet management improvements --- src/app/providers/mikrowizard/data.ts | 33 +- .../views/dashboard/dashboard.component.html | 62 +- src/app/views/dashboard/dashboard.module.ts | 1 - .../views/device_detail/device.component.ts | 18 +- .../views/settings/settings.component.html | 718 ++++++++++++------ .../views/settings/settings.component.scss | 624 ++++++++++++++- src/app/views/settings/settings.component.ts | 70 ++ src/app/views/settings/settings.module.ts | 8 +- src/app/views/snippets/snippets.component.ts | 2 +- 9 files changed, 1290 insertions(+), 246 deletions(-) diff --git a/src/app/providers/mikrowizard/data.ts b/src/app/providers/mikrowizard/data.ts index ba6c8a4..6bc40f6 100644 --- a/src/app/providers/mikrowizard/data.ts +++ b/src/app/providers/mikrowizard/data.ts @@ -278,13 +278,14 @@ export class dataProvider { return this.MikroWizardRPC.sendJsonRequest("/api/devgroup/update_save_group", data); } - get_snippets(name:string,desc:string,content:string,page:number=0,size:number=1000){ + get_snippets(name:string,desc:string,content:string,page:number=0,size:number=1000,limit:any=false){ var data={ 'name':name, 'description':desc, 'content':content, 'page':page, - 'size':size + 'size':size, + 'limit':limit } return this.MikroWizardRPC.sendJsonRequest("/api/snippet/list", data); } @@ -601,6 +602,34 @@ export class dataProvider { } return this.MikroWizardRPC.sendJsonRequest("/api/dhcp-history/get", data); } + + getNetworkMap(){ + return this.MikroWizardRPC.sendJsonRequest("/api/networkmap/get", {}); + } + + bulk_add_devices(devices: any[]){ + var data = { + 'devices': devices + } + return this.MikroWizardRPC.sendJsonRequest("/api/dev/bulk_add", data); + } + + bulk_add_status(taskId: string){ + var data = { + 'taskId': taskId + } + return this.MikroWizardRPC.sendJsonRequest("/api/dev/bulk_add_status", data); + } + + group_firmware_action(groupId: number, action: string){ + var data = { + 'groupId': groupId, + 'action': action + } + return this.MikroWizardRPC.sendJsonRequest("/api/devgroup/firmware_action", data); + } + + //// //// End api funcs //// diff --git a/src/app/views/dashboard/dashboard.component.html b/src/app/views/dashboard/dashboard.component.html index af6b2e9..1fa301a 100644 --- a/src/app/views/dashboard/dashboard.component.html +++ b/src/app/views/dashboard/dashboard.component.html @@ -1,11 +1,23 @@ - + - + Past 24 Hour Statics - + + + + +
+
+
+
+
+
+
+
+ @@ -53,7 +65,17 @@ - + + +
+
+
+
+
+
+
+
+
Total users
@@ -120,16 +142,28 @@ - +
+
+
+
+
+ - +

Version and Serial information

- +
+
+
+
+
+
+
+
@@ -199,8 +233,18 @@ - - + +
+
+
+
+
+
+
+
+
+
+ diff --git a/src/app/views/dashboard/dashboard.module.ts b/src/app/views/dashboard/dashboard.module.ts index 20a6600..f1ff857 100644 --- a/src/app/views/dashboard/dashboard.module.ts +++ b/src/app/views/dashboard/dashboard.module.ts @@ -32,7 +32,6 @@ import { ClipboardModule } from "@angular/cdk/clipboard"; ReactiveFormsModule, ButtonModule, TemplateIdDirective, - ButtonModule, ButtonGroupModule, ChartjsModule, CarouselModule, diff --git a/src/app/views/device_detail/device.component.ts b/src/app/views/device_detail/device.component.ts index c3aa787..116970e 100644 --- a/src/app/views/device_detail/device.component.ts +++ b/src/app/views/device_detail/device.component.ts @@ -509,14 +509,16 @@ export class DeviceComponent implements OnInit, OnDestroy { // loop in dhcp_server_data and create a new object with the data for chart for each dhcp server _self.reloading = false; _self.dhcp_server_data.forEach((element:any) => { - var pooldata=element.pools[0]; - element.chartpools = { - labels: ['Used', 'Free'], - datasets: [{ - backgroundColor: [ '#E46651','#41B883'], - data: [pooldata.used_ips, pooldata.available_ips] - }] - }; + if(element.pools.length>0){ + var pooldata=element.pools[0]; + element.chartpools = { + labels: ['Used', 'Free'], + datasets: [{ + backgroundColor: [ '#E46651','#41B883'], + data: [pooldata.used_ips, pooldata.available_ips] + }] + }; + } }); }); } diff --git a/src/app/views/settings/settings.component.html b/src/app/views/settings/settings.component.html index d3fe44e..8b66fb9 100644 --- a/src/app/views/settings/settings.component.html +++ b/src/app/views/settings/settings.component.html @@ -1,230 +1,510 @@ - - - - Firmware Manager - - -
Firmware in repository:
- - - -   {{value}} - - - - {{value}} - - - - - {{value}} - - - - - - - - -
+
+ + +
+
+ +

System Settings

+
+ Admin Panel +
+
+ +
+ + +
-
- - - - - -
- Add new Permission - - - - - - - - - - {{firm}} - - - - - - -
- -
- - - - - * Choose how Mikrowizard should update old v6 firmwares - - - - - - - * The version of firmware to install routers - - - - - - - * The version of firmware to install on V6 routers - - - - -
- - System Settings - - - - Rad Secret - - - * Radius Secret of Mikrowizard Radius Server - - - - - System URL - - - * Default system access URl - - - - Default IP - - - * Default Mikrowizard Access IP - - - System Time Zone - - Select event type - - - - - - {{tz.text}} - - - - - * Default TimeZone for the system - - - - - Default User - - Default password - - - * Default username and Password for searching new devices - - - - - - - * Choose if Mikrowizard should download updates automaticaly when availble or wait for user to download/apply updates - + + + +
+
+
+ Firmware Repository + +
+ + {{source.length}} Versions Available + +
+
+ + Tip: Keep multiple firmware versions for compatibility. Always test updates on non-critical devices first. +
- - License Username - - - * The username that you registred in Mikrowizard.com,Required for License Activation - + + + + {{value}} + + + + + {{value}} + + + + + {{value.substring(0, 16)}}... + + + + + + + + +
+ + +
+
+
+ + Download New Firmware + +
+
+ + Internet Required: Downloads from mikrotik.com. Ensure stable connection and access to mikrotik.com domain. +
+ + +
+ + +
+
+ {{firm}} +
+
+
+ No versions found +
+
+
+ + + +
+
+ + Fetching available versions from MikroTik... +
+
+
+ + +
+
+ Update Configuration + +
+
+ + Best Practice: Use "Keep v6" for legacy devices. Test new firmware versions in lab environment first. +
+ + + +
+ + + 📋 Keep v6: v6 devices use V6 Firmware Version, v7 devices use Default Firmware Version +
+
- - - - - * Force User Groups under user>groups configuration of each router to match Mikrowizard Permissions and - monitor for any change to prevent/fix the configuration. - + +
+ + + 💡 Tip: Choose stable releases for production. LTS versions are only available for v6 firmware +
+
+ + +
+ + + Firmware version for RouterOS v6 devices +
+
+
+ +
+ +
+
+
- - - - - * Force Radius config under radius>client and user>aaa setting of each router that added to Mikrowizard and - monitor for any change to prevent/fix the configuration. - + + + +
+
+ Network Configuration + +
+
+ + Network Setup: Configure these settings to match your network infrastructure for proper device communication. +
+ + + +
+ + + 🌐 Examples: https://mikrowizard.company.com or 192.168.1.100 +
+
+ + +
+ + + 🔧 Tip: Use static IP outside DHCP range (e.g., 192.168.1.100-200) +
+
+ + +
+ + + 🔐 Internal RADIUS: Secret for MikroWizard's built-in RADIUS server (for MikroTik admin authentication) +
+
+ + +
+ +
+ +
+
+ {{tz.text}} +
+
+
+ No timezones found +
+
+ Default system timezone +
+
+
+
- - - - - * Force Syslog config under system>logs setting of each router that added to Mikrowizard and monitor syslog - setting for any change to prevent/fix the configuration. - + +
+
+ Device Discovery Credentials + +
+
+ + Security Warning: Change default passwords immediately after device setup. Use strong, unique credentials. +
+ + + +
+ + + 🔍 Device Discovery: Username for finding MikroTik devices with default credentials in your network +
+
+ + +
+ + + 🔍 Device Discovery: Password for finding MikroTik devices with default credentials (often empty on new devices) +
+
+
+
- - - - PRO - * Download and install reqired firmware before installing the target firmware . for example it will install - latest 7.12 then upgrade to newer version >7.13 or install Required packages before update - + +
+
+ License Configuration + +
+ + + +
+ + + 🔑 Same username you use to login to mikrowizard.com website +
+
+
+
- - - - PRO - * Force login to devices using otp for all users.(you can make exceptions for each user) - - + +
+
+ System Behavior + +
+ + + +
+ + + 📊 Manual Mode: Updates require confirmation and actions in dashboard view +
+
+
+
-
-
- - + +
+
+ Security & Enforcement + +
+
+ + Important: These settings will override device configurations. Test in lab environment before enabling in production. +
+ +
+
+
+
+
Force Permissions + +
+

🔄 Sync MikroTik user groups with MikroWizard permissions +
💡 Ensures consistent user access control across all devices +

+
+ + + + +
+
+ +
+
+
+
Force RADIUS + +
+

🔐 Configure RADIUS on MikroTik devices for admin user authentication +
👥 For MikroTik system users authentication (not end users) +

+
+ + + + +
+
+ +
+
+
+
Force Syslog + +
+

📊 Automatically configure syslog settings on managed devices +
⚠️ Will OVERWRITE existing syslog configurations on devices +

+
+ + + + +
+
+ +
+
+
+
Safe Updates PRO + +
+

🛡️ Install required intermediate firmware versions before target version +
✅ Highly recommended for production environments +

+
+ + + + +
+
+ +
+
+
+
Force Device OTP PRO + +
+

🔐 Require OTP authentication for all device access +
⚠️ Ensure users have OTP configured before enabling +

+
+ + + + +
+
+ +
+
+
+
WebFig Auto Login PRO + +
+

🌐 Create temporary OTP for automatic WebFig login +
🔑 Users don't need to input passwords to access WebFig admin interface +

+
+ + + + +
+
+
+
+ +
+ +
+ + + + + +
Loading system configuration...
+
+ +
diff --git a/src/app/views/settings/settings.component.scss b/src/app/views/settings/settings.component.scss index 897c549..364f8c3 100644 --- a/src/app/views/settings/settings.component.scss +++ b/src/app/views/settings/settings.component.scss @@ -5,9 +5,629 @@ } } } + .mdc-line-ripple.mdc-line-ripple--deactivating.ng-star-inserted { display: none!important; } -.form-check-label{ - font-weight: bold; + +/* Settings Container */ +.settings-container { + max-width: 1200px; + margin: 0 auto; +} + +.settings-card { + border: none; + box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + border-radius: 12px; + overflow: hidden; +} + +.settings-header { + background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); + border-bottom: 1px solid #dee2e6; + padding: 1.25rem 1.5rem; +} + +/* Tabs */ +.settings-tabs { + background: #f8f9fa; + border-bottom: 1px solid #dee2e6; + padding: 0 1.5rem; + display: flex; +} + +.tab-link { + border: none; + background: transparent; + border-radius: 0; + padding: 1rem 1.5rem; + font-weight: 500; + color: #6c757d; + transition: all 0.2s ease; + border-bottom: 3px solid transparent; + cursor: pointer; +} + +.tab-link:hover { + color: #495057; + background: rgba(13, 110, 253, 0.05); +} + +.tab-link.active { + color: #0d6efd; + background: white; + border-bottom-color: #0d6efd; +} + +/* Tab Content */ +.tab-content { + padding: 2rem; +} + +/* Section Titles */ +.section-title { + color: #495057; + font-weight: 600; + font-size: 1.1rem; + margin-bottom: 1rem; + display: flex; + align-items: center; +} + +/* Status Section */ +.status-section { + background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); + border: 1px solid #e9ecef; + border-radius: 8px; + padding: 1.5rem; +} + +/* Download Section */ +.download-section { + .section-card { + background: linear-gradient(135deg, #e7f3ff 0%, #f8f9fa 100%); + border: 2px dashed #0d6efd; + border-radius: 8px; + padding: 1.5rem; + transition: all 0.2s ease; + } + + .section-card:hover { + border-color: #0a58ca; + background: linear-gradient(135deg, #cfe2ff 0%, #e7f3ff 100%); + } + + .section-header { + display: flex; + align-items: center; + font-size: 1rem; + font-weight: 600; + color: #495057; + } +} + +/* Firmware Settings */ +.firmware-settings { + background: #f8f9fa; + border-radius: 8px; + padding: 1.5rem; + border: 1px solid #e9ecef; +} + +/* Config Sections */ +.config-section { + background: #f8f9fa; + border-radius: 8px; + padding: 1.5rem; + border: 1px solid #e9ecef; +} + +/* Setting Groups */ +.setting-group { + margin-bottom: 1rem; +} + +.setting-label { + display: block; + font-weight: 600; + color: #495057; + margin-bottom: 0.5rem; + font-size: 0.9rem; +} + +.setting-help { + color: #6c757d; + font-size: 0.8rem; + margin-top: 0.25rem; + display: block; +} + +/* Security Switches */ +.security-switches { + display: grid; + gap: 1rem; +} + +.switch-item { + background: white; + border: 1px solid #e9ecef; + border-radius: 8px; + padding: 1.25rem; + transition: all 0.2s ease; +} + +.switch-item:hover { + border-color: #0d6efd; + box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1); +} + +.switch-content { + display: flex; + justify-content: space-between; + align-items: center; +} + +.switch-info { + flex: 1; + margin-right: 1rem; +} + +.switch-title { + font-size: 1rem; + font-weight: 600; + color: #495057; + margin-bottom: 0.25rem; + display: flex; + align-items: center; +} + +.switch-description { + color: #6c757d; + font-size: 0.85rem; + margin: 0; + line-height: 1.4; +} + +/* Compact Grid */ +.compact-grid { + border-radius: 6px; + overflow: hidden; + border: 1px solid #e9ecef; +} + +/* Version Badge */ +.version-badge { + font-family: 'Courier New', monospace; + font-weight: 600; +} + + + +/* Form Controls */ +.form-control, .form-select { + border-radius: 6px; + border: 1px solid #ced4da; + padding: 0.5rem 0.75rem; + font-size: 0.9rem; + transition: all 0.2s ease; +} + +.form-control:focus, .form-select:focus { + border-color: #0d6efd; + box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); +} + +/* Save Section */ +.save-section { + text-align: center; + padding-top: 1rem; + border-top: 1px solid #e9ecef; +} + +/* Form Check Labels */ +.form-check-label { + font-weight: 500; +} + +/* Button Enhancements */ +.btn { + border-radius: 6px; + font-weight: 500; + transition: all 0.2s ease; +} + +.btn:hover { + transform: translateY(-1px); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + +/* Badge Enhancements */ +.badge { + font-weight: 500; + padding: 0.4em 0.6em; +} + +/* Mobile Responsive for Informative Elements */ +@media (max-width: 768px) { + .info-banner, + .warning-banner, + .success-banner { + padding: 0.5rem 0.75rem; + font-size: 0.8rem; + } + + .help-icon { + font-size: 0.75rem; + } + + .setting-help { + font-size: 0.75rem; + } + + .switch-description { + font-size: 0.8rem; + } + + .switch-description small { + font-size: 0.7rem; + } + + ::ng-deep .tooltip-inner { + max-width: 250px; + font-size: 0.75rem; + } +} + +@media (max-width: 576px) { + .info-banner, + .warning-banner, + .success-banner { + flex-direction: column; + align-items: flex-start; + gap: 0.25rem; + } + + .setting-label { + flex-direction: column; + align-items: flex-start; + gap: 0.25rem; + } +} + +/* Original Responsive Design */ +@media (max-width: 768px) { + .settings-header { + padding: 1rem; + } + + .settings-tabs { + padding: 0 1rem; + } + + .tab-content { + padding: 1rem; + } + + .tab-link { + padding: 0.75rem 1rem; + font-size: 0.9rem; + } + + .status-section, + .config-section, + .firmware-settings { + padding: 1rem; + } + + .download-section .section-card { + padding: 1rem; + } + + .switch-content { + flex-direction: column; + align-items: flex-start; + gap: 1rem; + } + + .switch-info { + margin-right: 0; + } + + .section-title { + font-size: 1rem; + } +} + +@media (max-width: 576px) { + .settings-container { + margin: 0 0.5rem; + } + + .settings-card { + border-radius: 8px; + } + + .tab-content { + padding: 0.75rem; + } + + .status-section, + .config-section, + .firmware-settings { + padding: 0.75rem; + } +} + +/* Search Select Components */ +.search-select-wrapper { + position: relative; + width: 100%; +} + +.search-input { + width: 100%; + padding: 0.5rem 0.75rem; + border: 1px solid #ced4da; + border-radius: 6px; + font-size: 0.9rem; + transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; +} + +.search-input:focus { + border-color: #0d6efd; + box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25); + outline: 0; +} + +.search-dropdown { + position: absolute; + top: 100%; + left: 0; + right: 0; + background: white; + border: 1px solid #ced4da; + border-top: none; + border-radius: 0 0 6px 6px; + max-height: 300px; + overflow-y: auto; + z-index: 1000; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +.search-option { + padding: 0.5rem 0.75rem; + cursor: pointer; + border-bottom: 1px solid #f8f9fa; + transition: background-color 0.15s ease-in-out; + font-size: 0.85rem; +} + +.search-option:hover { + background-color: #f8f9fa; +} + +.search-option:last-child { + border-bottom: none; +} + +.search-no-results { + padding: 0.75rem; + text-align: center; + color: #6c757d; + font-style: italic; + font-size: 0.8rem; +} + +/* Animation for dropdown */ +@keyframes fadeIn { + from { opacity: 0; transform: translateY(-10px); } + to { opacity: 1; transform: translateY(0); } +} + +.search-dropdown { + animation: fadeIn 0.2s ease-out; +} + +/* Informative Design Elements */ +.help-icon { + font-size: 0.8rem; + cursor: help; + opacity: 0.7; + transition: opacity 0.2s ease; +} + +.help-icon:hover { + opacity: 1; +} + +.help-icon.text-danger { + color: #dc3545 !important; + opacity: 1; +} + +.help-icon.text-warning { + color: #fd7e14 !important; + opacity: 0.9; +} + +.info-banner { + background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); + border: 1px solid #2196f3; + border-radius: 6px; + padding: 0.75rem 1rem; + color: #0d47a1; + font-size: 0.85rem; + display: flex; + align-items: center; +} + +.warning-banner { + background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%); + border: 1px solid #ff9800; + border-radius: 6px; + padding: 0.75rem 1rem; + color: #e65100; + font-size: 0.85rem; + display: flex; + align-items: center; +} + +.success-banner { + background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%); + border: 1px solid #4caf50; + border-radius: 6px; + padding: 0.75rem 1rem; + color: #2e7d32; + font-size: 0.85rem; + display: flex; + align-items: center; +} + +/* Enhanced Setting Help */ +.setting-help { + color: #6c757d; + font-size: 0.8rem; + margin-top: 0.25rem; + display: block; + line-height: 1.4; +} + +.setting-help strong { + color: #495057; +} + +/* Enhanced Form Labels */ +.setting-label { + display: flex; + align-items: center; + font-weight: 600; + color: #495057; + margin-bottom: 0.5rem; + font-size: 0.9rem; +} + +/* Enhanced Switch Descriptions */ +.switch-description { + color: #6c757d; + font-size: 0.85rem; + margin: 0; + line-height: 1.4; +} + +.switch-description small { + display: block; + margin-top: 0.25rem; + font-size: 0.75rem; +} + +.switch-description .text-warning { + color: #856404 !important; +} + +.switch-description .text-info { + color: #0c5460 !important; +} + +.switch-description .text-success { + color: #155724 !important; +} + +.switch-description .text-danger { + color: #721c24 !important; +} + +.setting-help.text-danger { + color: #721c24 !important; + font-weight: 600; +} + +.setting-help.text-warning { + color: #856404 !important; + font-weight: 600; +} + +/* Enhanced Section Titles */ +.section-title { + color: #495057; + font-weight: 600; + font-size: 1.1rem; + margin-bottom: 1rem; + display: flex; + align-items: center; +} + +/* Tooltip Enhancements */ +::ng-deep .tooltip { + font-size: 0.8rem; +} + +::ng-deep .tooltip-inner { + max-width: 300px; + text-align: left; + background-color: #2c3e50; + border-radius: 6px; + padding: 0.5rem 0.75rem; +} + +/* Enhanced Form Controls with Status */ +.form-control.has-warning { + border-color: #ffc107; + box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25); +} + +.form-control.has-success { + border-color: #28a745; + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} + +.form-control.has-error { + border-color: #dc3545; + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} + +/* Enhanced Select Options */ +.form-select option { + padding: 0.5rem; +} + +/* Status Indicators */ +.status-indicator { + display: inline-flex; + align-items: center; + padding: 0.25rem 0.5rem; + border-radius: 4px; + font-size: 0.75rem; + font-weight: 500; + margin-left: 0.5rem; +} + +.status-indicator.recommended { + background: #d4edda; + color: #155724; + border: 1px solid #c3e6cb; +} + +.status-indicator.warning { + background: #fff3cd; + color: #856404; + border: 1px solid #ffeaa7; +} + +.status-indicator.critical { + background: #f8d7da; + color: #721c24; + border: 1px solid #f5c6cb; +} + +/* Grid Enhancements */ +::ng-deep .gui-grid { + .gui-grid-header { + background: #f8f9fa; + font-weight: 600; + } + + .gui-grid-cell { + padding: 0.75rem 0.5rem; + } } \ No newline at end of file diff --git a/src/app/views/settings/settings.component.ts b/src/app/views/settings/settings.component.ts index 5501013..53a387a 100644 --- a/src/app/views/settings/settings.component.ts +++ b/src/app/views/settings/settings.component.ts @@ -37,6 +37,17 @@ export class SettingsComponent implements OnInit { public filters: any = {}; public firms: any = {}; public firmtodownload: any = {}; + public activeTab: string = 'firmware'; + + // Search functionality properties + public firmwareSearch: string = ''; + public showFirmwareDropdown: boolean = false; + public filteredFirmwares: any[] = []; + + public timezoneSearch: string = ''; + public showTimezoneDropdown: boolean = false; + public filteredTimezones: any[] = []; + constructor( private data_provider: dataProvider, private router: Router, @@ -293,6 +304,12 @@ export class SettingsComponent implements OnInit { _self.sysconfigs["default_user"]["value"] = ""; _self.sysconfigs["default_password"]["value"] = ""; _self.timezones = _self.TimeZones.timezones; + _self.filteredTimezones = _self.TimeZones.timezones; + // Set initial timezone search display + const currentTz = _self.timezones.find((tz: any) => tz.utc[0] === _self.sysconfigs['timezone']['value']); + if (currentTz) { + _self.timezoneSearch = currentTz.text; + } _self.sysconfigs["force_syslog"]["value"] = /true/i.test( _self.sysconfigs["force_syslog"]["value"] ); @@ -310,6 +327,16 @@ export class SettingsComponent implements OnInit { _self.sysconfigs["otp_force"]["value"] ); } + if(_self.ispro && "proxy_auto_login" in _self.sysconfigs){ + _self.sysconfigs["proxy_auto_login"]["value"] = /true/i.test( + _self.sysconfigs["proxy_auto_login"]["value"] + ); + } + else if(_self.ispro){ + _self.sysconfigs["proxy_auto_login"] = { + "value": true + } + } //check if update_mode is in the sysconfigs if ("update_mode" in _self.sysconfigs){ //convert string to json @@ -335,7 +362,50 @@ export class SettingsComponent implements OnInit { this.data_provider.get_downloadable_firms().then((res) => { let index = 1; _self.firms = res.versions; + _self.filteredFirmwares = res.versions; _self.loading = false; }); } + + // Firmware search methods + filterFirmwares(event: any): void { + const searchTerm = event.target.value.toLowerCase(); + this.firmwareSearch = searchTerm; + this.filteredFirmwares = this.firms.filter((firm: string) => + firm.toLowerCase().includes(searchTerm) + ); + } + + selectFirmware(firmware: string): void { + this.firmtodownload = firmware; + this.firmwareSearch = firmware; + this.showFirmwareDropdown = false; + } + + hideFirmwareDropdown(): void { + setTimeout(() => { + this.showFirmwareDropdown = false; + }, 200); + } + + // Timezone search methods + filterTimezones(event: any): void { + const searchTerm = event.target.value.toLowerCase(); + this.timezoneSearch = searchTerm; + this.filteredTimezones = this.timezones.filter((tz: any) => + tz.text.toLowerCase().includes(searchTerm) + ); + } + + selectTimezone(timezone: any): void { + this.sysconfigs['timezone']['value'] = timezone.utc[0]; + this.timezoneSearch = timezone.text; + this.showTimezoneDropdown = false; + } + + hideTimezoneDropdown(): void { + setTimeout(() => { + this.showTimezoneDropdown = false; + }, 200); + } } diff --git a/src/app/views/settings/settings.module.ts b/src/app/views/settings/settings.module.ts index 116d06d..b482be7 100644 --- a/src/app/views/settings/settings.module.ts +++ b/src/app/views/settings/settings.module.ts @@ -10,14 +10,14 @@ import { SpinnerModule, ToastModule, ModalModule, + BadgeModule, + TooltipModule, } from "@coreui/angular"; import { SettingsRoutingModule } from "./settings-routing.module"; import { SettingsComponent } from "./settings.component"; import { GuiGridModule } from "@generic-ui/ngx-grid"; import { FormsModule } from "@angular/forms"; -import { MatSelectModule } from "@angular/material/select"; -import { NgxMatSelectSearchModule } from "ngx-mat-select-search"; @NgModule({ imports: [ @@ -30,11 +30,11 @@ import { NgxMatSelectSearchModule } from "ngx-mat-select-search"; ButtonModule, ButtonGroupModule, GuiGridModule, - MatSelectModule, - NgxMatSelectSearchModule, SpinnerModule, ToastModule, ModalModule, + BadgeModule, + TooltipModule, ], declarations: [SettingsComponent], }) diff --git a/src/app/views/snippets/snippets.component.ts b/src/app/views/snippets/snippets.component.ts index bcb2e4d..174a3e9 100644 --- a/src/app/views/snippets/snippets.component.ts +++ b/src/app/views/snippets/snippets.component.ts @@ -318,7 +318,7 @@ export class SnippetsComponent implements OnInit, OnDestroy { initGridTable(): void { var _self = this; - _self.data_provider.get_snippets("", "", "", 0, 1000).then((res) => { + _self.data_provider.get_snippets("", "", "", 0, 1000,false).then((res) => { _self.source = res.map((x: any) => { x.created = [ x.created.split("T")[0],