diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-15 07:22:21 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-11-15 07:22:21 +0100 |
commit | 77709fd6296cf90f93dd62ad3fc2b7b0303f7884 (patch) | |
tree | 91c5ac99f5af5ec98549d9aa61af139fa2c4e3f0 | |
parent | 1470bd43a79a679132d6523e92e99f81e2892119 (diff) | |
download | smokeping-77709fd6296cf90f93dd62ad3fc2b7b0303f7884.tar.gz smokeping-77709fd6296cf90f93dd62ad3fc2b7b0303f7884.tar.xz |
more woring cooxdoo code
-rw-r--r-- | qooxdoo/source/class/Smokeping/Application.js | 22 | ||||
-rw-r--r-- | qooxdoo/source/class/Smokeping/ui/TargetTree.js | 52 | ||||
-rw-r--r-- | qooxdoo/source/perl/Qooxdoo/Services/Smokeping.pm | 8 | ||||
-rw-r--r-- | qooxdoo/source/script/Smokeping.js | 43 | ||||
-rw-r--r-- | qooxdoo/source/translation/C.po | 4 | ||||
-rw-r--r-- | qooxdoo/source/translation/de.po | 4 | ||||
-rw-r--r-- | qooxdoo/source/translation/en.po | 4 | ||||
-rw-r--r-- | qooxdoo/source/translation/fr.po | 4 | ||||
-rw-r--r-- | qooxdoo/source/translation/messages.pot | 21 |
9 files changed, 77 insertions, 85 deletions
diff --git a/qooxdoo/source/class/Smokeping/Application.js b/qooxdoo/source/class/Smokeping/Application.js index 49a151d..6578393 100644 --- a/qooxdoo/source/class/Smokeping/Application.js +++ b/qooxdoo/source/class/Smokeping/Application.js @@ -17,8 +17,8 @@ qx.Class.define( var self=this; this.base(arguments); - // this will provide access to the server side of this app - var rpc = new Smokeping.io.Rpc('http://localhost/~oetiker/smq'); + // this will provide access to the server side of this app + var rpc = new Smokeping.io.Rpc('http://localhost/~oetiker/smq/'); var base_url = rpc.getBaseUrl(); @@ -39,25 +39,23 @@ qx.Class.define( prime.add(title); var splitpane = new qx.ui.splitpane.HorizontalSplitPane('1*', '3*'); - splitpane.setEdge(1); + splitpane.setEdge(0); splitpane.setHeight('1*'); splitpane.setShowKnob(true); prime.add(splitpane); - var tree = new Smokeping.ui.TargetTree(rpc,this.tr("Root Node")); + var tree = new Smokeping.ui.TargetTree(rpc); splitpane.addLeft(tree); - var graphs = new qx.ui.layout.VerticalBoxLayout(); - with(graphs){ - setBackgroundColor('white'); - setBorder('inset'); - setWidth('100%'); - setHeight('100%'); - }; + tree.getManager().addEventListener("changeSelection", function(e) { + if (e.getData().length > 0) { + this.debug(e.getData()[0].getUserData('id')); + } + },this); + var graphs = new Smokeping.ui.Graphs(rpc.getBaseUrl()); splitpane.addRight(graphs); - }, close : function(e) diff --git a/qooxdoo/source/class/Smokeping/ui/TargetTree.js b/qooxdoo/source/class/Smokeping/ui/TargetTree.js index 6c47398..6d72ad1 100644 --- a/qooxdoo/source/class/Smokeping/ui/TargetTree.js +++ b/qooxdoo/source/class/Smokeping/ui/TargetTree.js @@ -23,27 +23,43 @@ qx.Class.define('Smokeping.ui.TargetTree', * @param rpc {rpcObject} An rpc object providing access to the Smokeping service */ - construct: function (rpc,root_node) { + construct: function (rpc) { with(this){ - base(arguments,root_node); + base(arguments,'root node'); setBackgroundColor('white'); setBorder('inset'); +// setOverflow('scrollY'); setWidth('100%'); setHeight('100%'); setPadding(5); - } + setHideNode(true); + }; - return this; + var self = this; + + var fill_tree = function(data,exc,id){ + if (exc == null){ + var nodes = data.length; + for(var i=0;i<nodes;i++){ + Smokeping.ui.TargetTree.__fill_folder(self,data[i]); + } + } + else { + alert(exc); + } + }; + + rpc.callAsync(fill_tree,'get_tree'); }, /* ***************************************************************************** - MEMBERS + Statics ***************************************************************************** */ - members : + statics : { /* @@ -53,7 +69,7 @@ qx.Class.define('Smokeping.ui.TargetTree', */ /** - * Tell about the BaseUrl we found. + * Create the tree based on input from the Server * * @type member * @@ -62,9 +78,25 @@ qx.Class.define('Smokeping.ui.TargetTree', * @return BaseUrl {Strings} */ -// getBaseUrl: function(){ -// return this.__base_url; -// } + + __fill_folder: function(node,data){ + // in data[0] we have the id of the folder + var folder = new qx.ui.tree.TreeFolder(data[1]); + folder.setUserData('id',data[0]); + node.add(folder); + var length = data.length; + for (var i=2;i<length;i++){ + if(qx.util.Validation.isValidArray(data[i])){ + Smokeping.ui.TargetTree.__fill_folder(folder,data[i]); + } else { + i++; // skip the node id for now + var file = new qx.ui.tree.TreeFile(data[i]); + file.setUserData('id',data[i-1]); + folder.add(file); + } + } + } + } }); diff --git a/qooxdoo/source/perl/Qooxdoo/Services/Smokeping.pm b/qooxdoo/source/perl/Qooxdoo/Services/Smokeping.pm index f40288d..2293dfa 100644 --- a/qooxdoo/source/perl/Qooxdoo/Services/Smokeping.pm +++ b/qooxdoo/source/perl/Qooxdoo/Services/Smokeping.pm @@ -10,11 +10,7 @@ sub method_get_tree my $error = shift; # $error->set_error(101,$err); # return $error; - # b = branche - # i = in - # l = leave - # o = out - return [ ['fk1','Folder 1', + return [['fk1','Folder 1', 'fk1/f1','File 1', 'fk1/f2','File 2', [ 'fk1/sf1','Sub Folder 2', @@ -22,7 +18,7 @@ sub method_get_tree 'fk1/sf1/f4','File 4', ], ], - [ 'fk2','Folder 2'], + [ 'fk24','Folder 2'], [ 'fk3','Folder 3', 'fk3/f3','File 33', 'fk3/f4','File 44' diff --git a/qooxdoo/source/script/Smokeping.js b/qooxdoo/source/script/Smokeping.js index 53670e4..35d0cad 100644 --- a/qooxdoo/source/script/Smokeping.js +++ b/qooxdoo/source/script/Smokeping.js @@ -106,6 +106,26 @@ if(!window.qxvariants)qxvariants={};\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/io/image/PreloaderManager.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/io/image/Preloader.js"></script>\ <script type="text/javascript" src="./class/Smokeping/Application.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/BoxLayout.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/impl/VerticalBoxLayoutImpl.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/util/Validation.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/impl/HorizontalBoxLayoutImpl.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/AbstractTreeElement.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeRowStructure.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/embed/HtmlEmbed.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/basic/Image.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/basic/Label.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/Manager.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/LocalizedString.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/dom/Element.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeFile.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeFolder.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/Tree.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/selection/SelectionManager.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/selection/Selection.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/SelectionManager.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/HorizontalBoxLayout.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/VerticalBoxLayout.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/io/remote/Rpc.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/net/Http.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/util/Mime.js"></script>\ @@ -121,17 +141,7 @@ if(!window.qxvariants)qxvariants={};\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/html/Iframe.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/io/remote/ScriptTransport.js"></script>\ <script type="text/javascript" src="./class/Smokeping/io/Rpc.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/BoxLayout.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/impl/VerticalBoxLayoutImpl.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/util/Validation.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/impl/HorizontalBoxLayoutImpl.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/VerticalBoxLayout.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/basic/Atom.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/basic/Label.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/Manager.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/LocalizedString.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/dom/Element.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/basic/Image.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/splitpane/SplitPane.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/splitpane/SplitPaneSlider.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/splitpane/SplitPaneSplitter.js"></script>\ @@ -141,17 +151,10 @@ if(!window.qxvariants)qxvariants={};\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/bom/element/Dimension.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/bom/Document.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/splitpane/HorizontalSplitPane.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/AbstractTreeElement.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeRowStructure.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/embed/HtmlEmbed.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeFolder.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/Tree.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/selection/SelectionManager.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/selection/Selection.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/SelectionManager.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/tree/TreeFile.js"></script>\ -<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/HorizontalBoxLayout.js"></script>\ <script type="text/javascript" src="./class/Smokeping/ui/TargetTree.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/FlowLayout.js"></script>\ +<script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/ui/layout/impl/FlowLayoutImpl.js"></script>\ +<script type="text/javascript" src="./class/Smokeping/ui/Graphs.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/Locale.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/data/C.js"></script>\ <script type="text/javascript" src="../qooxdoolink/frontend/framework/source/class/qx/locale/data/en.js"></script>\ diff --git a/qooxdoo/source/translation/C.po b/qooxdoo/source/translation/C.po index 6812b97..d28ef4e 100644 --- a/qooxdoo/source/translation/C.po +++ b/qooxdoo/source/translation/C.po @@ -14,7 +14,3 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" - -#: source/class/Smokeping/Application.js:47 -msgid "Root Node" -msgstr "" diff --git a/qooxdoo/source/translation/de.po b/qooxdoo/source/translation/de.po index eb3d833..5dd3fdd 100644 --- a/qooxdoo/source/translation/de.po +++ b/qooxdoo/source/translation/de.po @@ -16,10 +16,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: source/class/Smokeping/Application.js:47 -msgid "Root Node" -msgstr "" - #~ msgid "Start Date" #~ msgstr "Start-Datum" diff --git a/qooxdoo/source/translation/en.po b/qooxdoo/source/translation/en.po index 2c63469..1d4558d 100644 --- a/qooxdoo/source/translation/en.po +++ b/qooxdoo/source/translation/en.po @@ -16,10 +16,6 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: source/class/Smokeping/Application.js:47 -msgid "Root Node" -msgstr "" - #~ msgid "Start Date" #~ msgstr "Start Date" diff --git a/qooxdoo/source/translation/fr.po b/qooxdoo/source/translation/fr.po index 5245d60..b32afd2 100644 --- a/qooxdoo/source/translation/fr.po +++ b/qooxdoo/source/translation/fr.po @@ -15,7 +15,3 @@ msgstr "" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: source/class/Smokeping/Application.js:47 -msgid "Root Node" -msgstr "" diff --git a/qooxdoo/source/translation/messages.pot b/qooxdoo/source/translation/messages.pot index bbd18ac..e69de29 100644 --- a/qooxdoo/source/translation/messages.pot +++ b/qooxdoo/source/translation/messages.pot @@ -1,21 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-11-14 11:33-0600\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL@li.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: source/class/Smokeping/Application.js:47 -msgid "Root Node" -msgstr "" |