模板分隔符改为"{% %}"

develop
ouqiang 2018-01-28 15:48:37 +08:00
parent 50638e6dfa
commit 4c940c2088
24 changed files with 284 additions and 292 deletions

View File

@ -142,16 +142,8 @@ func RegisterMiddleware(m *macaron.Macaron) {
}
m.Use(macaron.Static(StaticDir))
m.Use(macaron.Renderer(macaron.RenderOptions{
Directory: "templates",
Extensions: []string{".html"},
// 模板语法分隔符,默认为 ["{{", "}}"]
Delims: macaron.Delims{"{{{", "}}}"},
// 追加的 Content-Type 头信息,默认为 "UTF-8"
Charset: "UTF-8",
// 渲染具有缩进格式的 JSON默认为不缩进
IndentJSON: true,
// 渲染具有缩进格式的 XML默认为不缩进
IndentXML: true,
Delims: macaron.Delims{"{%", "%}"},
Funcs: []template.FuncMap{map[string]interface{}{
"HostFormat": func(index int) bool {
return (index+1)%3 == 0

View File

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<title>{{{.Title}}}</title>
<title>{%.Title%}</title>
<link type="text/css" rel="stylesheet" href="/resource/css/framework.css" />
<link type="text/css" rel="stylesheet" href="/resource/css/main.css" />
<link type="text/css" rel="stylesheet" href="/resource/sweetalert/sweetalert.css" />
@ -29,29 +29,29 @@
</head>
<body>
<div class="page">
{{{if not .DisableNav}}}
{%if not .DisableNav%}
<!--header begin-->
<header>
<div class="bigcontainer">
<div id="logo">
{{{.AppName}}}
{%.AppName%}
</div>
<div class="user">
<div class="ui inline labeled icon top right pointing dropdown">
{{{if not .LoginUsername}}}
{%if not .LoginUsername%}
<i class="dropdown icon"></i>
<div class="menu">
<a class="item" href="/user/login"><i class="sign in icon"></i></a>
</div>
{{{else}}}
{{{.LoginUsername}}}
{%else%}
{%.LoginUsername%}
<i class="dropdown icon"></i>
<div class="menu">
<a href="/user/editMyPassword" class="item"><i class="edit icon"></i></a>
<a class="item" href="/user/logout"><i class="sign out icon"></i>退</a>
</div>
{{{end}}}
{%end%}
</div>
</div>
</div>
@ -60,13 +60,13 @@
<div class="ui teal inverted menu">
<div class="bigcontainer">
<div class="right menu">
<a class="item {{{if or (eq .Controller "task") (eq .Controller "delaytask")}}}active{{{end}}}" href="/task"><i class="tasks icon"></i></a>
<a class="item {{{if eq .Controller "host"}}}active{{{end}}}" href="/host"><i class="linux icon"></i></a>
{{{if .IsAdmin}}}
<a class="item {{{if eq .Controller "user"}}}active{{{end}}}" href="/user"><i class="user icon"></i></a>
<a class="item {{{if eq .Controller "manage"}}}active{{{end}}}" href="/manage/slack/edit"><i class="settings icon"></i></a>
{{{end}}}
<a class="item {%if or (eq .Controller "task") (eq .Controller "delaytask")%}active{%end%}" href="/task"><i class="tasks icon"></i></a>
<a class="item {%if eq .Controller "host"%}active{%end%}" href="/host"><i class="linux icon"></i></a>
{%if .IsAdmin%}
<a class="item {%if eq .Controller "user"%}active{%end%}" href="/user"><i class="user icon"></i></a>
<a class="item {%if eq .Controller "manage"%}active{%end%}" href="/manage/slack/edit"><i class="settings icon"></i></a>
{%end%}
</div>
</div>
</div>
{{{end}}}
{%end%}

View File

@ -1,41 +1,41 @@
{{{if gt .Pagination.Total 0}}}
{%if gt .Pagination.Total 0%}
<div class="ui pagination menu">
{{{if not .Pagination.IsFirst}}}
<a class="item" href="{{{.URI}}}?{{{ .Params.PageParams}}}&page=1">
{%if not .Pagination.IsFirst%}
<a class="item" href="{%.URI%}?{% .Params.PageParams%}&page=1">
</a>
{{{end}}}
{%end%}
{{{if .Pagination.HasPrevious}}}
<a class="icon item" href="{{{.URI}}}?{{{ .Params.PageParams}}}&page={{{.Pagination.Previous}}}">
{%if .Pagination.HasPrevious%}
<a class="icon item" href="{%.URI%}?{% .Params.PageParams%}&page={%.Pagination.Previous%}">
<i class="icon left arrow"></i>
</a>
{{{end}}}
{%end%}
{{{range .Pagination.Pages}}}
{{{if eq .Num -1}}}
{%range .Pagination.Pages%}
{%if eq .Num -1%}
<div class="disabled item">
...
</div>
{{{else}}}
<a class="icon {{{if .IsCurrent}}}active{{{end}}} item" href="{{{$.URI}}}?{{{ $.Params.PageParams}}}&page={{{.Num}}}">
{{{.Num}}}
{%else%}
<a class="icon {%if .IsCurrent%}active{%end%} item" href="{%$.URI%}?{% $.Params.PageParams%}&page={%.Num%}">
{%.Num%}
</a>
{{{end}}}
{{{end}}}
{%end%}
{%end%}
{{{if .Pagination.HasNext}}}
<a class="icon item" href="{{{.URI}}}?{{{ .Params.PageParams}}}&page={{{.Pagination.Next}}}">
{%if .Pagination.HasNext%}
<a class="icon item" href="{%.URI%}?{% .Params.PageParams%}&page={%.Pagination.Next%}">
<i class="icon right arrow"></i>
</a>
{{{end}}}
{{{if not .Pagination.IsLast}}}
<a class="icon item" href="{{{.URI}}}?{{{ .Params.PageParams}}}&page={{{.Pagination.TotalPages}}}">
{%end%}
{%if not .Pagination.IsLast%}
<a class="icon item" href="{%.URI%}?{% .Params.PageParams%}&page={%.Pagination.TotalPages%}">
</a>
{{{end}}}
<div class="item">{{{.Pagination.Total}}}/{{{.Pagination.TotalPages}}}</div>
{%end%}
<div class="item">{%.Pagination.Total%}/{%.Pagination.TotalPages%}</div>
</div>
{{{end}}}
{%end%}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<script>
swal({
title: "404 - NOT FOUND",
@ -9,4 +9,4 @@
location.href = "/"
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<script>
swal({
title: "500 - INTERNAL SERVER ERROR",
@ -8,4 +8,4 @@
confirmButtonText: "确定"
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,3 +1,3 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,7 +1,7 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "host/menu" . }}}
{% template "host/menu" . %}
<div class="twelve wide column">
<div class="pageHeader">
@ -14,24 +14,24 @@
</div>
</div>
<form class="ui form fluid vertical segment">
<input type="hidden" name="id" value="{{{.Host.Id}}}">
<input type="hidden" name="id" value="{%.Host.Id%}">
<div class="four fields">
<div class="field">
<label></label>
<div class="ui small input">
<input type="text" name="name" value="{{{.Host.Name}}}" placeholder="127.0.0.1">
<input type="text" name="name" value="{%.Host.Name%}" placeholder="127.0.0.1">
</div>
</div>
<div class="field">
<label></label>
<div class="ui small input">
<input type="text" name="port" value="{{{.Host.Port}}}" placeholder="5921">
<input type="text" name="port" value="{%.Host.Port%}" placeholder="5921">
</div>
</div>
<div class="field">
<label></label>
<div class="ui small input">
<input type="text" name="alias" value="{{{.Host.Alias}}}"
<input type="text" name="alias" value="{%.Host.Alias%}"
placeholder="节点名称如web">
</div>
</div>
@ -40,7 +40,7 @@
<div class="field">
<label></label>
<div class="ui small input">
<textarea rows="7" name="remark" >{{{.Host.Remark}}}</textarea>
<textarea rows="7" name="remark" >{%.Host.Remark%}</textarea>
</div>
</div>
</div>
@ -113,4 +113,4 @@
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,10 +1,10 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "host/menu" . }}}
{% template "host/menu" . %}
<div class="twelve wide column">
{{{if .IsAdmin}}}
{%if .IsAdmin%}
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
@ -17,14 +17,14 @@
</h3>
</div>
</div>
{{{end}}}
{%end%}
<form class="ui form">
<div class="three fields">
<div class="field">
<input type="text" placeholder="ID" name="id" value="{{{if gt .Params.Id 0}}}{{{.Params.Id}}}{{{end}}}">
<input type="text" placeholder="ID" name="id" value="{%if gt .Params.Id 0%}{%.Params.Id%}{%end%}">
</div>
<div class="field">
<input type="text" placeholder="主机名" name="name" value="{{{.Params.Name}}}">
<input type="text" placeholder="主机名" name="name" value="{%.Params.Name%}">
</div>
<div class="field">
<button class="ui linkedin submit button"></button>
@ -43,30 +43,30 @@
</tr>
</thead>
<tbody>
{{{range $i, $v := .Hosts}}}
{%range $i, $v := .Hosts%}
<tr>
<td>{{{.Id}}}</td>
<td>{{{.Name}}}</td>
<td>{{{.Alias}}}</td>
<td>{{{.Port}}}</td>
<td>{{{.Remark}}}</td>
<td>{%.Id%}</td>
<td>{%.Name%}</td>
<td>{%.Alias%}</td>
<td>{%.Port%}</td>
<td>{%.Remark%}</td>
<td class="operation">
{{{if $.IsAdmin}}}
<a class="ui purple button" href="/host/edit/{{{.Id}}}"></a>
<button class="ui positive button" onclick="util.removeConfirm('/host/remove/{{{.Id}}}')"></button><br>
{{{end}}}
{%if $.IsAdmin%}
<a class="ui purple button" href="/host/edit/{%.Id%}"></a>
<button class="ui positive button" onclick="util.removeConfirm('/host/remove/{%.Id%}')"></button><br>
{%end%}
<div style="margin-top: 5px;">
<a class="ui twitter button" href="/task?host_id={{{.Id}}}"></a>
{{{if $.IsAdmin}}}
<button class="ui blue button" @click="ping({{{.Id}}})"></button>
{{{end}}}
<a class="ui twitter button" href="/task?host_id={%.Id%}"></a>
{%if $.IsAdmin%}
<button class="ui blue button" @click="ping({%.Id%})"></button>
{%end%}
</div>
</td>
</tr>
{{{end}}}
{%end%}
</tbody>
</table>
{{{ template "common/pagination" .}}}
{% template "common/pagination" .%}
</div>
</div>
@ -83,4 +83,4 @@
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,7 +1,7 @@
<div class="four wide column">
<div class="verticalMenu">
<div class="ui vertical pointing menu fluid">
<a class="{{{if eq .URI "/host"}}}active teal{{{end}}} item" href="/host">
<a class="{%if eq .URI "/host"%}active teal{%end%} item" href="/host">
<i class="linux icon"></i>
</a>
</div>

View File

@ -1,7 +1,7 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "install/menu" . }}}
{% template "install/menu" . %}
<div class="ten wide column">
<form class="ui form">
<div class="ui blue center aligned segment">
@ -186,4 +186,4 @@
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,7 +1,7 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "manage/menu" . }}}
{% template "manage/menu" . %}
<div class="twelve wide column">
<div class="pageHeader">
@ -22,18 +22,18 @@
</tr>
</thead>
<tbody>
{{{range $i, $v := .LoginLogs}}}
{%range $i, $v := .LoginLogs%}
<tr>
<td>{{{.Username}}}</td>
<td>{{{.Ip}}}</td>
<td>{{{.Created}}}</td>
<td>{%.Username%}</td>
<td>{%.Ip%}</td>
<td>{%.Created%}</td>
</tr>
{{{end}}}
{%end%}
</tbody>
</table>
{{{ template "common/pagination" .}}}
{% template "common/pagination" .%}
</div>
</div>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,12 +1,12 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{template "manage/menu" .}}}
{%template "manage/menu" .%}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<div class="content">
{{{.Title}}}
{%.Title%}
</div>
</h3>
</div>
@ -19,7 +19,7 @@
SMTP
</label>
<div class="ui small input">
<input type="text" name="host" value="{{{.Mail.Host}}}">
<input type="text" name="host" value="{%.Mail.Host%}">
</div>
</div>
<div class="field">
@ -27,7 +27,7 @@
</label>
<div class="ui small input">
<input type="text" name="port" value="{{{if gt .Mail.Port 0}}}{{{.Mail.Port}}}{{{end}}}">
<input type="text" name="port" value="{%if gt .Mail.Port 0%}{%.Mail.Port%}{%end%}">
</div>
</div>
<div class="field">
@ -35,7 +35,7 @@
</label>
<div class="ui small input">
<input type="text" name="user" value="{{{.Mail.User}}}">
<input type="text" name="user" value="{%.Mail.User%}">
</div>
</div>
<div class="field">
@ -43,25 +43,25 @@
</label>
<div class="ui small input">
<input type="text" name="password" value="{{{.Mail.Password}}}">
<input type="text" name="password" value="{%.Mail.Password%}">
</div>
</div>
</div>
<button class="ui primary button"></button>
{{{if .Mail.Host}}}
{%if .Mail.Host%}
<a class="ui green button" onclick="clearMailServer()"></a>
{{{end}}}
{%end%}
<br><br><br>
<div>
<div class="content"></div><p></p>
<div class="fields">
{{{range $i, $v := .Mail.MailUsers}}}
{%range $i, $v := .Mail.MailUsers%}
<div class="field">
<div class="ui segment">
{{{.Username}}}-{{{.Email}}}&nbsp;&nbsp;&nbsp;<div class="ui blue button" onclick="removeMailUser({{{.Id}}})"></div>
{%.Username%}-{%.Email%}&nbsp;&nbsp;&nbsp;<div class="ui blue button" onclick="removeMailUser({%.Id%})"></div>
</div>
</div>
{{{end}}}
{%end%}
</div>
</div>
</form>
@ -198,4 +198,4 @@
});
}
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,13 +1,13 @@
<div class="three wide column">
<div class="verticalMenu">
<div class="ui vertical pointing menu fluid">
<a class="{{{if eq .URI "/manage/slack/edit"}}}active teal{{{end}}} item" href="/manage/slack/edit">
<a class="{%if eq .URI "/manage/slack/edit"%}active teal{%end%} item" href="/manage/slack/edit">
<i class="slack icon"></i> Slack
</a>
<a class="{{{if eq .URI "/manage/mail/edit"}}}active teal{{{end}}} item" href="/manage/mail/edit">
<a class="{%if eq .URI "/manage/mail/edit"%}active teal{%end%} item" href="/manage/mail/edit">
<i class="slack icon"></i>
</a>
<a class="{{{if eq .URI "/manage/login-log"}}}active teal{{{end}}} item" href="/manage/login-log">
<a class="{%if eq .URI "/manage/login-log"%}active teal{%end%} item" href="/manage/login-log">
<i class="slack icon"></i>
</a>
</div>

View File

@ -1,12 +1,12 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{template "manage/menu" .}}}
{%template "manage/menu" .%}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<div class="content">
{{{.Title}}}
{%.Title%}
</div>
</h3>
</div>
@ -18,7 +18,7 @@
<div class="content">Slack WebHook URL</div>
</label>
<div class="ui small input">
<input type="text" id="url" value="{{{.Slack.Url}}}">
<input type="text" id="url" value="{%.Slack.Url%}">
</div>
</div>
<div class="ui primary button" @click="updateUrl"></div>
@ -27,13 +27,13 @@
<div>
<div class="content">Slack Channel(Channel)</div><p></p>
<div class="fields">
{{{range $i, $v := .Slack.Channels}}}
{%range $i, $v := .Slack.Channels%}
<div class="field">
<div class="ui segment">
{{{.Name}}}&nbsp;&nbsp;&nbsp;<div class="ui blue button" @click="removeChannel({{{.Id}}})"></div>
{%.Name%}&nbsp;&nbsp;&nbsp;<div class="ui blue button" @click="removeChannel({%.Id%})"></div>
</div>
</div>
{{{end}}}
{%end%}
</div>
</div>
<div class="ui facebook button" @click="createChannel">Channel</div>
@ -85,4 +85,4 @@
}
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,8 +1,8 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{template "task/menu" .}}}
{%template "task/menu" .%}
<div class="twelve wide column">
{{{if .IsAdmin}}}
{%if .IsAdmin%}
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
@ -15,40 +15,40 @@
</h3>
</div>
</div>
{{{end}}}
{%end%}
<form class="ui form">
<div class="six fields search">
<div class="one wide field">
<input type="text" placeholder="任务ID" name="id" value="{{{if gt .Params.Id 0}}}{{{.Params.Id}}}{{{end}}}">
<input type="text" placeholder="任务ID" name="id" value="{%if gt .Params.Id 0%}{%.Params.Id%}{%end%}">
</div>
<div class="field">
<input type="text" placeholder="任务名称" name="name" value="{{{.Params.Name}}}">
<input type="text" placeholder="任务名称" name="name" value="{%.Params.Name%}">
</div>
<div class="field">
<input type="text" placeholder="标签名称" name="tag" value="{{{.Params.Tag}}}">
<input type="text" placeholder="标签名称" name="tag" value="{%.Params.Tag%}">
</div>
</div>
<div class="six fields search">
<div class="field">
<select name="host_id" id="hostId">
<option value=""></option>
{{{range $i, $v := .Hosts}}}
<option value="{{{.Id}}}" {{{if eq $.Params.HostId .Id }}} selected {{{end}}} >{{{.Alias}}}-{{{.Name}}}</option>
{{{end}}}
{%range $i, $v := .Hosts%}
<option value="{%.Id%}" {%if eq $.Params.HostId .Id %} selected {%end%} >{%.Alias%}-{%.Name%}</option>
{%end%}
</select>
</div>
<div class="field">
<select name="protocol" id="protocol">
<option value="0"></option>
<option value="2" {{{if eq .Params.Protocol 2}}}selected{{{end}}} data-match="host_id" data-validate-type="selectProtocol">SHELL</option>
<option value="1" {{{if eq .Params.Protocol 1}}}selected{{{end}}}>HTTP</option>
<option value="2" {%if eq .Params.Protocol 2%}selected{%end%} data-match="host_id" data-validate-type="selectProtocol">SHELL</option>
<option value="1" {%if eq .Params.Protocol 1%}selected{%end%}>HTTP</option>
</select>
</div>
<div class="field">
<select name="status">
<option value="0"></option>
<option value="1" {{{if eq .Params.Status 0}}}selected{{{end}}} ></option>
<option value="2" {{{if eq .Params.Status 1}}}selected{{{end}}}></option>
<option value="1" {%if eq .Params.Status 0%}selected{%end%} ></option>
<option value="2" {%if eq .Params.Status 1%}selected{%end%}></option>
</select>
</div>
<div class="field">
@ -56,7 +56,7 @@
</div>
</div>
</form>
{{{if .IsAdmin}}}
{%if .IsAdmin%}
<div class="field">
<select id="batch-operation">
<option value="0"></option>
@ -65,16 +65,16 @@
<option value="3"></option>
</select>
</div>
{{{end}}}
{%end%}
<br>
<table class="ui celled table task-list">
<thead>
<tr>
{{{if .IsAdmin}}}
{%if .IsAdmin%}
<th>
<input type="checkbox" onclick="checkAll(this)" style="width:25px;height: 25px;">
</th>
{{{end}}}
{%end%}
<th>ID</th>
<th></th>
<th></th>
@ -90,58 +90,58 @@
</tr>
</thead>
<tbody>
{{{range $i, $v := .Tasks}}}
{%range $i, $v := .Tasks%}
<tr>
{{{if $.IsAdmin}}}
{%if $.IsAdmin%}
<td>
<input type="checkbox"
class="sub-check"
data-id="{{{.Id}}}"
data-id="{%.Id%}"
style="width:25px;height: 25px;">
</td>
{{{end}}}
<td>{{{.Id}}}</td>
<td>{{{.Name}}}</td>
<td>{{{if eq .Level 1}}}{{{else}}}{{{end}}}</td>
<td>{{{.Tag}}}</td>
<td>{{{.Spec}}}</td>
<td>{{{if eq .Protocol 1}}} HTTP {{{else if eq .Protocol 2}}} SHELL {{{end}}}</td>
<td>{{{if eq .Timeout -1}}}{{{else if gt .Timeout 0}}}{{{.Timeout}}}{{{else}}}{{{end}}}</td>
<td>{{{.RetryTimes}}}</td>
<td>{{{if gt .Multi 0}}}{{{else}}}{{{end}}}</td>
{%end%}
<td>{%.Id%}</td>
<td>{%.Name%}</td>
<td>{%if eq .Level 1%}{%else%}{%end%}</td>
<td>{%.Tag%}</td>
<td>{%.Spec%}</td>
<td>{%if eq .Protocol 1%} HTTP {%else if eq .Protocol 2%} SHELL {%end%}</td>
<td>{%if eq .Timeout -1%}{%else if gt .Timeout 0%}{%.Timeout%}{%else%}{%end%}</td>
<td>{%.RetryTimes%}</td>
<td>{%if gt .Multi 0%}{%else%}{%end%}</td>
<td>
{{{range $k, $h := .Hosts}}}
{{{$h.Alias}}}<br>
{{{end}}}
{%range $k, $h := .Hosts%}
{%$h.Alias%}<br>
{%end%}
</td>
<td>
{{{if eq .Level 1}}}
{{{if eq .Status 1}}}<span><i class="checkmark big icon"></i></span>{{{else}}}<span><i class="minus big icon"></i><span>{{{end}}}
{{{end}}}
{%if eq .Level 1%}
{%if eq .Status 1%}<span><i class="checkmark big icon"></i></span>{%else%}<span><i class="minus big icon"></i><span>{%end%}
{%end%}
</td>
<td>
<div class="ui buttons operation">
{{{if $.IsAdmin}}}
<a href="/task/edit/{{{.Id}}}" ><i class="edit big icon" title="编辑"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
{{{if eq .Level 1}}}
{{{if eq .Status 1}}}
<a href="javascript:void(0);" @click="changeStatus({{{.Id}}},{{{.Status}}})"><i class="pause circle big icon" title="停止"></i></a>&nbsp;&nbsp;
{{{else}}}
<a href="javascript:void(0);" @click="changeStatus({{{.Id}}},{{{.Status}}})"><i class="play big icon" title="激活"></i></a>&nbsp;&nbsp;
{{{end}}}
{{{end}}}
<a href="javascript:void(0);" @click="remove({{{.Id}}})"><i class="remove big icon" title="删除"></i></a>
<a href="javascript:void(0);" @click="run({{{.Id}}})"><i class="rocket big icon" title="手动执行"></i></a>&nbsp;&nbsp;
{{{end}}}
{%if $.IsAdmin%}
<a href="/task/edit/{%.Id%}" ><i class="edit big icon" title="编辑"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
{%if eq .Level 1%}
{%if eq .Status 1%}
<a href="javascript:void(0);" @click="changeStatus({%.Id%},{%.Status%})"><i class="pause circle big icon" title="停止"></i></a>&nbsp;&nbsp;
{%else%}
<a href="javascript:void(0);" @click="changeStatus({%.Id%},{%.Status%})"><i class="play big icon" title="激活"></i></a>&nbsp;&nbsp;
{%end%}
{%end%}
<a href="javascript:void(0);" @click="remove({%.Id%})"><i class="remove big icon" title="删除"></i></a>
<a href="javascript:void(0);" @click="run({%.Id%})"><i class="rocket big icon" title="手动执行"></i></a>&nbsp;&nbsp;
{%end%}
<a href="/task/log?task_id={{{.Id}}}"><i class="bar chart icon big" title="查看日志"></i></a>
<a href="/task/log?task_id={%.Id%}"><i class="bar chart icon big" title="查看日志"></i></a>
</div>
</td>
</tr>
{{{end}}}
{%end%}
</tbody>
</table>
{{{ template "common/pagination" .}}}
{% template "common/pagination" .%}
</div>
</div>
@ -239,4 +239,4 @@
}
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<style type="text/css">
pre {
white-space: pre-wrap;
@ -10,10 +10,10 @@
</style>
<div class="ui grid">
<!--the vertical menu-->
{{{ template "task/menu" . }}}
{% template "task/menu" . %}
<div class="twelve wide column">
{{{if .IsAdmin}}}
{%if .IsAdmin%}
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
@ -23,26 +23,26 @@
</h3>
</div>
</div>
{{{end}}}
{%end%}
<form class="ui form">
<div class="six fields search">
<div class="field">
<input type="text" placeholder="任务ID" name="task_id" value="{{{if gt .Params.TaskId 0}}}{{{.Params.TaskId}}}{{{end}}}">
<input type="text" placeholder="任务ID" name="task_id" value="{%if gt .Params.TaskId 0%}{%.Params.TaskId%}{%end%}">
</div>
<div class="field">
<select name="protocol" id="protocol">
<option value="0"></option>
<option value="2" {{{if eq .Params.Protocol 2}}}selected{{{end}}} data-match="host_id" data-validate-type="selectProtocol">SHELL</option>
<option value="1" {{{if eq .Params.Protocol 1}}}selected{{{end}}}>HTTP</option>
<option value="2" {%if eq .Params.Protocol 2%}selected{%end%} data-match="host_id" data-validate-type="selectProtocol">SHELL</option>
<option value="1" {%if eq .Params.Protocol 1%}selected{%end%}>HTTP</option>
</select>
</div>
<div class="field">
<select name="status">
<option value="0"></option>
<option value="1" {{{if eq .Params.Status 0}}}selected{{{end}}} ></option>
<option value="2" {{{if eq .Params.Status 1}}}selected{{{end}}}></option>
<option value="3" {{{if eq .Params.Status 2}}}selected{{{end}}}></option>
<option value="4" {{{if eq .Params.Status 3}}}selected{{{end}}}></option>
<option value="1" {%if eq .Params.Status 0%}selected{%end%} ></option>
<option value="2" {%if eq .Params.Status 1%}selected{%end%}></option>
<option value="3" {%if eq .Params.Status 2%}selected{%end%}></option>
<option value="4" {%if eq .Params.Status 3%}selected{%end%}></option>
</select>
</div>
<div class="field">
@ -65,54 +65,54 @@
</tr>
</thead>
<tbody>
{{{range $i, $v := .Logs}}}
{%range $i, $v := .Logs%}
<tr>
<td><a href="/task?id={{{.TaskId}}}">{{{.TaskId}}}</a></td>
<td>{{{.Name}}}</td>
<td>{{{.Spec}}}</td>
<td>{{{if eq .Protocol 1}}} HTTP {{{else if eq .Protocol 2}}} SHELL {{{end}}}</td>
<td>{{{.RetryTimes}}}</td>
<td>{{{unescape .Hostname}}}</td>
<td><a href="/task?id={%.TaskId%}">{%.TaskId%}</a></td>
<td>{%.Name%}</td>
<td>{%.Spec%}</td>
<td>{%if eq .Protocol 1%} HTTP {%else if eq .Protocol 2%} SHELL {%end%}</td>
<td>{%.RetryTimes%}</td>
<td>{%unescape .Hostname%}</td>
<td>
{{{if and (ne .Status 3) (ne .Status 4)}}}
{{{if gt .TotalTime 0}}}{{{.TotalTime}}}{{{else}}}1{{{end}}}<br>
: {{{.StartTime.Format "2006-01-02 15:04:05" }}}<br>
{{{if ne .Status 1}}}
: {{{.EndTime.Format "2006-01-02 15:04:05" }}}
{{{end}}}
{{{end}}}
{%if and (ne .Status 3) (ne .Status 4)%}
{%if gt .TotalTime 0%}{%.TotalTime%}{%else%}1{%end%}<br>
: {%.StartTime.Format "2006-01-02 15:04:05" %}<br>
{%if ne .Status 1%}
: {%.EndTime.Format "2006-01-02 15:04:05" %}
{%end%}
{%end%}
</td>
<td>
{{{if eq .Status 2}}}
{%if eq .Status 2%}
{{{else if eq .Status 1}}}
{%else if eq .Status 1%}
<span style="color:green"></span>
{{{else if eq .Status 0}}}
{%else if eq .Status 0%}
<span style="color:red"></span>
{{{else if eq .Status 3}}}
{%else if eq .Status 3%}
<span style="color:#4499EE"></span>
{{{end}}}
{%end%}
</td>
<td>
{{{if or (eq .Status 2) (eq .Status 0)}}}
{%if or (eq .Status 2) (eq .Status 0)%}
<button class="ui small primary button"
onclick="showResult('{{{.Name}}}', '{{{.Command}}}', '{{{.Result}}}')"
onclick="showResult('{%.Name%}', '{%.Command%}', '{%.Result%}')"
>
</button>
{{{end}}}
{%end%}
{{{if $.IsAdmin}}}
{{{if and (eq .Status 1) (eq .Protocol 2) }}}
<button class="ui small blue button" onclick="stopTask({{{.Id}}}, {{{.TaskId}}})"></button>
{{{end}}}
{{{end}}}
{%if $.IsAdmin%}
{%if and (eq .Status 1) (eq .Protocol 2) %}
<button class="ui small blue button" onclick="stopTask({%.Id%}, {%.TaskId%})"></button>
{%end%}
{%end%}
</td>
</tr>
{{{end}}}
{%end%}
</tbody>
</table>
{{{ template "common/pagination" .}}}
{% template "common/pagination" .%}
</div>
</div>
@ -171,4 +171,4 @@
});
}
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,10 +1,10 @@
<div class="three wide column">
<div class="verticalMenu">
<div class="ui vertical pointing menu fluid">
<a class="{{{if eq .URI "/task"}}}active teal{{{end}}} item" href="/task">
<a class="{%if eq .URI "/task"%}active teal{%end%} item" href="/task">
<i class="tasks icon"></i>
</a>
<a class="item {{{if eq .URI "/task/log"}}}active teal{{{end}}} " href="/task/log">
<a class="item {%if eq .URI "/task/log"%}active teal{%end%} " href="/task/log">
<i class="bar chart icon"></i>
</a>
</div>

View File

@ -1,25 +1,25 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{template "task/menu" .}}}
{%template "task/menu" .%}
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<div class="content">
{{{.Title}}}
{%.Title%}
</div>
</h3>
</div>
</div>
<form class="ui form fluid vertical segment">
<input type="hidden" name="id" value="{{{.Task.Id}}}">
<input type="hidden" name="id" value="{%.Task.Id%}">
<div class="two fields">
<div class="field">
<label>
<div class="content"></div>
</label>
<div class="ui small input">
<input type="text" name="name" placeholder="任务名称" value="{{{.Task.Name}}}">
<input type="text" name="name" placeholder="任务名称" value="{%.Task.Name%}">
</div>
</div>
@ -28,7 +28,7 @@
<div class="content"></div>
</label>
<div class="ui small input">
<input type="text" name="tag" placeholder="标签用于任务分类" value="{{{.Task.Tag}}}">
<input type="text" name="tag" placeholder="标签用于任务分类" value="{%.Task.Tag%}">
</div>
</div>
</div>
@ -41,9 +41,9 @@
</div>
</label>
<select name="level" id="level" {{{if .Task}}}disabled="disabled"{{{end}}}>
<option value="1" {{{if .Task}}} {{{if eq .Task.Level 1}}}selected{{{end}}} {{{end}}}></option>
<option value="2" {{{if .Task}}} {{{if eq .Task.Level 2}}}selected{{{end}}} {{{end}}}></option>
<select name="level" id="level" {%if .Task%}disabled="disabled"{%end%}>
<option value="1" {%if .Task%} {%if eq .Task.Level 1%}selected{%end%} {%end%}></option>
<option value="2" {%if .Task%} {%if eq .Task.Level 2%}selected{%end%} {%end%}></option>
</select>
</div>
</div>
@ -58,8 +58,8 @@
</div>
</label>
<select name="dependency_status" id="dependency_status">
<option value="1" {{{if .Task}}} {{{if eq .Task.DependencyStatus 1}}}selected{{{end}}} {{{end}}}></option>
<option value="2" {{{if .Task}}} {{{if eq .Task.DependencyStatus 2}}}selected{{{end}}} {{{end}}}></option>
<option value="1" {%if .Task%} {%if eq .Task.DependencyStatus 1%}selected{%end%} {%end%}></option>
<option value="2" {%if .Task%} {%if eq .Task.DependencyStatus 2%}selected{%end%} {%end%}></option>
</select>
</div>
<div class="field">
@ -71,7 +71,7 @@
</div>
</label>
<div class="ui small input">
<input type="text" name="dependency_task_id" placeholder="可选" value="{{{.Task.DependencyTaskId}}}">
<input type="text" name="dependency_task_id" placeholder="可选" value="{%.Task.DependencyTaskId%}">
</div>
</div>
</div>
@ -83,7 +83,7 @@
</div>
</label>
<div class="ui small input">
<input type="text" name="spec" value="{{{.Task.Spec}}}" placeholder="秒 分 时 天 月 周"/>
<input type="text" name="spec" value="{%.Task.Spec%}" placeholder="秒 分 时 天 月 周"/>
</div>
</div>
</div>
@ -92,9 +92,9 @@
<div class="field">
<label></label>
<select name="protocol" id="protocol">
<option value="2" {{{if .Task}}} {{{if eq .Task.Protocol 2}}}selected{{{end}}} {{{end}}}
<option value="2" {%if .Task%} {%if eq .Task.Protocol 2%}selected{%end%} {%end%}
data-validate-type="selectProtocol">SHELL</option>
<option value="1" {{{if .Task}}} {{{if eq .Task.Protocol 1}}}selected{{{end}}} {{{end}}}>HTTP</option>
<option value="1" {%if .Task%} {%if eq .Task.Protocol 1%}selected{%end%} {%end%}>HTTP</option>
</select>
</div>
</div>
@ -102,12 +102,12 @@
<div class="field">
<label></label>
<div id="hostId">
{{{range $i, $v := .Hosts}}}
{%range $i, $v := .Hosts%}
<label>
<input type="checkbox" value="{{{.Id}}}" {{{if $.Task}}}{{{if $v.Selected}}} checked {{{end}}}{{{end}}} style="width:25px;height: 25px;">{{{.Alias}}}-{{{.Name}}}
{{{if (HostFormat $i) }}}<br>{{{end}}}
<input type="checkbox" value="{%.Id%}" {%if $.Task%}{%if $v.Selected%} checked {%end%}{%end%} style="width:25px;height: 25px;">{%.Alias%}-{%.Name%}
{%if (HostFormat $i) %}<br>{%end%}
</label>
{{{end}}}
{%end%}
</div> &nbsp; <br> <a class="ui blue button" href="/host/create" target="_blank"></a>
</div>
@ -116,8 +116,8 @@
<div class="field">
<label></label>
<select name="http_method">
<option value="1" {{{if .Task}}} {{{if eq .Task.HttpMethod 1}}}selected{{{end}}} {{{end}}}>GET</option>
<option value="2" {{{if .Task}}} {{{if eq .Task.HttpMethod 2}}}selected{{{end}}} {{{end}}}
<option value="1" {%if .Task%} {%if eq .Task.HttpMethod 1%}selected{%end%} {%end%}>GET</option>
<option value="2" {%if .Task%} {%if eq .Task.HttpMethod 2%}selected{%end%} {%end%}
data-validate-type="selectProtocol">POST</option>
</select>
</div>
@ -125,19 +125,19 @@
<div class="two fields">
<div class="field">
<label></label>
<textarea rows="5" name="command" placeholder="请输入系统命令" id="command">{{{.Task.Command}}}</textarea>
<textarea rows="5" name="command" placeholder="请输入系统命令" id="command">{%.Task.Command%}</textarea>
</div>
</div>
<div class="two fields">
<div class="field">
<label>(, 0-86400)</label>
<input type="text" name="timeout" placeholder="默认0, 不限制" value="{{{if .Task}}} {{{.Task.Timeout}}} {{{else}}}0{{{end}}}">
<input type="text" name="timeout" placeholder="默认0, 不限制" value="{%if .Task%} {%.Task.Timeout%} {%else%}0{%end%}">
</div>
<div class="field">
<label></label>
<select name="multi">
<option value="2" {{{if .Task}}} {{{if eq .Task.Multi 0}}}selected{{{end}}} {{{end}}}></option>
<option value="1"{{{if .Task}}} {{{if eq .Task.Multi 1}}}selected{{{end}}} {{{end}}}></option>
<option value="2" {%if .Task%} {%if eq .Task.Multi 0%}selected{%end%} {%end%}></option>
<option value="1"{%if .Task%} {%if eq .Task.Multi 1%}selected{%end%} {%end%}></option>
</select>
</div>
</div>
@ -145,11 +145,11 @@
<div class="two fields">
<div class="field">
<label> (0-10)</label>
<input type="text" name="retry_times" placeholder="默认0, 不重试" value="{{{if .Task}}} {{{.Task.RetryTimes}}} {{{else}}}0{{{end}}}">
<input type="text" name="retry_times" placeholder="默认0, 不重试" value="{%if .Task%} {%.Task.RetryTimes%} {%else%}0{%end%}">
</div>
<div class="field">
<label> (, 0-3600)</label>
<input type="text" name="retry_interval" placeholder="默认0, 执行默认重试策略" value="{{{if .Task}}} {{{.Task.RetryInterval}}} {{{else}}}0{{{end}}}">
<input type="text" name="retry_interval" placeholder="默认0, 执行默认重试策略" value="{%if .Task%} {%.Task.RetryInterval%} {%else%}0{%end%}">
</div>
</div>
@ -157,9 +157,9 @@
<div class="field">
<label></label>
<select name="notify_status" id="task-status">
<option value="1"{{{if .Task}}} {{{if eq .Task.NotifyStatus 0}}}selected{{{end}}} {{{end}}}></option>
<option value="2" {{{if .Task}}} {{{if eq .Task.NotifyStatus 1}}}selected{{{end}}} {{{end}}}></option>
<option value="3" {{{if .Task}}} {{{if eq .Task.NotifyStatus 2}}}selected{{{end}}} {{{end}}}></option>
<option value="1"{%if .Task%} {%if eq .Task.NotifyStatus 0%}selected{%end%} {%end%}></option>
<option value="2" {%if .Task%} {%if eq .Task.NotifyStatus 1%}selected{%end%} {%end%}></option>
<option value="3" {%if .Task%} {%if eq .Task.NotifyStatus 2%}selected{%end%} {%end%}></option>
</select>
</div>
</div>
@ -167,9 +167,9 @@
<div class="field" >
<label></label>
<select name="notify_type">
<option value="1"{{{if .Task}}} {{{if eq .Task.NotifyType 0}}}selected{{{end}}} {{{end}}}></option>
<option value="2" {{{if .Task}}} {{{if eq .Task.NotifyType 1}}}selected{{{end}}} {{{end}}}></option>
<option value="3" {{{if .Task}}} {{{if eq .Task.NotifyType 2}}}selected{{{end}}} {{{end}}}>Slack</option>
<option value="1"{%if .Task%} {%if eq .Task.NotifyType 0%}selected{%end%} {%end%}></option>
<option value="2" {%if .Task%} {%if eq .Task.NotifyType 1%}selected{%end%} {%end%}></option>
<option value="3" {%if .Task%} {%if eq .Task.NotifyType 2%}selected{%end%} {%end%}>Slack</option>
</select>
</div>
</div>
@ -177,7 +177,7 @@
<div class="two fields">
<div class="field">
<label></label>
<textarea rows="5" name="remark" placeholder="任务备注信息">{{{.Task.Remark}}}</textarea>
<textarea rows="5" name="remark" placeholder="任务备注信息">{%.Task.Remark%}</textarea>
</div>
</div>
<div class="ui primary submit button"></div> <a class="ui button" onclick="location.href='/task';"></a>
@ -256,11 +256,11 @@
}
function showNotify() {
var notifyStatus = {{{.Task.NotifyStatus}}};
var notifyStatus = {%.Task.NotifyStatus%};
if (notifyStatus > 0) {
$('#task-notify-type').show();
}
var notifyReceiverIds = '{{{.Task.NotifyReceiverId}}}'.split(',');
var notifyReceiverIds = '{%.Task.NotifyReceiverId%}'.split(',');
changeNotify(notifyReceiverIds);
}
@ -465,4 +465,4 @@
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui small modal">
<div class="header"></div>
<div class="content">
@ -70,4 +70,4 @@
inline : true
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui small modal">
<div class="header"></div>
<div class="content">
@ -25,7 +25,7 @@
$('.ui.form').form(
{
onSuccess: function(event, fields) {
util.post('/user/editPassword/{{{.Id}}}', fields, function(code, message) {
util.post('/user/editPassword/{%.Id%}', fields, function(code, message) {
swal("操作成功", '', 'success');
location.href = "/user"
});
@ -55,4 +55,4 @@
inline : true
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,7 +1,7 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "user/menu" . }}}
{% template "user/menu" . %}
<div class="twelve wide column">
<div class="pageHeader">
@ -28,30 +28,30 @@
</tr>
</thead>
<tbody>
{{{range $i, $v := .Users}}}
{%range $i, $v := .Users%}
<tr>
<td>{{{.Id}}}</td>
<td>{{{.Name}}}</td>
<td>{{{.Email}}}</td>
<td>{{{if .IsAdmin}}}{{{else}}}{{{end}}}</td>
<td>{{{if .Status}}}{{{else}}}{{{end}}}</td>
<td>{%.Id%}</td>
<td>{%.Name%}</td>
<td>{%.Email%}</td>
<td>{%if .IsAdmin%}{%else%}{%end%}</td>
<td>{%if .Status%}{%else%}{%end%}</td>
<td class="operation">
<a class="ui purple button" href="/user/edit/{{{.Id}}}"></a>
{{{if eq .Status 1}}}
<button class="ui button red" onclick="changeStatus({{{.Id}}},{{{.Status}}})"></button>&nbsp;&nbsp;
{{{else}}}
<button class="ui button twitter" onclick="changeStatus({{{.Id}}},{{{.Status}}})"></button>&nbsp;&nbsp;
{{{end}}}
<a href="/user/editPassword/{{{.Id}}}">
<a class="ui purple button" href="/user/edit/{%.Id%}"></a>
{%if eq .Status 1%}
<button class="ui button red" onclick="changeStatus({%.Id%},{%.Status%})"></button>&nbsp;&nbsp;
{%else%}
<button class="ui button twitter" onclick="changeStatus({%.Id%},{%.Status%})"></button>&nbsp;&nbsp;
{%end%}
<a href="/user/editPassword/{%.Id%}">
<button class="ui button facebook"></button>
</a>
<button class="ui positive button" onclick="util.removeConfirm('/user/remove/{{{.Id}}}')"></button>
<button class="ui positive button" onclick="util.removeConfirm('/user/remove/{%.Id%}')"></button>
</td>
</tr>
{{{end}}}
{%end%}
</tbody>
</table>
{{{ template "common/pagination" .}}}
{% template "common/pagination" .%}
</div>
</div>
@ -70,4 +70,4 @@
}
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,4 +1,4 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui small modal">
<div class="header"></div>
<div class="content">
@ -15,7 +15,7 @@
</div>
<div class="two fields">
<div class="field">
{{{.Captcha.CreateHtml}}}
{%.Captcha.CreateHtml%}
<input type="text" name="captcha" placeholder="验证码">
</div>
</div>
@ -71,4 +71,4 @@
inline : true
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}

View File

@ -1,7 +1,7 @@
<div class="four wide column">
<div class="verticalMenu">
<div class="ui vertical pointing menu fluid">
<a class="{{{if eq .URI "/user"}}}active teal{{{end}}} item" href="/user">
<a class="{%if eq .URI "/user"%}active teal{%end%} item" href="/user">
<i class="user icon"></i>
</a>
</div>

View File

@ -1,7 +1,7 @@
{{{ template "common/header" . }}}
{% template "common/header" . %}
<div class="ui grid">
{{{ template "user/menu" . }}}
{% template "user/menu" . %}
<div class="twelve wide column">
<div class="pageHeader">
@ -14,22 +14,22 @@
</div>
</div>
<form class="ui form fluid vertical segment">
<input type="hidden" name="id" value="{{{.User.Id}}}">
<input type="hidden" name="id" value="{%.User.Id%}">
<div class="three fields">
<div class="field">
<label></label>
<div class="ui small input">
<input type="text" name="name" value="{{{.User.Name}}}" placeholder="请输入用户名">
<input type="text" name="name" value="{%.User.Name%}" placeholder="请输入用户名">
</div>
</div>
<div class="field">
<label></label>
<div class="ui small input">
<input type="text" name="email" value="{{{.User.Email}}}" placeholder="请输入邮箱">
<input type="text" name="email" value="{%.User.Email%}" placeholder="请输入邮箱">
</div>
</div>
</div>
{{{if eq .User.Id 0}}}
{%if eq .User.Id 0%}
<div class="three fields">
<div class="field">
<label></label>
@ -41,20 +41,20 @@
<input type="password" name="confirm_password" placeholder="请再次输入密码">
</div>
</div>
{{{end}}}
{%end%}
<div class="three fields">
<div class="field">
<label></label>
<input type="radio" name="is_admin" value="0" {{{if eq .User.IsAdmin 0}}}checked{{{end}}}>
<input type="radio" name="is_admin" value="1" {{{if eq .User.IsAdmin 1}}}checked{{{end}}}>
<input type="radio" name="is_admin" value="0" {%if eq .User.IsAdmin 0%}checked{%end%}>
<input type="radio" name="is_admin" value="1" {%if eq .User.IsAdmin 1%}checked{%end%}>
</div>
<div class="field">
<label></label>
<input type="radio" name="status" value="1" {{{if eq .User.Status 1}}}checked{{{end}}}>
<input type="radio" name="status" value="1" {%if eq .User.Status 1%}checked{%end%}>
<input type="radio" name="status" value="0"
{{{if eq .User.Status 0}}}checked{{{end}}}
{%if eq .User.Status 0%}checked{%end%}
>
</div>
</div>
@ -139,4 +139,4 @@
});
</script>
{{{ template "common/footer" . }}}
{% template "common/footer" . %}