refactor: improve confirmation dialog visuals (#508)

* chore: improve confirmation service host control visuals
* fix: add missing klipper restart condition
* i18n: improve wording of english and german translation

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus 2022-01-04 21:25:54 +01:00 committed by GitHub
parent 7b3781ebaf
commit 26ed70b4a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 28 deletions

View File

@ -85,7 +85,7 @@
</v-card> </v-card>
</v-dialog> </v-dialog>
<v-dialog v-model="dialogConfirmation.show" width="400" :fullscreen="isMobile"> <v-dialog v-model="dialogConfirmation.show" width="400" :fullscreen="isMobile">
<panel card-class="confirm-top-corner-menu-dialog" icon="mdi-help-circle" :title="dialogConfirmation.title" :margin-bottom="false"> <panel card-class="confirm-top-corner-menu-dialog" icon="mdi-alert" :title="dialogConfirmation.title" :margin-bottom="false">
<template v-slot:buttons> <template v-slot:buttons>
<v-btn icon tile @click="dialogConfirmation.show = false"><v-icon>mdi-close-thick</v-icon></v-btn> <v-btn icon tile @click="dialogConfirmation.show = false"><v-icon>mdi-close-thick</v-icon></v-btn>
</template> </template>
@ -101,7 +101,7 @@
<v-btn text @click="dialogConfirmation.show = false"> <v-btn text @click="dialogConfirmation.show = false">
{{ $t('App.TopCornerMenu.Cancel') }} {{ $t('App.TopCornerMenu.Cancel') }}
</v-btn> </v-btn>
<v-btn text color="primary" @click="executeDialog"> <v-btn text color="error" @click="executeDialog">
{{ dialogConfirmation.actionButtonText }} {{ dialogConfirmation.actionButtonText }}
</v-btn> </v-btn>
</v-card-actions> </v-card-actions>
@ -197,6 +197,7 @@ export default class TheTopCornerMenu extends Mixins(BaseMixin) {
this.dialogConfirmation.title = this.$t('App.TopCornerMenu.ConfirmationDialog.Title.' + functionNameUppercase)+'' this.dialogConfirmation.title = this.$t('App.TopCornerMenu.ConfirmationDialog.Title.' + functionNameUppercase)+''
if (serviceName === 'klipper' && action === 'Stop') this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperStop')+'' if (serviceName === 'klipper' && action === 'Stop') this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperStop')+''
else if (serviceName === 'klipper' && action === 'Restart') this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.KlipperRestart')+''
else this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.' + functionNameUppercase)+'' else this.dialogConfirmation.description = this.$t('App.TopCornerMenu.ConfirmationDialog.Description.' + functionNameUppercase)+''
this.dialogConfirmation.actionButtonText = this.$t('App.TopCornerMenu.' + action.charAt(0).toUpperCase() + action.slice(1))+'' this.dialogConfirmation.actionButtonText = this.$t('App.TopCornerMenu.' + action.charAt(0).toUpperCase() + action.slice(1))+''

View File

@ -27,21 +27,21 @@
"Title": { "Title": {
"KlipperRestart": "Klipper Neustart", "KlipperRestart": "Klipper Neustart",
"KlipperFirmwareRestart": "Klipper Firmware Neustart", "KlipperFirmwareRestart": "Klipper Firmware Neustart",
"ServiceStart": "Service Start", "ServiceStart": "Dienst Start",
"ServiceRestart": "Service Neustart", "ServiceRestart": "Dienst Neustart",
"ServiceStop": "Service Stop", "ServiceStop": "Dienst Stop",
"HostReboot": "Host Neustart", "HostReboot": "Host Neustart",
"HostShutdown": "Host Herunterfahren" "HostShutdown": "Host Herunterfahren"
}, },
"Description": { "Description": {
"KlipperStop": "Wenn du Klipper jetzt stoppst, wird der momentane Druck fehlschlagen.", "KlipperStop": "Ein Stopp von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",
"KlipperRestart": "Wenn du Klipper jetzt neustartest, wird der momentane Druck fehlschlagen.", "KlipperRestart": "Ein Neustart von Klipper wird zum Abbruch des aktuellen Druckauftrags führen!",
"KlipperFirmwareRestart": "Wenn du die Klipper Firmware jetzt neustartest, wird der momentane Druck fehlschlagen.", "KlipperFirmwareRestart": "Ein Neustart der Klipper Firmware wird zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceStart": "Wenn du diesen Service jetzt startest, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.", "ServiceStart": "Ein Start dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceRestart": "Wenn du diesen Service jetzt neustartest, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.", "ServiceRestart": "Ein Neustart dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"ServiceStop": "Wenn du diesen Service jetzt stoppst, riskierst du höchstwahrscheinlich einen Fehlschlag des momentanen Druckauftrags.", "ServiceStop": "Ein Stopp dieses Dienstes kann zum Abbruch des aktuellen Druckauftrags führen!",
"HostReboot": "Wenn du den Host jetzt neustartest, wird der momentane Druck fehlschlagen.", "HostReboot": "Ein Neustart des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!",
"HostShutdown": "Wenn du den Host jetzt herunterfährst, wird der momentane Druck fehlschlagen." "HostShutdown": "Ein Herunterfahren des Hosts wird zum Abbruch des aktuellen Druckauftrags führen!"
} }
} }
}, },

View File

@ -25,23 +25,23 @@
"Cancel": "Cancel", "Cancel": "Cancel",
"ConfirmationDialog": { "ConfirmationDialog": {
"Title": { "Title": {
"KlipperRestart": "Klipper restart", "KlipperRestart": "Klipper Restart",
"KlipperFirmwareRestart": "Klipper firmware restart", "KlipperFirmwareRestart": "Klipper Firmware Restart",
"ServiceStart": "Service start", "ServiceStart": "Service Start",
"ServiceRestart": "Service restart", "ServiceRestart": "Service Restart",
"ServiceStop": "Service stop", "ServiceStop": "Service Stop",
"HostReboot": "Host reboot", "HostReboot": "Host Reboot",
"HostShutdown": "Host shutdown" "HostShutdown": "Host Shutdown"
}, },
"Description": { "Description": {
"KlipperStop": "If you stop Klipper now, the current print will fail.", "KlipperStop": "Stopping Klipper will cause the current print to fail!",
"KlipperRestart": "If you restart Klipper now, the current print will fail.", "KlipperRestart": "Restarting Klipper will cause the current print to fail!",
"KlipperFirmwareRestart": "If you restart the Klipper firmware now, the current print will fail.", "KlipperFirmwareRestart": "Restarting the Klipper Firmware will cause the current print to fail!",
"ServiceStart": "If you start this service now, you are very likely risking a failure of your ongoing print job.", "ServiceStart": "Starting this service may cause the current print to fail!",
"ServiceRestart": "If you restart this service now, you are very likely risking a failure of your ongoing print job.", "ServiceRestart": "Restarting this service may cause the current print to fail!",
"ServiceStop": "If you stop this service now, you are very likely risking a failure of your ongoing print job.", "ServiceStop": "Stopping this service may cause the current print to fail!",
"HostReboot": "If you reboot the host now, the current print will fail.", "HostReboot": "Rebooting the Host will cause the current print to fail!",
"HostShutdown": "If you shutdown the host now, the current print will fail." "HostShutdown": "Shutting down the Host will cause the current print to fail!"
} }
} }
}, },