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.

52 lines
1.1 KiB

  1. 'use strict'
  2. import * as $ from 'jquery'
  3. export default {
  4. name: 'admin-settings',
  5. data() {
  6. return {
  7. upgradeModal: {
  8. state: false,
  9. step: 'confirm',
  10. mode: 'upgrade',
  11. error: 'Something went wrong.'
  12. }
  13. }
  14. },
  15. methods: {
  16. upgrade() {
  17. this.upgradeModal.mode = 'upgrade'
  18. this.upgradeModal.step = 'confirm'
  19. this.upgradeModal.state = true
  20. },
  21. reinstall() {
  22. this.upgradeModal.mode = 're-install'
  23. this.upgradeModal.step = 'confirm'
  24. this.upgradeModal.state = true
  25. },
  26. upgradeCancel() {
  27. this.upgradeModal.state = false
  28. },
  29. upgradeStart() {
  30. this.upgradeModal.step = 'running'
  31. $.post('/admin/settings/install', {
  32. mode: this.upgradeModal.mode
  33. }).done((resp) => {
  34. // todo
  35. }).fail((jqXHR, txtStatus, resp) => {
  36. this.upgradeModal.step = 'error'
  37. this.upgradeModal.error = jqXHR.responseText
  38. })
  39. },
  40. flushcache() {
  41. window.alert('Coming soon!')
  42. },
  43. resetaccounts() {
  44. window.alert('Coming soon!')
  45. },
  46. flushsessions() {
  47. window.alert('Coming soon!')
  48. }
  49. }
  50. }