Skip to content

Commit

Permalink
fix: editor safe & restart with multi instances (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Jun 21, 2022
1 parent 38d2c88 commit dfc91df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/TheEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<v-btn text color="primary" @click="save">
{{ $t('Editor.SaveClose') }}
</v-btn>
<template v-if="restartServiceName != null">
<template v-if="restartServiceNameExists">
<v-btn text color="primary" @click="save(restartServiceName)">
{{ $t('Editor.SaveRestart') }}
</v-btn>
Expand Down Expand Up @@ -246,15 +246,23 @@ export default class TheEditor extends Mixins(BaseMixin) {
return this.filenameWithoutExtension
if (this.filename.startsWith('webcam') && ['conf', 'txt'].includes(this.fileExtension)) return 'webcamd'
if (this.filename.startsWith('mooncord') && this.fileExtension === 'json') return 'mooncord'
if (this.filename === 'moonraker.conf') return this.moonrakerRestartInstance ?? 'moonraker'
if (this.fileExtension === 'cfg') return 'klipper'
return null
}
get restartServiceNameExists() {
if (this.restartServiceName) return true
return this.availableServices.includes(this.restartServiceName)
}
get moonrakerRestartInstance() {
return this.$store.state.gui.editor.moonrakerRestartInstance
}
get confirmUnsavedChanges() {
return this.$store.state.gui.editor.confirmUnsavedChanges ?? false
}
Expand Down

0 comments on commit dfc91df

Please sign in to comment.