mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-25 02:31:59 -05:00
commit
64766de8d6
2 changed files with 9 additions and 14 deletions
|
@ -1,11 +1,6 @@
|
||||||
var DebugController = Ember.Controller.extend(Ember.Evented, {
|
var DebugController = Ember.Controller.extend(Ember.Evented, {
|
||||||
uploadButtonText: 'Import',
|
uploadButtonText: 'Import',
|
||||||
|
|
||||||
exportPath: function () {
|
|
||||||
return this.get('ghostPaths.url').api('db') +
|
|
||||||
'?access_token=' + this.get('session.access_token');
|
|
||||||
}.property(),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
onUpload: function (file) {
|
onUpload: function (file) {
|
||||||
var self = this,
|
var self = this,
|
||||||
|
@ -33,15 +28,15 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
|
||||||
},
|
},
|
||||||
|
|
||||||
exportData: function () {
|
exportData: function () {
|
||||||
var self = this;
|
var iframe = $('#iframeDownload'),
|
||||||
|
downloadURL = this.get('ghostPaths.url').api('db') +
|
||||||
|
'?access_token=' + this.get('session.access_token');
|
||||||
|
|
||||||
ic.ajax.request(this.get('ghostPaths.url').api('db'), {
|
if (iframe.length === 0) {
|
||||||
type: 'GET'
|
iframe = $('<iframe>', { id: 'iframeDownload' }).hide().appendTo('body');
|
||||||
}).then(function () {
|
}
|
||||||
self.notifications.showSuccess('Data exported successfully.');
|
|
||||||
}).catch(function (response) {
|
iframe.attr('src', downloadURL);
|
||||||
self.notifications.showErrors(response);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
sendTestEmail: function () {
|
sendTestEmail: function () {
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Export</label>
|
<label>Export</label>
|
||||||
<a class="button-save" {{bind-attr href=exportPath}}>Export</a>
|
<a class="button-save" {{action "exportData"}}>Export</a>
|
||||||
<p>Export the blog settings and data.</p>
|
<p>Export the blog settings and data.</p>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
Loading…
Add table
Reference in a new issue