aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/faultApp
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/faultApp')
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx23
-rw-r--r--sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx6
2 files changed, 26 insertions, 3 deletions
diff --git a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
index bf96fe38d..06299417d 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
+++ b/sdnr/wt/odlux/apps/faultApp/src/pluginFault.tsx
@@ -42,6 +42,7 @@ import { FaultStatus } from "./components/faultStatus";
import { refreshFaultStatusAsyncAction } from "./actions/statusActions";
let currentMountId: string | undefined = undefined;
+let currentSeverity: string | undefined = undefined;
const mapProps = (state: IApplicationStoreState) => ({
currentProblemsProperties: createCurrentProblemsProperties(state),
@@ -75,8 +76,30 @@ const FaultApplicationRouteAdapter = connect(mapProps, mapDisp)((props: RouteCom
)
});
+const FaulttApplicationAlarmStatusRouteAdapter = connect(mapProps, mapDisp)((props: RouteComponentProps<{ severity?: string }> & Connect<typeof mapProps, typeof mapDisp>) => {
+ if (currentSeverity !== props.match.params.severity) {
+ currentSeverity = props.match.params.severity || undefined;
+ window.setTimeout(() => {
+ if (currentSeverity) {
+ props.setCurrentPanel("CurrentProblem");
+ props.currentProblemsActions.onFilterChanged("severity", currentSeverity);
+ if (!props.currentProblemsProperties.showFilter) {
+ props.currentProblemsActions.onToggleFilter(false);
+ props.currentProblemsActions.onRefresh();
+ }
+ else
+ props.currentProblemsActions.onRefresh();
+ }
+ });
+ }
+ return (
+ <FaultApplication />
+ )
+});
+
const App = withRouter((props: RouteComponentProps) => (
<Switch>
+ <Route path={`${props.match.path}/alarmStatus/:severity?`} component={FaulttApplicationAlarmStatusRouteAdapter} />
<Route path={`${props.match.path}/:mountId?`} component={FaultApplicationRouteAdapter} />
<Redirect to={`${props.match.path}`} />
</Switch>
diff --git a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx
index 6075066fd..7b0c23693 100644
--- a/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx
+++ b/sdnr/wt/odlux/apps/faultApp/src/views/faultApplication.tsx
@@ -137,7 +137,7 @@ class FaultApplicationComponent extends React.Component<FaultApplicationComponen
render(): JSX.Element {
- const refreshButton = {
+ const clearAlarmsAction = {
icon: Sync, tooltip: 'Clear stuck alarms', onClick: this.onDialogOpen
};
@@ -158,7 +158,7 @@ class FaultApplicationComponent extends React.Component<FaultApplicationComponen
};
const areFaultsAvailable = this.props.currentProblemsProperties.rows && this.props.currentProblemsProperties.rows.length > 0
- const customActions = areFaultsAvailable ? [refreshButton, refreshCurrentProblemsAction] : [refreshCurrentProblemsAction];
+ const customActions = areFaultsAvailable ? [clearAlarmsAction, refreshCurrentProblemsAction] : [refreshCurrentProblemsAction];
const { panelId: activePanelId } = this.props;
@@ -191,7 +191,7 @@ class FaultApplicationComponent extends React.Component<FaultApplicationComponen
}
{activePanelId === 'AlarmNotifications' &&
- <FaultAlarmNotificationTable tableId="alarm-notifications-table" idProperty="id" stickyHeader rows={this.props.faultNotifications.faults} asynchronus columns={[
+ <FaultAlarmNotificationTable stickyHeader tableId="alarm-notifications-table" idProperty="id" defaultSortColumn='timeStamp' defaultSortOrder='desc' rows={this.props.faultNotifications.faults} asynchronus columns={[
{ property: "icon", title: "", type: ColumnType.custom, customControl: this.renderIcon },
{ property: "timeStamp", title: "Timestamp" },
{ property: "nodeName", title: "Node Name" },