nezha/resource/template/component/cron.html

51 lines
2.4 KiB
HTML
Raw Normal View History

{{define "component/cron"}}
<div class="ui tiny cron modal transition hidden">
<div class="header">添加计划任务</div>
<div class="content">
<form id="cronForm" class="ui form">
<input type="hidden" name="ID">
<div class="field">
<label>备注</label>
<input type="text" name="Name" placeholder="备份">
</div>
<div class="field">
<label>计划</label>
<input type="text" name="Scheduler" placeholder="0 3 * * *每天3点">
</div>
<div class="field">
<label>命令</label>
<textarea name="Command"></textarea>
</div>
<div class="field">
<label>执行服务器ID列表</label>
<div class="ui fluid multiple servers search selection dropdown">
<input type="hidden" name="ServersRaw">
<i class="dropdown icon"></i>
<div class="default text">输入ID/备注以搜索</div>
<div class="menu"></div>
</div>
</div>
<div class="field">
<div class="ui push-successful checkbox">
<input name="PushSuccessful" type="checkbox" tabindex="0" class="hidden">
<label>推送成功的消息</label>
</div>
</div>
</form>
<div class="ui warning message">
<p>
计划的格式为:<code>* * * * *</code> 分 时 天 月 星期,详情见 <a
href="https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format"
target="_blank">计划表达式格式</a><br>
命令Shell 命令,就像写脚本一样就可以,如果遇到 xxx 命令找不到,可能是 <code>PATH</code> 环境变量的问题,在脚本顶部加一个 <code>source ~/.bashrc</code>
或者使用绝对路径执行,示例 <a href="https://gist.github.com/naiba/26efc8bf6f0b3273a9ba15ee48db5f11" target="_blank" rel="noopener noreferrer">备份脚本</a>
</p>
</div>
</div>
<div class=" actions">
<div class="ui negative button">取消</div>
<button class="ui positive right labeled icon button">确认<i class="checkmark icon"></i>
</button>
</div>
</div>
{{end}}