{GetStatusSymbol(data.Status)}
diff --git a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/DeviceHealthReport/DeviceHealthReport.tsx b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/DeviceHealthReport/DeviceHealthReport.tsx
index 994b58ee3..ab3d0eeb6 100644
--- a/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/DeviceHealthReport/DeviceHealthReport.tsx
+++ b/Source/Applications/SystemCenter/wwwroot/Scripts/TSX/SystemCenter/DeviceHealthReport/DeviceHealthReport.tsx
@@ -22,7 +22,7 @@
//******************************************************************************************************
import * as React from 'react';
-import { Table, Column } from '@gpa-gemstone/react-table';
+import { Table, Column, Paging } from '@gpa-gemstone/react-table';
import * as _ from 'lodash';
import { Application, SystemCenter } from '@gpa-gemstone/application-typings';
import { SystemCenter as SCGlobal } from '../global';
@@ -32,7 +32,14 @@ import { SystemCenterSettingSlice } from '../Store/Store';
import moment from 'moment';
import { ReactIcons } from '@gpa-gemstone/gpa-symbols';
import AppStatus from './AppStatus'
-import { ErrorBoundary } from '@gpa-gemstone/common-pages'
+import { ToolTip } from '@gpa-gemstone/react-forms'
+
+interface IPagedResult {
+ Data: string,
+ NumberOfPages: number,
+ TotalRecords: number,
+ RecordsPerPage: number
+}
const defaultSearchcols: Search.IField
[] = [
{ label: 'Name', key: 'Name', type: 'string', isPivotField: false },
@@ -65,23 +72,27 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
const settings = useAppSelector(SystemCenterSettingSlice.Data);
const settingStatus = useAppSelector(SystemCenterSettingSlice.Status);
+ const [hovered, setHovered] = React.useState(null);
+ const [pagedData, setPagedData] = React.useState(null);
+ const [page, setPage] = React.useState(0);
React.useEffect(() => {
let handle = getMeters();
handle.done((dt: string) => {
setSearchState('Idle');
- setData(JSON.parse(dt) as SCGlobal.DeviceHealthReport[]);
+ const pagedResults = JSON.parse(dt) as IPagedResult;
+ setPagedData(pagedResults);
+ setData(JSON.parse(pagedResults.Data) as SCGlobal.DeviceHealthReport[])
}).fail((d) => setSearchState('Error'));
return function cleanup() {
if (handle.abort != null)
handle.abort();
}
- }, [sortKey, ascending, search]);
+ }, [sortKey, ascending, search, page]);
React.useEffect(() => {
let handle = getAdditionalFields();
-
return () => {
if (handle.abort != null) handle.abort();
}
@@ -93,14 +104,12 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
}, [settingStatus]);
-
- function getMeters(): JQuery.jqXHR{
+ function getMeters(): JQuery.jqXHR {
setSearchState('Loading');
let searches = search.map(s => { if (defaultSearchcols.findIndex(item => item.key == s.FieldName) == -1) return { ...s, IsPivotColumn: true }; else return s; })
-
return $.ajax({
type: "Post",
- url: `${homePath}api/DeviceHealthReport/SearchableList`,
+ url: `${homePath}api/DeviceHealthReport/PagedList/${page}`,
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: JSON.stringify({ Searches: searches, OrderBy: sortKey, Ascending: ascending }),
@@ -157,30 +166,30 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
CollumnList={filterableList} SetFilter={(flds) => setSearch(flds)} Direction={'left'} defaultCollumn={standardSearch} Width={'50%'} Label={'Search'} StorageID="DeviceHealthReportFilter"
- ShowLoading={searchState == 'Loading'} ResultNote={searchState == 'Error' ? 'Could not complete Search' : 'Found ' + data.length + ' Meter(s)'}
- GetEnum={(setOptions, field) => {
- let handle = null;
- if (field.type != 'enum' || field.enum == undefined || field.enum.length != 1)
- return () => { };
-
- handle = $.ajax({
- type: "GET",
- url: `${homePath}api/ValueList/Group/${field.enum[0].Value}`,
- contentType: "application/json; charset=utf-8",
- dataType: 'json',
- cache: true,
- async: true
- });
-
- handle.done(d => setOptions(d.map(item => ({ Value: item.Value.toString(), Label: item.Text }))))
- return () => { if (handle != null && handle.abort == null) handle.abort(); }
- }}
+ ShowLoading={searchState == 'Loading'} ResultNote={searchState == 'Error' ? 'Could not complete Search' : 'Found ' + data.length + ' Meter(s)'}
+ GetEnum={(setOptions, field) => {
+ let handle = null;
+ if (field.type != 'enum' || field.enum == undefined || field.enum.length != 1)
+ return () => { };
+
+ handle = $.ajax({
+ type: "GET",
+ url: `${homePath}api/ValueList/Group/${field.enum[0].Value}`,
+ contentType: "application/json; charset=utf-8",
+ dataType: 'json',
+ cache: true,
+ async: true
+ });
+
+ handle.done(d => setOptions(d.map(item => ({ Value: item.Value.toString(), Label: item.Text }))))
+ return () => { if (handle != null && handle.abort == null) handle.abort(); }
+ }}
>
@@ -227,7 +236,7 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
Field={'Name'}
HeaderStyle={{ width: 'auto' }}
RowStyle={{ width: 'auto' }}
- Content={({ item, field }) =>
{item[field]} }
+ Content={({ item, field }) =>
{item[field]}}
> Name
@@ -261,7 +270,7 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
return item.LocationKey
}}
-
+
> Substn
@@ -270,7 +279,7 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
Field={'Model'}
HeaderStyle={{ width: '8%' }}
RowStyle={{ width: '8%' }}
- Content={({ item, field }) => {
+ Content={({ item, field }) => {
const MimdUrl = settings.find(s => s.Name == 'MiMD.Url')?.Value;
if (MimdUrl != undefined)
@@ -286,7 +295,7 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
Field={'TSC'}
HeaderStyle={{ width: 50 }}
RowStyle={{ width: 50 }}
- Content={({ item, field }) => {item[field]} }
+ Content={({ item, field }) => {item[field]}}
> TSC
@@ -295,7 +304,7 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
Field={'Sector'}
HeaderStyle={{ width: '5%' }}
RowStyle={{ width: '5%' }}
- Content={({ item, field }) => {item[field]} }
+ Content={({ item, field }) => {item[field]}}
> Sector
@@ -336,6 +345,39 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
Field={'BadDays'}
HeaderStyle={{ width: 100 }}
RowStyle={{ width: 100, textAlign: 'center' }}
+ Content={({ item, key, index }) => {
+ if (item[key] == undefined)
+ return '';
+ return (
+ <>
+ setHovered(index)}
+ onMouseLeave={() => setHovered(null)}
+ >
+ {item[key]}
+
+
+ {item['MICBadDays'] == null ? null :
+ -
+ {`openMIC: ${item['MICBadDays']}`}
+
+ }
+ -
+ {`miMD: ${item['MiMDBadDays']}`}
+
+ -
+ {`openXDA: ${item['XDABadDays']}`}
+
+
+
+ >
+ )
+ }}
> Bad Days
@@ -446,6 +488,12 @@ const DeviceHealthReport: Application.Types.iByComponent = (props) => {
+