diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css index 9b093f0..e71097c 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.css @@ -45,6 +45,20 @@ button { border-bottom: 1px solid rgba(122, 122, 122, 0.555); } +.search-container { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + padding: 0 5px; + box-sizing: border-box; +} + +.search-string { + flex: 2; + padding: 5px; +} + .image-container h4 { margin: 0; flex: 1; diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html index f081224..23ffbad 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.html @@ -21,60 +21,48 @@ + + +
+ + Buscar nombre de imagen + + search + Pulsar 'enter' para buscar + + + Buscar netmask + + search + Pulsar 'enter' para buscar + + + Buscar IP + + search + Pulsar 'enter' para buscar + +
- - + @@ -85,4 +73,4 @@ - \ No newline at end of file + diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts index 71bd6ae..81c986b 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets/og-dhcp-subnets.component.ts @@ -29,17 +29,19 @@ export interface Subnet { }) export class OgDhcpSubnetsComponent { baseUrl: string = import.meta.env.NG_APP_BASE_API_URL; - displayedColumns: string[] = ['name', 'netmask', 'ipAddress', 'nextServer', 'bootFileName', 'actions']; + displayedColumns: string[] = ['id', 'name', 'netmask', 'ipAddress', 'nextServer', 'bootFileName', 'actions']; dataSource = new MatTableDataSource([]); length = 0; itemsPerPage: number = 10; page = 0; + filters: { [key: string]: string } = {}; pageSizeOptions: number[] = [5, 10, 20]; alertMessage: string | null = null; @ViewChild(MatPaginator) paginator: MatPaginator | undefined; - + columns = [ + { columnDef: 'id', header: 'ID', cell: (subnet: Subnet) => subnet.id }, { columnDef: 'name', header: 'Name', cell: (subnet: Subnet) => subnet.name }, { columnDef: 'netmask', header: 'Netmask', cell: (subnet: Subnet) => subnet.netmask }, { columnDef: 'ipAddress', header: 'IP Address', cell: (subnet: Subnet) => subnet.ipAddress }, @@ -89,9 +91,9 @@ export class OgDhcpSubnetsComponent { console.log('Editando subnet:', subnet); const dialogRef = this.dialog.open(CreateSubnetComponent, { width: '400px', - data: { subnet } + data: { subnet } }); - + dialogRef.afterClosed().subscribe(result => { console.log('The dialog was closed'); this.loadSubnets() @@ -104,11 +106,11 @@ export class OgDhcpSubnetsComponent { width: '300px', data: { name: subnet.name } }); - + dialogRef.afterClosed().subscribe(result => { if (result) { const apiUrl = `${this.baseUrl}${subnet['@id']}`; - + this.http.delete(apiUrl).subscribe({ next: () => { console.log('Subnet deleted successfully'); @@ -131,12 +133,12 @@ export class OgDhcpSubnetsComponent { } addClientsToSubnet(subnet: Subnet) { - + const dialogRef = this.dialog.open(AddClientsToSubnetComponent, { width: '600px', - data: { subnetUuid: subnet.uuid, subnetName: subnet.name } + data: { subnetUuid: subnet.uuid, subnetName: subnet.name } }); - + dialogRef.afterClosed().subscribe(result => { console.log('The dialog was closed'); this.loadSubnets();
{{ column.header }} - - - {{ subnet.name }} + + {{ column.cell(subnet) }} - - - {{ subnet.netmask }} - - - - {{ subnet.ipAddress }} - - - - {{ subnet.nextServer }} - - - - {{ subnet.bootFileName }} - - Acciones + Acciones - - - - - - - -