Add DM Sans font integration and enhance dashboard context
- Added DM Sans font to the project, including multiple weights and styles for improved typography. - Updated package.json and package-lock.json to include @fontsource/dm-sans dependency. - Enhanced dashboard context to include current cluster CPU state, integrating new data into the context and API responses. - Updated relevant templates and JavaScript to utilize the new current cluster data for better visualization and user experience.
This commit is contained in:
@@ -33,6 +33,19 @@ def convert_cpu_data(data: list):
|
||||
.reset_index()
|
||||
)
|
||||
|
||||
|
||||
def get_current_cluster_cpu(connection: Connection) -> dict:
|
||||
"""Return current per-host CPU state for the cluster (no Watcher dependency)."""
|
||||
cpu_data = query_prometheus(PROMETHEUS_METRICS['cpu_usage'])
|
||||
cpu_metrics = convert_cpu_data(data=cpu_data)
|
||||
if cpu_metrics.empty:
|
||||
return {"host_labels": [], "cpu_current": []}
|
||||
return {
|
||||
"host_labels": cpu_metrics['host'].to_list(),
|
||||
"cpu_current": cpu_metrics['cpu_usage'].to_list(),
|
||||
}
|
||||
|
||||
|
||||
def get_audits(connection: Connection) -> list[dict] | None:
|
||||
session = connection.session
|
||||
|
||||
|
||||
Reference in New Issue
Block a user