bkruse: branch asterisknow r1347 - in /branches/asterisknow: ./ config/ confi...
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Wed Aug 15 15:32:03 CDT 2007
Author: bkruse
Date: Wed Aug 15 15:32:02 2007
New Revision: 1347
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1347
Log:
Merged revisions 1346 via svnmerge from
https://origsvn.digium.com/svn/asterisk-gui/branches/1.4
........
r1346 | bkruse | 2007-08-15 15:29:51 -0500 (Wed, 15 Aug 2007) | 1 line
Added some support to astman.js for config2json. Now when you use config to json, you can use its return value as a conditional statement, eg, if(\!config2json(doesnotexist.conf, 1, function(t) { do_something(); }) { alert('config file not found'); }); An example of this is included in the commit, as the first attempt at it, in digital.html
........
Modified:
branches/asterisknow/ (props changed)
branches/asterisknow/config/digital.html
branches/asterisknow/config/scripts/astman.js
Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Aug 15 15:32:02 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-1296,1316,1326,1332,1336-1338,1342
+/branches/1.4:1-1296,1316,1326,1332,1336-1338,1342,1346
Modified: branches/asterisknow/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/digital.html?view=diff&rev=1347&r1=1346&r2=1347
==============================================================================
--- branches/asterisknow/config/digital.html (original)
+++ branches/asterisknow/config/digital.html Wed Aug 15 15:32:02 2007
@@ -107,7 +107,6 @@
// }
}}
- alert("just did parentloadd screen");
_$('status_message').style.display='none';
return "span: " + t.name + " Mode: " + mode;
@@ -161,7 +160,13 @@
_$('message_text').innerHTML = "Detecting Digital Cards ... (Beta)";
setWindowTitle("Digital Setup Wizard");
parent.loadscreen(this);
- parent.astmanEngine.run_tool(asterisk_guiZtscan, onSuccess = function() { config2json("ztscan.conf", 1, digitalparse); });
+ parent.astmanEngine.run_tool(asterisk_guiZtscan, onSuccess = function() {
+ if(!config2json("ztscan.conf", 1, digitalparse)) {
+ alert("Have you properly installed ztscan to /sbin/ztscan?\n/etc/asterisk/ztscan.conf does not exist.");
+ _$('error_txt').style.display="";
+ _$('error_txt').innerHTML="<br><br>Problem Detecting/No Cards(or spans) Found!<br><br> Error: No Config File";
+ }
+ });
}
function free_mem(){
Modified: branches/asterisknow/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/scripts/astman.js?view=diff&rev=1347&r1=1346&r2=1347
==============================================================================
--- branches/asterisknow/config/scripts/astman.js (original)
+++ branches/asterisknow/config/scripts/astman.js Wed Aug 15 15:32:02 2007
@@ -363,7 +363,15 @@
function config2json(a, b, c){ // a is filename (string) , b is 0 or 1 , c is callback function
- makerequest('g',a,'', function(t){var f = toJSO(t, b) ; c(f) ;});
+ makerequest('g',a,'', function(t){
+ var response = t.split("\n");
+ if(response[1].match("Message: Config file not found")) {
+ //alert( "Asterisk says it cannot find a required config file (" + a + ") \n!" );
+ return false;
+ }
+ var f = toJSO(t, b) ; c(f) ;
+ });
+ return true; /* If our previous case of config file not found does not return already, we must have found the config file */
}
function toJSO(z, p){
More information about the asterisk-gui-commits
mailing list