# # # patch "www/admin-source_control.js" # from [7bec49a7c82945b057152f741a0cfd7a0fe1c8db] # to [9305375733e72c063e111aa95f360e97415bb135] # # patch "www/admin-source_control.php" # from [700d93d02ecec10bccee13823d193fcddd1b6ed3] # to [35af3e3fedbd74da5b196194442aa9bd75860f3d] # # patch "www/admin-source_control_backend.php" # from [3013cfe52768a17fb2490ae68acb744c88a6ddfb] # to [7b8dd85a0964b66aaf36c39344f6b0593d2a6740] # ============================================================ --- www/admin-source_control.js 7bec49a7c82945b057152f741a0cfd7a0fe1c8db +++ www/admin-source_control.js 9305375733e72c063e111aa95f360e97415bb135 @@ -6,7 +6,7 @@ chwperm = function () { args.newperm = getElement("newperm").value; args.action = "chwriters"; call_server(ctrl, args, "chwperm", function(data){clearstatus();}); -} +}; sendkey = function() { setstatus("Uploading key..."); @@ -17,7 +17,7 @@ sendkey = function() { getElement("keydata").value = ""; setstatus("Key uploaded."); }); -} +}; resetdb = function() { setstatus("Resetting database..."); @@ -28,7 +28,7 @@ resetdb = function() { getElement("oath").value = ""; setstatus(data.ok); }); -} +}; chstate = function() { setstatus("Changing server state..."); @@ -39,12 +39,12 @@ chstate = function() { args.action = "enable"; } call_server(ctrl, args, "chstate", function(data){ - set_state_display(data.status); + set_state_display(data.status, data.connections); clearstatus(); }); -} +}; -set_state_display = function(state){ +set_state_display = function(state, connections){ if (state == "") { replaceChildNodes("serverstate", "(server not found)"); } else { @@ -56,17 +56,19 @@ set_state_display = function(state){ } else { getElement("chstate").value = "Enable server"; } -} + var contents = connections.replace(/\([^()]*\)/g, "").replace(/ /g, "\r\n"); + replaceChildNodes("connlist", PRE(contents)); +}; restate = function() { setstatus("Refreshing server state..."); var args = {'project':project}; args.action = "refresh_state"; call_server(ctrl, args, "restate", function(data){ - set_state_display(data.status); + set_state_display(data.status, data.connections); clearstatus(); }); -} +}; addLoadEvent(function() { setstatus("Loading..."); @@ -76,7 +78,7 @@ addLoadEvent(function() { if (data.wperm) { getElement("newperm").value = data.wperm; } - set_state_display(data.status); + set_state_display(data.status, data.connections); clearstatus(); }); }); ============================================================ --- www/admin-source_control.php 700d93d02ecec10bccee13823d193fcddd1b6ed3 +++ www/admin-source_control.php 35af3e3fedbd74da5b196194442aa9bd75860f3d @@ -41,6 +41,10 @@ Current server status is "server state"
+
+Current connections are:
+
+

This is to reset your database, for example if you had to do a rebuild. For this to work, you must type "I solemnly swear that I have a backup." in the box below.
Note that Bad Things may happen if your server is running while you do this. ("Current server status" above should be SLEEPING or STOPPED or SHUTDOWN)
============================================================ --- www/admin-source_control_backend.php 3013cfe52768a17fb2490ae68acb744c88a6ddfb +++ www/admin-source_control_backend.php 7b8dd85a0964b66aaf36c39344f6b0593d2a6740 @@ -23,10 +23,12 @@ if ($action == "getsrv") { if ($action == "getsrv") { print $json->encode(array( "status" => usherctrl("STATUS " . $project), + "connections" => usherctrl("LISTCONNECTIONS " . $project), "wperm" => file_get_contents($projdir . "/write-permissions"), )); } else if ($action === "refresh_state") { - print $json->encode(array("status" => usherctrl("STATUS " . $project))); + print $json->encode(array("status" => usherctrl("STATUS " . $project), + "connections" => usherctrl("LISTCONNECTIONS " . $project))); } else if ($action === "disable" || $action === "enable") { if(allowed('server')) { if ($action === "disable") @@ -34,7 +36,8 @@ if ($action == "getsrv") { else $what = "START"; usherctrl("$what $project"); - print $json->encode(array("status" => usherctrl("STATUS " . $project))); + print $json->encode(array("status" => usherctrl("STATUS " . $project), + "connections" => usherctrl("LISTCONNECTIONS " . $project))); } } else if ($action === "resetdb") { if(allowed('server')) {