index.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. {extend name='main'}
  2. {block name="button"}
  3. {if auth("start") && $iswin}
  4. <button data-load='{:url("start")}' class='layui-btn layui-btn-sm layui-btn-primary'>开始监听</button>
  5. {/if}
  6. {if auth("stop") && $iswin}
  7. <button data-load='{:url("stop")}' data-confirm="确定要停止主进程监听吗?" class='layui-btn layui-btn-sm layui-btn-primary'>停止监听</button>
  8. {/if}
  9. {if auth("remove")}
  10. <button data-action='{:url("remove")}' data-rule="id#{key}" data-confirm="确定批量删除任务吗?" class='layui-btn layui-btn-sm layui-btn-primary'>批量删除</button>
  11. {/if}
  12. {if auth("clear")}
  13. <button data-load='{:url("clear")}' data-confirm="确定要清理3天前的任务记录吗?" class='layui-btn layui-btn-sm layui-btn-primary'>清理记录</button>
  14. {/if}
  15. {/block}
  16. {block name="content"}
  17. <div class="think-box-shadow">
  18. {include file='queue/index_search'}
  19. <table class="layui-table margin-top-15" lay-skin="line">
  20. {notempty name='list'}
  21. <thead>
  22. <tr>
  23. <th class='list-table-check-td think-checkbox'>
  24. <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
  25. </th>
  26. <th class='text-left nowrap'>任务信息</th>
  27. <th class='text-left nowrap'>任务时间</th>
  28. <th class='text-left nowrap'>任务状态</th>
  29. </tr>
  30. </thead>
  31. {/notempty}
  32. <tbody>
  33. {foreach $list as $key=>$vo}
  34. <tr>
  35. <td class='list-table-check-td think-checkbox'>
  36. <input class="list-check-box" value='{$vo.id}' type='checkbox'>
  37. </td>
  38. <td class='text-left nowrap'>
  39. 任务名称:{$vo.title}<br>
  40. <span class="color-desc">任务指令:{$vo.preload}</span>
  41. </td>
  42. <td class='text-left nowrap'>
  43. 计划时间:{$vo.time|format_datetime} {if isset($vo.exec_pid) and $vo.exec_pid>0}( 进程 <b class="color-blue">{$vo.exec_pid|default='-'}</b> ){/if}<br>
  44. {if $vo.status eq 3 or $vo.status eq 4}
  45. 执行时间:{$vo.start_at|format_datetime}( 耗时 <b class="color-blue">{:sprintf("%.4f",strtotime($vo.end_at)-strtotime($vo.start_at))}</b> 秒 )
  46. {elseif $vo.status eq 2} 开始时间:{$vo.start_at|format_datetime}
  47. {else} 创建时间:{$vo.create_at|format_datetime} {/if}
  48. </td>
  49. <td class='text-left nowrap'>
  50. <div>
  51. {eq name='vo.double' value='1'}
  52. <span class="layui-badge layui-bg-green margin-right-5">复</span>
  53. {else}
  54. <span class="layui-badge layui-bg-blue margin-right-5">单</span>
  55. {/eq}
  56. {eq name='vo.status' value='1'}
  57. <span class="layui-badge layui-bg-black">待处理</span>
  58. {elseif $vo.status eq 2}
  59. <span class="layui-badge layui-bg-green">处理中</span>
  60. {elseif $vo.status eq 3}
  61. <span class="layui-badge layui-bg-blue">处理完成</span>
  62. {elseif $vo.status eq 4}
  63. <span class="layui-badge layui-bg-red margin-right-5">处理失败</span>
  64. <a class="layui-badge layui-bg-green" data-tips-text="重置该任务" data-action="{:url('redo')}" data-value="id#{$vo.id}">
  65. <i class="layui-icon font-s12">&#xe669;</i>
  66. </a>
  67. {/eq}
  68. {if auth("admin/queue/remove") and in_array($vo.status,[1,3,4])}
  69. <a data-action='{:url("remove")}' data-confirm="确定要删除该任务吗?" data-value="id#{$vo.id}" data-tips-text="删除该任务" class='layui-badge layui-bg-red margin-left-5'>
  70. <i class="layui-icon">&#xe640;</i>
  71. </a>
  72. {/if}
  73. </div>
  74. <div class="color-desc">{$vo.desc|raw|default="没有获取到状态描述"}</div>
  75. </td>
  76. </tr>
  77. {/foreach}
  78. </tbody>
  79. </table>
  80. {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
  81. </div>
  82. {/block}