GetGroupConfigOptions returns a list of available configuration options for groups.
(c *gin.Context)
| 337 | |
| 338 | // GetGroupConfigOptions returns a list of available configuration options for groups. |
| 339 | func (s *Server) GetGroupConfigOptions(c *gin.Context) { |
| 340 | options, err := s.GroupService.GetGroupConfigOptions() |
| 341 | if s.handleGroupError(c, err) { |
| 342 | return |
| 343 | } |
| 344 | |
| 345 | translated := make([]ConfigOption, 0, len(options)) |
| 346 | for _, option := range options { |
| 347 | name := option.Name |
| 348 | if strings.HasPrefix(name, "config.") { |
| 349 | name = i18n.Message(c, name) |
| 350 | } |
| 351 | description := option.Description |
| 352 | if strings.HasPrefix(description, "config.") { |
| 353 | description = i18n.Message(c, description) |
| 354 | } |
| 355 | |
| 356 | translated = append(translated, ConfigOption{ |
| 357 | Key: option.Key, |
| 358 | Name: name, |
| 359 | Description: description, |
| 360 | DefaultValue: option.DefaultValue, |
| 361 | }) |
| 362 | } |
| 363 | |
| 364 | response.Success(c, translated) |
| 365 | } |
| 366 | |
| 367 | // calculateRequestStats is a helper to compute request statistics. |
| 368 | func (s *Server) GetGroupStats(c *gin.Context) { |
nothing calls this directly
no test coverage detected