<%@page trimDirectiveWhitespaces="true"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" disabled="disabled" />
<title>定时</title>
<!-- 当前页面 -->
<link type="text/css" href="${config.statie}ui/admin/images/admin.css" rel="stylesheet">
</head>
<body>
<div id="wrapper">
  <div class="area">
    <h2><i>查看任务</i></h2>
    <div class="area-content">
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
          <tr>
            <td width="30%" align="right">任务名称：</td>
            <td>${cron.name}</td>
          </tr>
          <tr class="border-top">
            <td align="right">实现类路径：</td>
            <td>${cron.impl}</td>
          </tr>
          <tr class="border-top">
            <td align="right" valign="top">实现类参数：</td>
            <td align="left" valign="top"><gen:if test="${not empty cron.paramMap}"><c:forEach items="${cron.paramMap}" var="map">${map.key}=${map.value}<br /></c:forEach><gen:else />暂无参数<br /></gen:if></td>
          </tr>
          <tr class="border-top">
            <td align="right"> 运行模式：</td>
            <td><label><input type="radio" name="mode" value="time" disabled="disabled" ${(empty cron.mode || cron.mode == "time") ? 'checked="checked"' : ''}/>
              定时</label>&nbsp;&nbsp;
              <label><input type="radio" name="mode" value="loop" disabled="disabled" ${cron.mode == "loop" ? 'checked="checked"' : ''}/>
              循环</label>&nbsp;&nbsp;
              <label><input type="radio" name="mode" value="timeloop" disabled="disabled" ${cron.mode == "timeloop" ? 'checked="checked"' : ''}/>
              定时循环</label></td>
          </tr>
          <tr class="border-top tr_time" style="display:none;">
            <td align="right"> 运行时间：</td>
            <td>${gen:dateTime(cron.time, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}</td>
          </tr>
          <tr class="border-top tr_loop" style="display:none;">
            <td align="right"> 间隔时间：</td>
            <td>${cron.interval}分钟，最多运行：${cron.count}次</td>
          </tr>
          <tr class="border-top tr_timeloop" style="display:none;">
            <td align="right"> 按周设置：</td>
            <td><table border="0" cellspacing="0" cellpadding="0">
                <tr class="ignore">
                  <td><input name="weekday" type="checkbox" value="1" disabled="disabled" />
                    周日&nbsp;
                    <input name="weekday" type="checkbox" value="2" disabled="disabled" />
                    周一&nbsp;
                    <input name="weekday" type="checkbox" value="3" disabled="disabled" />
                    周二&nbsp;
                    <input name="weekday" type="checkbox" value="4" disabled="disabled" />
                    周三&nbsp;
                    <input name="weekday" type="checkbox" value="5" disabled="disabled" />
                    周四&nbsp;
                    <input name="weekday" type="checkbox" value="6" disabled="disabled" />
                    周五&nbsp;
                    <input name="weekday" type="checkbox" value="7" disabled="disabled" />
                    周六&nbsp;
                    <span style="display:none;"><input type="checkbox" id="weekday" for="weekday" />
                    全选&nbsp;</span></td>
                  <td valign="top"></td>
                </tr>
              </table></td>
          </tr>
          <tr class="border-top tr_timeloop" style="display:none;">
            <td align="right" valign="top">按日设置：</td>
            <td><table border="0" cellspacing="0" cellpadding="0">
                <tr class="ignore">
                  <td><input name="day" type="checkbox" value="1" disabled="disabled" />
                    01&nbsp;
                    <input name="day" type="checkbox" value="2" disabled="disabled" />
                    02&nbsp;
                    <input name="day" type="checkbox" value="3" disabled="disabled" />
                    03&nbsp;
                    <input name="day" type="checkbox" value="4" disabled="disabled" />
                    04&nbsp;
                    <input name="day" type="checkbox" value="5" disabled="disabled" />
                    05&nbsp;
                    <input name="day" type="checkbox" value="6" disabled="disabled" />
                    06&nbsp;
                    <input name="day" type="checkbox" value="7" disabled="disabled" />
                    07&nbsp;
                    <input name="day" type="checkbox" value="8" disabled="disabled" />
                    08&nbsp;
                    <input name="day" type="checkbox" value="9" disabled="disabled" />
                    09&nbsp;
                    <input name="day" type="checkbox" value="10" disabled="disabled" />
                    10&nbsp;<br />
                    <input name="day" type="checkbox" value="11" disabled="disabled" />
                    11&nbsp;
                    <input name="day" type="checkbox" value="12" disabled="disabled" />
                    12&nbsp;
                    <input name="day" type="checkbox" value="13" disabled="disabled" />
                    13&nbsp;
                    <input name="day" type="checkbox" value="14" disabled="disabled" />
                    14&nbsp;
                    <input name="day" type="checkbox" value="15" disabled="disabled" />
                    15&nbsp;
                    <input name="day" type="checkbox" value="16" disabled="disabled" />
                    16&nbsp;
                    <input name="day" type="checkbox" value="17" disabled="disabled" />
                    17&nbsp;
                    <input name="day" type="checkbox" value="18" disabled="disabled" />
                    18&nbsp;
                    <input name="day" type="checkbox" value="19" disabled="disabled" />
                    19&nbsp;
                    <input name="day" type="checkbox" value="20" disabled="disabled" />
                    20&nbsp;<br />
                    <input name="day" type="checkbox" value="21" disabled="disabled" />
                    21&nbsp;
                    <input name="day" type="checkbox" value="22" disabled="disabled" />
                    22&nbsp;
                    <input name="day" type="checkbox" value="23" disabled="disabled" />
                    23&nbsp;
                    <input name="day" type="checkbox" value="24" disabled="disabled" />
                    24&nbsp;
                    <input name="day" type="checkbox" value="25" disabled="disabled" />
                    25&nbsp;
                    <input name="day" type="checkbox" value="26" disabled="disabled" />
                    26&nbsp;
                    <input name="day" type="checkbox" value="27" disabled="disabled" />
                    27&nbsp;
                    <input name="day" type="checkbox" value="28" disabled="disabled" />
                    28&nbsp;
                    <input name="day" type="checkbox" value="29" disabled="disabled" />
                    29&nbsp;
                    <input name="day" type="checkbox" value="30" disabled="disabled" />
                    30&nbsp;<br />
                    <input name="day" type="checkbox" value="31" disabled="disabled" />
                    31&nbsp;
                    <span style="display:none;"><input type="checkbox" id="day" for="day" />
                    全选&nbsp;</span></td>
                  <td valign="top"></td>
                </tr>
              </table></td>
          </tr>
          <tr class="border-top tr_timeloop" style="display:none;">
            <td align="right" valign="top">按时设置：</td>
            <td><table border="0" cellspacing="0" cellpadding="0">
                <tr class="ignore">
                  <td><input name="hour" type="checkbox" value="0" disabled="disabled" />
                    00&nbsp;
                    <input name="hour" type="checkbox" value="1" disabled="disabled" />
                    01&nbsp;
                    <input name="hour" type="checkbox" value="2" disabled="disabled" />
                    02&nbsp;
                    <input name="hour" type="checkbox" value="3" disabled="disabled" />
                    03&nbsp;
                    <input name="hour" type="checkbox" value="4" disabled="disabled" />
                    04&nbsp;
                    <input name="hour" type="checkbox" value="5" disabled="disabled" />
                    05&nbsp;
                    <input name="hour" type="checkbox" value="6" disabled="disabled" />
                    06&nbsp;
                    <input name="hour" type="checkbox" value="7" disabled="disabled" />
                    07&nbsp;
                    <input name="hour" type="checkbox" value="8" disabled="disabled" />
                    08&nbsp;
                    <input name="hour" type="checkbox" value="9" disabled="disabled" />
                    09&nbsp;<br />
                    <input name="hour" type="checkbox" value="10" disabled="disabled" />
                    10&nbsp;
                    <input name="hour" type="checkbox" value="11" disabled="disabled" />
                    11&nbsp;
                    <input name="hour" type="checkbox" value="12" disabled="disabled" />
                    12&nbsp;
                    <input name="hour" type="checkbox" value="13" disabled="disabled" />
                    13&nbsp;
                    <input name="hour" type="checkbox" value="14" disabled="disabled" />
                    14&nbsp;
                    <input name="hour" type="checkbox" value="15" disabled="disabled" />
                    15&nbsp;
                    <input name="hour" type="checkbox" value="16" disabled="disabled" />
                    16&nbsp;
                    <input name="hour" type="checkbox" value="17" disabled="disabled" />
                    17&nbsp;
                    <input name="hour" type="checkbox" value="18" disabled="disabled" />
                    18&nbsp;
                    <input name="hour" type="checkbox" value="19" disabled="disabled" />
                    19&nbsp;<br />
                    <input name="hour" type="checkbox" value="20" disabled="disabled" />
                    20&nbsp;
                    <input name="hour" type="checkbox" value="21" disabled="disabled" />
                    21&nbsp;
                    <input name="hour" type="checkbox" value="22" disabled="disabled" />
                    22&nbsp;
                    <input name="hour" type="checkbox" value="23" disabled="disabled" />
                    23&nbsp;
                    <span style="display:none;"><input type="checkbox" id="hour" for="hour" />
                    全选&nbsp;</span></td>
                  <td valign="top"></td>
                </tr>
              </table></td>
          </tr>
          <tr class="border-top tr_timeloop" style="display:none;">
            <td align="right">按分设置：</td>
            <td><table border="0" cellspacing="0" cellpadding="0">
                <tr class="ignore">
                  <td><input name="minute" type="checkbox" value="0" disabled="disabled" />
                    00&nbsp;
                    <input name="minute" type="checkbox" value="10" disabled="disabled" />
                    10&nbsp;
                    <input name="minute" type="checkbox" value="30" disabled="disabled" />
                    30&nbsp;
                    <input name="minute" type="checkbox" value="50" disabled="disabled" />
                    50&nbsp;
                    <span style="display:none;"><input type="checkbox" id="minute" for="minute" />
                    全选&nbsp;</span></td>
                  <td valign="top"></td>
                </tr>
              </table></td>
          </tr>
          <tr class="border-top tr_loop tr_timeloop" style="display:none;">
            <td align="right">开始时间：</td>
            <td>${gen:dateTime(cron.startTime, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}，结束时间：${gen:dateTime(cron.endTime, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}</td>
          </tr>
          <tr class="border-top">
            <td align="right">当前状态：</td>
            <td><gen:if test='${cron.status == 3}'><span class="orange">暂停</span></gen:if><gen:if test='${cron.status == 2}'>结束</gen:if>
                <gen:if test='${cron.status == 1}'><span class="green">运行中</span></gen:if><gen:if test='${cron.status == 0}'><span class="blue">正常</span></gen:if></td>
          </tr>
          <tr class="border-top">
            <td align="right">运行信息：</td>
            <td><gen:if test='${cron.scanned == 0}'><span class="orange">未扫描</span><gen:else /><span class="blue">已扫描</span></gen:if>，已运行：${cron.stat}次，<a href="javascript:void(0);" class="blue cronLog" title="日志" val="${cron.id}">查看日志</a></td>
          </tr>
          <tr class="border-top">
            <td align="right">上次运行时间：</td>
            <td>${gen:dateTime(cron.lastRun, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}，下次运行时间：${gen:dateTime(cron.nextRun, 'yyyy-MM-dd HH:mm:ss', config.timezoneid)}</td>
          </tr>
        </table>
    </div>
  </div>
</div>
<!-- 必备插件 -->
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.grapes.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.timers.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.mousewheel.js"></script>
<script type="text/javascript" src="${config.statie}js/jquery.tablecolor.js"></script>
<!-- 表单验证插件 -->
<script type="text/javascript" src="${config.statie}js/validate/jquery.validate.js"></script>
<script type="text/javascript" src="${config.statie}js/validate/validate.expand.js"></script>
<script type="text/javascript" src="${config.statie}js/validate/messages_zh.js"></script>
<!-- UI界面必备 -->
<script type="text/javascript" src="${config.statie}ui/js/jspgen.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ajax.js"></script>
<script type="text/javascript" src="${config.statie}ui/js/jspgen.ready.js"></script>
<!-- 当前页面 -->
<script type="text/javascript" src="${config.statie}ui/admin/js/cron-input.js"></script>
<script type="text/javascript">
// document.domain = "baidu.com";

// 调用
$(document).ready(function(){
	// 变量
	var $cronLog = $('.table a.cronLog');
	
	// 赋值
	setMode();
	setItem('weekday', '${cron.weekday}');  setItem('day', '${cron.day}'); 
	setItem('hour', '${cron.hour}');  setItem('minute', '${cron.minute}');
	
	// 日志
	$cronLog.bind('click', function () {
		var id = $(this).attr('val');
		return addTab($(this).attr('title'), 'cron_log!list.gen?findBy=cronId&keyword='+id, 'view_cron_log_cron_'+id);
	});
});
</script>
</body>
</html>
