pari: branch asterisknow r873 - in /branches/asterisknow: ./ config/
config/s...
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Fri May 4 15:33:45 MST 2007
Author: pari
Date: Fri May 4 17:33:44 2007
New Revision: 873
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=873
Log:
Merged revisions 865-866,868,871-872 via svnmerge from
https://origsvn.digium.com/svn/asterisk-gui/trunk
........
r865 | pari | 2007-05-03 12:37:44 -0500 (Thu, 03 May 2007) | 1 line
CLI command history
........
r866 | pari | 2007-05-03 13:46:55 -0500 (Thu, 03 May 2007) | 1 line
onKeyPress do not work with textbox + up/down arrow key events - but found that onKeyDown does, so reverting back to text box using onKeyDown
........
r868 | pari | 2007-05-04 12:54:16 -0500 (Fri, 04 May 2007) | 1 line
load home.html after finished loading parent
........
r871 | pari | 2007-05-04 17:10:19 -0500 (Fri, 04 May 2007) | 1 line
make sure that analog lines are used in only once
........
r872 | pari | 2007-05-04 17:32:31 -0500 (Fri, 04 May 2007) | 1 line
Also in setup wizard: make sure that analog lines are used in only once
........
Modified:
branches/asterisknow/ (props changed)
branches/asterisknow/config/cfgbasic.html
branches/asterisknow/config/cli.html
branches/asterisknow/config/setup/4.html
branches/asterisknow/config/trunks.html
Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 4 17:33:44 2007
@@ -1,1 +1,1 @@
-/trunk:1-449,489-540,542-557,559,561-577,580-586,588-862
+/trunk:1-449,489-540,542-557,559,561-577,580-586,588-872
Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=873&r1=872&r2=873
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Fri May 4 17:33:44 2007
@@ -174,6 +174,7 @@
}
function registerajax() {
+ _$('mainscreen').src = "home.html" ;
Rico.Corner.round('tooltip_round', {compact:true});
// if you want google style feedback boxes :-)
// _$('feedback_round').style.backgroundColor = "#EFEFEF";
@@ -283,7 +284,7 @@
<span style="margin-left: 4px;font-weight:bold">Loading Screen <img src='images/dots.gif'></span>
</div>
<div id="borderbox" class="mainscreenBorderBox" height="100%"></div>
- <iframe width="540" height="505" frameborder="0" border="0" marginheight="0" marginwidth="0" src="home.html" id="mainscreen" style="position:absolute;top:48px;" SCROLLING=no></iframe>
+ <iframe width="540" height="505" frameborder="0" border="0" marginheight="0" marginwidth="0" id="mainscreen" style="position:absolute;top:48px;" SCROLLING=no></iframe>
</td>
<td valign=top width=250 height="505">
<div class="mainscreenTooltipBar" align=right>
Modified: branches/asterisknow/config/cli.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cli.html?view=diff&rev=873&r1=872&r2=873
==============================================================================
--- branches/asterisknow/config/cli.html (original)
+++ branches/asterisknow/config/cli.html Fri May 4 17:33:44 2007
@@ -24,6 +24,10 @@
<link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<script>
+var CLI_HSTY = []; // cli history of previous commands
+var CLI_INDEX = 0; // index for navigating through command history
+var COMMAND;
+
function localajaxinit() {
top._$('mainscreen').width= 798;
setWindowTitle("Asterisk CLI Emulator");
@@ -41,19 +45,36 @@
}
function gotResponse(op){
-
+ var cc = _$('cli_cmd');
op = op.replace(/Response: Follows/, "");
op = op.replace(/Privilege: Command/, "");
op = op.replace(/--END COMMAND--/, "");
- op = "Command><B> <Font color=#13138a size=+1>" + _$('cli_cmd').value + "</FONT></B>" + op ;
+ op = "Command><B> <Font color=#13138a size=+1>" + COMMAND + "</FONT></B>" + op ;
+ CLI_HSTY.push(COMMAND); CLI_INDEX = CLI_HSTY.length;
_$('cli_output').innerHTML = "<PRE>"+ op + "</PRE>";
_$('cli_cmd').value = "";
_$('cli_cmd').focus();
}
function sendCommand(e){
+ var cc = _$('cli_cmd');
+
+ if(e.keyCode == 38){
+ if(CLI_INDEX ==0){return false;}
+ cc.value =CLI_HSTY[CLI_INDEX-1]; CLI_INDEX -= 1;
+ cc.focus();
+ return false;
+ }
+ if(e.keyCode == 40){
+ if(!CLI_HSTY[CLI_INDEX]){cc.value = ""; CLI_INDEX = CLI_HSTY.length; return false;}
+ cc.value = CLI_HSTY[CLI_INDEX]; CLI_INDEX += 1;
+ cc.focus();
+ return false;
+ }
+
if(e.keyCode == 13){
- executeCommand( _$('cli_cmd').value );
+ COMMAND = cc.value;
+ executeCommand(COMMAND);
return false;
}
}
@@ -67,6 +88,6 @@
</div>
<div style="padding : 0px 0px 0px 0px;">
<div style="padding : 0px 1px 0px 2px; height:444px;width= 797px; overflow :auto; font-size : 12px;" id="cli_output"></div><BR>
-Asterisk CLI> <input id="cli_cmd" size=95 onKeyPress="sendCommand(event)" class="input9">
+Asterisk CLI> <input id="cli_cmd" style="height:18px" onKeyDown="sendCommand(event)" class="input9" size=95>
</div>
</body>
Modified: branches/asterisknow/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/4.html?view=diff&rev=873&r1=872&r2=873
==============================================================================
--- branches/asterisknow/config/setup/4.html (original)
+++ branches/asterisknow/config/setup/4.html Fri May 4 17:33:44 2007
@@ -42,6 +42,9 @@
var isnewtrunk;
var dids_array = [];
var old_trunkname;
+var used_fxos = {};
+used_fxos.oldvalue = "";
+used_fxos.newvalue = "";
function add_didcontext(trunk){
var didcontext = asterisk_guiTDPrefix + trunk ;
@@ -135,7 +138,14 @@
}
callbacks.format = function(t) {
- if( InArray(dids_array, t.name) ){ return t.fieldbyname['trunkname']; }
+ if( InArray(dids_array, t.name) ){
+ //
+ if(t.fieldbyname['zapchan']){
+ var s = t.fieldbyname['zapchan'].split(",");
+ for(var u=0; u < s.length; u++){ used_fxos[s[u]] = true ; }
+ }
+ return t.fieldbyname['trunkname'];
+ }
return null;
}
@@ -244,6 +254,7 @@
}else{
if( _$('trunkstyleanalog').checked ){
+ used_fxos.oldvalue = _$('devices').stored_config.catbyname[_dvcs_v].fieldbyname['zapchan'] ;
_$('context').value = asterisk_guiTDPrefix + _$('name').value ;
var needcomma = 0 ;
var count = 0 ;
@@ -256,6 +267,7 @@
count++ ;
}
}
+ used_fxos.newvalue = _$('trunkname').value;
_$('trunkname').value = ((count > 1) ? "Ports ":"Port ") + _$('trunkname').value ;
}
@@ -267,6 +279,7 @@
}
callbacks.savechanges = function() {
+ update_used_fxos();
if(isnewtrunk == 1){ //New Trunk created , add [DID_trunk_x] in extensions.conf
add_didcontext(_$('name').value);
if (_$('trunkstylevoip').checked) {
@@ -281,9 +294,19 @@
callbacks_savechanges_step2();
}else{
if(old_trunkname != _$('name').value ){ update_didcontext(old_trunkname, _$('name').value); } // rename DID if needed
+ hideSPdetails();
+ loadServiceProvidersintotable();
}
return true;
+}
+
+function update_used_fxos(){
+ var r;
+ var ovs = used_fxos.oldvalue.split(",");
+ var nvs = used_fxos.newvalue.split(",");
+ for(r=0; r < ovs.length; r++){ delete used_fxos[ovs[r]]; }
+ for(r=0; r < nvs.length; r++){ used_fxos[nvs[r]] = true; }
}
@@ -359,6 +382,7 @@
_provider.selectedIndex = -1;
count = 0;
_trunkname.value = "";
+ used_fxos.oldvalue = "";
for (var x=0;x<_zapchan.options.length;x++) {
if (_zapchan.options[x].selected) {
if (needcomma){ _trunkname.value += "," }
@@ -367,6 +391,7 @@
count++;
}
}
+ used_fxos.newvalue = _trunkname.value;
_trunkname.value = ((count > 1) ? "Ports ":"Port ") + _trunkname.value;
_$('callerid').value = 'asreceived';
_$('hassip').value = 'no';
@@ -473,6 +498,7 @@
_zcal.innerHTML ="";
_$('customvoip').style.display = "none" ;
_$('voip').style.display= "none";
+ var disablestring;
if (_$('trunkstyleanalog').checked) {
_$('analog').style.display = "block";
@@ -482,10 +508,17 @@
}else{
for (k=0;k< _zapchan.length ;k++ ){
var selectedline = "selectedline" + k;
+
+ if( used_fxos[_zapchan.options[k].value] && !_zapchan.options[k].selected){
+ disablestring = " disabled";
+ }else{
+ disablestring = "";
+ }
+
if(_zapchan.options[k].selected){
- _zcal.innerHTML += '<LABEL FOR="' + selectedline + '"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" checked onclick="update_zapchan()">' + _zapchan.options[k].text + '</LABEL><BR>';
+ _zcal.innerHTML += '<LABEL FOR="' + selectedline + '"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" checked onclick="update_zapchan()"' + disablestring +'>' + _zapchan.options[k].text + '</LABEL><BR>';
}else{
- _zcal.innerHTML += '<LABEL FOR="'+ selectedline+'"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" onclick="update_zapchan()">' + _zapchan.options[k].text + '</LABEL><BR>';
+ _zcal.innerHTML += '<LABEL FOR="'+ selectedline+'"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" onclick="update_zapchan()"' + disablestring +'>' + _zapchan.options[k].text + '</LABEL><BR>';
}
}
}
Modified: branches/asterisknow/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/trunks.html?view=diff&rev=873&r1=872&r2=873
==============================================================================
--- branches/asterisknow/config/trunks.html (original)
+++ branches/asterisknow/config/trunks.html Fri May 4 17:33:44 2007
@@ -40,7 +40,9 @@
var isnewtrunk;
var dids_array = [];
var old_trunkname;
-
+var used_fxos = {};
+used_fxos.oldvalue = "";
+used_fxos.newvalue = "";
function add_didcontext(trunk){
var didcontext = asterisk_guiTDPrefix + trunk ;
@@ -126,7 +128,14 @@
}
callbacks.format = function(t) {
- if( InArray(dids_array, t.name) ){ return t.fieldbyname['trunkname']; }
+ if( InArray(dids_array, t.name) ){
+ //
+ if(t.fieldbyname['zapchan']){
+ var s = t.fieldbyname['zapchan'].split(",");
+ for(var u=0; u < s.length; u++){ used_fxos[s[u]] = true ; }
+ }
+ return t.fieldbyname['trunkname'];
+ }
return null;
}
@@ -234,6 +243,8 @@
}else{
if( _$('trunkstyleanalog').checked ){
+
+ used_fxos.oldvalue = _$('devices').stored_config.catbyname[_dvcs_v].fieldbyname['zapchan'] ;
_$('context').value = asterisk_guiTDPrefix + _$('name').value ;
var needcomma = 0 ;
var count = 0 ;
@@ -246,6 +257,7 @@
count++ ;
}
}
+ used_fxos.newvalue = _$('trunkname').value;
_$('trunkname').value = ((count > 1) ? "Ports ":"Port ") + _$('trunkname').value ;
}
@@ -257,6 +269,7 @@
}
callbacks.savechanges = function() {
+ update_used_fxos();
if(isnewtrunk == 1){ //New Trunk created , add [DID_trunk_x] in extensions.conf
add_didcontext(_$('name').value);
if (_$('trunkstylevoip').checked) {
@@ -271,9 +284,19 @@
callbacks_savechanges_step2();
}else{
if(old_trunkname != _$('name').value ){ update_didcontext(old_trunkname, _$('name').value); } // rename DID if needed
+ hideSPdetails();
+ loadServiceProvidersintotable();
}
return true;
+}
+
+function update_used_fxos(){
+ var r;
+ var ovs = used_fxos.oldvalue.split(",");
+ var nvs = used_fxos.newvalue.split(",");
+ for(r=0; r < ovs.length; r++){ delete used_fxos[ovs[r]]; }
+ for(r=0; r < nvs.length; r++){ used_fxos[nvs[r]] = true; }
}
@@ -349,6 +372,7 @@
_provider.selectedIndex = -1;
count = 0;
_trunkname.value = "";
+ used_fxos.oldvalue = "";
for (var x=0;x<_zapchan.options.length;x++) {
if (_zapchan.options[x].selected) {
if (needcomma){ _trunkname.value += "," }
@@ -357,6 +381,7 @@
count++;
}
}
+ used_fxos.newvalue = _trunkname.value;
_trunkname.value = ((count > 1) ? "Ports ":"Port ") + _trunkname.value;
_$('callerid').value = 'asreceived';
_$('hassip').value = 'no';
@@ -463,6 +488,7 @@
_zcal.innerHTML ="";
_$('customvoip').style.display = "none" ;
_$('voip').style.display= "none";
+ var disablestring;
if (_$('trunkstyleanalog').checked) {
_$('analog').style.display = "block";
@@ -472,10 +498,17 @@
}else{
for (k=0;k< _zapchan.length ;k++ ){
var selectedline = "selectedline" + k;
+
+ if( used_fxos[_zapchan.options[k].value] && !_zapchan.options[k].selected){
+ disablestring = " disabled";
+ }else{
+ disablestring = "";
+ }
+
if(_zapchan.options[k].selected){
- _zcal.innerHTML += '<LABEL FOR="' + selectedline + '"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" checked onclick="update_zapchan()">' + _zapchan.options[k].text + '</LABEL><BR>';
+ _zcal.innerHTML += '<LABEL FOR="' + selectedline + '"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" checked onclick="update_zapchan()"' + disablestring +'>' + _zapchan.options[k].text + '</LABEL><BR>';
}else{
- _zcal.innerHTML += '<LABEL FOR="'+ selectedline+'"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" onclick="update_zapchan()">' + _zapchan.options[k].text + '</LABEL><BR>';
+ _zcal.innerHTML += '<LABEL FOR="'+ selectedline+'"><INPUT id="' + selectedline + '" TYPE="CHECKBOX" VALUE="'+ _zapchan.options[k].value+ '" onclick="update_zapchan()"' + disablestring +'>' + _zapchan.options[k].text + '</LABEL><BR>';
}
}
}
More information about the asterisk-gui-commits
mailing list