diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-11-19 18:38:25 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-05 09:14:02 +0000 |
| commit | 77200b36494dbf8f7aa1500fbf5976585fffdb66 (patch) | |
| tree | b3b17c991bf49a7ef78b297166d26427c808e66e /dashboard/app/handler.go | |
| parent | d65130ca2efd4a9ccb21068e3d9cefaf365e8dc6 (diff) | |
dashboard/app: add support for AI workflows
Support for:
- polling for AI jobs
- handling completion of AI jobs
- submitting job trajectory logs
- basic visualization for AI jobs
Diffstat (limited to 'dashboard/app/handler.go')
| -rw-r--r-- | dashboard/app/handler.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dashboard/app/handler.go b/dashboard/app/handler.go index bda86eb30..1acd9ed4d 100644 --- a/dashboard/app/handler.go +++ b/dashboard/app/handler.go @@ -214,6 +214,7 @@ func serveTemplate(w http.ResponseWriter, name string, data any) error { type uiHeader struct { Admin bool + AI bool // Enable UI elements related to AI URLPath string LoginLink string AnalyticsTrackingID string @@ -225,6 +226,7 @@ type uiHeader struct { Namespaces []uiNamespace ShowSubsystems bool ShowCoverageMenu bool + Message string // Show message box with this message when the page loads. } type uiNamespace struct { @@ -299,8 +301,10 @@ func commonHeader(c context.Context, r *http.Request, w http.ResponseWriter, ns } } if ns != adminPage { + cfg := getNsConfig(c, ns) h.Namespace = ns - h.ShowSubsystems = getNsConfig(c, ns).Subsystems.Service != nil + h.AI = cfg.AI && accessLevel >= AIAccessLevel + h.ShowSubsystems = cfg.Subsystems.Service != nil cookie.Namespace = ns encodeCookie(w, cookie) cached, err := CacheGet(c, r, ns) @@ -309,7 +313,7 @@ func commonHeader(c context.Context, r *http.Request, w http.ResponseWriter, ns } h.BugCounts = &cached.Total h.MissingBackports = cached.MissingBackports - h.ShowCoverageMenu = getNsConfig(c, ns).Coverage != nil + h.ShowCoverageMenu = cfg.Coverage != nil } return h, nil } |
