ViewPunishment.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 class="button is-danger" @click="$parent.toggleModal()">
  43. <span>&nbsp;Close</span>
  44. </button>
  45. </div>
  46. </modal>
  47. </div>
  48. </template>
  49. <script>
  50. import { mapState } from "vuex";
  51. import io from "../../io";
  52. import Modal from "./Modal.vue";
  53. export default {
  54. components: { Modal },
  55. data() {
  56. return {
  57. ban: {},
  58. moment
  59. };
  60. },
  61. computed: {
  62. ...mapState("admin/punishments", {
  63. punishment: state => state.punishment
  64. })
  65. },
  66. mounted: function() {
  67. let _this = this;
  68. io.getSocket(socket => (_this.socket = socket));
  69. },
  70. methods: {}
  71. };
  72. </script>