Module: nagvis Branch: master Commit: 2051cb5f6faf8e04a4e4933d1d99853a53d4f2c9 URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/nagvis;a=commit;h=2051cb5f6faf8e04a4e4933d1d99853a53d4f2c9
Author: Roman Kyrylych <[email protected]> Date: Tue Sep 8 14:28:28 2009 +0300 Added geomap to the overview page Signed-off-by: Roman Kyrylych <[email protected]> --- .gitignore | 1 + etc/nagvis.ini.php-sample | 2 + share/nagvis/images/maps/geomap-thumb.png | Bin 0 -> 12229 bytes share/nagvis/includes/classes/GlobalIndexPage.php | 1 + share/nagvis/includes/classes/GlobalMainCfg.php | 4 + share/nagvis/includes/js/frontend.js | 114 +++++++++++++++++++++ 6 files changed, 122 insertions(+), 0 deletions(-) diff --git a/.gitignore b/.gitignore index e49fcab..ed12f25 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ etc/automaps/*.cfg share/nagvis/images/maps/*.png !share/nagvis/images/maps/demo_background.png !share/nagvis/images/maps/nagvis-demo.png +!share/nagvis/images/maps/geomap-thumb.png # Exclude all shapes except the default share/nagvis/images/shapes/*.png diff --git a/etc/nagvis.ini.php-sample b/etc/nagvis.ini.php-sample index 06ccdfe..5487bf3 100644 --- a/etc/nagvis.ini.php-sample +++ b/etc/nagvis.ini.php-sample @@ -179,6 +179,8 @@ ;showautomaps=1 ; Enable/Disable map listing ;showmaps=1 +; Enable/Disable geomap listing +;showgeomap=1 ; Enable/Disable map thumbnails ;showmapthumbs=1 ; Enable/Disable rotation listing diff --git a/share/nagvis/images/maps/geomap-thumb.png b/share/nagvis/images/maps/geomap-thumb.png new file mode 100644 index 0000000..80b3d07 Binary files /dev/null and b/share/nagvis/images/maps/geomap-thumb.png differ diff --git a/share/nagvis/includes/classes/GlobalIndexPage.php b/share/nagvis/includes/classes/GlobalIndexPage.php index 386ae68..6bb4025 100755 --- a/share/nagvis/includes/classes/GlobalIndexPage.php +++ b/share/nagvis/includes/classes/GlobalIndexPage.php @@ -331,6 +331,7 @@ class GlobalIndexPage { $arr['cellsperrow'] = $this->CORE->MAINCFG->getValue('index', 'cellsperrow'); $arr['showautomaps'] = $this->CORE->MAINCFG->getValue('index', 'showautomaps'); $arr['showmaps'] = $this->CORE->MAINCFG->getValue('index', 'showmaps'); + $arr['showgeomap'] = $this->CORE->MAINCFG->getValue('index', 'showgeomap'); $arr['showmapthumbs'] = $this->CORE->MAINCFG->getValue('index', 'showmapthumbs'); $arr['showrotations'] = $this->CORE->MAINCFG->getValue('index', 'showrotations'); diff --git a/share/nagvis/includes/classes/GlobalMainCfg.php b/share/nagvis/includes/classes/GlobalMainCfg.php index 9297568..7a5b6e3 100644 --- a/share/nagvis/includes/classes/GlobalMainCfg.php +++ b/share/nagvis/includes/classes/GlobalMainCfg.php @@ -605,6 +605,10 @@ class GlobalMainCfg { 'editable' => 1, 'default' => 1, 'match' => MATCH_BOOLEAN), + 'showgeomap' => Array('must' => 0, + 'editable' => 1, + 'default' => 1, + 'match' => MATCH_BOOLEAN), 'showmapthumbs' => Array('must' => 0, 'editable' => 1, 'default' => 1, diff --git a/share/nagvis/includes/js/frontend.js b/share/nagvis/includes/js/frontend.js index 6acaef9..361dc48 100755 --- a/share/nagvis/includes/js/frontend.js +++ b/share/nagvis/includes/js/frontend.js @@ -881,6 +881,34 @@ function parseOverviewPage() { oTable = null; } + // Render the geomap when enabled + if(oPageProperties.showgeomap == 1) { + oTable = document.createElement('table'); + oTable.setAttribute('class', 'infobox'); + oTable.setAttribute('className', 'infobox'); + + oTbody = document.createElement('tbody'); + oTbody.setAttribute('id', 'overviewGeomap'); + + oTr = document.createElement('tr'); + + oTh = document.createElement('th'); + oTh.colSpan = oPageProperties.cellsperrow; + oTh.appendChild(document.createTextNode('Geomap')); + + oTr.appendChild(oTh); + oTh = null; + + oTbody.appendChild(oTr); + oTr = null; + + oTable.appendChild(oTbody); + oTbody = null; + + oContainer.appendChild(oTable); + oTable = null; + } + // Render the rotation list when enabled if(oPageProperties.showrotations == 1 && aInitialRotations.length > 0) { @@ -1030,6 +1058,89 @@ function parseOverviewAutomaps(aMapsConf) { } /** + * parseOverviewGeomap() + * + * Does initial parsing of geomap on the overview page + * + * @author Lars Michelsen <[email protected]> + * @author Roman Kyrylych <[email protected]> + */ +function parseOverviewGeomap() { + eventlog("worker", "debug", "parseOverviewGeomap: Start setting geomap"); + + // Render the maps when enabled + if(oPageProperties.showgeomap == 1) { + var oTable = document.getElementById('overviewGeomap'); + var oTr = document.createElement('tr'); + + var oTd = document.createElement('td'); + oTd.setAttribute('id', 'geomap-icon'); + oTd.setAttribute('class', 'geomap'); + oTd.setAttribute('className', 'geomap'); + oTd.style.width = '200px'; + + // Only show map thumb when configured + if(oPageProperties.showmapthumbs == 1) { + oTd.style.height = '200px'; + } + + oTr.appendChild(oTd); + + // Link + var oLink = document.createElement('a'); + oLink.href = oGeneralProperties['path_htmlbase']+'/netmap/shell.html'; + + // Status image + var oImg = document.createElement('img'); + oImg.align="right"; + oImg.src=oGeneralProperties['path_htmlimages']+'/iconsets/std_small_unknown.png'; + oImg.alt = 'geomap'; + + oLink.appendChild(oImg); + oImg = null; + + // Title + var h2 = document.createElement('h2'); + h2.appendChild(document.createTextNode('Geomap')); + oLink.appendChild(h2); + h2 = null; + + var br = document.createElement('br'); + oLink.appendChild(br); + br = null; + + // Only show map thumb when configured + if(oPageProperties.showmapthumbs == 1) { + oImg = document.createElement('img'); + oImg.style.width = '200px'; + oImg.style.height = '150px'; + oImg.src=oGeneralProperties['path_htmlimages']+'/maps/geomap-thumb.png'; + oLink.appendChild(oImg); + oImg = null; + } + + oTd.appendChild(oLink); + oLink = null; + + oTd = null; + + for(var a = 0; a < (oPageProperties.cellsperrow - 1); a++) { + var oTd = document.createElement('td'); + oTr.appendChild(oTd); + oTd = null; + } + + // Append last row + oTable.appendChild(oTr); + oTr = null; + + oTable = null; + } + + eventlog("worker", "debug", "parseOverviewGeomap: End setting geomap"); +} + +/** * parseOverviewRotations() * * Does initial parsing of rotations on the overview page @@ -1252,6 +1363,9 @@ function runWorker(iCount, sType, sIdentifier) { eventlog("worker", "debug", "Parsing automaps"); parseOverviewAutomaps(aInitialAutomaps); + eventlog("worker", "debug", "Parsing geomap"); + parseOverviewGeomap(); + eventlog("worker", "debug", "Parsing rotations"); parseOverviewRotations(aInitialRotations); ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
