diff --git a/domain/backup/backup.go b/domain/backup/backup.go index 789c4b74..51d3bad3 100644 --- a/domain/backup/backup.go +++ b/domain/backup/backup.go @@ -21,6 +21,8 @@ package backup // the file is deleted at the end of the process. // // The backup file contains a manifest file that describes the backup. +// +// TODO: explore writing straight to HTTP response via https://github.com/mholt/archiver import ( "archive/zip" diff --git a/gui/app/components/customize/license-key.js b/gui/app/components/customize/license-key.js index f13928ae..ae901fd0 100644 --- a/gui/app/components/customize/license-key.js +++ b/gui/app/components/customize/license-key.js @@ -12,9 +12,10 @@ import { empty } from '@ember/object/computed'; import { inject as service } from '@ember/service'; import Notifier from '../../mixins/notifier'; +import Modals from '../../mixins/modal'; import Component from '@ember/component'; -export default Component.extend(Notifier, { +export default Component.extend(Notifier, Modals, { appMeta: service(), global: service(), licenseError: empty('license'), @@ -44,6 +45,13 @@ export default Component.extend(Notifier, { this.showDone(); window.location.reload(); }); + }, + + onDeactivate() { + this.get('global').deactivate().then(() => { + this.showDone(); + this.modalOpen("#deactivation-modal", {"show": true}); + }); } } }); diff --git a/gui/app/services/global.js b/gui/app/services/global.js index 456c129d..8dac1d0e 100644 --- a/gui/app/services/global.js +++ b/gui/app/services/global.js @@ -234,5 +234,15 @@ export default Service.extend({ xhr.send(data); }); - } + }, + + deactivate() { + if(this.get('sessionService.isAdmin')) { + return this.get('ajax').request(`deactivate`, { + method: 'POST', + }).then(() => { + return; + }); + } + }, }); diff --git a/gui/app/styles/view/customize.scss b/gui/app/styles/view/customize.scss index 67b1f739..99ddd85c 100644 --- a/gui/app/styles/view/customize.scss +++ b/gui/app/styles/view/customize.scss @@ -222,4 +222,13 @@ } } } + + > .deactivation-zone { + @include border-radius(3px); + border: 1px solid $color-red; + margin: 30px 0; + padding: 20px 20px; + background-color: lighten($color-red, 60%); + color: $color-off-black; + } } diff --git a/gui/app/templates/components/customize/license-key.hbs b/gui/app/templates/components/customize/license-key.hbs index 7e371493..bb6929d0 100644 --- a/gui/app/templates/components/customize/license-key.hbs +++ b/gui/app/templates/components/customize/license-key.hbs @@ -130,3 +130,38 @@ {{/if}} + +{{#if (eq appMeta.edition constants.Product.EnterpriseEdition)}} + {{#if (eq appMeta.location 'cloud')}} +
+
+
+
+
+

Let us know if you would like to close your account or cancel your subscription.

+

WARNING: All data will be deleted so please download a complete backup of all your data.

+

Requests can take up to 24 hours to process.

+ {{#link-to 'customize.backup' class="btn btn-success"}}PERFORM BACKUP{{/link-to}} +
+ +
+
+
+
+ {{/if}} +{{/if}} + +