Compare commits
4 Commits
016e5a821a
...
2631469b71
Author | SHA1 | Date |
---|---|---|
|
2631469b71 | |
|
0550c1b25d | |
|
a9afb951e2 | |
|
5bc5a9d23a |
|
@ -1,4 +1,5 @@
|
|||
<div class="header-container">
|
||||
<button mat-flat-button color="primary" (click)="back()">Volver</button>
|
||||
<h2 class="title" i18n="@@subnetsTitle">Crear Imagen desde {{ clientName }}</h2>
|
||||
<div class="subnets-button-row">
|
||||
<button mat-flat-button color="primary" (click)="save()">Guardar y ejecutar</button>
|
||||
|
|
|
@ -68,6 +68,7 @@ export class CreateImageComponent {
|
|||
selectedImage: string | null = null;
|
||||
selectedPartition: any = null;
|
||||
name: string = '';
|
||||
client: any = null;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
columns = [
|
||||
{
|
||||
|
@ -120,6 +121,7 @@ export class CreateImageComponent {
|
|||
this.http.get(url).subscribe(
|
||||
(response: any) => {
|
||||
if (response.partitions) {
|
||||
this.client = response;
|
||||
this.clientName = response.name;
|
||||
|
||||
this.dataSource.data = response.partitions.filter((partition: any) => {
|
||||
|
@ -145,6 +147,10 @@ export class CreateImageComponent {
|
|||
);
|
||||
}
|
||||
|
||||
back() {
|
||||
this.router.navigate(['clients', this.clientId], { state: { clientData: this.client} });
|
||||
}
|
||||
|
||||
save(): void {
|
||||
const payload = {
|
||||
client: `/clients/${this.clientId}`,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div class="header-container">
|
||||
<button mat-flat-button color="primary" (click)="back()">Volver</button>
|
||||
<h2 class="title" i18n="@@subnetsTitle">Desplegar imagen en {{ clientName }}</h2>
|
||||
<div class="subnets-button-row">
|
||||
<button mat-flat-button color="primary" (click)="save()">Guardar</button>
|
||||
|
|
|
@ -32,6 +32,7 @@ export class DeployImageComponent {
|
|||
p2pMode: string = '';
|
||||
p2pTime: Number = 0;
|
||||
name: string = '';
|
||||
client: any = null;
|
||||
|
||||
protected p2pModeOptions = [
|
||||
{ name: 'Leecher', value: 'p2p-mode-leecher' },
|
||||
|
@ -119,6 +120,7 @@ export class DeployImageComponent {
|
|||
this.http.get(url).subscribe(
|
||||
(response: any) => {
|
||||
if (response.partitions) {
|
||||
this.client = response;
|
||||
this.clientName = response.name;
|
||||
this.dataSource.data = response.partitions.filter((partition: any) => {
|
||||
return partition.partitionNumber !== 0;
|
||||
|
@ -149,6 +151,10 @@ export class DeployImageComponent {
|
|||
);
|
||||
}
|
||||
|
||||
back() {
|
||||
this.router.navigate(['clients', this.clientId], { state: { clientData: this.client} });
|
||||
}
|
||||
|
||||
save(): void {
|
||||
if (!this.selectedImage) {
|
||||
this.toastService.error('Debe seleccionar una imagen');
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<div class="header-container">
|
||||
<button mat-flat-button color="primary" (click)="back()">Volver</button>
|
||||
<h2 class="title" i18n="@@subnetsTitle">Asistente de particionado</h2>
|
||||
<div class="subnets-button-row">
|
||||
<button mat-flat-button color="primary" [disabled]="data.status === 'busy'" (click)="save()">Ejecutar</button>
|
||||
|
|
|
@ -250,6 +250,10 @@ export class PartitionAssistantComponent implements OnInit {
|
|||
return modifiedPartitions;
|
||||
}
|
||||
|
||||
back() {
|
||||
this.router.navigate(['clients', this.data.uuid], { state: { clientData: this.data } });
|
||||
}
|
||||
|
||||
save() {
|
||||
if (!this.selectedDisk) {
|
||||
this.errorMessage = 'Por favor selecciona un disco antes de guardar.';
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
</ng-container>
|
||||
<ng-container matColumnDef="oglive">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> OG Live </th>
|
||||
<td mat-cell *matCellDef="let client"> {{ (client.ogLive?.name || '').slice(0, 15) }}{{ (client.ogLive?.name?.length > 15) ? '...' : '' }} </td>
|
||||
<td mat-cell *matCellDef="let client"> {{ (client.ogLive?.filename || '').slice(0, 15) }}{{ (client.ogLive?.filename?.length > 15) ? '...' : '' }} </td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="status">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{ 'status' | translate }} </th>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<h1>{{ 'addClientTitle' | translate }}s</h1>
|
||||
<div class="inputs-container">
|
||||
<div class="mat-dialog-content" [ngClass]="{'loading': loading}">
|
||||
|
||||
|
||||
<form [formGroup]="clientForm" class="client-form grid-form" *ngIf="!loading">
|
||||
<mat-form-field class="form-field">
|
||||
<mat-label>{{ 'organizationalUnitLabel' | translate }}</mat-label>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<h3>Añadir un cliente</h3>
|
||||
<mat-spinner class="loading-spinner" *ngIf="loading"></mat-spinner>
|
||||
<form [formGroup]="clientForm" class="client-form grid-form" *ngIf="!loading">
|
||||
|
||||
|
||||
<mat-form-field class="form-field">
|
||||
<mat-label>{{ 'nameLabel' | translate }}</mat-label>
|
||||
<input matInput formControlName="name">
|
||||
|
@ -61,7 +61,7 @@
|
|||
<mat-label>{{ 'ogLiveLabel' | translate }}</mat-label>
|
||||
<mat-select formControlName="ogLive">
|
||||
<mat-option *ngFor="let oglive of ogLives" [value]="oglive['@id']">
|
||||
{{ oglive.name }}
|
||||
{{ oglive.filename }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<mat-label>{{ 'ogLiveLabel' | translate }}</mat-label>
|
||||
<mat-select formControlName="ogLive">
|
||||
<mat-option *ngFor="let ogLive of ogLives" [value]="ogLive['@id']">
|
||||
{{ ogLive.name }}
|
||||
{{ ogLive.filename }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<mat-label>{{ 'ogLiveLabel' | translate }}</mat-label>
|
||||
<mat-select formControlName="oglive" (selectionChange)="onOgLiveChange($event)">
|
||||
<mat-option *ngFor="let oglive of ogLives" [value]="oglive['@id']">
|
||||
{{ oglive.name }}
|
||||
{{ oglive.filename }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<mat-label>{{ 'ogLiveLabel' | translate }}</mat-label>
|
||||
<mat-select formControlName="ogLive" (selectionChange)="onOgLiveChange($event)">
|
||||
<mat-option *ngFor="let oglive of ogLives" [value]="oglive['@id']">
|
||||
{{ oglive.name }}
|
||||
{{ oglive.filename }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<h2 mat-dialog-title>{{ isEditMode ? 'Editar' : 'Añadir' }} imagen ogLive</h2>
|
||||
<mat-dialog-content>
|
||||
<mat-form-field appearance="fill" class="full-width">
|
||||
<mat-label>Nombre</mat-label>
|
||||
<input matInput [(ngModel)]="name">
|
||||
</mat-form-field>
|
||||
<mat-spinner class="spinner" *ngIf="loading"></mat-spinner>
|
||||
|
||||
<mat-form-field *ngIf="!loading" appearance="fill" class="full-width">
|
||||
|
|
|
@ -10,7 +10,6 @@ import { ToastrService } from 'ngx-toastr';
|
|||
})
|
||||
export class CreatePXEImageComponent implements OnInit {
|
||||
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
||||
name: string = '';
|
||||
downloads: any[] = [];
|
||||
selectedDownload: any;
|
||||
isEditMode: boolean = false;
|
||||
|
@ -28,7 +27,6 @@ export class CreatePXEImageComponent implements OnInit {
|
|||
this.fetchDownloads();
|
||||
if (this.data) {
|
||||
this.isEditMode = true;
|
||||
this.name = this.data.name;
|
||||
this.selectedDownload = this.data.downloadUrl;
|
||||
this.imageId = this.data.uuid; // Assuming UUID is used for edit
|
||||
}
|
||||
|
@ -55,7 +53,6 @@ export class CreatePXEImageComponent implements OnInit {
|
|||
|
||||
submitForm(): void {
|
||||
const payload = {
|
||||
name: this.name,
|
||||
downloadUrl: this.selectedDownload.url
|
||||
};
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<button mat-icon-button color="info" (click)="showOgLive($event, image)">
|
||||
<mat-icon>{{ 'viewIcon' | translate }}</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="primary" (click)="editImage(image)">
|
||||
<button mat-icon-button disabled color="primary" (click)="editImage(image)">
|
||||
<mat-icon>{{ 'editIcon' | translate }}</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="deleteImage(image)">
|
||||
|
|
|
@ -40,9 +40,9 @@ export class PXEimagesComponent implements OnInit {
|
|||
cell: (user: any) => `${user.id}`
|
||||
},
|
||||
{
|
||||
columnDef: 'name',
|
||||
header: 'Nombre de imagen',
|
||||
cell: (user: any) => `${user.name}`
|
||||
columnDef: 'filename',
|
||||
header: 'Og Live',
|
||||
cell: (user: any) => `${user.filename}`
|
||||
},
|
||||
{
|
||||
columnDef: 'isDefault',
|
||||
|
|
Loading…
Reference in New Issue