<@sys.taskList status=status pageIndex=pageNum pageSize=numPerPage>
<div class="pageHeader card">
    <form class="pagerForm" autocomplete="off" onsubmit="return navTabSearch(this);" method="post">
        <#include "../include_page/parameters.html"/>
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <select class="combox" name="status">
                        <option value><@t.page 'task.status'/></option>
                        <option value="0"${(status?has_content&&"0"=status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+0/></option>
                        <option value="1"${(status?has_content&&"1"=status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+1/></option>
                        <option value="2"${(status?has_content&&"2"=status)?then(' selected="true"','')?no_esc}><@t.page 'status.task.'+2/></option>
                    </select>
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <button type="submit" class="buttonActive"><@t.page 'button.search'/></button>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>
<div class="card">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a href="sysTask/add.html" target="navTab" rel="sysTask/add"><i class="icon-plus-sign-alt icon-large"></i><@t.page 'task.add'/></a></li>
        </ul>
    </div>
    <table class="table" width="100%" layoutH>
        <thead>
            <tr>
                <th width="30"><@t.page 'id'/></th>
                <th><@t.page 'name'/></th>
                <th><@t.page 'description'/></th>
                <th><@t.page 'task.cron'/></th>
                <th><@t.page 'task_template'/></th>
                <th><@t.page 'multiple_node'/></th>
                <th><@t.page 'status'/></th>
                <th><@t.page 'operate'/></th>
            </tr>
        </thead>
        <tbody>
            <#list page.list as a>
            <tr>
                <td>${a.id!}</td>
                <td class="exclude-translate">${(a.name)!}</td>
                <td class="exclude-translate">${(a.description)!}</td>
                <td>${(a.cronExpression)!}</td>
                <td>${(a.filePath)!}</td>
                <td><#if a.multiNode><@t.page 'multiple_node'/></#if></td>
                <td><span class="statusText ${a.status?switch(0,'green',2,'orange',3,'red','')}"><@t.page 'status.task.'+a.status/></span></td>
                <td class="wrap">
                    <a href="sysTask/add.html?id=${a.id}" class="edit btnText" target="navTab" rel="sysTask/edit"><i class="icon-edit"></i><@t.page 'task.edit'/></a>
                    <#if a.status=0>
                        <a href="sysTask/runOnce?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText green" title="<@t.page 'confirm.exec'/>" target="ajaxTodo"><@t.page 'button.exec'/></a>
                        <a href="sysTask/pause?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText red" title="<@t.page 'confirm.pause'/>" target="ajaxTodo"><@t.page 'button.pause'/></a>
                    <#elseif a.status=1>
                        <a href="sysTask/recreate?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText red" title="<@t.page 'confirm.reinitialize'/>" target="ajaxTodo"><@t.page 'button.reinitialize'/></a>
                        <a href="sysTask/interrupt?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText red" title="<@t.page 'confirm.interrupt'/>" target="ajaxTodo"><@t.page 'button.interrupt'/></a>
                    <#elseif a.status=2>
                        <a href="sysTask/resume?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText green" title="<@t.page 'confirm.resume'/>" target="ajaxTodo"><@t.page 'button.resume'/></a>
                    <#elseif a.status=3>
                        <a href="sysTask/recreate?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText blue" title="<@t.page 'confirm.reinitialize'/>" target="ajaxTodo"><@t.page 'button.reinitialize'/></a>
                    </#if>
                    <a href="log/task.html?taskId=${a.id}" class="btnText" target="navTab" rel="logTask" title="<@t.page 'log.task'/>"><@t.page 'button.view_log'/></a>
                    <a href="sysTask/delete?id=${a.id}&_csrf=<@tools.csrfToken admin=true/>" class="btnText warn" title="<@t.page 'confirm.delete'/>" target="ajaxTodo"><i class="icon-trash"></i><@t.page 'button.delete'/></a>
                </td>
            </tr>
            </#list>
        </tbody>
    </table>
    <#include "../include_page/page.html"/>
</div>
</@sys.taskList>