From abe4b30fb43f3fed334248fa4e8488b0ef4e365b Mon Sep 17 00:00:00 2001 From: Yves Mettier Date: Thu, 28 Mar 2013 16:28:26 +0100 Subject: [PATCH] New about box showing versio number --- VERSION | 1 + html/mainMenu.html | 6 +----- html/version.html | 14 ++++++++++++++ js/perfwatcher.functions.js | 14 ++++++++++++++ js/perfwatcher.js | 3 +++ php/version.php | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 VERSION create mode 100644 html/version.html create mode 100644 php/version.php diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..3835a84 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +Git master branch diff --git a/html/mainMenu.html b/html/mainMenu.html index ccc7bf4..9ea35a2 100644 --- a/html/mainMenu.html +++ b/html/mainMenu.html @@ -56,11 +56,7 @@
  • About
  • diff --git a/html/version.html b/html/version.html new file mode 100644 index 0000000..64be137 --- /dev/null +++ b/html/version.html @@ -0,0 +1,14 @@ +

    + +

    Version : @VERSION@

    +

    Author : Cyril Feraudet

    +

    Licence : GPL version 2.0

    + +

    Thanks to :

    +

    +
    +
    +
    + +

    + diff --git a/js/perfwatcher.functions.js b/js/perfwatcher.functions.js index cf3b053..7965bb5 100644 --- a/js/perfwatcher.functions.js +++ b/js/perfwatcher.functions.js @@ -136,6 +136,7 @@ function hide_menu_for(node_type) { $('li[id="menu_refresh_tree"]').show(); $('li[id="menu_refresh_status"]').show(); $('li[id="menu_refresh_node"]').show(); + $('li[id="menu_about_box"]').show(); switch (node_type) { case 'default': break; @@ -309,6 +310,19 @@ function confirmfor(optionsarg, func) { return false; } +function perfwatcher_about_box() { + $('#modalwindow').jqxWindow({ height: 287, width: 262, title: 'About Perfwatcher', isModal: true, theme: theme }).show(); + $('#modalwindowcontent').html('

    About Perfwatcheur

    '); + $.ajax({ + async : false, type: 'POST', url: "action.php?tpl=version", + complete : function (r) { + if(r.status) { + $('#modalwindowcontent').html(r.responseText); + } + } + }); +} + function isRightClick(event) { var rightclick; if (!event) var event = window.event; diff --git a/js/perfwatcher.js b/js/perfwatcher.js index ead9cb0..846ba16 100644 --- a/js/perfwatcher.js +++ b/js/perfwatcher.js @@ -150,6 +150,9 @@ $(document).ready(function() { case 'menu_refresh_status': refresh_status(); break; + case 'menu_about_box': + perfwatcher_about_box(); + break; default: console.log('Undefined stuff : '+ $(this).attr("id")); break; diff --git a/php/version.php b/php/version.php new file mode 100644 index 0000000..6789f7d --- /dev/null +++ b/php/version.php @@ -0,0 +1,32 @@ +. + * + * @category Monitoring + * @author Yves Mettier + * @copyright 2013 Yves Mettier + * @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1 + * @link http://www.perfwatcher.org/ + */ + +$html = file_get_contents("html/version.html"); +$version = file_get_contents("VERSION"); +if(!$version) { + $version = "(not found)"; +} + +print preg_replace("/@VERSION@/", $version, $html); + +?>