Skip to content

Commit 8d817f8

Browse files
committed
ITC-3653 merge conflicts resolved
2 parents 5195606 + 6d76f17 commit 8d817f8

File tree

53 files changed

+3997
-28
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3997
-28
lines changed

src/app/app.routes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { mshypervModuleRoutes } from './modules/mshyperv_module/mshyperv_module.
4444
import { ciscoModuleRoutes } from './modules/cisco_module/cisco_module.routes';
4545
import { networkModuleRoutes } from './modules/network_module/network_module.routes';
4646
import { broadcomProxyModuleRoutes } from './modules/broadcomproxy_module/broadcomproxy_module.routes';
47+
import { nutanixModuleRoutes } from './modules/nutanix_module/nutanix_module.routes';
4748

4849
@Component({
4950
selector: 'legacy-redirect',
@@ -109,6 +110,7 @@ const moduleRoutes: Routes = [
109110
...mshypervModuleRoutes,
110111
...ciscoModuleRoutes,
111112
...broadcomProxyModuleRoutes,
113+
...nutanixModuleRoutes,
112114
...networkModuleRoutes
113115
];
114116
/*** Core routes ***/

src/app/components/dynamical-form-fields/dynamical-form-fields.component.html

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,35 @@
149149
[(ngModel)]="ngModel"
150150
(ngModelChange)="ngModelChange.emit($event)"
151151
[ngModelOptions]="{standalone: true}"
152-
[showClear]="false">
152+
[showClear]="false"
153+
oitcFormError [errors]="errors" errorField="{{formField['ngModel']}}">
153154
</oitc-select>
155+
<oitc-form-feedback [errors]="errors"
156+
errorField="{{formField['ngModel']}}"></oitc-form-feedback>
157+
<div class="help-block small" *ngIf="formField['help']">
158+
{{ formField['help'] }}
159+
</div>
160+
</div>
161+
<!-- MULTI SELECT FIELDS -->
162+
<div *ngIf="formField['type'] === 'multiselect'" class="mb-3">
163+
{{ formField['label'] }}
164+
@if (formField['required']) {
165+
<oitc-required-icon></oitc-required-icon>
166+
}
167+
<oitc-multi-select
168+
[attr.id]="formField['ngModel']"
169+
[name]="name"
170+
optionValue="key"
171+
optionLabel="value"
172+
[options]="formField['options']"
173+
[(ngModel)]="ngModel"
174+
(ngModelChange)="ngModelChange.emit($event)"
175+
[ngModelOptions]="{standalone: true}"
176+
[showClear]="false"
177+
oitcFormError [errors]="errors" errorField="{{formField['ngModel']}}">
178+
</oitc-multi-select>
179+
<oitc-form-feedback [errors]="errors"
180+
errorField="{{formField['ngModel']}}"></oitc-form-feedback>
154181
<div class="help-block small" *ngIf="formField['help']">
155182
{{ formField['help'] }}
156183
</div>

src/app/components/dynamical-form-fields/dynamical-form-fields.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { TranslocoDirective } from '@jsverse/transloco';
2828
import { NgSelectComponent } from '@ng-select/ng-select';
2929
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
3030
import { SelectComponent } from '../../layouts/primeng/select/select/select.component';
31+
import { MultiSelectComponent } from '../../layouts/primeng/multi-select/multi-select/multi-select.component';
3132

3233
@Component({
3334
selector: 'oitc-dynamical-form-fields',
@@ -47,7 +48,8 @@ import { SelectComponent } from '../../layouts/primeng/select/select/select.comp
4748
TranslocoDirective,
4849
NgSelectComponent,
4950
SelectComponent,
50-
FormsModule
51+
FormsModule,
52+
MultiSelectComponent
5153
],
5254
templateUrl: './dynamical-form-fields.component.html',
5355
styleUrl: './dynamical-form-fields.component.css',

src/app/layouts/primeng/multi-select/multi-select/multi-select.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class MultiSelectComponent implements ControlValueAccessor, OnInit, OnDes
5858
*/
5959
private _options: any[] | undefined;
6060
@Input()
61-
set options(value: any[]) {
61+
set options(value: any[] | undefined) {
6262
this._options = value;
6363
this.onOptionsChanged();
6464
}

src/app/modules/distribute_module/pages/satellites/satellites-downtime/satellites-downtime.component.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ <h6 class="pb-2 mb-3 border-bottom">
229229
<th scope="col" mat-sort-header="Satellites.name">
230230
{{ t('Satellite') }}
231231
</th>
232+
<th scope="col" mat-sort-header="Systemdowntimes.downtimetype_id">
233+
{{ t('Include services') }}
234+
</th>
232235
<th scope="col" mat-sort-header="Systemdowntimes.author">
233236
{{ t('User') }}
234237
</th>
@@ -265,6 +268,13 @@ <h6 class="pb-2 mb-3 border-bottom">
265268
<td class="word-break">
266269
{{ satelliteSystemdowntime.Satellite.name }}
267270
</td>
271+
<td>
272+
@if (satelliteSystemdowntime.Systemdowntime.downtimeTypeId == 1) {
273+
{{ t('Yes') }}
274+
} @else {
275+
{{ t('No') }}
276+
}
277+
</td>
268278
<td>
269279
{{ satelliteSystemdowntime.Systemdowntime.author }}
270280
</td>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
// Keep in sync with ExternalMonitoringSystem.php
12
export enum ExternalMonitoringSystems {
23
Icinga2 = 'icinga2',
34
OpManager = 'opmanager',
45
PRTG = 'prtg',
5-
FlowChief = 'flowchief'
6+
FlowChief = 'flowchief',
7+
LibreNMS = 'librenms'
68
}

src/app/modules/import_module/pages/externalmonitorings/external-monitorings-add/external-monitorings-add.component.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
ExternalMonitoringConfig,
3434
ExternalMonitoringConfigFlowChief,
3535
ExternalMonitoringConfigIcinga2,
36+
ExternalMonitoringConfigLibreNMS,
3637
ExternalMonitoringConfigOpmanager,
3738
ExternalMonitoringConfigPrtg,
3839
ExternalMonitoringPost
@@ -121,6 +122,10 @@ export class ExternalMonitoringsAddComponent implements OnInit, OnDestroy {
121122
{
122123
key: ExternalMonitoringSystems.PRTG,
123124
value: this.TranslocoService.translate('Paessler PRTG System')
125+
},
126+
{
127+
key: ExternalMonitoringSystems.LibreNMS,
128+
value: this.TranslocoService.translate('LibreNMS')
124129
}
125130
];
126131

@@ -206,6 +211,11 @@ export class ExternalMonitoringsAddComponent implements OnInit, OnDestroy {
206211
const flowChief = result.config.config as ExternalMonitoringConfigFlowChief;
207212
this.post.json_data = flowChief;
208213
break;
214+
215+
case ExternalMonitoringSystems.LibreNMS:
216+
const LibreNMS = result.config.config as ExternalMonitoringConfigLibreNMS;
217+
this.post.json_data = LibreNMS;
218+
break;
209219
}
210220

211221
this.formFields = result.config.formFields;

src/app/modules/import_module/pages/externalmonitorings/external-monitorings-edit/external-monitorings-edit.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ export class ExternalMonitoringsEditComponent implements OnInit, OnDestroy {
117117
{
118118
key: ExternalMonitoringSystems.PRTG,
119119
value: this.TranslocoService.translate('Paessler PRTG System')
120+
},
121+
{
122+
key: ExternalMonitoringSystems.LibreNMS,
123+
value: this.TranslocoService.translate('LibreNMS')
120124
}
121125
];
122126
protected readonly Object = Object;

src/app/modules/import_module/pages/externalmonitorings/external-monitorings.interface.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export function getDefaultExternalMonitoringsIndexParams(): ExternalMonitoringsI
5555

5656
export interface ExternalMonitoringConfig {
5757
config: {
58-
config: ExternalMonitoringConfigIcinga2 | ExternalMonitoringConfigOpmanager | ExternalMonitoringConfigPrtg | ExternalMonitoringConfigFlowChief
58+
config: ExternalMonitoringConfigIcinga2 | ExternalMonitoringConfigOpmanager | ExternalMonitoringConfigPrtg | ExternalMonitoringConfigFlowChief | ExternalMonitoringConfigLibreNMS
5959
formFields: DynamicalFormFields
6060
}
6161
}
@@ -103,6 +103,21 @@ export interface ExternalMonitoringConfigFlowChief {
103103
host_prefix: string
104104
}
105105

106+
// Server code: LibreNMSExternalMonitoringJson.php
107+
export interface ExternalMonitoringConfigLibreNMS {
108+
api_url: string
109+
api_key: string
110+
device_types: string[] // one of appliance,collaboration,environment,firewall,loadbalancer,management,network,printer,power,server,storage,wireless,workstation
111+
import_ports: number
112+
import_services: number
113+
track_alerts: number
114+
warning_alerts_force_down_state: number
115+
critical_alerts_force_down_state: number
116+
polling_interval: number
117+
use_proxy: number
118+
ignore_ssl_certificate: number
119+
}
120+
106121
export interface ExternalMonitoringsAsList {
107122
externalMonitorings: SelectKeyValue[]
108123
}

src/app/modules/map_module/components/map-item-base/map-item-base.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,4 +354,16 @@ export class MapItemBaseComponent<T extends MapitemBase> implements AfterViewIni
354354
this.cdr.markForCheck();
355355
}
356356

357+
protected shortenLabel(text: string, maxLength: number, shortenEnd: boolean = false): string {
358+
if (text.length <= maxLength) {
359+
return text;
360+
}
361+
362+
if (shortenEnd) {
363+
return '...' + text.substring(text.length - (maxLength - 3));
364+
}
365+
366+
return text.substring(0, maxLength - 3) + '...';
367+
}
368+
357369
}

0 commit comments

Comments
 (0)