From cfbffe1f649207eaf4d93685289b087ae8660286 Mon Sep 17 00:00:00 2001 From: sepehr Date: Fri, 2 Aug 2024 20:40:58 +0330 Subject: [PATCH] monitoring bugs and devices list pagination fix --- package.json | 1 + src/app/providers/mikrowizard/data.ts | 13 ++- src/app/views/devices/devices.component.ts | 4 +- .../monitoring/monitoring.component.html | 22 ++-- .../monitoring/monitoring.component.scss | 12 +++ .../views/monitoring/monitoring.component.ts | 100 ++++++++++++++++-- src/app/views/monitoring/monitoring.module.ts | 7 +- 7 files changed, 131 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 9bf4c8c..f96143c 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,7 @@ "ngx-date-fns": "^11.0.0", "ngx-diff": "^9.0.0", "ngx-highlightjs": "^12.0.0", + "ngx-infinite-scroll": "^18.0.0", "ngx-mat-select-search": "^7.0.6", "ngx-material-date-fns-adapter": "^18.0.0", "ngx-scrollbar": "^13.0.3", diff --git a/src/app/providers/mikrowizard/data.ts b/src/app/providers/mikrowizard/data.ts index f7fa80a..975c152 100644 --- a/src/app/providers/mikrowizard/data.ts +++ b/src/app/providers/mikrowizard/data.ts @@ -77,9 +77,13 @@ export class dataProvider { } return this.MikroWizardRPC.sendJsonRequest("/api/dashboard/stats", data); } - monitoring_devices_events(){ + monitoring_devices_events(page:number,textfilter:string=''){ + var data={ + 'page':page, + 'textfilter':textfilter + } - return this.MikroWizardRPC.sendJsonRequest("/api/monitoring/devs/get", {}); + return this.MikroWizardRPC.sendJsonRequest("/api/monitoring/devs/get", data); } monitoring_events_fix(event_id:number){ @@ -89,9 +93,10 @@ export class dataProvider { return this.MikroWizardRPC.sendJsonRequest("/api/monitoring/events/fix", data); } - monitoring_all_events(devid:number){ + monitoring_all_events(devid:number,page:number){ var data={ - 'devid':devid + 'devid':devid, + 'page':page } return this.MikroWizardRPC.sendJsonRequest("/api/monitoring/events/get", data); } diff --git a/src/app/views/devices/devices.component.ts b/src/app/views/devices/devices.component.ts index 03042bd..7e4ac50 100644 --- a/src/app/views/devices/devices.component.ts +++ b/src/app/views/devices/devices.component.ts @@ -416,8 +416,6 @@ export class DevicesComponent implements OnInit, OnDestroy { var data = { group_id: this.selected_group, search: false, - page: this.paging.page, - size: this.paging.pageSize, }; _self.data_provider.get_dev_list(data).then((res) => { @@ -451,7 +449,7 @@ export class DevicesComponent implements OnInit, OnDestroy { // _self.loading = false; // }); //we don't want to reload table if user is selected devices from list - if (_self.Selectedrows.length < 1) _self.initGridTable(); + if (_self.Selectedrows && _self.Selectedrows.length < 1) _self.initGridTable(); }, 10000); } diff --git a/src/app/views/monitoring/monitoring.component.html b/src/app/views/monitoring/monitoring.component.html index e0c494e..b696738 100644 --- a/src/app/views/monitoring/monitoring.component.html +++ b/src/app/views/monitoring/monitoring.component.html @@ -2,20 +2,24 @@ - Devices - + Devices + + + + +
  • | All Devices
    -
    {{CCount}} @@ -44,7 +48,7 @@ [class.fa-tower-broadcast]="x.router_type=='special'"> | {{x.name}}
    -
    {{x.CCount}} @@ -57,6 +61,7 @@
+
@@ -70,8 +75,8 @@ class="fa-solid fa-clock-rotate-left mx-1">{{display}}
- - +
+
@@ -85,7 +90,7 @@ - +
#comment