diff --git a/ogWebconsole/src/app/app.module.ts b/ogWebconsole/src/app/app.module.ts
index 7f5df2f..db56824 100644
--- a/ogWebconsole/src/app/app.module.ts
+++ b/ogWebconsole/src/app/app.module.ts
@@ -172,6 +172,7 @@ import { HardwareProfileComponent } from './components/hardware-profile/hardware
import { HardwareCollectionModalComponent } from './components/hardware-profile/hardware-collection-modal/hardware-collection-modal.component';
import { HardwareTypeComponent } from './components/hardware-type/hardware-type.component';
import { ShowDetailsComponent } from './components/hardware-type/show-details/show-details.component';
+import { DiskPartitionSelectorComponent } from './components/groups/shared/disk-partition-selector/disk-partition-selector.component';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './locale/', '.json');
}
@@ -348,7 +349,7 @@ registerLocaleData(localeEs, 'es-ES');
progressAnimation: 'increasing',
closeButton: true
}
- ), MatGridList, MatTree, MatTreeNode, MatNestedTreeNode, MatTreeNodeToggle, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeOutlet, MatPaginator, MatGridTile, MatExpansionPanel, MatExpansionPanelTitle, MatExpansionPanelDescription, MatRadioGroup, MatRadioButton, MatAutocompleteTrigger, NgOptimizedImage
+ ), MatGridList, MatTree, MatTreeNode, MatNestedTreeNode, MatTreeNodeToggle, MatTreeNodeDef, MatTreeNodePadding, MatTreeNodeOutlet, MatPaginator, MatGridTile, MatExpansionPanel, MatExpansionPanelTitle, MatExpansionPanelDescription, MatRadioGroup, MatRadioButton, MatAutocompleteTrigger, NgOptimizedImage, DiskPartitionSelectorComponent
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA,
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.html
index e2e79a6..d28e1b6 100644
--- a/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.html
+++ b/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.html
@@ -224,39 +224,13 @@
-
-
- Seleccionar partición
-
-
-
-
-
-
-
-
-
- {{ column.header }}
-
-
- {{ column.cell(image) }}
-
-
-
-
- {{ image.size }} MB
- {{ image.size / 1024 }} GB
-
-
-
-
-
-
-
-
+
+
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.ts
index eb8cc5e..a9ce00f 100644
--- a/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.ts
+++ b/ogWebconsole/src/app/components/groups/components/client-main-view/create-image/create-image.component.ts
@@ -62,12 +62,11 @@ export class CreateClientImageComponent implements OnInit{
return this.gitData && this.gitData.repo && this.gitData.branch;
}
+ isPartitionDisabled = (row: any): boolean => {
+ return !row.operativeSystem;
+ };
+
columns = [
- {
- columnDef: 'diskNumber',
- header: 'Disco',
- cell: (partition: any) => partition.diskNumber
- },
{
columnDef: 'partitionNumber',
header: 'Particion',
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.css
index 1d6cb4e..6a2a8a6 100644
--- a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.css
+++ b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.css
@@ -590,6 +590,11 @@ table {
}
}
+.partition-table-container {
+ overflow-x: auto;
+ margin-top: 10px;
+}
+
.commits-table-container {
margin-top: 20px;
}
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.html
index 4dbb9f9..1b10903 100644
--- a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.html
+++ b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.html
@@ -16,9 +16,7 @@
- Ejecutar
+ Ejecutar
@@ -28,9 +26,7 @@
-
+
Opciones de programación
@@ -49,7 +45,8 @@
info
- Puedes marcar o desmarcar un cliente haciendo clic en el área del ordenador. Además, selecciona con "Modelo" el equipo que actuará como modelo.
+ Puedes marcar o desmarcar un cliente haciendo clic en el área del ordenador. Además, selecciona con "Modelo" el
+ equipo que actuará como modelo.
@@ -61,17 +58,11 @@
-
+
-
+
{{ client.name | slice:0:20 }}
@@ -82,9 +73,7 @@
-
+
Modelo
@@ -104,7 +93,7 @@
image
Configuración de imagen
-
+
Tipo de imagen
@@ -119,7 +108,8 @@
Seleccionar Repositorio
-
+
{{ repo }}
@@ -129,7 +119,8 @@
Seleccionar Rama
-
+
{{ branch }}
@@ -176,8 +167,8 @@
Tags
-
+
{{ tag }}
Sin tags
@@ -198,7 +189,7 @@
Seleccione imagen
-
+
{{ image.name }}
{{ image.description }}
@@ -212,13 +203,82 @@
+
+
+
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts
index 0396eae..dae7062 100644
--- a/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts
+++ b/ogWebconsole/src/app/components/groups/components/client-main-view/deploy-image/deploy-image.component.ts
@@ -57,6 +57,7 @@ export class DeployImageComponent implements OnInit{
selectedClients: any[] = [];
selectedModelClient: any = null;
filteredPartitions: any[] = [];
+
selectedRepository: any = null;
imageType: string = 'monolithic';
@@ -70,14 +71,9 @@ export class DeployImageComponent implements OnInit{
dataSource = new MatTableDataSource();
columns = [
- {
- columnDef: 'diskNumber',
- header: 'Disco',
- cell: (partition: any) => `${partition.diskNumber}`
- },
{
columnDef: 'partitionNumber',
- header: 'Particion',
+ header: 'Partición',
cell: (partition: any) => `${partition.partitionNumber}`
},
{
diff --git a/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.css b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.css
new file mode 100644
index 0000000..aa3c38d
--- /dev/null
+++ b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.css
@@ -0,0 +1,51 @@
+/* Formatting specific to grouped partition selector */
+.disk-container {
+ display: flex;
+ flex-direction: column;
+ gap: 32px;
+ padding-top: 16px;
+}
+
+.disk-card-wrapper {
+ margin-bottom: 20px;
+}
+
+.disk-mat-card {
+ border-radius: 8px;
+ overflow: hidden;
+ padding: 0;
+}
+
+.disk-card-header {
+ background-color: #f5f5f5;
+ padding: 16px 20px;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ border-bottom: 1px solid #e0e0e0;
+}
+
+.disk-card-title {
+ margin: 0;
+ font-size: 1.2rem;
+ color: #3f51b5;
+ font-weight: bold;
+}
+
+.disk-card-layout {
+ display: flex;
+ align-items: stretch;
+ background: white;
+ gap: 0;
+}
+
+.disk-table-container {
+ flex: 1;
+ overflow-x: auto;
+}
+
+.disk-table {
+ width: 100%;
+ box-shadow: none !important;
+ border: none !important;
+}
diff --git a/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.html b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.html
new file mode 100644
index 0000000..899e6c7
--- /dev/null
+++ b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.html
@@ -0,0 +1,53 @@
+
+ @for (disk of diskUsageData; track disk.diskNumber) {
+
+
+
+
+
+
+
+
+
+ Seleccionar
+
+
+
+
+
+
+
+ @for (column of columns; track column.columnDef) {
+
+ {{ column.header }}
+
+ @if (column.columnDef === 'size') {
+
+ {{ partition.size }} MB
+ {{ partition.size / 1024 | number:'1.0-2' }} GB
+
+ } @else {
+ {{ column.cell ? column.cell(partition) : partition[column.columnDef] }}
+ }
+
+
+ }
+
+
+
+
+
+
+
+
+
+ }
+
diff --git a/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.ts b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.ts
new file mode 100644
index 0000000..a3bb8ad
--- /dev/null
+++ b/ogWebconsole/src/app/components/groups/shared/disk-partition-selector/disk-partition-selector.component.ts
@@ -0,0 +1,58 @@
+import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { MatCardModule } from '@angular/material/card';
+import { MatTableModule } from '@angular/material/table';
+import { MatRadioModule } from '@angular/material/radio';
+import { FormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'app-disk-partition-selector',
+ standalone: true,
+ imports: [CommonModule, MatCardModule, MatTableModule, MatRadioModule, FormsModule],
+ templateUrl: './disk-partition-selector.component.html',
+ styleUrl: './disk-partition-selector.component.css'
+})
+export class DiskPartitionSelectorComponent implements OnChanges {
+ @Input() partitions: any[] = [];
+ @Input() columns: any[] = [];
+ @Input() displayedColumns: string[] = [];
+ @Input() selectedPartition: any;
+ @Input() disableCondition: (row: any) => boolean = () => false;
+
+ @Output() selectedPartitionChange = new EventEmitter();
+
+ diskUsageData: any[] = [];
+
+ ngOnChanges(changes: SimpleChanges): void {
+ if (changes['partitions']) {
+ this.calculateDiskUsage(this.partitions || []);
+ }
+ }
+
+ calculateDiskUsage(partitions: any[]) {
+ this.diskUsageData = [];
+ const grouped = partitions.reduce((acc: any, curr: any) => {
+ if (!acc[curr.diskNumber]) {
+ acc[curr.diskNumber] = [];
+ }
+ acc[curr.diskNumber].push(curr);
+ return acc;
+ }, {});
+
+ for (const diskNum in grouped) {
+ if (grouped.hasOwnProperty(diskNum)) {
+ this.diskUsageData.push({
+ diskNumber: diskNum,
+ partitions: grouped[diskNum]
+ });
+ }
+ }
+ }
+
+ onPartitionSelected(row: any) {
+ if (!this.disableCondition(row)) {
+ this.selectedPartition = row;
+ this.selectedPartitionChange.emit(this.selectedPartition);
+ }
+ }
+}