refs #1702. Updated ogLive sync. Deleted wrong or uninstalled oglives

pull/18/head
Manuel Aranda Rosales 2025-03-13 14:44:11 +01:00
parent e230b3b41d
commit 083b46a94d
7 changed files with 62 additions and 27 deletions

View File

@ -49,3 +49,23 @@ table {
justify-content: end; justify-content: end;
margin-bottom: 30px; margin-bottom: 30px;
} }
.status-active {
background-color: #46c446 !important;
color: white !important;
}
.status-inactive {
background-color: #e87979 !important;
color: white !important;
}
.status-installing {
background-color: #f5a623 !important;
color: white !important;
}
.status-failed {
background-color: #9e9e9e !important;
color: white !important;
}

View File

@ -1,3 +1,5 @@
<app-loading [isLoading]="loading"></app-loading>
<div class="header-container"> <div class="header-container">
<button mat-icon-button color="primary" (click)="iniciarTour()"> <button mat-icon-button color="primary" (click)="iniciarTour()">
<mat-icon>help</mat-icon> <mat-icon>help</mat-icon>
@ -10,8 +12,8 @@
<div class="images-button-row"> <div class="images-button-row">
<button class="action-button" (click)="openSubnetInfoDialog()">{{ 'viewInfoButton' | translate }}</button> <button class="action-button" (click)="openSubnetInfoDialog()">{{ 'viewInfoButton' | translate }}</button>
<button class="action-button" (click)="addImage()" joyrideStep="addImageStep" <button class="action-button" (click)="addImage()" joyrideStep="addImageStep"
[text]="'addImageButtonDescription' | translate"> [text]="'addOgLiveButtonDescription' | translate">
{{ 'addImageButton' | translate }} {{ 'addOgLiveButton' | translate }}
</button> </button>
</div> </div>
</div> </div>
@ -39,12 +41,13 @@
<mat-form-field appearance="fill" class="search-boolean" joyrideStep="searchInstalledStep" <mat-form-field appearance="fill" class="search-boolean" joyrideStep="searchInstalledStep"
[text]="'searchInstalledDescription' | translate"> [text]="'searchInstalledDescription' | translate">
<mat-label>{{ 'searchInstalledLabel' | translate }}</mat-label> <mat-label>{{ 'status' | translate }}</mat-label>
<mat-select [(ngModel)]="filters['installed']" (selectionChange)="search()" <mat-select [(ngModel)]="filters['status']" (selectionChange)="search()"
[placeholder]="'selectOptionPlaceholder' | translate"> [placeholder]="'selectOptionPlaceholder' | translate">
<mat-option [value]="''">{{ 'allOption' | translate }}</mat-option> <mat-option [value]="'inactive'">{{ 'inactiveOption' | translate }}</mat-option>
<mat-option [value]="true">{{ 'yesOption' | translate }}</mat-option> <mat-option [value]="'active'">{{ 'activeOption' | translate }}</mat-option>
<mat-option [value]="false">{{ 'noOption' | translate }}</mat-option> <mat-option [value]="'failed'">{{ 'failedOption' | translate }}</mat-option>
<mat-option [value]="'pending'">{{ 'pendingOption' | translate }}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</div> </div>
@ -55,7 +58,7 @@
<ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef"> <ng-container *ngFor="let column of columns" [matColumnDef]="column.columnDef">
<th mat-header-cell *matHeaderCellDef>{{ column.header }}</th> <th mat-header-cell *matHeaderCellDef>{{ column.header }}</th>
<td mat-cell *matCellDef="let image"> <td mat-cell *matCellDef="let image">
<ng-container *ngIf="column.columnDef === 'isDefault' || column.columnDef === 'installed'"> <ng-container *ngIf="column.columnDef === 'isDefault'">
<mat-icon [color]="image[column.columnDef] ? 'primary' : 'warn'"> <mat-icon [color]="image[column.columnDef] ? 'primary' : 'warn'">
<ng-container *ngIf="image[column.columnDef]; else cancelIcon"> <ng-container *ngIf="image[column.columnDef]; else cancelIcon">
{{ 'checkCircle' | translate }} {{ 'checkCircle' | translate }}
@ -79,13 +82,13 @@
</ng-container> </ng-container>
<ng-container *ngIf="column.columnDef === 'status'"> <ng-container *ngIf="column.columnDef === 'status'">
<mat-chip> <mat-chip [ngClass]="getStatusLabel(image.status).class">
{{ column.cell(image) }} {{ getStatusLabel(image.status).label }}
</mat-chip> </mat-chip>
</ng-container> </ng-container>
<ng-container <ng-container
*ngIf="column.columnDef !== 'isDefault' && column.columnDef !== 'installed' && column.columnDef !== 'downloadUrl' && column.columnDef !== 'status' && column.columnDef !== 'name'"> *ngIf="column.columnDef !== 'isDefault' && column.columnDef !== 'downloadUrl' && column.columnDef !== 'status' && column.columnDef !== 'name'">
{{ column.cell(image) }} {{ column.cell(image) }}
</ng-container> </ng-container>
</td> </td>
@ -108,12 +111,12 @@
<mat-icon>menu</mat-icon> <mat-icon>menu</mat-icon>
</button> </button>
<mat-menu #menu="matMenu"> <mat-menu #menu="matMenu">
<button mat-menu-item [disabled]="image.installed" (click)="toggleAction(image, 'install')">{{ 'installOption' | <button mat-menu-item [disabled]="image.status !== 'inactive'" (click)="toggleAction(image, 'install')">{{ 'installOption' |
translate }}</button> translate }}</button>
<button mat-menu-item [disabled]="!image.installed" (click)="toggleAction(image, 'uninstall')"> <button mat-menu-item [disabled]="image.status !== 'active'" (click)="toggleAction(image, 'uninstall')">
{{ 'uninstallOption' | translate }} {{ 'uninstallOption' | translate }}
</button> </button>
<button mat-menu-item [disabled]="!image.installed" (click)="toggleAction(image, 'set-default')"> <button mat-menu-item [disabled]="image.status !== 'active'" (click)="toggleAction(image, 'set-default')">
{{ 'setDefaultOption' | translate }} {{ 'setDefaultOption' | translate }}
</button> </button>
</mat-menu> </mat-menu>

View File

@ -50,11 +50,6 @@ export class PXEimagesComponent implements OnInit {
header: 'Imagen por defecto', header: 'Imagen por defecto',
cell: (user: any) => `${user.isDefault}` cell: (user: any) => `${user.isDefault}`
}, },
{
columnDef: 'installed',
header: 'Imagen instalada',
cell: (user: any) => `${user.installed}`
},
{ {
columnDef: 'status', columnDef: 'status',
header: 'Estado', header: 'Estado',
@ -110,13 +105,18 @@ export class PXEimagesComponent implements OnInit {
); );
} }
showInfo(image: any): void { getStatusLabel(status: string): { label: string; class: string } {
const dialogRef = this.dialog.open(InfoImageComponent, { const statusMap: { [key: string]: { label: string; class: string } } = {
width: '700px', active: { label: 'Instalada', class: 'status-active' },
data: image inactive: { label: 'Sin instalar', class: 'status-inactive' },
}); installing: { label: 'Instalando...', class: 'status-installing' },
failed: { label: 'Fallido', class: 'status-failed' }
};
return statusMap[status] || { label: 'Desconocido', class: 'status-default' };
} }
toggleAction(image: any, action: string): void { toggleAction(image: any, action: string): void {
switch (action) { switch (action) {
case 'set-default': case 'set-default':

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -374,6 +374,10 @@
"selectOptionPlaceholder": "Select an option", "selectOptionPlaceholder": "Select an option",
"yesOption": "Yes", "yesOption": "Yes",
"noOption": "No", "noOption": "No",
"inactiveOption": "Uninstalled",
"activeOption": "Installed",
"pendingOption": "Pending",
"failedOption": "Failed",
"actionsColumn": "Actions", "actionsColumn": "Actions",
"createServerButton": "Create Server", "createServerButton": "Create Server",
"labelName": "Name", "labelName": "Name",
@ -381,6 +385,8 @@
"servicesStatusDescription": "Here is the status of the server services.", "servicesStatusDescription": "Here is the status of the server services.",
"oglivesDescription": "Here are the OgLives installed on the server.", "oglivesDescription": "Here are the OgLives installed on the server.",
"addImageButtonDescription": "Click to add a new image.", "addImageButtonDescription": "Click to add a new image.",
"addOgLiveButtonDescription": "Click to add a new OgLive.",
"addOgLiveButton": "Add OgLive",
"adminPxeDescription": "From here you can manage the PXE templates of the server.", "adminPxeDescription": "From here you can manage the PXE templates of the server.",
"addTemplateButtonDescription": "Add PXE Template", "addTemplateButtonDescription": "Add PXE Template",
"addTemplateButton": "Add Template", "addTemplateButton": "Add Template",

View File

@ -374,6 +374,12 @@
"selectOptionPlaceholder": "Selecciona una opción", "selectOptionPlaceholder": "Selecciona una opción",
"yesOption": "Sí", "yesOption": "Sí",
"noOption": "No", "noOption": "No",
"inactiveOption": "No instalada",
"activeOption": "Instalada",
"pendingOption": "Instalando",
"failedOption": "Fallida",
"addOgLiveButtonDescription": "Haz clic para añadir un nuevo OgLive.",
"addOgLiveButton": "Añadir OgLive",
"menuLabel": "Menu", "menuLabel": "Menu",
"actionsColumn": "Acciones", "actionsColumn": "Acciones",
"createServerButton": "Crear servidor", "createServerButton": "Crear servidor",