Author: Lars Michelsen <[email protected]>
Date: Thu Apr 19 08:51:15 2012 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Thu Apr 19 08:51:15 2012 +0200
Line weathermaps colors definition can now be set as float values
(Thanks to Ormi for the patch!)
---
ChangeLog | 2 ++
.../frontend/nagvis-js/js/NagVisStatefulObject.js | 4 ++--
share/server/core/defines/matches.php | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2aaa02e..99b7c58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@ Frontend
* Bugfix: Fixed JS error in template object management dialog
Core
+ * Line weathermaps colors definition can now be set as float values
+ (Thanks to Ormi for the patch!)
* Bugfix: Made shortly introduced recoding of map config files optional
1.6.5
diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 07595f8..2291510 100644
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -624,7 +624,7 @@ var NagVisStatefulObject = NagVisObject.extend({
// 1 contains the color to be used
for(var i = 0; i < ranges.length; i++) {
var parts = ranges[i].split(':');
- if(parseInt(perc) <= parts[0])
+ if(parseFloat(perc) <= parts[0])
return parts[1];
parts = null;
}
@@ -715,7 +715,7 @@ var NagVisStatefulObject = NagVisObject.extend({
return set;
// Calculate percentages with 2 decimals and reset other options
- return Array(set[0], Math.round((set[1]*100/set[6]*100)/100), '%',
set[3], set[4], 0, 100);
+ return Array(set[0], Math.round(set[1]*100/set[6]*100)/100, '%',
set[3], set[4], 0, 100);
},
/**
diff --git a/share/server/core/defines/matches.php
b/share/server/core/defines/matches.php
index 128dcd4..5fc527e 100644
--- a/share/server/core/defines/matches.php
+++ b/share/server/core/defines/matches.php
@@ -95,7 +95,7 @@ define('MATCH_INTEGER_PRESIGN_EMPTY', '/^[\+\-]?[0-9]*$/');
define('MATCH_ORDER', '/^(?:asc|desc)$/');
define('MATCH_TEXTBOX_WIDTH', '/^([0-9]+|auto)$/');
define('MATCH_TEXTBOX_HEIGHT', '/^([0-9]+|auto)$/');
-define('MATCH_WEATHER_COLORS', '/^(?:[0-9]{1,3}:#[0-9a-f]{6},?)+$/');
+define('MATCH_WEATHER_COLORS',
'/^(?:[0-9]{1,3}(\.[0-9]{1,2})?:#[0-9a-f]{6},?)+$/');
define('MATCH_SOCKET',
'/^(unix:[a-zA-Z0-9\-_\.\/]+|tcp:[a-zA-Z0-9\-\.]+:[0-9]{1,5})$/');
define('MATCH_WUI_ADDMODIFY_DO', '/^(add|modify)$/');
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins