[icinga-checkins] icinga.org: icinga-web/mhein/default: * Commands for tackle view [WIP] ( ref #1941)

git at icinga.org git at icinga.org
Thu Nov 10 17:54:59 CET 2011


Module: icinga-web
Branch: mhein/default
Commit: ea41437ea77eb27b8f079c18deb039bde0ddc345
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=ea41437ea77eb27b8f079c18deb039bde0ddc345

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Nov 10 17:36:56 2011 +0100

* Commands for tackle view [WIP] (ref #1941)

---

 app/modules/Cronks/config/javascript.xml           |    1 +
 .../Cronks/lib/js/Cronks/Tackle/Command/Panel.js   |   17 ++++++++++-----
 .../Cronks/lib/js/Cronks/Tackle/Command/View.js    |    9 ++++++-
 pub/styles/icinga.css                              |   21 ++++++++++++++++++++
 4 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/app/modules/Cronks/config/javascript.xml b/app/modules/Cronks/config/javascript.xml
index ae07962..fc0c995 100644
--- a/app/modules/Cronks/config/javascript.xml
+++ b/app/modules/Cronks/config/javascript.xml
@@ -68,6 +68,7 @@
             <ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/Information/Perfdata.js</ae:parameter>
             <ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/Command/Panel.js</ae:parameter>
             <ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/Command/View.js</ae:parameter>
+            <ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/Command/Form.js</ae:parameter>
             
 			<ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/Cronk.js</ae:parameter>
             <ae:parameter>%core.module_dir%/Cronks/lib/js/Cronks/Tackle/ObjectGrid.js</ae:parameter>
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Command/Panel.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Command/Panel.js
index b49906f..289ca80 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Command/Panel.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Command/Panel.js
@@ -49,14 +49,19 @@ Icinga.Cronks.Tackle.Command.Panel = Ext.extend(Ext.Panel, {
 			flex : 1
 		});
 		
-		var dummyPanel2 = new Ext.Panel({
-            title : 'DUMMY',
-            html : 'I am a stupid dummy panel',
-            flex : 1
-        });
+		this.commandDataView.on('click', this.onCommandClick, this);
 		
-		this.add(this.commandDataView, dummyPanel2);
+		this.commandForm = new Icinga.Cronks.Tackle.Command.Form({
+			flex : 1
+		});
+		
+		this.add(this.commandDataView, this.commandForm);
 		
 		this.doLayout();
+	},
+	
+	onCommandClick : function(dataView, index, node, e) {
+		var record = this.store.getAt(index);
+		this.commandForm.rebuildFormForCommand(record.data.definition);
 	}
 });
\ No newline at end of file
diff --git a/app/modules/Cronks/lib/js/Cronks/Tackle/Command/View.js b/app/modules/Cronks/lib/js/Cronks/Tackle/Command/View.js
index d8d2478..15ea0b8 100644
--- a/app/modules/Cronks/lib/js/Cronks/Tackle/Command/View.js
+++ b/app/modules/Cronks/lib/js/Cronks/Tackle/Command/View.js
@@ -4,12 +4,17 @@ Icinga.Cronks.Tackle.Command.View = Ext.extend(Ext.DataView, {
 	
 	tpl : new Ext.XTemplate(
 	    '<tpl for=".">',
-	    '<div>',
-	    '<div>{definition}</div>',
+	    '<div class="tackle-command-view-item">',
+	    '<div class="tackle-command-view-item-inline icon-16 {iconCls}"></div>',
+	    '<div class="tackle-command-view-item-inline">{definition}</div>',
 	    '</div>',
 	    '</tpl>'
 	),
 	
+	itemSelector : 'div.tackle-command-view-item',
+	overClass : 'tackle-command-view-item-over',
+	autoScroll : true,
+	
 	constructor : function(config) {
 		Icinga.Cronks.Tackle.Command.View.superclass.constructor.call(this, config);
 	},
diff --git a/pub/styles/icinga.css b/pub/styles/icinga.css
index 71a1529..dc3a532 100644
--- a/pub/styles/icinga.css
+++ b/pub/styles/icinga.css
@@ -263,6 +263,27 @@ div.cronk-data-view .x-view-selected .thumb{
 	background:transparent;
 }
 
+/* Command dataview (tackle) */
+div.tackle-command-view-item {
+    margin-right: 0;
+    margin: 10px;
+    padding: 5px;
+    border: 1px #c0c0c0 solid;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    -webkit-border-radius: 5px;
+    cursor: pointer;
+}
+
+div.tackle-command-view-item-over {
+    border: 1px #333 solid;
+}
+
+div.tackle-command-view-item-inline {
+    display: inline-block;
+    margin-right: 5px;
+}
+
 /* div.x-portlet div.x-panel-body { */
 #west-frame .x-panel-body-noborder {
 	background: white url(../images/background/bg-frame-left.png) no-repeat bottom right;





More information about the icinga-checkins mailing list