From 775da40f8c247a97a01c3affd75511b4cbdb95b7 Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Mon, 16 Dec 2013 22:28:33 +0100 Subject: Add a configuration option for sync/async choice for the canvas graphs --- conf/config.php | 3 +++ inc/html.inc.php | 11 +++++++++++ js/CGP-async.js | 21 +++++++++++++++++++++ js/CGP-sync.js | 21 +++++++++++++++++++++ js/CGP.js | 22 ---------------------- 5 files changed, 56 insertions(+), 22 deletions(-) create mode 100644 js/CGP-async.js create mode 100644 js/CGP-sync.js diff --git a/conf/config.php b/conf/config.php index 26172b1..b808a70 100644 --- a/conf/config.php +++ b/conf/config.php @@ -45,6 +45,9 @@ $CONFIG['network_datasize'] = 'bytes'; # png or canvas graphs $CONFIG['graph_type'] = 'png'; +# For canvas graphs, use 'async' or 'sync' fetch method +$CONFIG['rrd_fetch_method'] = 'sync'; + # use the negative X-axis in I/O graphs $CONFIG['negative_io'] = false; diff --git a/inc/html.inc.php b/inc/html.inc.php index 478045c..b07be8a 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -87,6 +87,17 @@ EOT; EOT; + if ($CONFIG['rrd_fetch_method'] == 'async') { + echo << + +EOT; + } else { + echo << + +EOT; + } } echo <<