r8591: - added a simple 2 level menu structure to swat. Deryck, I know this
authorAndrew Tridgell <tridge@samba.org>
Tue, 19 Jul 2005 09:34:11 +0000 (09:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:42 +0000 (13:29 -0500)
  isn't very pretty, and please feel free to do this much more nicely
  :-)

- added a top level menu listing our main servers

- added placeholder pages for the main servers

- added NBT server statistics
(This used to be commit 1aa658b756903e7cb598302eddd18b7734937c83)

22 files changed:
swat/cldap_server/index.esp [new file with mode: 0644]
swat/esptest/exception.esp
swat/esptest/formtest.esp
swat/esptest/include.esp
swat/esptest/index.esp [new file with mode: 0644]
swat/esptest/ldb.esp
swat/esptest/loadparm.esp
swat/esptest/newuser.esp
swat/esptest/provision.esp
swat/esptest/samr.esp
swat/esptest/session.esp
swat/esptest/showvars.esp
swat/index.esp
swat/ldap_server/index.esp [new file with mode: 0644]
swat/login.esp
swat/logout.esp
swat/menu.js [new file with mode: 0644]
swat/nbt_server/index.esp [new file with mode: 0644]
swat/nbt_server/menu.js [new file with mode: 0644]
swat/scripting/common.js
swat/scripting/header_columns.esp
swat/smb_server/index.esp [new file with mode: 0644]

diff --git a/swat/cldap_server/index.esp b/swat/cldap_server/index.esp
new file mode 100644 (file)
index 0000000..253effd
--- /dev/null
@@ -0,0 +1,13 @@
+<% page_header("columns", "CLDAP Server", ""); 
+
+  libinclude("base.js");
+  libinclude("management.js");
+%>
+
+<h1>CLDAP Server</h1>
+
+<%
+writefln("Status: %s\n", server_status("cldap"));
+%>
+
+<% page_footer(); %>
index df62e9a326387d9264569b5fd17aedc40d84f005..dcc0fda093097ec3d05cf727453e042f75cb20e1 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP Exception test"); %>
+<% page_header("columns", "ESP Exception test", "/esptest/menu.js"); %>
 
 <h1>Samba4 exception test</h1>
 
index 2d7c33e518f4322fad7133d75079b5b223b712f2..5cb4f003272d131839ed8f1682e865792600cea1 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP Form Test"); %>
+<% page_header("columns", "ESP Form Test", "/esptest/menu.js"); %>
 
 <%
 var f = FormObj("FormTest", 3, 2);
index 96afead1f95318a2b43bb2229b0d1bd5c3efc808..fc53a9b1f485af5a6b3bfbd9f47fc9336f415750 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP Include Test"); %>
+<% page_header("columns", "ESP Include Test", "/esptest/menu.js"); %>
 
 including /scripting/test.ejs<p/>
 <% include("/scripting/test.ejs"); %>
diff --git a/swat/esptest/index.esp b/swat/esptest/index.esp
new file mode 100644 (file)
index 0000000..fbbed9b
--- /dev/null
@@ -0,0 +1,7 @@
+<% page_header("columns", "ESP Tests", "/esptest/menu.js"); %>
+
+<h1>ESP Test functions</h1>
+
+Please select a menu item from the selection on the left
+
+<% page_footer(); %>
index 18427dfecde01b8dc964abebbbbd87d1107338c7..b0a2db8dadfa3e5c06740ad5ccb7230425a58ce0 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP ldb test"); %>
+<% page_header("columns", "ESP ldb test", "/esptest/menu.js"); %>
 
 <h1>Samba4 ldb test</h1>
 
index 738208b745d93810ee99645e435b60ecf304d105..9e6de480e23815f3d42b470820ef854634fe140e 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP loadparm test"); %>
+<% page_header("columns", "ESP loadparm test", "/esptest/menu.js" ); %>
 
 <h1>Samba4 loadparm test</h1>
 
index 2e4341fbee66e773bb33811e37d8facf3b0a5b1c..4c54a969e7d32aa566763a65f8ea74cf6aa0180a 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "Add a user"); 
+<% page_header("columns", "Add a user", "/esptest/menu.js"); 
 
   libinclude("base.js");
   libinclude("provision.js");
index b2f5fbf618821e112d2a716b9002d8a9892ff9b5..edb65469dfda9da34f989184c840c18bf71fcd0c 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "Server provisioning"); 
+<% page_header("columns", "Server provisioning", "/esptest/menu.js"); 
 
   libinclude("base.js");
   libinclude("provision.js");
index b0a6a9de6ec61cbac25a5bb63cb8abe8d3970366..53e20a23ab9602a16d72370093560abd1077dccd 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP samr test"); 
+<% page_header("columns", "ESP samr test", "/esptest/menu.js"); 
 
   libinclude("base.js");
   libinclude("samr.js");
index 4fb4ee7bb4da02667f2b66379279e43bac376c7d..01352212668e9b0073a1c69c7dea2e27a39a0042 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP session test"); %>
+<% page_header("columns", "ESP session test", "/esptest/menu.js"); %>
 
 <h1>Samba4 session test</h1>
 
index 38904edcc52f5fe7988b5984119ed23e66e68c3b..6763f2b6ddece0fe2b33642ec3b92e20773ff463 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("columns", "ESP standard variables test"); %>
+<% page_header("columns", "ESP standard variables test", "/esptest/menu.js"); %>
 
 <h1>Samba4 showvars test</h1>
 
index 325deeddaeef39139f061026d7e0ead21fb57221..0abfcc46d99354cfb6beab3e1300a511c4cb231c 100644 (file)
@@ -1,7 +1,24 @@
-<% page_header("columns", "Welcome to SWAT"); %>
+<% page_header("columns", "Server Status", "");
+  libinclude("base.js");
+  libinclude("management.js");
+%>
 
-<h1>Welcome to SWAT!</h1>
+<h1>Server Status</h1>
 
-Please select a menu item from the selection on the left
+<%
+var servers = new Array("nbt_server", "smb_server", "ldap_server", "cldap_server", "kdc_server");
+var i;
+var info = new Object();
+
+info["NBT Server"]   = server_status("nbt");
+info["WINS Server"]  = server_status("wins");
+info["CLDAP Server"] = server_status("cldap");
+info["KDC"]          = server_status("kdc");
+info["SMB Server"]   = stream_server_status("smb");
+info["LDAP Server"]  = stream_server_status("ldap");
+info["RPC Server"]   = stream_server_status("rpc");
+
+simple_table(info);
+%>
 
 <% page_footer(); %>
diff --git a/swat/ldap_server/index.esp b/swat/ldap_server/index.esp
new file mode 100644 (file)
index 0000000..57f259c
--- /dev/null
@@ -0,0 +1,13 @@
+<% page_header("columns", "LDAP Server", ""); 
+
+  libinclude("base.js");
+  libinclude("management.js");
+%>
+
+<h1>LDAP Server</h1>
+
+<%
+writefln("Status: %s\n", stream_server_status("ldap"));
+%>
+
+<% page_footer(); %>
index 10a0ba80d641a54fedcaa60c3f399cb624334999..12182ea1060103ed1b8435346d4a8790aafb26cd 100644 (file)
@@ -1,4 +1,4 @@
-<% page_header("plain", "SWAT Login"); %>
+<% page_header("plain", "SWAT Login", ""); %>
 
 <%
 
index b725d63a64f77ce76eab706b3ad7ab84e33352ae..d0d971d9627ee6e2f07c7ce8b86184bae74a260c 100644 (file)
@@ -1,5 +1,5 @@
 <% 
-page_header("plain", "Logging out"); 
+page_header("plain", "Logging out", ""); 
 
 session.AUTHENTICATED = false;
 redirect("/login.esp");
diff --git a/swat/menu.js b/swat/menu.js
new file mode 100644 (file)
index 0000000..78d61b3
--- /dev/null
@@ -0,0 +1,8 @@
+/* show a menu for the esp test pages */
+simple_menu(
+       "Main Menu",
+       "File Server",         session_uri("/smb_server/"),
+       "LDAP Server",         session_uri("/ldap_server/"),
+       "CLDAP Server",         session_uri("/cldap_server/"),
+       "NBT Server",         session_uri("/nbt_server/"),
+       "ESP Tests",          session_uri("/esptest/"));
diff --git a/swat/nbt_server/index.esp b/swat/nbt_server/index.esp
new file mode 100644 (file)
index 0000000..133615c
--- /dev/null
@@ -0,0 +1,24 @@
+<% page_header("columns", "NBT Server", "/nbt_server/menu.js"); 
+
+  libinclude("base.js");
+  libinclude("management.js");
+%>
+
+<h1>NBT Server</h1>
+
+<%
+writefln("The NBT server is: %s\n", server_status("nbt"));
+%>
+
+<h2>Packet statistics</h2>
+<%
+
+var stats = nbtd_statistics();
+if (stats == undefined) {
+       writefln("nbt server not running");
+} else {
+       simple_table(stats);
+}
+%>
+
+<% page_footer(); %>
diff --git a/swat/nbt_server/menu.js b/swat/nbt_server/menu.js
new file mode 100644 (file)
index 0000000..fd445bf
--- /dev/null
@@ -0,0 +1,4 @@
+/* show a menu for the esp test pages */
+simple_menu(
+       "NBT Server",
+       "Statistics",          session_uri("/nbt_server/index.esp"));
index c431c8c1b07d7d600b36894419e07f5a0f45ba75..baebe8af82380b514d0ec2d4f7dde1d35f570170 100644 (file)
@@ -50,9 +50,10 @@ if (headers['HOST'] == undefined) {
 /*
   show the page header. page types include "plain" and "column" 
 */
-function page_header(pagetype, title) {
+function page_header(pagetype, title, menu) {
        global.page.pagetype = pagetype;
        global.page.title = title;
+       global.page.menu = menu;
        include("/scripting/header_" + pagetype + ".esp");
 }
 
index 63b527d842a19a6d12a21aa991329e58cd370f39..c7e58df90bbf4d42b9bf82fa5acb9d9537df4475 100644 (file)
@@ -62,7 +62,10 @@ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/images/logo.png'
 
 <div id="nav">
      <% 
-     include("/esptest/menu.js");
+     include("/menu.js");
+     if (global.page.menu) {
+          include(global.page.menu);
+     }
      %>
 </div>
 
diff --git a/swat/smb_server/index.esp b/swat/smb_server/index.esp
new file mode 100644 (file)
index 0000000..8ca34e3
--- /dev/null
@@ -0,0 +1,13 @@
+<% page_header("columns", "SMB Server", ""); 
+
+  libinclude("base.js");
+  libinclude("management.js");
+%>
+
+<h1>SMB Server</h1>
+
+<%
+writefln("Status: %s\n", stream_server_status("smb"));
+%>
+
+<% page_footer(); %>