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
4 changes: 3 additions & 1 deletion src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { proxmoxModuleRoutes } from './modules/proxmox_module/proxmox_module.rou
import { ms365ModuleRoutes } from './modules/ms365_module/ms365_module.routes';
import { mshypervModuleRoutes } from './modules/mshyperv_module/mshyperv_module.routes';
import { ciscoModuleRoutes } from './modules/cisco_module/cisco_module.routes';
import { networkModuleRoutes } from './modules/network_module/network_module.routes';
import { broadcomProxyModuleRoutes } from './modules/broadcomproxy_module/broadcomproxy_module.routes';

@Component({
Expand Down Expand Up @@ -107,7 +108,8 @@ const moduleRoutes: Routes = [
...ms365ModuleRoutes,
...mshypervModuleRoutes,
...ciscoModuleRoutes,
...broadcomProxyModuleRoutes
...broadcomProxyModuleRoutes,
...networkModuleRoutes
];
/*** Core routes ***/
const coreRoutes: Routes = [{
Expand Down
9 changes: 9 additions & 0 deletions src/app/modules/network_module/network_module.routes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Routes } from '@angular/router';
import { NetworkinterfacesComponent } from './pages/wizards/networkinterfaces/networkinterfaces.component';

export const networkModuleRoutes: Routes = [
{
path: 'network_module/wizards/networkinterfaces/:hostId',
loadComponent: () => import('./pages/wizards/networkinterfaces/networkinterfaces.component').then(m => NetworkinterfacesComponent)
},
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { WizardGet, WizardPost } from '../../../../../pages/wizards/wizards.interface';
import { GenericValidationError } from '../../../../../generic-responses';

// WIZARD GET
export interface NetworkinterfacesWizardGet extends WizardGet {
interfaceServicetemplate: InterfaceServicetemplate
}


export interface InterfaceServicetemplate {
id: number
uuid: string
template_name: string
name: string
container_id: number
servicetemplatetype_id: number
check_period_id: number
notify_period_id: number
description: string
command_id: number
check_command_args: string
checkcommand_info: string
eventhandler_command_id: number
timeperiod_id: number
check_interval: number
retry_interval: number
max_check_attempts: number
first_notification_delay: number
notification_interval: number
notify_on_warning: number
notify_on_unknown: number
notify_on_critical: number
notify_on_recovery: number
notify_on_flapping: number
notify_on_downtime: number
flap_detection_enabled: number
flap_detection_on_ok: number
flap_detection_on_warning: number
flap_detection_on_unknown: number
flap_detection_on_critical: number
low_flap_threshold: number
high_flap_threshold: number
process_performance_data: number
freshness_checks_enabled: number
freshness_threshold: any
passive_checks_enabled: number
event_handler_enabled: number
active_checks_enabled: number
retain_status_information: number
retain_nonstatus_information: number
notifications_enabled: number
notes: string
priority: number
tags: string
service_url: any
sla_relevant: number
is_volatile: number
check_freshness: number
created: string
modified: string
check_command: {
id: number
name: string
command_line: string
command_type: number
human_args: any
uuid: string
description: string
commandarguments: {
id: number
command_id: number
name: string
human_name: string
created: string
modified: string
}[]
}
servicetemplatecommandargumentvalues: Servicecommandargumentvalue[]
}

export interface Servicecommandargumentvalue {
commandargument: Commandargument
commandargument_id: number
created: string
id: number
modified: string
servicetemplate_id: number
value: string
}

export interface Commandargument {
command_id: number
created: string
human_name: string
id: number
modified: string
name: string
}



// WIZARD POST
export interface NetworkinterfacesWizardPost extends WizardPost {
authPassword: string
authProtocol: string
interfaces: N0[]
privacyPassword: string
privacyProtocol: string
securityLevel: string
securityName: string
snmpCommunity: string
snmpVersion: string
}

export interface N0 {
createService: boolean
description: string
host_id: number
name: string
servicecommandargumentvalues: Servicecommandargumentvalue[]
servicetemplate_id: number
}

// SNMP Discovery
export interface NetworkinterfacesDiscovery {
interfaces: Interface[]
success: boolean
errors: GenericValidationError | undefined
_csrfToken: any
}

export interface Interface {
key: number
value: {
number: string
name: string
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { Injectable } from '@angular/core';
import { catchError, map, Observable, of } from 'rxjs';
import { WizardsService } from '../../../../../pages/wizards/wizards.service';
import { GenericResponseWrapper, GenericValidationError } from '../../../../../generic-responses';
import {
NetworkinterfacesDiscovery,
NetworkinterfacesWizardGet,
NetworkinterfacesWizardPost,
} from './networkinterfaces-wizard.interface';

@Injectable({
providedIn: 'root'
})
export class NetworkinterfacesWizardService extends WizardsService {

public fetch(hostId: number): Observable<NetworkinterfacesWizardGet> {
return this.http.get<NetworkinterfacesWizardGet>(`${this.proxyPath}/network_module/wizards/networkinterfaces/${hostId}.json?angular=true`).pipe(
map((data: NetworkinterfacesWizardGet): NetworkinterfacesWizardGet => {
return data;
})
);
}

public submit(post: NetworkinterfacesWizardPost): Observable<GenericResponseWrapper> {
return this.http.post<any>(`${this.proxyPath}/network_module/wizards/networkinterfaces.json?angular=true`, post)
.pipe(
map(data => {
return {
success: true,
data: null
};
}),
catchError((error: any) => {
const err = error.error.error as GenericValidationError;
return of({
success: false,
data: err
});
})
);

}

public executeNetworkinterfacesDiscovery(post: NetworkinterfacesWizardPost): Observable<NetworkinterfacesDiscovery | GenericResponseWrapper> {
return this.http.post<NetworkinterfacesDiscovery>(`${this.proxyPath}/network_module/wizards/executeNetworkinterfacesDiscovery/${post.host_id}.json?angular=true`, post)
.pipe(
map((data: NetworkinterfacesDiscovery) => {
return data
}),
catchError((error: any) => {
const err = error.error.error as GenericValidationError;
return of({
success: false,
data: err
});
})
);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

.alert-icon {
margin-right: 10px;
}

.accordion-button-padding-left {
padding-left: 1.3rem; /*var(--cui-accordion-btn-padding-x) [1.25rem] + border */
}

.lg-checkbox {
width: 20px;
height: 20px;
}
Loading