Reports.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. import io from '../../io';
  44. export default {
  45. data() {
  46. return {
  47. reports: []
  48. }
  49. },
  50. methods: {},
  51. ready: function () {
  52. let _this = this;
  53. io.getSocket((socket) => {
  54. _this.socket = socket;
  55. _this.socket.emit('reports.index', res => {
  56. _this.reports = res.data;
  57. });
  58. });
  59. }
  60. }
  61. </script>
  62. <style lang='scss' scoped>
  63. .tag:not(:last-child) { margin-right: 5px; }
  64. td {
  65. word-wrap: break-word;
  66. max-width: 10vw;
  67. vertical-align: middle;
  68. }
  69. </style>