|
43 | 43 | <v-btn |
44 | 44 | v-tooltip="'Restores BlueOS services to default configurations'" |
45 | 45 | class="ma-2" |
46 | | - @click="reset_settings" |
| 46 | + @click="confirm_reset_settings" |
47 | 47 | > |
48 | 48 | <v-icon left> |
49 | 49 | mdi-cog-refresh |
|
158 | 158 | </v-card> |
159 | 159 | </v-card> |
160 | 160 | </v-dialog> |
| 161 | + <v-dialog |
| 162 | + v-model="show_reset_warning" |
| 163 | + width="fit-content" |
| 164 | + @click:outside="show_reset_warning = false" |
| 165 | + @keydown.esc="show_reset_warning = false" |
| 166 | + > |
| 167 | + <v-sheet |
| 168 | + color="warning" |
| 169 | + outlined |
| 170 | + > |
| 171 | + <v-card variant="outlined"> |
| 172 | + <v-card-title class="align-center"> |
| 173 | + WARNING |
| 174 | + </v-card-title> |
| 175 | + <v-card-text class="reset-warning-text"> |
| 176 | + Resetting will restore BlueOS services to their default configurations. |
| 177 | + This action cannot be undone. Proceed? |
| 178 | + </v-card-text> |
| 179 | + <v-card-actions> |
| 180 | + <v-btn color="primary" @click="show_reset_warning = false"> |
| 181 | + Cancel |
| 182 | + </v-btn> |
| 183 | + <v-spacer /> |
| 184 | + <v-btn color="warning" @click="reset_settings(); show_reset_warning = false"> |
| 185 | + Yes, reset settings |
| 186 | + </v-btn> |
| 187 | + </v-card-actions> |
| 188 | + </v-card> |
| 189 | + </v-sheet> |
| 190 | + </v-dialog> |
161 | 191 | <v-dialog |
162 | 192 | width="380" |
163 | 193 | :value="show_reset_dialog" |
@@ -201,6 +231,7 @@ export default Vue.extend({ |
201 | 231 | mavlink_log_folder_size: null as null | string, |
202 | 232 | show_dialog: false, |
203 | 233 | show_reset_dialog: false, |
| 234 | + show_reset_warning: false, |
204 | 235 | operation_in_progress: false, |
205 | 236 | operation_description: '', |
206 | 237 | operation_error: undefined as undefined | string, |
@@ -286,6 +317,9 @@ export default Vue.extend({ |
286 | 317 | }) |
287 | 318 | this.operation_in_progress = false |
288 | 319 | }, |
| 320 | + confirm_reset_settings(): void { |
| 321 | + this.show_reset_warning = true |
| 322 | + }, |
289 | 323 | async reset_settings(): Promise<void> { |
290 | 324 | this.prepare_operation('Resetting settings...') |
291 | 325 |
|
@@ -410,4 +444,7 @@ export default Vue.extend({ |
410 | 444 | backdrop-filter: blur(2px); |
411 | 445 | z-index: 9999 !important; |
412 | 446 | } |
| 447 | +.reset-warning-text { |
| 448 | + max-width: 30rem; |
| 449 | +} |
413 | 450 | </style> |
0 commit comments