From 575a951d5f44b24e0eee1fefb24f92f5168fd304 Mon Sep 17 00:00:00 2001 From: ssamson-tis Date: Mon, 29 Jun 2015 15:16:19 +0200 Subject: [PATCH] improove perfermances with last_backups page --- templates/last_backups.html | 2 +- tisbackup_gui.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/last_backups.html b/templates/last_backups.html index bb89d9f..8fe2a2e 100755 --- a/templates/last_backups.html +++ b/templates/last_backups.html @@ -4,7 +4,7 @@ $(document).ready(function() { var oTable = $('#table-design').dataTable( { "bProcessing": true, - "sAjaxDataProp": "data", + "sAjaxDataProp": "", "sAjaxSource": "/backups.json", "iDisplayLength": 25, // "aLengthMenu": [[25, 50, 100, 200, 500, -1], [25, 50, 100, 200, 500, "All"]], diff --git a/tisbackup_gui.py b/tisbackup_gui.py index c96c6af..b986f24 100755 --- a/tisbackup_gui.py +++ b/tisbackup_gui.py @@ -26,7 +26,7 @@ from shutil import * from iniparse import ConfigParser from libtisbackup.common import * import time -from flask import request, Flask, session, g, redirect, url_for, abort, render_template, flash, jsonify +from flask import request, Flask, session, g, redirect, url_for, abort, render_template, flash, jsonify, Response from urlparse import urlparse import json import glob @@ -227,7 +227,10 @@ def export_backup_status(): @app.route('/backups.json') def last_backup_json(): exports = dbstat.query('select * from stats where TYPE="BACKUP" ORDER BY backup_start DESC ') - return jsonify(data=exports) + return Response(response=json.dumps(exports), + status=200, + mimetype="application/json") + @app.route('/last_backups') def last_backup():