[icinga-checkins] icinga.org: icinga-web/master: * StatusInfo layout fixes (ref #1941)

git at icinga.org git at icinga.org
Wed Nov 9 16:37:21 CET 2011


Module: icinga-web
Branch: master
Commit: 76e8dc009b01e635ce4fe66064a8992917d695d9
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=76e8dc009b01e635ce4fe66064a8992917d695d9

Author: Marius Hein <marius.hein at netways.de>
Date:   Wed Nov  9 16:36:24 2011 +0100

* StatusInfo layout fixes (ref #1941)
* Typo (ref #1941)

---

 .../lib/js/Cronks/Tackle/Information/Head.js       |   24 ++++++---------
 .../lib/js/Cronks/Tackle/Information/Perfdata.js   |    2 +-
 .../js/Cronks/Tackle/Information/PluginOutput.js   |    2 +-
 .../lib/js/Cronks/Tackle/Information/State.js      |   30 +++++++++++++++++++-
 .../Cronks/lib/js/Cronks/Tackle/Translation.js     |    2 +-
 5 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Head.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Head.js
index bfadb5e..662bad9 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Head.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Head.js
@@ -15,7 +15,6 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
             align: 'stretch',
             pack: 'start'
         },
-        style: 'height: 100%;',
         fields: [],
         title: _('Default'),
         iconCls: 'icinga-icon-information',
@@ -67,27 +66,22 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
             // this.loadDataForObjectId(3);
 
             this.stateInfo = new Icinga.Cronks.Tackle.Information.State({
-                width: 400,
-                type: this.type
+                type: this.type,
+                flex: 1,
+                layout : 'fit'
             });
 
             this.pluginOutputInfo = new Icinga.Cronks.Tackle.Information.PluginOutput({
-                width: 400,
-                height: 100,
+                // height : 40,
                 type: this.type,
+                flex: 1,
                 layout: 'fit'
             });
 
             this.pluginPerfdataInfo = new Icinga.Cronks.Tackle.Information.Perfdata({
-                width: 400,
-                height: 100,
+                // height: 40,
                 type: this.type,
-                layout: 'fit'
-            });
-
-            var dummyPanel = new Ext.Panel({
-                title: 'TEST PANEL',
-                html: 'Stupid test panel without meaning!',
+                flex: 1,
                 layout: 'fit'
             });
 
@@ -96,11 +90,13 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
                 xtype: 'panel',
                 border: false,
                 layout: 'vbox',
+                flex: 1,
                 
                 layoutConfig: {
-                    align: 'stretchmax',
+                    align: 'stretch',
                     pack: 'start'
                 },
+                
                 items: [this.pluginOutputInfo, this.pluginPerfdataInfo]
             });
 
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Perfdata.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Perfdata.js
index ec507d7..86e4d3f 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Perfdata.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/Perfdata.js
@@ -6,7 +6,7 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
 
     Icinga.Cronks.Tackle.Information.Perfdata = Ext.extend(Ext.Panel, {
         title: _("Perfdata"),
-        tpl: new Ext.XTemplate('<tpl for=".">', '<div>', '{object_perfdata}', '</div>', '</tpl>')
+        tpl: new Ext.XTemplate('<tpl for=".">', '<div style="margin: 5px;">', '{object_perfdata}', '</div>', '</tpl>')
     });
 
 })();
\ No newline at end of file
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/PluginOutput.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/PluginOutput.js
index 611f089..af6a40a 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/PluginOutput.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/PluginOutput.js
@@ -6,7 +6,7 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
 
     Icinga.Cronks.Tackle.Information.PluginOutput = Ext.extend(Ext.Panel, {
         title: _("Plugin output"),
-        tpl: new Ext.XTemplate('<tpl for=".">', '<div>', '{object_output}', '</div>', '</tpl>')
+        tpl: new Ext.XTemplate('<tpl for=".">', '<div style="margin: 5px;">', '{object_output}', '</div>', '</tpl>')
     });
 
 })();
\ No newline at end of file
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/State.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/State.js
index 377ce4a..521cf68 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Information/State.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Information/State.js
@@ -6,7 +6,8 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
 
     Icinga.Cronks.Tackle.Information.State = Ext.extend(Ext.grid.PropertyGrid, {
         title: _('State information'),
-
+        clicksToEdit: 3,
+        
         constructor: function (config) {
             Icinga.Cronks.Tackle.Information.State.superclass.constructor.call(this, config);
         },
@@ -17,6 +18,10 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
 
         setSource: function (source) {
             source = this.translateNames(source);
+            
+            this.customEditors = this.createSimpleEditors(source);
+            this.rewriteValues(source);
+            
             Icinga.Cronks.Tackle.Information.State.superclass.setSource.call(this, source);
         },
 
@@ -26,6 +31,29 @@ Ext.ns('Icinga.Cronks.Tackle.Information');
                 newSource[Icinga.Cronks.Tackle.Translation.get(key)] = val;
             }, this);
             return newSource;
+        },
+        
+        createSimpleEditors : function(source) {
+        	var field = new Ext.grid.GridEditor(new Ext.form.TextField({
+        		selectOnFocus:false,
+        		readOnly : true
+            }));
+            
+            var editors = {};
+            
+            Ext.iterate(source, function(key, val) {
+            	editors[key] = field;
+            }, this);
+            
+            return editors;
+        },
+        
+        rewriteValues : function(source) {
+        	Ext.iterate(source, function(key, val) {
+        		if (!val) {
+        			source[key] = '(null)';
+        		}
+        	}, this);
         }
     });
 
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Translation.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Translation.js
index ad27917..667c226 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Translation.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Translation.js
@@ -16,7 +16,7 @@ Ext.ns('Icinga.Cronks.Tackle');
             object_current_check_attempt: _("Check attempt"),
             object_current_state: _("State"),
             object_display_name: _("Display name"),
-            object_event_handler_enabled: _("Eventhandler enbaled"),
+            object_event_handler_enabled: _("Eventhandler enabled"),
             object_execution_time: _("Execution time"),
             object_execution_time_avg: _("Execution time (avg)"),
             object_execution_time_max: _("Execution time (max)"),





More information about the icinga-checkins mailing list