mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-26 04:06:34 +08:00
实现基础的统计指标
This commit is contained in:
@@ -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>
|
||||
@@ -1,4 +1,4 @@
|
||||
{$layout}
|
||||
{$template "item_menu"}
|
||||
|
||||
<p class="ui message warning">此功能暂未开通,敬等期待。</p>
|
||||
<warning-message>此功能暂未开通,敬等期待。</warning-message>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
27
web/views/@default/servers/metrics/stats.html
Normal file
27
web/views/@default/servers/metrics/stats.html
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user