summaryrefslogtreecommitdiff
path: root/swat.obsolete/apps/samba/utils/admin_console.html
diff options
context:
space:
mode:
Diffstat (limited to 'swat.obsolete/apps/samba/utils/admin_console.html')
-rw-r--r--swat.obsolete/apps/samba/utils/admin_console.html258
1 files changed, 258 insertions, 0 deletions
diff --git a/swat.obsolete/apps/samba/utils/admin_console.html b/swat.obsolete/apps/samba/utils/admin_console.html
new file mode 100644
index 0000000000..c314c8fc5b
--- /dev/null
+++ b/swat.obsolete/apps/samba/utils/admin_console.html
@@ -0,0 +1,258 @@
+<HTML>
+
+<HEAD>
+ <META http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <TITLE>Samba Admin Console</TITLE>
+
+ <LINK type="text/css" rel="stylesheet" href="../../resource/css/layout-samba.css"/>
+ <!--[if IE]>
+ <LINK
+ type="text/css" rel="stylesheet" href="../../resource/css/layout-samba.css"/>
+ <![endif]-->
+ <SCRIPT type="text/javascript" src="../../script/qx.js"></SCRIPT>
+
+ <!--> Include plug-in applications <!-->
+ <SCRIPT type="text/javascript" src="../../plug-ins/echo.js"></SCRIPT>
+ <SCRIPT type="text/javascript" src="../../plug-ins/nbt_stats.js"></SCRIPT>
+</HEAD>
+
+<BODY>
+ <SCRIPT type="text/javascript" src="../../script/layout-samba.js"></SCRIPT>
+ <DIV style="position: absolute; background-color: transparent; right:0; top:0; z-index: 1000000001;">
+ <IMG src="../../../images/logo.png">
+ </DIV>
+
+ <DIV id="demoHead">
+ Samba Administrative Console
+ </DIV>
+ <SCRIPT type="text/javascript">
+
+// All global variables will be members of this object.
+globals = new Object();
+
+//paneWidget is the split-pane.
+globals.paneWidget = qx.ui.splitpane.SplitPane;
+
+//appTree is paneWidget's left pane.
+globals.appTree = new Object();
+
+//appInstance is paneWidget's right pane.
+globals.appInstance = new qx.ui.layout.CanvasLayout();
+
+function createApplicationTree() {
+ var app_treeRowStructure =
+ qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(
+ "Plug-in Apps",
+ "icon/16/desktop.png",
+ "icon/16/dictionary.png");
+ var app_tree = new
+ qx.ui.treefullcontrol.Tree(app_treeRowStructure);
+
+ with (app_tree) {
+ setBackgroundColor(255);
+ setBorder(qx.renderer.border.BorderPresets.getInstance().inset);
+ setOverflow("scrollY");
+ setWidth("100%");
+ setHeight("100%");
+ };
+
+ app_tree.getManager().addEventListener("changeSelection", function(e) {
+ sel = new Object();
+ sel = app_tree.getSelectedElement();
+ var appName = sel.getUserData("PlugIn Name");
+ this.debug("changeSelection: " + appName);
+ var obj = sel.getUserData("PlugIn Object");
+
+ obj.display(globals.appInstance);
+
+ });
+
+ return app_tree;
+}
+
+function addButtonClickHandler(addMenu, el, e) {
+ if (addMenu.isSeeable()) {
+ addMenu.hide();
+ } else {
+ addMenu.setLeft(qx.dom.DomLocation.getPageBoxLeft(el));
+ addMenu.setTop(qx.dom.DomLocation.getPageBoxBottom(el));
+ addMenu.show();
+ };
+}
+
+function removeButtonExecuteHandler() {
+ // Get list of installed plug-in applications.
+ // Display list as a menu
+}
+
+function aboutButtonExecuteHandler(aboutWindow) {
+ aboutWindow.open();
+}
+
+function addMenuButtonExecuteHandler(plugInName, plugIn) {
+ treeRowStructure =
+ qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard(plugInName);
+ var treeElement =
+ new qx.ui.treefullcontrol.TreeFolder(treeRowStructure);
+
+ treeElement.setUserData("PlugIn Name", plugInName);
+ treeElement.setUserData("PlugIn Object", plugIn);
+
+ globals.appTree.add(treeElement);
+
+ // Select the most recently added plugin in the tree-menu.
+ globals.appTree.setSelectedElement(globals.appTree.getLastTreeChild());
+
+ plugIn.display(globals.appInstance);
+}
+
+function createConsoleButtons(mainWindow) {
+ // Get list of available plug-in applications.
+ // Display list of applications as a menu.
+ var addMenu = new qx.ui.menu.Menu();
+ var descriptionMenuButton =
+ new qx.ui.menu.MenuButton("Select a plug-in.");
+ var menuSeparator = new qx.ui.menu.MenuSeparator();
+ var echoMenuButton = new qx.ui.menu.MenuButton("Echo");
+
+ with (echoMenuButton) {
+ addEventListener("execute", function(e) {
+ this.debug("executed: " + this.getLabel());
+ var plugIn = new EchoPlugIn();
+ addMenuButtonExecuteHandler("Echo Test", plugIn);
+ });
+ };
+
+ var NBTStatsMenuButton =
+ new qx.ui.menu.MenuButton("NBT Packet Statistics");
+
+ with (NBTStatsMenuButton) {
+ addEventListener("execute", function(e) {
+ this.debug("executed: " + this.getLabel());
+ var plugIn = new NBTStatsPlugIn();
+ addMenuButtonExecuteHandler("NBT Packet Statistics", plugIn);
+ });
+ };
+
+ addMenu.add(descriptionMenuButton);
+ addMenu.add(menuSeparator);
+ addMenu.add(echoMenuButton);
+ addMenu.add(NBTStatsMenuButton);
+
+ mainWindow.add(addMenu);
+
+ var addButton = new qx.ui.form.Button("Add Plug-in");
+
+ with (addButton) {
+ setTop(0);
+ setLeft(0);
+
+ addEventListener("click", function(e) {
+ this.debug("clicked: " + this.getLabel());
+ var el = this.getElement();
+ addButtonClickHandler(addMenu, el);
+ e.setPropagationStopped(true);
+ });
+
+ addEventListener("mousedown", function(e) {
+ this.debug("mousedown: " + this.getLabel());
+ e.setPropagationStopped(true);
+ });
+
+ setEnabled(true);
+ };
+
+ var removeButton = new qx.ui.form.Button("Remove Plug-in");
+ with (removeButton) {
+ setTop(0);
+ setLeft(66);
+
+ addEventListener("execute", function(e) {
+ this.debug("Executed: " + this.getLabel());
+ removeButtonExecuteHandler();
+ });
+
+ setEnabled(true);
+ };
+
+ var aboutWindow = new qx.ui.window.Window("About");
+ aboutWindow.setSpace(100, "auto", 100, "auto");
+ aboutWindow.setModal(false);
+ aboutWindow.setShowMinimize(false);
+ aboutWindow.setShowMaximize(false);
+
+ var aboutText = new qx.ui.basic.Label("Blah.");
+ aboutWindow.add(aboutText);
+
+ mainWindow.add(aboutWindow);
+
+ var aboutButton = new qx.ui.form.Button("About");
+
+ with (aboutButton) {
+ setTop(0);
+ setLeft(154);
+ addEventListener("execute", function(e) {
+ this.debug("Executed: " + this.getLabel());
+ aboutButtonExecuteHandler(aboutWindow);
+ });
+ setEnabled(true);
+ };
+
+ mainWindow.add(addButton);
+ mainWindow.add(removeButton);
+ mainWindow.add(aboutButton);
+}
+
+qx.core.Init.getInstance().defineMain(
+ function() {
+ // Enable JSON-RPC debugging.
+ qx.Settings.setCustomOfClass("qx.io.Json", "enableDebug", true);
+
+ var consoleFrame = new qx.ui.layout.CanvasLayout;
+ consoleFrame.setLocation(0,60);
+ consoleFrame.setBottom(120);
+ consoleFrame.setRight(280);
+ consoleFrame.setPadding(20);
+
+ consoleFrame.addToDocument();
+
+ var mainWindow = new qx.ui.window.Window("Console");
+ mainWindow.setSpace(0, 700, 0, 400);
+ mainWindow.allowMinimize = false;
+ mainWindow.showMinimize = false;
+
+ // The default window move method is slow.
+ mainWindow.setMoveMethod("frame");
+
+ consoleFrame.add(mainWindow);
+
+ // We need buttons to add and remove plug-ins.
+ createConsoleButtons(mainWindow);
+
+ // Make a splitpane.
+ globals.paneWidget = new qx.ui.splitpane.HorizontalSplitPane("1*","2*");
+ globals.paneWidget.setEdge(28,0);
+ globals.paneWidget.setLiveResize(true);
+
+ mainWindow.add(globals.paneWidget);
+
+ // plug-in application tree is on the left.
+ globals.appTree = createApplicationTree();
+
+ globals.paneWidget.addLeft(globals.appTree);
+
+ // What is drawn in the right pane is up to the plug-in.
+ // It is a blank canvas for now.
+ globals.appInstance.setTop(0);
+ globals.appInstance.setLeft(0);
+ globals.appInstance.setBottom(50);
+ globals.appInstance.setRight(20);
+
+ globals.paneWidget.addRight(globals.appInstance);
+
+ mainWindow.open();
+ }
+);
+ </SCRIPT>
+</BODY>
+</HTML>