ViewPunishment.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <div>
  3. <modal title="View Punishment">
  4. <div slot="body">
  5. <article class="message">
  6. <div class="message-body">
  7. <strong>Type:</strong>
  8. {{ punishment.type }}
  9. <br />
  10. <strong>Value:</strong>
  11. {{ punishment.value }}
  12. <br />
  13. <strong>Reason:</strong>
  14. {{ punishment.reason }}
  15. <br />
  16. <strong>Active:</strong>
  17. {{ punishment.active }}
  18. <br />
  19. <strong>Expires at:</strong>
  20. {{
  21. moment(punishment.expiresAt).format(
  22. "MMMM Do YYYY, h:mm:ss a"
  23. )
  24. }}
  25. ({{ moment(punishment.expiresAt).fromNow() }})
  26. <br />
  27. <strong>Punished at:</strong>
  28. {{
  29. moment(punishment.punishedAt).format(
  30. "MMMM Do YYYY, h:mm:ss a"
  31. )
  32. }}
  33. ({{ moment(punishment.punishedAt).fromNow() }})
  34. <br />
  35. <strong>Punished by:</strong>
  36. {{ punishment.punishedBy }}
  37. <br />
  38. </div>
  39. </article>
  40. </div>
  41. <div slot="footer">
  42. <button
  43. class="button is-danger"
  44. @click="
  45. closeModal({
  46. sector: 'admin',
  47. modal: 'viewPunishment'
  48. })
  49. "
  50. >
  51. <span>&nbsp;Close</span>
  52. </button>
  53. </div>
  54. </modal>
  55. </div>
  56. </template>
  57. <script>
  58. import { mapState, mapActions } from "vuex";
  59. import io from "../../io";
  60. import Modal from "./Modal.vue";
  61. export default {
  62. components: { Modal },
  63. data() {
  64. return {
  65. ban: {},
  66. moment
  67. };
  68. },
  69. computed: {
  70. ...mapState("admin/punishments", {
  71. punishment: state => state.punishment
  72. })
  73. },
  74. mounted() {
  75. const _this = this;
  76. io.getSocket(socket => {
  77. _this.socket = socket;
  78. return socket;
  79. });
  80. },
  81. methods: {
  82. ...mapActions("modals", ["closeModal"])
  83. }
  84. };
  85. </script>