From 5d13d53762933c306e595079efd1f69b1807fb1a Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Fri, 16 Nov 2007 20:05:00 +0000 Subject: working version --- qooxdoo/source/class/Smokeping/Application.js | 23 ++------ qooxdoo/source/class/Smokeping/ui/Graphs.js | 75 ++++++++++--------------- qooxdoo/source/class/Smokeping/ui/TargetTree.js | 15 ++++- qooxdoo/source/script/Smokeping.js | 43 +++++++------- 4 files changed, 69 insertions(+), 87 deletions(-) diff --git a/qooxdoo/source/class/Smokeping/Application.js b/qooxdoo/source/class/Smokeping/Application.js index 6578393..29bb685 100644 --- a/qooxdoo/source/class/Smokeping/Application.js +++ b/qooxdoo/source/class/Smokeping/Application.js @@ -17,6 +17,10 @@ qx.Class.define( var self=this; this.base(arguments); + qx.io.Alias.getInstance().add( + 'SP', qx.core.Setting.get('Smokeping.resourceUri') + ); + // this will provide access to the server side of this app var rpc = new Smokeping.io.Rpc('http://localhost/~oetiker/smq/'); @@ -47,12 +51,6 @@ qx.Class.define( var tree = new Smokeping.ui.TargetTree(rpc); splitpane.addLeft(tree); - 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); @@ -68,23 +66,12 @@ qx.Class.define( terminate : function(e) { this.base(arguments); - }, + } /******************************************************************** * Functional Block Methods ********************************************************************/ - /** - * Get the base url of this page - * - * @return {String} the base url of the page - */ - - __getBaseUrl: function() { - var our_href = new String(document.location.href); - var last_slash = our_href.lastIndexOf("/"); - return our_href.substring(0,last_slash+1); - } }, diff --git a/qooxdoo/source/class/Smokeping/ui/Graphs.js b/qooxdoo/source/class/Smokeping/ui/Graphs.js index 9508eee..7a9fb83 100644 --- a/qooxdoo/source/class/Smokeping/ui/Graphs.js +++ b/qooxdoo/source/class/Smokeping/ui/Graphs.js @@ -32,56 +32,39 @@ qx.Class.define('Smokeping.ui.Graphs', setHeight('100%'); setVerticalSpacing(10); setHorizontalSpacing(10); + setPadding(10); }; - for(var i=0;i<2000;i++){ - var button = new qx.ui.basic.Atom(i.toString()); - this.add(button); - } - }, - - /* - ***************************************************************************** - Statics - ***************************************************************************** - */ - - statics : - { - - /* - --------------------------------------------------------------------------- - CORE METHODS - --------------------------------------------------------------------------- - */ - - /** - * Create the tree based on input from the Server - * - * @type member - * - * @param {void} - * - * @return BaseUrl {Strings} - */ + var load_graphs = function(m){ + var files = m.getData() + this.removeAll(); + for(var i=0;i 0) { + if ( e.getData()[0].basename == 'TreeFolder' ){ + qx.event.message.Bus.dispatch('sp.menu.folder',e.getData()[0].getUserData('ids')); + } + } + },this); + rpc.callAsync(fill_tree,'get_tree'); }, @@ -82,8 +90,8 @@ qx.Class.define('Smokeping.ui.TargetTree', __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 files = new Array(); var length = data.length; for (var i=2;i\ \ \ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ \ \ \ @@ -141,7 +121,17 @@ if(!window.qxvariants)qxvariants={};\ \ \ \ +\ +\ +\ +\ +\ \ +\ +\ +\ +\ +\ \ \ \ @@ -151,10 +141,23 @@ if(!window.qxvariants)qxvariants={};\ \ \ \ +\ +\ +\ +\ +\ +\ +\ +\ +\ +\ \ +\ +\ \ \ \ +\ \ \ \ -- cgit v1.2.3-24-g4f1b