实现基础的统计指标

This commit is contained in:
GoEdgeLab
2021-06-30 19:59:59 +08:00
parent ea358ad348
commit c82d11aa4d
39 changed files with 258 additions and 66 deletions

2
go.mod
View File

@@ -11,7 +11,7 @@ require (
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f
github.com/iwind/TeaGo v0.0.0-20210628135026-38575a4ab060
github.com/miekg/dns v1.1.35
github.com/shirou/gopsutil v3.21.5+incompatible // indirect
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e

8
go.sum
View File

@@ -65,8 +65,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f h1:r2O8PONj/KiuZjJHVHn7KlCePUIjNtgAmvLfgRafQ8o=
github.com/iwind/TeaGo v0.0.0-20210411134150-ddf57e240c2f/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc=
github.com/iwind/TeaGo v0.0.0-20210628135026-38575a4ab060 h1:qdLtK4PDXxk2vMKkTWl5Fl9xqYuRCukzWAgJbLHdfOo=
github.com/iwind/TeaGo v0.0.0-20210628135026-38575a4ab060/go.mod h1:KU4mS7QNiZ7QWEuDBk1zw0/Q2LrAPZv3tycEFBsuUwc=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -76,8 +80,12 @@ github.com/miekg/dns v1.1.35 h1:oTfOaDH+mZkdcgdIjH6yBajRGtIwcwcaR+rt23ZSrJs=
github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=

View File

@@ -392,6 +392,10 @@ func (this *RPCClient) MetricItemRPC() pb.MetricItemServiceClient {
return pb.NewMetricItemServiceClient(this.pickConn())
}
func (this *RPCClient) MetricStatRPC() pb.MetricStatServiceClient {
return pb.NewMetricStatServiceClient(this.pickConn())
}
func (this *RPCClient) NodeClusterMetricItemRPC() pb.NodeClusterMetricItemServiceClient {
return pb.NewNodeClusterMetricItemServiceClient(this.pickConn())
}

View File

@@ -5,6 +5,7 @@ package metrics
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
)
@@ -17,12 +18,14 @@ func (this *CreatePopupAction) Init() {
}
func (this *CreatePopupAction) RunGet(params struct {
ClusterId int64
Category string
}) {
if len(params.Category) == 0 {
params.Category = "http"
}
this.Data["category"] = params.Category
this.Data["clusterId"] = params.ClusterId
countResp, err := this.RPC().MetricItemRPC().CountAllEnabledMetricItems(this.AdminContext(), &pb.CountAllEnabledMetricItemsRequest{Category: params.Category})
if err != nil {
@@ -44,6 +47,17 @@ func (this *CreatePopupAction) RunGet(params struct {
}
var itemMaps = []maps.Map{}
for _, item := range itemsResp.MetricItems {
// 是否已添加
existsResp, err := this.RPC().NodeClusterMetricItemRPC().ExistsNodeClusterMetricItem(this.AdminContext(), &pb.ExistsNodeClusterMetricItemRequest{
NodeClusterId: params.ClusterId,
MetricItemId: item.Id,
})
if err != nil {
this.ErrorPage(err)
return
}
var exists = existsResp.Exists
itemMaps = append(itemMaps, maps.Map{
"id": item.Id,
"name": item.Name,
@@ -53,9 +67,29 @@ func (this *CreatePopupAction) RunGet(params struct {
"keys": item.Keys,
"value": item.Value,
"category": item.Category,
"isChecked": exists,
})
}
this.Data["items"] = itemMaps
this.Show()
}
func (this *CreatePopupAction) RunPost(params struct {
ClusterId int64
ItemId int64
Must *actions.Must
}) {
defer this.CreateLogInfo("添加指标 %d 到集群 %d", params.ItemId, params.ClusterId)
_, err := this.RPC().NodeClusterMetricItemRPC().EnableNodeClusterMetricItem(this.AdminContext(), &pb.EnableNodeClusterMetricItemRequest{
NodeClusterId: params.ClusterId,
MetricItemId: params.ItemId,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}

View File

@@ -2,12 +2,29 @@
package metrics
import "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
)
type DeleteAction struct {
actionutils.ParentAction
}
func (this *DeleteAction) RunPost(params struct{}) {
func (this *DeleteAction) RunPost(params struct {
ClusterId int64
ItemId int64
}) {
defer this.CreateLogInfo("从集群 %d 中移除指标 %d", params.ClusterId, params.ItemId)
_, err := this.RPC().NodeClusterMetricItemRPC().DisableNodeClusterMetricItem(this.AdminContext(), &pb.DisableNodeClusterMetricItemRequest{
NodeClusterId: params.ClusterId,
MetricItemId: params.ItemId,
})
if err != nil {
this.ErrorPage(err)
return
}
this.Success()
}

View File

@@ -26,7 +26,10 @@ func (this *IndexAction) RunGet(params struct {
}
this.Data["category"] = params.Category
itemsResp, err := this.RPC().NodeClusterMetricItemRPC().FindAllNodeClusterMetricItems(this.AdminContext(), &pb.FindAllNodeClusterMetricItemsRequest{NodeClusterId: params.ClusterId})
itemsResp, err := this.RPC().NodeClusterMetricItemRPC().FindAllNodeClusterMetricItems(this.AdminContext(), &pb.FindAllNodeClusterMetricItemsRequest{
NodeClusterId: params.ClusterId,
Category: params.Category,
})
if err != nil {
this.ErrorPage(err)
return

View File

@@ -121,12 +121,12 @@ func (this *ClusterHelper) createSettingMenu(cluster *pb.NodeCluster, info *pb.F
"isActive": selectedItem == "dns",
"isOn": cluster.DnsDomainId > 0 || len(cluster.DnsName) > 0,
})
/**items = append(items, maps.Map{
items = append(items, maps.Map{
"name": "统计指标",
"url": "/clusters/cluster/settings/metrics?clusterId=" + clusterId,
"isActive": selectedItem == "metric",
"isOn": info != nil && info.HasMetricItems,
})**/
})
if teaconst.IsPlus {
items = append(items, maps.Map{

View File

@@ -15,7 +15,7 @@ func (this *ChartsAction) Init() {
func (this *ChartsAction) RunGet(params struct {
ItemId int64
}) {
err := InitItem(this.Parent(), params.ItemId)
_, err := InitItem(this.Parent(), params.ItemId)
if err != nil {
this.ErrorPage(err)
return

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
)
@@ -22,6 +23,7 @@ func (this *CreatePopupAction) RunGet(params struct {
Category string
}) {
this.Data["category"] = params.Category
this.Data["valueDefinitions"] = serverconfigs.FindAllMetricValueDefinitions(params.Category)
this.Show()
}

View File

@@ -19,6 +19,7 @@ func init() {
Post("/delete", new(DeleteAction)).
Get("/item", new(ItemAction)).
Get("/charts", new(ChartsAction)).
Get("/stats", new(StatsAction)).
EndAll()
})
}

View File

@@ -15,7 +15,7 @@ func (this *ItemAction) Init() {
func (this *ItemAction) RunGet(params struct {
ItemId int64
}) {
err := InitItem(this.Parent(), params.ItemId)
_, err := InitItem(this.Parent(), params.ItemId)
if err != nil {
this.ErrorPage(err)
return

View File

@@ -0,0 +1,65 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package metrics
import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/maps"
)
type StatsAction struct {
actionutils.ParentAction
}
func (this *StatsAction) Init() {
this.Nav("", "", "stat")
}
func (this *StatsAction) RunGet(params struct {
ItemId int64
}) {
item, err := InitItem(this.Parent(), params.ItemId)
if err != nil {
this.ErrorPage(err)
return
}
countResp, err := this.RPC().MetricStatRPC().CountMetricStats(this.AdminContext(), &pb.CountMetricStatsRequest{
MetricItemId: params.ItemId,
})
if err != nil {
this.ErrorPage(err)
return
}
var count = countResp.Count
page := this.NewPage(count)
this.Data["page"] = page.AsHTML()
statsResp, err := this.RPC().MetricStatRPC().ListMetricStats(this.AdminContext(), &pb.ListMetricStatsRequest{
MetricItemId: params.ItemId,
Offset: page.Offset,
Size: page.Size,
})
if err != nil {
this.ErrorPage(err)
return
}
var statMaps = []maps.Map{}
for _, stat := range statsResp.MetricStats {
statMaps = append(statMaps, maps.Map{
"id": stat.Id,
"time": serverconfigs.HumanMetricTime(item.PeriodUnit, stat.Time),
"keys": stat.Keys,
"value": stat.Value,
"cluster": maps.Map{"id": stat.NodeCluster.Id, "name": stat.NodeCluster.Name},
"node": maps.Map{"id": stat.Node.Id, "name": stat.Node.Name},
"server": maps.Map{"id": stat.Server.Id, "name": stat.Server.Name},
})
}
this.Data["stats"] = statMaps
this.Show()
}

View File

@@ -6,6 +6,7 @@ import (
"encoding/json"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/maps"
)
@@ -21,12 +22,14 @@ func (this *UpdateAction) Init() {
func (this *UpdateAction) RunGet(params struct {
ItemId int64
}) {
err := InitItem(this.Parent(), params.ItemId)
item, err := InitItem(this.Parent(), params.ItemId)
if err != nil {
this.ErrorPage(err)
return
}
this.Data["valueDefinitions"] = serverconfigs.FindAllMetricValueDefinitions(item.Category)
this.Show()
}

View File

@@ -10,18 +10,19 @@ import (
"github.com/iwind/TeaGo/maps"
)
func InitItem(parent *actionutils.ParentAction, itemId int64) error {
// InitItem 初始化指标信息
func InitItem(parent *actionutils.ParentAction, itemId int64) (*pb.MetricItem, error) {
client, err := rpc.SharedRPC()
if err != nil {
return err
return nil, err
}
resp, err := client.MetricItemRPC().FindEnabledMetricItem(parent.AdminContext(), &pb.FindEnabledMetricItemRequest{MetricItemId: itemId})
if err != nil {
return err
return nil, err
}
var item = resp.MetricItem
if item == nil {
return errors.New("not found")
return nil, errors.New("not found")
}
parent.Data["item"] = maps.Map{
"id": item.Id,
@@ -33,5 +34,5 @@ func InitItem(parent *actionutils.ParentAction, itemId int64) error {
"periodUnit": item.PeriodUnit,
"category": item.Category,
}
return nil
return item, nil
}

View File

@@ -177,11 +177,11 @@ func (this *userMustAuth) modules(adminId int64) []maps.Map {
"url": "/servers/certs",
"code": "cert",
},
/**{
{
"name": "统计指标",
"url": "/servers/metrics",
"code": "metric",
},**/
},
},
},
{

View File

@@ -0,0 +1,4 @@
// 警告消息
Vue.component("warning-message", {
template: `<p class="ui message warning"><i class="icon warning circle"></i><slot></slot></p>`
})

View File

@@ -1,8 +1,8 @@
{$layout "layout_popup"}
<h3>添加指标</h3>
<h3>可以添加指标</h3>
<p class="comment" v-if="items.length == 0">暂时还没有指标。</p>
<p class="comment" v-if="items.length == 0">暂时还没有可用的指标。</p>
<table class="ui table celled selectable" v-if="items.length > 0">
<thead>
<tr>
@@ -29,8 +29,8 @@
<label-on :v-is-on="item.isOn"></label-on>
</td>
<td>
<a href="" v-if="!item.isChecked">添加</a>
<a href="" v-if="item.isChecked"><span class="grey">已添加</span></a>
<a href="" @click.prevent="addItem(item)" v-if="!item.isChecked">添加</a>
<a href="" @click.prevent="removeItem(item)" v-if="item.isChecked"><span class="grey">已添加</span></a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,23 @@
Tea.context(function () {
this.addItem = function (item) {
this.$post("$")
.params({
clusterId: this.clusterId,
itemId: item.id
})
.success(function () {
item.isChecked = true
})
}
this.removeItem = function (item) {
this.$post(".delete")
.params({
clusterId: this.clusterId,
itemId: item.id
})
.success(function () {
item.isChecked = false
})
}
})

View File

@@ -4,15 +4,15 @@
<div class="right-box">
<first-menu>
<menu-item :href="'/clusters/cluster/settings/metrics?category=http&clusterId=' + clusterId" :active="category == 'http'">HTTP</menu-item>
<menu-item :href="'/clusters/cluster/settings/metrics?category=tcp&clusterId=' + clusterId" :active="category == 'tcp'">TCP</menu-item>
<menu-item :href="'/clusters/cluster/settings/metrics?category=udp&clusterId=' + clusterId" :active="category == 'udp'">UDP</menu-item>
<!--<menu-item :href="'/clusters/cluster/settings/metrics?category=tcp&clusterId=' + clusterId" :active="category == 'tcp'">TCP</menu-item>
<menu-item :href="'/clusters/cluster/settings/metrics?category=udp&clusterId=' + clusterId" :active="category == 'udp'">UDP</menu-item>-->
<span class="item disabled">|</span>
<menu-item @click.prevent="createItem">[添加指标]</menu-item>
<span class="item disabled">|</span>
<span class="item"><tip-icon content="在这里设置的指标,会自动应用到部署在当前集群上的所有服务上。"></tip-icon></span>
</first-menu>
<p class="comment" v-if="items.length == 0">暂时还没有设置指标。</p>
<p class="comment" v-if="items.length == 0">暂时还没有添加指标。</p>
<table class="ui table celled selectable" v-if="items.length > 0">
<thead>

View File

@@ -1,13 +1,17 @@
Tea.context(function () {
this.createItem = function () {
teaweb.popup(Tea.url(".createPopup", {
clusterId: this.clusterId
clusterId: this.clusterId,
category: this.category
}), {
callback: function () {
teaweb.success("保存成功", function () {
teaweb.reload()
})
},
onClose: function () {
teaweb.reload()
},
width: "50em",
height: "25em"
})
@@ -18,6 +22,7 @@ Tea.context(function () {
teaweb.confirm("确定要删除这个指标吗?", function () {
that.$post(".delete")
.params({
clusterId: that.clusterId,
itemId: itemId
})
.success(function () {

View File

@@ -10,9 +10,9 @@
<tr>
<th class="one wide">ID</th>
<th>名称</th>
<th class="one wide">类型</th>
<th class="two wide">类型</th>
<th>备注</th>
<th class="one wide">IP数量</th>
<th class="two wide">IP数量</th>
<th class="two op">操作</th>
</tr>
</thead>

View File

@@ -4,4 +4,5 @@
<menu-item :href="'/servers/metrics/item?itemId=' + item.id" code="item">"{{item.name}}"详情</menu-item>
<menu-item :href="'/servers/metrics/update?itemId=' + item.id" code="update">修改</menu-item>
<menu-item :href="'/servers/metrics/charts?itemId=' + item.id" code="chart">图表</menu-item>
<menu-item :href="'/servers/metrics/stats?itemId=' + item.id" code="stat">数据</menu-item>
</first-menu>

View File

@@ -1,4 +1,4 @@
{$layout}
{$template "item_menu"}
<p class="ui message warning">此功能暂未开通,敬等期待。</p>
<warning-message>此功能暂未开通,敬等期待。</warning-message>

View File

@@ -28,24 +28,17 @@
<td>
<!-- HTTP -->
<select class="ui dropdown auto-width" name="value" v-if="category == 'http'">
<option value="${countRequest}">请求数</option>
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
<!-- TCP -->
<select class="ui dropdown auto-width" name="value" v-if="category == 'tcp'">
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
<!-- UDP -->
<select class="ui dropdown auto-width" name="value" v-if="category == 'udp'">
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
</td>
</tr>

View File

@@ -2,8 +2,8 @@
<first-menu>
<menu-item :href="'/servers/metrics?category=http'" :active="category == 'http'">HTTP</menu-item>
<menu-item :href="'/servers/metrics?category=tcp'" :active="category == 'tcp'">TCP</menu-item>
<menu-item :href="'/servers/metrics?category=udp'" :active="category == 'udp'">UDP</menu-item>
<!--<menu-item :href="'/servers/metrics?category=tcp'" :active="category == 'tcp'">TCP</menu-item>
<menu-item :href="'/servers/metrics?category=udp'" :active="category == 'udp'">UDP</menu-item>-->
<span class="item disabled">|</span>
<menu-item @click.prevent="createItem">[创建指标]</menu-item>
<span class="item disabled">|</span>

View File

@@ -12,6 +12,12 @@
<td>状态</td>
<td><label-on :v-is-on="item.isOn"></label-on></td>
</tr>
<tr>
<td>统计对象</td>
<td>
<span v-for="key in item.keys" class="ui label small basic">{{key}}</span>
</td>
</tr>
<tr>
<td>统计周期</td>
<td>

View File

@@ -0,0 +1,27 @@
{$layout}
{$template "item_menu"}
<p class="comment" v-if="stats.length == 0">暂时还没有统计数据。</p>
<table class="ui table selectable celled" v-if="stats.length > 0">
<thead>
<tr>
<th>指标对象</th>
<th>指标值</th>
<th>时间</th>
<th>集群</th>
<th>节点</th>
<th>服务</th>
</tr>
</thead>
<tr v-for="stat in stats">
<td>{{stat.keys}}</td>
<td>{{stat.value}}</td>
<td>{{stat.time}}</td>
<td>{{stat.cluster.name}}</td>
<td>{{stat.node.name}}</td>
<td>{{stat.server.name}}<link-icon :href="'/servers/server/stat?serverId=' + stat.server.id"></link-icon></td>
</tr>
</table>
<div class="page" v-html="page"></div>

View File

@@ -1,6 +1,8 @@
{$layout "layout"}
{$template "item_menu"}
<warning-message>修改统计对象、统计周期、统计数值等参数后,将重新记录数据。</warning-message>
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="itemId" :value="item.id"/>
@@ -28,24 +30,17 @@
<td>
<!-- HTTP -->
<select class="ui dropdown auto-width" name="value" v-if="item.category == 'http'" v-model="item.value">
<option value="${countRequest}">请求数</option>
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
<!-- TCP -->
<select class="ui dropdown auto-width" name="value" v-if="item.category == 'tcp'">
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
<!-- UDP -->
<select class="ui dropdown auto-width" name="value" v-if="item.category == 'udp'">
<option value="${countConnection}">连接数</option>
<option value="${countTrafficIn}">下行流量</option>
<option value="${countTrafficOut}">上行流量</option>
<option v-for="def in valueDefinitions" :value="def.code">{{def.name}}</option>
</select>
</td>
</tr>

View File

@@ -10,7 +10,7 @@
<div class="margin"></div>
<div v-if="!reverseProxyRef.isPrior || !reverseProxyRef.isOn">
<div class="margin"></div>
<p class="ui message warning">当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/locations/reverseProxy/setting?serverId=' + serverId + '&locationId=' + locationId">[更多设置]</a> 开启 。</p>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/locations/reverseProxy/setting?serverId=' + serverId + '&locationId=' + locationId">[更多设置]</a> 开启 。</warning-message>
</div>
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"

View File

@@ -6,7 +6,7 @@
<div v-if="!reverseProxyRef.isOn">
<div class="margin"></div>
<p class="ui message warning">当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId">[更多设置]</a> 开启 。</p>
<warning-message>当前代理服务没有开启,可以通过点击 <a :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId">[更多设置]</a> 开启 。</warning-message>
</div>
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"

View File

@@ -4,7 +4,7 @@
<div class="right-box">
<!-- 审核中 -->
<div v-show="isAuditing">
<p class="ui message warning">当前域名正在审核中,请审核域名的所有人、备案情况等。</p>
<warning-message>当前域名正在审核中,请审核域名的所有人、备案情况等。</warning-message>
<form method="post" class="ui form" data-tea-action=".audit" data-tea-success="auditSuccess">
<csrf-token></csrf-token>
<input type="hidden" name="serverId" :value="serverId"/>

View File

@@ -8,7 +8,7 @@
<a href="" class="item" @click.prevent="createGroup(type)">[添加分组]</a>
</second-menu>
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<p class="comment" v-if="groups.length == 0">暂时还没有规则分组。</p>

View File

@@ -4,7 +4,7 @@
<div class="right-box">
{$template "../menu"}
<div class="ui message warning" v-if="!featureIsOn">尚未为当前用户开通此功能。</div>
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<second-menu>
@@ -15,7 +15,7 @@
<div class="item"><ip-list-bind-box :v-http-firewall-policy-id="firewallPolicyId" :v-type="'white'"></ip-list-bind-box></div>
</second-menu>
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<p class="comment" v-if="items.length == 0">暂时还没有IP。</p>
<ip-list-table v-if="items.length > 0" :v-items="items" @update-item="updateItem" @delete-item="deleteItem"></ip-list-table>

View File

@@ -4,10 +4,10 @@
<div class="right-box">
{$template "../menu"}
<div class="ui message warning" v-if="!featureIsOn">尚未为当前用户开通此功能。</div>
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>

View File

@@ -4,7 +4,7 @@
<div class="right-box">
{$template "../menu"}
<div class="ui message warning" v-if="!featureIsOn">尚未为当前用户开通此功能。</div>
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<second-menu>
@@ -15,7 +15,7 @@
<div class="item"><ip-list-bind-box :v-http-firewall-policy-id="firewallPolicyId" :v-type="'black'"></ip-list-bind-box></div>
</second-menu>
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<p class="comment" v-if="items.length == 0">暂时还没有IP。</p>
<ip-list-table v-if="items.length > 0" :v-items="items" @update-item="updateItem" @delete-item="deleteItem"></ip-list-table>

View File

@@ -4,10 +4,10 @@
<div class="right-box">
{$template "../menu"}
<div class="ui message warning" v-if="!featureIsOn">尚未为当前用户开通此功能。</div>
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>

View File

@@ -4,10 +4,10 @@
<div class="right-box">
{$template "../menu"}
<div class="ui message warning" v-if="!featureIsOn">尚未为当前用户开通此功能。</div>
<warning-message v-if="!featureIsOn">尚未为当前用户开通此功能。</warning-message>
{$ if .featureIsOn}
<p class="ui message warning" v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</p>
<warning-message v-if="!wafIsOn">当前WAF未启用设置将在<a :href="'/servers/server/settings/waf?serverId=' + serverId">[启用]</a>后生效。</warning-message>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="firewallPolicyId" :value="firewallPolicyId"/>

View File

@@ -1,7 +1,7 @@
{$layout}
{$template "menu"}
<div class="ui message warning" v-if="key == null">认证之后,可以使用企业版功能,当前你还没有认证,<a href="http://edge.teaos.cn/docs/Plus/Authority/Index.md" target="_blank">[在这里看认证方法]</a></div>
<warning-message v-if="key == null">认证之后,可以使用企业版功能,当前你还没有认证,<a href="http://edge.teaos.cn/docs/Plus/Authority/Index.md" target="_blank">[在这里看认证方法]</a></warning-message>
<div v-if="key != null">
<div class="margin"></div>

View File

@@ -1,6 +1,6 @@
{$layout}
<div class="ui message warning" v-if="serverIsChanged">服务配置已修改,请在命令行下重启后生效。</div>
<warning-message v-if="serverIsChanged">服务配置已修改,请在命令行下重启后生效。</warning-message>
<h3>HTTP <a href="/settings/server/http" v-if="!teaDemoEnabled" @click.prevent="updateHTTP()">修改</a><a v-if="teaDemoEnabled">[演示版无法修改]</a></h3>