index.blade.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <script data-exec-on-popstate>
  2. $(function () {
  3. $('.run-task').click(function (e) {
  4. var id = $(this).data('id');
  5. NProgress.start();
  6. $.ajax({
  7. method: 'POST',
  8. url: '{{ route('scheduling-run') }}',
  9. data: {id: id, _token: LA.token},
  10. success: function (data) {
  11. if (typeof data === 'object') {
  12. $('.output-box').removeClass('hide');
  13. $('.output-box .output-body').html(data.data);
  14. }
  15. NProgress.done();
  16. }
  17. });
  18. });
  19. });
  20. </script>
  21. <style>
  22. .output-body {
  23. white-space: pre-wrap;
  24. background: #000000;
  25. color: #00fa4a;
  26. padding: 10px;
  27. border-radius: 0;
  28. }
  29. </style>
  30. <div class="box">
  31. <!-- /.box-header -->
  32. <div class="box-body no-padding">
  33. <table class="table table-striped table-hover">
  34. <tbody>
  35. <tr>
  36. <th style="width: 10px">#</th>
  37. <th>任务名称</th>
  38. <th>执行周期</th>
  39. <th>下次执行时间</th>
  40. <th>描述</th>
  41. <th>执行</th>
  42. </tr>
  43. @foreach($events as $index => $event)
  44. <tr>
  45. <td>{{ $index+1 }}.</td>
  46. <td><code>{{ $event['task']['name'] }}</code></td>
  47. <td><span class="label label-success">{{ $event['expression'] }}</span>&nbsp;{{ $event['readable'] }}</td>
  48. <td>{{ $event['nextRunDate'] }}</td>
  49. <td>{{ $event['description'] }}</td>
  50. <td><a class="btn btn-xs btn-primary run-task" data-id="{{ $index+1 }}">执行</a></td>
  51. </tr>
  52. @endforeach
  53. </tbody>
  54. </table>
  55. </div>
  56. <!-- /.box-body -->
  57. </div>
  58. <div class="box box-default output-box hide">
  59. <div class="box-header with-border">
  60. <i class="fa fa-terminal"></i>
  61. <h3 class="box-title">Output</h3>
  62. </div>
  63. <!-- /.box-header -->
  64. <div class="box-body">
  65. <pre class="output-body"></pre>
  66. </div>
  67. <!-- /.box-body -->
  68. </div>