refs #1617. Fix: handle undefined networkSettings in ClientViewComponent
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
testing/ogGui-multibranch/pipeline/head This commit looks good
Details
parent
900cb423b3
commit
7e06e60598
|
@ -21,8 +21,7 @@ export class ClassroomViewComponent implements OnInit, OnChanges {
|
|||
@Input() pcInTable: number = 5;
|
||||
groupedClients: GroupedClients[] = [];
|
||||
|
||||
constructor(public dialog: MatDialog, private http: HttpClient, private toastService: ToastrService) {}
|
||||
|
||||
constructor(public dialog: MatDialog, private http: HttpClient, private toastService: ToastrService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.groupClientsByOrganizationalUnit();
|
||||
|
@ -61,7 +60,6 @@ export class ClassroomViewComponent implements OnInit, OnChanges {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
chunkArray(arr: any[], chunkSize: number): any[][] {
|
||||
const chunks = [];
|
||||
for (let i = 0; i < arr.length; i += chunkSize) {
|
||||
|
@ -71,7 +69,8 @@ export class ClassroomViewComponent implements OnInit, OnChanges {
|
|||
}
|
||||
|
||||
handleClientClick(client: any): void {
|
||||
const dialogRef = this.dialog.open(ClientViewComponent, { data: { client }, width: '800px', height:'700px' });
|
||||
console.log('Client clicked:', client);
|
||||
this.dialog.open(ClientViewComponent, { data: { client }, width: '800px', height: '700px' });
|
||||
}
|
||||
|
||||
onDragMoved(event: CdkDragMove<any>, client: any): void {
|
||||
|
@ -106,4 +105,4 @@ export class ClassroomViewComponent implements OnInit, OnChanges {
|
|||
} else
|
||||
this.toastService.success('Cliente actualizado!', 'Éxito');
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import {Component, Inject} from '@angular/core';
|
||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from "@angular/material/dialog";
|
||||
|
||||
@Component({
|
||||
selector: 'app-client-view',
|
||||
|
@ -11,54 +11,61 @@ export class ClientViewComponent {
|
|||
displayedColumns: string[] = ['property', 'value'];
|
||||
|
||||
generalData = [
|
||||
{property: 'Nombre', value: this.data.client.name},
|
||||
{property: 'Uuid', value: this.data.client.uuid},
|
||||
{property: 'IP', value: this.data.client.ip},
|
||||
{property: 'MAC', value: this.data.client.mac},
|
||||
{property: 'Nº de serie', value: this.data.client.serialNumber},
|
||||
{property: 'Netiface', value: this.data.client.netiface},
|
||||
{property: 'Perfil hardware', value: this.data.client.hardwareProfile ? this.data.client.hardwareProfile.description : ''},
|
||||
{property: 'Menú', value: this.data.client.menu ? this.data.client.menu.description : ''},
|
||||
{property: 'Fecha de creación', value: this.data.client.createdAt},
|
||||
{property: 'Creado por', value: this.data.client.createdBy}
|
||||
{ property: 'Nombre', value: this.data.client.name },
|
||||
{ property: 'Uuid', value: this.data.client.uuid },
|
||||
{ property: 'IP', value: this.data.client.ip },
|
||||
{ property: 'MAC', value: this.data.client.mac },
|
||||
{ property: 'Nº de serie', value: this.data.client.serialNumber },
|
||||
{ property: 'Netiface', value: this.data.client.netiface },
|
||||
{ property: 'Perfil hardware', value: this.data.client.hardwareProfile ? this.data.client.hardwareProfile.description : '' },
|
||||
{ property: 'Menú', value: this.data.client.menu ? this.data.client.menu.description : '' },
|
||||
{ property: 'Fecha de creación', value: this.data.client.createdAt },
|
||||
{ property: 'Creado por', value: this.data.client.createdBy }
|
||||
];
|
||||
|
||||
networkData = [
|
||||
{property: 'Menú', value: this.data.client.menu ? this.data.client.menu.description : ''},
|
||||
{property: 'Perfil hardware', value: this.data.client.hardwareProfile ? this.data.client.hardwareProfile.description : ''},
|
||||
{property: 'Subred', value: this.data.client.subnet},
|
||||
{property: 'OGlive', value: ''},
|
||||
{property: 'Autoexec', value: ''},
|
||||
{property: 'Repositorio', value: ''},
|
||||
{property: 'Validacion', value: ''},
|
||||
{property: 'Página login', value: ''},
|
||||
{property: 'Fecha de creación', value: this.data.client.createdAt},
|
||||
{property: 'Creado por', value: this.data.client.createdBy}
|
||||
{ property: 'Menú', value: this.data.client.menu ? this.data.client.menu.description : '' },
|
||||
{ property: 'Perfil hardware', value: this.data.client.hardwareProfile ? this.data.client.hardwareProfile.description : '' },
|
||||
{ property: 'Subred', value: this.data.client.subnet },
|
||||
{ property: 'OGlive', value: '' },
|
||||
{ property: 'Autoexec', value: '' },
|
||||
{ property: 'Repositorio', value: '' },
|
||||
{ property: 'Validacion', value: '' },
|
||||
{ property: 'Página login', value: '' },
|
||||
{ property: 'Fecha de creación', value: this.data.client.createdAt },
|
||||
{ property: 'NTP', value: this.data.client.organizationalUnit?.networkSettings?.ntp || '' },
|
||||
{ property: 'Modo p2p', value: this.data.client.organizationalUnit?.networkSettings?.p2pMode || '' },
|
||||
{ property: 'Tiempo p2p', value: this.data.client.organizationalUnit?.networkSettings?.p2pTime || '' },
|
||||
{ property: 'IP multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastIp || '' },
|
||||
{ property: 'Modo multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastMode || '' },
|
||||
{ property: 'Puerto multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastPort || '' },
|
||||
{ property: 'Velocidad multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastSpeed || '' },
|
||||
{ property: 'Perfil hardware', value: this.data.client.organizationalUnit?.networkSettings?.hardwareProfile?.description || '' },
|
||||
{ property: 'Menú', value: this.data.client.organizationalUnit?.networkSettings?.menu?.description || '' }
|
||||
];
|
||||
|
||||
classroomData = [
|
||||
{property: 'Url servidor proxy', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.proxy : ''},
|
||||
{property: 'IP DNS', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.dns : ''},
|
||||
{property: 'Máscara de red', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.netmask : ''},
|
||||
{property: 'Router', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.router : ''},
|
||||
{property: 'NTP', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.ntp : ''},
|
||||
{property: 'Modo p2p', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.p2pMode : ''},
|
||||
{property: 'Tiempo p2p', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.p2pTime : ''},
|
||||
{property: 'IP multicast', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.mcastIp : ''},
|
||||
{property: 'Modo multicast', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.mcastMode : ''},
|
||||
{property: 'Puerto multicast', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.mcastPort : ''},
|
||||
{property: 'Velocidad multicast', value: this.data.client.organizationalUnit.networkSettings ? this.data.client.organizationalUnit.networkSettings.mcastSpeed : ''},
|
||||
{property: 'Perfil hardware', value: this.data.client.organizationalUnit.networkSettings && this.data.client.organizationalUnit.networkSettings.hardwareProfile ? this.data.client.organizationalUnit.networkSettings.hardwareProfile.description : ''},
|
||||
{property: 'Menú', value: this.data.client.organizationalUnit.networkSettings && this.data.client.organizationalUnit.networkSettings.menu ? this.data.client.organizationalUnit.networkSettings.menu.description : ''}
|
||||
{ property: 'Url servidor proxy', value: this.data.client.organizationalUnit?.networkSettings?.proxy || '' },
|
||||
{ property: 'IP DNS', value: this.data.client.organizationalUnit?.networkSettings?.dns || '' },
|
||||
{ property: 'Máscara de red', value: this.data.client.organizationalUnit?.networkSettings?.netmask || '' },
|
||||
{ property: 'Router', value: this.data.client.organizationalUnit?.networkSettings?.router || '' },
|
||||
{ property: 'NTP', value: this.data.client.organizationalUnit?.networkSettings?.ntp || '' },
|
||||
{ property: 'Modo p2p', value: this.data.client.organizationalUnit?.networkSettings?.p2pMode || '' },
|
||||
{ property: 'Tiempo p2p', value: this.data.client.organizationalUnit?.networkSettings?.p2pTime || '' },
|
||||
{ property: 'IP multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastIp || '' },
|
||||
{ property: 'Modo multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastMode || '' },
|
||||
{ property: 'Puerto multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastPort || '' },
|
||||
{ property: 'Velocidad multicast', value: this.data.client.organizationalUnit?.networkSettings?.mcastSpeed || '' },
|
||||
{ property: 'Perfil hardware', value: this.data.client.organizationalUnit?.networkSettings?.hardwareProfile?.description || '' },
|
||||
{ property: 'Menú', value: this.data.client.organizationalUnit?.networkSettings?.menu?.description || '' }
|
||||
];
|
||||
|
||||
constructor(
|
||||
private dialogRef: MatDialogRef<ClientViewComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
onNoClick(): void {
|
||||
this.dialogRef.close();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue