mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 04:10:27 +08:00
阶段性提交
This commit is contained in:
203
internal/rpc/pb/model_node_ip_address.pb.go
Normal file
203
internal/rpc/pb/model_node_ip_address.pb.go
Normal file
@@ -0,0 +1,203 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.25.0
|
||||
// protoc v3.12.3
|
||||
// source: model_node_ip_address.proto
|
||||
|
||||
package pb
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type NodeIPAddress struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
NodeId int64 `protobuf:"varint,2,opt,name=nodeId,proto3" json:"nodeId,omitempty"`
|
||||
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
|
||||
Ip string `protobuf:"bytes,4,opt,name=ip,proto3" json:"ip,omitempty"`
|
||||
Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
|
||||
State int64 `protobuf:"varint,6,opt,name=state,proto3" json:"state,omitempty"`
|
||||
Order int64 `protobuf:"varint,7,opt,name=order,proto3" json:"order,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) Reset() {
|
||||
*x = NodeIPAddress{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_model_node_ip_address_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NodeIPAddress) ProtoMessage() {}
|
||||
|
||||
func (x *NodeIPAddress) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_model_node_ip_address_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NodeIPAddress.ProtoReflect.Descriptor instead.
|
||||
func (*NodeIPAddress) Descriptor() ([]byte, []int) {
|
||||
return file_model_node_ip_address_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetNodeId() int64 {
|
||||
if x != nil {
|
||||
return x.NodeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetName() string {
|
||||
if x != nil {
|
||||
return x.Name
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetIp() string {
|
||||
if x != nil {
|
||||
return x.Ip
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetDescription() string {
|
||||
if x != nil {
|
||||
return x.Description
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetState() int64 {
|
||||
if x != nil {
|
||||
return x.State
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NodeIPAddress) GetOrder() int64 {
|
||||
if x != nil {
|
||||
return x.Order
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_model_node_ip_address_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_model_node_ip_address_proto_rawDesc = []byte{
|
||||
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x70, 0x5f,
|
||||
0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
|
||||
0x62, 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x50, 0x41, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e,
|
||||
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,
|
||||
0x0e, 0x0a, 0x02, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12,
|
||||
0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
|
||||
0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a,
|
||||
0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_model_node_ip_address_proto_rawDescOnce sync.Once
|
||||
file_model_node_ip_address_proto_rawDescData = file_model_node_ip_address_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_model_node_ip_address_proto_rawDescGZIP() []byte {
|
||||
file_model_node_ip_address_proto_rawDescOnce.Do(func() {
|
||||
file_model_node_ip_address_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_ip_address_proto_rawDescData)
|
||||
})
|
||||
return file_model_node_ip_address_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_model_node_ip_address_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_model_node_ip_address_proto_goTypes = []interface{}{
|
||||
(*NodeIPAddress)(nil), // 0: pb.NodeIPAddress
|
||||
}
|
||||
var file_model_node_ip_address_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_model_node_ip_address_proto_init() }
|
||||
func file_model_node_ip_address_proto_init() {
|
||||
if File_model_node_ip_address_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_model_node_ip_address_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NodeIPAddress); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_model_node_ip_address_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_model_node_ip_address_proto_goTypes,
|
||||
DependencyIndexes: file_model_node_ip_address_proto_depIdxs,
|
||||
MessageInfos: file_model_node_ip_address_proto_msgTypes,
|
||||
}.Build()
|
||||
File_model_node_ip_address_proto = out.File
|
||||
file_model_node_ip_address_proto_rawDesc = nil
|
||||
file_model_node_ip_address_proto_goTypes = nil
|
||||
file_model_node_ip_address_proto_depIdxs = nil
|
||||
}
|
||||
1375
internal/rpc/pb/service_node_ip_address.pb.go
Normal file
1375
internal/rpc/pb/service_node_ip_address.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
97
internal/rpc/protos/service_node_ip_address.proto
Normal file
97
internal/rpc/protos/service_node_ip_address.proto
Normal file
@@ -0,0 +1,97 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "model_node_ip_address.proto";
|
||||
|
||||
service NodeIPAddressService {
|
||||
// 创建IP地址
|
||||
rpc createNodeIPAddress (CreateNodeIPAddressRequest) returns (CreateNodeIPAddressResponse);
|
||||
|
||||
// 修改IP地址
|
||||
rpc updateNodeIPAddress (UpdateNodeIPAddressRequest) returns (UpdateNodeIPAddressResponse);
|
||||
|
||||
// 修改IP地址所属节点
|
||||
rpc updateNodeIPAddressNodeId (UpdateNodeIPAddressNodeIdRequest) returns (UpdateNodeIPAddressNodeIdResponse);
|
||||
|
||||
// 禁用单个IP地址
|
||||
rpc disableNodeIPAddress (DisableNodeIPAddressRequest) returns (DisableNodeIPAddressResponse);
|
||||
|
||||
// 禁用节点的所有IP地址
|
||||
rpc disableAllIPAddressesWithNodeId (DisableAllIPAddressesWithNodeIdRequest) returns (DisableAllIPAddressesWithNodeIdResponse);
|
||||
|
||||
// 查找单个IP地址
|
||||
rpc findEnabledNodeIPAddress (FindEnabledNodeIPAddressRequest) returns (FindEnabledNodeIPAddressResponse);
|
||||
|
||||
// 查找节点的所有地址
|
||||
rpc findAllEnabledIPAddressesWithNodeId (FindAllEnabledIPAddressesWithNodeIdRequest) returns (FindAllEnabledIPAddressesWithNodeIdResponse);
|
||||
}
|
||||
|
||||
// 创建IP地址
|
||||
message CreateNodeIPAddressRequest {
|
||||
int64 nodeId = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
}
|
||||
|
||||
message CreateNodeIPAddressResponse {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
// 修改IP地址
|
||||
message UpdateNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
}
|
||||
|
||||
message UpdateNodeIPAddressResponse {
|
||||
|
||||
}
|
||||
|
||||
// 修改IP地址所属节点
|
||||
message UpdateNodeIPAddressNodeIdRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeId = 2;
|
||||
}
|
||||
|
||||
message UpdateNodeIPAddressNodeIdResponse {
|
||||
|
||||
}
|
||||
|
||||
// 禁用单个IP地址
|
||||
message DisableNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
message DisableNodeIPAddressResponse {
|
||||
|
||||
}
|
||||
|
||||
// 禁用节点的所有IP地址
|
||||
message DisableAllIPAddressesWithNodeIdRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message DisableAllIPAddressesWithNodeIdResponse {
|
||||
|
||||
}
|
||||
|
||||
// 查找单个IP地址
|
||||
message FindEnabledNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodeIPAddressResponse {
|
||||
NodeIPAddress ipAddress = 1;
|
||||
}
|
||||
|
||||
// 查找节点的所有地址
|
||||
message FindAllEnabledIPAddressesWithNodeIdRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message FindAllEnabledIPAddressesWithNodeIdResponse {
|
||||
repeated NodeIPAddress addresses = 1;
|
||||
}
|
||||
@@ -17,12 +17,13 @@ import (
|
||||
)
|
||||
|
||||
type RPCClient struct {
|
||||
apiConfig *configs.APIConfig
|
||||
adminClients []pb.AdminServiceClient
|
||||
nodeClients []pb.NodeServiceClient
|
||||
nodeGrantClients []pb.NodeGrantServiceClient
|
||||
nodeClusterClients []pb.NodeClusterServiceClient
|
||||
serverClients []pb.ServerServiceClient
|
||||
apiConfig *configs.APIConfig
|
||||
adminClients []pb.AdminServiceClient
|
||||
nodeClients []pb.NodeServiceClient
|
||||
nodeGrantClients []pb.NodeGrantServiceClient
|
||||
nodeClusterClients []pb.NodeClusterServiceClient
|
||||
nodeIPAddressClients []pb.NodeIPAddressServiceClient
|
||||
serverClients []pb.ServerServiceClient
|
||||
}
|
||||
|
||||
func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) {
|
||||
@@ -34,6 +35,7 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) {
|
||||
nodeClients := []pb.NodeServiceClient{}
|
||||
nodeGrantClients := []pb.NodeGrantServiceClient{}
|
||||
nodeClusterClients := []pb.NodeClusterServiceClient{}
|
||||
nodeIPAddressClients := []pb.NodeIPAddressServiceClient{}
|
||||
serverClients := []pb.ServerServiceClient{}
|
||||
|
||||
conns := []*grpc.ClientConn{}
|
||||
@@ -54,16 +56,18 @@ func NewRPCClient(apiConfig *configs.APIConfig) (*RPCClient, error) {
|
||||
nodeClients = append(nodeClients, pb.NewNodeServiceClient(conn))
|
||||
nodeGrantClients = append(nodeGrantClients, pb.NewNodeGrantServiceClient(conn))
|
||||
nodeClusterClients = append(nodeClusterClients, pb.NewNodeClusterServiceClient(conn))
|
||||
nodeIPAddressClients = append(nodeIPAddressClients, pb.NewNodeIPAddressServiceClient(conn))
|
||||
serverClients = append(serverClients, pb.NewServerServiceClient(conn))
|
||||
}
|
||||
|
||||
return &RPCClient{
|
||||
apiConfig: apiConfig,
|
||||
adminClients: adminClients,
|
||||
nodeClients: nodeClients,
|
||||
nodeGrantClients: nodeGrantClients,
|
||||
nodeClusterClients: nodeClusterClients,
|
||||
serverClients: serverClients,
|
||||
apiConfig: apiConfig,
|
||||
adminClients: adminClients,
|
||||
nodeClients: nodeClients,
|
||||
nodeGrantClients: nodeGrantClients,
|
||||
nodeClusterClients: nodeClusterClients,
|
||||
nodeIPAddressClients: nodeIPAddressClients,
|
||||
serverClients: serverClients,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -95,6 +99,13 @@ func (this *RPCClient) NodeClusterRPC() pb.NodeClusterServiceClient {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *RPCClient) NodeIPAddressRPC() pb.NodeIPAddressServiceClient {
|
||||
if len(this.nodeIPAddressClients) > 0 {
|
||||
return this.nodeIPAddressClients[rands.Int(0, len(this.nodeIPAddressClients)-1)]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (this *RPCClient) ServerRPC() pb.ServerServiceClient {
|
||||
if len(this.serverClients) > 0 {
|
||||
return this.serverClients[rands.Int(0, len(this.serverClients)-1)]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package nodes
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
@@ -38,11 +39,12 @@ func (this *CreateAction) RunGet(params struct{}) {
|
||||
}
|
||||
|
||||
func (this *CreateAction) RunPost(params struct {
|
||||
Name string
|
||||
ClusterId int64
|
||||
GrantId int64
|
||||
SshHost string
|
||||
SshPort int
|
||||
Name string
|
||||
IPAddresses string `alias:"ipAddresses"`
|
||||
ClusterId int64
|
||||
GrantId int64
|
||||
SshHost string
|
||||
SshPort int
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
@@ -68,7 +70,7 @@ func (this *CreateAction) RunPost(params struct {
|
||||
}
|
||||
|
||||
// 保存
|
||||
_, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
||||
createResp, err := this.RPC().NodeRPC().CreateNode(this.AdminContext(), &pb.CreateNodeRequest{
|
||||
Name: params.Name,
|
||||
ClusterId: params.ClusterId,
|
||||
Login: loginInfo,
|
||||
@@ -77,6 +79,26 @@ func (this *CreateAction) RunPost(params struct {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
nodeId := createResp.NodeId
|
||||
|
||||
// IP地址
|
||||
ipAddresses := []maps.Map{}
|
||||
err = json.Unmarshal([]byte(params.IPAddresses), &ipAddresses)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
for _, address := range ipAddresses {
|
||||
addressId := address.GetInt64("id")
|
||||
_, err = this.RPC().NodeIPAddressRPC().UpdateNodeIPAddressNodeId(this.AdminContext(), &pb.UpdateNodeIPAddressNodeIdRequest{
|
||||
AddressId: addressId,
|
||||
NodeId: nodeId,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
104
internal/web/actions/default/nodes/grants/updatePopup.go
Normal file
104
internal/web/actions/default/nodes/grants/updatePopup.go
Normal file
@@ -0,0 +1,104 @@
|
||||
package grants
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants/grantutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type UpdatePopupAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) RunGet(params struct {
|
||||
GrantId int64
|
||||
}) {
|
||||
this.Data["methods"] = grantutils.AllGrantMethods()
|
||||
|
||||
grantResp, err := this.RPC().NodeGrantRPC().FindEnabledGrant(this.AdminContext(), &pb.FindEnabledGrantRequest{GrantId: params.GrantId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
if grantResp.Grant == nil {
|
||||
this.WriteString("找不到要操作的对象")
|
||||
return
|
||||
}
|
||||
|
||||
grant := grantResp.Grant
|
||||
this.Data["grant"] = maps.Map{
|
||||
"id": grant.Id,
|
||||
"nodeId": grant.NodeId,
|
||||
"method": grant.Method,
|
||||
"name": grant.Name,
|
||||
"username": grant.Username,
|
||||
"password": grant.Password,
|
||||
"description": grant.Description,
|
||||
"privateKey": grant.PrivateKey,
|
||||
}
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) RunPost(params struct {
|
||||
GrantId int64
|
||||
NodeId int64
|
||||
Name string
|
||||
Method string
|
||||
Username string
|
||||
Password string
|
||||
PrivateKey string
|
||||
Description string
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
params.Must.
|
||||
Field("name", params.Name).
|
||||
Require("请输入名称")
|
||||
|
||||
switch params.Method {
|
||||
case "user":
|
||||
if len(params.Username) == 0 {
|
||||
this.FailField("username", "请输入SSH登录用户名")
|
||||
}
|
||||
case "privateKey":
|
||||
if len(params.PrivateKey) == 0 {
|
||||
this.FailField("privateKey", "请输入RSA私钥")
|
||||
}
|
||||
default:
|
||||
this.Fail("请选择正确的认证方式")
|
||||
}
|
||||
|
||||
// 执行修改
|
||||
_, err := this.RPC().NodeGrantRPC().UpdateNodeGrant(this.AdminContext(), &pb.UpdateNodeGrantRequest{
|
||||
GrantId: params.GrantId,
|
||||
Name: params.Name,
|
||||
Method: params.Method,
|
||||
Username: params.Username,
|
||||
Password: params.Password,
|
||||
PrivateKey: params.PrivateKey,
|
||||
Description: params.Description,
|
||||
NodeId: params.NodeId,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
// 返回信息
|
||||
this.Data["grant"] = maps.Map{
|
||||
"id": params.GrantId,
|
||||
"name": params.Name,
|
||||
"method": params.Method,
|
||||
"methodName": grantutils.FindGrantMethodName(params.Method),
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -14,7 +14,7 @@ func (this *Helper) BeforeAction(action *actions.ActionObject) {
|
||||
selectedTabbar, _ := action.Data["mainTab"]
|
||||
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("节点管理", "", "/nodes", "", selectedTabbar == "node")
|
||||
tabbar.Add("认证管理", "", "/nodes/grants", "", selectedTabbar == "grant")
|
||||
tabbar.Add("节点", "", "/nodes", "", selectedTabbar == "node")
|
||||
tabbar.Add("认证", "", "/nodes/grants", "", selectedTabbar == "grant")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
}
|
||||
|
||||
@@ -46,6 +46,21 @@ func (this *IndexAction) RunGet(params struct{}) {
|
||||
status.IsActive = time.Now().Unix()-status.UpdatedAt < 120 // 2分钟之内认为活跃
|
||||
}
|
||||
|
||||
// IP
|
||||
ipAddressesResp, err := this.RPC().NodeIPAddressRPC().FindAllEnabledIPAddressesWithNodeId(this.AdminContext(), &pb.FindAllEnabledIPAddressesWithNodeIdRequest{NodeId: node.Id})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
ipAddresses := []maps.Map{}
|
||||
for _, addr := range ipAddressesResp.Addresses {
|
||||
ipAddresses = append(ipAddresses, maps.Map{
|
||||
"id": addr.Id,
|
||||
"name": addr.Name,
|
||||
"ip": addr.Ip,
|
||||
})
|
||||
}
|
||||
|
||||
nodeMaps = append(nodeMaps, maps.Map{
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
@@ -62,6 +77,7 @@ func (this *IndexAction) RunGet(params struct{}) {
|
||||
"id": node.Cluster.Id,
|
||||
"name": node.Cluster.Name,
|
||||
},
|
||||
"ipAddresses": ipAddresses,
|
||||
})
|
||||
}
|
||||
this.Data["nodes"] = nodeMaps
|
||||
|
||||
@@ -2,6 +2,7 @@ package nodes
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/grants"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes/ipAddresses"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
@@ -18,6 +19,10 @@ func init() {
|
||||
GetPost("/update", new(UpdateAction)).
|
||||
Get("/node", new(NodeAction)).
|
||||
|
||||
// IP地址
|
||||
GetPost("/ipAddresses/createPopup", new(ipAddresses.CreatePopupAction)).
|
||||
GetPost("/ipAddresses/updatePopup", new(ipAddresses.UpdatePopupAction)).
|
||||
|
||||
// 授权管理
|
||||
Get("/grants", new(grants.IndexAction)).
|
||||
GetPost("/grants/create", new(grants.CreateAction)).
|
||||
@@ -26,6 +31,7 @@ func init() {
|
||||
Get("/grants/grant", new(grants.GrantAction)).
|
||||
GetPost("/grants/selectPopup", new(grants.SelectPopupAction)).
|
||||
GetPost("/grants/createPopup", new(grants.CreatePopupAction)).
|
||||
GetPost("/grants/updatePopup", new(grants.UpdatePopupAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package ipAddresses
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type CreatePopupAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *CreatePopupAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *CreatePopupAction) RunGet(params struct{}) {
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *CreatePopupAction) RunPost(params struct {
|
||||
IP string `alias:"ip"`
|
||||
Name string
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
// TODO 严格校验IP地址
|
||||
|
||||
params.Must.
|
||||
Field("ip", params.IP).
|
||||
Require("请输入IP地址")
|
||||
|
||||
resp, err := this.RPC().NodeIPAddressRPC().CreateNodeIPAddress(this.AdminContext(), &pb.CreateNodeIPAddressRequest{
|
||||
NodeId: 0,
|
||||
Name: params.Name,
|
||||
Ip: params.IP,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Data["ipAddress"] = maps.Map{
|
||||
"name": params.Name,
|
||||
"ip": params.IP,
|
||||
"id": resp.AddressId,
|
||||
}
|
||||
this.Success()
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package ipAddresses
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
|
||||
type UpdatePopupAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) Init() {
|
||||
this.Nav("", "", "")
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) RunGet(params struct {
|
||||
AddressId int64
|
||||
}) {
|
||||
addressResp, err := this.RPC().NodeIPAddressRPC().FindEnabledNodeIPAddress(this.AdminContext(), &pb.FindEnabledNodeIPAddressRequest{AddressId: params.AddressId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
address := addressResp.IpAddress
|
||||
if address == nil {
|
||||
this.WriteString("找不到要修改的IP地址")
|
||||
return
|
||||
}
|
||||
|
||||
this.Data["address"] = maps.Map{
|
||||
"id": address.Id,
|
||||
"name": address.Name,
|
||||
"ip": address.Ip,
|
||||
}
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *UpdatePopupAction) RunPost(params struct {
|
||||
AddressId int64
|
||||
IP string `alias:"ip"`
|
||||
Name string
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
// TODO 严格校验IP地址
|
||||
|
||||
params.Must.
|
||||
Field("ip", params.IP).
|
||||
Require("请输入IP地址")
|
||||
|
||||
_, err := this.RPC().NodeIPAddressRPC().UpdateNodeIPAddress(this.AdminContext(), &pb.UpdateNodeIPAddressRequest{
|
||||
AddressId: params.AddressId,
|
||||
Name: params.Name,
|
||||
Ip: params.IP,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Data["ipAddress"] = maps.Map{
|
||||
"name": params.Name,
|
||||
"ip": params.IP,
|
||||
"id": params.AddressId,
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
@@ -40,6 +40,22 @@ func (this *NodeAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
// IP地址
|
||||
ipAddressesResp, err := this.RPC().NodeIPAddressRPC().FindAllEnabledIPAddressesWithNodeId(this.AdminContext(), &pb.FindAllEnabledIPAddressesWithNodeIdRequest{NodeId: params.NodeId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
ipAddressMaps := []maps.Map{}
|
||||
for _, addr := range ipAddressesResp.Addresses {
|
||||
ipAddressMaps = append(ipAddressMaps, maps.Map{
|
||||
"id": addr.Id,
|
||||
"name": addr.Name,
|
||||
"ip": addr.Ip,
|
||||
})
|
||||
}
|
||||
|
||||
// 登录信息
|
||||
var loginMap maps.Map = nil
|
||||
if node.Login != nil {
|
||||
loginParams := maps.Map{}
|
||||
@@ -79,10 +95,11 @@ func (this *NodeAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
this.Data["node"] = maps.Map{
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
"cluster": clusterMap,
|
||||
"login": loginMap,
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
"ipAddresses": ipAddressMaps,
|
||||
"cluster": clusterMap,
|
||||
"login": loginMap,
|
||||
}
|
||||
|
||||
this.Show()
|
||||
|
||||
@@ -41,6 +41,22 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
// IP地址
|
||||
ipAddressesResp, err := this.RPC().NodeIPAddressRPC().FindAllEnabledIPAddressesWithNodeId(this.AdminContext(), &pb.FindAllEnabledIPAddressesWithNodeIdRequest{NodeId: params.NodeId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
ipAddressMaps := []maps.Map{}
|
||||
for _, addr := range ipAddressesResp.Addresses {
|
||||
ipAddressMaps = append(ipAddressMaps, maps.Map{
|
||||
"id": addr.Id,
|
||||
"name": addr.Name,
|
||||
"ip": addr.Ip,
|
||||
})
|
||||
}
|
||||
|
||||
// 登录信息
|
||||
var loginMap maps.Map = nil
|
||||
if node.Login != nil {
|
||||
loginParams := maps.Map{}
|
||||
@@ -80,10 +96,11 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
this.Data["node"] = maps.Map{
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
"cluster": clusterMap,
|
||||
"login": loginMap,
|
||||
"id": node.Id,
|
||||
"name": node.Name,
|
||||
"ipAddresses": ipAddressMaps,
|
||||
"cluster": clusterMap,
|
||||
"login": loginMap,
|
||||
}
|
||||
|
||||
// 所有集群
|
||||
@@ -108,13 +125,14 @@ func (this *UpdateAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
func (this *UpdateAction) RunPost(params struct {
|
||||
LoginId int64
|
||||
NodeId int64
|
||||
Name string
|
||||
ClusterId int64
|
||||
GrantId int64
|
||||
SshHost string
|
||||
SshPort int
|
||||
LoginId int64
|
||||
NodeId int64
|
||||
Name string
|
||||
IPAddresses string `alias:"ipAddresses"`
|
||||
ClusterId int64
|
||||
GrantId int64
|
||||
SshHost string
|
||||
SshPort int
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
@@ -155,5 +173,31 @@ func (this *UpdateAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
// 禁用老的IP地址
|
||||
_, err = this.RPC().NodeIPAddressRPC().DisableAllIPAddressesWithNodeId(this.AdminContext(), &pb.DisableAllIPAddressesWithNodeIdRequest{NodeId: params.NodeId})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
// 添加新的IP地址
|
||||
ipAddresses := []maps.Map{}
|
||||
err = json.Unmarshal([]byte(params.IPAddresses), &ipAddresses)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
for _, address := range ipAddresses {
|
||||
addressId := address.GetInt64("id")
|
||||
_, err = this.RPC().NodeIPAddressRPC().UpdateNodeIPAddressNodeId(this.AdminContext(), &pb.UpdateNodeIPAddressNodeIdRequest{
|
||||
AddressId: addressId,
|
||||
NodeId: params.NodeId,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
24
internal/web/actions/default/servers/components/helper.go
Normal file
24
internal/web/actions/default/servers/components/helper.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package components
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
type Helper struct {
|
||||
}
|
||||
|
||||
func NewHelper() *Helper {
|
||||
return &Helper{}
|
||||
}
|
||||
|
||||
func (this *Helper) BeforeAction(action *actions.ActionObject) {
|
||||
action.Data["teaMenu"] = "servers"
|
||||
|
||||
selectedTabbar, _ := action.Data["mainTab"]
|
||||
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("服务", "", "/servers", "", selectedTabbar == "server")
|
||||
tabbar.Add("组件", "", "/servers/components", "", selectedTabbar == "component")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
}
|
||||
18
internal/web/actions/default/servers/components/index.go
Normal file
18
internal/web/actions/default/servers/components/index.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package components
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "component", "index")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
|
||||
this.Show()
|
||||
}
|
||||
17
internal/web/actions/default/servers/components/init.go
Normal file
17
internal/web/actions/default/servers/components/init.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package components
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(NewHelper()).
|
||||
Prefix("/servers/components").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -18,6 +18,7 @@ func (this *Helper) BeforeAction(action *actions.ActionObject) {
|
||||
selectedTabbar, _ := action.Data["mainTab"]
|
||||
|
||||
tabbar := actionutils.NewTabbar()
|
||||
tabbar.Add("服务管理", "", "/servers", "", selectedTabbar == "server")
|
||||
tabbar.Add("服务", "", "/servers", "", selectedTabbar == "server")
|
||||
tabbar.Add("组件", "", "/servers/components", "", selectedTabbar == "component")
|
||||
actionutils.SetTabbar(action, tabbar)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ type IndexAction struct {
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "board", "")
|
||||
this.SecondMenu("index")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
|
||||
@@ -8,6 +8,7 @@ type IndexAction struct {
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "delete", "")
|
||||
this.SecondMenu("index")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
|
||||
@@ -8,6 +8,7 @@ type IndexAction struct {
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "log", "")
|
||||
this.SecondMenu("index")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package access
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("access")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package access
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/access").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package accessLog
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("accessLog")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package accessLog
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/accessLog").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
22
internal/web/actions/default/servers/server/settings/cache/index.go
vendored
Normal file
22
internal/web/actions/default/servers/server/settings/cache/index.go
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("cache")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
18
internal/web/actions/default/servers/server/settings/cache/init.go
vendored
Normal file
18
internal/web/actions/default/servers/server/settings/cache/init.go
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package cache
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/cache").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package charset
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("charset")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package charset
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/charset").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package gzip
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("gzip")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package gzip
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/gzip").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package headers
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("header")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package headers
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/headers").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package server
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
@@ -16,5 +16,7 @@ func (this *IndexAction) Init() {
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package server
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
||||
@@ -11,7 +11,7 @@ func init() {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/http").
|
||||
Prefix("/servers/server/settings/http").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package https
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("https")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package https
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/https").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package locations
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("locations")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package locations
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/locations").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("pages")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package pages
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/pages").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package reverseProxy
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("reverseProxy")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package reverseProxy
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/reverseProxy").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package stat
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("stat")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package stat
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/stat").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("tcp")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package tcp
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/tcp").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package udp
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("udp")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package udp
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/udp").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package unix
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("unix")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package unix
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/unix").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package waf
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("waf")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package waf
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/waf").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "setting", "index")
|
||||
this.SecondMenu("web")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
ServerId int64
|
||||
}) {
|
||||
// TODO
|
||||
|
||||
this.Show()
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"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()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Prefix("/servers/server/settings/web").
|
||||
Get("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -8,6 +8,7 @@ type IndexAction struct {
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
this.Nav("", "stat", "")
|
||||
this.SecondMenu("index")
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct{}) {
|
||||
|
||||
@@ -83,18 +83,52 @@ func (this *ServerHelper) createLeftMenu(action *actions.ActionObject) {
|
||||
// 左侧操作子菜单
|
||||
switch types.String(mainTab) {
|
||||
case "board":
|
||||
// TODO
|
||||
action.Data["leftMenuItems"] = this.createBoardMenu(types.String(secondMenuItem), serverIdString, serverConfig)
|
||||
case "log":
|
||||
// TODO
|
||||
action.Data["leftMenuItems"] = this.createLogMenu(types.String(secondMenuItem), serverIdString, serverConfig)
|
||||
case "stat":
|
||||
// TODO
|
||||
action.Data["leftMenuItems"] = this.createStatMenu(types.String(secondMenuItem), serverIdString, serverConfig)
|
||||
case "setting":
|
||||
action.Data["leftMenuItems"] = this.createSettingsMenu(types.String(secondMenuItem), serverIdString, serverConfig)
|
||||
case "delete":
|
||||
// TODO
|
||||
action.Data["leftMenuItems"] = this.createDeleteMenu(types.String(secondMenuItem), serverIdString, serverConfig)
|
||||
}
|
||||
}
|
||||
|
||||
// 看板菜单
|
||||
func (this *ServerHelper) createBoardMenu(secondMenuItem string, serverIdString string, serverConfig *serverconfigs.ServerConfig) []maps.Map {
|
||||
menuItems := []maps.Map{}
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "看板",
|
||||
"url": "/servers/server/board?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "index",
|
||||
})
|
||||
return menuItems
|
||||
}
|
||||
|
||||
// 日志菜单
|
||||
func (this *ServerHelper) createLogMenu(secondMenuItem string, serverIdString string, serverConfig *serverconfigs.ServerConfig) []maps.Map {
|
||||
menuItems := []maps.Map{}
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "实时",
|
||||
"url": "/servers/server/log?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "index",
|
||||
})
|
||||
return menuItems
|
||||
}
|
||||
|
||||
// 统计菜单
|
||||
func (this *ServerHelper) createStatMenu(secondMenuItem string, serverIdString string, serverConfig *serverconfigs.ServerConfig) []maps.Map {
|
||||
menuItems := []maps.Map{}
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "统计",
|
||||
"url": "/servers/server/stat?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "index",
|
||||
})
|
||||
return menuItems
|
||||
}
|
||||
|
||||
// 设置菜单
|
||||
func (this *ServerHelper) createSettingsMenu(secondMenuItem string, serverIdString string, serverConfig *serverconfigs.ServerConfig) (items []maps.Map) {
|
||||
menuItems := []maps.Map{
|
||||
{
|
||||
@@ -108,105 +142,122 @@ func (this *ServerHelper) createSettingsMenu(secondMenuItem string, serverIdStri
|
||||
if serverConfig.IsHTTP() {
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "HTTP",
|
||||
"url": "/servers/server/http?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/http?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "http",
|
||||
})
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "HTTPS",
|
||||
"url": "/servers/server/https?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/https?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "https",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "Web设置",
|
||||
"url": "/servers/server/web?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/web?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "web",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "字符集",
|
||||
"url": "/servers/server/charset?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "charset",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "访问日志",
|
||||
"url": "/servers/server/accessLog?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "accessLog",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "统计",
|
||||
"url": "/servers/server/stat?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "stat",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "Gzip压缩",
|
||||
"url": "/servers/server/gzip?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "gzip",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "特殊页面",
|
||||
"url": "/servers/server/pages?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "pages",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "HTTP Header",
|
||||
"url": "/servers/server/headers?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "header",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "反向代理",
|
||||
"url": "/servers/server/reverseProxy?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/reverseProxy?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "reverseProxy",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "路径规则",
|
||||
"url": "/servers/server/locations?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/locations?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "locations",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "访问控制",
|
||||
"url": "/servers/server/access?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/access?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "access",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "WAF",
|
||||
"url": "/servers/server/waf?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/waf?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "waf",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "缓存",
|
||||
"url": "/servers/server/cache?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/cache?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "cache",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "-",
|
||||
"url": "",
|
||||
"isActive": false,
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "字符集",
|
||||
"url": "/servers/server/settings/charset?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "charset",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "访问日志",
|
||||
"url": "/servers/server/settings/accessLog?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "accessLog",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "统计",
|
||||
"url": "/servers/server/settings/stat?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "stat",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "Gzip压缩",
|
||||
"url": "/servers/server/settings/gzip?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "gzip",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "特殊页面",
|
||||
"url": "/servers/server/settings/pages?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "pages",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "HTTP Header",
|
||||
"url": "/servers/server/settings/headers?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "header",
|
||||
})
|
||||
} else if serverConfig.IsTCP() {
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "TCP",
|
||||
"url": "/servers/server/tcp?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/tcp?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "tcp",
|
||||
})
|
||||
} else if serverConfig.IsUnix() {
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "Unix",
|
||||
"url": "/servers/server/unix?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/unix?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "unix",
|
||||
})
|
||||
} else if serverConfig.IsUDP() {
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "UDP",
|
||||
"url": "/servers/server/udp?serverId=" + serverIdString,
|
||||
"url": "/servers/server/settings/udp?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "udp",
|
||||
})
|
||||
}
|
||||
|
||||
return menuItems
|
||||
}
|
||||
|
||||
// 删除菜单
|
||||
func (this *ServerHelper) createDeleteMenu(secondMenuItem string, serverIdString string, serverConfig *serverconfigs.ServerConfig) []maps.Map {
|
||||
menuItems := []maps.Map{}
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "删除",
|
||||
"url": "/servers/server/delete?serverId=" + serverIdString,
|
||||
"isActive": secondMenuItem == "index",
|
||||
})
|
||||
return menuItems
|
||||
}
|
||||
|
||||
@@ -7,12 +7,29 @@ import (
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/logout"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/nodes"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/components"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/board"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/delete"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/log"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/access"
|
||||
_ "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/charset"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/gzip"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/headers"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/http"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/https"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/pages"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/reverseProxy"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/stat"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/tcp"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/udp"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/unix"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/waf"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/web"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/stat"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/settings"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/ui"
|
||||
|
||||
@@ -13,10 +13,21 @@
|
||||
<tr>
|
||||
<td>IP地址</td>
|
||||
<td>
|
||||
<div>
|
||||
<input type="hidden" name="ipAddresses" :value="JSON.stringify(ipAddresses)"/>
|
||||
<div v-if="ipAddresses.length > 0">
|
||||
<div>
|
||||
<div v-for="(address, index) in ipAddresses" class="ui label small">
|
||||
{{address.ip}}<span class="small">({{address.name}})</span>
|
||||
<a href="" title="修改" @click.prevent="updateIPAddress(index, address)"><i class="icon pencil small"></i></a>
|
||||
<a href="" title="删除" @click.prevent="removeIPAddress(index)"><i class="icon remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
</div>
|
||||
<p class="comment">已经绑定的IP地址。</p>
|
||||
<div>
|
||||
<button class="ui button small" type="button" @click.prevent="addIPAddress()">+</button>
|
||||
</div>
|
||||
<p class="comment">添加已经绑定的IP地址,仅做记录用。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -38,13 +49,13 @@
|
||||
<td>SSH主机端口</td>
|
||||
<td>
|
||||
<input type="text" name="sshPort" maxlength="5"/>
|
||||
<p class="comment">比如22。</p>
|
||||
<p class="comment">常见的比如22。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH登录认证</td>
|
||||
<td>
|
||||
<div class="ui label small" v-if="grant != null">{{grant.name}}<span class="small">({{grant.methodName}})</span> <a href="" title="删除" @click.prevent="removeGrant()"><i class="icon remove"></i></a> </div>
|
||||
<div class="ui label small" v-if="grant != null">{{grant.name}}<span class="small">({{grant.methodName}})</span> <a href="" title="修改" @click.prevent="updateGrant()"><i class="icon pencil small"></i></a> <a href="" title="删除" @click.prevent="removeGrant()"><i class="icon remove"></i></a> </div>
|
||||
<div v-if="grant == null">
|
||||
<a href="" @click.prevent="selectGrant()">[选择已有认证]</a> <a href="" @click.prevent="createGrant()">[添加新认证]</a>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,37 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifySuccess("保存成功", "/nodes");
|
||||
|
||||
// IP地址相关
|
||||
this.ipAddresses = [];
|
||||
|
||||
// 添加IP地址
|
||||
this.addIPAddress = function () {
|
||||
teaweb.popup("/nodes/ipAddresses/createPopup", {
|
||||
callback: function (resp) {
|
||||
this.ipAddresses.push(resp.data.ipAddress);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// 修改地址
|
||||
this.updateIPAddress = function (index, address) {
|
||||
teaweb.popup("/nodes/ipAddresses/updatePopup?addressId=" + address.id, {
|
||||
callback: function (resp) {
|
||||
Vue.set(this.ipAddresses, index, resp.data.ipAddress);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除IP地址
|
||||
this.removeIPAddress = function (index) {
|
||||
this.ipAddresses.$remove(index);
|
||||
};
|
||||
|
||||
// 授权相关
|
||||
this.grantId = 0;
|
||||
this.grant = null;
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/nodes");
|
||||
|
||||
// 选择授权
|
||||
this.selectGrant = function () {
|
||||
var that = this;
|
||||
teaweb.popup("/nodes/grants/selectPopup", {
|
||||
@@ -16,19 +44,34 @@ Tea.context(function () {
|
||||
});
|
||||
};
|
||||
|
||||
// 创建授权
|
||||
this.createGrant = function () {
|
||||
var that = this;
|
||||
teaweb.popup("/nodes/grants/createPopup", {
|
||||
height: "31em",
|
||||
callback: function (resp) {
|
||||
that.grantId = resp.data.grant.id;
|
||||
if (that.grantId > 0) {
|
||||
that.grant = resp.data.grant;
|
||||
this.grantId = resp.data.grant.id;
|
||||
if (this.grantId > 0) {
|
||||
this.grant = resp.data.grant;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// 修改授权
|
||||
this.updateGrant = function () {
|
||||
if (this.grant == null) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
teaweb.popup("/nodes/grants/updatePopup?grantId=" + this.grant.id, {
|
||||
height: "31em",
|
||||
callback: function (resp) {
|
||||
this.grant = resp.data.grant;
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// 删除已选择授权
|
||||
this.removeGrant = function () {
|
||||
this.grant = null;
|
||||
this.grantId = 0;
|
||||
|
||||
@@ -47,11 +47,17 @@
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea name="description" rows="3"></textarea>
|
||||
</td>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-if="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea name="description" rows="3"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
65
web/views/@default/nodes/grants/updatePopup.html
Normal file
65
web/views/@default/nodes/grants/updatePopup.html
Normal file
@@ -0,0 +1,65 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改认证</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="grantId" :value="grant.id"/>
|
||||
<input type="hidden" name="nodeId" :value="grant.nodeId"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td>名称 *</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus" value="" v-model="grant.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="title">认证方式</td>
|
||||
<td>
|
||||
<select class="ui dropdown" style="width:10em" name="method" v-model="method">
|
||||
<option v-for="method in methods" :value="method.value">{{method.name}}</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 用户名/密码 -->
|
||||
<tbody v-if="method == 'user'">
|
||||
<tr>
|
||||
<td>SSH用户名 *</td>
|
||||
<td>
|
||||
<input type="text" name="username" maxlength="100" v-model="grant.username"/>
|
||||
<p class="comment">SSH登录用户名。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>SSH密码</td>
|
||||
<td><input type="password" name="password" maxlength="100" v-model="grant.password"/>
|
||||
<p class="comment">SSH登录用户密码。</p> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<!-- 私钥 -->
|
||||
<tbody v-if="method == 'privateKey'">
|
||||
<tr>
|
||||
<td>RSA私钥 *</td>
|
||||
<td>
|
||||
<textarea name="privateKey" v-model="grant.privateKey"></textarea>
|
||||
<p class="comment">用来生成登录SSH公钥的私钥</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><more-options-indicator></more-options-indicator></td>
|
||||
</tr>
|
||||
|
||||
<tbody v-if="moreOptionsVisible">
|
||||
<tr>
|
||||
<td>描述</td>
|
||||
<td>
|
||||
<textarea name="description" rows="3" v-model="grant.description"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
5
web/views/@default/nodes/grants/updatePopup.js
Normal file
5
web/views/@default/nodes/grants/updatePopup.js
Normal file
@@ -0,0 +1,5 @@
|
||||
Tea.context(function () {
|
||||
this.method = this.grant.method;
|
||||
|
||||
this.success = NotifyPopup;
|
||||
});
|
||||
5
web/views/@default/nodes/index.css
Normal file
5
web/views/@default/nodes/index.css
Normal file
@@ -0,0 +1,5 @@
|
||||
.address-box .label {
|
||||
display: block;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
1
web/views/@default/nodes/index.css.map
Normal file
1
web/views/@default/nodes/index.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,YACC;EACC,cAAA;EACA,oBAAA","file":"index.css"}
|
||||
@@ -9,7 +9,7 @@
|
||||
<th>ID</th>
|
||||
<th>节点名称</th>
|
||||
<th>主机名</th>
|
||||
<!--<th>IP</th>-->
|
||||
<th>IP</th>
|
||||
<th>所属集群</th>
|
||||
<th>状态</th>
|
||||
<th>CPU</th>
|
||||
@@ -26,9 +26,16 @@
|
||||
<span v-if="node.status.hostname != null && node.status.hostname.length > 0">{{node.status.hostname}}</span>
|
||||
<span v-else>-</span>
|
||||
</td>
|
||||
<td>
|
||||
<span v-if="node.ipAddresses.length == 0">-</span>
|
||||
<div v-else class="address-box">
|
||||
<div v-for="addr in node.ipAddresses" class="ui label small">{{addr.ip}} <span class="small">({{addr.name}})</span></div>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{node.cluster.name}}</td>
|
||||
<td>
|
||||
<span v-if="node.status.isActive"><span class="green">运行中</span></span>
|
||||
<span v-else-if="node.status.updatedAt > 0" class="red">已断开</span>
|
||||
<span v-else-if="node.status.updatedAt == 0" class="red">未连接</span>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
6
web/views/@default/nodes/index.less
Normal file
6
web/views/@default/nodes/index.less
Normal file
@@ -0,0 +1,6 @@
|
||||
.address-box {
|
||||
.label {
|
||||
display: block;
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
}
|
||||
21
web/views/@default/nodes/ipAddresses/createPopup.html
Normal file
21
web/views/@default/nodes/ipAddresses/createPopup.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加IP地址</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>IP地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="ip" maxlength="128" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">简介</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="50"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
3
web/views/@default/nodes/ipAddresses/createPopup.js
Normal file
3
web/views/@default/nodes/ipAddresses/createPopup.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function (){
|
||||
this.success = NotifyPopup;
|
||||
});
|
||||
22
web/views/@default/nodes/ipAddresses/updatePopup.html
Normal file
22
web/views/@default/nodes/ipAddresses/updatePopup.html
Normal file
@@ -0,0 +1,22 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改IP地址</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="addressId" :value="address.id"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>IP地址 *</td>
|
||||
<td>
|
||||
<input type="text" name="ip" maxlength="128" ref="focus" v-model="address.ip"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">简介</td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="50" v-model="address.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
3
web/views/@default/nodes/ipAddresses/updatePopup.js
Normal file
3
web/views/@default/nodes/ipAddresses/updatePopup.js
Normal file
@@ -0,0 +1,3 @@
|
||||
Tea.context(function (){
|
||||
this.success = NotifyPopup;
|
||||
});
|
||||
@@ -10,6 +10,21 @@
|
||||
<td class="title">节点名称</td>
|
||||
<td>{{node.name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP地址</td>
|
||||
<td>
|
||||
<div v-if="node.ipAddresses.length > 0">
|
||||
<div>
|
||||
<div v-for="(address, index) in node.ipAddresses" class="ui label small">
|
||||
{{address.ip}}<span class="small">({{address.name}})</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span class="disabled">暂时还没有填写IP地址。</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属集群</td>
|
||||
<td>
|
||||
|
||||
@@ -18,6 +18,26 @@
|
||||
<input type="text" name="name" maxlength="50" ref="focus" v-model="node.name"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>IP地址</td>
|
||||
<td>
|
||||
<input type="hidden" name="ipAddresses" :value="JSON.stringify(ipAddresses)"/>
|
||||
<div v-if="ipAddresses.length > 0">
|
||||
<div>
|
||||
<div v-for="(address, index) in ipAddresses" class="ui label small">
|
||||
{{address.ip}}<span class="small">({{address.name}})</span>
|
||||
<a href="" title="修改" @click.prevent="updateIPAddress(index, address)"><i class="icon pencil small"></i></a>
|
||||
<a href="" title="删除" @click.prevent="removeIPAddress(index)"><i class="icon remove"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui divider"></div>
|
||||
</div>
|
||||
<div>
|
||||
<button class="ui button small" type="button" @click.prevent="addIPAddress()">+</button>
|
||||
</div>
|
||||
<p class="comment">添加已经绑定的IP地址,仅做记录用。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>所属集群</td>
|
||||
<td>
|
||||
@@ -43,7 +63,7 @@
|
||||
<tr>
|
||||
<td>SSH登录认证</td>
|
||||
<td>
|
||||
<div class="ui label small" v-if="grant != null && grant.id != null">{{grant.name}}<span class="small">({{grant.methodName}})</span> <a href="" title="删除" @click.prevent="removeGrant()"><i class="icon remove"></i></a> </div>
|
||||
<div class="ui label small" v-if="grant != null && grant.id != null">{{grant.name}}<span class="small">({{grant.methodName}})</span> <a href="" title="修改" @click.prevent="updateGrant()"><i class="icon pencil small"></i></a> <a href="" title="删除" @click.prevent="removeGrant()"><i class="icon remove"></i></a> </div>
|
||||
<div v-else>
|
||||
<a href="" @click.prevent="selectGrant()">[选择已有认证]</a> <a href="" @click.prevent="createGrant()">[添加新认证]</a>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,41 @@
|
||||
Tea.context(function () {
|
||||
this.grantId = 0;
|
||||
this.grant = null;
|
||||
|
||||
|
||||
this.clusterId = 0;
|
||||
if (this.node.cluster != null && this.node.cluster.id > 0) {
|
||||
this.clusterId = this.node.cluster.id;
|
||||
}
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/nodes/node?nodeId=" + this.node.id);
|
||||
|
||||
// IP地址相关
|
||||
this.ipAddresses = this.node.ipAddresses;
|
||||
|
||||
// 添加IP地址
|
||||
this.addIPAddress = function () {
|
||||
teaweb.popup("/nodes/ipAddresses/createPopup", {
|
||||
callback: function (resp) {
|
||||
this.ipAddresses.push(resp.data.ipAddress);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
// 修改地址
|
||||
this.updateIPAddress = function (index, address) {
|
||||
teaweb.popup("/nodes/ipAddresses/updatePopup?addressId=" + address.id, {
|
||||
callback: function (resp) {
|
||||
Vue.set(this.ipAddresses, index, resp.data.ipAddress);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除IP地址
|
||||
this.removeIPAddress = function (index) {
|
||||
this.ipAddresses.$remove(index);
|
||||
};
|
||||
|
||||
// 认证相关
|
||||
this.grantId = 0;
|
||||
this.grant = null;
|
||||
|
||||
this.sshHost = "";
|
||||
this.sshPort = "";
|
||||
this.loginId = 0;
|
||||
@@ -30,8 +58,6 @@ Tea.context(function () {
|
||||
}
|
||||
}
|
||||
|
||||
this.success = NotifySuccess("保存成功", "/nodes/node?nodeId=" + this.node.id);
|
||||
|
||||
this.selectGrant = function () {
|
||||
var that = this;
|
||||
teaweb.popup("/nodes/grants/selectPopup", {
|
||||
@@ -44,6 +70,20 @@ Tea.context(function () {
|
||||
});
|
||||
};
|
||||
|
||||
// 修改授权
|
||||
this.updateGrant = function () {
|
||||
if (this.grant == null) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
teaweb.popup("/nodes/grants/updatePopup?grantId=" + this.grant.id, {
|
||||
height: "31em",
|
||||
callback: function (resp) {
|
||||
this.grant = resp.data.grant;
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
this.createGrant = function () {
|
||||
var that = this;
|
||||
teaweb.popup("/nodes/grants/createPopup", {
|
||||
|
||||
3
web/views/@default/servers/components/index.html
Normal file
3
web/views/@default/servers/components/index.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{$layout}
|
||||
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
<div class="left-box">
|
||||
<div class="ui menu text blue vertical small">
|
||||
<a class="item" v-for="item in leftMenuItems" :href="item.url" :class="{active:item.isActive}"><i class="icon play tiny" :style="{'visibility':item.isActive ? 'visible' : 'hidden'}"></i>{{item.name}}</a>
|
||||
<a class="item" v-for="item in leftMenuItems" :href="item.url" :class="{active:item.isActive, separator:item.name == '-'}">
|
||||
<span v-if="item.name != '-'"><i class="icon play tiny" :style="{'visibility':item.isActive ? 'visible' : 'hidden'}"></i>{{item.name}}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,8 +23,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
/** .header需要在.item下面 **/
|
||||
.item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
// .header需要在.item下面
|
||||
.header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;ACzCD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;AChDD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
{$template "/servers/server/left_menu"}
|
||||
<div class="right-box">
|
||||
<div class="ui message">此功能暂未实现,敬请期待。</div>
|
||||
<div class="ui message">此功能暂未开放,敬请期待。</div>
|
||||
</div>
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;ACzCD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;AChDD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
{$template "/servers/server/left_menu"}
|
||||
<div class="right-box">
|
||||
<div class="ui message">此功能暂未实现,敬请期待。</div>
|
||||
<div class="ui message">此功能暂未开放,敬请期待。</div>
|
||||
</div>
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;ACzCD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
{"version":3,"sources":["@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;AChDD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;ACzCD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less","index.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA;;AChDD,MAAO;EACN,6BAAA","file":"index.css"}
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
{$template "/servers/server/left_menu"}
|
||||
<div class="right-box">
|
||||
<div class="ui message">此功能暂未实现,敬请期待。</div>
|
||||
<div class="ui message">此功能暂未开放,敬请期待。</div>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
.left-box {
|
||||
width: 8em;
|
||||
position: fixed;
|
||||
top: 8em;
|
||||
top: 7.5em;
|
||||
bottom: 0.5em;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/settings/@left_menu.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,QAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA","file":"index.css"}
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA","file":"index.css"}
|
||||
@@ -1,7 +1,7 @@
|
||||
{$layout}
|
||||
|
||||
{$template "../left_menu"}
|
||||
{$template "/servers/server/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<p class="ui message">此功能暂未实现,敬请期待。</p>
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
</div>
|
||||
@@ -1 +1 @@
|
||||
@import "../@left_menu";
|
||||
@import "../../@left_menu";
|
||||
@@ -0,0 +1,42 @@
|
||||
.left-box {
|
||||
width: 8em;
|
||||
position: fixed;
|
||||
top: 7.5em;
|
||||
bottom: 0.5em;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
border-right: 1px #ddd solid;
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
position: relative;
|
||||
padding-left: 1em !important;
|
||||
}
|
||||
.left-box .menu .item .icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
padding-bottom: 1em !important;
|
||||
}
|
||||
.left-box::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.right-box {
|
||||
margin-left: 9em;
|
||||
}
|
||||
/*# sourceMappingURL=index.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA","file":"index.css"}
|
||||
@@ -0,0 +1,7 @@
|
||||
{$layout}
|
||||
|
||||
{$template "/servers/server/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
@import "../../@left_menu";
|
||||
@@ -1,7 +1,7 @@
|
||||
.left-box {
|
||||
width: 8em;
|
||||
position: fixed;
|
||||
top: 8em;
|
||||
top: 7.5em;
|
||||
bottom: 0.5em;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/settings/@left_menu.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,QAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAkBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA","file":"index.css"}
|
||||
{"version":3,"sources":["/Users/liuxiangchao/Documents/projects/Edge/EdgeAdmin/web/views/@default/servers/server/@left_menu.less"],"names":[],"mappings":"AAAA;EACC,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAPD,SASC;EACC,qBAAA;;AAVF,SASC,MAGC;EACC,gBAAA;EACA,kBAAA;EACA,4BAAA;;AAfH,SASC,MAGC,MAKC;EACC,kBAAA;EACA,QAAA;EACA,OAAA;EACA,kBAAA;;AArBJ,SASC,MAgBC,MAAK;EACJ,wCAAA;EACA,cAAA;EACA,iBAAA;EACA,wBAAA;EACA,2BAAA;;AA9BH,SASC,MAyBC;EACC,6BAAA;EACA,0BAAA;EACA,8BAAA;;AAQH,SAAS;EACR,UAAA;;AAGD;EACC,gBAAA","file":"index.css"}
|
||||
@@ -1,7 +1,7 @@
|
||||
{$layout}
|
||||
|
||||
{$template "../left_menu"}
|
||||
{$template "/servers/server/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
<p class="ui message">此功能暂未实现,敬请期待。</p>
|
||||
<p class="ui message">此功能暂未开放,敬请期待。</p>
|
||||
</div>
|
||||
@@ -1 +1 @@
|
||||
@import "../@left_menu";
|
||||
@import "../../@left_menu";
|
||||
@@ -1,7 +1,7 @@
|
||||
.left-box {
|
||||
width: 8em;
|
||||
position: fixed;
|
||||
top: 8em;
|
||||
top: 7.5em;
|
||||
bottom: 0.5em;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
@@ -9,7 +9,6 @@
|
||||
}
|
||||
.left-box .menu {
|
||||
width: 90% !important;
|
||||
/** .header需要在.item下面 **/
|
||||
}
|
||||
.left-box .menu .item {
|
||||
line-height: 1.2;
|
||||
@@ -22,6 +21,13 @@
|
||||
left: 0;
|
||||
margin-top: -0.4em !important;
|
||||
}
|
||||
.left-box .menu .item.separator {
|
||||
border-bottom: 1px #eee solid !important;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
.left-box .menu .header {
|
||||
border-bottom: 1px #ddd solid;
|
||||
padding-left: 0 !important;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user