From 11cb2c56e2f171e74ccc931deffd459455ec9ea2 Mon Sep 17 00:00:00 2001 From: Rob Fellows Date: Thu, 7 Nov 2024 09:08:29 -0500 Subject: [PATCH] [NIFI-13974] - Improve UX of Status History dialog (select all nodes, scrolling left panel) (#9493) This closes #9493 --- .../status-history.component.html | 152 ++++++++++-------- .../status-history.component.scss | 1 + .../status-history.component.ts | 24 +++ 3 files changed, 109 insertions(+), 68 deletions(-) diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.html b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.html index ecfe60f5c007..a7905ff9108f 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.html +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.html @@ -55,87 +55,103 @@

Status History

@if (instances.length > 0 && fieldDescriptors.length > 0) { @if (componentDetails$ | async; as componentDetails) {
-
- @for (detail of details; track detail) { - @if (detail.key && detail.value) { -
-
{{ detail.key }}
-
- {{ detail.value }} +
+
+ @for (detail of details; track detail) { + @if (detail.key && detail.value) { +
+
{{ detail.key }}
+
+ {{ detail.value }} +
-
+ } } - } -
-
Start
-
- {{ minDate }} -
-
-
-
End
-
- {{ maxDate }} -
-
-
-
NiFi
-
-
Min / Max / Mean
+
+
Start
- {{ clusterStats.min }} / {{ clusterStats.max }} / - {{ clusterStats.mean }} + {{ minDate }}
-
- - NiFi +
+
End
+
+ {{ maxDate }} +
-
- @if (!!nodes && nodes.length > 0) {
-
Nodes
-
+
Min / Max / Mean
- {{ nodeStats.min }} / {{ nodeStats.max }} / - {{ nodeStats.mean }} + {{ clusterStats.min }} / {{ clusterStats.max }} / + {{ clusterStats.mean }}
-
- @for (node of nodes; track node) { - @if (node.snapshots?.length) { -
- - {{ node.label }} -
- } - } +
+ NiFi + +
- } + @if (!!nodes && nodes.length > 0) { +
+
+ Nodes + + +
+
+
Min / Max / Mean
+
+ {{ nodeStats.min }} / {{ nodeStats.max }} / + {{ nodeStats.mean }} +
+
+
+ @for (node of nodes; track node.id) { + @if (node.snapshots?.length) { +
+ {{ node.label }} + + +
+ } + } +
+
+ } +
@if (fieldDescriptors$ | async) { diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.scss b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.scss index 51aee015ee5e..04552728cb75 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.scss +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.scss @@ -55,6 +55,7 @@ min-width: 495px; } + .component-details-panel, .component-details { min-width: 300px; max-width: 300px; diff --git a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.ts b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.ts index bdbfc87ea90d..1cbf17449ea3 100644 --- a/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.ts +++ b/nifi-frontend/src/main/frontend/apps/nifi/src/app/ui/common/status-history/status-history.component.ts @@ -244,6 +244,30 @@ export class StatusHistory extends CloseOnEscapeDialog implements OnInit, AfterV protected readonly TextTip = TextTip; + areAllNodesSelected(instanceVisibility: any): boolean { + const unChecked = Object.entries(instanceVisibility) + .filter(([node, checked]) => node !== 'nifi-instance-id' && !checked) + .map(([, checked]) => checked); + return unChecked.length === 0; + } + + areAnyNodesSelected(instanceVisibility: any): boolean { + const checked = Object.entries(instanceVisibility) + .filter(([node, checked]) => node !== 'nifi-instance-id' && checked) + .map(([, checked]) => checked); + return checked.length > 0 && checked.length < this.nodes.length; + } + + selectAllNodesChanged(event: MatCheckboxChange) { + const checked: boolean = event.checked; + const tmpInstanceVisibility: any = {}; + this.nodes.forEach((node: Instance) => { + tmpInstanceVisibility[node.id] = checked; + }); + tmpInstanceVisibility['nifi-instance-id'] = this.instanceVisibility['nifi-instance-id']; + this.instanceVisibility = tmpInstanceVisibility; + } + selectNode(event: MatCheckboxChange) { const instanceId: string = event.source.value; const checked: boolean = event.checked;