2
0

configure.js 1015 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. 'use strict'
  2. /* global jQuery, _, Vue, axios */
  3. jQuery(document).ready(function ($) {
  4. new Vue({ // eslint-disable-line no-new
  5. el: 'main',
  6. data: {
  7. loading: false,
  8. state: 'welcome',
  9. syscheck: {
  10. ok: false,
  11. error: ''
  12. },
  13. conf: {
  14. title: 'Wiki',
  15. host: ''
  16. }
  17. },
  18. methods: {
  19. proceedToSyscheck: function (ev) {
  20. let self = this
  21. this.state = 'syscheck'
  22. this.loading = true
  23. _.delay(() => {
  24. axios.post('/syscheck').then(resp => {
  25. if (resp.data.ok === true) {
  26. self.syscheck.ok = true
  27. } else {
  28. self.syscheck.ok = false
  29. self.syscheck.error = resp.data.error
  30. }
  31. self.loading = false
  32. }).catch(err => {
  33. window.alert(err.message)
  34. })
  35. }, 1000)
  36. },
  37. proceedToGeneral: function (ev) {
  38. this.state = 'general'
  39. this.loading = true
  40. }
  41. }
  42. })
  43. })