Enable templates in scheduled maintenance dashboard

This commit is contained in:
Shuichiro MAKIGAKI
2018-11-14 16:06:16 +09:00
parent 93a459409c
commit 8db2b47aab
3 changed files with 79 additions and 46 deletions

View File

@@ -0,0 +1,30 @@
<script>
module.exports = {
data () {
return {
template: null,
name: '',
message: ''
}
},
methods: {
getTemplate (template) {
axios.get('/dashboard/api/incidents/templates', {
params: {
slug: template
}
}).then(response => {
this.name = response.data.name
this.message = response.data.template
}).catch(response => {
(new Cachet.Notifier()).notify('There was an error finding that template.');
})
}
},
watch: {
'template' (template) {
this.getTemplate(template)
}
}
}
</script>