ShowRegistries displays all configured registries.
()
| 1071 | |
| 1072 | // ShowRegistries displays all configured registries. |
| 1073 | func (sh *SkillHandler) ShowRegistries() { |
| 1074 | regs := sh.registryMgr.GetRegistries() |
| 1075 | |
| 1076 | fmt.Printf("\n %s\n\n", colorize(i18n.T("skill.registries.configured")+":", ColorCyan)) |
| 1077 | |
| 1078 | for i, r := range regs { |
| 1079 | status := colorize("["+i18n.T("skill.cmd.status_enabled")+"]", ColorGreen) |
| 1080 | if r.TempDisabled { |
| 1081 | remaining := "" |
| 1082 | if r.DisabledUntil != nil { |
| 1083 | remaining = fmt.Sprintf(" ~%ds", int(time.Until(*r.DisabledUntil).Seconds())) |
| 1084 | } |
| 1085 | status = colorize(fmt.Sprintf("[%s]", i18n.T("skill.cmd.status_paused_failures", r.FailureCount, remaining)), ColorYellow) |
| 1086 | } else if !r.Enabled { |
| 1087 | status = colorize("["+i18n.T("skill.cmd.status_disabled")+"]", ColorGray) |
| 1088 | } |
| 1089 | fmt.Printf(" %d. %-12s %s %s\n", i+1, r.Name, colorize(r.URL, ColorGray), status) |
| 1090 | } |
| 1091 | |
| 1092 | fmt.Printf("\n %s: %s\n", i18n.T("skill.registries.config"), colorize(sh.registryMgr.GetConfigPath(), ColorGray)) |
| 1093 | fmt.Printf(" %s\n", i18n.T("skill.registries.toggle_hint", |
| 1094 | colorize("/skill registry enable|disable <name>", ColorCyan))) |
| 1095 | fmt.Println() |
| 1096 | } |
| 1097 | |
| 1098 | // SetRegistryEnabled enables or disables a registry by name, persists the change, |
| 1099 | // and hot-reloads the registry manager so the change takes effect immediately. |
no test coverage detected