mailboxes: be explicit about what is exported
This commit is contained in:
@@ -209,7 +209,7 @@
|
|||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div ng-show="!mailboxImport.done">
|
<div ng-show="!mailboxImport.done">
|
||||||
<div ng-show="!mailboxImport.busy">
|
<div ng-show="!mailboxImport.busy">
|
||||||
<p>The import requires a specific schema for JSON. The detailed schema is described in our <a href="" target="_blank">documentation</a></p>
|
<p>The import requires a specific schema for JSON. The detailed schema is described in our <a href="https://cloudron.io/documentation/email/#import" target="_blank">documentation</a></p>
|
||||||
<input type="file" style="display: none;" id="mailboxImportFileInput" accept="application/json"/>
|
<input type="file" style="display: none;" id="mailboxImportFileInput" accept="application/json"/>
|
||||||
<button class="btn btn-primary" ng-click="mailboxImport.openFileInput()">Select JSON file</button>
|
<button class="btn btn-primary" ng-click="mailboxImport.openFileInput()">Select JSON file</button>
|
||||||
<br/>
|
<br/>
|
||||||
|
|||||||
+12
-1
@@ -449,7 +449,18 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
|||||||
return console.error('Failed to list mailboxes.', error);
|
return console.error('Failed to list mailboxes.', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
var file = new Blob([ JSON.stringify(result, null, 2) ], { type: 'application/json' });
|
var content = JSON.stringify(result.map(function (mailbox) {
|
||||||
|
return {
|
||||||
|
name: mailbox.name,
|
||||||
|
domain: mailbox.domain,
|
||||||
|
ownerId: mailbox.ownerId,
|
||||||
|
ownerType: mailbox.ownerType,
|
||||||
|
active: mailbox.ative,
|
||||||
|
aliases: mailbox.aliases
|
||||||
|
};
|
||||||
|
}), null, 2);
|
||||||
|
|
||||||
|
var file = new Blob([ content ], { type: 'application/json' });
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
a.href = URL.createObjectURL(file);
|
a.href = URL.createObjectURL(file);
|
||||||
a.download = $scope.domain.domain.replaceAll('.','_') + '-mailboxes.json';
|
a.download = $scope.domain.domain.replaceAll('.','_') + '-mailboxes.json';
|
||||||
|
|||||||
Reference in New Issue
Block a user