mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 02:26:58 +00:00
Small cosmetic changes to export routine.
This commit is contained in:
@@ -46,7 +46,7 @@ class ExportController extends Controller
|
|||||||
$this->middleware(
|
$this->middleware(
|
||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
View::share('mainTitleIcon', 'fa-file-archive-o');
|
View::share('mainTitleIcon', 'fa-file-archive-o');
|
||||||
View::share('title', trans('firefly.export_data'));
|
View::share('title', trans('firefly.export_and_backup_data'));
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
18
public/js/ff/export/index.js
vendored
18
public/js/ff/export/index.js
vendored
@@ -58,7 +58,8 @@ function hideForm() {
|
|||||||
function showForm() {
|
function showForm() {
|
||||||
"use strict";
|
"use strict";
|
||||||
$('#form-body').show();
|
$('#form-body').show();
|
||||||
$('#do-export-button').show();
|
$('#do-export-button').show().prop('disabled', false);
|
||||||
|
// enable button again:
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoading() {
|
function showLoading() {
|
||||||
@@ -88,7 +89,7 @@ function callExport() {
|
|||||||
// call status, keep calling it until response is "finished"?
|
// call status, keep calling it until response is "finished"?
|
||||||
intervalId = window.setInterval(checkStatus, 500);
|
intervalId = window.setInterval(checkStatus, 500);
|
||||||
|
|
||||||
$.post('export/submit', data).done(function () {
|
$.post('export/submit', data, null, 'json').done(function () {
|
||||||
// stop polling:
|
// stop polling:
|
||||||
window.clearTimeout(intervalId);
|
window.clearTimeout(intervalId);
|
||||||
|
|
||||||
@@ -103,18 +104,13 @@ function callExport() {
|
|||||||
// show download
|
// show download
|
||||||
showDownload();
|
showDownload();
|
||||||
|
|
||||||
}).fail(function (data) {
|
}).fail(function (jqXHR, textStatus, errorThrown) {
|
||||||
// show error.
|
// show error.
|
||||||
// show form again.
|
// show form again.
|
||||||
|
var response = jqXHR.responseJSON;
|
||||||
var errorText = 'The export failed. Please check the log files to find out why.';
|
var errorText = 'The export failed. Please check the log files to find out why.';
|
||||||
if (typeof data.responseJSON === 'object') {
|
if (typeof response === 'object') {
|
||||||
errorText = '';
|
errorText =response.message;
|
||||||
for (var propt in data.responseJSON) {
|
|
||||||
if (data.responseJSON.hasOwnProperty(propt)) {
|
|
||||||
errorText += propt + ': ' + data.responseJSON[propt][0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showError(errorText);
|
showError(errorText);
|
||||||
|
@@ -5,9 +5,6 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form method="post" action="{{ route('export.submit') }}" accept-charset="UTF-8" class="form-horizontal" id="export">
|
<form method="post" action="{{ route('export.submit') }}" accept-charset="UTF-8" class="form-horizontal" id="export">
|
||||||
<input name="_token" type="hidden" value="{{ csrf_token() }}">
|
<input name="_token" type="hidden" value="{{ csrf_token() }}">
|
||||||
<input name="job" type="hidden" value="{{ job.key }}">
|
<input name="job" type="hidden" value="{{ job.key }}">
|
||||||
@@ -17,7 +14,7 @@
|
|||||||
|
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">{{ 'export_data'|_ }}</h3>
|
<h3 class="box-title">{{ 'export_and_backup_data'|_ }}</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div id="export-loading" style="display:none;">
|
<div id="export-loading" style="display:none;">
|
||||||
|
Reference in New Issue
Block a user