pari: branch asterisknow r2102 - /branches/asterisknow/config/digital.html
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Tue Jan 8 13:44:42 CST 2008
Author: pari
Date: Tue Jan 8 13:44:41 2008
New Revision: 2102
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=2102
Log:
Fix for BE-307
use 'getconfig' for reading the loadzone
-- instead of trying to parse the zaptel.conf as html
(which might have a lot of comments in the file)
Modified:
branches/asterisknow/config/digital.html
Modified: branches/asterisknow/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/digital.html?view=diff&rev=2102&r1=2101&r2=2102
==============================================================================
--- branches/asterisknow/config/digital.html (original)
+++ branches/asterisknow/config/digital.html Tue Jan 8 13:44:41 2008
@@ -589,24 +589,25 @@
},
load_zaptel_conf: function(){
- parent.astmanEngine.run_tool('cat /etc/zaptel.conf > /var/lib/asterisk/static-http/config/scan.html' , function(t) {
- new Ajax.Request("./scan.html", {
- method : "get",
- asynchronous : true,
- onComplete : function(c){
- try{
- var lines = c.responseText.split("\n");
- lines.each(function(line){
- if(line.contains('loadzone')){
- var y = (line.split('=')[1]).strip();
- ASTGUI.selectbox.selectOption( _$('loadZone'), y );
- }
- });
- }catch(err){}
- return true;
- },
- onFailure : function(){ return true; }
- });
+ var tmp_file = 'zaptel_guiRead.conf';
+ parent.astmanEngine.run_tool("touch /etc/asterisk/" + tmp_file, function(t){
+ var parseZaptelconf = function(zp){
+ if(zp['general']['loadzone']){
+ var y = zp['general']['loadzone'];
+ ASTGUI.selectbox.selectOption( _$('loadZone'), y );
+ }else{
+ var y ='';
+ _$('loadZone').selectedIndex = -1;
+ }
+; };
+
+ var somefunction = function(){
+ var c = 0;
+ var uri = build_action('delcat', c, 'general', "", ""); c++;
+ uri += build_action('newcat', c, 'general', "", ""); c++;
+ uri += build_action('update', c, 'general', '#include "../zaptel.conf" ;', ''); c++;
+ makerequest('u', tmp_file, uri, function(t) { config2json(tmp_file, 1, parseZaptelconf); });
+ }();
});
},
};
More information about the asterisk-gui-commits
mailing list