parent
dda15b0821
commit
c9617e583f
2 changed files with 2 additions and 3 deletions
|
@ -76,7 +76,6 @@ func copyHeaders(destination, source http.Header) {
|
|||
}
|
||||
|
||||
func CheckNetwork() {
|
||||
|
||||
//先获取所有已创建的网络
|
||||
respBody, err := httper.ZTGet("/controller/network")
|
||||
if err != nil {
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
func (s *CasaOS) SetZerotierNetworkStatus(ctx echo.Context, networkId string) error {
|
||||
ip := `,"via":"10.147.20.256"`
|
||||
ip := `,"via":"10.147.19.0"`
|
||||
status := ctx.Request().PostFormValue("status")
|
||||
if status == "online" {
|
||||
ip = ``
|
||||
|
@ -34,7 +34,7 @@ func (s *CasaOS) SetZerotierNetworkStatus(ctx echo.Context, networkId string) er
|
|||
via := gjson.GetBytes(res, "routes.0.via").Str
|
||||
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
|
||||
info.Name = utils.Ptr(gjson.GetBytes(res, "name").Str)
|
||||
if len(via) != 0 {
|
||||
if len(via) == 0 {
|
||||
info.Status = utils.Ptr("online")
|
||||
} else {
|
||||
info.Status = utils.Ptr("offline")
|
||||
|
|
Loading…
Reference in a new issue