You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.2 KiB

  1. <template lang="pug">
  2. transition(:duration="400")
  3. .modal(v-show='isShown', v-cloak)
  4. transition(name='modal-background')
  5. .modal-background(v-show='isShown')
  6. .modal-container
  7. transition(name='modal-content')
  8. .modal-content(v-show='isShown')
  9. template(v-if='step === "running"')
  10. header.is-blue Install
  11. section.modal-loading
  12. i
  13. span Wiki.js {{ mode }} in progress...
  14. em Please wait
  15. template(v-if='step === "error"')
  16. header.is-red Installation Error
  17. section.modal-loading
  18. span {{ error }}
  19. footer
  20. a.button.is-grey.is-outlined(@click='upgradeCancel') Abort
  21. a.button.is-deep-orange(@click='upgradeStart') Try Again
  22. template(v-if='step === "confirm"')
  23. header.is-deep-orange Are you sure?
  24. section
  25. label.label You are about to {{ mode }} Wiki.js.
  26. span.note You will not be able to access your wiki during the operation. Content will not be affected. However, it is your responsability to ensure you have a backup in the unexpected event content gets lost or corrupted.
  27. footer
  28. a.button.is-grey.is-outlined(@click='upgradeCancel') Abort
  29. a.button.is-deep-orange(@click='upgradeStart') Start
  30. </template>
  31. <script>
  32. export default {
  33. name: 'modal-upgrade-system',
  34. data() {
  35. return {
  36. isLoading: false
  37. }
  38. },
  39. computed: {
  40. isShown() {
  41. return this.$store.state.modalUpgradeSystem.shown
  42. },
  43. mode() {
  44. return this.$store.state.modalUpgradeSystem.mode
  45. },
  46. step() {
  47. return this.$store.state.modalUpgradeSystem.step
  48. }
  49. },
  50. methods: {
  51. upgradeCancel() {
  52. this.isLoading = false
  53. this.$store.dispatch('modalUpgradeSystem/close')
  54. },
  55. upgradeStart() {
  56. this.$store.commit('modalUpgradeSystem/stepChange', 'running')
  57. this.$http.post('/admin/system/install', {
  58. mode: this.mode
  59. }).then(resp => {
  60. // todo
  61. }).catch(err => {
  62. this.$store.commit('modalUpgradeSystem/stepChange', 'error')
  63. this.error = err.body
  64. })
  65. }
  66. }
  67. }
  68. </script>