Hi Marius,

thanks again for leading me into the right direction :-)

There is a small patch attached, which solves the problem of long and fuzzy html output coming from check_multi plugin.

It also adds my user defined function to the ColumnRenderer.js. I might have done better, but it works nicely ;-)

Maybe you would like to apply something similar to the official source?

Feedback welcome!

Kind regards, Philipp



Hi.

Because the grid is truncating the output itself I removed the handler
without think about. The handler has also escaped the html.

The commit where the handler was removed:
https://git.icinga.org/?p=icinga-web.git;a=commitdiff;h=b03ad65f1449f65844ada76f7412ad741aa59086

I'll add it again the next days.

Sorry.

Kind regards,
  Marius.


--- app/modules/Cronks/data/xml/grid/icinga-service-template.xml.orig	2011-08-31 10:06:31.357135000 +0200
+++ app/modules/Cronks/data/xml/grid/icinga-service-template.xml	2011-08-31 12:10:57.529485054 +0200
@@ -1078,7 +1078,7 @@
                 <parameter name="jsFunc">
                     <parameter>
                         <parameter name="namespace">Cronk.grid.ColumnRenderer</parameter>
-                        <parameter name="function">selectableColumn</parameter> 
+                        <parameter name="function">customColumnPerfdataSanatized</parameter> 
                     </parameter>
                 </parameter>
             </display>
--- app/modules/Cronks/lib/js/grid/renderer/ColumnRenderer.js.orig	2011-08-30 08:52:51.517271000 +0200
+++ app/modules/Cronks/lib/js/grid/renderer/ColumnRenderer.js	2011-08-31 12:13:20.169016056 +0200
@@ -29,6 +29,30 @@
  * Default column renderes
  */
 Cronk.grid.ColumnRenderer = {
+
+	customColumnPerfdataSanatized: function(cfg) {
+		AppKit.log(cfg);
+		return function(value, metaData, record, rowIndex, colIndex, store) {
+			if(!value)
+				return 'no value';
+
+			if( value.match(/check_multi/) ) {
+				var output = '';
+				var expression = /(check_multi.*?)<br \/>/;
+				expression.exec(value);
+
+				output += RegExp.$1;
+
+				metaData.attr = 'ext:qtip="' + output + '"';
+
+				return output;
+			}
+
+			metaData.attr = 'ext:qtip="' + value + '"';
+			return value;
+		}
+	},
+
 	
 	bogusGroupRenderer : function(cfg) {
 		return function(value, garbage, record, rowIndex, colIndex, store) {
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to