diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-19 09:34:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:29:42 -0500 |
commit | 342d11e3544ec4836cf718f23ea65bee3592fc08 (patch) | |
tree | e014a00594b7ca5dbf14e67684f210eb36068884 | |
parent | 82f1a9474d85f75291d0af0e51d55fa904d42055 (diff) | |
download | samba-342d11e3544ec4836cf718f23ea65bee3592fc08.tar.gz samba-342d11e3544ec4836cf718f23ea65bee3592fc08.tar.xz samba-342d11e3544ec4836cf718f23ea65bee3592fc08.zip |
r8591: - added a simple 2 level menu structure to swat. Deryck, I know this
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)
-rw-r--r-- | swat/cldap_server/index.esp | 13 | ||||
-rw-r--r-- | swat/esptest/exception.esp | 2 | ||||
-rw-r--r-- | swat/esptest/formtest.esp | 2 | ||||
-rw-r--r-- | swat/esptest/include.esp | 2 | ||||
-rw-r--r-- | swat/esptest/index.esp | 7 | ||||
-rw-r--r-- | swat/esptest/ldb.esp | 2 | ||||
-rw-r--r-- | swat/esptest/loadparm.esp | 2 | ||||
-rw-r--r-- | swat/esptest/newuser.esp | 2 | ||||
-rw-r--r-- | swat/esptest/provision.esp | 2 | ||||
-rw-r--r-- | swat/esptest/samr.esp | 2 | ||||
-rw-r--r-- | swat/esptest/session.esp | 2 | ||||
-rw-r--r-- | swat/esptest/showvars.esp | 2 | ||||
-rw-r--r-- | swat/index.esp | 23 | ||||
-rw-r--r-- | swat/ldap_server/index.esp | 13 | ||||
-rw-r--r-- | swat/login.esp | 2 | ||||
-rw-r--r-- | swat/logout.esp | 2 | ||||
-rw-r--r-- | swat/menu.js | 8 | ||||
-rw-r--r-- | swat/nbt_server/index.esp | 24 | ||||
-rw-r--r-- | swat/nbt_server/menu.js | 4 | ||||
-rw-r--r-- | swat/scripting/common.js | 3 | ||||
-rw-r--r-- | swat/scripting/header_columns.esp | 5 | ||||
-rw-r--r-- | swat/smb_server/index.esp | 13 |
22 files changed, 120 insertions, 17 deletions
diff --git a/swat/cldap_server/index.esp b/swat/cldap_server/index.esp new file mode 100644 index 00000000000..253effd55a8 --- /dev/null +++ b/swat/cldap_server/index.esp @@ -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(); %> diff --git a/swat/esptest/exception.esp b/swat/esptest/exception.esp index df62e9a3263..dcc0fda0930 100644 --- a/swat/esptest/exception.esp +++ b/swat/esptest/exception.esp @@ -1,4 +1,4 @@ -<% page_header("columns", "ESP Exception test"); %> +<% page_header("columns", "ESP Exception test", "/esptest/menu.js"); %> <h1>Samba4 exception test</h1> diff --git a/swat/esptest/formtest.esp b/swat/esptest/formtest.esp index 2d7c33e518f..5cb4f003272 100644 --- a/swat/esptest/formtest.esp +++ b/swat/esptest/formtest.esp @@ -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); diff --git a/swat/esptest/include.esp b/swat/esptest/include.esp index 96afead1f95..fc53a9b1f48 100644 --- a/swat/esptest/include.esp +++ b/swat/esptest/include.esp @@ -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 index 00000000000..fbbed9b3c46 --- /dev/null +++ b/swat/esptest/index.esp @@ -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(); %> diff --git a/swat/esptest/ldb.esp b/swat/esptest/ldb.esp index 18427dfecde..b0a2db8dadf 100644 --- a/swat/esptest/ldb.esp +++ b/swat/esptest/ldb.esp @@ -1,4 +1,4 @@ -<% page_header("columns", "ESP ldb test"); %> +<% page_header("columns", "ESP ldb test", "/esptest/menu.js"); %> <h1>Samba4 ldb test</h1> diff --git a/swat/esptest/loadparm.esp b/swat/esptest/loadparm.esp index 738208b745d..9e6de480e23 100644 --- a/swat/esptest/loadparm.esp +++ b/swat/esptest/loadparm.esp @@ -1,4 +1,4 @@ -<% page_header("columns", "ESP loadparm test"); %> +<% page_header("columns", "ESP loadparm test", "/esptest/menu.js" ); %> <h1>Samba4 loadparm test</h1> diff --git a/swat/esptest/newuser.esp b/swat/esptest/newuser.esp index 2e4341fbee6..4c54a969e7d 100644 --- a/swat/esptest/newuser.esp +++ b/swat/esptest/newuser.esp @@ -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"); diff --git a/swat/esptest/provision.esp b/swat/esptest/provision.esp index b2f5fbf6188..edb65469dfd 100644 --- a/swat/esptest/provision.esp +++ b/swat/esptest/provision.esp @@ -1,4 +1,4 @@ -<% page_header("columns", "Server provisioning"); +<% page_header("columns", "Server provisioning", "/esptest/menu.js"); libinclude("base.js"); libinclude("provision.js"); diff --git a/swat/esptest/samr.esp b/swat/esptest/samr.esp index b0a6a9de6ec..53e20a23ab9 100644 --- a/swat/esptest/samr.esp +++ b/swat/esptest/samr.esp @@ -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"); diff --git a/swat/esptest/session.esp b/swat/esptest/session.esp index 4fb4ee7bb4d..01352212668 100644 --- a/swat/esptest/session.esp +++ b/swat/esptest/session.esp @@ -1,4 +1,4 @@ -<% page_header("columns", "ESP session test"); %> +<% page_header("columns", "ESP session test", "/esptest/menu.js"); %> <h1>Samba4 session test</h1> diff --git a/swat/esptest/showvars.esp b/swat/esptest/showvars.esp index 38904edcc52..6763f2b6dde 100644 --- a/swat/esptest/showvars.esp +++ b/swat/esptest/showvars.esp @@ -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> diff --git a/swat/index.esp b/swat/index.esp index 325deeddaee..0abfcc46d99 100644 --- a/swat/index.esp +++ b/swat/index.esp @@ -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 index 00000000000..57f259c3b6e --- /dev/null +++ b/swat/ldap_server/index.esp @@ -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(); %> diff --git a/swat/login.esp b/swat/login.esp index 10a0ba80d64..12182ea1060 100644 --- a/swat/login.esp +++ b/swat/login.esp @@ -1,4 +1,4 @@ -<% page_header("plain", "SWAT Login"); %> +<% page_header("plain", "SWAT Login", ""); %> <% diff --git a/swat/logout.esp b/swat/logout.esp index b725d63a64f..d0d971d9627 100644 --- a/swat/logout.esp +++ b/swat/logout.esp @@ -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 index 00000000000..78d61b34d27 --- /dev/null +++ b/swat/menu.js @@ -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 index 00000000000..133615c52cd --- /dev/null +++ b/swat/nbt_server/index.esp @@ -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 index 00000000000..fd445bf861b --- /dev/null +++ b/swat/nbt_server/menu.js @@ -0,0 +1,4 @@ +/* show a menu for the esp test pages */ +simple_menu( + "NBT Server", + "Statistics", session_uri("/nbt_server/index.esp")); diff --git a/swat/scripting/common.js b/swat/scripting/common.js index c431c8c1b07..baebe8af823 100644 --- a/swat/scripting/common.js +++ b/swat/scripting/common.js @@ -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"); } diff --git a/swat/scripting/header_columns.esp b/swat/scripting/header_columns.esp index 63b527d842a..c7e58df90bb 100644 --- a/swat/scripting/header_columns.esp +++ b/swat/scripting/header_columns.esp @@ -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 index 00000000000..8ca34e3dc3f --- /dev/null +++ b/swat/smb_server/index.esp @@ -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(); %> |