Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@
<div class="d-flex mt-3 flex-column">
<div class="alert alert-info alert-styled-right mb-2 info-dismissible">
<span class="font-weight-semibold">Info! </span>
<span>Select the agent handling strategy for the automation. By default (not active), commands will run on specified platform agents if the trigger conditions and dataSource field value of the alert match. Alternatively, choose a default agent to run the automation if no other agent matches the criteria. If this option is active, commands will run only on specified platform agents if the trigger conditions and dataSource field value of the alert match, if not, the automation won't be executed.</span>
<span>Select the agent handling strategy for the automation. If <strong>not active</strong>, commands will run on specified platform agents if the trigger conditions and dataSource field value of the alert match. Alternatively, choose a <strong>default agent</strong> to run the automation if no other agent matches the criteria. If this option is <strong>active</strong>, commands will run only on specified platform agents if the trigger conditions and dataSource field value of the alert match, if not, the <strong>automation won't be executed</strong>.</span>
</div>
<app-utm-toggle (toggleChange)="onChangeToggle($event)"
[active]="formRule.get('agentType').value"
[emitAtStart]="false"
[customClass]="'pl-3'"
[label]="'Run on specific agent'"></app-utm-toggle>

</div>
<div *ngIf="!formRule.get('agentType').value" class="d-flex mt-2 flex-column">
<div class="col-12 p-0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class IrCreateRuleComponent implements OnInit {
this.ruleConditions.push(ruleCondition);
this.getAgents(this.formRule.get('agentPlatform').value);
this.formRule.get('excludedAgents').setValue(this.rule.excludedAgents);
this.formRule.get('agentType').setValue(this.rule.excludedAgents.length === 0);
this.formRule.get('agentType').setValue(this.rule.excludedAgents.length === 0 && this.rule.defaultAgent !== '');
this.formRule.get('defaultAgent').setValue(this.rule.defaultAgent);
}
} else if (this.alert) {
Expand Down Expand Up @@ -163,8 +163,12 @@ export class IrCreateRuleComponent implements OnInit {

getAgents(platform: any) {
this.formRule.get('excludedAgents').setValue([]);
this.formRule.get('defaultAgent').setValue('');
this.utmNetScanService.query({page: 0, size: 10000, agent: true, osPlatform: platform}).subscribe(response => {
this.agents = response.body;
if (this.agents.length === 1) {
this.formRule.get('excludedAgents').disable();
}
});
}

Expand Down Expand Up @@ -286,7 +290,7 @@ export class IrCreateRuleComponent implements OnInit {
}

onChangeToggle($event) {
if ($event ) {
if ($event) {
this.formRule.get('excludedAgents').setValue([]);
} else {
this.formRule.get('defaultAgent').setValue('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</span>


<ng-container *ngIf="!agentType">
<ng-container *ngIf="!agentType && excludedAgents.length > 0">
<span>
Importantly, the automation excludes designated agents, such as
</span>
Expand All @@ -30,8 +30,8 @@

<ng-container *ngIf="agentType">
<span>
In case none of the agents satisfy the specified conditions, the automation will smoothly revert and execute on the default agent,
<span class="badge p-1 border-1 badge-flat font-weight-light border-info-800 text-info-800 mr-2 mb-2">
In case that none of the agents satisfy the specified conditions, the automation will smoothly revert and execute on the default agent
<span class="badge p-1 border-1 badge-flat font-weight-light border-info-800 text-info-800 mr-2">
{{ defaultAgent | uppercase}}.
</span>
<span>
Expand All @@ -50,7 +50,7 @@

<div class="d-flex p-0 flex-column">
<div class="col-12 p-0">
<div class="alert alert-info alert-styled-right mt-2 info-dismissible">
<div class="alert alert-warning alert-styled-right mb-2 mt-3 alert-dismissible">
<span class="font-weight-semibold">Info! </span>
<span>Please carefully review all presented changes, such as this one, before saving. Any oversight may lead to potential damage to your infrastructure.</span>
</div>
Expand Down