Reports.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class='columns is-mobile'>
  3. <div class='column is-8-desktop is-offset-2-desktop is-12-mobile'>
  4. <table class='table is-striped'>
  5. <thead>
  6. <tr>
  7. <td>Song ID</td>
  8. <td>Created By</td>
  9. <td>Created At</td>
  10. <td>Description</td>
  11. <td>Issues</td>
  12. <td>Options</td>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. <tr v-for='(index, report) in reports' track-by='$index'>
  17. <td>
  18. <span>{{ report.songId }}</span>
  19. </td>
  20. <td>
  21. <span>{{ report.createdBy }}</span>
  22. </td>
  23. <td>
  24. <span>{{ report.createdAt }}</span>
  25. </td>
  26. <td>
  27. <span>{{ report.description }}</span>
  28. </td>
  29. <td>
  30. <span>{{ report.issues }}</span>
  31. </td>
  32. <td>
  33. <a class='button is-primary' @click='resolve()'>Resolve</a>
  34. </td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. </div>
  40. </template>
  41. <script>
  42. import { Toast } from 'vue-roaster';
  43. export default {
  44. data() {
  45. return {
  46. reports: []
  47. }
  48. },
  49. methods: {},
  50. ready: function () {
  51. let _this = this;
  52. let socketInterval = setInterval(() => {
  53. if (!!_this.$parent.$parent.socket) {
  54. _this.socket = _this.$parent.$parent.socket;
  55. _this.socket.emit('reports.index', res => {
  56. _this.reports = res.data;
  57. });
  58. clearInterval(socketInterval);
  59. }
  60. }, 100);
  61. }
  62. }
  63. </script>
  64. <style lang='scss' scoped>
  65. .tag:not(:last-child) { margin-right: 5px; }
  66. td {
  67. word-wrap: break-word;
  68. max-width: 10vw;
  69. vertical-align: middle;
  70. }
  71. </style>