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 | 168 ++++++++++-------- .../status-history.component.scss | 1 + .../status-history.component.ts | 24 +++ 3 files changed, 117 insertions(+), 76 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 ecfe60f5c0..a7905ff910 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 @@ @if (instances.length > 0 && fieldDescriptors.length > 0) { @if (componentDetails$ | async; as componentDetails) {
-
- @for (detail of details; track detail) { - @if (detail.key && detail.value) { +
+
+ @for (detail of details; track detail) { + @if (detail.key && detail.value) { +
+
{{ detail.key }}
+
+ {{ detail.value }} +
+
+ } + } +
+
Start
+
+ {{ minDate }} +
+
+
+
End
+
+ {{ maxDate }} +
+
+
+
+
Min / Max / Mean
+
+ {{ clusterStats.min }} / {{ clusterStats.max }} / + {{ clusterStats.mean }} +
+
+
+ NiFi + + +
+
+ @if (!!nodes && nodes.length > 0) {
-
{{ detail.key }}
-
- {{ detail.value }} +
+ Nodes + + +
+
+
Min / Max / Mean
+
+ {{ nodeStats.min }} / {{ nodeStats.max }} / + {{ nodeStats.mean }} +
+
+
+ @for (node of nodes; track node.id) { + @if (node.snapshots?.length) { +
+ {{ node.label }} + + +
+ } + }
} - } -
-
Start
-
- {{ minDate }} -
-
-
End
-
- {{ maxDate }} -
-
-
-
NiFi
-
-
Min / Max / Mean
-
- {{ clusterStats.min }} / {{ clusterStats.max }} / - {{ clusterStats.mean }} -
-
-
- - NiFi -
-
- @if (!!nodes && nodes.length > 0) { -
-
Nodes
-
-
Min / Max / Mean
-
- {{ nodeStats.min }} / {{ nodeStats.max }} / - {{ nodeStats.mean }} -
-
-
- @for (node of nodes; track node) { - @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 51aee015ee..04552728cb 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 bdbfc87ea9..1cbf17449e 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;