Fixed a flexibility issue

pull/59/head
Mokaddem 2016-07-15 09:47:00 +02:00
parent 2383db022f
commit 4ecb9a4b44
2 changed files with 4 additions and 2 deletions

View File

@ -1,7 +1,8 @@
// Plot and update the number of processed pastes // Plot and update the number of processed pastes
$(function() { $(function() {
var data = []; var data = [];
var totalPoints = 60*10; //60s*10m var default_minute = (typeof window.default_minute !== "undefined") ? parseInt(window.default_minute) : 10;
var totalPoints = 60*parseInt(default_minute); //60s*minute
var curr_max = 0; var curr_max = 0;
function getData() { function getData() {
@ -24,7 +25,7 @@ $(function() {
return res; return res;
} }
var updateInterval = 1000; var updateInterval = 1000; //1s
var options = { var options = {
series: { shadowSize: 1 }, series: { shadowSize: 1 },
lines: { fill: true, fillColor: { colors: [ { opacity: 1 }, { opacity: 0.1 } ] }}, lines: { fill: true, fillColor: { colors: [ { opacity: 1 }, { opacity: 0.1 } ] }},

View File

@ -19,6 +19,7 @@
<script src="{{ url_for('static', filename='js/jquery.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery.js') }}"></script>
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script> <script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
<script> <script>
window.default_minute = {{ default_minute }};
function update_values() { function update_values() {
$SCRIPT_ROOT = {{ request.script_root|tojson|safe }}; $SCRIPT_ROOT = {{ request.script_root|tojson|safe }};
$.getJSON($SCRIPT_ROOT+"/_stuff", $.getJSON($SCRIPT_ROOT+"/_stuff",