setup wizard intro + syscheck
This commit is contained in:
46
client/js/configure.js
Normal file
46
client/js/configure.js
Normal file
@@ -0,0 +1,46 @@
|
||||
'use strict'
|
||||
|
||||
/* global jQuery, _, Vue, axios */
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
new Vue({ // eslint-disable-line no-new
|
||||
el: 'main',
|
||||
data: {
|
||||
loading: false,
|
||||
state: 'welcome',
|
||||
syscheck: {
|
||||
ok: false,
|
||||
error: ''
|
||||
},
|
||||
conf: {
|
||||
title: 'Wiki',
|
||||
host: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
proceedToSyscheck: function (ev) {
|
||||
let self = this
|
||||
this.state = 'syscheck'
|
||||
this.loading = true
|
||||
|
||||
_.delay(() => {
|
||||
axios.post('/syscheck').then(resp => {
|
||||
if (resp.data.ok === true) {
|
||||
self.syscheck.ok = true
|
||||
} else {
|
||||
self.syscheck.ok = false
|
||||
self.syscheck.error = resp.data.error
|
||||
}
|
||||
self.loading = false
|
||||
}).catch(err => {
|
||||
window.alert(err.message)
|
||||
})
|
||||
}, 1000)
|
||||
},
|
||||
proceedToGeneral: function (ev) {
|
||||
this.state = 'general'
|
||||
this.loading = true
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user