修改列表和登录
登录设置默认一天 列表页各行换色并点击换色 修改返回的一些bug
This commit is contained in:
@@ -169,7 +169,7 @@ func (this *MainController) Login() {
|
|||||||
if remember == "yes" {
|
if remember == "yes" {
|
||||||
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400)
|
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey, 7*86400)
|
||||||
} else {
|
} else {
|
||||||
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey)
|
this.Ctx.SetCookie("auth", strconv.Itoa(user.Id)+"|"+authkey,86400)
|
||||||
}
|
}
|
||||||
this.redirect(beego.URLFor("TaskController.List"))
|
this.redirect(beego.URLFor("TaskController.List"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,13 @@ func (this *TaskController) List() {
|
|||||||
page = 1
|
page = 1
|
||||||
}
|
}
|
||||||
groupId, _ := this.GetInt("groupid")
|
groupId, _ := this.GetInt("groupid")
|
||||||
|
if groupId>0 {
|
||||||
|
this.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job")
|
||||||
|
}else {
|
||||||
|
arr := strings.Split(this.Ctx.GetCookie("groupid"), "|")
|
||||||
|
groupId,_= strconv.Atoi(arr[0])
|
||||||
|
}
|
||||||
|
|
||||||
filters := make([]interface{}, 0)
|
filters := make([]interface{}, 0)
|
||||||
if groupId > 0 {
|
if groupId > 0 {
|
||||||
filters = append(filters, "group_id", groupId)
|
filters = append(filters, "group_id", groupId)
|
||||||
@@ -51,6 +58,7 @@ func (this *TaskController) List() {
|
|||||||
row["description"] = v.Description
|
row["description"] = v.Description
|
||||||
row["group_id"] = v.GroupId
|
row["group_id"] = v.GroupId
|
||||||
row["group_name"] = groups_map[v.GroupId]
|
row["group_name"] = groups_map[v.GroupId]
|
||||||
|
row["is_odd"] = k%2
|
||||||
|
|
||||||
e := jobs.GetEntryById(v.Id)
|
e := jobs.GetEntryById(v.Id)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
|||||||
@@ -105,4 +105,9 @@ function batch(action) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//点击行换色
|
||||||
|
$('tbody tr').click(function(){
|
||||||
|
$(this).addClass("warning").siblings().removeClass("warning");
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<div class="collapse navbar-collapse">
|
<div class="collapse navbar-collapse">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="li-border">
|
<li class="li-border">
|
||||||
<a class="mystyle-color" href="#" style="font-size: 20px">定时任务管理后台</a>
|
<a class="mystyle-color" href="#" style="font-size: 20px">渠道定时任务管理后台 <span style="font-size: 12px">V1.1</span></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -104,18 +104,18 @@
|
|||||||
<label class="col-sm-3 control-label" for="notify">邮件通知</label>
|
<label class="col-sm-3 control-label" for="notify">邮件通知</label>
|
||||||
<div class="col-sm-6" >
|
<div class="col-sm-6" >
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="notify" value="0" checked> 不通知
|
<input type="radio" name="notify" value="0" checked readonly> 不通知
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="notify" value="1"> 执行失败通知
|
<input type="radio" name="notify" value="1" > 执行失败通知
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="radio-inline">
|
<label class="radio-inline">
|
||||||
<input type="radio" name="notify" value="2"> 执行结束通知
|
<input type="radio" name="notify" value="2" > 执行结束通知
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3" style="padding-top:5px;">
|
<div class="col-sm-3" style="padding-top:5px;">
|
||||||
|
<i style="font-size: 12px;color: red">暂不支持</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -156,6 +156,8 @@ $(function () {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$("input[name='notify']").click(function () {
|
$("input[name='notify']").click(function () {
|
||||||
|
// alert("暂不启用");
|
||||||
|
// return;
|
||||||
if ($(this).val() > 0) {
|
if ($(this).val() > 0) {
|
||||||
$('.notify_email').removeClass('hide');
|
$('.notify_email').removeClass('hide');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3" style="padding-top:5px;">
|
<div class="col-sm-3" style="padding-top:5px;">
|
||||||
|
<i style="font-size: 12px;color: red">暂不支持</i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{range $k,$v := .list}}
|
{{range $k,$v := .list}}
|
||||||
<tr>
|
<tr {{if eq $v.is_odd 0 }} style="background: #FFFFFF " {{else}} style="background: #f8f8f8" {{end}}>
|
||||||
<td class="chk"><input type="checkbox" name="ids" value="{{$v.id}}" /></td>
|
<td class="chk"><input type="checkbox" name="ids" value="{{$v.id}}" /></td>
|
||||||
<td> {{$v.id}} </td>
|
<td> {{$v.id}} </td>
|
||||||
<td>
|
<td>
|
||||||
@@ -80,8 +80,6 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{$v.name}}-{{$v.group_name}}
|
{{$v.name}}-{{$v.group_name}}
|
||||||
|
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td> {{$v.cron_spec}} </td>
|
<td> {{$v.cron_spec}} </td>
|
||||||
<td> {{$v.description}} </td>
|
<td> {{$v.description}} </td>
|
||||||
@@ -158,4 +156,8 @@ function batch(action) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
//点击行换色
|
||||||
|
$('tbody tr').click(function(){
|
||||||
|
$(this).addClass("warning").siblings().removeClass("warning");
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a href="{{urlfor "TaskController.Logs" "id" .task.Id}}" class="btn btn-default"><span class="icon-chevron-left"></span> 返 回</a>
|
<button class="btn btn-default reback"><span class="icon-chevron-left"></span> 返 回</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user