Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdb2fd8839 | ||
|
|
f3fac9325c | ||
|
|
626613441d | ||
|
|
b86b73a433 |
@@ -98,6 +98,9 @@ You can change the dashboard language in the settings page (`/setting`) after th
|
||||
<a href="https://github.com/ch8o" title="no-name-now">
|
||||
<img src="https://avatars.githubusercontent.com/u/9103372?v=4" width="50;" alt="no-name-now"/>
|
||||
</a>
|
||||
<a href="https://github.com/lvgj-stack" title="Ko no dio">
|
||||
<img src="https://avatars.githubusercontent.com/u/38449861?v=4" width="50;" alt="Ko no dio"/>
|
||||
</a>
|
||||
<a href="https://github.com/Creling" title="Creling">
|
||||
<img src="https://avatars.githubusercontent.com/u/43109504?v=4" width="50;" alt="Creling"/>
|
||||
</a>
|
||||
|
||||
@@ -118,6 +118,11 @@ func (p *commonPage) service(c *gin.Context) {
|
||||
var statsStore map[uint64]model.CycleTransferStats
|
||||
copier.Copy(&stats, singleton.ServiceSentinelShared.LoadStats())
|
||||
copier.Copy(&statsStore, singleton.AlertsCycleTransferStatsStore)
|
||||
for k, service := range stats {
|
||||
if !service.Monitor.EnableShowInService {
|
||||
delete(stats, k)
|
||||
}
|
||||
}
|
||||
return []interface {
|
||||
}{
|
||||
stats, statsStore,
|
||||
|
||||
@@ -394,6 +394,7 @@ type monitorForm struct {
|
||||
MaxLatency float32
|
||||
LatencyNotify string
|
||||
EnableTriggerTask string
|
||||
EnableShowInService string
|
||||
FailTriggerTasksRaw string
|
||||
RecoverTriggerTasksRaw string
|
||||
}
|
||||
@@ -415,6 +416,7 @@ func (ma *memberAPI) addOrEditMonitor(c *gin.Context) {
|
||||
m.LatencyNotify = mf.LatencyNotify == "on"
|
||||
m.MinLatency = mf.MinLatency
|
||||
m.MaxLatency = mf.MaxLatency
|
||||
m.EnableShowInService = mf.EnableShowInService == "on"
|
||||
m.EnableTriggerTask = mf.EnableTriggerTask == "on"
|
||||
m.RecoverTriggerTasksRaw = mf.RecoverTriggerTasksRaw
|
||||
m.FailTriggerTasksRaw = mf.FailTriggerTasksRaw
|
||||
|
||||
@@ -50,6 +50,7 @@ type Monitor struct {
|
||||
Cover uint8
|
||||
|
||||
EnableTriggerTask bool `gorm:"default: false"`
|
||||
EnableShowInService bool `gorm:"default: false"`
|
||||
FailTriggerTasksRaw string `gorm:"default:'[]'"`
|
||||
RecoverTriggerTasksRaw string `gorm:"default:'[]'"`
|
||||
FailTriggerTasks []uint64 `gorm:"-" json:"-"` // 失败时执行的触发任务id
|
||||
|
||||
Vendored
+4
-1
@@ -611,4 +611,7 @@ other = "Hide for Guest"
|
||||
other = "Menu"
|
||||
|
||||
[NetworkSpiter]
|
||||
other = "Network Monitor"
|
||||
other = "Network"
|
||||
|
||||
[EnableShowInService]
|
||||
other = "Enable Show in Service"
|
||||
Vendored
+4
-1
@@ -611,4 +611,7 @@ other = "Ocultar para Invitados"
|
||||
other = "Menú"
|
||||
|
||||
[NetworkSpiter]
|
||||
other = "Supervisión De Redes"
|
||||
other = "Red"
|
||||
|
||||
[EnableShowInService]
|
||||
other = "Mostrar en servicio"
|
||||
Vendored
+4
-1
@@ -611,4 +611,7 @@ other = "对游客隐藏"
|
||||
other = "菜单"
|
||||
|
||||
[NetworkSpiter]
|
||||
other = "网络监控"
|
||||
other = "网络"
|
||||
|
||||
[EnableShowInService]
|
||||
other = "在服务中显示"
|
||||
|
||||
Vendored
+4
-1
@@ -611,4 +611,7 @@ other = "對遊客隱藏"
|
||||
other = "菜單"
|
||||
|
||||
[NetworkSpiter]
|
||||
other = "網絡監控"
|
||||
other = "網絡"
|
||||
|
||||
[EnableShowInService]
|
||||
other = "在服務中顯示"
|
||||
@@ -339,6 +339,11 @@ function addOrEditMonitor(monitor) {
|
||||
modal.find("select[name=Type]").val(monitor ? monitor.Type : 1);
|
||||
modal.find("select[name=Cover]").val(monitor ? monitor.Cover : 0);
|
||||
modal.find("input[name=NotificationTag]").val(monitor ? monitor.NotificationTag : null);
|
||||
if (monitor && monitor.EnableShowInService) {
|
||||
modal.find(".ui.nb-show-in-service.checkbox").checkbox("set checked")
|
||||
} else {
|
||||
modal.find(".ui.nb-show-in-service.checkbox").checkbox("set unchecked")
|
||||
}
|
||||
if (monitor && monitor.Notify) {
|
||||
modal.find(".ui.nb-notify.checkbox").checkbox("set checked");
|
||||
} else {
|
||||
|
||||
Vendored
+1
-1
@@ -10,7 +10,7 @@
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/semantic-ui/2.4.1/semantic.min.js"></script>
|
||||
<script src="/static/semantic-ui-alerts.min.js"></script>
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
|
||||
<script src="/static/main.js?v20230614"></script>
|
||||
<script src="/static/main.js?v20240213"></script>
|
||||
<script>
|
||||
(function () {
|
||||
updateLang({{.LANG }});
|
||||
|
||||
+7
@@ -24,6 +24,12 @@
|
||||
<option value="3">TCP-Ping</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui nb-show-in-service checkbox">
|
||||
<input name="EnableShowInService" type="checkbox" tabindex="0" class="hidden" />
|
||||
<label>{{tr "EnableShowInService"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>{{tr "Duration"}}</label>
|
||||
<input type="number" name="Duration" placeholder="{{tr "Seconds"}}" />
|
||||
@@ -110,3 +116,4 @@
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
|
||||
+1
-1
@@ -68,4 +68,4 @@
|
||||
<script>
|
||||
$(".checkbox").checkbox();
|
||||
</script>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/semantic-ui/2.4.1/semantic.min.js"></script>
|
||||
<script src="/static/semantic-ui-alerts.min.js"></script>
|
||||
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
|
||||
<script src="/static/main.js?v20230614"></script>
|
||||
<script src="/static/main.js?v20240213"></script>
|
||||
<script>
|
||||
(function () {
|
||||
updateLang({{.LANG }});
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</section>
|
||||
{{if .CycleTransferStats}}
|
||||
<h2 class="mdui-m-t-5 mdui-text-center">{{tr "CycleTransferStats"}}</h2>
|
||||
|
||||
Reference in New Issue
Block a user