|
81 | 81 | <input type="button" :value="t('exportToCsv.message')" @click="exportToCsv()" /> |
82 | 82 | </div> |
83 | 83 | </div> |
| 84 | + <div class="settings-item"> |
| 85 | + <label class="setting-header d-inline-block">{{ t('removeAllData.message') }}</label> |
| 86 | + <p class="description">{{ t('removeAllData.description') }}</p> |
| 87 | + <input type="button" :value="t('remove.message')" @click="removeAll()" /> |
| 88 | + </div> |
| 89 | + <div id="removeAllConfirmModal" class="modal" v-if="needToConfirmDeleteAllData"> |
| 90 | + <div class="modal-content"> |
| 91 | + <p class="text-center">{{ t('removeAllDataConfirm.message') }}</p> |
| 92 | + <div class="text-center"> |
| 93 | + <input |
| 94 | + type="button" |
| 95 | + class="alert" |
| 96 | + :value="t('remove.message')" |
| 97 | + @click="removeAllConfirm()" |
| 98 | + /> |
| 99 | + <input type="button" class="info ml-10" :value="t('cancel.message')" @click="cancel()" /> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + </div> |
84 | 103 | </template> |
85 | 104 |
|
86 | 105 | <script lang="ts"> |
@@ -119,6 +138,8 @@ const selectedDate = ref<Date[]>(); |
119 | 138 |
|
120 | 139 | const presetRanges = ranges(); |
121 | 140 |
|
| 141 | +const needToConfirmDeleteAllData = ref<boolean>(); |
| 142 | +
|
122 | 143 | onMounted(async () => { |
123 | 144 | viewTimeInBadge.value = await settingsStorage.getValue( |
124 | 145 | StorageParams.VIEW_TIME_IN_BADGE, |
@@ -169,6 +190,18 @@ async function exportToCsv() { |
169 | 190 | ); |
170 | 191 | } |
171 | 192 | } |
| 193 | +
|
| 194 | +async function removeAll() { |
| 195 | + needToConfirmDeleteAllData.value = true; |
| 196 | +} |
| 197 | +
|
| 198 | +function removeAllConfirm() { |
| 199 | + needToConfirmDeleteAllData.value = false; |
| 200 | +} |
| 201 | +
|
| 202 | +function cancel() { |
| 203 | + needToConfirmDeleteAllData.value = false; |
| 204 | +} |
172 | 205 | </script> |
173 | 206 |
|
174 | 207 | <style scoped> |
|
0 commit comments