mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: wire agents-tab-visible metadata to experiments flag (#22553)
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
<meta property="docs-url" content="{{ .DocsURL }}" />
|
||||
<meta property="logo-url" content="{{ .LogoURL }}" />
|
||||
<meta property="tasks-tab-visible" content="{{ .TasksTabVisible }}" />
|
||||
<meta property="agents-tab-visible" content="{{ .AgentsTabVisible }}" />
|
||||
<link
|
||||
rel="alternate icon"
|
||||
type="image/png"
|
||||
|
||||
+12
-1
@@ -262,7 +262,8 @@ type htmlState struct {
|
||||
Regions string
|
||||
DocsURL string
|
||||
|
||||
TasksTabVisible string
|
||||
TasksTabVisible string
|
||||
AgentsTabVisible string
|
||||
}
|
||||
|
||||
type csrfState struct {
|
||||
@@ -505,6 +506,16 @@ func (h *Handler) renderHTMLWithState(r *http.Request, filePath string, state ht
|
||||
state.TasksTabVisible = html.EscapeString(string(tasksTabVisible))
|
||||
}
|
||||
}()
|
||||
wg.Go(func() {
|
||||
agentsTabVisible := false
|
||||
if experiments != nil {
|
||||
agentsTabVisible = experiments.Enabled(codersdk.ExperimentAgents)
|
||||
}
|
||||
data, err := json.Marshal(agentsTabVisible)
|
||||
if err == nil {
|
||||
state.AgentsTabVisible = html.EscapeString(string(data))
|
||||
}
|
||||
})
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user