Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8393481a4 | ||
|
|
70d3202a2c | ||
|
|
c7f1bbc03d | ||
|
|
61a55cb3f4 | ||
|
|
6a484af775 | ||
|
|
3074d41cf2 | ||
|
|
54199058e3 | ||
|
|
87a533791b | ||
|
|
c3109bb2c6 | ||
|
|
031cb836d2 | ||
|
|
aa0a9134cb |
@@ -58,6 +58,10 @@ function build() {
|
|||||||
rm -f $(basename $EDGE_API_ZIP_FILE)
|
rm -f $(basename $EDGE_API_ZIP_FILE)
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
|
# generate files
|
||||||
|
echo "generating files ..."
|
||||||
|
go run -tags $TAG $ROOT/../cmd/edge-admin/main.go generate
|
||||||
|
|
||||||
# build
|
# build
|
||||||
echo "building "${NAME}" ..."
|
echo "building "${NAME}" ..."
|
||||||
env GOOS=$OS GOARCH=$ARCH go build -tags $TAG -ldflags="-s -w" -o $DIST/bin/${NAME} $ROOT/../cmd/edge-admin/main.go
|
env GOOS=$OS GOARCH=$ARCH go build -tags $TAG -ldflags="-s -w" -o $DIST/bin/${NAME} $ROOT/../cmd/edge-admin/main.go
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"github.com/TeaOSLab/EdgeAdmin/internal/apps"
|
"github.com/TeaOSLab/EdgeAdmin/internal/apps"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/configs"
|
"github.com/TeaOSLab/EdgeAdmin/internal/configs"
|
||||||
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
|
teaconst "github.com/TeaOSLab/EdgeAdmin/internal/const"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/gen"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/nodes"
|
"github.com/TeaOSLab/EdgeAdmin/internal/nodes"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web"
|
||||||
_ "github.com/iwind/TeaGo/bootstrap"
|
_ "github.com/iwind/TeaGo/bootstrap"
|
||||||
@@ -70,6 +71,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
fmt.Println("change demo mode successfully")
|
fmt.Println("change demo mode successfully")
|
||||||
})
|
})
|
||||||
|
app.On("generate", func() {
|
||||||
|
err := gen.Generate()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("generate failed: " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
app.Run(func() {
|
app.Run(func() {
|
||||||
adminNode := nodes.NewAdminNode()
|
adminNode := nodes.NewAdminNode()
|
||||||
adminNode.Run()
|
adminNode.Run()
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -11,7 +11,7 @@ require (
|
|||||||
github.com/go-yaml/yaml v2.1.0+incompatible
|
github.com/go-yaml/yaml v2.1.0+incompatible
|
||||||
github.com/google/go-cmp v0.5.6 // indirect
|
github.com/google/go-cmp v0.5.6 // indirect
|
||||||
github.com/iwind/TeaGo v0.0.0-20211026123858-7de7a21cad24
|
github.com/iwind/TeaGo v0.0.0-20211026123858-7de7a21cad24
|
||||||
github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3
|
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/miekg/dns v1.1.35
|
github.com/miekg/dns v1.1.35
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||||
|
|||||||
2
go.sum
2
go.sum
@@ -68,6 +68,8 @@ github.com/iwind/TeaGo v0.0.0-20211026123858-7de7a21cad24 h1:1cGulkD2SNJJRok5OKw
|
|||||||
github.com/iwind/TeaGo v0.0.0-20211026123858-7de7a21cad24/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc=
|
github.com/iwind/TeaGo v0.0.0-20211026123858-7de7a21cad24/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc=
|
||||||
github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3 h1:aBSonas7vFcgTj9u96/bWGILGv1ZbUSTLiOzcI1ZT6c=
|
github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3 h1:aBSonas7vFcgTj9u96/bWGILGv1ZbUSTLiOzcI1ZT6c=
|
||||||
github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA=
|
github.com/iwind/gosock v0.0.0-20210722083328-12b2d66abec3/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA=
|
||||||
|
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4 h1:VWGsCqTzObdlbf7UUE3oceIpcEKi4C/YBUszQXk118A=
|
||||||
|
github.com/iwind/gosock v0.0.0-20211103081026-ee4652210ca4/go.mod h1:H5Q7SXwbx3a97ecJkaS2sD77gspzE7HFUafBO0peEyA=
|
||||||
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
|
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
|
||||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package teaconst
|
package teaconst
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version = "0.3.5"
|
Version = "0.3.6"
|
||||||
|
|
||||||
APINodeVersion = "0.3.5"
|
APINodeVersion = "0.3.6"
|
||||||
|
|
||||||
ProductName = "Edge Admin"
|
ProductName = "Edge Admin"
|
||||||
ProcessName = "edge-admin"
|
ProcessName = "edge-admin"
|
||||||
|
|||||||
129
internal/gen/generate.go
Normal file
129
internal/gen/generate.go
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||||
|
|
||||||
|
package gen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/conds/condutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||||
|
"github.com/iwind/TeaGo/Tea"
|
||||||
|
"github.com/iwind/TeaGo/files"
|
||||||
|
"github.com/iwind/TeaGo/logs"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Generate() error {
|
||||||
|
err := generateComponentsJSFile()
|
||||||
|
if err != nil {
|
||||||
|
return errors.New("generate 'components.js' failed: " + err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 生成Javascript文件
|
||||||
|
func generateComponentsJSFile() error {
|
||||||
|
var buffer = bytes.NewBuffer([]byte{})
|
||||||
|
|
||||||
|
var webRoot string
|
||||||
|
if Tea.IsTesting() {
|
||||||
|
webRoot = Tea.Root + "/../web/public/js/components/"
|
||||||
|
} else {
|
||||||
|
webRoot = Tea.Root + "/web/public/js/components/"
|
||||||
|
}
|
||||||
|
f := files.NewFile(webRoot)
|
||||||
|
|
||||||
|
f.Range(func(file *files.File) {
|
||||||
|
if !file.IsFile() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if file.Ext() != ".js" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data, err := file.ReadAll()
|
||||||
|
if err != nil {
|
||||||
|
logs.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
buffer.Write(data)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
})
|
||||||
|
|
||||||
|
// 条件组件
|
||||||
|
typesJSON, err := json.Marshal(condutils.ReadAllAvailableCondTypes())
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal request cond types failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.REQUEST_COND_COMPONENTS = ")
|
||||||
|
buffer.Write(typesJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 条件操作符
|
||||||
|
requestOperatorsJSON, err := json.Marshal(shared.AllRequestOperators())
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal request operators failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.REQUEST_COND_OPERATORS = ")
|
||||||
|
buffer.Write(requestOperatorsJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 请求变量
|
||||||
|
requestVariablesJSON, err := json.Marshal(shared.DefaultRequestVariables())
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal request variables failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.REQUEST_VARIABLES = ")
|
||||||
|
buffer.Write(requestVariablesJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 指标
|
||||||
|
metricHTTPKeysJSON, err := json.Marshal(serverconfigs.FindAllMetricKeyDefinitions(serverconfigs.MetricItemCategoryHTTP))
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal metric http keys failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.METRIC_HTTP_KEYS = ")
|
||||||
|
buffer.Write(metricHTTPKeysJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
// IP地址阈值项目
|
||||||
|
ipAddrThresholdItemsJSON, err := json.Marshal(nodeconfigs.FindAllIPAddressThresholdItems())
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal ip addr threshold items failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.IP_ADDR_THRESHOLD_ITEMS = ")
|
||||||
|
buffer.Write(ipAddrThresholdItemsJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
// IP地址阈值动作
|
||||||
|
ipAddrThresholdActionsJSON, err := json.Marshal(nodeconfigs.FindAllIPAddressThresholdActions())
|
||||||
|
if err != nil {
|
||||||
|
logs.Println("ComponentsAction marshal ip addr threshold actions failed: " + err.Error())
|
||||||
|
} else {
|
||||||
|
buffer.WriteString("window.IP_ADDR_THRESHOLD_ACTIONS = ")
|
||||||
|
buffer.Write(ipAddrThresholdActionsJSON)
|
||||||
|
buffer.Write([]byte{'\n', '\n'})
|
||||||
|
}
|
||||||
|
|
||||||
|
fp, err := os.OpenFile(filepath.Clean(Tea.PublicFile("/js/components.js")), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0777)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = io.Copy(fp, buffer)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
13
internal/gen/generate_test.go
Normal file
13
internal/gen/generate_test.go
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||||
|
|
||||||
|
package gen
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestGenerate(t *testing.T) {
|
||||||
|
err := Generate()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
t.Log("ok")
|
||||||
|
}
|
||||||
@@ -33,7 +33,7 @@ func (this *IndexAction) RunGet(params struct{}) {
|
|||||||
globalConfig := &serverconfigs.GlobalConfig{}
|
globalConfig := &serverconfigs.GlobalConfig{}
|
||||||
|
|
||||||
// 默认值
|
// 默认值
|
||||||
globalConfig.HTTPAll.DomainAuditingIsOn = true
|
globalConfig.HTTPAll.DomainAuditingIsOn = false
|
||||||
|
|
||||||
if len(valueJSON) > 0 {
|
if len(valueJSON) > 0 {
|
||||||
err = json.Unmarshal(valueJSON, globalConfig)
|
err = json.Unmarshal(valueJSON, globalConfig)
|
||||||
|
|||||||
@@ -57,6 +57,14 @@ func (this *CreateAction) RunGet(params struct{}) {
|
|||||||
// 服务类型
|
// 服务类型
|
||||||
this.Data["serverTypes"] = serverconfigs.AllServerTypes()
|
this.Data["serverTypes"] = serverconfigs.AllServerTypes()
|
||||||
|
|
||||||
|
// 检查是否有用户
|
||||||
|
countUsersResp, err := this.RPC().UserRPC().CountAllEnabledUsers(this.AdminContext(), &pb.CountAllEnabledUsersRequest{})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.Data["hasUsers"] = countUsersResp.Count > 0
|
||||||
|
|
||||||
this.Show()
|
this.Show()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,14 +102,16 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
|
|
||||||
// 用户
|
// 用户
|
||||||
var userId = params.UserId
|
var userId = params.UserId
|
||||||
clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
|
if userId > 0 {
|
||||||
if err != nil {
|
clusterIdResp, err := this.RPC().UserRPC().FindUserNodeClusterId(this.AdminContext(), &pb.FindUserNodeClusterIdRequest{UserId: userId})
|
||||||
this.ErrorPage(err)
|
if err != nil {
|
||||||
return
|
this.ErrorPage(err)
|
||||||
}
|
return
|
||||||
clusterId = clusterIdResp.NodeClusterId
|
}
|
||||||
if clusterId <= 0 {
|
clusterId = clusterIdResp.NodeClusterId
|
||||||
this.Fail("请选择部署的集群")
|
if clusterId <= 0 {
|
||||||
|
this.Fail("请选择部署的集群")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 套餐
|
// 套餐
|
||||||
@@ -354,7 +364,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
webId = webResp.WebId
|
webId = webResp.HttpWebId
|
||||||
}
|
}
|
||||||
|
|
||||||
// 包含条件
|
// 包含条件
|
||||||
@@ -452,7 +462,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
// 访问日志
|
// 访问日志
|
||||||
if params.AccessLogIsOn {
|
if params.AccessLogIsOn {
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
||||||
WebId: webConfig.Id,
|
HttpWebId: webConfig.Id,
|
||||||
AccessLogJSON: []byte(`{
|
AccessLogJSON: []byte(`{
|
||||||
"isPrior": false,
|
"isPrior": false,
|
||||||
"isOn": true,
|
"isOn": true,
|
||||||
@@ -491,7 +501,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
} else {
|
} else {
|
||||||
websocketId := createWebSocketResp.WebsocketId
|
websocketId := createWebSocketResp.WebsocketId
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
||||||
WebId: webConfig.Id,
|
HttpWebId: webConfig.Id,
|
||||||
WebsocketJSON: []byte(` {
|
WebsocketJSON: []byte(` {
|
||||||
"isPrior": false,
|
"isPrior": false,
|
||||||
"isOn": true,
|
"isOn": true,
|
||||||
@@ -520,7 +530,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
||||||
WebId: webConfig.Id,
|
HttpWebId: webConfig.Id,
|
||||||
CacheJSON: cacheConfigJSON,
|
CacheJSON: cacheConfigJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -542,7 +552,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
||||||
WebId: webConfig.Id,
|
HttpWebId: webConfig.Id,
|
||||||
FirewallJSON: firewallRefJSON,
|
FirewallJSON: firewallRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -565,7 +575,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
||||||
WebId: webConfig.Id,
|
HttpWebId: webConfig.Id,
|
||||||
RemoteAddrJSON: remoteAddrConfigJSON,
|
RemoteAddrJSON: remoteAddrConfigJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查参数
|
// TODO 检查参数
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
AccessLogJSON: params.AccessLogJSON,
|
AccessLogJSON: params.AccessLogJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CacheJSON: cacheJSON,
|
CacheJSON: cacheJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
|
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CharsetJSON: params.CharsetJSON,
|
CharsetJSON: params.CharsetJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CompressionJSON: params.CompressionJSON,
|
CompressionJSON: params.CompressionJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -82,7 +82,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -129,7 +129,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
HeaderJSON: params.RequestHeaderJSON,
|
HeaderJSON: params.RequestHeaderJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -145,7 +145,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
HeaderJSON: params.ResponseHeaderJSON,
|
HeaderJSON: params.ResponseHeaderJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
PagesJSON: []byte(params.PagesJSON),
|
PagesJSON: []byte(params.PagesJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
ShutdownJSON: []byte(params.ShutdownJSON),
|
ShutdownJSON: []byte(params.ShutdownJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RemoteAddrJSON: params.RemoteAddrJSON,
|
RemoteAddrJSON: params.RemoteAddrJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -49,8 +49,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 校验配置
|
// TODO 校验配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
StatJSON: params.StatJSON,
|
StatJSON: params.StatJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
FirewallJSON: params.FirewallJSON,
|
FirewallJSON: params.FirewallJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RootJSON: params.RootJSON,
|
RootJSON: params.RootJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebpJSON: params.WebpJSON,
|
WebpJSON: params.WebpJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebsocketJSON: websocketRefJSON,
|
WebsocketJSON: websocketRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
AuthJSON: configJSON,
|
AuthJSON: configJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查参数
|
// TODO 检查参数
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
AccessLogJSON: params.AccessLogJSON,
|
AccessLogJSON: params.AccessLogJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CacheJSON: cacheJSON,
|
CacheJSON: cacheJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
|
defer this.CreateLog(oplogs.LevelInfo, "修改Web %d 的字符集设置", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CharsetJSON: params.CharsetJSON,
|
CharsetJSON: params.CharsetJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||||
|
|
||||||
|
package common
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/dao"
|
||||||
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||||
|
"github.com/iwind/TeaGo/actions"
|
||||||
|
"github.com/iwind/TeaGo/maps"
|
||||||
|
)
|
||||||
|
|
||||||
|
type IndexAction struct {
|
||||||
|
actionutils.ParentAction
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IndexAction) Init() {
|
||||||
|
this.Nav("", "setting", "index")
|
||||||
|
this.SecondMenu("common")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IndexAction) RunGet(params struct {
|
||||||
|
ServerId int64
|
||||||
|
}) {
|
||||||
|
this.Data["hasGroupConfig"] = false
|
||||||
|
|
||||||
|
webConfig, err := dao.SharedHTTPWebDAO.FindWebConfigWithServerId(this.AdminContext(), params.ServerId)
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Data["webId"] = webConfig.Id
|
||||||
|
|
||||||
|
this.Data["commonConfig"] = maps.Map{
|
||||||
|
"mergeSlashes": webConfig.MergeSlashes,
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Show()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *IndexAction) RunPost(params struct {
|
||||||
|
WebId int64
|
||||||
|
MergeSlashes bool
|
||||||
|
|
||||||
|
Must *actions.Must
|
||||||
|
CSRF *actionutils.CSRF
|
||||||
|
}) {
|
||||||
|
defer this.CreateLogInfo("修改服务Web %d 设置的其他设置", params.WebId)
|
||||||
|
|
||||||
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCommon(this.AdminContext(), &pb.UpdateHTTPWebCommonRequest{
|
||||||
|
HttpWebId: params.WebId,
|
||||||
|
MergeSlashes: params.MergeSlashes,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
this.ErrorPage(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.Success()
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package common
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
||||||
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||||
|
"github.com/iwind/TeaGo"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||||
|
server.
|
||||||
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
||||||
|
Helper(serverutils.NewServerHelper()).
|
||||||
|
Prefix("/servers/server/settings/common").
|
||||||
|
GetPost("", new(IndexAction)).
|
||||||
|
EndAll()
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -71,7 +71,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CompressionJSON: params.CompressionJSON,
|
CompressionJSON: params.CompressionJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
FastcgiJSON: fastcgiRefJSON,
|
FastcgiJSON: fastcgiRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -86,7 +86,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// 设置跳转到HTTPS
|
// 设置跳转到HTTPS
|
||||||
// TODO 校验设置
|
// TODO 校验设置
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
|
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebAuth(this.AdminContext(), &pb.UpdateHTTPWebAuthRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
AuthJSON: configJSON,
|
AuthJSON: configJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查参数
|
// TODO 检查参数
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebAccessLog(this.AdminContext(), &pb.UpdateHTTPWebAccessLogRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
AccessLogJSON: params.AccessLogJSON,
|
AccessLogJSON: params.AccessLogJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCache(this.AdminContext(), &pb.UpdateHTTPWebCacheRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CacheJSON: cacheJSON,
|
CacheJSON: cacheJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLogInfo("修改Web %d 的字符集设置", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的字符集设置", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CharsetJSON: params.CharsetJSON,
|
CharsetJSON: params.CharsetJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebCompression(this.AdminContext(), &pb.UpdateHTTPWebCompressionRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
CompressionJSON: params.CompressionJSON,
|
CompressionJSON: params.CompressionJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ func (this *CreateAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
LocationsJSON: refJSON,
|
LocationsJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
LocationsJSON: refJSON,
|
LocationsJSON: refJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebFastcgi(this.AdminContext(), &pb.UpdateHTTPWebFastcgiRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
FastcgiJSON: fastcgiRefJSON,
|
FastcgiJSON: fastcgiRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
isChanged = true
|
isChanged = true
|
||||||
@@ -71,7 +71,7 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||||
WebId: webId,
|
HttpWebId: webId,
|
||||||
HeaderJSON: refJSON,
|
HeaderJSON: refJSON,
|
||||||
})
|
})
|
||||||
isChanged = true
|
isChanged = true
|
||||||
@@ -109,7 +109,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
switch params.Type {
|
switch params.Type {
|
||||||
case "request":
|
case "request":
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
HeaderJSON: params.RequestHeaderJSON,
|
HeaderJSON: params.RequestHeaderJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -118,7 +118,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
case "response":
|
case "response":
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
HeaderJSON: params.ResponseHeaderJSON,
|
HeaderJSON: params.ResponseHeaderJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// 设置跳转到HTTPS
|
// 设置跳转到HTTPS
|
||||||
// TODO 校验设置
|
// TODO 校验设置
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
|
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
PagesJSON: []byte(params.PagesJSON),
|
PagesJSON: []byte(params.PagesJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -50,7 +50,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
ShutdownJSON: []byte(params.ShutdownJSON),
|
ShutdownJSON: []byte(params.ShutdownJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RemoteAddrJSON: params.RemoteAddrJSON,
|
RemoteAddrJSON: params.RemoteAddrJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ func (this *SortAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebLocations(this.AdminContext(), &pb.UpdateHTTPWebLocationsRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
LocationsJSON: newRefsJSON,
|
LocationsJSON: newRefsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 校验配置
|
// TODO 校验配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
StatJSON: params.StatJSON,
|
StatJSON: params.StatJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
FirewallJSON: params.FirewallJSON,
|
FirewallJSON: params.FirewallJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLogInfo("修改Web %d 的根目录等设置", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的根目录等设置", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RootJSON: params.RootJSON,
|
RootJSON: params.RootJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebpJSON: params.WebpJSON,
|
WebpJSON: params.WebpJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebsocketJSON: websocketRefJSON,
|
WebsocketJSON: websocketRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebPages(this.AdminContext(), &pb.UpdateHTTPWebPagesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
PagesJSON: []byte(params.PagesJSON),
|
PagesJSON: []byte(params.PagesJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -66,7 +66,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebShutdown(this.AdminContext(), &pb.UpdateHTTPWebShutdownRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
ShutdownJSON: []byte(params.ShutdownJSON),
|
ShutdownJSON: []byte(params.ShutdownJSON),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLogInfo("修改Web %d 的URL跳转设置", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的URL跳转设置", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebHostRedirects(this.AdminContext(), &pb.UpdateHTTPWebHostRedirectsRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebHostRedirects(this.AdminContext(), &pb.UpdateHTTPWebHostRedirectsRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
HostRedirectsJSON: params.HostRedirectsJSON,
|
HostRedirectsJSON: params.HostRedirectsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRemoteAddr(this.AdminContext(), &pb.UpdateHTTPWebRemoteAddrRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RemoteAddrJSON: params.RemoteAddrJSON,
|
RemoteAddrJSON: params.RemoteAddrJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
|
|
||||||
// 设置Web中的重写规则
|
// 设置Web中的重写规则
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RewriteRulesJSON: refsJSON,
|
RewriteRulesJSON: refsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RewriteRulesJSON: refsJSON,
|
RewriteRulesJSON: refsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ func (this *SortAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRewriteRules(this.AdminContext(), &pb.UpdateHTTPWebRewriteRulesRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RewriteRulesJSON: refsJSON,
|
RewriteRulesJSON: refsJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 校验配置
|
// TODO 校验配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebStat(this.AdminContext(), &pb.UpdateHTTPWebStatRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
StatJSON: params.StatJSON,
|
StatJSON: params.StatJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebFirewall(this.AdminContext(), &pb.UpdateHTTPWebFirewallRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
FirewallJSON: params.FirewallJSON,
|
FirewallJSON: params.FirewallJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的首页文件名", params.WebId)
|
||||||
|
|
||||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWeb(this.AdminContext(), &pb.UpdateHTTPWebRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
RootJSON: params.RootJSON,
|
RootJSON: params.RootJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebP(this.AdminContext(), &pb.UpdateHTTPWebWebPRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebpJSON: params.WebpJSON,
|
WebpJSON: params.WebpJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebWebsocket(this.AdminContext(), &pb.UpdateHTTPWebWebsocketRequest{
|
||||||
WebId: params.WebId,
|
HttpWebId: params.WebId,
|
||||||
WebsocketJSON: websocketRefJSON,
|
WebsocketJSON: websocketRefJSON,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -357,6 +357,19 @@ func (this *ServerHelper) createSettingsMenu(secondMenuItem string, serverIdStri
|
|||||||
"isOn": serverConfig.TrafficLimit != nil && serverConfig.TrafficLimit.IsOn,
|
"isOn": serverConfig.TrafficLimit != nil && serverConfig.TrafficLimit.IsOn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuItems = append(menuItems, maps.Map{
|
||||||
|
"name": "-",
|
||||||
|
"url": "",
|
||||||
|
"isActive": false,
|
||||||
|
})
|
||||||
|
|
||||||
|
menuItems = append(menuItems, maps.Map{
|
||||||
|
"name": "其他设置",
|
||||||
|
"url": "/servers/server/settings/common?serverId=" + serverIdString,
|
||||||
|
"isActive": secondMenuItem == "common",
|
||||||
|
"isOn": serverConfig.Web != nil && serverConfig.Web.MergeSlashes,
|
||||||
|
})
|
||||||
} else if serverConfig.IsTCPFamily() {
|
} else if serverConfig.IsTCPFamily() {
|
||||||
menuItems = append(menuItems, maps.Map{
|
menuItems = append(menuItems, maps.Map{
|
||||||
"name": "TCP",
|
"name": "TCP",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ func (this *DeleteAction) RunPost(params struct {
|
|||||||
}) {
|
}) {
|
||||||
// TODO 检查权限
|
// TODO 检查权限
|
||||||
|
|
||||||
_, err := this.RPC().AuthorityNodeRPC().DeleteAuthorityNode(this.AdminContext(), &pb.DeleteAuthorityNodeRequest{NodeId: params.NodeId})
|
_, err := this.RPC().AuthorityNodeRPC().DeleteAuthorityNode(this.AdminContext(), &pb.DeleteAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ func (this *IndexAction) RunGet(params struct{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, node := range nodesResp.Nodes {
|
for _, node := range nodesResp.AuthorityNodes {
|
||||||
// 状态
|
// 状态
|
||||||
status := &nodeconfigs.NodeStatus{}
|
status := &nodeconfigs.NodeStatus{}
|
||||||
if len(node.StatusJSON) > 0 {
|
if len(node.StatusJSON) > 0 {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建日志
|
// 创建日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "创建认证节点 %d", createResp.NodeId)
|
defer this.CreateLog(oplogs.LevelInfo, "创建认证节点 %d", createResp.AuthorityNodeId)
|
||||||
|
|
||||||
this.Success()
|
this.Success()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ func (this *IndexAction) Init() {
|
|||||||
func (this *IndexAction) RunGet(params struct {
|
func (this *IndexAction) RunGet(params struct {
|
||||||
NodeId int64
|
NodeId int64
|
||||||
}) {
|
}) {
|
||||||
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId})
|
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
node := nodeResp.Node
|
node := nodeResp.AuthorityNode
|
||||||
if node == nil {
|
if node == nil {
|
||||||
this.NotFound("authorityNode", params.NodeId)
|
this.NotFound("authorityNode", params.NodeId)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ func (this *InstallAction) RunGet(params struct {
|
|||||||
NodeId int64
|
NodeId int64
|
||||||
}) {
|
}) {
|
||||||
// 认证节点信息
|
// 认证节点信息
|
||||||
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId})
|
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
node := nodeResp.Node
|
node := nodeResp.AuthorityNode
|
||||||
if node == nil {
|
if node == nil {
|
||||||
this.NotFound("authorityNode", params.NodeId)
|
this.NotFound("authorityNode", params.NodeId)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ func (this *LogsAction) RunGet(params struct {
|
|||||||
this.Data["keyword"] = params.Keyword
|
this.Data["keyword"] = params.Keyword
|
||||||
this.Data["level"] = params.Level
|
this.Data["level"] = params.Level
|
||||||
|
|
||||||
authorityNodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{NodeId: params.NodeId})
|
authorityNodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{AuthorityNodeId: params.NodeId})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
authorityNode := authorityNodeResp.Node
|
authorityNode := authorityNodeResp.AuthorityNode
|
||||||
if authorityNode == nil {
|
if authorityNode == nil {
|
||||||
this.NotFound("authorityNode", params.NodeId)
|
this.NotFound("authorityNode", params.NodeId)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ func (this *UpdateAction) RunGet(params struct {
|
|||||||
NodeId int64
|
NodeId int64
|
||||||
}) {
|
}) {
|
||||||
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{
|
nodeResp, err := this.RPC().AuthorityNodeRPC().FindEnabledAuthorityNode(this.AdminContext(), &pb.FindEnabledAuthorityNodeRequest{
|
||||||
NodeId: params.NodeId,
|
AuthorityNodeId: params.NodeId,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
node := nodeResp.Node
|
node := nodeResp.AuthorityNode
|
||||||
if node == nil {
|
if node == nil {
|
||||||
this.WriteString("要操作的节点不存在")
|
this.WriteString("要操作的节点不存在")
|
||||||
return
|
return
|
||||||
@@ -56,10 +56,10 @@ func (this *UpdateAction) RunPost(params struct {
|
|||||||
Require("请输入认证节点名称")
|
Require("请输入认证节点名称")
|
||||||
|
|
||||||
_, err := this.RPC().AuthorityNodeRPC().UpdateAuthorityNode(this.AdminContext(), &pb.UpdateAuthorityNodeRequest{
|
_, err := this.RPC().AuthorityNodeRPC().UpdateAuthorityNode(this.AdminContext(), &pb.UpdateAuthorityNodeRequest{
|
||||||
NodeId: params.NodeId,
|
AuthorityNodeId: params.NodeId,
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
Description: params.Description,
|
Description: params.Description,
|
||||||
IsOn: params.IsOn,
|
IsOn: params.IsOn,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -26,11 +26,15 @@ func (this *IndexAction) RunGet(params struct{}) {
|
|||||||
config, err := configs.LoadAPIConfig()
|
config, err := configs.LoadAPIConfig()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
endpoints = config.RPC.Endpoints
|
endpoints = config.RPC.Endpoints
|
||||||
|
this.Data["nodeId"] = config.NodeId
|
||||||
|
this.Data["secret"] = config.Secret
|
||||||
|
this.Data["canInstall"] = false
|
||||||
|
} else {
|
||||||
|
this.Data["nodeId"] = ""
|
||||||
|
this.Data["secret"] = ""
|
||||||
|
this.Data["canInstall"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Data["nodeId"] = config.NodeId
|
|
||||||
this.Data["secret"] = config.Secret
|
|
||||||
|
|
||||||
if len(endpoints) == 0 {
|
if len(endpoints) == 0 {
|
||||||
endpoints = []string{""} // 初始化一个空的
|
endpoints = []string{""} // 初始化一个空的
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import (
|
|||||||
"github.com/iwind/TeaGo/dbs"
|
"github.com/iwind/TeaGo/dbs"
|
||||||
"github.com/iwind/TeaGo/logs"
|
"github.com/iwind/TeaGo/logs"
|
||||||
"github.com/iwind/TeaGo/maps"
|
"github.com/iwind/TeaGo/maps"
|
||||||
|
"github.com/iwind/gosock/pkg/gosock"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@@ -167,6 +168,9 @@ func (this *InstallAction) RunPost(params struct {
|
|||||||
if !resultMap.GetBool("isOk") {
|
if !resultMap.GetBool("isOk") {
|
||||||
this.Fail("节点安装错误:" + resultMap.GetString("error"))
|
this.Fail("节点安装错误:" + resultMap.GetString("error"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 等数据完全写入
|
||||||
|
time.Sleep(1 * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 关闭正在运行的API节点,防止冲突
|
// 关闭正在运行的API节点,防止冲突
|
||||||
@@ -190,7 +194,30 @@ func (this *InstallAction) RunPost(params struct {
|
|||||||
nodes.SharedAdminNode.AddSubPID(cmd.Process.Pid)
|
nodes.SharedAdminNode.AddSubPID(cmd.Process.Pid)
|
||||||
|
|
||||||
// 等待API节点初始化完成
|
// 等待API节点初始化完成
|
||||||
time.Sleep(5 * time.Second)
|
currentStatusText = "正在等待API节点启动完毕"
|
||||||
|
var apiNodeSock = gosock.NewTmpSock("edge-api")
|
||||||
|
var maxRetries = 5
|
||||||
|
for {
|
||||||
|
reply, err := apiNodeSock.SendTimeout(&gosock.Command{
|
||||||
|
Code: "starting",
|
||||||
|
}, 3*time.Second)
|
||||||
|
if err != nil {
|
||||||
|
if maxRetries < 0 {
|
||||||
|
this.Fail("API节点启动失败,请查看运行日志检查是否正常")
|
||||||
|
} else {
|
||||||
|
time.Sleep(3 * time.Second)
|
||||||
|
maxRetries--
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if !maps.NewMap(reply.Params).GetBool("isStarting") {
|
||||||
|
currentStatusText = "API节点启动完毕"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
// 继续等待完成
|
||||||
|
time.Sleep(3 * time.Second)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 写入API节点配置,完成安装
|
// 写入API节点配置,完成安装
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package ui
|
package ui
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"compress/gzip"
|
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||||
"github.com/iwind/TeaGo"
|
"github.com/iwind/TeaGo"
|
||||||
"github.com/iwind/TeaGo/actions"
|
"github.com/iwind/TeaGo/Tea"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -16,11 +15,6 @@ func init() {
|
|||||||
// 公共可以访问的链接
|
// 公共可以访问的链接
|
||||||
Get("/image/:fileId", new(ImageAction)).
|
Get("/image/:fileId", new(ImageAction)).
|
||||||
|
|
||||||
// 以下的需要压缩
|
|
||||||
Helper(&actions.Gzip{Level: gzip.BestCompression}).
|
|
||||||
Get("/components.js", new(ComponentsAction)).
|
|
||||||
EndHelpers().
|
|
||||||
|
|
||||||
// 以下需要登录
|
// 以下需要登录
|
||||||
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeCommon)).
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeCommon)).
|
||||||
Get("/download", new(DownloadAction)).
|
Get("/download", new(DownloadAction)).
|
||||||
@@ -31,7 +25,13 @@ func init() {
|
|||||||
Post("/hideTip", new(HideTipAction)).
|
Post("/hideTip", new(HideTipAction)).
|
||||||
Post("/theme", new(ThemeAction)).
|
Post("/theme", new(ThemeAction)).
|
||||||
Post("/validateIPs", new(ValidateIPsAction)).
|
Post("/validateIPs", new(ValidateIPsAction)).
|
||||||
|
|
||||||
EndAll()
|
EndAll()
|
||||||
|
|
||||||
|
// 开发环境下总是动态加载,以便于调试
|
||||||
|
if Tea.IsTesting() {
|
||||||
|
server.
|
||||||
|
Get("/js/components.js", new(ComponentsAction)).
|
||||||
|
EndAll()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ import (
|
|||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/accessLog"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/accessLog"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/cache"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/cache"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/charset"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/charset"
|
||||||
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/common"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/compression"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/compression"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/conds"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/conds"
|
||||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/dns"
|
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/dns"
|
||||||
|
|||||||
12042
web/public/js/components.js
Executable file
12042
web/public/js/components.js
Executable file
File diff suppressed because it is too large
Load Diff
30
web/public/js/components/server/http-common-config-box.js
Normal file
30
web/public/js/components/server/http-common-config-box.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// 通用设置
|
||||||
|
Vue.component("http-common-config-box", {
|
||||||
|
props: ["v-common-config"],
|
||||||
|
data: function () {
|
||||||
|
let config = this.vCommonConfig
|
||||||
|
if (config == null) {
|
||||||
|
config = {
|
||||||
|
mergeSlashes: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
config: config
|
||||||
|
}
|
||||||
|
},
|
||||||
|
template: `<div>
|
||||||
|
<table class="ui table definition selectable">
|
||||||
|
<tr>
|
||||||
|
<td class="title">合并重复的路径分隔符</td>
|
||||||
|
<td>
|
||||||
|
<div class="ui checkbox">
|
||||||
|
<input type="checkbox" name="mergeSlashes" value="1" v-model="config.mergeSlashes"/>
|
||||||
|
<label></label>
|
||||||
|
</div>
|
||||||
|
<p class="comment">合并URL中重复的路径分隔符为一个,比如<code-label>//hello/world</code-label>中的<code-label>//</code-label>。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="margin"></div>
|
||||||
|
</div>`
|
||||||
|
})
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
{$TEA.VUE}
|
{$TEA.VUE}
|
||||||
{$echo "header"}
|
{$echo "header"}
|
||||||
<script type="text/javascript" src="/_/@default/@layout.js"></script>
|
<script type="text/javascript" src="/_/@default/@layout.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js?v=v{$.teaVersion}"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/date.tea.js"></script>
|
<script type="text/javascript" src="/js/date.tea.js"></script>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<link rel="stylesheet" type="text/css" href="/_/@default/@layout_override.css" media="all"/>
|
<link rel="stylesheet" type="text/css" href="/_/@default/@layout_override.css" media="all"/>
|
||||||
{$echo "header"}
|
{$echo "header"}
|
||||||
<script type="text/javascript" src="/_/@default/@layout.js"></script>
|
<script type="text/javascript" src="/_/@default/@layout.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js?v=v{$.teaVersion}"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/date.tea.js"></script>
|
<script type="text/javascript" src="/js/date.tea.js"></script>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js?v=1.0.0"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<input type="text" name="name" maxlength="60" ref="focus"/>
|
<input type="text" name="name" maxlength="60" ref="focus"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr v-show="hasUsers">
|
||||||
<td>选择用户</td>
|
<td>选择用户</td>
|
||||||
<td>
|
<td>
|
||||||
<user-selector @change="changeUserId"></user-selector>
|
<user-selector @change="changeUserId"></user-selector>
|
||||||
|
|||||||
15
web/views/@default/servers/server/settings/common/index.html
Normal file
15
web/views/@default/servers/server/settings/common/index.html
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{$layout}
|
||||||
|
|
||||||
|
{$template "/left_menu"}
|
||||||
|
|
||||||
|
<div class="right-box">
|
||||||
|
<div :class="{'opacity-mask': hasGroupConfig}">
|
||||||
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
|
<csrf-token></csrf-token>
|
||||||
|
|
||||||
|
<input type="hidden" name="webId" :value="webId"/>
|
||||||
|
<http-common-config-box :v-common-config="commonConfig"></http-common-config-box>
|
||||||
|
<submit-btn></submit-btn>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Tea.context(function () {
|
||||||
|
this.success = NotifyReloadSuccess("保存成功")
|
||||||
|
})
|
||||||
@@ -35,17 +35,17 @@
|
|||||||
源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="isHTTP">
|
|
||||||
<td>专属域名</td>
|
|
||||||
<td>
|
|
||||||
<domains-box></domains-box>
|
|
||||||
<p class="comment">不为空时,指定的这些域名访问时当前源站才生效。</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr v-if="isHTTP">
|
||||||
|
<td>专属域名</td>
|
||||||
|
<td>
|
||||||
|
<domains-box></domains-box>
|
||||||
|
<p class="comment">默认不需要填写,表示支持所有域名。如果填写了专属域名,表示这些源站只会在这些域名被访问时才生效。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>权重</td>
|
<td>权重</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -36,17 +36,17 @@
|
|||||||
<p class="comment"><span class="red" v-if="addrError.length > 0">{{addrError}}</span>源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
<p class="comment"><span class="red" v-if="addrError.length > 0">{{addrError}}</span>源站服务器地址,通常是一个IP(或域名)加端口<span v-if="serverType == 'httpProxy'">,不需要加 http:// 或 https://</span>。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="isHTTP">
|
|
||||||
<td>专属域名</td>
|
|
||||||
<td>
|
|
||||||
<domains-box :v-domains="origin.domains"></domains-box>
|
|
||||||
<p class="comment">不为空时,指定的这些域名访问时当前源站才生效。</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tbody v-show="moreOptionsVisible">
|
<tbody v-show="moreOptionsVisible">
|
||||||
|
<tr v-if="isHTTP">
|
||||||
|
<td>专属域名</td>
|
||||||
|
<td>
|
||||||
|
<domains-box :v-domains="origin.domains"></domains-box>
|
||||||
|
<p class="comment">默认不需要填写,表示支持所有域名。如果填写了专属域名,表示这些源站只会在这些域名被访问时才生效。</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>权重</td>
|
<td>权重</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -47,6 +47,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="margin" style="margin-top: 2em"></div>
|
<div class="margin" style="margin-top: 2em"></div>
|
||||||
|
<a href="/setup" class="ui button" type="button" v-if="canInstall">重新安装</a>
|
||||||
<button class="ui button primary" type="submit" v-if="!isRequesting">确认</button>
|
<button class="ui button primary" type="submit" v-if="!isRequesting">确认</button>
|
||||||
<button class="ui button disabled" type="button" v-if="isRequesting">检查中...</button>
|
<button class="ui button disabled" type="button" v-if="isRequesting">检查中...</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<script type="text/javascript" src="/js/md5.min.js"></script>
|
<script type="text/javascript" src="/js/md5.min.js"></script>
|
||||||
<script type="text/javascript" src="/js/utils.js"></script>
|
<script type="text/javascript" src="/js/utils.js"></script>
|
||||||
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
<script type="text/javascript" src="/js/sweetalert2/dist/sweetalert2.all.min.js"></script>
|
||||||
<script type="text/javascript" src="/ui/components.js"></script>
|
<script type="text/javascript" src="/js/components.js"></script>
|
||||||
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
<link rel="stylesheet" href="/_/@default/@layout.css"/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user