list.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @var yii\web\View $this
  4. */
  5. $this->title = '上线任务列表';
  6. ?>
  7. <div class="box">
  8. <div class="box-header">
  9. <!-- <h3 class="box-title">Responsive Hover Table</h3>-->
  10. <form action="/logger/search" method="POST">
  11. <div class="box-tools">
  12. <div class="input-group" style="width: 150px;">
  13. <input type="text" name="kw" class="form-control input-sm pull-right" placeholder="Search" value="">
  14. <div class="input-group-btn">
  15. <input class="btn btn-sm btn-default" type="submit" value="搜索"><i class="fa fa-search"></i></input>
  16. </div>
  17. </div>
  18. </div>
  19. </form>
  20. </div><!-- /.box-header -->
  21. <div class="box-body table-responsive no-padding">
  22. <table class="table table-hover">
  23. <tbody><tr>
  24. <th>开发者</th>
  25. <th>任务名称</th>
  26. <th>上线commit号</th>
  27. <th>当前状态</th>
  28. <th>操作</th>
  29. </tr>
  30. <?php foreach ($list as $item) { ?>
  31. <tr>
  32. <td><?= $item['username'] ?></td>
  33. <td><?= $item['title'] ?></td>
  34. <td><?= $item['commit_id'] ?></td>
  35. <td><?= \Yii::t('status', 'task_status_' . $item['status']) ?></td>
  36. <td>
  37. <button class="btn btn-xs btn-success task-operation" data-id="<?= $item['id'] ?>" data-action="pass">通过</button>
  38. <button class="btn btn-xs btn-danger task-operation" data-id="<?= $item['id'] ?>" data-action="refuse">拒绝</button>
  39. </td>
  40. </tr>
  41. <?php } ?>
  42. </tbody></table>
  43. </div><!-- /.box-body -->
  44. </div>
  45. <script type="text/javascript">
  46. $(function() {
  47. $('.task-operation').click(function() {
  48. $this = $(this);
  49. $.get("/walle/task-operation", {id: $(this).data('id'), operation: $(this).data('action')},
  50. function(data) {
  51. $this.parent().prev().text(data.data.status);
  52. }
  53. );
  54. })
  55. })
  56. </script>