优化忽略规则配置和 Agent 获取 IP

This commit is contained in:
naiba
2021-06-21 21:30:42 +08:00
parent c4f36d17d5
commit 4b0c0ad288
20 changed files with 370 additions and 291 deletions

View File

@@ -17,7 +17,14 @@
<textarea name="Command"></textarea>
</div>
<div class="field">
<label>执行服务器列表</label>
<label>覆盖范围</label>
<select name="Cover" class="ui fluid dropdown">
<option value="0">忽略所有,仅通过指定服务器执行</option>
<option value="1">覆盖所有,仅指定服务器不执行</option>
</select>
</div>
<div class="field">
<label>指定服务器</label>
<div class="ui fluid multiple servers search selection dropdown">
<input type="hidden" name="ServersRaw">
<i class="dropdown icon"></i>
@@ -37,7 +44,8 @@
计划的格式为:<code>* * * * *</code> 分 时 天 月 星期,详情见 <a
href="https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format"
target="_blank">计划表达式格式</a><br>
命令:就像写 shell/bat 脚本一样,但是不推荐换行,多个命令使用 <code>&&</code>/<code>&</code> 连接,如果遇到 xxx 命令找不到,可能是 <code>PATH</code> 环境变量的问题,<code>Linux</code> 主机在命令开头加入
命令:就像写 shell/bat 脚本一样,但是不推荐换行,多个命令使用 <code>&&</code>/<code>&</code> 连接,如果遇到 xxx 命令找不到,可能是
<code>PATH</code> 环境变量的问题,<code>Linux</code> 主机在命令开头加入
<code>source ~/.bashrc</code>或者使用绝对路径执行。
</p>
</div>

View File

@@ -25,7 +25,14 @@
</select>
</div>
<div class="field">
<label>不通过下列服务器请求</label>
<label>覆盖范围</label>
<select name="Cover" class="ui fluid dropdown">
<option value="0">覆盖所有,仅忽略指定服务器</option>
<option value="1">忽略所有,仅通过指定服务器请求</option>
</select>
</div>
<div class="field">
<label>指定服务器</label>
<div class="ui fluid multiple servers search selection dropdown">
<input type="hidden" name="SkipServersRaw" />
<i class="dropdown icon"></i>

View File

@@ -18,7 +18,8 @@
<th>计划</th>
<th>命令</th>
<th>成功推送</th>
<th>执行者</th>
<th>覆盖范围</th>
<th>排除服务器</th>
<th>最后执行</th>
<th>最后结果</th>
<th>管理</th>
@@ -32,6 +33,7 @@
<td>{{$cron.Scheduler}}</td>
<td>{{$cron.Command}}</td>
<td>{{$cron.PushSuccessful}}</td>
<td>{{if eq $cron.Cover 0}}忽略所有{{else}}覆盖所有{{end}}</td>
<td>{{$cron.ServersRaw}}</td>
<td>{{$cron.LastExecutedAt|tf}}</td>
<td>{{$cron.LastResult}}</td>

View File

@@ -4,10 +4,7 @@
<div class="ui container">
<div class="ui grid">
<div class="right floated right aligned twelve wide column">
<button
class="ui right labeled positive icon button"
onclick="addOrEditMonitor()"
>
<button class="ui right labeled positive icon button" onclick="addOrEditMonitor()">
<i class="add icon"></i> 添加监控
</button>
</div>
@@ -18,7 +15,8 @@
<th>ID</th>
<th>名称</th>
<th>目标</th>
<th>跳过的服务器</th>
<th>覆盖范围</th>
<th>排除服务器</th>
<th>类型</th>
<th>通知</th>
<th>管理</th>
@@ -30,6 +28,7 @@
<td>{{$monitor.ID}}</td>
<td>{{$monitor.Name}}</td>
<td>{{$monitor.Target}}</td>
<td>{{if eq $monitor.Cover 0}}覆盖所有{{else}}忽略所有{{end}}</td>
<td>{{$monitor.SkipServersRaw}}</td>
<td>
{{if eq $monitor.Type 1}}HTTP(S)/SSL证书 {{else if eq $monitor.Type
@@ -38,16 +37,11 @@
<td>{{$monitor.Notify}}</td>
<td>
<div class="ui mini icon buttons">
<button
class="ui button"
onclick="addOrEditMonitor({{$monitor}})"
>
<button class="ui button" onclick="addOrEditMonitor({{$monitor}})">
<i class="edit icon"></i>
</button>
<button
class="ui button"
onclick="showConfirm('删除监控','确认删除此监控?',deleteRequest,'/api/monitor/'+{{$monitor.ID}})"
>
<button class="ui button"
onclick="showConfirm('删除监控','确认删除此监控?',deleteRequest,'/api/monitor/'+{{$monitor.ID}})">
<i class="trash alternate outline icon"></i>
</button>
</div>
@@ -62,4 +56,4 @@
<script>
$(".checkbox").checkbox();
</script>
{{end}}
{{end}}

View File

@@ -17,6 +17,7 @@
<th>名称</th>
<th>分组</th>
<th>IP</th>
<th>版本号</th>
<th>密钥</th>
<th>备注</th>
<th>管理</th>
@@ -29,6 +30,7 @@
<td>{{$server.Name}}</td>
<td>{{$server.Tag}}</td>
<td>{{$server.Host.IP}}</td>
<td>{{$server.Host.Version}}</td>
<td>{{$server.Secret}}</td>
<td style="word-break: break-word;">{{$server.Note}}</td>
<td>