[open-ils-commits] r12034 - in branches/staff-client-experiment/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/main xul/staff_client/chrome/content/util xul/staff_client/server/main
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Feb 1 05:15:00 EST 2009
Author: phasefx
Date: 2009-02-01 05:14:56 -0500 (Sun, 01 Feb 2009)
New Revision: 12034
Modified:
branches/staff-client-experiment/Open-ILS/web/opac/locale/en-US/lang.dtd
branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/main/main.js
branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/util/network.js
branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_menus.xul
Log:
ping server function
Modified: branches/staff-client-experiment/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/staff-client-experiment/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-02-01 07:52:31 UTC (rev 12033)
+++ branches/staff-client-experiment/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-02-01 10:14:56 UTC (rev 12034)
@@ -635,6 +635,7 @@
<!ENTITY staff.main.menu.admin.xuleditor.accesskey "X">
<!ENTITY staff.main.menu.admin.xuleditor.label "XUL Test">
<!ENTITY staff.main.menu.admin.venkman.label "Venkman">
+<!ENTITY staff.main.menu.admin.ping "Ping Server">
<!ENTITY staff.main.menu.cat.accesskey "g">
<!ENTITY staff.main.menu.cat.add_bib.key "B">
<!ENTITY staff.main.menu.cat.add_bib.label "Add Bib Record">
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/main/main.js
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/main/main.js 2009-02-01 07:52:31 UTC (rev 12033)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/main/main.js 2009-02-01 10:14:56 UTC (rev 12034)
@@ -151,7 +151,8 @@
var xulG = {
'auth' : G.auth,
'url' : url,
- 'window' : G.window
+ 'window' : G.window,
+ 'data' : G.data
};
if (G.data.ws_info && G.data.ws_info[G.auth.controller.view.server_prompt.value]) {
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/util/network.js
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-02-01 07:52:31 UTC (rev 12033)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/chrome/content/util/network.js 2009-02-01 10:14:56 UTC (rev 12034)
@@ -470,7 +470,39 @@
} catch(E) {
throw(E);
}
- }
+ },
+
+ 'ping' : function() {
+ try {
+ JSAN.use('util.file'); JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
+ var file = new util.file('ping.bat');
+ var path = file._file.path;
+ file.write_content('truncate+exec',
+ '#!/bin/sh\n' +
+ 'ping -n 15 ' + data.server_unadorned + ' > "' + path + '.txt"\n' + /* windows */
+ 'ping -c 15 ' + data.server_unadorned + ' >> "' + path + '.txt"\n' /* unix */
+ );
+ file.close();
+ file = new util.file('ping.bat');
+
+ var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
+ process.init(file._file);
+
+ var args = [];
+
+ dump('process.run = ' + process.run(true, args, args.length) + '\n');
+
+ file.close();
+
+ var file = new util.file('ping.bat.txt');
+ var output = file.get_content();
+ file.close();
+
+ return output;
+ } catch(E) {
+ alert(E);
+ }
+ }
}
/*
Modified: branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_menus.xul
===================================================================
--- branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_menus.xul 2009-02-01 07:52:31 UTC (rev 12033)
+++ branches/staff-client-experiment/Open-ILS/xul/staff_client/server/main/menu_frame_menus.xul 2009-02-01 10:14:56 UTC (rev 12034)
@@ -234,6 +234,7 @@
<menuitem label="&staff.main.menu.admin.venkman.label;" oncommand="try{xulG.window.win.start_debugger();}catch(E){alert(E);}"/>
<menuitem label="&staff.main.auth.debug.inspector;" oncommand="try{xulG.window.win.start_inspector();}catch(E){alert(E);}"/>
<menuitem label="&staff.main.auth.debug.chrome_list;" oncommand="try{xulG.window.win.start_chrome_list();}catch(E){alert(E);}"/>
+ <menuitem label="&staff.main.menu.admin.ping;" oncommand="try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');JSAN.use('util.network'); var n = new util.network(); alert(n.ping());}catch(E){alert(E);}"/>
</menupopup>
</menu>
</menupopup>
More information about the open-ils-commits
mailing list