2017-07-08 16:51:47 +00:00
|
|
|
<template>
|
|
|
|
<div class="dashboard">
|
|
|
|
<h1>Global Settings</h1>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li><router-link v-if="user.admin" to="/users">Go to User Management</router-link></li>
|
|
|
|
</ul>
|
|
|
|
|
2017-07-08 17:13:19 +00:00
|
|
|
<form @submit="saveHooks">
|
|
|
|
<h2>Commands</h2>
|
|
|
|
|
|
|
|
<p class="small">Here you can set commands that are executed in the named events. You write one command
|
|
|
|
per line. If the event is related to files, such as before and after saving, the environment variable
|
|
|
|
<code>file</code> will be available with the path of the file.</p>
|
|
|
|
|
|
|
|
<h3>Before Save</h3>
|
|
|
|
<textarea v-model="beforeSave"></textarea>
|
|
|
|
|
|
|
|
<h3>After Save</h3>
|
|
|
|
<textarea v-model="afterSave"></textarea>
|
|
|
|
|
2017-07-08 16:51:47 +00:00
|
|
|
<p><input type="submit" value="Save"></p>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState, mapMutations } from 'vuex'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'settings',
|
|
|
|
data: function () {
|
|
|
|
return {
|
2017-07-08 17:13:19 +00:00
|
|
|
beforeSave: '',
|
|
|
|
afterSave: ''
|
2017-07-08 16:51:47 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState([ 'user' ])
|
|
|
|
},
|
2017-07-08 17:13:19 +00:00
|
|
|
created () {
|
|
|
|
// TODO: fetch current settings here
|
|
|
|
},
|
2017-07-08 16:51:47 +00:00
|
|
|
methods: {
|
2017-07-08 17:13:19 +00:00
|
|
|
...mapMutations([ 'showSuccess' ]),
|
|
|
|
saveHooks (event) {
|
|
|
|
event.preventDefault()
|
|
|
|
}
|
2017-07-08 16:51:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|