64
64
</b-button >
65
65
66
66
<b-button
67
- @click = " uninstall"
67
+ v-b-modal. uninstall-modal
68
68
id =" uninstall"
69
69
variant =" danger"
70
70
:class =" { 'ml-auto': !app.url }"
262
262
</b-list-group >
263
263
</card >
264
264
265
+ <b-modal
266
+ v-if =" app"
267
+ id =" uninstall-modal" :title =" $t('confirm_uninstall', { name: id })"
268
+ header-bg-variant =" warning" :body-class =" { 'd-none': !app.supports_purge }" body-bg-variant =" "
269
+ @ok =" uninstall"
270
+ >
271
+ <b-form-group v-if =" app.supports_purge" >
272
+ <b-form-checkbox v-model =" purge" >
273
+ {{ $t('app.uninstall.purge_desc', { name: id }) }}
274
+ </b-form-checkbox >
275
+ </b-form-group >
276
+ </b-modal >
277
+
265
278
<template #skeleton >
266
279
<card-info-skeleton :item-count =" 8" />
267
280
<card-form-skeleton />
@@ -306,6 +319,7 @@ export default {
306
319
loading: true ,
307
320
app: undefined ,
308
321
form: undefined ,
322
+ purge: false ,
309
323
config_panel_err: null ,
310
324
config: {
311
325
panels: [
@@ -408,7 +422,7 @@ export default {
408
422
links: [
409
423
[' license' , ` https://spdx.org/licenses/${ app .manifest .upstream .license } ` ],
410
424
... [' website' , ' admindoc' , ' userdoc' , ' code' ].map ((key ) => ([key, app .manifest .upstream [key]])),
411
- [' package' , app .from_catalog .git .url ],
425
+ [' package' , app .from_catalog .git ? .url ],
412
426
[' forum' , ` https://forum.yunohost.org/tag/${ app .manifest .id } ` ]
413
427
].filter (([key , val ]) => !! val),
414
428
doc: {
@@ -429,6 +443,7 @@ export default {
429
443
is_default: app .is_default ,
430
444
supports_change_url: app .supports_change_url ,
431
445
supports_config_panel: app .supports_config_panel ,
446
+ supports_purge: app .supports_purge ,
432
447
permissions
433
448
}
434
449
if (app .settings .domain && app .settings .path ) {
@@ -518,12 +533,8 @@ export default {
518
533
},
519
534
520
535
async uninstall () {
521
- const confirmed = await this .$askConfirmation (
522
- this .$i18n .t (' confirm_uninstall' , { name: this .id })
523
- )
524
- if (! confirmed) return
525
-
526
- api .delete (' apps/' + this .id , {}, { key: ' apps.uninstall' , name: this .app .label }).then (() => {
536
+ const data = this .purge === true ? { purge: 1 } : {}
537
+ api .delete (' apps/' + this .id , data, { key: ' apps.uninstall' , name: this .app .label }).then (() => {
527
538
this .$router .push ({ name: ' app-list' })
528
539
})
529
540
}
0 commit comments