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

Method LoadSetting

agent/app/service/monitor.go:226–244  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

224}
225
226func (m *MonitorService) LoadSetting() (*dto.MonitorSetting, error) {
227 setting, err := settingRepo.GetList()
228 if err != nil {
229 return nil, buserr.New("ErrRecordNotFound")
230 }
231 settingMap := make(map[string]string)
232 for _, set := range setting {
233 settingMap[set.Key] = set.Value
234 }
235 var info dto.MonitorSetting
236 arr, err := json.Marshal(settingMap)
237 if err != nil {
238 return nil, err
239 }
240 if err := json.Unmarshal(arr, &info); err != nil {
241 return nil, err
242 }
243 return &info, err
244}
245
246func (m *MonitorService) UpdateSetting(key, value string) error {
247 switch key {

Callers

nothing calls this directly

Calls 1

GetListMethod · 0.65

Tested by

no test coverage detected