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
@@ -588,12 +588,13 @@ func (h *handler) handleAPIScenarioList(w http.ResponseWriter, _ *http.Request)
|
||||
return
|
||||
}
|
||||
type scenarioFile struct {
|
||||
Name string `json:"name"`
|
||||
Device string `json:"device"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Device string `json:"device"`
|
||||
}
|
||||
out := make([]scenarioFile, 0, len(files))
|
||||
for _, f := range files {
|
||||
out = append(out, scenarioFile{Name: f.Name, Device: f.Device})
|
||||
out = append(out, scenarioFile{Name: f.Name, Description: f.Description, Device: f.Device})
|
||||
}
|
||||
writeJSON(w, out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user