V1.2
1、新增服务器资源添加 (新增数据表pp_task_server) 2、新增远程服务器任务执行 3、删除邮件通知功能(pp_task删除两个有关字段)
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<div class="content-list">
|
||||
<form action="{{urlfor "GroupController.Add"}}" method="post" class="form-horizontal">
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="group_name">组名</label>
|
||||
<label class="col-sm-3 control-label" for="group_name">分类名称</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="group_name" value="" required />
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="description">任务说明</label>
|
||||
<label class="col-sm-3 control-label" for="description">分类说明</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="description" class="form-control" id="description" rows="3"></textarea>
|
||||
</div>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<div class="content-list">
|
||||
<form action="{{urlfor "GroupController.Edit"}}" method="post" class="form-horizontal">
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="group_name">组名</label>
|
||||
<label class="col-sm-3 control-label" for="group_name">分类名称</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="group_name" value="{{.group.GroupName}}" required />
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="description">任务说明</label>
|
||||
<label class="col-sm-3 control-label" for="description">分类说明</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="description" class="form-control" id="description" rows="3">{{.group.Description}}</textarea>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<div class="search-box row">
|
||||
<div class="col-md-4">
|
||||
<div class="btn-group pull-left" role="group" aria-label="...">
|
||||
<a href='{{urlfor "GroupController.Add"}}' class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> 新增分组</a>
|
||||
<a href='{{urlfor "GroupController.Add"}}' class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> 新增分类</a>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="glyphicon glyphicon-edit"></span> 批量操作
|
||||
@@ -48,7 +48,7 @@
|
||||
<tr>
|
||||
<td><input type="checkbox" name="all_check" /></td>
|
||||
<td>ID</td>
|
||||
<td width="20%">分组名称</td>
|
||||
<td width="20%">分类名称</td>
|
||||
<td>描述</td>
|
||||
<td width="25%">操作</td>
|
||||
</tr>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="li-border">
|
||||
<a class="mystyle-color" href="#" style="font-size: 20px">渠道定时任务管理后台 <span style="font-size: 12px">V1.1</span></a>
|
||||
<a class="mystyle-color" href="#" style="font-size: 20px">定时任务管理后台 <span style="font-size: 12px">V1.2</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -129,7 +129,6 @@
|
||||
<span class="sub-title">任务分类</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li {{if eq .curRoute "help.index"}}class="active"{{end}}>
|
||||
<div class="showtitle" style="width:100px;">
|
||||
使用帮助
|
||||
@@ -143,6 +142,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="subNavBox">
|
||||
<div class="sBox">
|
||||
<div class="subNav sublist-down">
|
||||
<span class="title-icon glyphicon glyphicon-chevron-down"></span>
|
||||
<span class="sublist-title">资源管理</span>
|
||||
</div>
|
||||
<ul class="navContent" >
|
||||
|
||||
<li {{if eq .menuTag "server"}}class="active"{{end}}>
|
||||
<div class="showtitle" style="width:100px;">
|
||||
服务器
|
||||
</div>
|
||||
<a href="/server/list">
|
||||
<span class="sublist-icon glyphicon glyphicon-hdd"></span>
|
||||
<span class="sub-title">服务器</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="subNavBox">
|
||||
<div class="sBox">
|
||||
<div class="subNav sublist-down">
|
||||
|
||||
149
views/server/add.html
Normal file
149
views/server/add.html
Normal file
@@ -0,0 +1,149 @@
|
||||
<!-- 新增服务器 -->
|
||||
<div class="container-fluid">
|
||||
<div class="info-center">
|
||||
<!--title-->
|
||||
<div class="info-center">
|
||||
<div class="page-header">
|
||||
<div class="pull-left">
|
||||
<h4>{{.pageTitle}}</h4>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<!-- <button type="button" class="btn btn-mystyle btn-sm refresh">刷新</button>
|
||||
<button type="button" class="btn btn-mystyle btn-sm reback">返回</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--content-list-->
|
||||
<div class="content-list">
|
||||
<form action="{{urlfor "ServerController.Add"}}" method="post" class="form-horizontal">
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_name">服务器名</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="server_name" value="" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_ip">服务器IP</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="server_ip" value="" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="port">服务器ssh端口</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="port" value="" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="type">验证类型</label>
|
||||
<div class="col-sm-6" >
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" value="0" > 密码
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" value="1" checked > 密钥
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-3" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group hide" style="margin-top: 15px" id="password">
|
||||
<label class="col-sm-3 control-label" for="password">服务器密码</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="password" value="" readonly />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="margin-top: 15px" id="private_key_src">
|
||||
<label class="col-sm-3 control-label" for="private_key_src">私钥地址</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="private_key_src" value="/Users/haodaquan/.ssh/pp_rsa" />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group " style="margin-top: 15px" id="public_key_src">
|
||||
<label class="col-sm-3 control-label" for="public_key_src">公钥地址</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="public_key_src" value="/Users/haodaquan/.ssh/pp_rsa.pub" />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
<i style="font-size: 12px">公钥和私钥地址请在本地服务器生成,命令:ssh-keygen -t rsa -f pp_rsa</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="detail">说明</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="detail" class="form-control" id="detail" rows="3"></textarea>
|
||||
</div>
|
||||
<div class="col-sm-4" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
<div class="modal-footer" style="text-align:center">
|
||||
<button type="submit" class="btn btn-primary submit_attr_button">保存</button>
|
||||
<button type="button" class="btn btn-default reback">返回</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("form").submit(function () {
|
||||
// $(".alert").hide();
|
||||
$("button[type='submit']").attr('disabled', true);
|
||||
$.post('{{urlfor "ServerController.Add"}}', $(this).serialize(), function (out) {
|
||||
if (out.status == 0) {
|
||||
window.location.href = '{{urlfor "ServerController.List"}}';
|
||||
} else {
|
||||
alert_message(out.msg,"alert-danger","alert-success");
|
||||
$("button[type='submit']").attr('disabled', false);
|
||||
}
|
||||
}, "json");
|
||||
return false;
|
||||
});
|
||||
|
||||
$("input[name='type']").click(function () {
|
||||
if ($(this).val() > 0) {
|
||||
$("#password").addClass('hide');
|
||||
$("#public_key_src").removeClass('hide');
|
||||
$("#private_key_src").removeClass('hide');
|
||||
} else {
|
||||
$("#password").removeClass('hide');
|
||||
$("#public_key_src").addClass('hide');
|
||||
$("#private_key_src").addClass('hide');
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
150
views/server/edit.html
Normal file
150
views/server/edit.html
Normal file
@@ -0,0 +1,150 @@
|
||||
<!-- 新增服务器 -->
|
||||
<div class="container-fluid">
|
||||
<div class="info-center">
|
||||
<!--title-->
|
||||
<div class="info-center">
|
||||
<div class="page-header">
|
||||
<div class="pull-left">
|
||||
<h4>{{.pageTitle}}</h4>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<!-- <button type="button" class="btn btn-mystyle btn-sm refresh">刷新</button>
|
||||
<button type="button" class="btn btn-mystyle btn-sm reback">返回</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!--content-list-->
|
||||
<div class="content-list">
|
||||
<form action="{{urlfor "ServerController.Edit"}}" method="post" class="form-horizontal">
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_name">服务器名</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="server_name" value="{{.server.ServerName}}" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_ip">服务器IP</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="server_ip" value="{{.server.ServerIp}}" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="port">服务器ssh端口</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="port" value="{{.server.Port}}" required />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="type">验证类型</label>
|
||||
<div class="col-sm-6" >
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" value="0" {{if eq .server.Type 0}}checked{{end}}> 密码
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="type" value="1" {{if eq .server.Type 1}}checked{{end}}> 密钥
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-3" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{if eq .server.Type 1}}hide{{end}}" style="margin-top: 15px" id="password">
|
||||
<label class="col-sm-3 control-label" for="password">服务器密码</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="password" value="{{.server.Password}}" />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{if eq .server.Type 0}}hide{{end}}" style="margin-top: 15px" id="private_key_src">
|
||||
<label class="col-sm-3 control-label" for="private_key_src">私钥地址</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="private_key_src" value="{{.server.PrivateKeySrc}}" />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{if eq .server.Type 0}}hide{{end}}" style="margin-top: 15px" id="public_key_src">
|
||||
<label class="col-sm-3 control-label" for="public_key_src">公钥地址</label>
|
||||
<div class="col-sm-3" >
|
||||
<input type="text" class="form-control input-sm" placeholder="" name="public_key_src" value="{{.server.PublicKeySrc}}" />
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="detail">说明</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="detail" class="form-control" id="detail" rows="3">{{.server.Detail}}</textarea>
|
||||
</div>
|
||||
<div class="col-sm-4" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<br />
|
||||
<div class="modal-footer" style="text-align:center">
|
||||
<input type="hidden" name="id" value="{{.server.Id}}" />
|
||||
<button type="submit" class="btn btn-primary submit_attr_button">保存</button>
|
||||
<button type="button" class="btn btn-default reback">返回</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function () {
|
||||
$("form").submit(function () {
|
||||
// $(".alert").hide();
|
||||
$("button[type='submit']").attr('disabled', true);
|
||||
$.post('{{urlfor "ServerController.Edit"}}', $(this).serialize(), function (out) {
|
||||
if (out.status == 0) {
|
||||
window.location.href = '{{urlfor "ServerController.List"}}';
|
||||
} else {
|
||||
alert_message(out.msg,"alert-danger","alert-success");
|
||||
$("button[type='submit']").attr('disabled', false);
|
||||
}
|
||||
}, "json");
|
||||
return false;
|
||||
});
|
||||
|
||||
$("input[name='type']").click(function () {
|
||||
if ($(this).val() > 0) {
|
||||
$("#password").addClass('hide');
|
||||
$("#public_key_src").removeClass('hide');
|
||||
$("#private_key_src").removeClass('hide');
|
||||
} else {
|
||||
$("#password").removeClass('hide');
|
||||
$("#public_key_src").addClass('hide');
|
||||
$("#private_key_src").addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
121
views/server/list.html
Normal file
121
views/server/list.html
Normal file
@@ -0,0 +1,121 @@
|
||||
<!-- 分组列表 -->
|
||||
<div class="container-fluid">
|
||||
<div class="info-center">
|
||||
<!--title-->
|
||||
<div class="info-center">
|
||||
<div class="page-header">
|
||||
<div class="pull-left">
|
||||
<h4>{{.pageTitle}}</h4>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<!-- <button type="button" class="btn btn-mystyle btn-sm refresh">刷新</button>
|
||||
<button type="button" class="btn btn-mystyle btn-sm reback">返回</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<!--content-list-->
|
||||
<div class="content-list">
|
||||
<div class="search-box row">
|
||||
<div class="col-md-4">
|
||||
<div class="btn-group pull-left" role="group" aria-label="...">
|
||||
<a href='{{urlfor "ServerController.Add"}}' class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span> 新增服务器</a>
|
||||
<div class="btn-group" role="server">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="glyphicon glyphicon-edit"></span> 批量操作
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="javascript:;" onclick="javascript:batch('delete');"><span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> 删除</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class=" btn-large pull-right" >
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
<div class="table-margin">
|
||||
<form id="form-list" method="post" action="">
|
||||
<table class="table table-bordered table-header">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="all_check" /></td>
|
||||
<td>ID</td>
|
||||
<td width="20%">服务器名称</td>
|
||||
<td width="">IP地址</td>
|
||||
<td width="">端口号</td>
|
||||
<td width="">验证类型</td>
|
||||
<td width="20%">备注</td>
|
||||
<td width="">创建时间</td>
|
||||
<td width="10%">操作</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range $k,$v := .list}}
|
||||
<tr>
|
||||
<td class="chk"><input type="checkbox" name="ids" value="{{$v.id}}" /></td>
|
||||
<td class="center">{{$v.id}}</td>
|
||||
<td>{{$v.server_name}}</td>
|
||||
<td>{{$v.server_ip}}</td>
|
||||
<td>{{$v.port}}</td>
|
||||
<td>{{$v.type}}</td>
|
||||
<td>{{$v.detail}}</td>
|
||||
<td>{{$v.create_time}}</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a class="btn btn-info btn-xs" href="{{urlfor "ServerController.Edit"}}?id={{$v.id}}">
|
||||
<span class="glyphicon glyphicon-file" aria-hidden="true"></span> 编辑
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<div class="pull-right">
|
||||
{{str2html .pageBar}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function batch(action) {
|
||||
if ($("input[name='ids']:checked").size() < 1) {
|
||||
alert_message("请选择要操作的任务","alert-danger","alert-success");
|
||||
} else {
|
||||
if(action=='delete'){
|
||||
if(!confirm("确定要删除所选吗?")) return;
|
||||
}
|
||||
var url = "{{urlfor "ServerController.Batch"}}";
|
||||
$.post(url + "?action=" + action, $("#form-list").serialize(), function(out) {
|
||||
if (out.status != 0) {
|
||||
alert_message(out.msg,"alert-danger","alert-success");
|
||||
} else {
|
||||
window.location.reload();
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//点击行换色
|
||||
$('tbody tr').click(function(){
|
||||
$(this).addClass("warning").siblings().removeClass("warning");
|
||||
});
|
||||
</script>
|
||||
@@ -55,6 +55,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_id">服务器</label>
|
||||
<div class="col-sm-3" >
|
||||
<select name="server_id" class="form-control">
|
||||
<option value="0">本地服务器</option>
|
||||
{{range $ks, $vs := .servers}}
|
||||
<option value="{{$vs.Id}}">{{$vs.ServerName}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="concurrent">是否单例</label>
|
||||
<div class="col-sm-3" >
|
||||
@@ -100,35 +115,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="notify">邮件通知</label>
|
||||
<div class="col-sm-6" >
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="0" checked readonly> 不通知
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="1" > 执行失败通知
|
||||
</label>
|
||||
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="2" > 执行结束通知
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3" style="padding-top:5px;">
|
||||
<i style="font-size: 12px;color: red">暂不支持</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group notify_email hide" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="notify_email">通知邮件抄送人</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="notify_email" class="form-control" id="notify_email" rows="3"></textarea>
|
||||
</div>
|
||||
<div class="col-sm-4" style="padding-top:5px;">
|
||||
每行一个email地址,如果不需要抄送给其他人请留空
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<div class="modal-footer" style="text-align:center">
|
||||
<button type="submit" class="btn btn-primary submit_attr_button">保存</button>
|
||||
@@ -141,28 +127,17 @@
|
||||
<script>
|
||||
$(function () {
|
||||
$("form").submit(function () {
|
||||
// $(".alert").hide();
|
||||
$("button[type='submit']").attr('disabled', true);
|
||||
$.post('{{urlfor "TaskController.Add"}}', $(this).serialize(), function (out) {
|
||||
if (out.status == 0) {
|
||||
window.location.href = '{{urlfor "TaskController.List"}}';
|
||||
} else {
|
||||
alert_message(out.msg,"alert-danger","alert-success");
|
||||
// $(".alert").text(out.msg);
|
||||
// $(".alert").show();
|
||||
$("button[type='submit']").attr('disabled', false);
|
||||
}
|
||||
}, "json");
|
||||
return false;
|
||||
});
|
||||
$("input[name='notify']").click(function () {
|
||||
// alert("暂不启用");
|
||||
// return;
|
||||
if ($(this).val() > 0) {
|
||||
$('.notify_email').removeClass('hide');
|
||||
} else {
|
||||
$('.notify_email').addClass('hide');
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
@@ -56,6 +56,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="server_id">服务器</label>
|
||||
<div class="col-sm-3" >
|
||||
<select name="server_id" class="form-control">
|
||||
<option value="0">本地服务器</option>
|
||||
{{range $ks, $vs := .servers}}
|
||||
<option value="{{$vs.Id}}" {{if eq $vs.Id $.task.ServerId}}selected{{end}}>{{$vs.ServerName}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-6" style="padding-top:5px;">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="concurrent">是否单例</label>
|
||||
<div class="col-sm-3" >
|
||||
@@ -102,35 +117,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="concurrent">邮件通知</label>
|
||||
<div class="col-sm-6" >
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="0" {{if eq .task.Notify 0}}checked{{end}}> 不通知
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="1" {{if eq .task.Notify 1}}checked{{end}}> 执行失败通知
|
||||
</label>
|
||||
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="notify" value="2" {{if eq .task.Notify 2}}checked{{end}}> 执行结束通知
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-3" style="padding-top:5px;">
|
||||
<i style="font-size: 12px;color: red">暂不支持</i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group notify_email {{if eq .task.Notify 0}}hide{{end}}" style="margin-top: 15px">
|
||||
<label class="col-sm-3 control-label" for="task_name">通知邮件抄送人</label>
|
||||
<div class="col-sm-5" >
|
||||
<textarea name="notify_email" class="form-control" id="notify_email" rows="3">{{.task.NotifyEmail}}</textarea>
|
||||
</div>
|
||||
<div class="col-sm-4" style="padding-top:5px;">
|
||||
每行一个email地址,如果不需要抄送给其他人请留空
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<input type="hidden" name="id" value="{{.task.Id}}" />
|
||||
<div class="modal-footer" style="text-align:center">
|
||||
@@ -155,13 +141,5 @@ $(function () {
|
||||
}, "json");
|
||||
return false;
|
||||
});
|
||||
|
||||
$("input[name='notify']").click(function () {
|
||||
if ($(this).val() > 0) {
|
||||
$('.notify_email').removeClass('hide');
|
||||
} else {
|
||||
$('.notify_email').addClass('hide');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -60,7 +60,8 @@
|
||||
<td><input type="checkbox" name="all_check" /></td>
|
||||
<td>ID</td>
|
||||
<td width="20%">任务名称</td>
|
||||
<td>时间表达式</td>
|
||||
<td>服务器</td>
|
||||
|
||||
<td>任务说明</td>
|
||||
<td>上次执行时间</td>
|
||||
<td>下次执行时间</td>
|
||||
@@ -80,7 +81,8 @@
|
||||
{{end}}
|
||||
{{$v.group_name}}-{{$v.name}}
|
||||
</td>
|
||||
<td> {{$v.cron_spec}} </td>
|
||||
<td> {{$v.server_name}} </td>
|
||||
|
||||
<td> {{$v.description}} </td>
|
||||
<td> {{$v.prev_time}} </td>
|
||||
<td> {{$v.next_time}} </td>
|
||||
@@ -110,7 +112,7 @@
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="9">
|
||||
<td colspan="8">
|
||||
<div class="pull-right">
|
||||
{{str2html .pageBar}}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user