Reports.vue 1.4 KB

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