mirror of
https://github.com/getnora-io/nora.git
synced 2026-04-12 09:10:32 +00:00
Add dashboard metrics, activity log, and dark theme
- Add DashboardMetrics for tracking downloads/uploads/cache hits per registry - Add ActivityLog for recent activity with bounded size (50 entries) - Instrument Docker, npm, Maven, and Cargo handlers with metrics - Add /api/ui/dashboard endpoint with global stats and activity - Implement dark theme dashboard with real-time polling (5s interval) - Add mount points table showing registry paths and proxy upstreams
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
mod activity_log;
|
||||
mod auth;
|
||||
mod backup;
|
||||
mod config;
|
||||
mod dashboard_metrics;
|
||||
mod error;
|
||||
mod health;
|
||||
mod metrics;
|
||||
@@ -23,8 +25,10 @@ use tokio::signal;
|
||||
use tracing::{error, info, warn};
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
|
||||
use activity_log::ActivityLog;
|
||||
use auth::HtpasswdAuth;
|
||||
use config::{Config, StorageMode};
|
||||
use dashboard_metrics::DashboardMetrics;
|
||||
pub use storage::Storage;
|
||||
use tokens::TokenStore;
|
||||
|
||||
@@ -71,6 +75,8 @@ pub struct AppState {
|
||||
pub start_time: Instant,
|
||||
pub auth: Option<HtpasswdAuth>,
|
||||
pub tokens: Option<TokenStore>,
|
||||
pub metrics: DashboardMetrics,
|
||||
pub activity: ActivityLog,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
@@ -205,6 +211,8 @@ async fn run_server(config: Config, storage: Storage) {
|
||||
start_time,
|
||||
auth,
|
||||
tokens,
|
||||
metrics: DashboardMetrics::new(),
|
||||
activity: ActivityLog::new(50),
|
||||
});
|
||||
|
||||
// Token routes with strict rate limiting (brute-force protection)
|
||||
|
||||
Reference in New Issue
Block a user