1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 1aa658b756)
This commit is contained in:
Andrew Tridgell 2005-07-19 09:34:11 +00:00 committed by Gerald (Jerry) Carter
parent 82f1a9474d
commit 342d11e354
22 changed files with 120 additions and 17 deletions

View File

@ -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(); %>

View 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>

View 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);

View 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"); %>

7
swat/esptest/index.esp Normal file
View File

@ -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(); %>

View 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>

View 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>

View 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");

View File

@ -1,4 +1,4 @@
<% page_header("columns", "Server provisioning");
<% page_header("columns", "Server provisioning", "/esptest/menu.js");
libinclude("base.js");
libinclude("provision.js");

View 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");

View 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>

View 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>

View 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(); %>

View File

@ -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(); %>

View File

@ -1,4 +1,4 @@
<% page_header("plain", "SWAT Login"); %>
<% page_header("plain", "SWAT Login", ""); %>
<%

View File

@ -1,5 +1,5 @@
<%
page_header("plain", "Logging out");
page_header("plain", "Logging out", "");
session.AUTHENTICATED = false;
redirect("/login.esp");

8
swat/menu.js Normal file
View File

@ -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/"));

24
swat/nbt_server/index.esp Normal file
View File

@ -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(); %>

4
swat/nbt_server/menu.js Normal file
View File

@ -0,0 +1,4 @@
/* show a menu for the esp test pages */
simple_menu(
"NBT Server",
"Statistics", session_uri("/nbt_server/index.esp"));

View 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");
}

View 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>

13
swat/smb_server/index.esp Normal file
View File

@ -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(); %>