From 9298dd80b69ac553009ffa363878c0f9518ea265 Mon Sep 17 00:00:00 2001 From: sepehr Date: Sun, 29 Mar 2026 16:43:30 +0300 Subject: [PATCH] Upgrade to angular 18, Replace gui-grid with PrimeNG table since gui-grid not developed anymore,Fix typo , Fix minor ui/ux bugs --- angular.json | 2 +- package.json | 33 +- src/app/app.module.ts | 118 +- src/app/containers/default-layout/_nav.ts | 5 +- src/app/providers/mikrowizard/provider.ts | 2 +- src/app/views/acc_log/acc.component.html | 190 ++- src/app/views/acc_log/acc.component.ts | 110 +- src/app/views/acc_log/acc.module.ts | 8 +- src/app/views/auth_log/auth.component.html | 234 +++- src/app/views/auth_log/auth.component.ts | 72 +- src/app/views/auth_log/auth.module.ts | 10 +- src/app/views/backups/backups.component.html | 182 +-- src/app/views/backups/backups.component.ts | 64 +- src/app/views/backups/backups.module.ts | 8 +- src/app/views/cloner/cloner.component.html | 715 +++++++----- src/app/views/cloner/cloner.component.ts | 97 +- src/app/views/cloner/cloner.module.ts | 8 +- .../views/dashboard/dashboard.component.html | 12 +- .../active-users/active-users.component.html | 7 +- .../views/device_detail/device.component.html | 177 +-- .../views/device_detail/device.component.scss | 3 - .../views/device_detail/device.component.ts | 71 +- src/app/views/device_detail/device.module.ts | 8 +- .../dhcp-info/dhcp-info.component.html | 212 ++-- .../dhcp-info/dhcp-info.component.ts | 22 +- .../dhcp-info/dhcp-info.module.ts | 8 +- .../ping-status/ping-status.component.html | 3 +- .../views/device_logs/devlogs.component.html | 267 +++-- .../views/device_logs/devlogs.component.ts | 132 +-- src/app/views/device_logs/devlogs.module.ts | 10 +- src/app/views/devices/devices.component.html | 455 +++++--- src/app/views/devices/devices.component.ts | 69 +- src/app/views/devices/devices.module.ts | 12 +- .../devices_group/devgroup.component.html | 390 ++++--- .../views/devices_group/devgroup.component.ts | 79 +- .../views/devices_group/devgroup.module.ts | 8 +- .../permissions/permissions.component.html | 84 +- .../permissions/permissions.component.ts | 37 +- .../views/permissions/permissions.module.ts | 8 +- .../views/sequences/sequences.component.html | 385 +++--- .../views/sequences/sequences.component.ts | 54 +- src/app/views/sequences/sequences.module.ts | 8 +- .../views/settings/settings.component.html | 1036 +++++++++-------- .../views/settings/settings.component.scss | 74 +- src/app/views/settings/settings.component.ts | 60 +- src/app/views/settings/settings.module.ts | 8 +- .../views/snippets/snippets.component.html | 304 +++-- src/app/views/snippets/snippets.component.ts | 80 +- src/app/views/snippets/snippets.module.ts | 8 +- .../syslog-regex/syslog-regex.component.html | 141 ++- .../syslog-regex/syslog-regex.component.scss | 33 +- .../syslog-regex/syslog-regex.component.ts | 8 +- .../views/syslog-regex/syslog-regex.module.ts | 12 +- src/app/views/syslog/syslog-routing.module.ts | 2 +- src/app/views/syslog/syslog.component.html | 180 ++- src/app/views/syslog/syslog.component.ts | 120 +- src/app/views/syslog/syslog.module.ts | 8 +- .../user_manager/user_manager.component.html | 672 ++++++----- .../user_manager/user_manager.component.ts | 211 ++-- .../views/user_manager/user_manager.module.ts | 8 +- .../user_tasks/user_tasks.component.html | 249 ++-- .../views/user_tasks/user_tasks.component.ts | 68 +- src/app/views/user_tasks/user_tasks.module.ts | 8 +- src/app/views/vault/vault.component.html | 312 +++-- src/app/views/vault/vault.component.ts | 85 +- src/app/views/vault/vault.module.ts | 8 +- src/app/views/vault/vault.scss | 19 - src/app/views/vpn/vpn.component.html | 388 +++--- src/app/views/vpn/vpn.component.ts | 28 +- src/app/views/vpn/vpn.module.ts | 8 +- src/scss/_custom.scss | 227 ++-- src/scss/styles.scss | 3 +- tsconfig.app.json | 3 +- tsconfig.json | 8 +- 74 files changed, 4845 insertions(+), 3913 deletions(-) diff --git a/angular.json b/angular.json index 739942a..817e16e 100644 --- a/angular.json +++ b/angular.json @@ -61,7 +61,7 @@ { "type": "anyComponentStyle", "maximumWarning": "2kb", - "maximumError": "6kb" + "maximumError": "10kb" } ], "outputHashing": "all" diff --git a/package.json b/package.json index 8c63917..37eb562 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,17 @@ }, "private": true, "dependencies": { - "@angular/animations": "^17.3.5", + "@angular/animations": "^18.2.14", "@angular/cdk": "^16.2.9", - "@angular/common": "^17.3.5", - "@angular/compiler": "^17.3.5", - "@angular/core": "^17.3.5", - "@angular/forms": "^17.3.5", - "@angular/language-service": "^17.3.5", + "@angular/common": "^18.2.14", + "@angular/compiler": "^18.2.14", + "@angular/core": "^18.2.14", + "@angular/forms": "^18.2.14", + "@angular/language-service": "^18.2.14", "@angular/material": "^17.3.5", - "@angular/platform-browser": "^17.3.5", - "@angular/platform-browser-dynamic": "^17.3.5", - "@angular/router": "^17.3.5", + "@angular/platform-browser": "^18.2.14", + "@angular/platform-browser-dynamic": "^18.2.14", + "@angular/router": "^18.2.14", "@coreui/angular": "~4.5.27", "@coreui/angular-chartjs": "~4.5.27", "@coreui/chartjs": "^3.1.2", @@ -42,6 +42,7 @@ "@generic-ui/fabric": "^0.19.0", "@generic-ui/hermes": "^0.19.0", "@generic-ui/ngx-grid": "^0.19.0", + "@primeuix/themes": "^2.0.3", "chart.js": "^3.9.1", "date-fns": "^3.6.0", "date-fns-jalali": "^3.6.0-0", @@ -61,17 +62,21 @@ "ngx-material-date-fns-adapter": "^18.0.0", "ngx-scrollbar": "^13.0.3", "ngx-super-select": "^3.17.0", + "primeicons": "^7.0.0", + "primeng": "^18.0.2", "rxjs": "~7.8.1", "tslib": "^2.3.0", "vis-data": "^7.1.9", "vis-network": "^9.1.9", - "zone.js": "~0.14.4" + "vis-util": "^6.0.0", + "zone.js": "~0.14.10" }, "devDependencies": { - "@angular-devkit/build-angular": "^17.3.5", - "@angular/cli": "^17.3.5", - "@angular/compiler-cli": "^17.3.5", - "@angular/localize": "^17.3.5", + "@angular-devkit/build-angular": "^18.2.21", + "@angular/cli": "^18.2.21", + "@angular/compiler-cli": "^18.2.14", + "@angular/localize": "^18.2.14", + "@types/hammerjs": "^2.0.46", "@types/jasmine": "^5.1.1", "@types/lodash-es": "^4.17.10", "@types/node": "^18.19.34", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index bb74798..2384b03 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,10 +2,13 @@ import { NgModule ,APP_INITIALIZER} from '@angular/core'; import { HashLocationStrategy, LocationStrategy, PathLocationStrategy } from '@angular/common'; import { BrowserModule, Title } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; +import { providePrimeNG } from 'primeng/config'; +import Aura from '@primeuix/themes/aura'; import { ReactiveFormsModule,FormsModule } from '@angular/forms'; import { NgScrollbarModule } from 'ngx-scrollbar'; -import { HttpClientModule } from '@angular/common/http'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; // Import routing module import { AppRoutingModule } from './app-routing.module'; @@ -54,60 +57,63 @@ const APP_CONTAINERS = [ export function loginStatusProviderFactory(provider: loginChecker) { return () => provider.load(); } -@NgModule({ - declarations: [AppComponent, ...APP_CONTAINERS], - imports: [ - BrowserModule, - BrowserAnimationsModule, - AppRoutingModule, - AvatarModule, - BreadcrumbModule, - FooterModule, - DropdownModule, - GridModule, - HeaderModule, - SidebarModule, - IconModule, - NavModule, - HttpClientModule, - ButtonModule, - FormModule, - UtilitiesModule, - ButtonGroupModule, - ReactiveFormsModule, - FormsModule, - SidebarModule, - SharedModule, - TabsModule, - ListGroupModule, - ProgressModule, - BadgeModule, - ListGroupModule, - CardModule, - NgScrollbarModule, - ModalModule, - FontAwesomeModule, - TableModule - ], - providers: [ - { - provide: LocationStrategy, - useClass: HashLocationStrategy - }, - MikroWizardProvider, - dataProvider, - loginChecker, - IconSetService, - provideDateFnsAdapter(), - { - provide: APP_INITIALIZER, - useFactory: loginStatusProviderFactory, - deps: [loginChecker], - multi: true, - }, - Title - ], - bootstrap: [AppComponent] -}) +@NgModule({ declarations: [AppComponent, ...APP_CONTAINERS], + bootstrap: [AppComponent], imports: [BrowserModule, + BrowserAnimationsModule, + AppRoutingModule, + AvatarModule, + BreadcrumbModule, + FooterModule, + DropdownModule, + GridModule, + HeaderModule, + SidebarModule, + IconModule, + NavModule, + ButtonModule, + FormModule, + UtilitiesModule, + ButtonGroupModule, + ReactiveFormsModule, + FormsModule, + SidebarModule, + SharedModule, + TabsModule, + ListGroupModule, + ProgressModule, + BadgeModule, + ListGroupModule, + CardModule, + NgScrollbarModule, + ModalModule, + FontAwesomeModule, + TableModule], providers: [ + { + provide: LocationStrategy, + useClass: HashLocationStrategy + }, + MikroWizardProvider, + dataProvider, + loginChecker, + IconSetService, + provideDateFnsAdapter(), + provideAnimationsAsync(), + providePrimeNG({ + theme: { + preset: Aura, + options: { + darkModeSelector: 'none' + } + } + }), + { + provide: APP_INITIALIZER, + useFactory: loginStatusProviderFactory, + deps: [loginChecker], + multi: true, + }, + Title, + provideHttpClient(withInterceptorsFromDi()) + ] }) export class AppModule { } diff --git a/src/app/containers/default-layout/_nav.ts b/src/app/containers/default-layout/_nav.ts index 830b492..ef78bee 100644 --- a/src/app/containers/default-layout/_nav.ts +++ b/src/app/containers/default-layout/_nav.ts @@ -18,9 +18,10 @@ export const navItems: INavData[] = [ name: 'Device Managment' }, { - name: 'VPN Server', + name: 'WireGuard Server', url: '/vpn', - icon: 'fa-solid fa-network-wired' + icon: 'fa-solid fa-network-wired', + attributes: { 'pro': true } }, { name: 'Devices', diff --git a/src/app/providers/mikrowizard/provider.ts b/src/app/providers/mikrowizard/provider.ts index ac7deb4..39e39d4 100644 --- a/src/app/providers/mikrowizard/provider.ts +++ b/src/app/providers/mikrowizard/provider.ts @@ -1,6 +1,6 @@ import { Injectable, Inject } from '@angular/core'; -import { HttpClient,HttpResponse } from '@angular/common/http'; +import { HttpClient, HttpResponse } from '@angular/common/http'; class Cookies { // cookies doesn't work with Android default browser / Ionic private session_id: string = ""; diff --git a/src/app/views/acc_log/acc.component.html b/src/app/views/acc_log/acc.component.html index 3b1b9b8..66e97be 100644 --- a/src/app/views/acc_log/acc.component.html +++ b/src/app/views/acc_log/acc.component.html @@ -1,10 +1,10 @@ - + -
Accunting Logs +
Accounting Logs @@ -14,8 +14,10 @@
Filtered Result For Device ID {{devid}} - - Showing last 24 hours logs by default. Use filters to modify the date and time. + + Showing last 24 hours logs by + default. Use filters to modify the date and time.
@@ -73,49 +75,143 @@
- - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - -
{{value}}
-
-
- - - {{value}} - - - - - {{value}} - - - - - {{value}} - - -
+
+ + + + +
+ + + + + + +
+ #No + +
+ + +
+ Device Name + + + + +
+ + +
+ Device IP + + + + +
+ + +
+ User Name + + + + +
+ + +
+ Action + + + + +
+ + +
+ Section + + + + +
+ + +
+ Date + + + + +
+ + +
+ + + + {{item.index}} + {{item.name}} + {{item.devip}} + {{item.username}} + {{item.action}} + {{item.section}} + {{item.created}} + + + + + + No accounting logs found. + + +
+ + + +
+
Device Info
+
+
{{selectedLog.name}}
+
{{selectedLog.devip}}
+
+ +
Session Details
+
+
User Name:
+
{{selectedLog.username}}
+
+
+
User IP:
+
{{selectedLog.address}}
+
+
+
Section:
+
{{selectedLog.section}}
+
+
+
Action:
+
{{selectedLog.action}}
+
+
+
Exec time:
+
{{selectedLog.created}}
+
+ +
Executed Config
+
+
{{selectedLog.config}}
+
+
+
diff --git a/src/app/views/acc_log/acc.component.ts b/src/app/views/acc_log/acc.component.ts index 2fbf5b7..44e4ba1 100644 --- a/src/app/views/acc_log/acc.component.ts +++ b/src/app/views/acc_log/acc.component.ts @@ -1,19 +1,8 @@ -import { Component, OnInit, ViewEncapsulation,Input } from "@angular/core"; +import { Component, OnInit, ViewChild, ViewEncapsulation, Input } from "@angular/core"; import { dataProvider } from "../../providers/mikrowizard/data"; import { Router, ActivatedRoute } from "@angular/router"; import { loginChecker } from "../../providers/login_checker"; -import { - GuiRowDetail, - GuiSelectedRow, - GuiInfoPanel, - GuiColumn, - GuiColumnMenu, - GuiPaging, - GuiPagingDisplay, - GuiRowSelectionMode, - GuiRowSelection, - GuiRowSelectionType, -} from "@generic-ui/ngx-grid"; +import { Table } from 'primeng/table'; import { formatInTimeZone } from "date-fns-tz"; @@ -26,10 +15,14 @@ import { formatInTimeZone } from "date-fns-tz"; }) export class AccComponent implements OnInit { @Input() component_devid: any=false; - public uid: number; - public uname: string; - public tz: string; - public filterText: string; + public uid!: number; + public uname!: string; + public tz!: string; + public filterText!: string; + public detailsVisible: boolean = false; + public selectedLog: any = null; + + @ViewChild('dt') table!: Table; public reloading: boolean = false; public filters: any = { devid: false, @@ -75,78 +68,20 @@ export class AccComponent implements OnInit { } } public source: Array = []; - public columns: Array = []; public loading: boolean = true; public rows: any = []; - public Selectedrows: any; + public selected_rows: any[] = []; + public Selectedrows: any[] = []; public devid: number = 0; - public sorting = { - enabled: true, - multiSorting: true, - }; - rowDetail: GuiRowDetail = { - enabled: true, - template: (item) => { - return ` -
-

${item.name}

- ${item.devip} - - - - - - - - - - - - - - - - - - - - - -
User Address${item.address}
User Name${item.username}
Connection Type${item.ctype}
Section${item.section}
Exec time${item.created}
-
Executed Config
- - ${item.config} - -
`; - }, - }; - public paging: GuiPaging = { - enabled: true, - page: 1, - pageSize: 10, - pageSizes: [5, 10, 25, 50], - display: GuiPagingDisplay.ADVANCED, - }; + showLogDetails(log: any) { + this.selectedLog = log; + this.detailsVisible = true; + } - public columnMenu: GuiColumnMenu = { - enabled: true, - sort: true, - columnsManager: true, - }; - - public infoPanel: GuiInfoPanel = { - enabled: true, - infoDialog: false, - columnsManager: true, - schemaManager: true, - }; - - public rowSelection: boolean | GuiRowSelection = { - enabled: true, - type: GuiRowSelectionType.CHECKBOX, - mode: GuiRowSelectionMode.MULTIPLE, - }; + applyFilterGlobal($event: any, stringVal: string) { + this.table.filterGlobal(($event.target as HTMLInputElement).value, stringVal); + } reinitgrid(field: string, $event: any) { if (field == "start") this.filters["start_time"] = $event.target.value; @@ -170,9 +105,10 @@ export class AccComponent implements OnInit { this.initGridTable(); } OnDestroy(): void {} - onSelectedRows(rows: Array): void { - this.rows = rows; - this.Selectedrows = rows.map((m: GuiSelectedRow) => m.source.id); + onSelectionChange(value: any[]) { + this.selected_rows = value; + this.Selectedrows = value.map(item => item.id); + this.rows = value; } removefilter(filter: any) { diff --git a/src/app/views/acc_log/acc.module.ts b/src/app/views/acc_log/acc.module.ts index 1b24182..44bcd50 100644 --- a/src/app/views/acc_log/acc.module.ts +++ b/src/app/views/acc_log/acc.module.ts @@ -13,7 +13,9 @@ import { import { AccRoutingModule } from "./acc-routing.module"; import { AccComponent } from "./acc.component"; -import { GuiGridModule } from "@generic-ui/ngx-grid"; +import { TableModule } from 'primeng/table'; +import { DrawerModule } from 'primeng/drawer'; +import { InputTextModule } from 'primeng/inputtext'; import { MatDatepickerModule } from "@angular/material/datepicker"; import { MatInputModule } from "@angular/material/input"; @@ -32,7 +34,9 @@ import { FormsModule } from "@angular/forms"; ButtonModule, FormModule, ButtonModule, - GuiGridModule, + TableModule, + DrawerModule, + InputTextModule, CollapseModule, MatFormFieldModule, MatInputModule, diff --git a/src/app/views/auth_log/auth.component.html b/src/app/views/auth_log/auth.component.html index 0cee1ea..02502b2 100644 --- a/src/app/views/auth_log/auth.component.html +++ b/src/app/views/auth_log/auth.component.html @@ -1,6 +1,6 @@ - + @@ -14,8 +14,10 @@ Filtered Result For Device ID {{devid}} - - Showing last 24 hours logs by default. Use filters to modify the date and time. + + Showing last 24 hours logs by + default. Use filters to modify the date and time. @@ -95,64 +97,180 @@ - - - - {{value}} - - - - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - -
{{value}}
-
-
- - - {{value}} - - +
+ + + + +
- - - {{value}} - {{item.message}} + - - + + + +
+ #No + +
+ + +
+ Device Name + + + + +
+ + +
+ Device IP + + + + +
+ + +
+ Username + + + + +
+ + +
+ With + + + + +
+ + +
+ IP Address + + + + +
+ + +
+ Time/Msg + + + + +
+ + +
+ State + + +
+ + +
+ Date + + +
+ + +
- - - Logged In - Logged Out - Failed - - - - - {{value}} - - -
+ + + {{item.index}} + + + + {{item.name}} + + {{item.devip}} + {{item.username}} + {{item.by}} + {{item.ip}} + + {{item.duration}} + {{item.message}} + + + Logged In + Logged Out + Failed + + {{item.created}} + + + + + + No authentication logs found. + + + + + + +
+
Session Info
+
+
Device:
+
{{selectedLog.name}} ({{selectedLog.devip}})
+
+
+
User:
+
{{selectedLog.username}}
+
+
+
Method:
+
{{selectedLog.by}}
+
+
+
Status:
+
+ Logged In + Logged Out + Failed +
+
+ +
Connection
+
+
IP/MAC:
+
{{selectedLog.ip}}
+
+
+
Duration:
+
{{selectedLog.duration}}
+
+
+
Date:
+
{{selectedLog.created}}
+
+ +
+
System Message
+
+ {{selectedLog.message}} +
+
+
+
diff --git a/src/app/views/auth_log/auth.component.ts b/src/app/views/auth_log/auth.component.ts index 63f06a4..7e59097 100644 --- a/src/app/views/auth_log/auth.component.ts +++ b/src/app/views/auth_log/auth.component.ts @@ -1,18 +1,8 @@ -import { Component, OnInit, ViewEncapsulation,Input } from "@angular/core"; +import { Component, OnInit, ViewChild, ViewEncapsulation, Input } from "@angular/core"; import { dataProvider } from "../../providers/mikrowizard/data"; import { Router, ActivatedRoute } from "@angular/router"; import { loginChecker } from "../../providers/login_checker"; -import { - GuiSelectedRow, - GuiInfoPanel, - GuiColumn, - GuiColumnMenu, - GuiPaging, - GuiPagingDisplay, - GuiRowSelectionMode, - GuiRowSelection, - GuiRowSelectionType, -} from "@generic-ui/ngx-grid"; +import { Table } from 'primeng/table'; import { formatInTimeZone } from "date-fns-tz"; interface IUser { @@ -37,10 +27,14 @@ interface IUser { }) export class AuthComponent implements OnInit { @Input() component_devid: any=false; - public uid: number; - public uname: string; + public uid!: number; + public uname!: string; public tz: string = "UTC"; - public filterText: string; + public filterText!: string; + public detailsVisible: boolean = false; + public selectedLog: any = null; + + @ViewChild('dt') table!: Table; public devid: number = 0; public reloading: boolean = false; public filters: any = { @@ -87,42 +81,19 @@ export class AuthComponent implements OnInit { } } public source: Array = []; - public columns: Array = []; public loading: boolean = true; public rows: any = []; - public Selectedrows: any; + public selected_rows: any[] = []; // Used by p-table selection + public Selectedrows: any[] = []; // ID array for legacy actions - public sorting = { - enabled: true, - multiSorting: true, - }; + showLogDetails(log: any) { + this.selectedLog = log; + this.detailsVisible = true; + } - public paging: GuiPaging = { - enabled: true, - page: 1, - pageSize: 10, - pageSizes: [5, 10, 25, 50], - display: GuiPagingDisplay.ADVANCED, - }; - - public columnMenu: GuiColumnMenu = { - enabled: true, - sort: true, - columnsManager: true, - }; - - public infoPanel: GuiInfoPanel = { - enabled: true, - infoDialog: false, - columnsManager: true, - schemaManager: true, - }; - - public rowSelection: boolean | GuiRowSelection = { - enabled: true, - type: GuiRowSelectionType.CHECKBOX, - mode: GuiRowSelectionMode.MULTIPLE, - }; + applyFilterGlobal($event: any, stringVal: string) { + this.table.filterGlobal(($event.target as HTMLInputElement).value, stringVal); + } reinitgrid(field: string, $event: any) { if (field == "start") this.filters["start_time"] = $event.target.value; @@ -179,9 +150,10 @@ export class AuthComponent implements OnInit { } this.initGridTable(); } - onSelectedRows(rows: Array): void { - this.rows = rows; - this.Selectedrows = rows.map((m: GuiSelectedRow) => m.source.id); + onSelectionChange(value: any[]) { + this.selected_rows = value; + this.Selectedrows = value.map(item => item.id); + this.rows = value; } removefilter(filter: any) { diff --git a/src/app/views/auth_log/auth.module.ts b/src/app/views/auth_log/auth.module.ts index 163612e..3b39569 100644 --- a/src/app/views/auth_log/auth.module.ts +++ b/src/app/views/auth_log/auth.module.ts @@ -11,7 +11,10 @@ import { } from '@coreui/angular'; import { AuthRoutingModule } from './auth-routing.module'; import { AuthComponent } from './auth.component'; -import { GuiGridModule } from '@generic-ui/ngx-grid'; +import { TableModule } from 'primeng/table'; +import { DrawerModule } from 'primeng/drawer'; +import { InputTextModule } from 'primeng/inputtext'; +import { TooltipModule } from 'primeng/tooltip'; import { FormsModule } from '@angular/forms'; @@ -27,7 +30,10 @@ import {MatSelectModule} from '@angular/material/select'; GridModule, FormsModule, ButtonModule, - GuiGridModule, + TableModule, + DrawerModule, + InputTextModule, + TooltipModule, CollapseModule, MatFormFieldModule, MatInputModule, diff --git a/src/app/views/backups/backups.component.html b/src/app/views/backups/backups.component.html index cd82daa..a4d4f25 100644 --- a/src/app/views/backups/backups.component.html +++ b/src/app/views/backups/backups.component.html @@ -20,15 +20,14 @@ {{compareitems.length}} Selected
- {{item.devname}} -
- @@ -84,8 +83,8 @@ Config Search - + @@ -93,65 +92,104 @@ - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - - {{value}} - - - - -
- - - -
-
-
-
+
+ + + + +
+ + + + + + +
+ #No + +
+ + +
+ Device Name + + + + +
+ + +
+ Device IP + + + + +
+ + +
+ Backup Time + + + + +
+ + +
+ File Size + + + + +
+ + Actions + +
+ + + + {{item.index}} + {{item.devname}} + {{item.devip}} + {{item.createdC}} + {{item.filesize}} + +
+ + + +
+ + +
+ + + + No backups found. + + +
@@ -166,11 +204,12 @@ -
{{codeForHighlightAuto}}
+
{{codeForHighlightAuto}}
-
@@ -230,7 +269,7 @@
Restore Configuration Backup
- +
Backup Details
@@ -276,7 +315,7 @@

To proceed with this critical action, type CONFIRM in the box below:

-
@@ -290,8 +329,7 @@ - diff --git a/src/app/views/backups/backups.component.ts b/src/app/views/backups/backups.component.ts index 68a0b62..b041ff6 100644 --- a/src/app/views/backups/backups.component.ts +++ b/src/app/views/backups/backups.component.ts @@ -1,18 +1,8 @@ -import { Component, OnInit, QueryList, ViewChildren } from "@angular/core"; +import { Component, OnInit, QueryList, ViewChildren, ViewChild } from "@angular/core"; import { dataProvider } from "../../providers/mikrowizard/data"; import { Router, ActivatedRoute } from "@angular/router"; import { loginChecker } from "../../providers/login_checker"; -import { - GuiSearching, - GuiInfoPanel, - GuiColumn, - GuiColumnMenu, - GuiPaging, - GuiPagingDisplay, - GuiRowSelectionMode, - GuiRowSelection, - GuiRowSelectionType, -} from "@generic-ui/ngx-grid"; +import { Table } from 'primeng/table'; import { formatInTimeZone } from "date-fns-tz"; import { ToasterComponent } from "@coreui/angular"; import { AppToastComponent } from "../toast-simple/toast.component"; @@ -22,10 +12,10 @@ import { AppToastComponent } from "../toast-simple/toast.component"; styleUrls: ["backups.component.scss"], }) export class BackupsComponent implements OnInit { - public uid: number; - public uname: string; + public uid: number = 0; + public uname: string = ''; public tz: string = "UTC"; - public filterText: string; + public filterText: string = ''; public filters: any = {}; public codeForHighlightAuto: string = ""; public ispro: boolean = false; @@ -69,34 +59,19 @@ export class BackupsComponent implements OnInit { return value !== undefined && value !== null && value !== ""; } } + @ViewChild("dt") table!: Table; @ViewChildren(ToasterComponent) viewChildren!: QueryList; public source: Array = []; - public columns: Array = []; public loading: boolean = true; - public backuploading : boolean=false; + public backuploading: boolean = false; public rows: any = []; public Selectedrows: any; public BakcupModalVisible: boolean = false; public devid: number = 0; public filters_visible: boolean = false; - public currentBackup:any=false; - public hlang:string=''; - public sorting = { - enabled: true, - multiSorting: true, - }; - searching: GuiSearching = { - enabled: true, - placeholder: "Search Devices", - }; - public paging: GuiPaging = { - enabled: true, - page: 1, - pageSize: 10, - pageSizes: [5, 10, 25, 50], - display: GuiPagingDisplay.ADVANCED, - }; + public currentBackup: any = false; + public hlang: string = ''; toasterForm = { autohide: true, @@ -105,25 +80,10 @@ export class BackupsComponent implements OnInit { fade: true, closeButton: true, }; - - public columnMenu: GuiColumnMenu = { - enabled: true, - sort: true, - columnsManager: true, - }; - public infoPanel: GuiInfoPanel = { - enabled: true, - infoDialog: false, - columnsManager: true, - schemaManager: true, - }; - - public rowSelection: boolean | GuiRowSelection = { - enabled: true, - type: GuiRowSelectionType.CHECKBOX, - mode: GuiRowSelectionMode.MULTIPLE, - }; + applyFilterGlobal($event: any, stringVal: string) { + this.table.filterGlobal(($event.target as HTMLInputElement).value, stringVal); + } ngOnInit(): void { this.devid = Number(this.route.snapshot.paramMap.get("devid")); diff --git a/src/app/views/backups/backups.module.ts b/src/app/views/backups/backups.module.ts index b24187a..5185bfb 100644 --- a/src/app/views/backups/backups.module.ts +++ b/src/app/views/backups/backups.module.ts @@ -17,7 +17,9 @@ import { import { BackupsRoutingModule } from "./backups-routing.module"; import { BackupsComponent } from "./backups.component"; -import { GuiGridModule } from "@generic-ui/ngx-grid"; +import { TableModule } from 'primeng/table'; +import { InputTextModule } from 'primeng/inputtext'; +import { TooltipModule } from 'primeng/tooltip'; import { MatDatepickerModule } from "@angular/material/datepicker"; import { MatInputModule } from "@angular/material/input"; import { MatFormFieldModule } from "@angular/material/form-field"; @@ -35,7 +37,9 @@ import { ClipboardModule } from "@angular/cdk/clipboard"; FormModule, FormsModule, ButtonModule, - GuiGridModule, + TableModule, + InputTextModule, + TooltipModule, CollapseModule, BadgeModule, AlertModule, diff --git a/src/app/views/cloner/cloner.component.html b/src/app/views/cloner/cloner.component.html index 67fd369..3a87e0b 100644 --- a/src/app/views/cloner/cloner.component.html +++ b/src/app/views/cloner/cloner.component.html @@ -13,107 +13,170 @@ - - - - {{value}} - - - - - {{value}} - - - - - {{value == 'twoway' ? 'Two Way' : 'Master Mode'}} - - - - - {{value ? 'Active' : 'Inactive'}} - - - - - {{value}} - - - - - - - - - - +
+ + + + +
+ + + + + + +
+ Name + + + + +
+ + +
+ Description + + + + +
+ + +
+ Direction + + + + +
+ + +
+ Live Mode + + + + +
+ + +
+ Schedule + + + + +
+ + Actions + +
+ + + + {{item.name}} + {{item.description}} + + + {{item.direction == 'twoway' ? 'Two Way' : 'Master Mode'}} + + + + {{item.live_mode ? 'Active' : + 'Inactive'}} + + {{item.desc_cron}} + +
+ + +
+ + +
+ + + + No cloners found. + + +
- - -
Edit Cloner: {{SelectedCloner['name']}}
-
Add New Cloner
- -
- - -
-
-
Basic Information
-
- - - - - - - - + + +
Edit Cloner: + {{SelectedCloner['name']}}
+
Add New Cloner
+ +
+ + +
+
+
Basic Information
+ + + + + + + + +
- -
-
-
Synchronization Settings
-
- - - - - - - - - - - - - - - - - - + +
+
+
Synchronization Settings
+ + + + + + + + + + + + + + + + + + +
- - + - -
-
-
Commands Configuration
-
-
-