Added UI for plugin system and upnp example

- Added wip UI for plugin tag system
- Added upnp port forwarder plugin
- Added error and fatal printout for plugins
- Optimized UI flow for plugin context window
- Added dev web server for plugin development purpose
This commit is contained in:
Toby Chui
2025-03-15 21:02:44 +08:00
parent 4a99afa2f0
commit f8270e46c2
34 changed files with 3143 additions and 14 deletions

View File

@@ -1005,6 +1005,23 @@ func ReverseProxyListDetail(w http.ResponseWriter, r *http.Request) {
}
}
// List all tags used in the proxy rules
func ReverseProxyListTags(w http.ResponseWriter, r *http.Request) {
results := []string{}
dynamicProxyRouter.ProxyEndpoints.Range(func(key, value interface{}) bool {
thisEndpoint := value.(*dynamicproxy.ProxyEndpoint)
for _, tag := range thisEndpoint.Tags {
if !utils.StringInArray(results, tag) {
results = append(results, tag)
}
}
return true
})
js, _ := json.Marshal(results)
utils.SendJSONResponse(w, string(js))
}
func ReverseProxyList(w http.ResponseWriter, r *http.Request) {
eptype, err := utils.PostPara(r, "type") //Support root and host
if err != nil {