|
1 | 1 | <app-utm-modal-header [name]="(rule?'Edit':'Create') + ' incident response automation'"></app-utm-modal-header> |
2 | | -<div class="container-fluid p-3"> |
3 | | - <div class="d-flex flex-column justify-content-start align-items-start"> |
| 2 | +<div class="container-fluid p-3 pt-5"> |
| 3 | + <div class="d-flex flex-column justify-content-start align-items-start pb-3"> |
4 | 4 | <div class="step-container wizard-step"> |
5 | 5 | <div class="step"> |
6 | | - <span class="text-blue-800 font-weight-bold"> |
| 6 | + <span class="text-blue-800 font-weight-bold step-title"> |
7 | 7 | Automation |
8 | 8 | </span> |
9 | 9 | <div [ngClass]="isCompleted(1)?'step-success':step===1?'step-active':'step-inactive'" |
10 | 10 | class="round-indicator"> |
11 | | - <i [ngClass]="isCompleted(1)?'icon-checkmark3':'icon-file-css'"></i> |
| 11 | + <i class="step-icon" [ngClass]="isCompleted(1)?'icon-checkmark3':'icon-file-css'"></i> |
12 | 12 | </div> |
13 | 13 | </div> |
14 | 14 | <div class="step-link"> |
15 | 15 | <div class="line w-100"></div> |
16 | 16 | </div> |
17 | 17 | <div class="step"> |
18 | | - <span class="text-blue-800 font-weight-bold"> |
| 18 | + <span class="text-blue-800 font-weight-bold step-title"> |
19 | 19 | Trigger |
20 | 20 | </span> |
21 | 21 | <div [ngClass]="isCompleted(2)?'step-success':step===2?'step-active':'step-inactive'" |
22 | 22 | class="round-indicator"> |
23 | | - <i [ngClass]="isCompleted(2)?'icon-checkmark3':'icon-power2'"></i> |
| 23 | + <i class="step-icon" [ngClass]="isCompleted(2)?'icon-checkmark3':'icon-power2'"></i> |
24 | 24 | </div> |
25 | 25 | </div> |
26 | 26 | <div class="step-link"> |
27 | 27 | <div class="line w-100"></div> |
28 | 28 | </div> |
29 | 29 | <div class="step"> |
30 | | - <span class="text-blue-800 font-weight-bold"> |
| 30 | + <span class="text-blue-800 font-weight-bold step-title"> |
31 | 31 | Action |
32 | 32 | </span> |
33 | 33 | <div [ngClass]="isCompleted(3)?'step-success':step===3?'step-active':'step-inactive'" |
34 | 34 | class="round-indicator"> |
35 | | - <i [ngClass]="isCompleted(3)?'icon-checkmark3':'icon-terminal'"></i> |
| 35 | + <i class="step-icon" [ngClass]="isCompleted(3)?'icon-checkmark3':'icon-terminal'"></i> |
| 36 | + </div> |
| 37 | + </div> |
| 38 | + <div class="step-link"> |
| 39 | + <div class="line w-100"></div> |
| 40 | + </div> |
| 41 | + <div class="step"> |
| 42 | + <span class="text-blue-800 font-weight-bold step-title"> |
| 43 | + Summary |
| 44 | + </span> |
| 45 | + <div [ngClass]="isCompleted(4)?'step-success':step===3?'step-active':'step-inactive'" |
| 46 | + class="round-indicator"> |
| 47 | + <i class="step-icon" [ngClass]="isCompleted(4)?'icon-checkmark3':'icon-eye'"></i> |
36 | 48 | </div> |
37 | 49 | </div> |
38 | 50 | </div> |
|
122 | 134 | placement="left" |
123 | 135 | (click)="removeRuleCondition(i)"></i> |
124 | 136 | </div> |
125 | | - <div class="d-flex justify-content-between"> |
| 137 | + <div class="d-flex justify-content-between pr-4"> |
126 | 138 | <div> |
127 | 139 | <span *ngIf="ruleConditions.length === 0 || !ruleConditions.valid" |
128 | 140 | class="text-danger-300 font-size-base"> |
129 | 141 | You must set at least one trigger condition |
130 | 142 | </span> |
131 | 143 | </div> |
132 | | - <button class="btn utm-button utm-button-primary align-self-end" (click)="addRuleCondition()">Add |
133 | | - condition |
| 144 | + <button class="btn utm-button btn-success align-self-end" (click)="addRuleCondition()"> |
| 145 | + <i class="icon-plus22"></i> |
| 146 | + Add |
134 | 147 | </button> |
135 | 148 | </div> |
136 | 149 | </div> |
137 | 150 | </div> |
138 | | - <div class="d-flex mt-3"> |
139 | | - <div class="d-flex flex-column w-30 mb-3 pr-2"> |
| 151 | + <div class="d-flex mt-3 flex-column"> |
| 152 | + <div class="col-12 p-0"> |
140 | 153 | <label class="pb-1" for="exclude">Agent platform is</label> |
141 | 154 | <ng-select [clearable]="false" |
142 | 155 | [items]="platforms" |
|
149 | 162 | </ng-select> |
150 | 163 | <app-formcontrol-error [formcontrol]="formRule.get('agentPlatform')"></app-formcontrol-error> |
151 | 164 | </div> |
152 | | - <div class="d-flex flex-column flex-grow-1 mb-3 pl-2"> |
| 165 | + <!--<div class="d-flex flex-column flex-grow-1 mb-3 pl-2"> |
153 | 166 | <label class="pb-1" for="exclude">Exclude agents</label> |
154 | 167 | <ng-select [clearable]="false" |
155 | 168 | [items]="agents" |
|
163 | 176 | bindLabel="assetName" |
164 | 177 | id="exclude"> |
165 | 178 | </ng-select> |
| 179 | + </div>--> |
| 180 | + </div> |
| 181 | + <div class="d-flex mt-3 flex-column"> |
| 182 | + <div class="col-12"> |
| 183 | + <app-utm-toggle (toggleChange)="formRule.get('agentType').setValue($event)" |
| 184 | + [active]="formRule.get('agentType').value" |
| 185 | + [emitAtStart]="false" |
| 186 | + [customClass]="'pl-3'" |
| 187 | + [label]="'Select the agent handling strategy for the automation. By default, commands won\'t run on specified agents, even if the trigger conditions match. Alternatively, choose a default agent to run the automation if no other agent matches the criteria.'" class="mb-3"></app-utm-toggle> |
| 188 | + </div> |
| 189 | + </div> |
| 190 | + <div *ngIf="formRule.get('agentType').value" class="d-flex mt-3 flex-column"> |
| 191 | + <div class="col-12 p-0"> |
| 192 | + <label class="pb-1" for="exclude">Exclude agents</label> |
| 193 | + <ng-select [clearable]="false" |
| 194 | + [items]="agents" |
| 195 | + [placeholder]="'Select agents to exclude'" |
| 196 | + [loadingText]="'Loading agents...'" |
| 197 | + [virtualScroll]="true" |
| 198 | + [multiple]="true" |
| 199 | + formControlName="excludedAgents" |
| 200 | + (change)="onChangeExclude($event)" |
| 201 | + bindValue="assetName" |
| 202 | + bindLabel="assetName" |
| 203 | + id="exclude"> |
| 204 | + </ng-select> |
| 205 | + </div> |
| 206 | + <div class="col-12 p-0"> |
| 207 | + <div class="alert alert-info alert-styled-right mt-2 info-dismissible"> |
| 208 | + <span class="font-weight-semibold">Info! </span> |
| 209 | + <span>Represents agents where the commands won't run, even if the trigger conditions match</span> |
| 210 | + </div> |
| 211 | + </div> |
| 212 | + </div> |
| 213 | + <div *ngIf="!formRule.get('agentType').value" class="d-flex mt-3 flex-column"> |
| 214 | + <div class="col-12 p-0"> |
| 215 | + <label class="pb-1" for="exclude">Default agents</label> |
| 216 | + <ng-select [clearable]="false" |
| 217 | + [items]="agents" |
| 218 | + [placeholder]="'Select agent'" |
| 219 | + [loadingText]="'Loading agents...'" |
| 220 | + [virtualScroll]="true" |
| 221 | + formControlName="defaultAgent" |
| 222 | + bindValue="assetName" |
| 223 | + bindLabel="assetName" |
| 224 | + id="deafult"> |
| 225 | + </ng-select> |
| 226 | + </div> |
| 227 | + <div class="col-12 p-0"> |
| 228 | + <div class="alert alert-info alert-styled-right mt-2 info-dismissible"> |
| 229 | + <span class="font-weight-semibold">Info! </span> |
| 230 | + <span>Designates the agent to execute the automation when no other agent meets the criteria to serve as the runner for this automation.</span> |
| 231 | + </div> |
166 | 232 | </div> |
167 | 233 | </div> |
168 | 234 | <div *ngIf="platforms.length === 0" |
|
206 | 272 | <span>Warning! You may cause damage to the infrastructure and services of your organization, please review the automation command before saving it</span> |
207 | 273 | </div> |
208 | 274 | </div> |
| 275 | + |
| 276 | + <div *ngIf="step===4" class="configure-step mt-3 mb-3"> |
| 277 | + <app-ir-summary |
| 278 | + [formRule]="formRule"> |
| 279 | + </app-ir-summary> |
| 280 | + </div> |
209 | 281 | </form> |
210 | 282 | <div class="button-container d-flex justify-content-end mt-3"> |
211 | 283 | <button (click)="backStep()" *ngIf="step > 1" |
212 | 284 | class="btn utm-button utm-button-primary"> |
213 | 285 | <i class="icon-arrow-left22"></i> |
214 | 286 | Back |
215 | 287 | </button> |
216 | | - <button (click)="nextStep()" *ngIf="step < 3" |
| 288 | + <button (click)="nextStep()" *ngIf="step < 4" |
217 | 289 | [disabled]="isDisable(step) " |
218 | 290 | class="btn utm-button utm-button-primary ml-2"> |
219 | 291 | Next |
220 | 292 | <i class="icon-arrow-right22"></i> |
221 | 293 | </button> |
222 | 294 |
|
223 | 295 | <button (click)="createRule()" |
224 | | - *ngIf="step===3" |
| 296 | + *ngIf="step===4" |
225 | 297 | [disabled]="!command || command === ''" |
226 | 298 | class="btn utm-button utm-button-primary ml-2"> |
227 | 299 | <i [ngClass]="creating?'icon-spinner2 spinner':'icon-terminal'"></i> |
|
0 commit comments