summaryrefslogtreecommitdiffstats
path: root/qooxdoo/source/class/Smokeping/Application.js
blob: 29bb685b1e817ebf06724efa8f825e1cc5c575ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/* ************************************************************************

#module(Smokeping)
#resource(Smokeping.image:image)
#embed(Smokeping.image/*)

************************************************************************ */

qx.Class.define(
    'Smokeping.Application', {
    extend: qx.application.Gui,
       
    members: 
    {           
        main: function()
        {
            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/');
            
			var base_url = rpc.getBaseUrl();

            var prime = new qx.ui.layout.VerticalBoxLayout();
            with(prime){
                setPadding(8);
                setLocation(0,0);
                setWidth('100%');
                setHeight('100%');
                setSpacing(10);
            };            
            prime.addToDocument();
			var title = new qx.ui.basic.Atom(this.tr('Smokeping Viewer'));
			with(title){
            	setTextColor('#b0b0b0');
            	setFont(qx.ui.core.Font.fromString('16px bold sans-serif'));
			}
			prime.add(title);

		    var splitpane = new qx.ui.splitpane.HorizontalSplitPane('1*', '3*');
		    splitpane.setEdge(0);
			splitpane.setHeight('1*');
		    splitpane.setShowKnob(true);
  		    prime.add(splitpane);

 		    var tree = new Smokeping.ui.TargetTree(rpc);
	        splitpane.addLeft(tree);

			var graphs = new Smokeping.ui.Graphs(rpc.getBaseUrl());
			splitpane.addRight(graphs);

        },
        
        close : function(e)
        {
            this.base(arguments);
            // return "Smokeping Web UI: "
            //      + "Do you really want to close the application?";
        },
        
			
		terminate : function(e) {
			this.base(arguments);
		}

        /********************************************************************
         * Functional Block Methods
         ********************************************************************/

    },
		



    /*
    *****************************************************************************
    SETTINGS
    *****************************************************************************
    */

    settings : {
			'Smokeping.resourceUri' : './resource'
	}
	}
);