mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-29 18:52:22 +01:00
use an hidden form to post export data
This commit is contained in:
parent
4dcab27af2
commit
d307f91983
@ -291,10 +291,12 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
|
||||
# export requested
|
||||
if info.type == 'current'
|
||||
custom = buildCustomFilterQuery()
|
||||
Export.stats $scope.selectedIndex.es_type_key,
|
||||
buildElasticDataQuery($scope.type.active.key, custom, $scope.agePicker.start, $scope.agePicker.end, moment($scope.datePickerStart.selected), moment($scope.datePickerEnd.selected), $scope.sorting)
|
||||
$scope.exportUrl = '/stats/'+$scope.selectedIndex.es_type_key+'/export'
|
||||
$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'
|
||||
Export.stats 'global',
|
||||
$scope.exportUrl = '/stats/global/export'
|
||||
$scope.exportQuery =
|
||||
"query":
|
||||
"bool":
|
||||
"must": [
|
||||
@ -305,6 +307,7 @@ Application.Controllers.controller "StatisticsController", ["$scope", "$state",
|
||||
"lte": moment(info.dates.end).format()
|
||||
}
|
||||
]
|
||||
angular.element('#export-stats').submit()
|
||||
|
||||
|
||||
|
||||
|
@ -289,3 +289,7 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<form id="export-stats" enctype="multipart/form-data" method="post" action="{{exportUrl}}" formtarget="_blank">
|
||||
<input type="hidden" ng-value="exportQuery" name="body" >
|
||||
</form>
|
||||
|
||||
|
@ -4,5 +4,4 @@
|
||||
# Mime::Type.register "text/richtext", :rtf
|
||||
# Mime::Type.register_alias "text/html", :iphone
|
||||
|
||||
Mime::Type.register "application/vnd.ms-excel", :xls
|
||||
Mime::Type.register "application/xlsx", :xlsx
|
||||
Mime::Type.register "application/vnd.ms-excel", :xls
|
Loading…
x
Reference in New Issue
Block a user