fea:support add/del/save network (#55)

* fea:support add/del/save network
This commit is contained in:
buliangjun
2024-04-08 22:48:23 +08:00
committed by GitHub
parent 0939850a6d
commit dfee4c956a
9 changed files with 273 additions and 79 deletions

View File

@@ -46,7 +46,7 @@ func (h Output) Post(w http.ResponseWriter, r *http.Request) {
return
}
cs := h.Switcher.Config()
if cs.Network == nil {
if cs.Network[name] == nil {
http.Error(w, "network is nil", http.StatusBadRequest)
return
}
@@ -69,7 +69,7 @@ func (h Output) Delete(w http.ResponseWriter, r *http.Request) {
return
}
cs := h.Switcher.Config()
if cs.Network == nil {
if cs.Network[name] == nil {
http.Error(w, "network is nil", http.StatusBadRequest)
return
}