diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css index a397531..664c4d0 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/client-main-view.component.css @@ -80,6 +80,11 @@ .client-info { margin: 20px 0; + border-radius: 12px; + background-color: #f5f7fa; + padding: 20px; + border: 2px solid #d1d9e6; + box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); } .info-section { 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 6086a3d..a967fef 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 @@ -72,7 +72,7 @@ Seleccione imagen -
{{ image.image?.name }} v{{ image.version?? 0 }}
+
{{ image.name }}
{{ image.description }}
@@ -81,7 +81,7 @@ Seleccione método de deploy - {{ method }} + {{ method.name }} 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 b97dcc2..9f1620f 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 @@ -51,12 +51,11 @@ export class DeployImageComponent { selectedRepository: any = null; allMethods = [ - 'uftp', - 'udpcast', - 'udpcast-direct', - 'unicast', - 'unicast-direct', - 'p2p' + { name: 'Multicast', value: 'udpcast' }, + { name: 'Unicast', value: 'unicast' }, + { name: 'Multicast (direct)', value: 'udpcast-direct' }, + { name: 'Unicast (direct)', value: 'unicast-direct' }, + { name: 'Torrent', value: 'p2p' }, ]; dataSource = new MatTableDataSource(); diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts index e06c354..a6416f8 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/partition-assistant/partition-assistant.component.ts @@ -77,7 +77,10 @@ export class PartitionAssistantComponent { this.selectedModelClient = this.clientData.find( (client: { status: string }) => client.status === 'og-live' ) || null; - this.loadPartitions(this.selectedModelClient); + + if (this.selectedModelClient) { + this.loadPartitions(this.selectedModelClient); + } } get selectedDisk():any { @@ -222,6 +225,7 @@ export class PartitionAssistantComponent { if (disk) { const remainingGB = this.getRemainingGB(disk.partitions, disk.totalDiskSize); + if (remainingGB > 0) { const removedPartitions = disk.partitions.filter((p) => !p.removed); const maxPartitionNumber = @@ -244,7 +248,7 @@ export class PartitionAssistantComponent { this.updatePartitionPercentages(disk.partitions, disk.totalDiskSize); this.updateDiskChart(disk); } else { - this.errorMessage = 'No hay suficiente espacio libre en el disco para crear una nueva partición.'; + this.toastService.error('No hay suficiente espacio libre en el disco para crear una nueva partición.'); } } } diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css index 6e6e22b..1f6be0a 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.css @@ -257,4 +257,8 @@ table { cursor: pointer; } +.full-width { + width: 100%; +} + diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html index 6588b61..e41eea9 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.html @@ -86,12 +86,15 @@
-
+

Ingrese los valores de los parámetros detectados:

-
+
- Parámetro {{ i + 1 }} - + {{ paramName }} +
diff --git a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts index e671823..83bb0d0 100644 --- a/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts +++ b/ogWebconsole/src/app/components/groups/components/client-main-view/run-script-assistant/run-script-assistant.component.ts @@ -24,13 +24,14 @@ export class RunScriptAssistantComponent { loading: boolean = false; scripts: any[] = []; scriptContent: string = ""; - parameters: string[] = []; + parameters: any = {}; selectedScript: any = null; selectedClients: any[] = []; allSelected: boolean = true; commandType: string = 'existing'; newScript: string = ''; selection = new SelectionModel(true, []); + parameterNames: string[] = Object.keys(this.parameters); constructor( private http: HttpClient, @@ -121,21 +122,39 @@ export class RunScriptAssistantComponent { if (this.selectedScript) { this.scriptContent = this.selectedScript.script; - const matches = this.scriptContent.match(/@\d+/g) || []; - this.parameters = new Array(matches.length).fill(""); + const matches = this.scriptContent.match(/@(\w+)/g) || []; + const uniqueParams = Array.from(new Set(matches.map(m => m.slice(1)))); + + this.parameters = {}; + uniqueParams.forEach(param => this.parameters[param] = ''); + + this.parameterNames = uniqueParams; + + this.updateScript(); } } - updateScript() { + onParamChange(name: string, value: string): void { + this.parameters[name] = value; + this.updateScript(); + } + + updateScript(): void { let updatedScript = this.selectedScript.script; - this.parameters.forEach((value, index) => { - updatedScript = updatedScript.replace(new RegExp(`@${index + 1}`, "g"), value || `@${index + 1}`); - }); + for (const [key, value] of Object.entries(this.parameters)) { + const regex = new RegExp(`@${key}\\b`, 'g'); + updatedScript = updatedScript.replace(regex, value || `@${key}`); + } this.scriptContent = updatedScript; } + trackByIndex(index: number): number { + return index; + } + + save(): void { this.loading = true;