diff --git a/ogWebconsole/src/app/components/global-status/ogboot-status/ogboot-status.component.html b/ogWebconsole/src/app/components/global-status/ogboot-status/ogboot-status.component.html
index ad0c987..b44e5f0 100644
--- a/ogWebconsole/src/app/components/global-status/ogboot-status/ogboot-status.component.html
+++ b/ogWebconsole/src/app/components/global-status/ogboot-status/ogboot-status.component.html
@@ -45,8 +45,8 @@
diff --git a/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.html b/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.html
index 099bf15..d344c9b 100644
--- a/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.html
+++ b/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.html
@@ -45,8 +45,8 @@
diff --git a/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.ts b/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.ts
index c15f1a5..9ab253f 100644
--- a/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.ts
+++ b/ogWebconsole/src/app/components/global-status/ogdhcp-status/ogdhcp-status.component.ts
@@ -104,6 +104,11 @@ export class OgdhcpStatusComponent implements OnInit {
}
}
+ getSelectedDhcpIp(): string {
+ const d = this.dhcps.find(d => d.uuid === this.selectedDhcpUuid);
+ return d ? d.ip : '';
+ }
+
getSelectedDhcpName(): string {
const selectedDhcp = this.dhcps.find(dhcp => dhcp.uuid === this.selectedDhcpUuid);
return selectedDhcp ? selectedDhcp.name : '';
diff --git a/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.html b/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.html
index cb4f294..a0fae1e 100644
--- a/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.html
+++ b/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.html
@@ -52,8 +52,8 @@
diff --git a/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.ts b/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.ts
index 32b9bfb..6f06dce 100644
--- a/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.ts
+++ b/ogWebconsole/src/app/components/global-status/ogrepository-status/ogrepository-status.component.ts
@@ -103,6 +103,11 @@ export class OgrepositoryStatusComponent implements OnInit {
}
}
+ getSelectedRepositoryIp(): string {
+ const r = this.repositories.find(r => r.uuid === this.selectedRepositoryUuid);
+ return r ? r.ip : '';
+ }
+
getSelectedRepositoryName(): string {
const selectedRepo = this.repositories.find(repo => repo.uuid === this.selectedRepositoryUuid);
return selectedRepo ? selectedRepo.name : '';
diff --git a/ogWebconsole/src/app/components/global-status/status-logs/status-logs.component.ts b/ogWebconsole/src/app/components/global-status/status-logs/status-logs.component.ts
index cdb5d9a..9053dd4 100644
--- a/ogWebconsole/src/app/components/global-status/status-logs/status-logs.component.ts
+++ b/ogWebconsole/src/app/components/global-status/status-logs/status-logs.component.ts
@@ -5,6 +5,14 @@ import { ConfigService } from '@services/config.service';
import { TranslateService } from '@ngx-translate/core';
import { MatTabChangeEvent } from '@angular/material/tabs';
+interface JournalEntry {
+ MESSAGE: string;
+ SYSLOG_IDENTIFIER?: string;
+ _HOSTNAME?: string;
+ __REALTIME_TIMESTAMP?: string;
+ PRIORITY?: string;
+}
+
@Component({
selector: 'app-status-logs',
templateUrl: './status-logs.component.html',
@@ -12,7 +20,7 @@ import { MatTabChangeEvent } from '@angular/material/tabs';
})
export class StatusLogsComponent implements OnInit, OnDestroy, AfterViewChecked {
@ViewChild('logContent') private logContainer!: ElementRef;
- @Input() identifier: string = '';
+ @Input() identifiers: string[] = [];
@Input() host: string = '';
@Input() oglogUrl: SafeResourceUrl | null = null;
@Input() title: string = '';
@@ -53,12 +61,12 @@ export class StatusLogsComponent implements OnInit, OnDestroy, AfterViewChecked
}
onTabChange(event: MatTabChangeEvent): void {
- if (event.index === 0) { // Disk Logs tab
+ if (event.index === 0) {
if (this.isLive) {
this.loadDiskLogs();
this.startPolling();
}
- } else { // oglog Logs tab or others
+ } else {
this.stopPolling();
}
}
@@ -68,27 +76,39 @@ export class StatusLogsComponent implements OnInit, OnDestroy, AfterViewChecked
}
loadDiskLogs(): void {
- if (!this.identifier) return;
+ if (!this.identifiers.length) return;
if (!this.isLive) {
this.loadingDiskLogs = true;
}
-
- const url = `${this.configService.apiUrl}/opengnsys/system/disk-logs?SYSLOG_IDENTIFIER=${this.identifier}&host=${this.host}&lines=200`;
- this.http.get<{ content: string }>(url).subscribe({
+ const idParam = this.identifiers.join(',');
+ const hostParam = this.host ? `&host=${encodeURIComponent(this.host)}` : '';
+ const url = `${this.configService.apiUrl}/opengnsys/system/disk-logs?SYSLOG_IDENTIFIER=${encodeURIComponent(idParam)}${hostParam}&lines=200`;
+
+ this.http.get<{ entries: JournalEntry[] }>(url).subscribe({
next: (response) => {
- this.diskLogsContent = response.content || '';
+ this.diskLogsContent = this.formatEntries(response.entries || []);
this.loadingDiskLogs = false;
this.errorDiskLogs = null;
},
- error: (err) => {
+ error: () => {
this.errorDiskLogs = 'Error al cargar logs de disco';
this.loadingDiskLogs = false;
}
});
}
+ private formatEntries(entries: JournalEntry[]): string {
+ return entries.map(entry => {
+ const ts = entry.__REALTIME_TIMESTAMP
+ ? new Date(parseInt(entry.__REALTIME_TIMESTAMP, 10) / 1000).toISOString().replace('T', ' ').substring(0, 23)
+ : ' ';
+ const id = entry.SYSLOG_IDENTIFIER ?? '';
+ return `[${ts}] ${id}: ${entry.MESSAGE ?? ''}`;
+ }).join('\n');
+ }
+
private startPolling(): void {
this.stopPolling();
this.pollInterval = setInterval(() => {