ResetAppButton.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <div class="text-xs-center">
  3. <v-dialog
  4. v-model="dialog"
  5. width="600"
  6. :fullscreen="$vuetify.breakpoint.smAndDown"
  7. >
  8. <template v-slot:activator="{ on }">
  9. <v-btn small dark v-on="on">Reset app</v-btn>
  10. </template>
  11. <v-card>
  12. <v-card-title class="headline" primary-title>Reset app</v-card-title>
  13. <v-card-text>
  14. Resetting the app will purge the configuration, any cached data, progression or any other data stored client-side.<br><br>
  15. This action is not reversible.
  16. </v-card-text>
  17. <v-divider />
  18. <v-card-actions v-if="$vuetify.breakpoint.smAndDown">
  19. <v-flex xs12 text-xs-center>
  20. <div>
  21. <v-btn color="primary" block flat @click="reset({ hostConfig: true })">Reset configuration</v-btn>
  22. </div>
  23. <div>
  24. <v-btn color="primary" block flat @click="reset({ hostConfig: true, scenesList: true })">Reset everything</v-btn>
  25. </div>
  26. <div class="mt-4">
  27. <v-btn color="secondary" block flat @click="dialog = false">Cancel</v-btn>
  28. </div>
  29. </v-flex>
  30. </v-card-actions>
  31. <v-card-actions v-else>
  32. <v-btn color="secondary" flat @click="dialog = false">Cancel</v-btn>
  33. <v-spacer />
  34. <v-btn color="primary" flat @click="reset({ hostConfig: true })">Reset configuration</v-btn>
  35. <v-btn color="primary" flat @click="reset({ hostConfig: true, scenesList: true })">Reset everything</v-btn>
  36. </v-card-actions>
  37. </v-card>
  38. </v-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import { mapActions } from 'vuex'
  43. export default {
  44. name: 'ResetAppButton',
  45. data() {
  46. return {
  47. dialog: false
  48. }
  49. },
  50. methods: {
  51. ...mapActions(['resetApp']),
  52. reset(toResetObj) {
  53. this.resetApp(toResetObj)
  54. this.dialog = false
  55. }
  56. }
  57. }
  58. </script>