Merge pull request 'develop' (#80) from develop into main
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details
oggui-debian-package/pipeline/head This commit looks good Details

Reviewed-on: #80
pull/81/head^2
Manuel Aranda Rosales 2026-05-04 17:03:24 +02:00
commit 4adf55ba82
5 changed files with 88 additions and 0 deletions

View File

@ -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;

View File

@ -399,6 +399,10 @@
<span class="client-name truncate-cell-wide" [matTooltip]="client.name">{{ client.name }}</span>
<span class="client-ip">{{ client.ip }}</span>
<span class="client-mac">{{ client.mac }}</span>
<span *ngIf="client.isRemotePcActive" class="remote-pc-badge">
<mat-icon class="remote-pc-icon">computer</mat-icon>
RemotePC
</span>
<div class="action-icons">
<app-execute-command [clientState]="client.status" [clientData]="[client]"

View File

@ -135,3 +135,27 @@ mat-dialog-content {
.submit-button {
margin: 1rem;
}
.sync-uds-button {
margin-right: 8px;
}
.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;
}

View File

@ -15,6 +15,10 @@
<span><strong>{{ client.name }}</strong></span>
<span>{{ client.ip }}</span>
<span>{{ client.mac }}</span>
<span *ngIf="isRemotePcActive(client)" class="remote-pc-badge">
<mat-icon class="remote-pc-icon">computer</mat-icon>
RemotePC
</span>
</div>
</mat-card>
</div>
@ -23,5 +27,12 @@
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<ng-container *ngIf="calendarUuid">
<button *ngIf="!syncingUds" mat-raised-button color="primary" (click)="syncUds()" class="sync-uds-button">
<mat-icon>sync</mat-icon>
Sincronizar con UDS
</button>
<app-loading *ngIf="syncingUds" [isLoading]="syncingUds"></app-loading>
</ng-container>
<button class="submit-button" (click)="saveDisposition()">{{ 'saveDispositionButton' | translate }}</button>
</mat-dialog-actions>

View File

@ -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;
}
}