v0.1.19 - Lots of remote hosting fixes
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Blossom Admin</title>
|
||||
<title>Blossom Admin 2</title>
|
||||
<link rel="stylesheet" href="/api/index.css">
|
||||
</head>
|
||||
|
||||
@@ -100,6 +100,10 @@
|
||||
<td>Total Size</td>
|
||||
<td id="total-size">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Version</td>
|
||||
<td id="version">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Process ID</td>
|
||||
<td id="process-id">-</td>
|
||||
@@ -116,6 +120,14 @@
|
||||
<td>CPU Usage</td>
|
||||
<td id="cpu-usage">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Filesystem Blob Count</td>
|
||||
<td id="fs-blob-count">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Filesystem Blob Size</td>
|
||||
<td id="fs-blob-size">-</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Oldest Blob</td>
|
||||
<td id="oldest-event">-</td>
|
||||
|
||||
30
api/index.js
30
api/index.js
@@ -4143,12 +4143,32 @@ function populateStatsOverview(data) {
|
||||
if (!data) return;
|
||||
|
||||
// Update individual cells with flash animation for changed values
|
||||
// Backend sends: total_bytes, total_blobs, first_upload, last_upload
|
||||
// Backend sends: total_bytes, total_blobs, first_upload, last_upload, version, process_id, memory_mb, cpu_core, fs_blob_count, fs_blob_size_mb
|
||||
updateStatsCell('db-size', data.total_bytes ? formatFileSize(data.total_bytes) : '-');
|
||||
updateStatsCell('total-size', data.total_bytes ? formatFileSize(data.total_bytes) : '-');
|
||||
updateStatsCell('total-events', data.total_blobs || '-');
|
||||
updateStatsCell('oldest-event', data.first_upload ? formatTimestamp(data.first_upload) : '-');
|
||||
updateStatsCell('newest-event', data.last_upload ? formatTimestamp(data.last_upload) : '-');
|
||||
|
||||
// System metrics from system table
|
||||
if (data.version) {
|
||||
updateStatsCell('version', data.version);
|
||||
}
|
||||
if (data.process_id) {
|
||||
updateStatsCell('process-id', data.process_id);
|
||||
}
|
||||
if (data.memory_mb) {
|
||||
updateStatsCell('memory-usage', data.memory_mb + ' MB');
|
||||
}
|
||||
if (data.cpu_core) {
|
||||
updateStatsCell('cpu-core', 'Core ' + data.cpu_core);
|
||||
}
|
||||
if (data.fs_blob_count !== undefined) {
|
||||
updateStatsCell('fs-blob-count', data.fs_blob_count);
|
||||
}
|
||||
if (data.fs_blob_size_mb !== undefined) {
|
||||
updateStatsCell('fs-blob-size', data.fs_blob_size_mb + ' MB');
|
||||
}
|
||||
}
|
||||
|
||||
// Populate event kinds distribution table
|
||||
@@ -4526,6 +4546,14 @@ function updateStatsCell(cellId, newValue) {
|
||||
// Start polling for statistics (every 10 seconds)
|
||||
function startStatsPolling() {
|
||||
console.log('=== STARTING STATISTICS POLLING ===');
|
||||
|
||||
// Initialize the event rate chart if not already initialized
|
||||
if (!eventRateChart) {
|
||||
console.log('Initializing event rate chart from startStatsPolling...');
|
||||
setTimeout(() => {
|
||||
initializeEventRateChart();
|
||||
}, 1000); // Delay to ensure text_graph.js is loaded
|
||||
}
|
||||
console.log('Current page:', currentPage);
|
||||
console.log('Is logged in:', isLoggedIn);
|
||||
console.log('User pubkey:', userPubkey);
|
||||
|
||||
Reference in New Issue
Block a user