mirror of https://github.com/Requarks/wiki.git
14 changed files with 130 additions and 68 deletions
Unified View
Diff Options
-
2client/js/app.js
-
4client/js/components/anchor.vue
-
2client/js/components/modal-create-user.vue
-
70client/js/components/modal-upgrade-system.vue
-
35client/js/pages/admin-settings.component.js
-
18client/js/pages/content-view.component.js
-
2client/js/store/index.js
-
6client/js/store/modules/anchor.js
-
24client/js/store/modules/modal-upgrade-system.js
-
6server/controllers/admin.js
-
7server/libs/markdown.js
-
8server/locales/en/admin.json
-
8server/locales/en/browser.json
-
6server/views/pages/admin/settings.pug
@ -0,0 +1,70 @@ |
|||||
|
<template lang="pug"> |
||||
|
transition(:duration="400") |
||||
|
.modal(v-show='isShown', v-cloak) |
||||
|
transition(name='modal-background') |
||||
|
.modal-background(v-show='isShown') |
||||
|
.modal-container |
||||
|
transition(name='modal-content') |
||||
|
.modal-content(v-show='isShown') |
||||
|
template(v-if='step === "running"') |
||||
|
header.is-blue Install |
||||
|
section.modal-loading |
||||
|
i |
||||
|
span Wiki.js {{ mode }} in progress... |
||||
|
em Please wait |
||||
|
template(v-if='step === "error"') |
||||
|
header.is-red Installation Error |
||||
|
section.modal-loading |
||||
|
span {{ error }} |
||||
|
footer |
||||
|
a.button.is-grey.is-outlined(@click='upgradeCancel') Abort |
||||
|
a.button.is-deep-orange(@click='upgradeStart') Try Again |
||||
|
template(v-if='step === "confirm"') |
||||
|
header.is-deep-orange Are you sure? |
||||
|
section |
||||
|
label.label You are about to {{ mode }} Wiki.js. |
||||
|
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. |
||||
|
footer |
||||
|
a.button.is-grey.is-outlined(@click='upgradeCancel') Abort |
||||
|
a.button.is-deep-orange(@click='upgradeStart') Start |
||||
|
|
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'modal-upgrade-system', |
||||
|
data() { |
||||
|
return { |
||||
|
isLoading: false |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
isShown() { |
||||
|
return this.$store.state.modalUpgradeSystem.shown |
||||
|
}, |
||||
|
mode() { |
||||
|
return this.$store.state.modalUpgradeSystem.mode |
||||
|
}, |
||||
|
step() { |
||||
|
return this.$store.state.modalUpgradeSystem.step |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
upgradeCancel() { |
||||
|
this.isLoading = false |
||||
|
this.$store.dispatch('modalUpgradeSystem/close') |
||||
|
}, |
||||
|
upgradeStart() { |
||||
|
this.$store.commit('modalUpgradeSystem/stepChange', 'running') |
||||
|
this.$http.post('/admin/settings/install', { |
||||
|
mode: this.mode |
||||
|
}).then(resp => { |
||||
|
// todo |
||||
|
}).catch(err => { |
||||
|
this.$store.commit('modalUpgradeSystem/stepChange', 'error') |
||||
|
this.error = err.body |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,24 @@ |
|||||
|
'use strict' |
||||
|
|
||||
|
export default { |
||||
|
namespaced: true, |
||||
|
state: { |
||||
|
shown: false, |
||||
|
mode: 'upgrade', |
||||
|
step: 'confirm' |
||||
|
}, |
||||
|
getters: {}, |
||||
|
mutations: { |
||||
|
shownChange: (state, shownState) => { state.shown = shownState }, |
||||
|
modeChange: (state, modeState) => { state.mode = modeState }, |
||||
|
stepChange: (state, stepState) => { state.step = stepState } |
||||
|
}, |
||||
|
actions: { |
||||
|
open({ commit }, opts) { |
||||
|
commit('shownChange', true) |
||||
|
commit('modeChange', opts.mode) |
||||
|
commit('stepChange', 'confirm') |
||||
|
}, |
||||
|
close({ commit }) { commit('shownChange', false) } |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save