MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / extractOtherConfig

Function extractOtherConfig

agent/app/service/agents_utils.go:292–316  ·  view source on GitHub ↗
(conf map[string]interface{})

Source from the content-addressed store, hash-verified

290}
291
292func extractOtherConfig(conf map[string]interface{}) dto.AgentOtherConfig {
293 result := dto.AgentOtherConfig{
294 UserTimezone: resolveServerTimezone(),
295 BrowserEnabled: true,
296 NPMRegistry: defaultOpenclawNPMRegistry,
297 }
298 agents, ok := conf["agents"].(map[string]interface{})
299 if !ok {
300 browser := extractBrowserConfig(conf)
301 result.BrowserEnabled = browser.Enabled
302 return result
303 }
304 defaults, ok := agents["defaults"].(map[string]interface{})
305 if !ok {
306 browser := extractBrowserConfig(conf)
307 result.BrowserEnabled = browser.Enabled
308 return result
309 }
310 if timezone, ok := defaults["userTimezone"].(string); ok && strings.TrimSpace(timezone) != "" {
311 result.UserTimezone = strings.TrimSpace(timezone)
312 }
313 browser := extractBrowserConfig(conf)
314 result.BrowserEnabled = browser.Enabled
315 return result
316}
317
318func setOtherConfig(conf map[string]interface{}, config dto.AgentOtherConfig) {
319 agents := ensureChildMap(conf, "agents")

Callers 1

GetOtherConfigMethod · 0.85

Calls 2

resolveServerTimezoneFunction · 0.85
extractBrowserConfigFunction · 0.85

Tested by

no test coverage detected