1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-06 01:08:21 +01:00

use an hidden form to post export data

This commit is contained in:
Sylvain 2016-07-05 17:23:14 +02:00
parent 4dcab27af2
commit d307f91983
3 changed files with 11 additions and 5 deletions

View File

@ -291,10 +291,12 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
# export requested # export requested
if info.type == 'current' if info.type == 'current'
custom = buildCustomFilterQuery() custom = buildCustomFilterQuery()
Export.stats $scope.selectedIndex.es_type_key, $scope.exportUrl = '/stats/'+$scope.selectedIndex.es_type_key+'/export'
buildElasticDataQuery($scope.type.active.key, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting) $scope.exportQuery = buildElasticDataQuery($scope.type.active.key, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting)
angular.element('#export-stats').submit()
else if info.type == 'global' else if info.type == 'global'
Export.stats 'global', $scope.exportUrl = '/stats/global/export'
$scope.exportQuery =
"query": "query":
"bool": "bool":
"must": [ "must": [
@ -305,6 +307,7 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
"lte": moment(info.dates.end).format() "lte": moment(info.dates.end).format()
} }
] ]
angular.element('#export-stats').submit()

View File

@ -289,3 +289,7 @@
</div> </div>
</section> </section>
<form id="export-stats" enctype="multipart/form-data" method="post" action="{{exportUrl}}" formtarget="_blank">
<input type="hidden" ng-value="exportQuery" name="body" >
</form>

View File

@ -4,5 +4,4 @@
# Mime::Type.register "text/richtext", :rtf # Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone # Mime::Type.register_alias "text/html", :iphone
Mime::Type.register "application/vnd.ms-excel", :xls Mime::Type.register "application/vnd.ms-excel", :xls
Mime::Type.register "application/xlsx", :xlsx