mirror of https://github.com/requarks/wiki
parent
48e7ea2e30
commit
d8fa6ecc27
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
"use strict";jQuery(document).ready(function(e){new Vue({el:"main",data:{loading:!1,state:"welcome",syscheck:{ok:!1,error:""},conf:{title:"Wiki",host:""}},methods:{proceedToSyscheck:function(e){var t=this;this.state="syscheck",this.loading=!0,_.delay(function(){axios.post("/syscheck").then(function(e){e.data.ok===!0?t.syscheck.ok=!0:(t.syscheck.ok=!1,t.syscheck.error=e.data.error),t.loading=!1}).catch(function(e){window.alert(e.message)})},1e3)},proceedToGeneral:function(e){this.state="general",this.loading=!0}}})});
|
File diff suppressed because one or more lines are too long
@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
Loading…
Reference in new issue