mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-11-07 15:19:44 +00:00
Update network name
This commit is contained in:
parent
e2c81f8099
commit
9b025c099f
@ -3,5 +3,6 @@ package common
|
|||||||
const (
|
const (
|
||||||
SERVICENAME = "casaos"
|
SERVICENAME = "casaos"
|
||||||
VERSION = "0.4.4"
|
VERSION = "0.4.4"
|
||||||
BODY = " "
|
BODY = ""
|
||||||
|
RANW_NAME = "IceWhale-RemoteAccess"
|
||||||
)
|
)
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/IceWhaleTech/CasaOS/common"
|
||||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/httper"
|
"github.com/IceWhaleTech/CasaOS/pkg/utils/httper"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
@ -91,7 +92,7 @@ func CheckNetwork(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
name := gjson.GetBytes(res, "name").Str
|
name := gjson.GetBytes(res, "name").Str
|
||||||
if name == "icewhale-casaos" {
|
if name == common.RANW_NAME {
|
||||||
fmt.Println(string(res))
|
fmt.Println(string(res))
|
||||||
networkId = gjson.GetBytes(res, "id").Str
|
networkId = gjson.GetBytes(res, "id").Str
|
||||||
break
|
break
|
||||||
@ -156,7 +157,7 @@ func JoinAndUpdateNet(address, networkId string) {
|
|||||||
}
|
}
|
||||||
func CreateNet(address string) string {
|
func CreateNet(address string) string {
|
||||||
body := `{
|
body := `{
|
||||||
"name": "icewhale-casaos",
|
"name": "` + common.RANW_NAME + `",
|
||||||
"private": false,
|
"private": false,
|
||||||
"v4AssignMode": {
|
"v4AssignMode": {
|
||||||
"zt": true
|
"zt": true
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/IceWhaleTech/CasaOS-Common/utils"
|
"github.com/IceWhaleTech/CasaOS-Common/utils"
|
||||||
"github.com/IceWhaleTech/CasaOS/codegen"
|
"github.com/IceWhaleTech/CasaOS/codegen"
|
||||||
|
"github.com/IceWhaleTech/CasaOS/common"
|
||||||
"github.com/IceWhaleTech/CasaOS/pkg/utils/httper"
|
"github.com/IceWhaleTech/CasaOS/pkg/utils/httper"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
@ -55,7 +56,7 @@ func (s *CasaOS) GetZerotierInfo(ctx echo.Context) error {
|
|||||||
return ctx.JSON(http.StatusInternalServerError, codegen.BaseResponse{Message: utils.Ptr(err.Error())})
|
return ctx.JSON(http.StatusInternalServerError, codegen.BaseResponse{Message: utils.Ptr(err.Error())})
|
||||||
}
|
}
|
||||||
name := gjson.GetBytes(res, "name").Str
|
name := gjson.GetBytes(res, "name").Str
|
||||||
if name == "icewhale-casaos" {
|
if name == common.RANW_NAME {
|
||||||
via := gjson.GetBytes(res, "routes.0.via").Str
|
via := gjson.GetBytes(res, "routes.0.via").Str
|
||||||
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
|
info.Id = utils.Ptr(gjson.GetBytes(res, "id").Str)
|
||||||
info.Name = &name
|
info.Name = &name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user