From 9e5a9d0515c093c2fd7456fa55e4c079da220086 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Thu, 31 Aug 2023 13:32:21 -0300 Subject: [PATCH 01/27] fix(orb-ui): Improve policy view header positioning (#2597) --- .../view/agent.policy.view.component.html | 55 +++++++++---------- .../view/agent.policy.view.component.scss | 12 +++- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html index 3fe199805..935162b35 100644 --- a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html +++ b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html @@ -1,5 +1,5 @@
-
+
Policy View
-
-
- - - Last Update: {{ lastUpdate | date: 'HH:mm:ss a' }} - -
- - - - -
-
+
+ + + Last Update: {{ lastUpdate | date: 'HH:mm:ss a' }} + + +
+ + + +
+
diff --git a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss index 0d9922742..ed8590490 100644 --- a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss +++ b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss @@ -235,7 +235,17 @@ button { color: #969fb9; font-size: 14px; } +header { + display: flex; + justify-content: space-between; + align-items: center; +} + +.left-content { + flex: 1; +} + .right-content { display: flex; - justify-content: flex-end; + align-items: center; } From c258620ae1950661826a115cd65a400167b830d6 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Thu, 31 Aug 2023 13:32:35 -0300 Subject: [PATCH 02/27] fix(orb-ui): #1096 Update Matching agent styles (#2596) --- ui/src/app/@theme/styles/_overrides.scss | 4 +-- .../agents/match/agent.match.component.html | 29 ++++++++++++------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ui/src/app/@theme/styles/_overrides.scss b/ui/src/app/@theme/styles/_overrides.scss index 1c0f54936..8d9c57da1 100644 --- a/ui/src/app/@theme/styles/_overrides.scss +++ b/ui/src/app/@theme/styles/_overrides.scss @@ -206,13 +206,13 @@ &online, &healthy { color: #6fcf97; } - &stale, &none { + &stale { color: #f2994a; } &error, &failure { color: #df316f; } - &offline { + &offline, &none { color: #969fb9; } } diff --git a/ui/src/app/pages/fleet/agents/match/agent.match.component.html b/ui/src/app/pages/fleet/agents/match/agent.match.component.html index 9dbd339fa..7e026295f 100644 --- a/ui/src/app/pages/fleet/agents/match/agent.match.component.html +++ b/ui/src/app/pages/fleet/agents/match/agent.match.component.html @@ -50,16 +50,25 @@ -
- - - {{tag | tagchip}} - - -
+ + + {{ tag.key }}:  + {{ tag.value }} + + + No tag were created + +
Date: Thu, 31 Aug 2023 13:32:55 -0300 Subject: [PATCH 03/27] fix(orb-ui): #124 center align agent key (#2595) --- ui/src/app/pages/fleet/agents/key/agent.key.component.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss index c11ef7c7a..7fb7e39ac 100644 --- a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss +++ b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss @@ -35,6 +35,7 @@ nb-card { align-content: space-between; align-items: flex-start; justify-content: space-between; + margin: 0; background: transparent; padding: 0.75rem; From 1b3bf23b8ac2f63befaba3ad4659806d0699b2a2 Mon Sep 17 00:00:00 2001 From: Luiz Pegoraro Date: Thu, 31 Aug 2023 14:56:54 -0300 Subject: [PATCH 04/27] fix(maestro): increase log tail on otel-collectors. --- maestro/monitor/monitor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maestro/monitor/monitor.go b/maestro/monitor/monitor.go index c9fa10ccc..5ac8a7ccd 100644 --- a/maestro/monitor/monitor.go +++ b/maestro/monitor/monitor.go @@ -71,7 +71,7 @@ func (svc *monitorService) Start(ctx context.Context, cancelFunc context.CancelF } func (svc *monitorService) getPodLogs(ctx context.Context, pod k8scorev1.Pod) ([]string, error) { - maxTailLines := int64(1) + maxTailLines := int64(10) sinceSeconds := int64(300) podLogOpts := k8scorev1.PodLogOptions{TailLines: &maxTailLines, SinceSeconds: &sinceSeconds} config, err := rest.InClusterConfig() From c2c7f368f17db75cc71b6cce71f0e91ca4df34ec Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Thu, 31 Aug 2023 16:30:38 -0300 Subject: [PATCH 05/27] improvement(orb-ui): #1095 Add Group page style and design (#2601) --- ui/src/app/@theme/styles/_overrides.scss | 3 + .../add/agent.policy.add.component.html | 53 +++---- .../add/agent.policy.add.component.scss | 3 + .../fleet/agents/add/agent.add.component.html | 86 +++++------ .../fleet/agents/add/agent.add.component.scss | 4 + .../groups/add/agent.group.add.component.html | 146 ++++++++++-------- .../groups/add/agent.group.add.component.scss | 22 ++- .../groups/add/agent.group.add.component.ts | 22 +-- .../agent.group.details.component.html | 21 ++- .../agent.group.details.component.scss | 7 +- .../tag-control/tag-control.component.scss | 2 +- 11 files changed, 206 insertions(+), 163 deletions(-) diff --git a/ui/src/app/@theme/styles/_overrides.scss b/ui/src/app/@theme/styles/_overrides.scss index 8d9c57da1..01705e612 100644 --- a/ui/src/app/@theme/styles/_overrides.scss +++ b/ui/src/app/@theme/styles/_overrides.scss @@ -265,3 +265,6 @@ width: 110px; background-color: #df316f !important; } +p { + font-family: 'Montserrat' !important; +} \ No newline at end of file diff --git a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html index a27a7707e..b821fec29 100644 --- a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html +++ b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html @@ -104,19 +104,8 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

+
- +
@@ -191,17 +192,13 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

diff --git a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.scss b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.scss index 0af6c504f..e9726339e 100644 --- a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.scss +++ b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.scss @@ -22,6 +22,9 @@ nb-card-footer { mat-chip nb-icon { font-size: 1rem; } +label { + color: #969FB9; +} ngx-tag-control, ngx-tag-display { margin-top: 20px; diff --git a/ui/src/app/pages/fleet/agents/add/agent.add.component.html b/ui/src/app/pages/fleet/agents/add/agent.add.component.html index c8bdea7fe..c241071fd 100644 --- a/ui/src/app/pages/fleet/agents/add/agent.add.component.html +++ b/ui/src/app/pages/fleet/agents/add/agent.add.component.html @@ -51,16 +51,6 @@

{{isEdit ? 'Edit Agent' : 'New Agent'}}


- +
@@ -89,23 +89,6 @@

{{isEdit ? 'Edit Agent' : 'New Agent'}}


- - + +
{{isEdit ? 'Edit Agent' : 'New Agent'}}
- - +
diff --git a/ui/src/app/pages/fleet/agents/add/agent.add.component.scss b/ui/src/app/pages/fleet/agents/add/agent.add.component.scss index d708b3e00..94227d0d4 100644 --- a/ui/src/app/pages/fleet/agents/add/agent.add.component.scss +++ b/ui/src/app/pages/fleet/agents/add/agent.add.component.scss @@ -107,6 +107,10 @@ nb-card-footer { } } +label { + color: #969FB9; +} + .required { color: #df316f; padding-left: 2px; 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 b5f3cb496..4101ddb1c 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 @@ -68,6 +68,16 @@

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


+ -
@@ -104,21 +104,20 @@

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

(tagsChange)="updateMatches()" [(tags)]="selectedTags"> -
-
-

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

-

- {{strings.match.matchNone}} -

-
+
+

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

+

+ {{strings.match.matchNone}} +

{{strings[isEdit ? 'edit' : 'add']['header']}}
@@ -166,25 +165,26 @@

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

- +

{{firstFormGroup.controls.name.value}}


- -

{{firstFormGroup.controls.description.value}}

+ +

{{firstFormGroup.controls.description.value}}

+

No description added


+
@@ -192,14 +192,15 @@

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

-

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

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

{{strings.match.matchNone}} @@ -216,15 +217,13 @@

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


@@ -270,12 +271,23 @@

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

let-i="index" let-row="row" let-value="value"> - + - {{tag | tagchip}} + style="background-color: #2B3148;" + class="orb-tag-chip" + > + {{ tag.key }}:  + {{ tag.value }} + + + No tag were created @@ -296,7 +308,7 @@

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

Object.entries(a) @@ -177,8 +171,8 @@ export class AgentGroupAddComponent { prop: 'state', name: 'Status', - flexGrow: 1, - resizeable: false, + resizeable: true, + canAutoResize: false, width: 120, cellTemplate: this.agentStateTemplateRef, }, diff --git a/ui/src/app/pages/fleet/groups/details/agent.group.details.component.html b/ui/src/app/pages/fleet/groups/details/agent.group.details.component.html index da2e7d5d8..c50a42f65 100644 --- a/ui/src/app/pages/fleet/groups/details/agent.group.details.component.html +++ b/ui/src/app/pages/fleet/groups/details/agent.group.details.component.html @@ -27,13 +27,24 @@

{{strings.propNames.tags}}

-
+
- {{tag | tagchip}} + *ngFor="let tag of agentGroup.tags | keyvalue" + style="background-color: #2B3148;" + class="orb-tag-chip" + > + {{ tag.key }}:  + {{ tag.value }} + + + No tag were created
diff --git a/ui/src/app/pages/fleet/groups/details/agent.group.details.component.scss b/ui/src/app/pages/fleet/groups/details/agent.group.details.component.scss index 15e268be0..f28cb3381 100644 --- a/ui/src/app/pages/fleet/groups/details/agent.group.details.component.scss +++ b/ui/src/app/pages/fleet/groups/details/agent.group.details.component.scss @@ -67,4 +67,9 @@ nb-tabset { margin-bottom: 0.4rem; } } - +.background { + background-color: #232940; + padding: 10px; + border-radius: 8px; + margin-bottom: 20px; +} diff --git a/ui/src/app/shared/components/orb/tag-control/tag-control.component.scss b/ui/src/app/shared/components/orb/tag-control/tag-control.component.scss index 7f64feb57..1bb06d106 100644 --- a/ui/src/app/shared/components/orb/tag-control/tag-control.component.scss +++ b/ui/src/app/shared/components/orb/tag-control/tag-control.component.scss @@ -17,7 +17,7 @@ mat-chip nb-icon { } .add-button { border: none !important; - background: #2F3D59 !important; + background: #1e2941 !important; } .add-button:disabled{ background-color: transparent !important; From 5159884d6e0153b0f7e99470e1c232af4319b2d4 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Thu, 31 Aug 2023 17:22:37 -0300 Subject: [PATCH 06/27] fix(orb-ui): Adjustments on agent key window, command with config file (#2602) * improve(orb-ui): #40 Agent Credentials, add tooltip and link to documentation * tooltip --- .../app/pages/dashboard/dashboard.component.scss | 12 ++++++------ .../fleet/agents/key/agent.key.component.html | 14 ++++++++++++-- .../fleet/agents/key/agent.key.component.scss | 15 ++++++++++++++- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/ui/src/app/pages/dashboard/dashboard.component.scss b/ui/src/app/pages/dashboard/dashboard.component.scss index f91f42262..af7247aa2 100644 --- a/ui/src/app/pages/dashboard/dashboard.component.scss +++ b/ui/src/app/pages/dashboard/dashboard.component.scss @@ -96,16 +96,16 @@ h6 { line-height: 24px !important; & > a { - white-space: nowrap; - padding: 0 0.3rem; - background-color: #3089fc; + white-space: nowrap !important; + padding: 0 0.3rem !important; + background-color: #3089fc !important; font-weight: 700 !important; text-decoration: none !important; - text-underline: none; + text-underline: none !important; color: #ffffff !important; border-radius: 10px; - link: #ffffff; - fill: #3089fc; + link: #ffffff !important; + fill: #3089fc !important; } } } diff --git a/ui/src/app/pages/fleet/agents/key/agent.key.component.html b/ui/src/app/pages/fleet/agents/key/agent.key.component.html index 406545aff..c908d8b2a 100644 --- a/ui/src/app/pages/fleet/agents/key/agent.key.component.html +++ b/ui/src/app/pages/fleet/agents/key/agent.key.component.html @@ -34,7 +34,7 @@

See here + target="_blank">Click here   for more advanced options.

@@ -82,6 +82,9 @@ pack="eva"> + +
@@ -98,8 +101,15 @@
             {{ fileConfigCommandShow }}
           
         
-
+ +

+ Click here + +   to learn more about how create and apply configuration files. +

diff --git a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss index 7fb7e39ac..a95937510 100644 --- a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss +++ b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss @@ -12,6 +12,9 @@ nb-card { button { float: right; } + nb-icon { + float: right ; + } } nb-card-body { @@ -21,7 +24,7 @@ nb-card { padding: 0; p { - color: #969fb9; + color: #fff; } .ns1-red { @@ -87,3 +90,13 @@ nb-card { color: #df316f !important; } } +a { + white-space: nowrap !important; + padding: 0 0.3rem !important; + background-color: #3089fc !important; + font-weight: 700 !important; + text-decoration: none !important; + color: #ffffff !important; + border-radius: 10px; + fill: #3089fc !important; +} From da7e998f01112eb7a7f4ef1694d76b731ff1264b Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Fri, 1 Sep 2023 13:26:06 -0300 Subject: [PATCH 07/27] feat(orb-ui): #1106 Agent View, include provisioning command with config file (#2603) --- .../agent-provisioning.component.html | 82 +++++++++++++++---- .../agent-provisioning.component.scss | 41 ++++++++-- .../agent-provisioning.component.ts | 68 ++++++++++----- 3 files changed, 147 insertions(+), 44 deletions(-) diff --git a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.html b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.html index 992f267c0..54f375229 100644 --- a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.html +++ b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.html @@ -1,6 +1,6 @@ - + - Provisioning Command + Provisioning Commands -

- To use the provisioning command, you must replace AGENT_KEY with the Agent Key given to you during agent - creation. If you have lost the Agent Key, you must remove and create a new agent. -

-
-      
-      {{ command2show }}
-    
+ + +
+          
+          
+            {{ defaultCommandShow }}
+          
+        
+
+
+ + + Provisioning Command with Configuration File + + + + + +
+          
+          
+            {{ fileConfigCommandShow }}
+          
+        
+
+
+

+ Click here + +   to learn more about how create and apply configuration files. +

diff --git a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.scss b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.scss index da2bdb0d6..cf3f935a0 100644 --- a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.scss +++ b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.scss @@ -17,9 +17,21 @@ nb-card { border-radius: 0.5rem; color: #969fb9; padding: 0.5rem 1rem; + button { + float: right; + margin: 0; + } + nb-icon { + float: right ; + } } nb-card-body { + border-bottom-left-radius: 0.5rem; + border-bottom-right-radius: 0.5rem; + margin: 0 2rem 0 2rem; + padding: 0; + label { color: #969fb9; } @@ -35,22 +47,27 @@ nb-card { } pre { - background: #1c2339; - border-radius: 0.5rem; - color: #fff; - font-weight: 400; - padding: 0.75rem; + display: flex; + flex-direction: row-reverse; + flex-wrap: wrap; + align-content: space-between; + align-items: flex-start; + justify-content: space-between; + margin: 0; + background: transparent; + padding: 0.75rem; + border-radius: 0.5rem; white-space: pre-line; button { background: transparent; border: 0 transparent; color: #969fb9; + top: -0.25rem; float: right; - position: relative; right: -0.5rem; - top: -0.25rem; + outline: none; } code { @@ -105,3 +122,13 @@ button { outline: none !important; margin-right: 15px; } +a { + white-space: nowrap !important; + padding: 0 0.3rem !important; + background-color: #ff9f05 !important; + font-weight: 700 !important; + text-decoration: none !important; + color: #ffffff !important; + border-radius: 10px; + fill: #3089fc !important; +} diff --git a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.ts b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.ts index c9ac54d60..0e9872e1e 100644 --- a/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.ts +++ b/ui/src/app/shared/components/orb/agent/agent-provisioning/agent-provisioning.component.ts @@ -12,25 +12,28 @@ export class AgentProvisioningComponent implements OnInit { agentStates = AgentStates; - command2copy: string; - copyCommandIcon: string; availableOS = [AvailableOS.DOCKER]; selectedOS = AvailableOS.DOCKER; - command2show: string; + defaultCommandCopy: string; + defaultCommandShow: string; + fileConfigCommandCopy: string; + fileConfigCommandShow: string; hideCommand: boolean; + hideCommand2: boolean; + hideCommand3: boolean; constructor() { - this.command2copy = ""; - this.command2show = ""; this.copyCommandIcon = "copy-outline"; } ngOnInit(): void { + this.hideCommand2 = false; + this.hideCommand3 = true; this.hideCommand = this.agent?.state !== this.agentStates.new; this.makeCommand2Copy(); } @@ -45,27 +48,52 @@ export class AgentProvisioningComponent implements OnInit { } makeCommand2Copy() { - // TODO: future - store this elsewhere - if (this.selectedOS === AvailableOS.DOCKER) { - this.command2copy = `docker run -d --restart=always --net=host \\ --e ORB_CLOUD_ADDRESS=${document.location.hostname} \\ --e ORB_CLOUD_MQTT_ID=${this.agent?.id} \\ --e ORB_CLOUD_MQTT_CHANNEL_ID=${this.agent?.channel_id} \\ --e ORB_CLOUD_MQTT_KEY="AGENT_KEY" \\ + this.defaultCommandCopy = `docker run -d --restart=always --net=host \\ +-e ORB_CLOUD_ADDRESS=${ document.location.hostname } \\ +-e ORB_CLOUD_MQTT_ID=${ this.agent.id } \\ +-e ORB_CLOUD_MQTT_CHANNEL_ID=${ this.agent.channel_id } \\ +-e ORB_CLOUD_MQTT_KEY="AGENT_KEY"\\ -e PKTVISOR_PCAP_IFACE_DEFAULT=auto \\ orbcommunity/orb-agent`; - this.command2show = `docker run -d --restart=always --net=host \\ --e ORB_CLOUD_ADDRESS=${document.location.hostname} \\ --e ORB_CLOUD_MQTT_ID=${this.agent?.id} \\ --e ORB_CLOUD_MQTT_CHANNEL_ID=${this.agent?.channel_id} \\ --e ORB_CLOUD_MQTT_KEY=AGENT_KEY \\ + this.defaultCommandShow = `docker run -d --restart=always --net=host \\ +-e ORB_CLOUD_ADDRESS=${ document.location.hostname } \\ +-e ORB_CLOUD_MQTT_ID=${ this.agent.id } \\ +-e ORB_CLOUD_MQTT_CHANNEL_ID=${ this.agent.channel_id } \\ +-e ORB_CLOUD_MQTT_KEY=AGENT_KEY\\ -e PKTVISOR_PCAP_IFACE_DEFAULT=auto \\ orbcommunity/orb-agent`; - } + + this.fileConfigCommandCopy = `docker run -d --restart=always --net=host \\ +-e ORB_CLOUD_ADDRESS=${ document.location.hostname } \\ +-e ORB_CLOUD_MQTT_ID=${ this.agent.id } \\ +-e ORB_CLOUD_MQTT_CHANNEL_ID=${ this.agent.channel_id } \\ +-e ORB_CLOUD_MQTT_KEY="AGENT_KEY"\\ +-e PKTVISOR_PCAP_IFACE_DEFAULT=auto \\ +-v \${PWD}/:/usr/local/orb/ \\ +orbcommunity/orb-agent run -c /usr/local/orb/agent.yaml`; + + this.fileConfigCommandShow = `docker run -d --restart=always --net=host \\ +-e ORB_CLOUD_ADDRESS=${ document.location.hostname } \\ +-e ORB_CLOUD_MQTT_ID=${ this.agent.id } \\ +-e ORB_CLOUD_MQTT_CHANNEL_ID=${ this.agent.channel_id } \\ +-e ORB_CLOUD_MQTT_KEY=AGENT_KEY\\ +-e PKTVISOR_PCAP_IFACE_DEFAULT=auto \\ +-v \${PWD}/:/usr/local/orb/ \\ +orbcommunity/orb-agent run -c /usr/local/orb/agent.yaml`; } - toggleProvisioningCommand() { - this.hideCommand = !this.hideCommand; +toggleProvisioningCommand(command: string) { + switch (command) { + case 'hideCommand': + this.hideCommand = !this.hideCommand; + break; + case 'hideCommand2': + this.hideCommand2 = !this.hideCommand2; + break; + case 'hideCommand3': + this.hideCommand3 = !this.hideCommand3; + break; } } +} From 3e813402730ed1fe4881ad72ac3263b1dba2a73c Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Fri, 1 Sep 2023 16:23:51 -0300 Subject: [PATCH 08/27] improvement(orb-ui): #1108 Update input and forms styles according to figma (#2604) --- ui/src/app/@theme/styles/_overrides.scss | 48 ++++++++++++++++++- .../dataset-from/dataset-from.component.html | 8 ++-- .../add/agent.policy.add.component.html | 39 +++++++-------- .../fleet/agents/add/agent.add.component.html | 40 ++++++++-------- .../fleet/agents/add/agent.add.component.scss | 8 +++- .../groups/add/agent.group.add.component.html | 44 ++++++++--------- .../agent-information.component.html | 7 +-- .../agent-information.component.scss | 5 +- .../policy-details.component.html | 11 ++--- .../policy-details.component.scss | 3 ++ .../sink-details/sink-details.component.html | 29 +++++------ .../tag-control/tag-control.component.html | 13 ++--- .../tag-control/tag-control.component.scss | 3 -- 13 files changed, 156 insertions(+), 102 deletions(-) diff --git a/ui/src/app/@theme/styles/_overrides.scss b/ui/src/app/@theme/styles/_overrides.scss index 01705e612..4eea19ebc 100644 --- a/ui/src/app/@theme/styles/_overrides.scss +++ b/ui/src/app/@theme/styles/_overrides.scss @@ -267,4 +267,50 @@ } p { font-family: 'Montserrat' !important; -} \ No newline at end of file +} +button { + font-family: 'Montserrat' !important; +} +label { + font-family: 'Montserrat' !important; +} +.input-label { + color: #fff !important; + font-size: 14px !important; + font-weight: 500 !important; +} +input { + background-color: transparent !important; +} +.next-button { + border-radius: 16px !important; + background: #3089FC !important; + padding: 8px 24px !important; + color: #fff !important; + border: none !important; + outline: none !important; + font-size: 14px !important; + font-weight: 600 !important; + transition: background-color 0.3s ease !important; +} +.next-button:hover { + background-color: #509afc!important; +} +.next-button:disabled { + background: #2b3148 !important; +} +.cancel-back-button { + border-radius: 16px !important;; + padding: 8px 24px !important; + background-color: transparent !important; + color: #3089FC !important; + border: none !important; + outline: none !important; + font-size: 14px !important; + font-weight: 600 !important; + transition: background-color 0.3s ease !important; + margin-right: 0 !important; +} +.cancel-back-button:hover { + background-color: rgba(255, 255, 255, 0.05) !important; +} diff --git a/ui/src/app/pages/datasets/dataset-from/dataset-from.component.html b/ui/src/app/pages/datasets/dataset-from/dataset-from.component.html index a2a370d44..952635bfd 100644 --- a/ui/src/app/pages/datasets/dataset-from/dataset-from.component.html +++ b/ui/src/app/pages/datasets/dataset-from/dataset-from.component.html @@ -18,14 +18,14 @@
- + *
- + *
@@ -69,7 +69,7 @@
- + *
- + *
diff --git a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html index b821fec29..6f32dda6a 100644 --- a/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html +++ b/ui/src/app/pages/datasets/policies.agent/add/agent.policy.add.component.html @@ -34,9 +34,8 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

- * + class="input-label" + for="name">Policy Name*
{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}} fullWidth="true" [status]="detailsFG?.controls.name.dirty ? (!detailsFG.controls.name.valid ? 'danger' : 'success') : 'basic'" id="name" - nbInput/> + nbInput + placeholder="Policy Name"/> -

+

Name is required! -

-

+

+
Name must start with a letter or "_" and contain only letters, numbers, "-" or "_" -

-

+

+
Name must be less than {{detailsFG.controls.name.errors?.maxlength.requiredLength}} characters -

+
{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}} formControlName="description" fullWidth="true" id="description" - nbInput/> + nbInput + placeholder="Policy Description"/>

Description must be less than {{detailsFG.controls.description.errors?.maxlength.requiredLength}} characters @@ -82,7 +83,7 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

- +
@@ -110,7 +111,7 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

(click)="goBack()" data-orb-qa-id="button#cancel" ghost - nbButton + class="cancel-back-button" shape="round" status="primary" type="button"> @@ -121,7 +122,7 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

[disabled]="!detailsFG?.valid" class="next-button" data-orb-qa-id="button#next" - nbButton + class="next-button" nbStepperNext shape="round" type="button" @@ -195,7 +196,7 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

(click)="goBack()" data-orb-qa-id="button#cancel" ghost - nbButton + class="cancel-back-button" status="primary" type="button"> {{ strings.stepper.cancel }} @@ -203,7 +204,7 @@

{{ isEdit ? 'Edit Agent Policy' : 'Create Agent Policy'}}

- {{ agent?.key }} + {{ agent?.key }} @@ -61,7 +61,7 @@ {{ defaultCommandShow }} diff --git a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss index a95937510..c87226b2e 100644 --- a/ui/src/app/pages/fleet/agents/key/agent.key.component.scss +++ b/ui/src/app/pages/fleet/agents/key/agent.key.component.scss @@ -59,6 +59,7 @@ nb-card { code { color: #ffffff; line-height: 2.5 !important; + font-size: 16px !important; } } } From 4a75c64f5b3d3dba98bcd6c06be1034f8b37c956 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Tue, 5 Sep 2023 17:10:24 -0300 Subject: [PATCH 10/27] feat(orb-ui): #1110 New profile page (#2615) --- .../app/pages/profile/profile.component.html | 142 ++++++++++------ .../app/pages/profile/profile.component.scss | 151 ++++++++++++++++++ ui/src/app/pages/profile/profile.component.ts | 112 ++++++++++--- 3 files changed, 331 insertions(+), 74 deletions(-) diff --git a/ui/src/app/pages/profile/profile.component.html b/ui/src/app/pages/profile/profile.component.html index 917c60901..7ad1a6db2 100644 --- a/ui/src/app/pages/profile/profile.component.html +++ b/ui/src/app/pages/profile/profile.component.html @@ -1,62 +1,108 @@ +
+
+

Account Information

+

User Profile

+
+
-
- - User Information +
+
+ +
+

User Name

+
+

{{ user?.fullName }}

+
+
+ +
+
+ + + + + +
+ +
+ +
+
-
- - Create Policy through {{isJsonMode ? "JSON editor" : "YAML editor"}} - +
+ +
-
-
-

Paste or Upload your JSON configuration

- - -
-
- - -
-
-
-
-

Paste or Upload your YAML configuration

- - -
-
+
+

Paste or Upload your {{isJsonMode ? 'Json' : 'Yaml'}} configuration

+ + +
+
+
+ + + + + -
+ +
+ +
+ + + +
+ Review & Confirm +
+
+
+
+
+ +

{{detailsFG.controls.name.value}}

+
+
+
+
+
+
+ +

{{detailsFG.controls.description.value}}

+

No description provided

+
+
+
+
+
+
+ +

{{detailsFG.controls.backend.value}}

+
+
+
+
+
+ + +
+
+
+ + +
+ + + + + + Group: {{ group?.name }} + + + + + + Group don't have any agents. + + + + + + + Policy not assigned to any group +

{{ errors.nogroup }} diff --git a/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss b/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss index 87a560751..28d543bad 100644 --- a/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss +++ b/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss @@ -120,16 +120,25 @@ nb-card { color: #df316f !important; } } - -::ng-deep .agent-group-button { +.no-agents { + color: #fff; + font-family: 'Roboto'; + font-size: 13px; + font-weight: 600; + line-height: 1.5rem; +} +.agent-group-button { background-color: transparent !important; background-repeat: no-repeat !important; - border: solid #ffffff !important; - border-radius: 15px !important; - border-width: thin !important; + border: none !important; cursor: pointer !important; outline: none !important; overflow: hidden !important; + color: #fff; + font-family: 'Montserrat', sans-serif; + font-size: 13px; + font-weight: 600; + line-height: 1.5rem; } .agent-group-accent { @@ -141,3 +150,38 @@ nb-card { color: #df316f !important; font-weight: 600; } + +::ng-deep nb-accordion { + border: none !important; + border-radius: 8px !important; + display: grid; + padding: -0.1rem !important; + margin: -0.1rem !important; + text-subtitle-line-height: 1rem; + box-shadow: none !important; + + > nb-accordion-item { + border: none !important; + border-radius: 8px !important; + padding: -0.1rem !important; + margin: -0.1rem !important; + + > nb-accordion-item-header { + border: none !important; + border-radius: 8px !important; + padding: 0.1rem 0 !important; + } + + > nb-accordion-item-body { + border: none !important; + border-radius: 8px !important; + display: grid; + padding: 0 10px 0 10px; + background-color: #1c2339; + + .item-body { + padding: 0.1em !important; + } + } + } +} From f61aada1c15aa8230eb6662cd05560f979278148 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Mon, 18 Sep 2023 13:43:28 -0300 Subject: [PATCH 23/27] feat(orb-ui): #1185 Search by name on list pages (#2633) --- ui/src/app/common/services/filter.service.ts | 4 ++ .../components/filter/filter.component.html | 44 ++++++++++++------- .../components/filter/filter.component.scss | 22 ++++++++++ .../components/filter/filter.component.ts | 29 +++++++++++- 4 files changed, 80 insertions(+), 19 deletions(-) diff --git a/ui/src/app/common/services/filter.service.ts b/ui/src/app/common/services/filter.service.ts index 329f8ee18..8d1d46701 100644 --- a/ui/src/app/common/services/filter.service.ts +++ b/ui/src/app/common/services/filter.service.ts @@ -74,6 +74,10 @@ export class FilterService { } } + removeFilterByParam(param: string) { + this.removeFilter(this._filters.findIndex((filter) => filter.param === param && filter.name === 'Name' && filter)); + } + // make a decorator out of this? createFilteredList() { return ( diff --git a/ui/src/app/shared/components/filter/filter.component.html b/ui/src/app/shared/components/filter/filter.component.html index 49209d6d7..808411de4 100644 --- a/ui/src/app/shared/components/filter/filter.component.html +++ b/ui/src/app/shared/components/filter/filter.component.html @@ -27,30 +27,37 @@ - + + +

+ + +
+ - - {{ filter?.exact ? filter.name + ": '" + filter?.param + "'" : filter.name + ': ' +filter?.param}} - - + + + {{ filter?.exact ? filter.name + ": '" + filter?.param + "'" : filter.name + ': ' + filter?.param }} + + + +
+
+
+
diff --git a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss index 7fbeb897c..19ed35e11 100644 --- a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss +++ b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.scss @@ -250,3 +250,4 @@ header { display: flex; align-items: center; } + diff --git a/ui/src/app/pages/fleet/agents/list/agent.list.component.scss b/ui/src/app/pages/fleet/agents/list/agent.list.component.scss index b3d73df0f..0612f71ef 100644 --- a/ui/src/app/pages/fleet/agents/list/agent.list.component.scss +++ b/ui/src/app/pages/fleet/agents/list/agent.list.component.scss @@ -187,6 +187,8 @@ input[type=checkbox] { font-weight: 600; text-transform: none !important; width: 160px; + opacity: 0; + animation: appear 0.3s forwards; &.btn-disabled { background: #2b3148; diff --git a/ui/src/app/pages/fleet/agents/view/agent.view.component.html b/ui/src/app/pages/fleet/agents/view/agent.view.component.html index 1956af161..041f6fb04 100644 --- a/ui/src/app/pages/fleet/agents/view/agent.view.component.html +++ b/ui/src/app/pages/fleet/agents/view/agent.view.component.html @@ -38,6 +38,10 @@
+
+
+
+
diff --git a/ui/src/app/pages/profile/profile.component.html b/ui/src/app/pages/profile/profile.component.html index def21abd0..61cfc10e5 100644 --- a/ui/src/app/pages/profile/profile.component.html +++ b/ui/src/app/pages/profile/profile.component.html @@ -4,7 +4,12 @@

User Profile / Settings

-
+ +
+
+
+ +
diff --git a/ui/src/app/pages/sinks/view/sink.view.component.html b/ui/src/app/pages/sinks/view/sink.view.component.html index ae73c8d30..51b3822f5 100644 --- a/ui/src/app/pages/sinks/view/sink.view.component.html +++ b/ui/src/app/pages/sinks/view/sink.view.component.html @@ -61,6 +61,10 @@

{{ strings.sink.view.header }}

+
+
+
+
From 4f7953b5c47627859dab30779b54ef4d41efaccf Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Wed, 20 Sep 2023 16:57:16 -0300 Subject: [PATCH 26/27] fix(orb-ui): Yaml as main and only sink config language (#2644) * fix(orb-ui): Yaml as main and only sink config language * remove unnecessary comments --- .../app/pages/sinks/add/sink-add.component.ts | 48 +++++++++----- .../pages/sinks/view/sink.view.component.ts | 64 +++++++++---------- .../sink-config/sink-config.component.html | 7 +- .../sink/sink-config/sink-config.component.ts | 38 ++++++----- 4 files changed, 86 insertions(+), 71 deletions(-) diff --git a/ui/src/app/pages/sinks/add/sink-add.component.ts b/ui/src/app/pages/sinks/add/sink-add.component.ts index d368dd044..82c088f50 100644 --- a/ui/src/app/pages/sinks/add/sink-add.component.ts +++ b/ui/src/app/pages/sinks/add/sink-add.component.ts @@ -55,7 +55,13 @@ export class SinkAddComponent { return false; } - return !this.editor.checkEmpty(config.authentication) && !this.editor.checkEmpty(config.exporter) && detailsValid; + return !this.editor.checkEmpty(config.authentication) && !this.editor.checkEmpty(config.exporter) && detailsValid && !this.checkString(config); + } + checkString(config: any): boolean { + if (typeof config.authentication.password !== 'string' || typeof config.authentication.username !== 'string') { + return true; + } + return false; } createSink() { @@ -68,22 +74,30 @@ export class SinkAddComponent { let payload = {}; - if (this.editor.isJson(configSink)) { - const config = JSON.parse(configSink); - payload = { - ...details, - tags, - config, - } as Sink; - } - else { - payload = { - ...details, - tags, - format: 'yaml', - config_data: configSink, - } as Sink; - } + const config = YAML.parse(configSink); + + payload = { + ...details, + tags, + config, + } as Sink; + + // if (this.editor.isJson(configSink)) { + // const config = JSON.parse(configSink); + // payload = { + // ...details, + // tags, + // config, + // } as Sink; + // } + // else { + // payload = { + // ...details, + // tags, + // format: 'yaml', + // config_data: configSink, + // } as Sink; + // } this.sinksService.addSink(payload).subscribe(() => { this.notificationsService.success('Sink successfully created', ''); diff --git a/ui/src/app/pages/sinks/view/sink.view.component.ts b/ui/src/app/pages/sinks/view/sink.view.component.ts index b10cc1823..420bb7bf3 100644 --- a/ui/src/app/pages/sinks/view/sink.view.component.ts +++ b/ui/src/app/pages/sinks/view/sink.view.component.ts @@ -94,14 +94,22 @@ export class SinkViewComponent implements OnInit, OnChanges, OnDestroy { } else if (this.editor.isYaml(configSink)) { config = YAML.parse(configSink); } else { - return false; + return false; } + if (this.editMode.config) { - configValid = !this.editor.checkEmpty(config.authentication) && !this.editor.checkEmpty(config.exporter); + configValid = !this.editor.checkEmpty(config.authentication) && !this.editor.checkEmpty(config.exporter) && !this.checkString(config); } return detailsValid && configValid; } + checkString(config: any): boolean { + if (typeof config.authentication.password !== 'string' || typeof config.authentication.username !== 'string') { + return true; + } + return false; + } + discard() { this.editMode.details = false; this.editMode.config = false; @@ -113,40 +121,30 @@ export class SinkViewComponent implements OnInit, OnChanges, OnDestroy { const sinkDetails = this.detailsComponent.formGroup?.value; const tags = this.detailsComponent.selectedTags; const configSink = this.configComponent.code; - + const details = { ...sinkDetails, tags }; - const isJson = this.editor.isJson(configSink); - - let payload: Sink = { id, backend }; - - if (isJson) { - const config = JSON.parse(configSink); - - if (this.editMode.details && !this.editMode.config) { - payload = { ...payload, ...details }; - } else if (!this.editMode.details && this.editMode.config) { - payload = { ...payload, config }; - } else { - payload = { ...payload, ...details, config }; - } - } else { - if (this.editMode.details && !this.editMode.config) { + + let payload = { id, backend, config: {}}; + + try { + const config = YAML.parse(configSink); + payload.config = config; + + if (this.editMode.details) { payload = { ...payload, ...details }; - } else if (!this.editMode.details && this.editMode.config) { - payload = { ...payload, format: 'yaml', config_data: configSink }; - } else { - payload = { ...payload, ...details, format: 'yaml', config_data: configSink }; } - } - - try { - this.sinks.editSink(payload).subscribe((resp) => { - this.discard(); - this.sink = resp; - this.orb.refreshNow(); - this.notifications.success('Sink updated successfully', ''); - this.isRequesting = false; - }); + + this.sinks.editSink(payload as Sink).subscribe( + (resp) => { + this.discard(); + this.sink = resp; + this.orb.refreshNow(); + this.notifications.success('Sink updated successfully', ''); + this.isRequesting = false; + }, + (err) => { + this.isRequesting = false; + }); } catch (err) { this.notifications.error('Failed to edit Sink', 'Error: Invalid configuration'); } diff --git a/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.html b/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.html index f700ca43c..05d4d1e02 100644 --- a/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.html +++ b/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.html @@ -18,12 +18,12 @@ style="color: #df316f !important;"> Discard - + -->
@@ -41,8 +41,7 @@ [(ngModel)]="code" [options]="editorOptionsYaml" class="code-editor" - ngDefaultControl - *ngIf="isYaml"> + ngDefaultControl>
diff --git a/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.ts b/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.ts index 8bba77fce..ce30aa4b3 100644 --- a/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.ts +++ b/ui/src/app/shared/components/orb/sink/sink-config/sink-config.component.ts @@ -78,7 +78,7 @@ export class SinkConfigComponent implements OnInit, OnChanges { private fb: FormBuilder, private orb: OrbService, ) { - this.isYaml = false; + this.isYaml = true; this.sink = {}; this.editMode = false; this.editModeChange = new EventEmitter(); @@ -111,17 +111,18 @@ export class SinkConfigComponent implements OnInit, OnChanges { ngOnInit(): void { if (this.createMode) { this.toggleEdit(true); - this.code = JSON.stringify(this.sinkConfigSchemaOtlp, null, 2); + this.code = YAML.stringify(this.sinkConfigSchemaOtlp); } else { - if (this.sink.config_data && this.sink.format === 'yaml') { - this.isYaml = true; - this.code = YAML.stringify(this.sink.config_data); - } - else if (this.isJson(JSON.stringify(this.sink.config))) { - this.isYaml = false; - this.code = JSON.stringify(this.sink.config, null, 2); - } + // if (this.sink.config_data && this.sink.format === 'yaml') { + // this.isYaml = true; + const parsedCode = YAML.parse(JSON.stringify(this.sink.config)); + this.code = YAML.stringify(parsedCode); + // } + // else if (this.isJson(JSON.stringify(this.sink.config))) { + // this.isYaml = false; + // this.code = JSON.stringify(this.sink.config, null, 2); + // } } } @@ -132,7 +133,7 @@ export class SinkConfigComponent implements OnInit, OnChanges { } catch { return false; } -} + } ngOnChanges(changes: SimpleChanges) { const { editMode, sinkBackend } = changes; if (editMode && !editMode.firstChange) { @@ -146,20 +147,23 @@ ngOnChanges(changes: SimpleChanges) { this.code = this.isYaml ? YAML.stringify(sinkConfigSchema, null) : JSON.stringify(sinkConfigSchema, null, 2); + this.code = YAML.stringify(sinkConfigSchema, null); } } updateForm() { - const configData = this.sink.config_data; - const isYamlFormat = this.sink.format === 'yaml'; + const configData = this.sink.config; + // const isYamlFormat = this.sink.format === 'yaml'; if (this.editMode) { - this.isYaml = isYamlFormat; - this.code = isYamlFormat ? YAML.stringify(configData) : JSON.stringify(this.sink.config, null, 2); + // this.isYaml = isYamlFormat; + // this.code = isYamlFormat ? YAML.stringify(configData) : JSON.stringify(this.sink.config, null, 2); + this.code = YAML.stringify(configData); } else { this.formControl = this.fb.control(null, [Validators.required]); - this.isYaml = isYamlFormat; - this.code = isYamlFormat ? YAML.stringify(configData) : JSON.stringify(this.sink.config, null, 2); + // this.isYaml = isYamlFormat; + // this.code = isYamlFormat ? YAML.stringify(configData) : JSON.stringify(this.sink.config, null, 2); + this.code = YAML.stringify(configData); } this.formControl = this.fb.control(this.code, [Validators.required]); From 4750f3eba2f2b696088888ae81bdbbf67e0ae5f4 Mon Sep 17 00:00:00 2001 From: joaoguilherme2003 Date: Thu, 21 Sep 2023 17:18:31 -0300 Subject: [PATCH 27/27] fixes(orb-ui): Polling stopping | resquest button disabled (#2645) --- ui/src/app/common/services/orb.service.ts | 4 ++++ .../view/agent.policy.view.component.html | 10 +++++----- .../view/agent.policy.view.component.ts | 11 +++++++++-- .../pages/fleet/agents/view/agent.view.component.ts | 1 + .../fleet/groups/add/agent.group.add.component.ts | 6 +++++- ui/src/app/pages/profile/profile.component.ts | 3 +++ ui/src/app/pages/sinks/view/sink.view.component.ts | 1 + .../agent-information/agent-information.component.ts | 3 +++ .../policy/policy-groups/policy-groups.component.scss | 1 + .../policy-interface/policy-interface.component.scss | 2 +- 10 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ui/src/app/common/services/orb.service.ts b/ui/src/app/common/services/orb.service.ts index c74182dfa..acf5f0aa8 100644 --- a/ui/src/app/common/services/orb.service.ts +++ b/ui/src/app/common/services/orb.service.ts @@ -53,11 +53,15 @@ export class OrbService implements OnDestroy { // next to force refresh private forceRefresh: Subject; + isPollingPaused = false; + pausePolling() { + this.isPollingPaused = true; this.pollController$.next(PollControls.PAUSE); } startPolling() { + this.isPollingPaused = false; this.pollController$.next(PollControls.RESUME); } diff --git a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html index e8a4c8740..4ba6ca33d 100644 --- a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html +++ b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.html @@ -44,15 +44,15 @@

Policy View

- +
diff --git a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.ts b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.ts index e67baf461..04fffa9ef 100644 --- a/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.ts +++ b/ui/src/app/pages/datasets/policies.agent/view/agent.policy.view.component.ts @@ -29,6 +29,7 @@ import { PolicyDuplicateComponent } from '../duplicate/agent.policy.duplicate.co import { NbDialogService } from '@nebular/theme'; import { updateMenuItems } from 'app/pages/pages-menu'; import { AgentPolicyDeleteComponent } from '../delete/agent.policy.delete.component'; +import { error } from 'console'; @Component({ selector: 'ngx-agent-view', @@ -162,13 +163,18 @@ export class AgentPolicyViewComponent implements OnInit, OnDestroy { backend, } as AgentPolicy; - this.policiesService.editAgentPolicy(payload).subscribe((resp) => { + this.policiesService.editAgentPolicy(payload).subscribe( + (resp) => { this.notifications.success('Agent Policy updated successfully', ''); this.discard(); this.policy = resp; this.orb.refreshNow(); this.isRequesting = false; - }); + }, + (error) => { + this.isRequesting = false; + } + ); } catch (err) { this.notifications.error( @@ -220,6 +226,7 @@ export class AgentPolicyViewComponent implements OnInit, OnDestroy { ngOnDestroy() { this.policySubscription?.unsubscribe(); + this.orb.isPollingPaused ? this.orb.startPolling() : null; this.orb.killPolling.next(); } openDeleteModal() { diff --git a/ui/src/app/pages/fleet/agents/view/agent.view.component.ts b/ui/src/app/pages/fleet/agents/view/agent.view.component.ts index 5fa487038..ca6091fa6 100644 --- a/ui/src/app/pages/fleet/agents/view/agent.view.component.ts +++ b/ui/src/app/pages/fleet/agents/view/agent.view.component.ts @@ -89,6 +89,7 @@ export class AgentViewComponent implements OnInit, OnDestroy { ngOnDestroy() { this.agentSubscription?.unsubscribe(); + this.orb.isPollingPaused ? this.orb.startPolling() : null; this.orb.killPolling.next(); } 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 784962127..c0ca0fb96 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 @@ -280,12 +280,16 @@ export class AgentGroupAddComponent if (this.isEdit) { this.agentGroupsService .editAgentGroup({ ...payload, id: this.agentGroupID }) - .subscribe(() => { + .subscribe( + (resp) => { this.notificationsService.success( 'Agent Group successfully updated', '', ); this.goBack(); + }, + (error) => { + this.isRequesting = false; }); } else { this.agentGroupsService.addAgentGroup(payload).subscribe(() => { diff --git a/ui/src/app/pages/profile/profile.component.ts b/ui/src/app/pages/profile/profile.component.ts index b7049cc41..b69e0e366 100644 --- a/ui/src/app/pages/profile/profile.component.ts +++ b/ui/src/app/pages/profile/profile.component.ts @@ -94,6 +94,9 @@ export class ProfileComponent implements OnInit { this.toggleEdit(''); this.isRequesting = false; }, + error => { + this.isRequesting = false; + } ); } diff --git a/ui/src/app/pages/sinks/view/sink.view.component.ts b/ui/src/app/pages/sinks/view/sink.view.component.ts index 420bb7bf3..490876744 100644 --- a/ui/src/app/pages/sinks/view/sink.view.component.ts +++ b/ui/src/app/pages/sinks/view/sink.view.component.ts @@ -161,6 +161,7 @@ export class SinkViewComponent implements OnInit, OnChanges, OnDestroy { ngOnDestroy(): void { this.sinkSubscription.unsubscribe(); + this.orb.isPollingPaused ? this.orb.startPolling() : null; this.orb.killPolling.next(); } openDeleteModal() { diff --git a/ui/src/app/shared/components/orb/agent/agent-information/agent-information.component.ts b/ui/src/app/shared/components/orb/agent/agent-information/agent-information.component.ts index de842595b..5189d0412 100644 --- a/ui/src/app/shared/components/orb/agent/agent-information/agent-information.component.ts +++ b/ui/src/app/shared/components/orb/agent/agent-information/agent-information.component.ts @@ -123,6 +123,9 @@ export class AgentInformationComponent implements OnInit { this.orb.refreshNow(); this.toggleEdit(false); this.isRequesting = false; + }, + (error) => { + this.isRequesting = false; }); } diff --git a/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss b/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss index 28d543bad..c6572a462 100644 --- a/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss +++ b/ui/src/app/shared/components/orb/policy/policy-groups/policy-groups.component.scss @@ -170,6 +170,7 @@ nb-card { border: none !important; border-radius: 8px !important; padding: 0.1rem 0 !important; + background-color: transparent !important; } > nb-accordion-item-body { diff --git a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss index 9090a1259..96cac03f9 100644 --- a/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss +++ b/ui/src/app/shared/components/orb/policy/policy-interface/policy-interface.component.scss @@ -70,7 +70,7 @@ nb-card { .code-editor-wrapper { min-height: 350px; min-width: 200px; - height: calc(50vh); + height: calc(45vh); width: calc(100%); display: block; }