fix model toggle

This commit is contained in:
Dobromir Popov
2025-07-29 00:52:58 +03:00
parent b44216ae1e
commit f4ac504963
2 changed files with 46 additions and 17 deletions

View File

@ -783,16 +783,29 @@ class DashboardComponentManager:
html.Span(f" [{checkpoint_status}]", className=f"small {'text-success' if checkpoint_status == 'LOADED' else 'text-warning'} ms-1")
], style={"flex": "1"}),
# Activation toggle (if easy to implement)
# Inference and Training toggles
html.Div([
dcc.Checklist(
id=f"toggle-{model_name}",
options=[{"label": "", "value": "active"}],
value=["active"] if is_active else [],
className="form-check-input",
style={"transform": "scale(0.8)"}
)
], className="form-check form-switch")
html.Div([
html.Label("Inf", className="text-muted small me-1", style={"font-size": "10px"}),
dcc.Checklist(
id=f"{model_name}-inference-toggle",
options=[{"label": "", "value": True}],
value=[True] if model_info.get('inference_enabled', True) else [],
className="form-check-input me-2",
style={"transform": "scale(0.7)"}
)
], className="d-flex align-items-center me-2"),
html.Div([
html.Label("Trn", className="text-muted small me-1", style={"font-size": "10px"}),
dcc.Checklist(
id=f"{model_name}-training-toggle",
options=[{"label": "", "value": True}],
value=[True] if model_info.get('training_enabled', True) else [],
className="form-check-input",
style={"transform": "scale(0.7)"}
)
], className="d-flex align-items-center")
], className="d-flex")
], className="d-flex align-items-center mb-1"),
# Model metrics