From 7927f6d7adbef61dfacef6a30d2b1637c43dee46 Mon Sep 17 00:00:00 2001 From: Guilhermo Pazuch <1490938+gpazuch@users.noreply.github.com> Date: Thu, 24 Feb 2022 16:34:41 -0300 Subject: [PATCH] fix(orb-ui): agent group add page matching agents table status (#891) * fix status color * fix time format for last_hb * code style fixes --- .../groups/add/agent.group.add.component.html | 185 +++++++++--------- .../groups/add/agent.group.add.component.scss | 18 ++ .../groups/add/agent.group.add.component.ts | 4 +- 3 files changed, 114 insertions(+), 93 deletions(-) diff --git a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.html b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.html index ccd71c96b..ecb85d221 100644 --- a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.html +++ b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.html @@ -6,10 +6,10 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

- + disableStepNavigation + orientation="vertical"> @@ -18,19 +18,19 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

{{strings.add.step.desc1}}

-
+
*
- + formControlName="name" + fullWidth="true" + nbInput/>

@@ -38,28 +38,28 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

- + nbInput/>
- -
@@ -76,12 +76,12 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

+ [style.background-color]="tag | tagcolor" + class="orb-tag-sink "> {{tag | tagchip}} - @@ -102,15 +102,15 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

*
- + formControlName="key" + fullWidth="true" + nbInput/>
- +
@@ -118,24 +118,24 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

*
- + formControlName="value" + fullWidth="true" + nbInput/>
-
@@ -155,31 +155,31 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}


-
- -
@@ -191,7 +191,7 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

{{strings.add.step.title3}} -
+
@@ -211,9 +211,9 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

+ [style.background-color]="tag | tagcolor" + class="orb-tag-sink "> {{tag | tagchip}} {{strings[isEdit ? 'edit' : 'add']['header']}}

{{strings.match.matchAny}} {{tagMatch.total}} {{strings.match.agents}} - . 

@@ -244,45 +244,45 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}


-
+
+ [headerHeight]="50" + [rowHeight]="50" + [rows]="matchingAgents" + [scrollbarV]="true" + class="orb w-100" + style="height: 500px;">

-
- - @@ -293,30 +293,31 @@

{{strings[isEdit ? 'edit' : 'add']['header']}}

- +
-
- - {{ row.state | titlecase }} -
-
- +
+ {{ row.state | titlecase }}
- +
+ [style.background-color]="tag | tagcolor" + class="orb-tag-sink "> {{tag | tagchip}}
+ + +
+ {{ row.ts_last_hb | date: 'medium' }} +
+
diff --git a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.scss b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.scss index 3438510e3..247350f68 100644 --- a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.scss +++ b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.scss @@ -188,3 +188,21 @@ tr div p { left: 0; width: 900px; } + +.orb-service- { + &new { + color: #9b51e0; + } + &online { + color: #6fcf97; + } + &stale { + color: #f2994a; + } + &error { + color: #df316f; + } + &offline { + color: #969fb9; + } +} \ No newline at end of file diff --git a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.ts b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.ts index 5581eaad9..400a17ae2 100644 --- a/ui/src/app/pages/fleet/groups/add/agent.group.add.component.ts +++ b/ui/src/app/pages/fleet/groups/add/agent.group.add.component.ts @@ -11,7 +11,6 @@ import { AgentsService } from 'app/common/services/agents/agents.service'; import { ColumnMode, TableColumn } from '@swimlane/ngx-datatable'; import { NotificationsService } from 'app/common/services/notifications/notifications.service'; - @Component({ selector: 'ngx-agent-group-add-component', templateUrl: './agent.group.add.component.html', @@ -32,6 +31,8 @@ export class AgentGroupAddComponent implements AfterViewInit { @ViewChild('agentStateTemplateCell') agentStateTemplateRef: TemplateRef; + @ViewChild('agentLastHBTemplateCell') agentLastHBTemplateRef: TemplateRef; + tableFilters: DropdownFilterItem[] = [ { id: '0', @@ -138,6 +139,7 @@ export class AgentGroupAddComponent implements AfterViewInit { { name: 'Last Activity', prop: 'ts_last_hb', + cellTemplate: this.agentLastHBTemplateRef, minWidth: 130, resizeable: false, sortable: false,