From 12111c3382d44d6021df099b233433fb5bbc9800 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Mon, 4 May 2026 17:01:09 +0200 Subject: [PATCH] Updated rempte Pc sync --- .../components/groups/groups.component.css | 20 +++++++++++++ .../components/groups/groups.component.html | 4 +++ .../classroom-view.component.css | 24 +++++++++++++++ .../classroom-view.component.html | 11 +++++++ .../classroom-view.component.ts | 29 +++++++++++++++++++ 5 files changed, 88 insertions(+) diff --git a/ogWebconsole/src/app/components/groups/groups.component.css b/ogWebconsole/src/app/components/groups/groups.component.css index 2763305..53f3fdb 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.css +++ b/ogWebconsole/src/app/components/groups/groups.component.css @@ -905,6 +905,26 @@ mat-tree mat-tree-node.disabled:hover { word-break: break-all; } +.remote-pc-badge { + display: inline-flex; + align-items: center; + gap: 2px; + background-color: #1976d2; + color: white; + padding: 2px 6px; + border-radius: 10px; + font-size: 10px; + font-weight: bold; + margin-top: 3px; +} + +.remote-pc-icon { + font-size: 12px; + height: 12px; + width: 12px; + line-height: 12px; +} + .clients-list { display: flex; flex-direction: column; diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index a652660..b52e653 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -399,6 +399,10 @@ {{ client.name }} {{ client.ip }} {{ client.mac }} + + computer + RemotePC +
{{ client.name }} {{ client.ip }} {{ client.mac }} + + computer + RemotePC +
@@ -23,5 +27,12 @@ + + + + diff --git a/ogWebconsole/src/app/components/groups/shared/classroom-view/classroom-view.component.ts b/ogWebconsole/src/app/components/groups/shared/classroom-view/classroom-view.component.ts index eb434cb..8baf142 100644 --- a/ogWebconsole/src/app/components/groups/shared/classroom-view/classroom-view.component.ts +++ b/ogWebconsole/src/app/components/groups/shared/classroom-view/classroom-view.component.ts @@ -24,6 +24,7 @@ export class ClassroomViewComponent implements OnInit, OnChanges { @Input() clients: any[] = []; @Input() pcInTable: number = 5; groupedClients: GroupedClients[] = []; + syncingUds = false; constructor(public dialog: MatDialog, private http: HttpClient, private toastService: ToastrService, private configService: ConfigService) { this.baseUrl = this.configService.apiUrl; @@ -110,4 +111,32 @@ export class ClassroomViewComponent implements OnInit, OnChanges { } else this.toastService.success(this.translate.instant('updatedClient'), 'Éxito'); } + + get calendarUuid(): string | null { + const client = this.clients.find(c => c.organizationalUnit?.remoteCalendar?.uuid); + return client?.organizationalUnit?.remoteCalendar?.uuid || null; + } + + syncUds(): void { + const uuid = this.calendarUuid; + if (!uuid) { + this.toastService.warning('Este aula no tiene un calendario remoto asociado'); + return; + } + this.syncingUds = true; + this.http.post(`${this.baseUrl}/remote-calendars/${uuid}/sync-uds`, {}).subscribe({ + next: () => { + this.toastService.success(this.translate.instant('calendarsSynchronizedCorrectly')); + this.syncingUds = false; + }, + error: (error: any) => { + this.toastService.error(error.error?.['hydra:description'] || 'Error al sincronizar con UDS'); + this.syncingUds = false; + } + }); + } + + isRemotePcActive(client: any): boolean { + return !!client.isRemotePcActive; + } } -- 2.40.1