platform/webui: add scenario description, show it in the Scenario page's list
ScenarioSpec gains an optional "description" field. Listing (both ListLocalScenarioFiles and ListScenarioFilesOnRemovableMedia, via the new scenarioDescription helper) reads it out of each file without requiring full ParseScenarioJSON validation to succeed, so a listing never hides a scenario over an unrelated validation issue. The webui Scenario page now renders Name/Description/Found-on/Run instead of just Name/Found-on — a bare filename rarely tells anyone but the author what a scenario actually does. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
5a780e96b4
commit
d108df7fe9
@@ -45,6 +45,7 @@ type ScenarioJob struct {
|
||||
//
|
||||
// {
|
||||
// "name": "nvbandwidth-all-gpu-power-watch",
|
||||
// "description": "Full nvbandwidth across all GPUs at once — the failure mode never reproduces on a single socket alone — while sampling IPMI sensors and GPU power/temp for a power-delivery correlation.",
|
||||
// "timeout_sec": 1800,
|
||||
// "jobs": [
|
||||
// {"name": "ipmi-sensors", "type": "sampler", "interval_sec": 2,
|
||||
@@ -57,9 +58,15 @@ type ScenarioJob struct {
|
||||
// ]
|
||||
// }
|
||||
type ScenarioSpec struct {
|
||||
Name string `json:"name"`
|
||||
TimeoutSec int `json:"timeout_sec,omitempty"`
|
||||
Jobs []ScenarioJob `json:"jobs"`
|
||||
Name string `json:"name"`
|
||||
// Description is a short, human-readable explanation of what the
|
||||
// scenario does and why — shown in the webui's scenario list (and
|
||||
// available to any other UI) alongside the name, since a bare
|
||||
// filename/name rarely conveys enough for someone other than the
|
||||
// author to decide whether to run it.
|
||||
Description string `json:"description,omitempty"`
|
||||
TimeoutSec int `json:"timeout_sec,omitempty"`
|
||||
Jobs []ScenarioJob `json:"jobs"`
|
||||
}
|
||||
|
||||
// ParseScenarioJSON parses and validates a scenario file's contents.
|
||||
|
||||
Reference in New Issue
Block a user