bkruse: trunk r1531 - in /trunk: ./ config/digital.html config/scripts/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Sep 5 15:57:44 CDT 2007


Author: bkruse
Date: Wed Sep  5 15:57:43 2007
New Revision: 1531

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1531
Log:
Merged revisions 1530 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/branches/1.4

........
r1530 | bkruse | 2007-09-05 15:55:58 -0500 (Wed, 05 Sep 2007) | 4 lines

Ability to backup your zaptel config.
Ability to properly refresh information
in the table... Couple other fixes.

........

Modified:
    trunk/   (props changed)
    trunk/config/digital.html
    trunk/config/scripts/astman.js

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-1.4-merged (original)
+++ branch-1.4-merged Wed Sep  5 15:57:43 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-1291,1293,1298-1300,1326,1332,1336-1338,1342,1346,1349,1356,1359,1362,1381,1384,1395,1399,1402,1413,1416,1426,1432,1435,1439,1442,1455,1458,1465,1471,1475,1478,1481,1488,1491,1494,1497,1500,1504,1507,1510,1513,1516,1520
+/branches/1.4:1-1291,1293,1298-1300,1326,1332,1336-1338,1342,1346,1349,1356,1359,1362,1381,1384,1395,1399,1402,1413,1416,1426,1432,1435,1439,1442,1455,1458,1465,1471,1475,1478,1481,1488,1491,1494,1497,1500,1504,1507,1510,1513,1516,1520,1530

Modified: trunk/config/digital.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/digital.html?view=diff&rev=1531&r1=1530&r2=1531
==============================================================================
--- trunk/config/digital.html (original)
+++ trunk/config/digital.html Wed Sep  5 15:57:43 2007
@@ -121,6 +121,7 @@
 var has_spans = 0; /* Count of our spans we have, incrementing each time. */
 var total_spans = 0; /* Count of our spans that ztscan.conf says we have */
 var old_zap = 0;
+var isrefresh = 0;
 var widgets = {};
 var fieldnames = [ 'active', 'alarms', 'description', 'name', 'totchans', 'fac', 'lbo' ]; 
 var fieldnames_clickable = [ 'active', 'fac', 'lbo' ]; 
@@ -212,6 +213,7 @@
 	setTimeout("_$('status_message').style.display='none'", 5000);
 	_$('message_text').innerHTML = "Re-Detecting Digital Cards and Alarms... ";
 	/* Give ztscan 4 seconds to detect and write to ztscan.conf */
+	isrefresh = 1;
 	parent.astmanEngine.run_tool(asterisk_guiZtscan, function(t) {
 		setTimeout('load_config_tool()', 4000); 
 	});
@@ -248,10 +250,14 @@
 	alert(a);
 	return true;
 }
+
 function digitalparse(n) { 
 
 	var l, h;
 	var box = _$('digitalcardstable');
+	if(isrefresh == 1) {
+		box.innerHTML = "";
+	}
 	var _class = 0;
 	for( l in n ){	if(n.hasOwnProperty(l)){
 		if( l =='general') { 
@@ -363,13 +369,23 @@
 	return true;
 }
 
+/* here we will actually backup zaptel.conf to the user defined setting. */
+function backup_zap_real() {
+	var _zc = _$('zap_conf_name').value;
+	var zap_conf = "zaptel.conf.bak";
+	if(!_zc.length) {
+		gui_alert("Not Backup Config Specified! Defaulting to zaptel.conf.bak");
+	} else {
+		zap_conf = _zc;
+	}
+	parent.astmanEngine.run_tool("cp " + asterisk_zaptelConfig + " /etc/" + zap_conf, callback = function(t) { return true; });
+}
+
 function backup_zap() {
-	alert("this is being worked on...");
-	return true;
 	/* function to grab the values of fields, and call the bash script to apply the changes and run ztcfg */
 	_$('status_message').style.display="block";
 	_$('status_message').innerHTML = '<TABLE border=0 cellpadding=0 cellspacing=4 align=center><TR><TD><img src="/asterisk/static/config/images/loading.gif"></TD><TD><div id=message_text></div></TD></TR></TABLE>';
-	_$('message_text').innerHTML = "Time: <div id='counter'>10</div>Are you sure you want to apply settings to zaptel.conf and restart zaptel? (run ztcfg)<BR>1. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; get_params_and_ztcfg();\">Yes</A><br>2. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; gui_feedback('You Chose not to save your settings.', 'red');>No<br></a>";
+	_$('message_text').innerHTML = "Time: <div id='counter'>10</div>Backup zaptel.conf to /etc/<input id=\"zap_conf_name\" width=\"15\" value=\"zaptel.conf.bak\" class=\"input8\"></input><BR>1. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; backup_zap_real();\">Yes</A><br>2. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; gui_feedback('You Chose not to save your settings.', 'red');>No<br></a>";
 	setTimeout("_$('status_message').style.display='none';", 10000);
 	int_handle = setInterval("_$('counter').innerHTML = (_$('counter').innerHTML - 1);", 1000);
 	setTimeout("clearInterval(int_handle);", 10000);

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=1531&r1=1530&r2=1531
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Wed Sep  5 15:57:43 2007
@@ -38,6 +38,7 @@
 var asterisk_guiConfigFile = "guipreferences.conf"; // will be created in asterisk_configfolder, if the file does not exist 
 var asterisk_configfolder = "/etc/asterisk/";
 var asterisk_guiListFiles = "sh " + asterisk_scriptsFolder + "listfiles" ;
+var asterisk_zaptelConfig = "/etc/zaptel.conf";
 
 var asterisk_guiTDPrefix = "DID_";
 var TIMERULES_CATEGORY = 'timebasedrules';




More information about the asterisk-gui-commits mailing list