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