From a770ccdb4673540c05e55e3247f7861773526030 Mon Sep 17 00:00:00 2001 From: apuente Date: Mon, 29 Jul 2024 17:19:58 +0200 Subject: [PATCH 01/13] New internacionalization mode --- ogWebconsole/angular.json | 26 +++++- ogWebconsole/package-lock.json | 66 ++++++++++++++ ogWebconsole/package.json | 1 + .../dashboard/dashboard.component.html | 2 +- .../components/groups/groups.component.html | 85 +++++++------------ ogWebconsole/src/main.ts | 2 + ogWebconsole/tsconfig.app.json | 4 +- ogWebconsole/tsconfig.spec.json | 3 +- 8 files changed, 128 insertions(+), 61 deletions(-) diff --git a/ogWebconsole/angular.json b/ogWebconsole/angular.json index f9f3df9..163f14c 100644 --- a/ogWebconsole/angular.json +++ b/ogWebconsole/angular.json @@ -4,6 +4,12 @@ "newProjectRoot": "projects", "projects": { "ogWebconsole": { + "i18n": { + "sourceLocale": "es", + "locales": { + "en-US": "src/locale/messages.en.json" + } + }, "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -23,11 +29,14 @@ "build": { "builder": "@angular-devkit/build-angular:application", "options": { + "localize": true, + "aot": true, "outputPath": "dist/og-webconsole", "index": "src/index.html", "browser": "src/main.ts", "polyfills": [ - "zone.js" + "zone.js", + "@angular/localize/init" ], "tsConfig": "tsconfig.app.json", "assets": [ @@ -61,6 +70,12 @@ "optimization": false, "extractLicenses": false, "sourceMap": true + }, + "es": { + "localize": ["es-ES"] + }, + "en": { + "localize": ["en-US"] } }, "defaultConfiguration": "production" @@ -73,6 +88,12 @@ }, "development": { "buildTarget": "ogWebconsole:build:development" + }, + "es": { + "buildTarget": "ogWebconsole:build:es" + }, + "en": { + "buildTarget": "ogWebconsole:build:en" } }, "defaultConfiguration": "development" @@ -88,7 +109,8 @@ "options": { "polyfills": [ "zone.js", - "zone.js/testing" + "zone.js/testing", + "@angular/localize/init" ], "tsConfig": "tsconfig.spec.json", "assets": [ diff --git a/ogWebconsole/package-lock.json b/ogWebconsole/package-lock.json index 1610f0f..3c83606 100644 --- a/ogWebconsole/package-lock.json +++ b/ogWebconsole/package-lock.json @@ -28,6 +28,7 @@ "@angular-devkit/build-angular": "^18.0.1", "@angular/cli": "^18.0.1", "@angular/compiler-cli": "^18.0.0", + "@angular/localize": "^18.1.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", @@ -486,6 +487,30 @@ "rxjs": "^6.5.3 || ^7.4.0" } }, + "node_modules/@angular/localize": { + "version": "18.1.0", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-18.1.0.tgz", + "integrity": "sha512-84D06p2Th5NxoJZzsSIn4FkTJGImj7rtNnvyTrHvHdomzzUKwiBOXDB2FiCLDstND0DsCtgjD/uBJivg77z9tg==", + "dev": true, + "dependencies": { + "@babel/core": "7.24.7", + "@types/babel__core": "7.20.5", + "fast-glob": "3.3.2", + "yargs": "^17.2.1" + }, + "bin": { + "localize-extract": "tools/bundles/src/extract/cli.js", + "localize-migrate": "tools/bundles/src/migrate/cli.js", + "localize-translate": "tools/bundles/src/translate/cli.js" + }, + "engines": { + "node": "^18.19.1 || ^20.11.1 || >=22.0.0" + }, + "peerDependencies": { + "@angular/compiler": "18.1.0", + "@angular/compiler-cli": "18.1.0" + } + }, "node_modules/@angular/material": { "version": "18.0.6", "resolved": "https://registry.npmjs.org/@angular/material/-/material-18.0.6.tgz", @@ -4938,6 +4963,47 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.6.tgz", + "integrity": "sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, "node_modules/@types/body-parser": { "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", diff --git a/ogWebconsole/package.json b/ogWebconsole/package.json index ad2a0a8..9a5ed71 100644 --- a/ogWebconsole/package.json +++ b/ogWebconsole/package.json @@ -30,6 +30,7 @@ "@angular-devkit/build-angular": "^18.0.1", "@angular/cli": "^18.0.1", "@angular/compiler-cli": "^18.0.0", + "@angular/localize": "^18.1.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", diff --git a/ogWebconsole/src/app/components/dashboard/dashboard.component.html b/ogWebconsole/src/app/components/dashboard/dashboard.component.html index 9c5fce9..c83a790 100644 --- a/ogWebconsole/src/app/components/dashboard/dashboard.component.html +++ b/ogWebconsole/src/app/components/dashboard/dashboard.component.html @@ -1 +1 @@ -

dashboard works!

+

dashboard works!

\ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 8226e41..de28f1e 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -1,27 +1,27 @@
-

Administrar grupos

+

Administrar grupos

- - - - - + + +
- -
+ +
+
- Búsqueda - + Búsqueda + search - Pulsar 'enter' para buscar entre las unidades organizativas + Pulsar 'enter' para buscar entre las unidades organizativas
+
- Unidad organizativa + Unidad organizativa @@ -34,49 +34,24 @@ menu @@ -89,7 +64,7 @@
- Elementos internos + Elementos internos {{ crumb }} @@ -103,7 +78,7 @@
info - No hay elementos internos + No hay elementos internos
@@ -121,23 +96,23 @@ @@ -146,6 +121,4 @@ - -
diff --git a/ogWebconsole/src/main.ts b/ogWebconsole/src/main.ts index c58dc05..be6bfab 100644 --- a/ogWebconsole/src/main.ts +++ b/ogWebconsole/src/main.ts @@ -1,3 +1,5 @@ +/// + import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; diff --git a/ogWebconsole/tsconfig.app.json b/ogWebconsole/tsconfig.app.json index 374cc9d..ec26f70 100644 --- a/ogWebconsole/tsconfig.app.json +++ b/ogWebconsole/tsconfig.app.json @@ -3,7 +3,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "outDir": "./out-tsc/app", - "types": [] + "types": [ + "@angular/localize" + ] }, "files": [ "src/main.ts" diff --git a/ogWebconsole/tsconfig.spec.json b/ogWebconsole/tsconfig.spec.json index be7e9da..c63b698 100644 --- a/ogWebconsole/tsconfig.spec.json +++ b/ogWebconsole/tsconfig.spec.json @@ -4,7 +4,8 @@ "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ - "jasmine" + "jasmine", + "@angular/localize" ] }, "include": [ From 70c6ea59b1256c2cc1a160ad2b18b6fc0d9e5c19 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Tue, 30 Jul 2024 11:17:13 +0200 Subject: [PATCH 02/13] Added new tab search in groups --- ogWebconsole/src/app/app.module.ts | 5 +- .../src/app/components/groups/data.service.ts | 35 ++- .../components/groups/groups.component.css | 65 +++++ .../components/groups/groups.component.html | 231 ++++++++++++------ .../app/components/groups/groups.component.ts | 49 +++- 5 files changed, 302 insertions(+), 83 deletions(-) diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts index 7d2e8fd..ac4d23c 100644 --- a/ogWebconsole/src/app/app.module.ts +++ b/ogWebconsole/src/app/app.module.ts @@ -56,7 +56,7 @@ import { DeleteGroupsModalComponent } from './components/groups/delete-groups-mo import { DragDropModule } from '@angular/cdk/drag-drop'; import { ToastrModule } from 'ngx-toastr'; import { ShowOrganizationalUnitComponent } from './components/groups/organizational-units/show-organizational-unit/show-organizational-unit.component'; -import { MatGridList } from "@angular/material/grid-list"; +import {MatGridList, MatGridTile} from "@angular/material/grid-list"; import { TreeViewComponent } from './components/groups/tree-view/tree-view.component'; import { MatNestedTreeNode, @@ -68,6 +68,7 @@ import { } from "@angular/material/tree"; import { LegendComponent } from './components/groups/legend/legend.component'; import { ClassroomViewDialogComponent } from './components/groups/classroom-view/classroom-view-modal'; +import {MatPaginator} from "@angular/material/paginator"; @NgModule({ declarations: [ @@ -132,7 +133,7 @@ import { ClassroomViewDialogComponent } from './components/groups/classroom-view progressAnimation: 'increasing', closeButton: true } - ), MatGridList, MatTree, MatTreeNode, MatNestedTreeNode, MatTreeNodeToggle, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeOutlet + ), MatGridList, MatTree, MatTreeNode, MatNestedTreeNode, MatTreeNodeToggle, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeOutlet, MatPaginator, MatGridTile ], schemas: [ CUSTOM_ELEMENTS_SCHEMA, diff --git a/ogWebconsole/src/app/components/groups/data.service.ts b/ogWebconsole/src/app/components/groups/data.service.ts index 9b0f503..5f9d7c2 100644 --- a/ogWebconsole/src/app/components/groups/data.service.ts +++ b/ogWebconsole/src/app/components/groups/data.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; +import {HttpClient, HttpParams} from '@angular/common/http'; import { Observable, throwError } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; import { UnidadOrganizativa } from './model'; @@ -10,7 +10,7 @@ import { UnidadOrganizativa } from './model'; export class DataService { private apiUrl = 'http://127.0.0.1:8080/organizational-units?page=1&itemsPerPage=1000'; - private clientsUrl = 'http://127.0.0.1:8080/clients?page=1&itemsPerPage=30'; + private clientsUrl = 'http://127.0.0.1:8080/clients?page=1&itemsPerPage=1000'; constructor(private http: HttpClient) {} @@ -107,5 +107,36 @@ export class DataService { ); } + getFilteredResults(filter1: string, filter2: string, filterName: string, page: number, pageSize: number): Observable { + let params = new HttpParams(); + if (filter2 && filter2 !== 'none') { + params = params.set('type', filter2); + } + if (filterName) { + params = params.set('name', filterName); + } + + params = params.set('page', page.toString()); + params = params.set('itemsPerPage', pageSize.toString()); + + const url = filter1 === 'client' ? this.clientsUrl : this.apiUrl; + + return this.http.get(url, { params }).pipe( + map(response => { + if (response['hydra:member'] && Array.isArray(response['hydra:member'])) { + return { + results: response['hydra:member'], + total: response['hydra:totalItems'] || response['hydra:member'].length + }; + } else { + throw new Error('Unexpected response format'); + } + }), + catchError(error => { + console.error('Error fetching data', error); + return throwError(error); + }) + ); + } } diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index a406e9b..b4bd345 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -131,3 +131,68 @@ mat-spinner { .roomMap-btn { } +.container { + display: flex; + flex-direction: column; +} + +.header { + display: flex; + align-items: center; + gap: 10px; + padding: 20px; +} + +.header mat-form-field { + width: 300px; +} + +.main-content { + display: flex; +} + +.filters { + padding: 20px; + display: flex; + flex-direction: column; + width: 300px; +} + +.saved-filter { + display: flex; + flex-direction: column; + width: 300px; + margin-bottom: 10px; + padding: 10px; +} + +.results { + width: 100%; +} + +.results-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 16px; + margin-bottom: 16px; +} + +.result-card { + width: 100%; + max-width: 250px; + height: 250px; /* Fijo para mantener la forma cuadrada */ +} + +.paginator-container { + display: flex; + justify-content: center; + margin-bottom: 30px; +} + +.divider { + margin: 20px 0; +} + +mat-card { + margin-bottom: 20px; +} diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 8226e41..0494a28 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -1,36 +1,36 @@ -
-

Administrar grupos

-
- - - - - -
-
- -
-
-
- - Búsqueda - - search - Pulsar 'enter' para buscar entre las unidades organizativas - -
-
- - Unidad organizativa - - - - -
- apartment - {{ unidad.name }} - + + +
+

Administrar grupos

+
+ + + +
+
+ +
+
+
+ + Búsqueda + + search + Pulsar 'enter' para buscar entre las unidades organizativas + +
+
+ + Unidad organizativa + + + + +
+ apartment + {{ unidad.name }} + menu +
+
+
+
+
+ + +
+ Elementos internos + + + {{ crumb }} + > + +
- - - -
- - - -
- Elementos internos - - - {{ crumb }} - > - - -
-
- - - -
- info - No hay elementos internos -
- -
- - apartment - meeting_room - school - computer - lan - help_outline - - {{child.name}} - + + + + +
+ info + No hay elementos internos +
+ +
+ + apartment + meeting_room + school + computer + lan + help_outline + + {{child.name}} + menu -
-
-
-
- - - -
+
+ + + + + +
+ + +

Búsqueda

+
+
+ + Seleccione filtro + + + {{ savedFilter.name }} + + + +
+ +
+
+ + Selecciona una opción + + Unidades organizativas + Clientes + + + + Nombre + + + + Tipo de unidad + + Unidad organizativa + Grupos de aulas + Aulas + Grupos de clientes + + + + Select an option + + None + Option 1 + Option 2 + Option 3 + + + +
+
+ + + + + {{ result.name }} + +

{{ result.type }}

+

Unidades internas: {{ result.type !== 'client' ? result.children.length : 0}}

+

Clientes: {{ result.type !== 'client' ? result.clients.length : 0}}

+
+
+
+
+
+ + +
+
+ +

No hay resultados para mostrar.

+
+
+
+
+
+ diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index c68ba3d..54454dc 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -15,6 +15,9 @@ import {MatBottomSheet} from "@angular/material/bottom-sheet"; import {LegendComponent} from "./legend/legend.component"; import { ClassroomViewComponent } from './classroom-view/classroom-view.component'; import { ClassroomViewDialogComponent } from './classroom-view/classroom-view-modal'; +import {HttpClient} from "@angular/common/http"; +import {Observable} from "rxjs"; +import {PageEvent} from "@angular/material/paginator"; @Component({ selector: 'app-groups', @@ -32,11 +35,22 @@ export class GroupsComponent implements OnInit { loading:boolean = false; loadingChildren:boolean = false; searchTerm: string = ''; -constructor( + selectedFilter1: string = 'none'; + selectedFilter2: string = 'none'; + filterName: string = ''; + filteredResults: any[] = []; + savedFilters: any[] = []; + length: number = 0; + itemsPerPage: number = 10; + page: number = 1; + pageSizeOptions: number[] = [5, 10, 25, 100]; + + constructor( private dataService: DataService, public dialog: MatDialog, private toastService: ToastrService, - private _bottomSheet: MatBottomSheet + private _bottomSheet: MatBottomSheet, + private http: HttpClient ) {} ngOnInit(): void { @@ -267,4 +281,35 @@ constructor( }); } } + + applyFilter() { + this.dataService.getFilteredResults(this.selectedFilter1, this.selectedFilter2, this.filterName, this.page, this.itemsPerPage) + .subscribe( + response => { + this.filteredResults = response.results; + this.length = response.total; + }, + error => { + console.error('Error al obtener los resultados filtrados', error); + this.filteredResults = []; + } + ); + } + + onPageChange(event: PageEvent) { + this.page = event.pageIndex; + this.itemsPerPage = event.pageSize; + this.applyFilter(); + } + saveFilters() { + const filters = { + name: `Filter ${new Date().toISOString()}`, + filter1: this.selectedFilter1, + filter2: this.selectedFilter2 + }; + } + + loadSelectedFilter(savedFilter: any) { + + } } From d80a2beacb03324731fe41254b6440b9d686f844 Mon Sep 17 00:00:00 2001 From: apuente Date: Tue, 30 Jul 2024 15:27:32 +0200 Subject: [PATCH 03/13] Internacionalization missing words --- .../classroom-view.component.html | 9 +- .../client-view/client-view.component.html | 34 +++-- .../create-client.component.html | 136 +++++++++--------- .../edit-client/edit-client.component.html | 42 +++--- .../delete-groups-modal.component.ts | 18 +-- .../delete-modal/delete-modal.component.ts | 17 +-- .../groups/legend/legend.component.html | 10 +- .../create-organizational-unit.component.html | 78 +++++----- .../edit-organizational-unit.component.html | 78 +++++----- .../show-organizational-unit.component.html | 28 ++-- .../groups/tree-view/tree-view.component.html | 7 +- .../layout/header/header.component.html | 20 +-- .../layout/sidebar/sidebar.component.html | 18 +-- .../app/components/login/login.component.html | 50 +++---- .../pages/admin/admin.component.html | 4 +- .../add-role-modal.component.html | 25 ++-- .../delete-role-modal.component.html | 8 +- .../admin/roles/roles/roles.component.html | 11 +- .../add-user-modal.component.html | 16 +-- .../change-password-modal.component.html | 30 ++-- .../delete-user-modal.component.html | 8 +- .../edit-user-modal.component.html | 15 +- .../admin/users/users/users.component.html | 12 +- 23 files changed, 340 insertions(+), 334 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html index 8f75087..647c54a 100644 --- a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html +++ b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html @@ -1,9 +1,8 @@ -
-
Pizarra digital
- Proyector +
Pizarra digital
+ Proyector
- Client + Client
{{ client.name }}
@@ -25,4 +24,4 @@
- + diff --git a/ogWebconsole/src/app/components/groups/client-view/client-view.component.html b/ogWebconsole/src/app/components/groups/client-view/client-view.component.html index 3ddfe30..1f97a50 100644 --- a/ogWebconsole/src/app/components/groups/client-view/client-view.component.html +++ b/ogWebconsole/src/app/components/groups/client-view/client-view.component.html @@ -1,14 +1,20 @@ -

Propiedades cliente

+

Propiedades cliente

+ Datos generales + Propiedades de red + Propiedades del aula + Acciones + Particiones + - + - + @@ -18,11 +24,11 @@
Propiedad Propiedad {{element.property}} Valor Valor {{element.value}}
- + - + @@ -32,11 +38,11 @@
Propiedad Propiedad {{element.property}} Valor Valor {{element.value}}
- + - + @@ -45,12 +51,12 @@
- - - - - - + + + + + +
@@ -58,5 +64,5 @@ - + diff --git a/ogWebconsole/src/app/components/groups/clients/create-client/create-client.component.html b/ogWebconsole/src/app/components/groups/clients/create-client/create-client.component.html index 0458898..88d1eef 100644 --- a/ogWebconsole/src/app/components/groups/clients/create-client/create-client.component.html +++ b/ogWebconsole/src/app/components/groups/clients/create-client/create-client.component.html @@ -1,69 +1,71 @@
-

Añadir Cliente

-
- -
- - Padre - - -
{{ unit.name }}
-
{{ unit.path }}
-
-
-
- - Nombre - - - - Número de Serie - - - - Interfaz de red - - - {{ type.name }} - - - - - Controlador de red - - - {{ type.name }} - - - - - MAC - Ejemplo: 00:11:22:33:44:55 - - Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55 - - - Dirección IP - Ejemplo: 127.0.0.1 - - Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1 - - - Menú URL - - Formato de URL inválido. - - - Perfil de Hardware - - {{ unit.description }} - - Formato de URL inválido. - - -
-
- - -
+

Añadir Cliente

+
+ +
+ + Padre + + +
{{ unit.name }}
+
{{ unit.path }}
+
+
+
+ + Nombre + + + + Número de Serie + + + + Interfaz de red + + + {{ type.name }} + + + + + Controlador de red + + + {{ type.name }} + + + + + MAC + Ejemplo: 00:11:22:33:44:55 + + Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55 + + + Dirección IP + Ejemplo: 127.0.0.1 + + Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1 + + + Menú URL + + Formato de URL inválido. + + + Perfil de Hardware + + + {{ unit.description }} + + + Formato de URL inválido. + + +
+
+ + +
diff --git a/ogWebconsole/src/app/components/groups/clients/edit-client/edit-client.component.html b/ogWebconsole/src/app/components/groups/clients/edit-client/edit-client.component.html index 7ed4b23..dd18a6e 100644 --- a/ogWebconsole/src/app/components/groups/clients/edit-client/edit-client.component.html +++ b/ogWebconsole/src/app/components/groups/clients/edit-client/edit-client.component.html @@ -1,23 +1,25 @@ -

Editar Cliente

+

Editar Cliente

- Padre + Padre - {{ unit.name }} + + {{ unit.name }} + - Nombre + Nombre - Número de Serie + Número de Serie - Interfaz de red + Interfaz de red {{ type.name }} @@ -25,7 +27,7 @@ - Controlador de red + Controlador de red {{ type.name }} @@ -33,30 +35,34 @@ - MAC + MAC - Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55 + Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55 - Dirección IP + Dirección IP - Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1 + Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1 - Menú URL + Menú URL - Formato de URL inválido. + Formato de URL inválido. - Perfil de Hardware + Perfil de Hardware - {{ unit.description }} + + {{ unit.description }} + - Formato de URL inválido. + Formato de URL inválido.
- - + +
diff --git a/ogWebconsole/src/app/components/groups/delete-groups-modal/delete-groups-modal.component.ts b/ogWebconsole/src/app/components/groups/delete-groups-modal/delete-groups-modal.component.ts index 524987f..9b06690 100644 --- a/ogWebconsole/src/app/components/groups/delete-groups-modal/delete-groups-modal.component.ts +++ b/ogWebconsole/src/app/components/groups/delete-groups-modal/delete-groups-modal.component.ts @@ -4,14 +4,16 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; @Component({ selector: 'app-delete-confirm-dialog', template: ` -

Eliminar

-
-

¿Quiere borrar los clientes situados en {{data.name}} o quiere resituarlos en el nivel superior?

-
-
- - -
+

Eliminar

+
+

¿Quiere borrar los clientes situados en {{data.name}} o quiere resituarlos en el nivel superior?

+
+
+ + +
+ + ` }) export class DeleteGroupsModalComponent { diff --git a/ogWebconsole/src/app/components/groups/delete-modal/delete-modal.component.ts b/ogWebconsole/src/app/components/groups/delete-modal/delete-modal.component.ts index 7285277..80675f7 100644 --- a/ogWebconsole/src/app/components/groups/delete-modal/delete-modal.component.ts +++ b/ogWebconsole/src/app/components/groups/delete-modal/delete-modal.component.ts @@ -4,14 +4,15 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; @Component({ selector: 'app-delete-confirm-dialog', template: ` -

Eliminar

-
-

¿Estás seguro que deseas eliminar {{data.name}}?

-
-
- - -
+

Eliminar

+
+

¿Estás seguro que deseas eliminar {{data.name}}?

+
+
+ + +
+ ` }) export class DeleteModalComponent { diff --git a/ogWebconsole/src/app/components/groups/legend/legend.component.html b/ogWebconsole/src/app/components/groups/legend/legend.component.html index 24929b2..9c1ecd5 100644 --- a/ogWebconsole/src/app/components/groups/legend/legend.component.html +++ b/ogWebconsole/src/app/components/groups/legend/legend.component.html @@ -1,22 +1,22 @@ apartment -
Unidad organizativa
+
Unidad organizativa
meeting_room -
Grupos de aula
+
Grupos de aula
school -
Aula
+
Aula
lan -
Grupos de clientes
+
Grupos de clientes
computer -
Cliente
+
Cliente
diff --git a/ogWebconsole/src/app/components/groups/organizational-units/create-organizational-unit/create-organizational-unit.component.html b/ogWebconsole/src/app/components/groups/organizational-units/create-organizational-unit/create-organizational-unit.component.html index 21d080c..e076917 100644 --- a/ogWebconsole/src/app/components/groups/organizational-units/create-organizational-unit/create-organizational-unit.component.html +++ b/ogWebconsole/src/app/components/groups/organizational-units/create-organizational-unit/create-organizational-unit.component.html @@ -1,13 +1,13 @@ -

Añadir Unidad Organizativa

+

Añadir Unidad Organizativa

- General + General - Tipo + Tipo {{ typeTranslations[type] }} @@ -15,22 +15,22 @@ - Nombre + Nombre - Unidad organizativa padre + Unidad organizativa padre - -- + -- {{ unit.name }} - Descripción + Descripción
- +
@@ -38,20 +38,20 @@
- Información del Aula + Información del Aula - Ubicación + Ubicación - Proyector - Pizarra + Proyector + Pizarra - Aforo + Aforo
- - + +
@@ -59,14 +59,14 @@
- Información Adicional + Información Adicional - Comentarios + Comentarios
- - + +
@@ -74,82 +74,82 @@
- Configuración de Red + Configuración de Red - Url servidor Proxy + Url servidor Proxy - IP servidor DNS + IP servidor DNS - Máscara de Red + Máscara de Red - Router + Router - IP servidor NTP + IP servidor NTP - Modo P2P + Modo P2P + [value]="option.value"> {{ option.name }} - Tiempo P2P + Tiempo P2P - IP Multicast + IP Multicast - Velocidad Multicast + Velocidad Multicast - Puerto Multicast + Puerto Multicast - Modo Multicast + Modo Multicast + [value]="option.value"> {{ option.name }} - Menú URL + Menú URL - Perfil de Hardware + Perfil de Hardware {{ unit.description }} - Formato de URL inválido. + Formato de URL inválido.
- - + +
- +
diff --git a/ogWebconsole/src/app/components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component.html b/ogWebconsole/src/app/components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component.html index 3160f95..f2ff39d 100644 --- a/ogWebconsole/src/app/components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component.html +++ b/ogWebconsole/src/app/components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component.html @@ -1,32 +1,32 @@ -

Editar Unidad Organizativa

+

Editar Unidad Organizativa

- General + General - Tipo + Tipo {{ type }} - Nombre + Nombre - Padre + Padre {{ unit.name }} - Descripción + Descripción
- +
@@ -34,20 +34,20 @@
- Información del Aula + Información del Aula - Ubicación + Ubicación - Proyector - Pizarra + Proyector + Pizarra - Aforo + Aforo
- - + +
@@ -55,14 +55,14 @@
- Información Adicional + Información Adicional - Comentarios + Comentarios
- - + +
@@ -70,83 +70,83 @@
- Configuración de Red + Configuración de Red - Url servidor Proxy + Url servidor Proxy - IP servidor DNS + IP servidor DNS - Máscara de Red + Máscara de Red - Router + Router - IP servidor NTP + IP servidor NTP - Modo P2P + Modo P2P + [value]="option.value"> {{ option.name }} - Tiempo P2P + Tiempo P2P - IP Multicast + IP Multicast - Velocidad Multicast + Velocidad Multicast - Puerto Multicast + Puerto Multicast - Modo Multicast + Modo Multicast + [value]="option.value"> {{ option.name }} - Menú URL + Menú URL - Perfil de Hardware + Perfil de Hardware {{ unit.description }} - Formato de URL inválido. + Formato de URL inválido. - Validación + Validación
- - + +
- +
diff --git a/ogWebconsole/src/app/components/groups/organizational-units/show-organizational-unit/show-organizational-unit.component.html b/ogWebconsole/src/app/components/groups/organizational-units/show-organizational-unit/show-organizational-unit.component.html index 61639be..93406cd 100644 --- a/ogWebconsole/src/app/components/groups/organizational-units/show-organizational-unit/show-organizational-unit.component.html +++ b/ogWebconsole/src/app/components/groups/organizational-units/show-organizational-unit/show-organizational-unit.component.html @@ -1,42 +1,42 @@ -

Propiedades unidad organizativa

+

Propiedades unidad organizativa

- +
Propiedad Propiedad {{element.property}} Valor Valor {{element.value}}
- + - +
Propiedad Propiedad {{ element.property }} Valor Valor {{ element.value }}
- + - + - +
Propiedad Propiedad {{ element.property }} Valor Valor {{ element.value }}
- +
- - - - - - + + + + + +
diff --git a/ogWebconsole/src/app/components/groups/tree-view/tree-view.component.html b/ogWebconsole/src/app/components/groups/tree-view/tree-view.component.html index 4c4e7ec..e15be5b 100644 --- a/ogWebconsole/src/app/components/groups/tree-view/tree-view.component.html +++ b/ogWebconsole/src/app/components/groups/tree-view/tree-view.component.html @@ -1,4 +1,4 @@ -

Visualizar arbol unidad Organizativa

+

Visualizar árbol unidad Organizativa

@@ -17,7 +17,8 @@
+ diff --git a/ogWebconsole/src/app/components/layout/header/header.component.html b/ogWebconsole/src/app/components/layout/header/header.component.html index cb93cff..e161167 100644 --- a/ogWebconsole/src/app/components/layout/header/header.component.html +++ b/ogWebconsole/src/app/components/layout/header/header.component.html @@ -1,12 +1,12 @@ - Opengnsys webconsole - + Opengnsys webconsole + diff --git a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.html b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.html index b3658ea..ef5da5d 100644 --- a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.html +++ b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.html @@ -1,7 +1,7 @@ - Bienvenido {{username}} + Bienvenido {{username}} @@ -10,49 +10,49 @@ apartment - Grupos + Grupos chevron_right - Acciones + Acciones desktop_windows - Imágenes + Imágenes settings_input_component - Componentes + Componentes warehouse - Repositorios + Repositorios list - Menús + Menús search - Buscar + Buscar calendar_month - Calendarios + Calendarios diff --git a/ogWebconsole/src/app/components/login/login.component.html b/ogWebconsole/src/app/components/login/login.component.html index abb8dad..cca44b1 100644 --- a/ogWebconsole/src/app/components/login/login.component.html +++ b/ogWebconsole/src/app/components/login/login.component.html @@ -1,27 +1,27 @@
- +
diff --git a/ogWebconsole/src/app/components/pages/admin/admin.component.html b/ogWebconsole/src/app/components/pages/admin/admin.component.html index 4f9e6c3..700da7b 100644 --- a/ogWebconsole/src/app/components/pages/admin/admin.component.html +++ b/ogWebconsole/src/app/components/pages/admin/admin.component.html @@ -1,10 +1,10 @@
diff --git a/ogWebconsole/src/app/components/pages/admin/roles/roles/add-role-modal/add-role-modal.component.html b/ogWebconsole/src/app/components/pages/admin/roles/roles/add-role-modal/add-role-modal.component.html index 68258ec..9423d7a 100644 --- a/ogWebconsole/src/app/components/pages/admin/roles/roles/add-role-modal/add-role-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/roles/roles/add-role-modal/add-role-modal.component.html @@ -1,25 +1,24 @@ -

Añadir Rol (TBD)

+

Añadir Rol (TBD)

- Nombre + Nombre
-

Permisos:

-

Gestionar los usuarios

-

Configuración PXE

-

Imágenes de la consola web

-

Gestionar los distintos componentes

-

Crear imágenes

-

script de configuración del servidor

-

...

+

Permisos:

+

Gestionar los usuarios

+

Configuración PXE

+

Imágenes de la consola web

+

Gestionar los distintos componentes

+

Crear imágenes

+

script de configuración del servidor

+

...

-
- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/roles/roles/delete-role-modal/delete-role-modal.component.html b/ogWebconsole/src/app/components/pages/admin/roles/roles/delete-role-modal/delete-role-modal.component.html index c2b3283..a527864 100644 --- a/ogWebconsole/src/app/components/pages/admin/roles/roles/delete-role-modal/delete-role-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/roles/roles/delete-role-modal/delete-role-modal.component.html @@ -1,8 +1,8 @@ -

Eliminar Rol

+

Eliminar Rol

-

¿Estás seguro que deseas eliminar el rol {{ data.name }}?

+

¿Estás seguro que deseas eliminar el rol {{ data.name }}?

- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/roles/roles/roles.component.html b/ogWebconsole/src/app/components/pages/admin/roles/roles/roles.component.html index bd5223b..d45ff57 100644 --- a/ogWebconsole/src/app/components/pages/admin/roles/roles/roles.component.html +++ b/ogWebconsole/src/app/components/pages/admin/roles/roles/roles.component.html @@ -1,6 +1,6 @@
-

Gestión de roles

- +

Gestión de roles

+
@@ -9,15 +9,12 @@ - - + - -
{{ column.cell(role) }} Acciones Acciones - +
diff --git a/ogWebconsole/src/app/components/pages/admin/users/users/add-user-modal/add-user-modal.component.html b/ogWebconsole/src/app/components/pages/admin/users/users/add-user-modal/add-user-modal.component.html index bc8c592..1b5684c 100644 --- a/ogWebconsole/src/app/components/pages/admin/users/users/add-user-modal/add-user-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/users/users/add-user-modal/add-user-modal.component.html @@ -1,17 +1,17 @@ -

Añadir Usuario

+

Añadir Usuario

- Nombre de usuario + Nombre de usuario - Contraseña + Contraseña - Rol + Rol {{ group.name }} @@ -20,18 +20,16 @@ - Unidad organiativa + Unidad organiativa {{unit.name}} - -
- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/users/users/change-password-modal/change-password-modal.component.html b/ogWebconsole/src/app/components/pages/admin/users/users/change-password-modal/change-password-modal.component.html index 3c2549c..8eff0f1 100644 --- a/ogWebconsole/src/app/components/pages/admin/users/users/change-password-modal/change-password-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/users/users/change-password-modal/change-password-modal.component.html @@ -1,33 +1,31 @@ -

Editar Usuario

+

Editar Usuario

- Contraseña actual - + Contraseña actual + - Nueva contraseña + Nueva contraseña - Repite la contraseña + Repite la contraseña - @if (loading){ - - } + - @if (passwordMismatch) { -
Las contraseñas no coinciden
- } +
+ Las contraseñas no coinciden +
- @if (updateError) { -
{{resetPasswordError}}
- } +
+ {{ resetPasswordError }} +
- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/users/users/delete-user-modal/delete-user-modal.component.html b/ogWebconsole/src/app/components/pages/admin/users/users/delete-user-modal/delete-user-modal.component.html index 80b17ef..51d8d63 100644 --- a/ogWebconsole/src/app/components/pages/admin/users/users/delete-user-modal/delete-user-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/users/users/delete-user-modal/delete-user-modal.component.html @@ -1,8 +1,8 @@ -

Eliminar Usuario

+

Eliminar Usuario

-

¿Estás seguro que deseas eliminar a {{ data.username }}?

+

¿Estás seguro que deseas eliminar a {{ data.username }}?

- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/users/users/edit-user-modal/edit-user-modal.component.html b/ogWebconsole/src/app/components/pages/admin/users/users/edit-user-modal/edit-user-modal.component.html index 39610df..b2e04cc 100644 --- a/ogWebconsole/src/app/components/pages/admin/users/users/edit-user-modal/edit-user-modal.component.html +++ b/ogWebconsole/src/app/components/pages/admin/users/users/edit-user-modal/edit-user-modal.component.html @@ -1,17 +1,17 @@ -

Editar Usuario

+

Editar Usuario

- Nombre de usuario + Nombre de usuario - Contraseña + Contraseña - Rol + Rol {{ group.name }} @@ -20,17 +20,16 @@ - Unidad organiativa + Unidad organizativa {{unit.name}} -
- - + +
diff --git a/ogWebconsole/src/app/components/pages/admin/users/users/users.component.html b/ogWebconsole/src/app/components/pages/admin/users/users/users.component.html index 115ec9e..8d58c00 100644 --- a/ogWebconsole/src/app/components/pages/admin/users/users/users.component.html +++ b/ogWebconsole/src/app/components/pages/admin/users/users/users.component.html @@ -1,6 +1,6 @@
-

Gestión de usuarios

- +

Gestión de usuarios

+
@@ -9,16 +9,14 @@ - - + -
{{ column.cell(user) }} Acciones Acciones - - + +
From f774459fa5473e3ebf5080c96361369c974c5e08 Mon Sep 17 00:00:00 2001 From: apuente Date: Tue, 30 Jul 2024 15:27:39 +0200 Subject: [PATCH 04/13] Internacionalization missing words --- ogWebconsole/src/locale/messages.en.json | 180 +++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 ogWebconsole/src/locale/messages.en.json diff --git a/ogWebconsole/src/locale/messages.en.json b/ogWebconsole/src/locale/messages.en.json new file mode 100644 index 0000000..9b9e80f --- /dev/null +++ b/ogWebconsole/src/locale/messages.en.json @@ -0,0 +1,180 @@ +{ + "locale": "en", + "translations": { + "digital-board": "Digital Board", + "projector-alt": "Projector", + "client-image-alt": "Client", + "save-disposition-button": "Save Layout", + "client-properties-title": "Client Properties", + "property-header": "Property", + "value-header": "Value", + "power-on-button": "Power On", + "power-off-button": "Power Off", + "reset-button": "Reset", + "other-actions-1": "Other Actions 1", + "other-actions-2": "Other Actions 2", + "other-actions-3": "Other Actions 3", + "close-button": "Close", + "add-client-dialog-title": "Add Client", + "organizational-unit-label": "Parent", + "name-label": "Name", + "serial-number-label": "Serial Number", + "netiface-label": "Network Interface", + "net-driver-label": "Network Driver", + "mac-label": "MAC", + "mac-hint": "Example: 00:11:22:33:44:55", + "mac-error": "Invalid MAC format. Valid example: 00:11:22:33:44:55", + "ip-label": "IP Address", + "ip-hint": "Example: 127.0.0.1", + "ip-error": "Invalid IP address format. Valid example: 127.0.0.1", + "menu-url-label": "Menu URL", + "menu-url-error": "Invalid URL format.", + "hardware-profile-label": "Hardware Profile", + "hardware-profile-error": "Invalid URL format.", + "cancel-button": "Cancel", + "add-button": "Add", + "edit-client-dialog-title": "Edit Client", + "delete-dialog-title": "Delete", + "delete-dialog-content": "Do you want to delete the clients located at {$INTERPOLATION} or relocate them to the top level?", + "delete-all-clients-button": "Delete All Clients", + "reposition-clients-button": "Reposition", + "deleteDialogTitle": "Delete", + "deleteConfirmationMessage": "Are you sure you want to delete {$INTERPOLATION}?", + "cancelButton": "Cancel", + "confirmButton": "Delete", + "titleAdminGroups": "Manage Groups", + "btnNewOrgUnit": "New Organizational Unit", + "btnNewClient": "New Client", + "btnLegend": "Legend", + "btnClassroomMap": "Classroom Layout", + "lblSearch": "Search", + "phSearch": "Search", + "hintSearch": "Press 'enter' to search among organizational units", + "cardTitleOrgUnit": "Organizational Unit", + "menuItemTreeView": "View Org Chart", + "menuItemEdit": "Edit", + "menuItemViewData": "View Data", + "menuItemAddOrgUnit": "Add Organizational Unit", + "menuItemAddClient": "Create Client", + "cardTitleElements": "Internal Elements", + "noElements": "No internal elements", + "menuItemEditElement": "Edit", + "menuItemViewOrgUnit": "View Data", + "menuItemAddInternalOrgUnit": "Add Organizational Unit", + "menuItemAddClientToOrgUnit": "Create Client", + "menuItemDeleteElement": "Delete Element", + "orgUnitTitle": "Organizational Unit", + "classroomGroupsTitle": "Classroom Groups", + "classroomTitle": "Classroom", + "clientGroupsTitle": "Client Groups", + "clientTitle": "Client", + "addOrgUnitTitle": "Add Organizational Unit", + "generalStepLabel": "General", + "typeLabel": "Type", + "nameLabel": "Name", + "createOrgUnitparentLabel": "Parent Organizational Unit", + "noParentOption": "--", + "descriptionLabel": "Description", + "nextButton": "Next", + "classroomInfoStepLabel": "Classroom Information", + "locationLabel": "Location", + "projectorToggle": "Projector", + "boardToggle": "Board", + "capacityLabel": "Capacity", + "backButton": "Back", + "additionalInfoStepLabel": "Additional Information", + "commentsLabel": "Comments", + "networkSettingsStepLabel": "Network Settings", + "proxyUrlLabel": "Proxy Server URL", + "dnsIpLabel": "DNS Server IP", + "netmaskLabel": "Netmask", + "routerLabel": "Router", + "ntpIpLabel": "NTP Server IP", + "p2pModeLabel": "P2P Mode", + "p2pTimeLabel": "P2P Time", + "mcastIpLabel": "Multicast IP", + "mcastSpeedLabel": "Multicast Speed", + "mcastPortLabel": "Multicast Port", + "mcastModeLabel": "Multicast Mode", + "menuUrlLabel": "Menu URL", + "hardwareProfileLabel": "Hardware Profile", + "urlFormatError": "Invalid URL format.", + "submitButton": "Add", + "editOrgUnitTitle": "Edit Organizational Unit", + "editOrgUnitParentLabel": "Parent", + "validationToggle": "Validation", + "orgUnitPropertiesTitle": "Organizational Unit Properties", + "generalDataTab": "General Data", + "classroomNetworkPropertiesTab": "Classroom and Network Properties", + "actionsTab": "Actions", + "2366056895545879062": "Power On", + "7368908909686115507": "Power Off", + "7760171369336053154": "Reset", + "6799187990933478083": "Other Actions 1", + "8971534271481971645": "Other Actions 2", + "3300614831699539964": "Other Actions 3", + "viewTreeTitle": "View Organizational Unit Tree", + "closeButton": "Close", + "webConsoleTitle": "Opengnsys Web Console", + "admin": "Administration", + "editUser": "Edit User", + "usersMenuItem": "Users", + "rolesMenuItem": "Roles", + "logout": "Logout", + "welcomeUser": "Welcome {$INTERPOLATION}", + "groups": "Groups", + "actions": "Actions", + "images": "Images", + "components": "Components", + "repositories": "Repositories", + "menus": "Menus", + "search": "Search", + "calendars": "Calendars", + "headerOpengnsys": "Opengnsys", + "loginlabelUsername": "Enter your username", + "loginlabelPassword": "Enter your password", + "buttonLogin": "Log In", + "labelUsers": "Users", + "labelRoles": "Roles", + "dialogTitleAddRole": "Add Role (TBD)", + "labelRoleName": "Name", + "sectionTitlePermissions": "Permissions:", + "checkboxManageUsers": "Manage Users", + "checkboxPXEConfig": "PXE Configuration", + "checkboxConsoleImages": "Web Console Images", + "checkboxManageComponents": "Manage Components", + "checkboxCreateImages": "Create Images", + "checkboxServerConfigScript": "Server Configuration Script", + "checkboxOther": "...", + "buttonCancel": "Cancel", + "buttonAdd": "Add", + "dialogTitleDeleteRole": "Delete Role", + "dialogContentDeleteRole": "Are you sure you want to delete the role {$INTERPOLATION}?", + "buttonDelete": "Delete", + "headerRoleManagement": "Role Management", + "buttonAddRole": "+ Add", + "headerActions": "Actions", + "dialogTitleAddUser": "Add User", + "addUserlabelUsername": "Username", + "addUserlabelPassword": "Password", + "labelRole": "Role", + "labelOrganizationalUnit": "Organizational Unit", + "dialogTitleEditUser": "Edit User", + "labelCurrentPassword": "Current Password", + "labelNewPassword": "New Password", + "labelRepeatPassword": "Repeat Password", + "errorPasswordMismatch": "Passwords do not match", + "errorUpdate": "{$INTERPOLATION}", + "buttonEdit": "Edit", + "dialogTitleDeleteUser": "Delete User", + "dialogContentDeleteUser": "Are you sure you want to delete {$INTERPOLATION}?", + "editUserlabelUsername": "Username", + "editUserlabelPassword": "Password", + "labelOrgUnit": "Organizational Unit", + "headerUserManagement": "User Management", + "buttonAddUser": "+ Add", + "columnActions": "Actions", + "buttonEditUser": "Edit", + "buttonDeleteUser": "Delete" + } +} \ No newline at end of file From 4a13be34a92d959e4a8fd6f7f5b7328d013340fd Mon Sep 17 00:00:00 2001 From: apuente Date: Tue, 30 Jul 2024 20:20:05 +0200 Subject: [PATCH 05/13] Internacionalization buttons mock --- .../src/app/components/login/login.component.html | 6 ++++++ .../src/app/components/login/login.component.ts | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/ogWebconsole/src/app/components/login/login.component.html b/ogWebconsole/src/app/components/login/login.component.html index cca44b1..249977d 100644 --- a/ogWebconsole/src/app/components/login/login.component.html +++ b/ogWebconsole/src/app/components/login/login.component.html @@ -23,5 +23,11 @@
+
+ + + + + diff --git a/ogWebconsole/src/app/components/login/login.component.ts b/ogWebconsole/src/app/components/login/login.component.ts index 3b6f805..ba6ad1f 100644 --- a/ogWebconsole/src/app/components/login/login.component.ts +++ b/ogWebconsole/src/app/components/login/login.component.ts @@ -74,4 +74,14 @@ export class LoginComponent { } else this.toastService.success(message, 'Éxito'); } + + + //SOLO PARA LA DEMO BORRAR EN PRODUCCION + redirectToUrl1() { + window.location.href = 'http://localhost:4201/auth/login'; + } + + redirectToUrl2() { + window.location.href = 'http://localhost:4200/auth/login'; + } } From 52f6ffabfab44eb59009550f29e92d9ca815cd94 Mon Sep 17 00:00:00 2001 From: apuente Date: Tue, 30 Jul 2024 20:20:10 +0200 Subject: [PATCH 06/13] Internacionalization buttons mock --- ogWebconsole/src/locale/messages.es.json | 180 +++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 ogWebconsole/src/locale/messages.es.json diff --git a/ogWebconsole/src/locale/messages.es.json b/ogWebconsole/src/locale/messages.es.json new file mode 100644 index 0000000..f8c9fae --- /dev/null +++ b/ogWebconsole/src/locale/messages.es.json @@ -0,0 +1,180 @@ +{ + "locale": "es", + "translations": { + "digital-board": "Pizarra digital", + "projector-alt": "Proyector", + "client-image-alt": "Client", + "save-disposition-button": "Guardar disposición", + "client-properties-title": "Propiedades cliente", + "property-header": "Propiedad", + "value-header": "Valor", + "power-on-button": "Encender", + "power-off-button": "Apagar", + "reset-button": "Resetear", + "other-actions-1": "Otras acciones 1", + "other-actions-2": "Otras acciones 2", + "other-actions-3": "Otras acciones 3", + "close-button": "Cerrar", + "add-client-dialog-title": "Añadir Cliente", + "organizational-unit-label": "Padre", + "name-label": "Nombre", + "serial-number-label": "Número de Serie", + "netiface-label": "Interfaz de red", + "net-driver-label": "Controlador de red", + "mac-label": "MAC", + "mac-hint": "Ejemplo: 00:11:22:33:44:55", + "mac-error": "Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55", + "ip-label": "Dirección IP", + "ip-hint": "Ejemplo: 127.0.0.1", + "ip-error": "Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1", + "menu-url-label": "Menú URL", + "menu-url-error": "Formato de URL inválido.", + "hardware-profile-label": "Perfil de Hardware", + "hardware-profile-error": "Formato de URL inválido.", + "cancel-button": "Cancelar", + "add-button": "Añadir", + "edit-client-dialog-title": "Editar Cliente", + "delete-dialog-title": "Eliminar", + "delete-dialog-content": "¿Quiere borrar los clientes situados en {$INTERPOLATION} o quiere resituarlos en el nivel superior?", + "delete-all-clients-button": "Borrar todos los clientes", + "reposition-clients-button": "Resituar", + "deleteDialogTitle": "Eliminar", + "deleteConfirmationMessage": "¿Estás seguro que deseas eliminar {$INTERPOLATION}?", + "cancelButton": "Cancelar", + "confirmButton": "Eliminar", + "titleAdminGroups": "Administrar grupos", + "btnNewOrgUnit": "Nueva Unidad Organizativa", + "btnNewClient": "Nuevo Cliente", + "btnLegend": "Leyenda", + "btnClassroomMap": "Plano de aula", + "lblSearch": "Búsqueda", + "phSearch": "Búsqueda", + "hintSearch": "Pulsar 'enter' para buscar entre las unidades organizativas", + "cardTitleOrgUnit": "Unidad organizativa", + "menuItemTreeView": "Ver organigrama", + "menuItemEdit": "Editar", + "menuItemViewData": "Visualizar datos", + "menuItemAddOrgUnit": "Añadir unidad organizativa", + "menuItemAddClient": "Crear cliente", + "cardTitleElements": "Elementos internos", + "noElements": "No hay elementos internos", + "menuItemEditElement": "Editar", + "menuItemViewOrgUnit": "Visualizar datos", + "menuItemAddInternalOrgUnit": "Añadir unidad organizativa", + "menuItemAddClientToOrgUnit": "Crear cliente", + "menuItemDeleteElement": "Borrar elemento", + "orgUnitTitle": "Unidad organizativa", + "classroomGroupsTitle": "Grupos de aula", + "classroomTitle": "Aula", + "clientGroupsTitle": "Grupos de clientes", + "clientTitle": "Cliente", + "addOrgUnitTitle": "Añadir Unidad Organizativa", + "generalStepLabel": "General", + "typeLabel": "Tipo", + "nameLabel": "Nombre", + "createOrgUnitparentLabel": "Unidad organizativa padre", + "noParentOption": "--", + "descriptionLabel": "Descripción", + "nextButton": "Siguiente", + "classroomInfoStepLabel": "Información del Aula", + "locationLabel": "Ubicación", + "projectorToggle": "Proyector", + "boardToggle": "Pizarra", + "capacityLabel": "Aforo", + "backButton": "Atrás", + "additionalInfoStepLabel": "Información Adicional", + "commentsLabel": "Comentarios", + "networkSettingsStepLabel": "Configuración de Red", + "proxyUrlLabel": "Url servidor Proxy", + "dnsIpLabel": "IP servidor DNS", + "netmaskLabel": "Máscara de Red", + "routerLabel": "Router", + "ntpIpLabel": "IP servidor NTP", + "p2pModeLabel": "Modo P2P", + "p2pTimeLabel": "Tiempo P2P", + "mcastIpLabel": "IP Multicast", + "mcastSpeedLabel": "Velocidad Multicast", + "mcastPortLabel": "Puerto Multicast", + "mcastModeLabel": "Modo Multicast", + "menuUrlLabel": "Menú URL", + "hardwareProfileLabel": "Perfil de Hardware", + "urlFormatError": "Formato de URL inválido.", + "submitButton": "Añadir", + "editOrgUnitTitle": "Editar Unidad Organizativa", + "editOrgUnitParentLabel": "Padre", + "validationToggle": "Validación", + "orgUnitPropertiesTitle": "Propiedades unidad organizativa", + "generalDataTab": "Datos generales", + "classroomNetworkPropertiesTab": "Propiedades aula y de red", + "actionsTab": "Acciones", + "2366056895545879062": "Encender", + "7368908909686115507": "Apagar", + "7760171369336053154": "Resetear", + "6799187990933478083": "Otras acciones 1", + "8971534271481971645": "Otras acciones 2", + "3300614831699539964": "Otras acciones 3", + "viewTreeTitle": "Visualizar árbol unidad Organizativa", + "closeButton": "Cerrar", + "webConsoleTitle": "Opengnsys webconsole", + "admin": "Administración", + "editUser": "Editar usuario", + "usersMenuItem": "Usuarios", + "rolesMenuItem": "Roles", + "logout": "Salir", + "welcomeUser": "Bienvenido {$INTERPOLATION}", + "groups": "Grupos", + "actions": "Acciones", + "images": "Imágenes", + "components": "Componentes", + "repositories": "Repositorios", + "menus": "Menús", + "search": "Buscar", + "calendars": "Calendarios", + "headerOpengnsys": "Opengnsys", + "loginlabelUsername": "Introduce tu usuario", + "loginlabelPassword": "Introduce tu contraseña", + "buttonLogin": "Iniciar sesión", + "labelUsers": "Usuarios", + "labelRoles": "Roles", + "dialogTitleAddRole": "Añadir Rol (TBD)", + "labelRoleName": "Nombre", + "sectionTitlePermissions": "Permisos:", + "checkboxManageUsers": "Gestionar los usuarios", + "checkboxPXEConfig": "Configuración PXE", + "checkboxConsoleImages": "Imágenes de la consola web", + "checkboxManageComponents": "Gestionar los distintos componentes", + "checkboxCreateImages": "Crear imágenes", + "checkboxServerConfigScript": "script de configuración del servidor", + "checkboxOther": "...", + "buttonCancel": "Cancelar", + "buttonAdd": "Añadir", + "dialogTitleDeleteRole": "Eliminar Rol", + "dialogContentDeleteRole": "¿Estás seguro que deseas eliminar el rol {$INTERPOLATION}?", + "buttonDelete": "Eliminar", + "headerRoleManagement": "Gestión de roles", + "buttonAddRole": "+ Añadir", + "headerActions": "Acciones", + "dialogTitleAddUser": "Añadir Usuario", + "addUserlabelUsername": "Nombre de usuario", + "addUserlabelPassword": "Contraseña", + "labelRole": "Rol", + "labelOrganizationalUnit": "Unidad organiativa", + "dialogTitleEditUser": "Editar Usuario", + "labelCurrentPassword": "Contraseña actual", + "labelNewPassword": "Nueva contraseña", + "labelRepeatPassword": "Repite la contraseña", + "errorPasswordMismatch": " Las contraseñas no coinciden ", + "errorUpdate": " {$INTERPOLATION} ", + "buttonEdit": "Editar", + "dialogTitleDeleteUser": "Eliminar Usuario", + "dialogContentDeleteUser": "¿Estás seguro que deseas eliminar a {$INTERPOLATION}?", + "editUserlabelUsername": "Nombre de usuario", + "editUserlabelPassword": "Contraseña", + "labelOrgUnit": "Unidad organizativa", + "headerUserManagement": "Gestión de usuarios", + "buttonAddUser": "+ Añadir", + "columnActions": "Acciones", + "buttonEditUser": "Editar", + "buttonDeleteUser": "Eliminar" + } +} \ No newline at end of file From 4016f00f785cb292188161c45498867fa929273a Mon Sep 17 00:00:00 2001 From: apuente Date: Wed, 31 Jul 2024 12:25:27 +0200 Subject: [PATCH 07/13] Merge css fix --- .../components/groups/groups.component.css | 9 +- .../components/groups/groups.component.html | 137 ++----- .../app/components/login/login.component.ts | 4 +- ogWebconsole/src/locale/messages.es.json | 346 +++++++++--------- 4 files changed, 226 insertions(+), 270 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index b4bd345..465d0b5 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -126,9 +126,16 @@ mat-spinner { .container { /* Asegúrate de que esta clase sea la del contenedor del botón */ display: flex; justify-content: flex-end; + width: 200px; +} +.classroomBtn-container { + display: flex; + justify-content: flex-end; + width: 100%; /* Asegura que el contenedor ocupe todo el ancho disponible */ + padding-right: 20px; /* Opcional: ajusta el espacio a la derecha */ } -.roomMap-btn { +.classroomBtn { } .container { diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 0494a28..4c70895 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -1,27 +1,27 @@ - +
-

Administrar grupos

+

Administrar grupos

- - - + + +
-
- +
+
- Búsqueda - + Búsqueda + search - Pulsar 'enter' para buscar entre las unidades organizativas + Pulsar 'enter' para buscar entre las unidades organizativas
- Unidad organizativa + Unidad organizativa @@ -38,45 +38,45 @@ class="edit-icon" #tooltip="matTooltip" matTooltip="Visualizar en forma de arbol" - matTooltipHideDelay="0">account_tree + matTooltipHideDelay="0" i18n-matTooltip="@@tooltipViewTree">account_tree - Ver organigrama + Ver organigrama @@ -88,7 +88,7 @@
- Elementos internos + Elementos internos {{ crumb }} @@ -102,7 +102,7 @@
info - No hay elementos internos + No hay elementos internos
@@ -119,24 +119,24 @@ menu @@ -148,12 +148,12 @@
- -

Búsqueda

+ +

Búsqueda

- Seleccione filtro + Seleccione filtro {{ savedFilter.name }} @@ -161,68 +161,3 @@
- -
-
- - Selecciona una opción - - Unidades organizativas - Clientes - - - - Nombre - - - - Tipo de unidad - - Unidad organizativa - Grupos de aulas - Aulas - Grupos de clientes - - - - Select an option - - None - Option 1 - Option 2 - Option 3 - - - -
-
- - - - - {{ result.name }} - -

{{ result.type }}

-

Unidades internas: {{ result.type !== 'client' ? result.children.length : 0}}

-

Clientes: {{ result.type !== 'client' ? result.clients.length : 0}}

-
-
-
-
-
- - -
-
- -

No hay resultados para mostrar.

-
-
-
-
-
- diff --git a/ogWebconsole/src/app/components/login/login.component.ts b/ogWebconsole/src/app/components/login/login.component.ts index ba6ad1f..1c4458d 100644 --- a/ogWebconsole/src/app/components/login/login.component.ts +++ b/ogWebconsole/src/app/components/login/login.component.ts @@ -78,10 +78,10 @@ export class LoginComponent { //SOLO PARA LA DEMO BORRAR EN PRODUCCION redirectToUrl1() { - window.location.href = 'http://localhost:4201/auth/login'; + window.location.href = 'http://localhost:4200/auth/login'; } redirectToUrl2() { - window.location.href = 'http://localhost:4200/auth/login'; + window.location.href = 'http://localhost:4201/auth/login'; } } diff --git a/ogWebconsole/src/locale/messages.es.json b/ogWebconsole/src/locale/messages.es.json index f8c9fae..d65253d 100644 --- a/ogWebconsole/src/locale/messages.es.json +++ b/ogWebconsole/src/locale/messages.es.json @@ -1,180 +1,194 @@ { - "locale": "es", + "locale": "en", "translations": { - "digital-board": "Pizarra digital", - "projector-alt": "Proyector", + "digital-board": "Digital board", + "projector-alt": "Projector", "client-image-alt": "Client", - "save-disposition-button": "Guardar disposición", - "client-properties-title": "Propiedades cliente", - "property-header": "Propiedad", - "value-header": "Valor", - "power-on-button": "Encender", - "power-off-button": "Apagar", - "reset-button": "Resetear", - "other-actions-1": "Otras acciones 1", - "other-actions-2": "Otras acciones 2", - "other-actions-3": "Otras acciones 3", - "close-button": "Cerrar", - "add-client-dialog-title": "Añadir Cliente", - "organizational-unit-label": "Padre", - "name-label": "Nombre", - "serial-number-label": "Número de Serie", - "netiface-label": "Interfaz de red", - "net-driver-label": "Controlador de red", + "save-disposition-button": "Save disposition", + "client-properties-title": "Client properties", + "property-header": "Property", + "value-header": "Value", + "power-on-button": "Power on", + "power-off-button": "Power off", + "reset-button": "Reset", + "other-actions-1": "Other actions 1", + "other-actions-2": "Other actions 2", + "other-actions-3": "Other actions 3", + "close-button": "Close", + "add-client-dialog-title": "Add Client", + "organizational-unit-label": "Parent", + "name-label": "Name", + "serial-number-label": "Serial Number", + "netiface-label": "Network Interface", + "net-driver-label": "Network Driver", "mac-label": "MAC", - "mac-hint": "Ejemplo: 00:11:22:33:44:55", - "mac-error": "Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55", - "ip-label": "Dirección IP", - "ip-hint": "Ejemplo: 127.0.0.1", - "ip-error": "Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1", - "menu-url-label": "Menú URL", - "menu-url-error": "Formato de URL inválido.", - "hardware-profile-label": "Perfil de Hardware", - "hardware-profile-error": "Formato de URL inválido.", - "cancel-button": "Cancelar", - "add-button": "Añadir", - "edit-client-dialog-title": "Editar Cliente", - "delete-dialog-title": "Eliminar", - "delete-dialog-content": "¿Quiere borrar los clientes situados en {$INTERPOLATION} o quiere resituarlos en el nivel superior?", - "delete-all-clients-button": "Borrar todos los clientes", - "reposition-clients-button": "Resituar", - "deleteDialogTitle": "Eliminar", - "deleteConfirmationMessage": "¿Estás seguro que deseas eliminar {$INTERPOLATION}?", - "cancelButton": "Cancelar", - "confirmButton": "Eliminar", - "titleAdminGroups": "Administrar grupos", - "btnNewOrgUnit": "Nueva Unidad Organizativa", - "btnNewClient": "Nuevo Cliente", - "btnLegend": "Leyenda", - "btnClassroomMap": "Plano de aula", - "lblSearch": "Búsqueda", - "phSearch": "Búsqueda", - "hintSearch": "Pulsar 'enter' para buscar entre las unidades organizativas", - "cardTitleOrgUnit": "Unidad organizativa", - "menuItemTreeView": "Ver organigrama", - "menuItemEdit": "Editar", - "menuItemViewData": "Visualizar datos", - "menuItemAddOrgUnit": "Añadir unidad organizativa", - "menuItemAddClient": "Crear cliente", - "cardTitleElements": "Elementos internos", - "noElements": "No hay elementos internos", - "menuItemEditElement": "Editar", - "menuItemViewOrgUnit": "Visualizar datos", - "menuItemAddInternalOrgUnit": "Añadir unidad organizativa", - "menuItemAddClientToOrgUnit": "Crear cliente", - "menuItemDeleteElement": "Borrar elemento", - "orgUnitTitle": "Unidad organizativa", - "classroomGroupsTitle": "Grupos de aula", - "classroomTitle": "Aula", - "clientGroupsTitle": "Grupos de clientes", - "clientTitle": "Cliente", - "addOrgUnitTitle": "Añadir Unidad Organizativa", + "mac-hint": "Example: 00:11:22:33:44:55", + "mac-error": "Invalid MAC format. Valid example: 00:11:22:33:44:55", + "ip-label": "IP Address", + "ip-hint": "Example: 127.0.0.1", + "ip-error": "Invalid IP address format. Valid example: 127.0.0.1", + "menu-url-label": "Menu URL", + "menu-url-error": "Invalid URL format.", + "hardware-profile-label": "Hardware Profile", + "hardware-profile-error": "Invalid URL format.", + "cancel-button": "Cancel", + "add-button": "Add", + "edit-client-dialog-title": "Edit Client", + "delete-dialog-title": "Delete", + "delete-dialog-content": "Do you want to delete the clients located at {$INTERPOLATION} or reposition them at the upper level?", + "delete-all-clients-button": "Delete all clients", + "reposition-clients-button": "Reposition", + "deleteDialogTitle": "Delete", + "deleteConfirmationMessage": "Are you sure you want to delete {$INTERPOLATION}?", + "cancelButton": "Cancel", + "confirmButton": "Delete", + "tabGeneralLabel": "General", + "headerAdminGroups": "Manage groups", + "buttonNewOU": "New Organizational Unit", + "buttonNewClient": "New Client", + "buttonLegend": "Legend", + "buttonRoomMap": "Classroom layout", + "labelSearch": "Search", + "placeholderSearch": "Search", + "hintSearch": "Press 'enter' to search among organizational units", + "cardTitleOU": "Organizational Unit", + "tooltipViewTree": "View as tree", + "menuItemViewTree": "View organizational chart", + "tooltipEditOU": "Edit organizational unit", + "menuItemEditOU": "Edit", + "tooltipViewOU": "View organizational unit", + "menuItemViewOU": "View data", + "tooltipAddOU": "Create internal organizational unit", + "menuItemAddOU": "Add organizational unit", + "tooltipAddClient": "Create client in this organizational unit", + "menuItemAddClient": "Create client", + "cardTitleInternalElements": "Internal Elements", + "emptyListNoInternalElements": "No internal elements", + "tooltipEditElement": "Edit element", + "menuItemEditElement": "Edit", + "tooltipViewOUElement": "View organizational unit", + "menuItemViewOUElement": "View data", + "tooltipAddOUElement": "Create internal organizational unit", + "menuItemAddOUElement": "Add organizational unit", + "tooltipAddClientElement": "Create client in this organizational unit", + "menuItemAddClientElement": "Create client", + "tooltipDeleteElement": "Delete element", + "menuItemDeleteElement": "Delete element", + "tabAdvancedSearchLabel": "Advanced Search", + "headerSearch": "Search", + "labelSelectFilter": "Select filter", + "orgUnitTitle": "Organizational Unit", + "classroomGroupsTitle": "Classroom Groups", + "classroomTitle": "Classroom", + "clientGroupsTitle": "Client Groups", + "clientTitle": "Client", + "addOrgUnitTitle": "Add Organizational Unit", "generalStepLabel": "General", - "typeLabel": "Tipo", - "nameLabel": "Nombre", - "createOrgUnitparentLabel": "Unidad organizativa padre", + "typeLabel": "Type", + "nameLabel": "Name", + "createOrgUnitparentLabel": "Parent Organizational Unit", "noParentOption": "--", - "descriptionLabel": "Descripción", - "nextButton": "Siguiente", - "classroomInfoStepLabel": "Información del Aula", - "locationLabel": "Ubicación", - "projectorToggle": "Proyector", - "boardToggle": "Pizarra", - "capacityLabel": "Aforo", - "backButton": "Atrás", - "additionalInfoStepLabel": "Información Adicional", - "commentsLabel": "Comentarios", - "networkSettingsStepLabel": "Configuración de Red", - "proxyUrlLabel": "Url servidor Proxy", - "dnsIpLabel": "IP servidor DNS", - "netmaskLabel": "Máscara de Red", + "descriptionLabel": "Description", + "nextButton": "Next", + "classroomInfoStepLabel": "Classroom Information", + "locationLabel": "Location", + "projectorToggle": "Projector", + "boardToggle": "Board", + "capacityLabel": "Capacity", + "backButton": "Back", + "additionalInfoStepLabel": "Additional Information", + "commentsLabel": "Comments", + "networkSettingsStepLabel": "Network Settings", + "proxyUrlLabel": "Proxy Server URL", + "dnsIpLabel": "DNS Server IP", + "netmaskLabel": "Netmask", "routerLabel": "Router", - "ntpIpLabel": "IP servidor NTP", - "p2pModeLabel": "Modo P2P", - "p2pTimeLabel": "Tiempo P2P", - "mcastIpLabel": "IP Multicast", - "mcastSpeedLabel": "Velocidad Multicast", - "mcastPortLabel": "Puerto Multicast", - "mcastModeLabel": "Modo Multicast", - "menuUrlLabel": "Menú URL", - "hardwareProfileLabel": "Perfil de Hardware", - "urlFormatError": "Formato de URL inválido.", - "submitButton": "Añadir", - "editOrgUnitTitle": "Editar Unidad Organizativa", - "editOrgUnitParentLabel": "Padre", - "validationToggle": "Validación", - "orgUnitPropertiesTitle": "Propiedades unidad organizativa", - "generalDataTab": "Datos generales", - "classroomNetworkPropertiesTab": "Propiedades aula y de red", - "actionsTab": "Acciones", - "2366056895545879062": "Encender", - "7368908909686115507": "Apagar", - "7760171369336053154": "Resetear", - "6799187990933478083": "Otras acciones 1", - "8971534271481971645": "Otras acciones 2", - "3300614831699539964": "Otras acciones 3", - "viewTreeTitle": "Visualizar árbol unidad Organizativa", - "closeButton": "Cerrar", + "ntpIpLabel": "NTP Server IP", + "p2pModeLabel": "P2P Mode", + "p2pTimeLabel": "P2P Time", + "mcastIpLabel": "Multicast IP", + "mcastSpeedLabel": "Multicast Speed", + "mcastPortLabel": "Multicast Port", + "mcastModeLabel": "Multicast Mode", + "menuUrlLabel": "Menu URL", + "hardwareProfileLabel": "Hardware Profile", + "urlFormatError": "Invalid URL format.", + "submitButton": "Add", + "editOrgUnitTitle": "Edit Organizational Unit", + "editOrgUnitParentLabel": "Parent", + "validationToggle": "Validation", + "orgUnitPropertiesTitle": "Organizational Unit Properties", + "generalDataTab": "General Data", + "classroomNetworkPropertiesTab": "Classroom and Network Properties", + "actionsTab": "Actions", + "2366056895545879062": "Power on", + "7368908909686115507": "Power off", + "7760171369336053154": "Reset", + "6799187990933478083": "Other actions 1", + "8971534271481971645": "Other actions 2", + "3300614831699539964": "Other actions 3", + "viewTreeTitle": "View Organizational Unit Tree", + "closeButton": "Close", "webConsoleTitle": "Opengnsys webconsole", - "admin": "Administración", - "editUser": "Editar usuario", - "usersMenuItem": "Usuarios", + "admin": "Administration", + "editUser": "Edit user", + "usersMenuItem": "Users", "rolesMenuItem": "Roles", - "logout": "Salir", - "welcomeUser": "Bienvenido {$INTERPOLATION}", - "groups": "Grupos", - "actions": "Acciones", - "images": "Imágenes", - "components": "Componentes", - "repositories": "Repositorios", - "menus": "Menús", - "search": "Buscar", - "calendars": "Calendarios", + "logout": "Logout", + "welcomeUser": "Welcome {$INTERPOLATION}", + "groups": "Groups", + "actions": "Actions", + "images": "Images", + "components": "Components", + "repositories": "Repositories", + "menus": "Menus", + "search": "Search", + "calendars": "Calendars", "headerOpengnsys": "Opengnsys", - "loginlabelUsername": "Introduce tu usuario", - "loginlabelPassword": "Introduce tu contraseña", - "buttonLogin": "Iniciar sesión", - "labelUsers": "Usuarios", + "loginlabelUsername": "Enter your username", + "loginlabelPassword": "Enter your password", + "buttonLogin": "Log in", + "labelUsers": "Users", "labelRoles": "Roles", - "dialogTitleAddRole": "Añadir Rol (TBD)", - "labelRoleName": "Nombre", - "sectionTitlePermissions": "Permisos:", - "checkboxManageUsers": "Gestionar los usuarios", - "checkboxPXEConfig": "Configuración PXE", - "checkboxConsoleImages": "Imágenes de la consola web", - "checkboxManageComponents": "Gestionar los distintos componentes", - "checkboxCreateImages": "Crear imágenes", - "checkboxServerConfigScript": "script de configuración del servidor", + "dialogTitleAddRole": "Add Role (TBD)", + "labelRoleName": "Name", + "sectionTitlePermissions": "Permissions:", + "checkboxManageUsers": "Manage users", + "checkboxPXEConfig": "PXE Configuration", + "checkboxConsoleImages": "Web console images", + "checkboxManageComponents": "Manage components", + "checkboxCreateImages": "Create images", + "checkboxServerConfigScript": "Server configuration script", "checkboxOther": "...", - "buttonCancel": "Cancelar", - "buttonAdd": "Añadir", - "dialogTitleDeleteRole": "Eliminar Rol", - "dialogContentDeleteRole": "¿Estás seguro que deseas eliminar el rol {$INTERPOLATION}?", - "buttonDelete": "Eliminar", - "headerRoleManagement": "Gestión de roles", - "buttonAddRole": "+ Añadir", - "headerActions": "Acciones", - "dialogTitleAddUser": "Añadir Usuario", - "addUserlabelUsername": "Nombre de usuario", - "addUserlabelPassword": "Contraseña", - "labelRole": "Rol", - "labelOrganizationalUnit": "Unidad organiativa", - "dialogTitleEditUser": "Editar Usuario", - "labelCurrentPassword": "Contraseña actual", - "labelNewPassword": "Nueva contraseña", - "labelRepeatPassword": "Repite la contraseña", - "errorPasswordMismatch": " Las contraseñas no coinciden ", + "buttonCancel": "Cancel", + "buttonAdd": "Add", + "dialogTitleDeleteRole": "Delete Role", + "dialogContentDeleteRole": "Are you sure you want to delete the role {$INTERPOLATION}?", + "buttonDelete": "Delete", + "headerRoleManagement": "Role management", + "buttonAddRole": "+ Add", + "headerActions": "Actions", + "dialogTitleAddUser": "Add User", + "addUserlabelUsername": "Username", + "addUserlabelPassword": "Password", + "labelRole": "Role", + "labelOrganizationalUnit": "Organizational Unit", + "dialogTitleEditUser": "Edit User", + "labelCurrentPassword": "Current password", + "labelNewPassword": "New password", + "labelRepeatPassword": "Repeat password", + "errorPasswordMismatch": " Passwords do not match ", "errorUpdate": " {$INTERPOLATION} ", - "buttonEdit": "Editar", - "dialogTitleDeleteUser": "Eliminar Usuario", - "dialogContentDeleteUser": "¿Estás seguro que deseas eliminar a {$INTERPOLATION}?", - "editUserlabelUsername": "Nombre de usuario", - "editUserlabelPassword": "Contraseña", - "labelOrgUnit": "Unidad organizativa", - "headerUserManagement": "Gestión de usuarios", - "buttonAddUser": "+ Añadir", - "columnActions": "Acciones", - "buttonEditUser": "Editar", - "buttonDeleteUser": "Eliminar" + "buttonEdit": "Edit", + "dialogTitleDeleteUser": "Delete User", + "dialogContentDeleteUser": "Are you sure you want to delete {$INTERPOLATION}?", + "editUserlabelUsername": "Username", + "editUserlabelPassword": "Password", + "labelOrgUnit": "Organizational Unit", + "headerUserManagement": "User management", + "buttonAddUser": "+ Add", + "columnActions": "Actions", + "buttonEditUser": "Edit", + "buttonDeleteUser": "Delete" } -} \ No newline at end of file +} From 18ff06afb262d0582751f9a3e684e8e150dc3aa7 Mon Sep 17 00:00:00 2001 From: apuente Date: Thu, 1 Aug 2024 23:25:46 +0200 Subject: [PATCH 08/13] Added saved filters --- .../src/app/components/groups/data.service.ts | 17 + .../components/groups/groups.component.css | 8 +- .../components/groups/groups.component.html | 255 +++++++----- .../app/components/groups/groups.component.ts | 33 +- .../layout/header/header.component.ts | 1 - .../layout/sidebar/sidebar.component.css | 5 + .../layout/sidebar/sidebar.component.ts | 1 - ogWebconsole/src/locale/messages.en.json | 101 +++-- ogWebconsole/src/locale/messages.es.json | 373 +++++++++--------- 9 files changed, 473 insertions(+), 321 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/data.service.ts b/ogWebconsole/src/app/components/groups/data.service.ts index 5f9d7c2..655524d 100644 --- a/ogWebconsole/src/app/components/groups/data.service.ts +++ b/ogWebconsole/src/app/components/groups/data.service.ts @@ -139,4 +139,21 @@ export class DataService { }) ); } + + getFilters(): Observable { + return this.http.get('http://127.0.0.1:8080/views?page=1&itemsPerPage=30').pipe( + map(response => { + if (response['hydra:member'] && Array.isArray(response['hydra:member'])) { + return response['hydra:member']; + } else { + throw new Error('Unexpected response format'); + } + }), + catchError(error => { + console.error('Error fetching filters', error); + return throwError(error); + }) + ); + } + } diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index 465d0b5..7dd19c4 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -122,17 +122,15 @@ mat-spinner { align-self: center; } - -.container { /* Asegúrate de que esta clase sea la del contenedor del botón */ +.container { display: flex; justify-content: flex-end; - width: 200px; } .classroomBtn-container { display: flex; justify-content: flex-end; - width: 100%; /* Asegura que el contenedor ocupe todo el ancho disponible */ - padding-right: 20px; /* Opcional: ajusta el espacio a la derecha */ + width: 100%; + padding-right: 20px; } .classroomBtn { diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 4c70895..296c03e 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -1,27 +1,27 @@ - +
-

Administrar grupos

+

Administrar grupos

- - - + + +
-
- +
+
- Búsqueda - + Búsqueda + search - Pulsar 'enter' para buscar entre las unidades organizativas + Pulsar 'enter' para buscar entre las unidades organizativas
- Unidad organizativa + Unidad organizativa @@ -31,55 +31,60 @@ apartment {{ unidad.name }} - menu - - - - - - - - + menu + + + + + + + +
@@ -88,7 +93,7 @@
- Elementos internos + Elementos internos {{ crumb }} @@ -102,7 +107,7 @@
info - No hay elementos internos + No hay elementos internos
@@ -116,48 +121,112 @@ {{child.name}} - menu - - - - - - - - + menu + + + + + + + +
-
- -

Búsqueda

+ +

Búsqueda

- Seleccione filtro + Seleccione filtro - - {{ savedFilter.name }} + + {{ savedFilter }} - +
+ +
+
+ + Selecciona una opción + + Unidades organizativas + Clientes + + + + Nombre + + + + Tipo de unidad + + Unidad organizativa + Grupos de aulas + Aulas + Grupos de clientes + + + + Selecciona otra opción + + Ninguno + Opción 1 + Opción 2 + Opción 3 + + + +
+
+ + + + + {{ result.name }} + +

{{ result.type }}

+

Unidades internas: {{ result.type !== 'client' ? result.children.length : 0}}

+

Clientes: {{ result.type !== 'client' ? result.clients.length : 0}}

+
+
+
+
+
+ + +
+
+ +

No hay resultados para mostrar.

+
+
+
+
+
+ diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 54454dc..f2297ef 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -39,7 +39,7 @@ export class GroupsComponent implements OnInit { selectedFilter2: string = 'none'; filterName: string = ''; filteredResults: any[] = []; - savedFilters: any[] = []; + savedFilterNames: any[] = []; length: number = 0; itemsPerPage: number = 10; page: number = 1; @@ -55,6 +55,20 @@ export class GroupsComponent implements OnInit { ngOnInit(): void { this.search(); + this.getFilters(); + } + + getFilters(): void { + this.dataService.getFilters().subscribe( + data => { + this.savedFilterNames = data.map((filter: any) => filter.name); + console.log('data:', data); + console.log('Saved filters:', this.savedFilterNames); + }, + error => { + console.error('Error fetching filters:', error); + } + ); } search(): void { @@ -303,10 +317,21 @@ export class GroupsComponent implements OnInit { } saveFilters() { const filters = { - name: `Filter ${new Date().toISOString()}`, - filter1: this.selectedFilter1, - filter2: this.selectedFilter2 + name: this.filterName || `Filter ${new Date().toISOString()}`, + favourite: true, + filters: { + filter1: this.selectedFilter1, + filter2: this.selectedFilter2 + } }; + + console.log('Filters:', filters); + + this.http.post('http://127.0.0.1:8080/views', filters).subscribe(response => { + console.log('Response from server:', response); + }, error => { + console.error('Error:', error); + }); } loadSelectedFilter(savedFilter: any) { diff --git a/ogWebconsole/src/app/components/layout/header/header.component.ts b/ogWebconsole/src/app/components/layout/header/header.component.ts index cac4d85..668e03e 100644 --- a/ogWebconsole/src/app/components/layout/header/header.component.ts +++ b/ogWebconsole/src/app/components/layout/header/header.component.ts @@ -30,7 +30,6 @@ export class HeaderComponent implements OnInit { this.decodedToken = jwtDecode(token); this.isSuperAdmin = this.decodedToken.roles.includes('ROLE_SUPER_ADMIN'); localStorage.setItem('isSuperAdmin', String(this.isSuperAdmin)); - console.log('isSuperAdmin:', this.isSuperAdmin); this.username = this.decodedToken.username; } catch (error) { console.error('Error decoding JWT:', error); diff --git a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.css b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.css index a58bde4..d1640bb 100644 --- a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.css +++ b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.css @@ -37,3 +37,8 @@ mat-icon { margin-top: auto; } +@media (max-width: 680px) { + mat-nav-list { + width: 0px; + } +} \ No newline at end of file diff --git a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.ts b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.ts index a93961e..4beab49 100644 --- a/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.ts +++ b/ogWebconsole/src/app/components/layout/sidebar/sidebar.component.ts @@ -23,7 +23,6 @@ export class SidebarComponent { this.decodedToken = jwtDecode(token); this.isSuperAdmin = this.decodedToken.roles.includes('ROLE_SUPER_ADMIN'); localStorage.setItem('isSuperAdmin', String(this.isSuperAdmin)); - console.log('isSuperAdmin:', this.isSuperAdmin); this.username = this.decodedToken.username; } catch (error) { console.error('Error decoding JWT:', error); diff --git a/ogWebconsole/src/locale/messages.en.json b/ogWebconsole/src/locale/messages.en.json index 9b9e80f..69f2491 100644 --- a/ogWebconsole/src/locale/messages.en.json +++ b/ogWebconsole/src/locale/messages.en.json @@ -1,19 +1,19 @@ { "locale": "en", "translations": { - "digital-board": "Digital Board", + "digital-board": "Digital board", "projector-alt": "Projector", "client-image-alt": "Client", - "save-disposition-button": "Save Layout", + "save-disposition-button": "Save layout", "client-properties-title": "Client Properties", "property-header": "Property", "value-header": "Value", "power-on-button": "Power On", "power-off-button": "Power Off", "reset-button": "Reset", - "other-actions-1": "Other Actions 1", - "other-actions-2": "Other Actions 2", - "other-actions-3": "Other Actions 3", + "other-actions-1": "Other actions 1", + "other-actions-2": "Other actions 2", + "other-actions-3": "Other actions 3", "close-button": "Close", "add-client-dialog-title": "Add Client", "organizational-unit-label": "Parent", @@ -35,34 +35,62 @@ "add-button": "Add", "edit-client-dialog-title": "Edit Client", "delete-dialog-title": "Delete", - "delete-dialog-content": "Do you want to delete the clients located at {$INTERPOLATION} or relocate them to the top level?", - "delete-all-clients-button": "Delete All Clients", + "delete-dialog-content": "Do you want to delete the clients located in {$INTERPOLATION} or move them to the top level?", + "delete-all-clients-button": "Delete all clients", "reposition-clients-button": "Reposition", "deleteDialogTitle": "Delete", "deleteConfirmationMessage": "Are you sure you want to delete {$INTERPOLATION}?", "cancelButton": "Cancel", "confirmButton": "Delete", - "titleAdminGroups": "Manage Groups", - "btnNewOrgUnit": "New Organizational Unit", - "btnNewClient": "New Client", - "btnLegend": "Legend", - "btnClassroomMap": "Classroom Layout", - "lblSearch": "Search", - "phSearch": "Search", - "hintSearch": "Press 'enter' to search among organizational units", - "cardTitleOrgUnit": "Organizational Unit", - "menuItemTreeView": "View Org Chart", - "menuItemEdit": "Edit", - "menuItemViewData": "View Data", - "menuItemAddOrgUnit": "Add Organizational Unit", - "menuItemAddClient": "Create Client", - "cardTitleElements": "Internal Elements", - "noElements": "No internal elements", - "menuItemEditElement": "Edit", - "menuItemViewOrgUnit": "View Data", - "menuItemAddInternalOrgUnit": "Add Organizational Unit", - "menuItemAddClientToOrgUnit": "Create Client", - "menuItemDeleteElement": "Delete Element", + "adminGroupsTitle": "Manage Groups", + "newOrganizationalUnitButton": "New Organizational Unit", + "newClientButton": "New Client", + "legendButton": "Legend", + "classroomMapButton": "Classroom Layout", + "searchLabel": "Search", + "searchPlaceholder": "Search", + "searchHint": "Press 'enter' to search among organizational units", + "organizationalUnitTitle": "Organizational Unit", + "viewTreeTooltip": "account_tree", + "viewTreeMenu": "View Organization Chart", + "editUnitTooltip": "edit", + "editUnitMenu": "Edit", + "viewUnitTool": "visibility", + "viewUnitMenu": "View Details", + "addInternalUnitTool": "add_home_work", + "addInternalUnitMenu": "Add Organizational Unit", + "addClientDevice": "devices", + "addClientMenu": "Create Client", + "internalElementsTitle": "Internal Elements", + "noInternalElementsMessage": "No internal elements", + "editElementTooltip": "edit", + "editElementMenu": "Edit", + "viewUnitTooltip": "visibility", + "addInternalUnitTooltip": "add_home_work", + "addClientTooltip": "devices", + "deleteElementTooltip": "delete", + "deleteElementMenu": "Delete Element", + "searchTitle": "Search", + "selectFilterLabel": "Select filter", + "selectOptionLabel": "Select an option", + "organizationalUnitsOption": "Organizational Units", + "clientsOption": "Clients", + "nameLabel": "Name", + "namePlaceholder": "Organizational Unit", + "unitTypeLabel": "Unit Type", + "organizationalUnitOption": "Organizational Unit", + "classroomsGroupOption": "Classroom Groups", + "classroomOption": "Classrooms", + "clientGroupOption": "Client Groups", + "selectAnotherOptionLabel": "Select another option", + "noneOption": "None", + "option1": "Option 1", + "option2": "Option 2", + "option3": "Option 3", + "saveFiltersButton": "Save Filters", + "internalUnits": "Internal Units: {$INTERPOLATION}", + "clients": "Clients: {$INTERPOLATION}", + "noResultsMessage": "No results to display.", "orgUnitTitle": "Organizational Unit", "classroomGroupsTitle": "Classroom Groups", "classroomTitle": "Classroom", @@ -71,7 +99,6 @@ "addOrgUnitTitle": "Add Organizational Unit", "generalStepLabel": "General", "typeLabel": "Type", - "nameLabel": "Name", "createOrgUnitparentLabel": "Parent Organizational Unit", "noParentOption": "--", "descriptionLabel": "Description", @@ -110,9 +137,9 @@ "2366056895545879062": "Power On", "7368908909686115507": "Power Off", "7760171369336053154": "Reset", - "6799187990933478083": "Other Actions 1", - "8971534271481971645": "Other Actions 2", - "3300614831699539964": "Other Actions 3", + "6799187990933478083": "Other actions 1", + "8971534271481971645": "Other actions 2", + "3300614831699539964": "Other actions 3", "viewTreeTitle": "View Organizational Unit Tree", "closeButton": "Close", "webConsoleTitle": "Opengnsys Web Console", @@ -139,12 +166,12 @@ "dialogTitleAddRole": "Add Role (TBD)", "labelRoleName": "Name", "sectionTitlePermissions": "Permissions:", - "checkboxManageUsers": "Manage Users", + "checkboxManageUsers": "Manage users", "checkboxPXEConfig": "PXE Configuration", "checkboxConsoleImages": "Web Console Images", - "checkboxManageComponents": "Manage Components", - "checkboxCreateImages": "Create Images", - "checkboxServerConfigScript": "Server Configuration Script", + "checkboxManageComponents": "Manage various components", + "checkboxCreateImages": "Create images", + "checkboxServerConfigScript": "Server configuration script", "checkboxOther": "...", "buttonCancel": "Cancel", "buttonAdd": "Add", @@ -177,4 +204,4 @@ "buttonEditUser": "Edit", "buttonDeleteUser": "Delete" } -} \ No newline at end of file +} diff --git a/ogWebconsole/src/locale/messages.es.json b/ogWebconsole/src/locale/messages.es.json index d65253d..5665acb 100644 --- a/ogWebconsole/src/locale/messages.es.json +++ b/ogWebconsole/src/locale/messages.es.json @@ -1,194 +1,207 @@ { - "locale": "en", + "locale": "es", "translations": { - "digital-board": "Digital board", - "projector-alt": "Projector", + "digital-board": "Pizarra digital", + "projector-alt": "Proyector", "client-image-alt": "Client", - "save-disposition-button": "Save disposition", - "client-properties-title": "Client properties", - "property-header": "Property", - "value-header": "Value", - "power-on-button": "Power on", - "power-off-button": "Power off", - "reset-button": "Reset", - "other-actions-1": "Other actions 1", - "other-actions-2": "Other actions 2", - "other-actions-3": "Other actions 3", - "close-button": "Close", - "add-client-dialog-title": "Add Client", - "organizational-unit-label": "Parent", - "name-label": "Name", - "serial-number-label": "Serial Number", - "netiface-label": "Network Interface", - "net-driver-label": "Network Driver", + "save-disposition-button": "Guardar disposición", + "client-properties-title": "Propiedades cliente", + "property-header": "Propiedad", + "value-header": "Valor", + "power-on-button": "Encender", + "power-off-button": "Apagar", + "reset-button": "Resetear", + "other-actions-1": "Otras acciones 1", + "other-actions-2": "Otras acciones 2", + "other-actions-3": "Otras acciones 3", + "close-button": "Cerrar", + "add-client-dialog-title": "Añadir Cliente", + "organizational-unit-label": "Padre", + "name-label": "Nombre", + "serial-number-label": "Número de Serie", + "netiface-label": "Interfaz de red", + "net-driver-label": "Controlador de red", "mac-label": "MAC", - "mac-hint": "Example: 00:11:22:33:44:55", - "mac-error": "Invalid MAC format. Valid example: 00:11:22:33:44:55", - "ip-label": "IP Address", - "ip-hint": "Example: 127.0.0.1", - "ip-error": "Invalid IP address format. Valid example: 127.0.0.1", - "menu-url-label": "Menu URL", - "menu-url-error": "Invalid URL format.", - "hardware-profile-label": "Hardware Profile", - "hardware-profile-error": "Invalid URL format.", - "cancel-button": "Cancel", - "add-button": "Add", - "edit-client-dialog-title": "Edit Client", - "delete-dialog-title": "Delete", - "delete-dialog-content": "Do you want to delete the clients located at {$INTERPOLATION} or reposition them at the upper level?", - "delete-all-clients-button": "Delete all clients", - "reposition-clients-button": "Reposition", - "deleteDialogTitle": "Delete", - "deleteConfirmationMessage": "Are you sure you want to delete {$INTERPOLATION}?", - "cancelButton": "Cancel", - "confirmButton": "Delete", - "tabGeneralLabel": "General", - "headerAdminGroups": "Manage groups", - "buttonNewOU": "New Organizational Unit", - "buttonNewClient": "New Client", - "buttonLegend": "Legend", - "buttonRoomMap": "Classroom layout", - "labelSearch": "Search", - "placeholderSearch": "Search", - "hintSearch": "Press 'enter' to search among organizational units", - "cardTitleOU": "Organizational Unit", - "tooltipViewTree": "View as tree", - "menuItemViewTree": "View organizational chart", - "tooltipEditOU": "Edit organizational unit", - "menuItemEditOU": "Edit", - "tooltipViewOU": "View organizational unit", - "menuItemViewOU": "View data", - "tooltipAddOU": "Create internal organizational unit", - "menuItemAddOU": "Add organizational unit", - "tooltipAddClient": "Create client in this organizational unit", - "menuItemAddClient": "Create client", - "cardTitleInternalElements": "Internal Elements", - "emptyListNoInternalElements": "No internal elements", - "tooltipEditElement": "Edit element", - "menuItemEditElement": "Edit", - "tooltipViewOUElement": "View organizational unit", - "menuItemViewOUElement": "View data", - "tooltipAddOUElement": "Create internal organizational unit", - "menuItemAddOUElement": "Add organizational unit", - "tooltipAddClientElement": "Create client in this organizational unit", - "menuItemAddClientElement": "Create client", - "tooltipDeleteElement": "Delete element", - "menuItemDeleteElement": "Delete element", - "tabAdvancedSearchLabel": "Advanced Search", - "headerSearch": "Search", - "labelSelectFilter": "Select filter", - "orgUnitTitle": "Organizational Unit", - "classroomGroupsTitle": "Classroom Groups", - "classroomTitle": "Classroom", - "clientGroupsTitle": "Client Groups", - "clientTitle": "Client", - "addOrgUnitTitle": "Add Organizational Unit", + "mac-hint": "Ejemplo: 00:11:22:33:44:55", + "mac-error": "Formato de MAC inválido. Ejemplo válido: 00:11:22:33:44:55", + "ip-label": "Dirección IP", + "ip-hint": "Ejemplo: 127.0.0.1", + "ip-error": "Formato de dirección IP inválido. Ejemplo válido: 127.0.0.1", + "menu-url-label": "Menú URL", + "menu-url-error": "Formato de URL inválido.", + "hardware-profile-label": "Perfil de Hardware", + "hardware-profile-error": "Formato de URL inválido.", + "cancel-button": "Cancelar", + "add-button": "Añadir", + "edit-client-dialog-title": "Editar Cliente", + "delete-dialog-title": "Eliminar", + "delete-dialog-content": "¿Quiere borrar los clientes situados en {$INTERPOLATION} o quiere resituarlos en el nivel superior?", + "delete-all-clients-button": "Borrar todos los clientes", + "reposition-clients-button": "Resituar", + "deleteDialogTitle": "Eliminar", + "deleteConfirmationMessage": "¿Estás seguro que deseas eliminar {$INTERPOLATION}?", + "cancelButton": "Cancelar", + "confirmButton": "Eliminar", + "adminGroupsTitle": "Administrar grupos", + "newOrganizationalUnitButton": "Nueva Unidad Organizativa", + "newClientButton": "Nuevo Cliente", + "legendButton": "Leyenda", + "classroomMapButton": "Plano de aula", + "searchLabel": "Búsqueda", + "searchPlaceholder": "Búsqueda", + "searchHint": "Pulsar 'enter' para buscar entre las unidades organizativas", + "organizationalUnitTitle": "Unidad organizativa", + "viewTreeTooltip": "account_tree ", + "viewTreeMenu": "Ver organigrama", + "editUnitTooltip": "edit ", + "editUnitMenu": "Editar", + "viewUnitTool": "visibility ", + "viewUnitMenu": "Visualizar datos", + "addInternalUnitTool": "add_home_work ", + "addInternalUnitMenu": "Añadir unidad organizativa", + "addClientDevice": "devices ", + "addClientMenu": "Crear cliente", + "internalElementsTitle": "Elementos internos", + "noInternalElementsMessage": "No hay elementos internos", + "editElementTooltip": "edit", + "editElementMenu": "Editar", + "viewUnitTooltip": "visibility", + "addInternalUnitTooltip": "add_home_work", + "addClientTooltip": "devices", + "deleteElementTooltip": "delete", + "deleteElementMenu": "Borrar elemento", + "searchTitle": "Búsqueda", + "selectFilterLabel": "Seleccione filtro", + "selectOptionLabel": "Selecciona una opción", + "organizationalUnitsOption": "Unidades organizativas", + "clientsOption": "Clientes", + "nameLabel": "Nombre", + "namePlaceholder": "Unidad organizativa", + "unitTypeLabel": "Tipo de unidad", + "organizationalUnitOption": "Unidad organizativa", + "classroomsGroupOption": "Grupos de aulas", + "classroomOption": "Aulas", + "clientGroupOption": "Grupos de clientes", + "selectAnotherOptionLabel": "Selecciona otra opción", + "noneOption": "Ninguno", + "option1": "Opción 1", + "option2": "Opción 2", + "option3": "Opción 3", + "saveFiltersButton": "Guardar Filtros", + "internalUnits": "Unidades internas: {$INTERPOLATION}", + "clients": "Clientes: {$INTERPOLATION}", + "noResultsMessage": "No hay resultados para mostrar.", + "orgUnitTitle": "Unidad organizativa", + "classroomGroupsTitle": "Grupos de aula", + "classroomTitle": "Aula", + "clientGroupsTitle": "Grupos de clientes", + "clientTitle": "Cliente", + "addOrgUnitTitle": "Añadir Unidad Organizativa", "generalStepLabel": "General", - "typeLabel": "Type", - "nameLabel": "Name", - "createOrgUnitparentLabel": "Parent Organizational Unit", + "typeLabel": "Tipo", + "createOrgUnitparentLabel": "Unidad organizativa padre", "noParentOption": "--", - "descriptionLabel": "Description", - "nextButton": "Next", - "classroomInfoStepLabel": "Classroom Information", - "locationLabel": "Location", - "projectorToggle": "Projector", - "boardToggle": "Board", - "capacityLabel": "Capacity", - "backButton": "Back", - "additionalInfoStepLabel": "Additional Information", - "commentsLabel": "Comments", - "networkSettingsStepLabel": "Network Settings", - "proxyUrlLabel": "Proxy Server URL", - "dnsIpLabel": "DNS Server IP", - "netmaskLabel": "Netmask", + "descriptionLabel": "Descripción", + "nextButton": "Siguiente", + "classroomInfoStepLabel": "Información del Aula", + "locationLabel": "Ubicación", + "projectorToggle": "Proyector", + "boardToggle": "Pizarra", + "capacityLabel": "Aforo", + "backButton": "Atrás", + "additionalInfoStepLabel": "Información Adicional", + "commentsLabel": "Comentarios", + "networkSettingsStepLabel": "Configuración de Red", + "proxyUrlLabel": "Url servidor Proxy", + "dnsIpLabel": "IP servidor DNS", + "netmaskLabel": "Máscara de Red", "routerLabel": "Router", - "ntpIpLabel": "NTP Server IP", - "p2pModeLabel": "P2P Mode", - "p2pTimeLabel": "P2P Time", - "mcastIpLabel": "Multicast IP", - "mcastSpeedLabel": "Multicast Speed", - "mcastPortLabel": "Multicast Port", - "mcastModeLabel": "Multicast Mode", - "menuUrlLabel": "Menu URL", - "hardwareProfileLabel": "Hardware Profile", - "urlFormatError": "Invalid URL format.", - "submitButton": "Add", - "editOrgUnitTitle": "Edit Organizational Unit", - "editOrgUnitParentLabel": "Parent", - "validationToggle": "Validation", - "orgUnitPropertiesTitle": "Organizational Unit Properties", - "generalDataTab": "General Data", - "classroomNetworkPropertiesTab": "Classroom and Network Properties", - "actionsTab": "Actions", - "2366056895545879062": "Power on", - "7368908909686115507": "Power off", - "7760171369336053154": "Reset", - "6799187990933478083": "Other actions 1", - "8971534271481971645": "Other actions 2", - "3300614831699539964": "Other actions 3", - "viewTreeTitle": "View Organizational Unit Tree", - "closeButton": "Close", + "ntpIpLabel": "IP servidor NTP", + "p2pModeLabel": "Modo P2P", + "p2pTimeLabel": "Tiempo P2P", + "mcastIpLabel": "IP Multicast", + "mcastSpeedLabel": "Velocidad Multicast", + "mcastPortLabel": "Puerto Multicast", + "mcastModeLabel": "Modo Multicast", + "menuUrlLabel": "Menú URL", + "hardwareProfileLabel": "Perfil de Hardware", + "urlFormatError": "Formato de URL inválido.", + "submitButton": "Añadir", + "editOrgUnitTitle": "Editar Unidad Organizativa", + "editOrgUnitParentLabel": "Padre", + "validationToggle": "Validación", + "orgUnitPropertiesTitle": "Propiedades unidad organizativa", + "generalDataTab": "Datos generales", + "classroomNetworkPropertiesTab": "Propiedades aula y de red", + "actionsTab": "Acciones", + "2366056895545879062": "Encender", + "7368908909686115507": "Apagar", + "7760171369336053154": "Resetear", + "6799187990933478083": "Otras acciones 1", + "8971534271481971645": "Otras acciones 2", + "3300614831699539964": "Otras acciones 3", + "viewTreeTitle": "Visualizar árbol unidad Organizativa", + "closeButton": "Cerrar", "webConsoleTitle": "Opengnsys webconsole", - "admin": "Administration", - "editUser": "Edit user", - "usersMenuItem": "Users", + "admin": "Administración", + "editUser": "Editar usuario", + "usersMenuItem": "Usuarios", "rolesMenuItem": "Roles", - "logout": "Logout", - "welcomeUser": "Welcome {$INTERPOLATION}", - "groups": "Groups", - "actions": "Actions", - "images": "Images", - "components": "Components", - "repositories": "Repositories", - "menus": "Menus", - "search": "Search", - "calendars": "Calendars", + "logout": "Salir", + "welcomeUser": "Bienvenido {$INTERPOLATION}", + "groups": "Grupos", + "actions": "Acciones", + "images": "Imágenes", + "components": "Componentes", + "repositories": "Repositorios", + "menus": "Menús", + "search": "Buscar", + "calendars": "Calendarios", "headerOpengnsys": "Opengnsys", - "loginlabelUsername": "Enter your username", - "loginlabelPassword": "Enter your password", - "buttonLogin": "Log in", - "labelUsers": "Users", + "loginlabelUsername": "Introduce tu usuario", + "loginlabelPassword": "Introduce tu contraseña", + "buttonLogin": "Iniciar sesión", + "labelUsers": "Usuarios", "labelRoles": "Roles", - "dialogTitleAddRole": "Add Role (TBD)", - "labelRoleName": "Name", - "sectionTitlePermissions": "Permissions:", - "checkboxManageUsers": "Manage users", - "checkboxPXEConfig": "PXE Configuration", - "checkboxConsoleImages": "Web console images", - "checkboxManageComponents": "Manage components", - "checkboxCreateImages": "Create images", - "checkboxServerConfigScript": "Server configuration script", + "dialogTitleAddRole": "Añadir Rol (TBD)", + "labelRoleName": "Nombre", + "sectionTitlePermissions": "Permisos:", + "checkboxManageUsers": "Gestionar los usuarios", + "checkboxPXEConfig": "Configuración PXE", + "checkboxConsoleImages": "Imágenes de la consola web", + "checkboxManageComponents": "Gestionar los distintos componentes", + "checkboxCreateImages": "Crear imágenes", + "checkboxServerConfigScript": "script de configuración del servidor", "checkboxOther": "...", - "buttonCancel": "Cancel", - "buttonAdd": "Add", - "dialogTitleDeleteRole": "Delete Role", - "dialogContentDeleteRole": "Are you sure you want to delete the role {$INTERPOLATION}?", - "buttonDelete": "Delete", - "headerRoleManagement": "Role management", - "buttonAddRole": "+ Add", - "headerActions": "Actions", - "dialogTitleAddUser": "Add User", - "addUserlabelUsername": "Username", - "addUserlabelPassword": "Password", - "labelRole": "Role", - "labelOrganizationalUnit": "Organizational Unit", - "dialogTitleEditUser": "Edit User", - "labelCurrentPassword": "Current password", - "labelNewPassword": "New password", - "labelRepeatPassword": "Repeat password", - "errorPasswordMismatch": " Passwords do not match ", + "buttonCancel": "Cancelar", + "buttonAdd": "Añadir", + "dialogTitleDeleteRole": "Eliminar Rol", + "dialogContentDeleteRole": "¿Estás seguro que deseas eliminar el rol {$INTERPOLATION}?", + "buttonDelete": "Eliminar", + "headerRoleManagement": "Gestión de roles", + "buttonAddRole": "+ Añadir", + "headerActions": "Acciones", + "dialogTitleAddUser": "Añadir Usuario", + "addUserlabelUsername": "Nombre de usuario", + "addUserlabelPassword": "Contraseña", + "labelRole": "Rol", + "labelOrganizationalUnit": "Unidad organiativa", + "dialogTitleEditUser": "Editar Usuario", + "labelCurrentPassword": "Contraseña actual", + "labelNewPassword": "Nueva contraseña", + "labelRepeatPassword": "Repite la contraseña", + "errorPasswordMismatch": " Las contraseñas no coinciden ", "errorUpdate": " {$INTERPOLATION} ", - "buttonEdit": "Edit", - "dialogTitleDeleteUser": "Delete User", - "dialogContentDeleteUser": "Are you sure you want to delete {$INTERPOLATION}?", - "editUserlabelUsername": "Username", - "editUserlabelPassword": "Password", - "labelOrgUnit": "Organizational Unit", - "headerUserManagement": "User management", - "buttonAddUser": "+ Add", - "columnActions": "Actions", - "buttonEditUser": "Edit", - "buttonDeleteUser": "Delete" + "buttonEdit": "Editar", + "dialogTitleDeleteUser": "Eliminar Usuario", + "dialogContentDeleteUser": "¿Estás seguro que deseas eliminar a {$INTERPOLATION}?", + "editUserlabelUsername": "Nombre de usuario", + "editUserlabelPassword": "Contraseña", + "labelOrgUnit": "Unidad organizativa", + "headerUserManagement": "Gestión de usuarios", + "buttonAddUser": "+ Añadir", + "columnActions": "Acciones", + "buttonEditUser": "Editar", + "buttonDeleteUser": "Eliminar" } -} +} \ No newline at end of file From a125e9b4e5656f6b2ef3b5f5e3b1ac1c4d55feb6 Mon Sep 17 00:00:00 2001 From: apuente Date: Fri, 2 Aug 2024 11:52:31 +0200 Subject: [PATCH 09/13] Added saved filters modal --- ogWebconsole/src/app/app.module.ts | 4 +- .../src/app/components/groups/data.service.ts | 19 +++++++ .../components/groups/groups.component.html | 18 +++--- .../app/components/groups/groups.component.ts | 57 +++++++++++++------ 4 files changed, 71 insertions(+), 27 deletions(-) diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts index ac4d23c..c999b44 100644 --- a/ogWebconsole/src/app/app.module.ts +++ b/ogWebconsole/src/app/app.module.ts @@ -69,6 +69,7 @@ import { import { LegendComponent } from './components/groups/legend/legend.component'; import { ClassroomViewDialogComponent } from './components/groups/classroom-view/classroom-view-modal'; import {MatPaginator} from "@angular/material/paginator"; +import { SaveFiltersDialogComponent } from './components/groups/save-filters-dialog/save-filters-dialog.component'; @NgModule({ declarations: [ @@ -100,7 +101,8 @@ import {MatPaginator} from "@angular/material/paginator"; ShowOrganizationalUnitComponent, TreeViewComponent, LegendComponent, - ClassroomViewDialogComponent + ClassroomViewDialogComponent, + SaveFiltersDialogComponent ], bootstrap: [AppComponent], imports: [BrowserModule, diff --git a/ogWebconsole/src/app/components/groups/data.service.ts b/ogWebconsole/src/app/components/groups/data.service.ts index 655524d..89863aa 100644 --- a/ogWebconsole/src/app/components/groups/data.service.ts +++ b/ogWebconsole/src/app/components/groups/data.service.ts @@ -155,5 +155,24 @@ export class DataService { }) ); } + + getFilter(id: string): Observable { + return this.http.get('http://127.0.0.1:8080/views/' + id).pipe( + map(response => { + + + if (response.name && response.filters) { + return response; + } else { + throw new Error('Unexpected response format'); + } + }), + catchError(error => { + console.error('Error fetching filters', error); + return throwError(error); + }) + ); + } + } diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 296c03e..8d848d9 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -152,7 +152,7 @@
- +

Búsqueda

@@ -160,7 +160,7 @@ Seleccione filtro - {{ savedFilter }} + {{ savedFilter[0] }} @@ -168,13 +168,6 @@
- - Selecciona una opción - - Unidades organizativas - Clientes - - Nombre @@ -188,6 +181,13 @@ Grupos de clientes + + Selecciona una opción + + Unidades organizativas + Clientes + + Selecciona otra opción diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index f2297ef..cc95942 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -18,6 +18,7 @@ import { ClassroomViewDialogComponent } from './classroom-view/classroom-view-mo import {HttpClient} from "@angular/common/http"; import {Observable} from "rxjs"; import {PageEvent} from "@angular/material/paginator"; +import { SaveFiltersDialogComponent } from './save-filters-dialog/save-filters-dialog.component'; @Component({ selector: 'app-groups', @@ -61,9 +62,7 @@ export class GroupsComponent implements OnInit { getFilters(): void { this.dataService.getFilters().subscribe( data => { - this.savedFilterNames = data.map((filter: any) => filter.name); - console.log('data:', data); - console.log('Saved filters:', this.savedFilterNames); + this.savedFilterNames = data.map((filter: any) => [filter.name, filter.uuid]); }, error => { console.error('Error fetching filters:', error); @@ -315,26 +314,50 @@ export class GroupsComponent implements OnInit { this.itemsPerPage = event.pageSize; this.applyFilter(); } + + saveFilters() { - const filters = { - name: this.filterName || `Filter ${new Date().toISOString()}`, - favourite: true, - filters: { - filter1: this.selectedFilter1, - filter2: this.selectedFilter2 + const dialogRef = this.dialog.open(SaveFiltersDialogComponent); + + dialogRef.afterClosed().subscribe(result => { + if (result) { + const filters = { + name: result, + favourite: true, + filters: { + filter0: this.filterName, + filter1: this.selectedFilter1, + filter2: this.selectedFilter2 + } + }; + + console.log('Filters:', filters); + + this.http.post('http://127.0.0.1:8080/views', filters).subscribe(response => { + console.log('Response from server:', response); + }, error => { + console.error('Error:', error); + }); } - }; - - console.log('Filters:', filters); - - this.http.post('http://127.0.0.1:8080/views', filters).subscribe(response => { - console.log('Response from server:', response); - }, error => { - console.error('Error:', error); }); } loadSelectedFilter(savedFilter: any) { + const url = 'http://127.0.0.1:8080/views/' + savedFilter[1]; + console.log('llamando a:', url); + + this.dataService.getFilter(savedFilter[1]).subscribe(response => { + console.log('Response from server:', response.filters); + if (response) { + console.log('Filter1:', response.filters); + this.filterName = response.filters.filter0 || ''; + this.selectedFilter1 = response.filters.filter1 || null; + this.selectedFilter2 = response.filters.filter2 || ''; + } + }, error => { + console.error('Error:', error); + }); } + } From 80f0324717bbc50dc6b36a9c0c3d96ed89b6af88 Mon Sep 17 00:00:00 2001 From: apuente Date: Sun, 4 Aug 2024 21:54:32 +0200 Subject: [PATCH 10/13] Added saved filters modal --- .../components/groups/groups.component.css | 3 + .../components/groups/groups.component.html | 142 ++++++++++++++++-- .../app/components/groups/groups.component.ts | 19 +++ 3 files changed, 153 insertions(+), 11 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index 7dd19c4..8d5af00 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -201,3 +201,6 @@ mat-spinner { mat-card { margin-bottom: 20px; } + +.temp_filter{color: red; +} \ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 8d848d9..e327b58 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -168,10 +168,21 @@
+ + Selecciona una opción + + Unidades organizativas + Clientes + + Nombre + + + + Tipo de unidad @@ -181,29 +192,138 @@ Grupos de clientes + - Selecciona una opción - - Unidades organizativas - Clientes - - - - Selecciona otra opción + Planta Ninguno - Opción 1 - Opción 2 - Opción 3 + Planta 1 + Planta 2 + Planta 3 + + + + + + + + + Sistema Operativo + + Ninguno + Windows 10 Education 1803 64 bits + Ubuntu 18.04.1 LTS 64 bits + Ubuntu 16.04.4 LTS 64 bits + DATA + Windows Boot loader + Windows 7 Professional + OpenGnsys Live + Ubuntu 18.04 LTS 64 bits + Windows 10 Education 1709 64 bits + Windows 7 Enterprise 64 bits + Windows 10 Education 1607 64 bits + Ubuntu 16.04.5 LTS 64 bits + Ubuntu 16.04.2 LTS 64 bits + Windows 10 Education 64 bits + CentOS release 6.3 (Final) 64 bits + Ubuntu 16.04.1 LTS 64 bits + Windows 10 Enterprise 1803 64 bits + Ubuntu 16.04.3 LTS 64 bits + Ubuntu precise (12.04.4 LTS) + GRUB2 Loader + Mac OS X 10.9.5 64 bits + Mac OS X 10.8.3 recovery + Mac OS X 10.13.6 + Windows 10 Education 1703 64 bits + Windows 7 Professional 64 bits + Ubuntu 14.04.4 LTS 64 bits + Windows 10 Education 1511 64 bits + Ubuntu 18.04.2 LTS 64 bits + Windows 10 Education 1809 64 bits + Ubuntu 16.04.6 LTS 64 bits + Ubuntu 14.04.5 LTS 64 bits + Windows 10 Education 1903 64 bits + Windows 10 Enterprise 1903 64 bits + Windows 10 Pro 1903 64 bits + Ubuntu 18.04.3 LTS 64 bits + Windows 10 Education 1909 64 bits + Ubuntu 18.04.3 LTS + Windows 10 Enterprise 1909 64 bits + Ubuntu 18.04.4 LTS 64 bits + Windows Boot loader 64 bits + Windows 10 Education 2004 64 bits + Ubuntu 20.04 LTS 64 bits + Ubuntu 20.04.1 LTS 64 bits + Windows 10 Enterprise LTSC 2019 Evaluation 1809 64 bits + Ubuntu 18.04.5 LTS 64 bits + Windows 10 Education 2009 64 bits + Ubuntu 20.04.2 LTS 64 bits + GRUB2 Loader 64 bits + Windows 10 Education 2009 + Debian GNU/Linux 8 (jessie) 64 bits + Windows 10 Enterprise 2009 64 bits + Windows 10 Pro 2009 64 bits + Windows 10 Pro 1909 64 bits + Windows 10 Home 2009 64 bits + Ubuntu 20.04.3 LTS 64 bits + Ubuntu 20.04.4 LTS 64 bits + Microsoft Windows XP + Ubuntu 22.04 LTS 64 bits + Ubuntu 22.04.1 LTS 64 bits + EducaAndOS 20.04 64 bits + Ubuntu 20.04.5 LTS 64 bits + Windows 10 Pro N 2009 64 bits + Guadalinex Edu 20.04 64 bits + Ubuntu 18.04.6 LTS 64 bits + elementary OS 6 Odin 64 bits + Ubuntu 22.04.2 LTS 64 bits + Ubuntu 22.04.3 LTS 64 bits + Windows 10 Pro for Workstations 2009 64 bits + Ubuntu 23.10 64 bits + Ubuntu 22.04.4 LTS 64 bits + + + + + + Estado + + off + initializing + oglive + busy + linux + linux_session + macos + windows + windows_session + + + + + IP + + + + + MAC + + + + + +
+ + {{ result.name }}

{{ result.type }}

diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index cc95942..afb55da 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -45,6 +45,7 @@ export class GroupsComponent implements OnInit { itemsPerPage: number = 10; page: number = 1; pageSizeOptions: number[] = [5, 10, 25, 100]; + selectedElements: string[] = []; constructor( private dataService: DataService, @@ -359,5 +360,23 @@ export class GroupsComponent implements OnInit { }); } + + onCheckboxChange(event: any, name: string) { + if (event.checked) { + this.selectedElements.push(name); + } else { + const index = this.selectedElements.indexOf(name); + if (index > -1) { + this.selectedElements.splice(index, 1); + } + } + console.log(this.selectedElements); + } + + + sendActions() { + alert('Send actions:'+ this.selectedElements); + + } } From ecba08ecacb8ae67ffa16d89d3584c0c98bbd5dc Mon Sep 17 00:00:00 2001 From: apuente Date: Mon, 5 Aug 2024 11:47:01 +0200 Subject: [PATCH 11/13] Added missing files --- ogWebconsole/src/app/app.module.ts | 4 +- .../acctions-modal.component.css | 20 ++++++++++ .../acctions-modal.component.html | 9 +++++ .../acctions-modal.component.spec.ts | 23 +++++++++++ .../acctions-modal.component.ts | 31 +++++++++++++++ .../components/groups/groups.component.css | 2 +- .../components/groups/groups.component.html | 2 +- .../app/components/groups/groups.component.ts | 9 +++-- .../save-filters-dialog.component.css | 0 .../save-filters-dialog.component.html | 1 + .../save-filters-dialog.component.spec.ts | 23 +++++++++++ .../save-filters-dialog.component.ts | 38 +++++++++++++++++++ 12 files changed, 155 insertions(+), 7 deletions(-) create mode 100644 ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.css create mode 100644 ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.html create mode 100644 ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.spec.ts create mode 100644 ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts create mode 100644 ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.css create mode 100644 ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.html create mode 100644 ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.spec.ts create mode 100644 ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.ts diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts index c999b44..9ac672f 100644 --- a/ogWebconsole/src/app/app.module.ts +++ b/ogWebconsole/src/app/app.module.ts @@ -70,6 +70,7 @@ import { LegendComponent } from './components/groups/legend/legend.component'; import { ClassroomViewDialogComponent } from './components/groups/classroom-view/classroom-view-modal'; import {MatPaginator} from "@angular/material/paginator"; import { SaveFiltersDialogComponent } from './components/groups/save-filters-dialog/save-filters-dialog.component'; +import { AcctionsModalComponent } from './components/groups/acctions-modal/acctions-modal.component'; @NgModule({ declarations: [ @@ -102,7 +103,8 @@ import { SaveFiltersDialogComponent } from './components/groups/save-filters-dia TreeViewComponent, LegendComponent, ClassroomViewDialogComponent, - SaveFiltersDialogComponent + SaveFiltersDialogComponent, + AcctionsModalComponent ], bootstrap: [AppComponent], imports: [BrowserModule, diff --git a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.css b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.css new file mode 100644 index 0000000..a63ee5d --- /dev/null +++ b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.css @@ -0,0 +1,20 @@ + +.button-column { + display: flex; + flex-direction: column; + align-items: center; + background-color: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Sombra ligera */ +} + +.button-column button { + margin: 10px 0; /* Espaciado entre los botones */ + width: 200px; /* Ancho uniforme para todos los botones */ + font-size: 16px; /* Tamaño de fuente consistente */ +} + +.button-column button.mat-flat-button { + border-radius: 5px; /* Bordes ligeramente redondeados */ +} diff --git a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.html b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.html new file mode 100644 index 0000000..4530933 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.html @@ -0,0 +1,9 @@ +

Acciones

+
+ + + + + + +
\ No newline at end of file diff --git a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.spec.ts b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.spec.ts new file mode 100644 index 0000000..671341d --- /dev/null +++ b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { AcctionsModalComponent } from './acctions-modal.component'; + +describe('AcctionsModalComponent', () => { + let component: AcctionsModalComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [AcctionsModalComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(AcctionsModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts new file mode 100644 index 0000000..96fd9a4 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts @@ -0,0 +1,31 @@ +// componente +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { ToastrService } from 'ngx-toastr'; +@Component({ + selector: 'app-acctions-modal', + templateUrl: './acctions-modal.component.html', + styleUrls: ['./acctions-modal.component.css'] +}) +export class AcctionsModalComponent { + selectedElements: any; + + constructor( + private toastService: ToastrService, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this.selectedElements = data.selectedElements; + } + + onCancel(): void { + this.dialogRef.close(null); + } + + onSend(): void { + console.log('send Action'); + console.log(this.selectedElements); + + this.toastService.success(' Acción enviada a: ' + this.selectedElements); + } +} diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index 8d5af00..4dd1ce4 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -133,7 +133,7 @@ mat-spinner { padding-right: 20px; } -.classroomBtn { +.roomMap-btn{ } .container { diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index e327b58..06d3e8a 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -7,7 +7,7 @@
-
+
diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index afb55da..862dc17 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -19,6 +19,7 @@ import {HttpClient} from "@angular/common/http"; import {Observable} from "rxjs"; import {PageEvent} from "@angular/material/paginator"; import { SaveFiltersDialogComponent } from './save-filters-dialog/save-filters-dialog.component'; +import { AcctionsModalComponent } from './acctions-modal/acctions-modal.component'; @Component({ selector: 'app-groups', @@ -332,12 +333,12 @@ export class GroupsComponent implements OnInit { } }; - console.log('Filters:', filters); - this.http.post('http://127.0.0.1:8080/views', filters).subscribe(response => { console.log('Response from server:', response); + this.toastService.success('Se ha guardado el filtro correctamente'); }, error => { console.error('Error:', error); + this.toastService.error(error); }); } }); @@ -354,6 +355,7 @@ export class GroupsComponent implements OnInit { this.filterName = response.filters.filter0 || ''; this.selectedFilter1 = response.filters.filter1 || null; this.selectedFilter2 = response.filters.filter2 || ''; + this.applyFilter(); } }, error => { console.error('Error:', error); @@ -375,8 +377,7 @@ export class GroupsComponent implements OnInit { sendActions() { - alert('Send actions:'+ this.selectedElements); - + const dialogRef = this.dialog.open(AcctionsModalComponent, { data: { selectedElements: this.selectedElements }, width: '700px'}); } } diff --git a/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.css b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.css new file mode 100644 index 0000000..e69de29 diff --git a/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.html b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.html new file mode 100644 index 0000000..c02fcb8 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.html @@ -0,0 +1 @@ +

save-filters-dialog works!

diff --git a/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.spec.ts b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.spec.ts new file mode 100644 index 0000000..1a1622b --- /dev/null +++ b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SaveFiltersDialogComponent } from './save-filters-dialog.component'; + +describe('SaveFiltersDialogComponent', () => { + let component: SaveFiltersDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [SaveFiltersDialogComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(SaveFiltersDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.ts b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.ts new file mode 100644 index 0000000..9707c63 --- /dev/null +++ b/ogWebconsole/src/app/components/groups/save-filters-dialog/save-filters-dialog.component.ts @@ -0,0 +1,38 @@ +import { Component } from '@angular/core'; +import { MatDialogRef } from '@angular/material/dialog'; +import { FormControl, Validators } from '@angular/forms'; + +@Component({ + selector: 'app-save-filters-dialog', + template: ` +

Guardar filtros

+
+ + Nombre del filtro + + + El nombre es obligatorio + + +
+
+ + +
+ ` +}) +export class SaveFiltersDialogComponent { + filterNameControl = new FormControl('', [Validators.required]); + + constructor(public dialogRef: MatDialogRef) {} + + onCancel(): void { + this.dialogRef.close(null); + } + + onSave(): void { + if (this.filterNameControl.valid) { + this.dialogRef.close(this.filterNameControl.value); + } + } +} From 2fe25308f6bcb7b1d7e34dfe229e3820f91fb7a3 Mon Sep 17 00:00:00 2001 From: apuente Date: Mon, 5 Aug 2024 16:46:40 +0200 Subject: [PATCH 12/13] Demo minor fix --- .../acctions-modal.component.ts | 2 - .../classroom-view.component.css | 4 +- .../classroom-view.component.html | 4 +- .../client-view/client-view.component.html | 5 -- .../components/groups/groups.component.html | 16 ++-- .../app/components/groups/groups.component.ts | 19 +++- .../layout/header/header.component.ts | 1 + ogWebconsole/src/locale/messages.en.json | 90 +++++++++++-------- ogWebconsole/src/locale/messages.es.json | 34 ++++--- 9 files changed, 107 insertions(+), 68 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts index 96fd9a4..9d81caa 100644 --- a/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts +++ b/ogWebconsole/src/app/components/groups/acctions-modal/acctions-modal.component.ts @@ -23,8 +23,6 @@ export class AcctionsModalComponent { } onSend(): void { - console.log('send Action'); - console.log(this.selectedElements); this.toastService.success(' Acción enviada a: ' + this.selectedElements); } diff --git a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.css b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.css index de8a3a0..58d2ab4 100644 --- a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.css +++ b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.css @@ -41,12 +41,12 @@ mat-card { background-color: rgba(0, 0, 0, 0); color: black; text-align: center; - padding: 10px; + padding: 15px; box-sizing: border-box; } .client-name { - font-size: medium; + font-size: small; font-weight: bold; } diff --git a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html index 647c54a..d332bf1 100644 --- a/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html +++ b/ogWebconsole/src/app/components/groups/classroom-view/classroom-view.component.html @@ -13,9 +13,9 @@ Client
{{ client.name }}
-
+
diff --git a/ogWebconsole/src/app/components/groups/client-view/client-view.component.html b/ogWebconsole/src/app/components/groups/client-view/client-view.component.html index 1f97a50..d60e173 100644 --- a/ogWebconsole/src/app/components/groups/client-view/client-view.component.html +++ b/ogWebconsole/src/app/components/groups/client-view/client-view.component.html @@ -1,11 +1,6 @@

Propiedades cliente

- Datos generales - Propiedades de red - Propiedades del aula - Acciones - Particiones diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 06d3e8a..7cad814 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -152,7 +152,7 @@ - +

Búsqueda

@@ -194,8 +194,8 @@ - Planta - + Planta + Ninguno Planta 1 Planta 2 @@ -211,7 +211,7 @@ Sistema Operativo - + Ninguno Windows 10 Education 1803 64 bits Ubuntu 18.04.1 LTS 64 bits @@ -289,7 +289,7 @@ Estado - + off initializing oglive @@ -304,18 +304,18 @@ IP - + MAC - + - +
diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 862dc17..a47fde3 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -39,6 +39,12 @@ export class GroupsComponent implements OnInit { searchTerm: string = ''; selectedFilter1: string = 'none'; selectedFilter2: string = 'none'; + + selectedFilterOS: string[] = []; + selectedFilterStatus: string[] = []; + filterIP: string = ''; + filterMAC: string = ''; + filterName: string = ''; filteredResults: any[] = []; savedFilterNames: any[] = []; @@ -329,7 +335,12 @@ export class GroupsComponent implements OnInit { filters: { filter0: this.filterName, filter1: this.selectedFilter1, - filter2: this.selectedFilter2 + filter2: this.selectedFilter2, + filter3: this.selectedFilterOS, + filter4: this.selectedFilterStatus, + filter5: this.filterIP, + filter6: this.filterMAC, + } }; @@ -355,6 +366,12 @@ export class GroupsComponent implements OnInit { this.filterName = response.filters.filter0 || ''; this.selectedFilter1 = response.filters.filter1 || null; this.selectedFilter2 = response.filters.filter2 || ''; + + this.selectedFilterOS = response.filters.filter3 || []; + this.selectedFilterStatus = response.filters.filter4 || []; + this.filterIP = response.filters.filter5 || ''; + this.filterMAC = response.filters.filter6 || ''; + this.applyFilter(); } }, error => { diff --git a/ogWebconsole/src/app/components/layout/header/header.component.ts b/ogWebconsole/src/app/components/layout/header/header.component.ts index 668e03e..97d0c99 100644 --- a/ogWebconsole/src/app/components/layout/header/header.component.ts +++ b/ogWebconsole/src/app/components/layout/header/header.component.ts @@ -50,4 +50,5 @@ export class HeaderComponent implements OnInit { console.log("User edited successfully!") }); */ } + } diff --git a/ogWebconsole/src/locale/messages.en.json b/ogWebconsole/src/locale/messages.en.json index 69f2491..661fa67 100644 --- a/ogWebconsole/src/locale/messages.en.json +++ b/ogWebconsole/src/locale/messages.en.json @@ -1,19 +1,20 @@ { "locale": "en", "translations": { - "digital-board": "Digital board", - "projector-alt": "Projector", - "client-image-alt": "Client", - "save-disposition-button": "Save layout", - "client-properties-title": "Client Properties", - "property-header": "Property", - "value-header": "Value", + "actions-modal-title": "Actions", "power-on-button": "Power On", "power-off-button": "Power Off", "reset-button": "Reset", - "other-actions-1": "Other actions 1", - "other-actions-2": "Other actions 2", - "other-actions-3": "Other actions 3", + "other-actions-1": "Other Actions 1", + "other-actions-2": "Other Actions 2", + "other-actions-3": "Other Actions 3", + "digital-board": "Digital Board", + "projector-alt": "Projector", + "client-image-alt": "Client", + "save-disposition-button": "Save Disposition", + "client-properties-title": "Client Properties", + "property-header": "Property", + "value-header": "Value", "close-button": "Close", "add-client-dialog-title": "Add Client", "organizational-unit-label": "Parent", @@ -35,9 +36,9 @@ "add-button": "Add", "edit-client-dialog-title": "Edit Client", "delete-dialog-title": "Delete", - "delete-dialog-content": "Do you want to delete the clients located in {$INTERPOLATION} or move them to the top level?", + "delete-dialog-content": "Do you want to delete the clients located in {$INTERPOLATION} or do you want to relocate them to the higher level?", "delete-all-clients-button": "Delete all clients", - "reposition-clients-button": "Reposition", + "reposition-clients-button": "Relocate", "deleteDialogTitle": "Delete", "deleteConfirmationMessage": "Are you sure you want to delete {$INTERPOLATION}?", "cancelButton": "Cancel", @@ -46,20 +47,20 @@ "newOrganizationalUnitButton": "New Organizational Unit", "newClientButton": "New Client", "legendButton": "Legend", - "classroomMapButton": "Classroom Layout", + "classroomMapButton": "Classroom Map", "searchLabel": "Search", "searchPlaceholder": "Search", "searchHint": "Press 'enter' to search among organizational units", "organizationalUnitTitle": "Organizational Unit", - "viewTreeTooltip": "account_tree", - "viewTreeMenu": "View Organization Chart", - "editUnitTooltip": "edit", + "viewTreeTooltip": "account_tree ", + "viewTreeMenu": "View Organizational Chart", + "editUnitTooltip": "edit ", "editUnitMenu": "Edit", - "viewUnitTool": "visibility", - "viewUnitMenu": "View Details", - "addInternalUnitTool": "add_home_work", + "viewUnitTool": "visibility ", + "viewUnitMenu": "View Data", + "addInternalUnitTool": "add_home_work ", "addInternalUnitMenu": "Add Organizational Unit", - "addClientDevice": "devices", + "addClientDevice": "devices ", "addClientMenu": "Create Client", "internalElementsTitle": "Internal Elements", "noInternalElementsMessage": "No internal elements", @@ -70,9 +71,10 @@ "addClientTooltip": "devices", "deleteElementTooltip": "delete", "deleteElementMenu": "Delete Element", + "7122753603772512402": "Advanced Search", "searchTitle": "Search", - "selectFilterLabel": "Select filter", - "selectOptionLabel": "Select an option", + "selectFilterLabel": "Select Filter", + "selectOptionLabel": "Select an Option", "organizationalUnitsOption": "Organizational Units", "clientsOption": "Clients", "nameLabel": "Name", @@ -82,13 +84,25 @@ "classroomsGroupOption": "Classroom Groups", "classroomOption": "Classrooms", "clientGroupOption": "Client Groups", - "selectAnotherOptionLabel": "Select another option", + "floorLabel": "Floor", "noneOption": "None", - "option1": "Option 1", - "option2": "Option 2", - "option3": "Option 3", + "option1": "Floor 1", + "option2": "Floor 2", + "option3": "Floor 3", + "selectAnotherOptionLabel": "Operating System", + "selectStateLabel": "State", + "offOption": "off", + "initializingOption": "initializing", + "ogliveOption": "oglive", + "busyOption": "busy", + "linuxOption": "linux", + "linuxSessionOption": "linux_session", + "macosOption": "macos", + "windowsOption": "windows", + "windowsSessionOption": "windows_session", "saveFiltersButton": "Save Filters", - "internalUnits": "Internal Units: {$INTERPOLATION}", + "sendFiltersButton": "Send Action", + "internalUnits": "Internal units: {$INTERPOLATION}", "clients": "Clients: {$INTERPOLATION}", "noResultsMessage": "No results to display.", "orgUnitTitle": "Organizational Unit", @@ -137,12 +151,12 @@ "2366056895545879062": "Power On", "7368908909686115507": "Power Off", "7760171369336053154": "Reset", - "6799187990933478083": "Other actions 1", - "8971534271481971645": "Other actions 2", - "3300614831699539964": "Other actions 3", + "6799187990933478083": "Other Actions 1", + "8971534271481971645": "Other Actions 2", + "3300614831699539964": "Other Actions 3", "viewTreeTitle": "View Organizational Unit Tree", "closeButton": "Close", - "webConsoleTitle": "Opengnsys Web Console", + "webConsoleTitle": "Opengnsys Webconsole", "admin": "Administration", "editUser": "Edit User", "usersMenuItem": "Users", @@ -160,18 +174,18 @@ "headerOpengnsys": "Opengnsys", "loginlabelUsername": "Enter your username", "loginlabelPassword": "Enter your password", - "buttonLogin": "Log In", + "buttonLogin": "Login", "labelUsers": "Users", "labelRoles": "Roles", "dialogTitleAddRole": "Add Role (TBD)", "labelRoleName": "Name", "sectionTitlePermissions": "Permissions:", - "checkboxManageUsers": "Manage users", + "checkboxManageUsers": "Manage Users", "checkboxPXEConfig": "PXE Configuration", "checkboxConsoleImages": "Web Console Images", - "checkboxManageComponents": "Manage various components", - "checkboxCreateImages": "Create images", - "checkboxServerConfigScript": "Server configuration script", + "checkboxManageComponents": "Manage Different Components", + "checkboxCreateImages": "Create Images", + "checkboxServerConfigScript": "Server Configuration Script", "checkboxOther": "...", "buttonCancel": "Cancel", "buttonAdd": "Add", @@ -190,8 +204,8 @@ "labelCurrentPassword": "Current Password", "labelNewPassword": "New Password", "labelRepeatPassword": "Repeat Password", - "errorPasswordMismatch": "Passwords do not match", - "errorUpdate": "{$INTERPOLATION}", + "errorPasswordMismatch": " Passwords do not match ", + "errorUpdate": " {$INTERPOLATION} ", "buttonEdit": "Edit", "dialogTitleDeleteUser": "Delete User", "dialogContentDeleteUser": "Are you sure you want to delete {$INTERPOLATION}?", diff --git a/ogWebconsole/src/locale/messages.es.json b/ogWebconsole/src/locale/messages.es.json index 5665acb..f6c6d0c 100644 --- a/ogWebconsole/src/locale/messages.es.json +++ b/ogWebconsole/src/locale/messages.es.json @@ -1,6 +1,13 @@ { "locale": "es", "translations": { + "actions-modal-title": "Acciones", + "power-on-button": "Encender", + "power-off-button": "Apagar", + "reset-button": "Resetear", + "other-actions-1": "Otras acciones 1", + "other-actions-2": "Otras acciones 2", + "other-actions-3": "Otras acciones 3", "digital-board": "Pizarra digital", "projector-alt": "Proyector", "client-image-alt": "Client", @@ -8,12 +15,6 @@ "client-properties-title": "Propiedades cliente", "property-header": "Propiedad", "value-header": "Valor", - "power-on-button": "Encender", - "power-off-button": "Apagar", - "reset-button": "Resetear", - "other-actions-1": "Otras acciones 1", - "other-actions-2": "Otras acciones 2", - "other-actions-3": "Otras acciones 3", "close-button": "Cerrar", "add-client-dialog-title": "Añadir Cliente", "organizational-unit-label": "Padre", @@ -70,6 +71,7 @@ "addClientTooltip": "devices", "deleteElementTooltip": "delete", "deleteElementMenu": "Borrar elemento", + "7122753603772512402": "Búsqueda avanzada", "searchTitle": "Búsqueda", "selectFilterLabel": "Seleccione filtro", "selectOptionLabel": "Selecciona una opción", @@ -82,12 +84,24 @@ "classroomsGroupOption": "Grupos de aulas", "classroomOption": "Aulas", "clientGroupOption": "Grupos de clientes", - "selectAnotherOptionLabel": "Selecciona otra opción", + "floorLabel": "Planta", "noneOption": "Ninguno", - "option1": "Opción 1", - "option2": "Opción 2", - "option3": "Opción 3", + "option1": "Planta 1", + "option2": "Planta 2", + "option3": "Planta 3", + "selectAnotherOptionLabel": "Sistema Operativo", + "selectStateLabel": "Estado", + "offOption": "off", + "initializingOption": "initializing", + "ogliveOption": "oglive", + "busyOption": "busy", + "linuxOption": "linux", + "linuxSessionOption": "linux_session", + "macosOption": "macos", + "windowsOption": "windows", + "windowsSessionOption": "windows_session", "saveFiltersButton": "Guardar Filtros", + "sendFiltersButton": "Enviar Acción", "internalUnits": "Unidades internas: {$INTERPOLATION}", "clients": "Clientes: {$INTERPOLATION}", "noResultsMessage": "No hay resultados para mostrar.", From bf3fe8b1ae342f4f53644c732871c5f927ff4a0d Mon Sep 17 00:00:00 2001 From: apuente Date: Mon, 12 Aug 2024 14:14:45 +0200 Subject: [PATCH 13/13] Code clean --- .../components/groups/groups.component.html | 87 ++++--------------- .../app/components/groups/groups.component.ts | 47 ++++++---- 2 files changed, 47 insertions(+), 87 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 7cad814..bccfb25 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -179,6 +179,9 @@ Nombre + + + @@ -216,73 +219,7 @@ Windows 10 Education 1803 64 bits Ubuntu 18.04.1 LTS 64 bits Ubuntu 16.04.4 LTS 64 bits - DATA - Windows Boot loader - Windows 7 Professional - OpenGnsys Live - Ubuntu 18.04 LTS 64 bits - Windows 10 Education 1709 64 bits - Windows 7 Enterprise 64 bits - Windows 10 Education 1607 64 bits - Ubuntu 16.04.5 LTS 64 bits - Ubuntu 16.04.2 LTS 64 bits - Windows 10 Education 64 bits - CentOS release 6.3 (Final) 64 bits - Ubuntu 16.04.1 LTS 64 bits - Windows 10 Enterprise 1803 64 bits - Ubuntu 16.04.3 LTS 64 bits - Ubuntu precise (12.04.4 LTS) - GRUB2 Loader - Mac OS X 10.9.5 64 bits - Mac OS X 10.8.3 recovery - Mac OS X 10.13.6 - Windows 10 Education 1703 64 bits - Windows 7 Professional 64 bits - Ubuntu 14.04.4 LTS 64 bits - Windows 10 Education 1511 64 bits - Ubuntu 18.04.2 LTS 64 bits - Windows 10 Education 1809 64 bits - Ubuntu 16.04.6 LTS 64 bits - Ubuntu 14.04.5 LTS 64 bits - Windows 10 Education 1903 64 bits - Windows 10 Enterprise 1903 64 bits - Windows 10 Pro 1903 64 bits - Ubuntu 18.04.3 LTS 64 bits - Windows 10 Education 1909 64 bits - Ubuntu 18.04.3 LTS - Windows 10 Enterprise 1909 64 bits - Ubuntu 18.04.4 LTS 64 bits - Windows Boot loader 64 bits - Windows 10 Education 2004 64 bits - Ubuntu 20.04 LTS 64 bits - Ubuntu 20.04.1 LTS 64 bits - Windows 10 Enterprise LTSC 2019 Evaluation 1809 64 bits - Ubuntu 18.04.5 LTS 64 bits - Windows 10 Education 2009 64 bits - Ubuntu 20.04.2 LTS 64 bits - GRUB2 Loader 64 bits - Windows 10 Education 2009 - Debian GNU/Linux 8 (jessie) 64 bits - Windows 10 Enterprise 2009 64 bits - Windows 10 Pro 2009 64 bits - Windows 10 Pro 1909 64 bits - Windows 10 Home 2009 64 bits - Ubuntu 20.04.3 LTS 64 bits - Ubuntu 20.04.4 LTS 64 bits - Microsoft Windows XP - Ubuntu 22.04 LTS 64 bits - Ubuntu 22.04.1 LTS 64 bits - EducaAndOS 20.04 64 bits - Ubuntu 20.04.5 LTS 64 bits - Windows 10 Pro N 2009 64 bits - Guadalinex Edu 20.04 64 bits - Ubuntu 18.04.6 LTS 64 bits - elementary OS 6 Odin 64 bits - Ubuntu 22.04.2 LTS 64 bits - Ubuntu 22.04.3 LTS 64 bits - Windows 10 Pro for Workstations 2009 64 bits - Ubuntu 23.10 64 bits - Ubuntu 22.04.4 LTS 64 bits + RESTO DE OPCIONES TBI @@ -313,7 +250,7 @@ - +
@@ -322,13 +259,19 @@ - - + + {{ result.name }}

{{ result.type }}

-

Unidades internas: {{ result.type !== 'client' ? result.children.length : 0}}

-

Clientes: {{ result.type !== 'client' ? result.clients.length : 0}}

+

+ Unidades internas: {{ result.type !== 'client' ? result.children.length : 0 }} +

+

+ Clientes: {{ result.type !== 'client' ? result.clients.length : 0 }} +

diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index a47fde3..da86861 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -13,10 +13,8 @@ import {ToastrService} from "ngx-toastr"; import {TreeViewComponent} from "./tree-view/tree-view.component"; import {MatBottomSheet} from "@angular/material/bottom-sheet"; import {LegendComponent} from "./legend/legend.component"; -import { ClassroomViewComponent } from './classroom-view/classroom-view.component'; import { ClassroomViewDialogComponent } from './classroom-view/classroom-view-modal'; import {HttpClient} from "@angular/common/http"; -import {Observable} from "rxjs"; import {PageEvent} from "@angular/material/paginator"; import { SaveFiltersDialogComponent } from './save-filters-dialog/save-filters-dialog.component'; import { AcctionsModalComponent } from './acctions-modal/acctions-modal.component'; @@ -29,11 +27,11 @@ import { AcctionsModalComponent } from './acctions-modal/acctions-modal.componen export class GroupsComponent implements OnInit { organizationalUnits: UnidadOrganizativa[] = []; selectedUnidad: UnidadOrganizativa | null = null; - selectedDetail: any | null = null; // Nueva variable para el detalle del elemento seleccionado + selectedDetail: any | null = null; children: any[] = []; breadcrumb: string[] = []; - clientsData: any[] = []; // Nueva variable para almacenar los datos de clients - breadcrumbData: any[] = []; // Almacenar datos de breadcrumb para navegar + clientsData: any[] = []; + breadcrumbData: any[] = []; loading:boolean = false; loadingChildren:boolean = false; searchTerm: string = ''; @@ -53,6 +51,8 @@ export class GroupsComponent implements OnInit { page: number = 1; pageSizeOptions: number[] = [5, 10, 25, 100]; selectedElements: string[] = []; + isAllSelected: boolean = false; + constructor( private dataService: DataService, @@ -83,11 +83,11 @@ export class GroupsComponent implements OnInit { this.dataService.getOrganizationalUnits(this.searchTerm).subscribe( data => { this.organizationalUnits = data; - this.loading = false; // Desactivar el spinner después de obtener los datos + this.loading = false; }, error => { console.error('Error fetching unidades organizativas', error); - this.loading = false; // Desactivar el spinner en caso de error + this.loading = false; } ); } @@ -95,14 +95,14 @@ export class GroupsComponent implements OnInit { onSelectUnidad(unidad: UnidadOrganizativa): void { this.selectedUnidad = unidad; - this.selectedDetail = unidad; // Mostrar detalles de la unidad seleccionada + this.selectedDetail = unidad; this.breadcrumb = [unidad.name]; this.breadcrumbData = [unidad]; this.loadChildrenAndClients(unidad.id); } onSelectChild(child: any): void { - this.selectedDetail = child; // Mostrar detalles del niño seleccionado + this.selectedDetail = child; if (child.type !== 'client' && child.uuid && child.id) { this.breadcrumb.push(child.name || child.name); this.breadcrumbData.push(child); @@ -128,27 +128,27 @@ export class GroupsComponent implements OnInit { console.log('Children data:', childrenData); this.dataService.getClients(id).subscribe( clientsData => { - this.clientsData = clientsData; // Almacenar clientsData para pasarlo al componente hijo + this.clientsData = clientsData; const newChildren = [...childrenData, ...clientsData]; if (newChildren.length > 0) { this.children = newChildren; } else { - this.children = []; // Limpiar card2 cuando no hay elementos + this.children = []; } this.loadingChildren = false }, error => { console.error('Error fetching clients', error); - this.clientsData = []; // Limpiar clientsData en caso de error - this.children = []; // Limpiar card2 en caso de error + this.clientsData = []; + this.children = []; this.loadingChildren = false } ); }, error => { console.error('Error fetching children', error); - this.children = []; // Limpiar card2 en caso de error + this.children = []; this.loadingChildren = false } ); @@ -173,7 +173,6 @@ export class GroupsComponent implements OnInit { const dialogRef = this.dialog.open(CreateClientComponent, { data: { organizationalUnit }, width: '700px'}); - // Subscribirse al evento unitAdded del componente de creación después de cerrar el diálogo dialogRef.afterClosed().subscribe(() => { this.dataService.getOrganizationalUnits().subscribe( data => { @@ -380,6 +379,7 @@ export class GroupsComponent implements OnInit { } + onCheckboxChange(event: any, name: string) { if (event.checked) { this.selectedElements.push(name); @@ -389,9 +389,26 @@ export class GroupsComponent implements OnInit { this.selectedElements.splice(index, 1); } } + + this.isAllSelected = this.selectedElements.length === this.filteredResults.length; console.log(this.selectedElements); } + toggleSelectAll() { + this.isAllSelected = !this.isAllSelected; + + if (this.isAllSelected) { + this.selectedElements = this.filteredResults.map(result => result.name); + } else { + this.selectedElements = []; + } + console.log(this.selectedElements); + } + + isSelected(name: string): boolean { + return this.selectedElements.includes(name); + } + sendActions() { const dialogRef = this.dialog.open(AcctionsModalComponent, { data: { selectedElements: this.selectedElements }, width: '700px'});