pari: branch asterisknow r489 - in /branches/asterisknow: config/
config/scri...
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Mon Mar 26 12:20:37 MST 2007
Author: pari
Date: Mon Mar 26 14:20:37 2007
New Revision: 489
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=489
Log:
Merging all recent changes in trunk - Part1
Removed:
branches/asterisknow/config/cfgadvanced.html
Modified:
branches/asterisknow/config/backup.html
branches/asterisknow/config/cfgbasic.html
branches/asterisknow/config/guialert.html
branches/asterisknow/config/home.html
branches/asterisknow/config/iax.html
branches/asterisknow/config/incoming.html
branches/asterisknow/config/jabber.html
branches/asterisknow/config/jingle.html
branches/asterisknow/config/localexts.html
branches/asterisknow/config/meetme.html
branches/asterisknow/config/menus.html
branches/asterisknow/config/moh.html
branches/asterisknow/config/numberplan.html
branches/asterisknow/config/options.html
branches/asterisknow/config/queues.html
branches/asterisknow/config/record.html
branches/asterisknow/config/scripts/astman.js
branches/asterisknow/config/scripts/prototype.js
branches/asterisknow/config/scripts/tooltip.js
branches/asterisknow/config/setup/4.html
branches/asterisknow/config/setup/6.html
branches/asterisknow/config/setup/7.html
branches/asterisknow/config/sip.html
branches/asterisknow/config/status.html
branches/asterisknow/config/stylesheets/schwing.css
branches/asterisknow/config/sysinfo.html
branches/asterisknow/config/trunks.html
branches/asterisknow/config/users.html
branches/asterisknow/config/voicemail.html
branches/asterisknow/config/zapata.html
branches/asterisknow/gui_configs/gui_sysinfo
Modified: branches/asterisknow/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/backup.html?view=diff&rev=489&r1=488&r2=489
==============================================================================
--- branches/asterisknow/config/backup.html (original)
+++ branches/asterisknow/config/backup.html Mon Mar 26 14:20:37 2007
@@ -25,81 +25,219 @@
<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 bkp_path = "/var/lib/asterisk/static-http/config/bkps/";
-var bkpfile ;
+var bkp_path = "/var/lib/asterisk/gui_configbackups/";
function localajaxinit() {
+ setWindowTitle("Backup");
showdiv_statusmessage();
- setWindowTitle("Backup");
+ var _nn = _$('newbkp_name') ;
+ _nn.onfocus = function(){this.className = 'input9_hilight';}
+ _nn.onblur = function(){this.className = 'input9';}
+
+ parent.astmanEngine.run_tool("sh /etc/asterisk/gui_sysinfo", callback = function() {
+ var opt = { method: 'get', asynchronous: true,
+ onComplete: function(originalRequest){
+ _$('sysinfohtml').innerHTML = originalRequest.responseText;
+ showlist_of_files();
+ },
+ onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }
+ };
+ opt.parameters="";
+ var tmp = new Ajax.Request("./bkps/sysinfo_output.html", opt);
+ return true;
+ });
+}
+
+
+function showlist_of_files(){
+ var k = _$('bkp_files').innerHTML ;
+ var bkpfiles = k.split("<br>") ;
+
+ clear_table();
+
+ for( var i =0 ; i < bkpfiles.length ; i++){
+ if( typeof bkpfiles[i] == "undefined" || bkpfiles[i] == "" ){
+ continue;
+ }
+ bkpfiles[i] = bkpfiles[i].replace(/^\s*|\s*$/g,'') ;
+ if( bkpfiles[i] == "" ){continue; }
+ addrow_totable( bkpfiles[i].stripTags(), i );
+ }
+
+
+ var _bft = _$('bkpfilesTable') ;
+
+ if( _bft.rows.length == 0 ){
+ _$('table_one').style.display="none";
+ var newRow = _bft.insertRow(-1);
+ var newCell0 = newRow.insertCell(0);
+ newCell0 .align = "center";
+ newCell0 .innerHTML = "<BR><I> No Previous Backup configurations found !!</I> <BR><BR>" +
+ "Please click on the 'Take a BackUp' button<BR> to take a backup of the current system configuration<BR><BR>" ;
+ }
+
parent.loadscreen(this);
- $('status_message').style.top = 100;
- $('status_message').style.left = 100;
-}
-
+}
+
+function clear_table(){
+ var _bft = _$('bkpfilesTable') ;
+ for( var i=0; i < _bft.rows.length; ){
+ _bft.deleteRow(i);
+ }
+}
+
+
+function addrow_totable(filename, i ){
+ var fname = filename.split("__") ;
+ // var fname[1] = 2007mar12.tar
+ var filedate = fname[1].split(".tar");
+ var day = filedate[0].substr(7);
+ var month = filedate[0].substr(4,3);
+ var year = filedate[0].substr(0,4);
+
+ var newRow = _$('bkpfilesTable').insertRow(-1);
+ newRow.style.backgroundColor='#FFFFFF';
+ newRow.onmouseover= function(){ this.style.backgroundColor='#F9F0D1'; };
+ newRow.onmouseout=function(){ this.style.backgroundColor='#FFFFFF'; };
+
+ var newCell0 = newRow.insertCell(0);
+ newCell0 .innerHTML = i+1 ;
+ newCell0 .width = 35;
+ newCell0.align = "center";
+
+ var newCell1 = newRow.insertCell(1);
+ newCell1 .innerHTML = fname[0] ;
+ newCell1.width = 180;
+
+ var newCell2 = newRow.insertCell(2);
+ newCell2 .innerHTML = month.capitalize() + " " + day + ", "+year ;
+ newCell2.width = 95;
+
+ var newCell3 = newRow.insertCell(3);
+ newCell3 .innerHTML = "<input type=\"button\" onclick='restore_bkp(\""+ filename + "\")' value=\"Restore\" class=\"splbutton\"> " +
+ "<input type=\"button\" onclick='delete_bkp(\""+ filename + "\")' value=\"Delete\" class=\"splbutton\">" ;
+ newCell3.align = "center";
+}
+
+
+function restore_bkp(filename){
+ parent.astmanEngine.run_tool("rm /etc/asterick/* -rf ", callback=function(){ restore_bkp_step2(filename);} );
+}
+
+
+function restore_bkp_step2(filename){
+ parent.astmanEngine.run_tool("tar -xf " + bkp_path + filename +" -C /" , callback=function(){
+ gui_alert("Configuration restored !!");
+ // give two seconds for extracting tar file before restarting asterisk
+ window.setTimeout( function(){ parent.reloadConfig();}, 1500);
+ });
+}
+
+function delete_bkp( filename ){
+ if(!confirm("Delete selected Backup Configuration ?")){ return ; }
+ parent.astmanEngine.run_tool("/bin/rm -f "+ bkp_path + filename , callback=function(){
+ _$('status').innerHTML = " <I> Delete Request Successfull ! </I>";
+ window.location.href = window.location.href ;
+ });
+}
+
+function take_bkp(){
+ _$('bg_transparent').style.display="" ;
+ _$('newbkp_content').style.display="" ;
+ _$('newbkp_name').focus();
+}
+
+function cancel_newbackup(){
+ _$('bg_transparent').style.display="none" ;
+ _$('newbkp_content').style.display="none" ;
+}
function addzero(x){
-if ( x < 10)
- return "0" + x;
-return x;
-}
-
-function removebkpfile(){
- $('message_text').innerHTML = "Please wait while the system <BR> Generates a Backup ... ";
- $('status_message').style.display="block";
- //remove bkpfile on server
- parent.astmanEngine.run_tool("/bin/rm " + bkp_path+ "conf_* -f", download_bkp );
-}
-
-
-function showremovebkpfile(){
- $('status_message').style.display='none';
-// $('message_text').innerHTML = "<A href=\"#\" onclick=\"removebkpfile()\">I have downloaded the file</A><BR><BR>" + "<A href=\"./bkps/"+ bkpfile +"\" onclick=\"showremovebkpfile()\">ReDownload</A>";
-}
-
-
-
-function download_bkp(){
-
- var today=new Date()
- var year = today.getFullYear();
- var month = addzero(today.getMonth() + 1);
- var day = addzero(today.getDate());
- var hour =addzero(today.getHours());
- var minute =addzero(today.getMinutes());
- var seconds =addzero(today.getSeconds());
- bkpfile = "conf_" + year + month + day + hour + minute +seconds +".tar";
- parent.astmanEngine.run_tool("/bin/tar -cf "+ bkp_path + bkpfile +" /etc/asterisk/", callback=function(){
- $('status').innerHTML = " <I> Finished generating Backup ! </I>";
- $('status_message').style.display="none";
- window.location.href = "./bkps/"+ bkpfile ;
- //$('message_text').innerHTML = "<A href=\"./bkps/"+ bkpfile +"\" onclick=\"showremovebkpfile()\">Click Here to Download</A>";
- } );
+ if ( x < 10){ return "0" + x;}
+ return x;
+}
+
+function backup_new(){
+ var _nn = _$('newbkp_name');
+ if( _nn.value == "" ){
+ alert("Please Enter a name for the backup");
+ _nn.focus();
+ return true;
+ }
+ var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
+ var today=new Date()
+ var year = today.getFullYear();
+ var month = months[ today.getMonth() ];
+ var day = addzero(today.getDate());
+ //var hour =addzero(today.getHours());
+ //var minute =addzero(today.getMinutes());
+ //var seconds =addzero(today.getSeconds());
+ var bkpfile = _nn.value +"__" + year + month + day +".tar";
+
+ parent.astmanEngine.run_tool("/bin/tar -cf "+ bkp_path + bkpfile +" /etc/asterisk/", callback=function(){
+ window.location.href = window.location.href ;
+ }
+ );
}
</script>
<body id="foo" onload="localajaxinit()" bgcolor="EFEFEF">
<div class="mainscreenTitleBar">
- <span style="margin-left: 4px;font-weight:bold;">Download Configuration Backup</span>
+ <span style="margin-left: 4px;font-weight:bold;">Backup / Restore Configurations</span>
<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" > <img src="images/refresh.png" title=" Refresh " border=0 > </span>
</div>
<div class="mainscreenContentBox" id="userscontent">
<table class="mainscreenTable" align="center">
- <tr> <td align=center height=30><BR><BR><div id="status"></div></td></tr>
<tr>
- <td valign="top" align="center">
- <BR><BR>
- <Input type="button" onclick="removebkpfile()" value="Download a Configuration backup">
- </td>
- </tr>
- <tr>
- <td valign="top" align="center">
- <BR><BR>
- <font size="-1">
- Note: Restoring a configuration backup will be added soon to this section !<BR>
- Work in Progress
- </font>
- </td>
+ <td valign="top" align="center">
+ <BR>
+ <fieldset style="height: 390px; " id="fieldset2">
+ <legend> List of Previous Configuration Backups </legend>
+ <table class="table_blacksm" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
+ <tr> <td width=35>S.No</td>
+ <td width="180">Name</td>
+ <td width="95">Date</td>
+ <td align="center">Options</td>
+ </tr>
+ </table>
+ <div id="bkpfilesTable_div" style="height:260px;width=100%; overflow :auto; padding : 0px 0px 0px 0px;">
+ <table id="bkpfilesTable" cellpadding=2 cellspacing=1 border=0 align=center width=500></table>
+ </div>
+ <center><div style="height:25px;color: #FF0000;" id='status' class="field_text9"></div></center>
+ <BR>
+ <div STYLE="position: absolute; left:186; top: 460;">
+ <input type="button" id="takebkp" value="Take a Backup" onclick="take_bkp();" >
+ </div>
+ </fieldset>
+ </td>
</tr>
</table>
</div>
-</body>
+<div id="newbkp_content" STYLE="display:none; position: absolute; left: 120; top: 144; width:350; height:125; background-color:#F4EFE5; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
+ <table width="100%" cellpadding=0 cellspacing=0 onmousedown="startDrag(event , 'newbkp_content');">
+ <TR bgcolor="#7E5538" style="background-image:url('images/title_gradient.gif');">
+ <TD><font color="#FFFFFF"> <B>Create New Backup</B></FONT></TD>
+ <TD Height="20" align="right" style="cursor: move">
+ <A href="#" onclick="$('cancel_a').click();" style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</A>
+ </TD>
+ <TD width=4></TD>
+ </TR>
+ </table>
+ <table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
+ <tr> <td colspan=2 height=20 valign=middle align=center class="field_text"></td> </tr>
+ <tr> <td class="field_text" align="right">File Name: </td>
+ <td><input id='newbkp_name' size=25 class="input9"></td>
+ </tr>
+ <tr> <td colspan=2 align=center height=6></td> </tr>
+ <tr> <td colspan=2 align=center height=6>(do not enter any extension )</td></tr>
+ <tr> <td colspan=2 align=center>
+ <input type="button" id='getbackup' Value="Backup" onclick="backup_new()" class="buttonbold">
+ <input type="button" id='cancel_a' Value="Cancel" onclick="cancel_newbackup()" class="buttonbold">
+ </td>
+ </tr>
+ </table>
+</div>
+<div id="sysinfohtml" style="display:none"></div>
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%; background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
+</div>
+</body>
Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=489&r1=488&r2=489
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Mon Mar 26 14:20:37 2007
@@ -20,7 +20,7 @@
*
-->
<script>
-var browser_alert = "Asterisk Configuration GUI is currently supported in Firefox (recommended 1.5 or above) \n SeaMonkey (1.0 or above), Netscape (8.0 or above) and Opera (9.0 or above) \n\n" + "Support for other browsers is under development \n" + " and will be supported in future versions";
+var browser_alert = "You owe it to yourself to try it out !<BR><A href='http://www.getfirefox.com' style='font-size: 13px; font-family:arial,sans-serif,Helvetica,Trebuchet MS; color : #6C74A3;' target='_blank'>Get Firefox</A>";
</script>
<script src="scripts/prototype.js"></script>
<script src="scripts/rico.js"></script>
@@ -28,202 +28,210 @@
<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>
- PanelDef = Class.create();
- PanelDef.prototype = {
- initialize: function(name, label, icon, content) {
- this.name = name;
- this.label = label;
- this.icon = icon;
- this.content = content;
- }
- }
- var panels = new Array;
- var eventeater = new Object;
- var loggedon = -1;
- var started = 0;
- var accordion;
- var copyright = "Copyright ©2006 Digium, Inc. All Rights Reserved. ";
- var tooltip_default = "Move the mouse over to a field to see tooltips";
- var asterisk_guitools_inextconf = 0;
-
- eventeater.eventcb = function(msgs) {
- if (loggedon == 1){
- astmanEngine.pollEvents();
- }
- }
-
-
- panels.push(
-
- new PanelDef("home", "Home", "home.png",
- "Asterisk Configuration Panel - Please click on a panel to manage related features"),
-
- new PanelDef("users", "Users", "accordion-icon.gif",
- "Users is a short cut for quickly adding and removing all the necessary " +
- "configuration components for any new phone."),
-
- new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
- "MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
- "security."),
-
- new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
- "General settings for voicemail"),
-
- new PanelDef("queues", "Call Queues", "accordion-icon.gif",
- "Call queues allow calls to be sequenced to one or more agents."),
-
- new PanelDef("trunks", "Service Providers", "accordion-icon.gif",
- "Service Providers are outbound lines used to allow the system to make calls to the " +
- "real world. Trunks can be VoIP lines or traditional telephony lines."),
-
- new PanelDef("numberplan", "Calling Rules", "accordion-icon.gif",
- "The Calling Rules define dialing permissions and least cost routing rules."),
-
- new PanelDef("incoming", "Incoming Calls", "accordion-icon.gif",
- "Define how your incoming calls should be handled & configure DID (Direct inward Dialing)"),
-
-// new PanelDef("musiconhold", "Music On Hold", "accordion-icon.gif",
-// "Music on hold sometimes keeps people less angry while they wait for an answer."),
-
- new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
- "Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist"),
-
- new PanelDef("record", "Record a Menu", "accordion-icon.gif",
- "Allows you to record custom voicemenus over a phone"),
-
- new PanelDef("status", "Active Channels", "accordion-icon.gif", "Monitor active channels."),
-
- new PanelDef("sysinfo", "System Info", "accordion-icon.gif", "System Information."),
-
- new PanelDef("backup", "Backup", "accordion-icon.gif", "Backup Management."),
-
- new PanelDef("localexts", "Options", "accordion-icon.gif", "Admin Settings")
-
+PanelDef = Class.create();
+PanelDef.prototype = {
+ initialize: function(name, label, icon, content) {
+ this.name = name;
+ this.label = label;
+ this.icon = icon;
+ this.content = content;
+ }
+}
+var panels = new Array;
+var eventeater = new Object;
+var loggedon = -1;
+var started = 0;
+var accordion;
+var copyright = "Copyright ©2006-2007 Digium, Inc. All Rights Reserved. ";
+var tooltip_default = "Move the mouse over to a field to see tooltips";
+var asterisk_guitools_inextconf = 0;
+
+eventeater.eventcb = function(msgs) {
+ if (loggedon == 1){
+ astmanEngine.pollEvents();
+ }
+}
+
+
+panels.push(
+
+ new PanelDef("home", "Home", "home.png",
+ "Asterisk Configuration Panel - Please click on a panel to manage related features"),
+
+ new PanelDef("users", "Users", "accordion-icon.gif",
+ "Users is a short cut for quickly adding and removing all the necessary " +
+ "configuration components for any new phone."),
+
+ new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
+ "MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
+ "security."),
+
+ new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
+ "General settings for voicemail"),
+
+ new PanelDef("queues", "Call Queues", "accordion-icon.gif",
+ "Call queues allow calls to be sequenced to one or more agents."),
+
+ new PanelDef("trunks", "Service Providers", "accordion-icon.gif",
+ "Service Providers are outbound lines used to allow the system to make calls to the " +
+ "real world. Trunks can be VoIP lines or traditional telephony lines."),
+
+ new PanelDef("numberplan", "Calling Rules", "accordion-icon.gif",
+ "The Calling Rules define dialing permissions and least cost routing rules."),
+
+ new PanelDef("incoming", "Incoming Calls", "accordion-icon.gif",
+ "Define how your incoming calls should be handled & configure DID (Direct inward Dialing)"),
+
+ new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
+ "Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist"),
+
+ new PanelDef("record", "Record a Menu", "accordion-icon.gif",
+ "Allows you to record custom voicemenus over a phone"),
+
+ new PanelDef("status", "Active Channels", "accordion-icon.gif", "Monitor active channels."),
+
+ new PanelDef("sysinfo", "System Info", "accordion-icon.gif", "System Information."),
+
+ new PanelDef("backup", "Backup", "accordion-icon.gif", "Backup Management."),
+
+ new PanelDef("localexts", "Options", "accordion-icon.gif", "Admin Settings")
+
+);
+
+// show additional panels for advanced mode
+if(window.location.href.match("advanced=yes") ){
+panels.splice(10,0,
+ new PanelDef("moh", "Music On Hold", "accordion-icon.gif", " Music on hold sometimes keeps people less angry while they wait for an answer"),
+
+ new PanelDef("sip", "SIP", "accordion-icon.gif", "SIP (Session Initiation Protocol) Configuration"),
+
+ new PanelDef("iax", "IAX", "accordion-icon.gif", "IAX (Inter-Asterisk eXchange Protocol) Configuration"),
+
+ new PanelDef("jabber", "Jabber", "accordion-icon.gif", "Jabber users configuration"),
+
+ new PanelDef("jingle", "Jingle", "accordion-icon.gif", "Jingle configuration lets users connect to google talk networks"),
+
+ new PanelDef("zapata", "Zap Channel", "accordion-icon.gif", "Zapata telephony interface configuration")
);
-
- function setLoggedOn(onoff) {
- loggedon = onoff;
- if (loggedon == 1) {
- for (var i = 0; i < panels.length; i++) {
- if (panels[i].name == 'home'){
- continue;
- }
- $(panels[i].name).onclick = $(panels[i].name).realonclick;
- $(panels[i].name).onmouseover = $(panels[i].name).realonmouseover;
- $(panels[i].name).style.visibility = 'inherit';
- }
- } else {
- for (var i = 0; i < panels.length; i++) {
- if (panels[i].name == 'home'){
- // class :: accordionTabContentBox panelHeight = 474;
- continue;
- }
- $(panels[i].name).onClick = false;
- $(panels[i].name).onMouseOver = false;
- $(panels[i].name).style.visibility = 'hidden';
-
- }
- }
- }
-
- function loadscreen(srcbody) {
- $('mainscreen').style.display = '';
- new Rico.Effect.FadeTo($('mainscreen'), 1, 100, 1);
- if (loggedon == 1)
- astmanEngine.pollEvents();
- }
- function finishfade(page) { $('mainscreen').style.display = "none"; }
- function setstatus(status) { $('status').innerHTML = copyright + status; }
- function showmainscreen(page) {
- if (started) {
- var opt = {
- method: 'get',
- asynchronous: true,
- onComplete: function (originalRequest){
- if ( originalRequest.responseText.match("Error") ) {
- window.location.href=window.location.href;
- return ;
- }
- if ( originalRequest.responseText.match("Pong") ) {
- $('mainscreen').src = page.titleBar.id + ".html";
- }
- }
- };
- opt.parameters="action=ping" ;
- var tmp = new Ajax.Request("../../rawman" , opt);
- //$('mainscreen').src = page.titleBar.id + ".html";
- }
- }
-
-
-
- function fademainscreen(page, newpage) {
- // Confirm Discard Changes goes here
- $('tooltip').innerHTML = tooltip_default;
- new Rico.Effect.FadeTo($('mainscreen'), 0, 100, 5, {complete:finishfade(page)});
- }
-
- function show_Acctooltip(name, tip){
- if( loggedon != 1){ return; }
- new Rico.Effect.FadeTo( 'tooltip_round', .01, 100, 10, {
- complete:function() {
- $('tooltip').innerHTML = tip ;
- new Rico.Effect.FadeTo( 'tooltip_round', 1, 10, 1, {complete:function() { } } );
- }
- } );
- }
-
- function registerajax() {
- Rico.Corner.round('tooltip_round', {compact:true});
- if( navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Konqueror") != -1 || navigator.userAgent.indexOf("Safari") != -1 ){
- gui_alert(browser_alert);
- }
- var pnameheight = 22;
- var pheight = (503 - (pnameheight*panels.length) ) ;
- accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
- //$('borderbox').style.height = $('screenholder').clientHeight;
- //$('titlebar').style.width = $('borderbox').clientWidth - 12;
- for (var i = 0; i < panels.length; i++) {
- if (panels[i].name == 'home'){
- $(panels[i].name).style.height = "19px";
- continue;
- }
- $(panels[i].name).realonclick = $(panels[i].name).onclick;
- $(panels[i].name).realonmouseover = $(panels[i].name).onmouseover;
- }
- started = 1;
- }
-
- astmanEngine.setURL('../../rawman');
- astmanEngine.setEventCallback(eventeater.eventcb);
-
-
- function Logoff() {
- var t=confirm("Are you sure ?");
- if(t == false)
- return true;
- var opt2 = {
+}
+
+
+function setLoggedOn(onoff) {
+ loggedon = onoff;
+ for (var i = 0; i < panels.length; i++) {
+ if (panels[i].name == 'home'){continue;}
+ var w = _$(panels[i].name);
+ w.onClick = (loggedon == 1)?w.realonclick: false;
+ w.onMouseOver = (loggedon == 1)?w.realonmouseover:false;
+ w.style.visibility = (loggedon == 1)?'inherit':'hidden';
+ }
+}
+
+function loadscreen(srcbody) {
+ _$('mainscreen').style.display = '';
+ if (loggedon == 1){ astmanEngine.pollEvents(); }
+}
+
+function setstatus(status) { _$('status').innerHTML = copyright + status; }
+function showmainscreen(page) {
+ if (started) {
+ var opt = {
method: 'get',
asynchronous: true,
- onSuccess: function() {
- setLoggedOn(0);
- loggedon == -1;
- // reload the browser URL
+ onComplete: function (originalRequest){
+ if ( originalRequest.responseText.match("Error") ) {
window.location.href=window.location.href;
- },
- onFailure: function(t) {
- gui_alert("Config Error: " + t.status + ": " + t.statusText);
+ return ;
+ }
+ if ( originalRequest.responseText.match("Pong") ) {
+ _$('mainscreen').src = page.titleBar.id + ".html";
+ }
}
};
- opt2.parameters ="action=logoff";
- var tmp2 = new Ajax.Request("../../rawman", opt2);
- }
-
- function system_link(){
- var newwindow_href = location.protocol + '//' + location.hostname + ':8003';
- window.open(newwindow_href ,'mainwindow','width=1024,height=768,resizable=no, scrollbars=no, toolbar=no, location=no,status=yes, menubar=no')
- }
-
+ opt.parameters="action=ping" ;
+ var tmp = new Ajax.Request("../../rawman" , opt);
+ //$('mainscreen').src = page.titleBar.id + ".html";
+ }
+}
+
+function fademainscreen(page, newpage) {
+ // Confirm Discard Changes goes here
+ _$('tooltip').innerHTML = tooltip_default;
+ _$('mainscreen').style.display = "none";
+}
+
+function show_Acctooltip(name, tip){
+ if( loggedon != 1){ return; }
+ _$('tooltip').innerHTML = tip ;
+
+}
+
+function registerajax() {
+ Rico.Corner.round('tooltip_round', {compact:true});
+ // if you want google style feedback boxes :-)
+ // _$('feedback_round').style.backgroundColor = "#EFEFEF";
+ // Rico.Corner.round('feedback_round', {compact:true});
+
+ if( navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Konqueror") != -1 || navigator.userAgent.indexOf("Safari") != -1 ){
+ gui_feedback(browser_alert, 'green');
+ }
+ var pnameheight = 22;
+ var pheight = (503 - (pnameheight*panels.length) ) ;
+ accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
+ //$('borderbox').style.height = $('screenholder').clientHeight;
+ //$('titlebar').style.width = $('borderbox').clientWidth - 12;
+ for (var i = 0; i < panels.length; i++) {
+ var w = _$(panels[i].name) ;
+ if (panels[i].name == 'home'){
+ w.style.height = "19px";
+ continue;
+ }
+ w.realonclick = w.onClick;
+ w.realonmouseover = w.onMouseOver;
+ }
+ started = 1;
+}
+
+astmanEngine.setURL('../../rawman');
+astmanEngine.setEventCallback(eventeater.eventcb);
+
+function Logoff() {
+ if(!confirm("Are you sure ?")){ return true; }
+ var opt2 = {
+ method: 'get',
+ asynchronous: true,
+ onSuccess: function() {
+ setLoggedOn(0);
+ loggedon == -1;
+ // reload the browser URL
+ window.location.href=window.location.href;
+ },
+ onFailure: function(t) {
+ gui_alert("Config Error: " + t.status + ": " + t.statusText);
+ }
+ };
+ opt2.parameters ="action=logoff";
+ var tmp2 = new Ajax.Request("../../rawman", opt2);
+}
+
+function system_link(){
+ var newwindow_href = location.protocol + '//' + location.hostname + ':8003';
+ window.open(newwindow_href ,'mainwindow','width=1024,height=768,resizable=no, scrollbars=no, toolbar=no, location=no,status=yes, menubar=no')
+}
+
+function reloadConfig(){
+ _$('reloadconfig').style.display = 'none';
+ window.setTimeout( function(){ _$('reloadconfig').style.display=""; }, asterisk_guifbt );
+ var opt = {
+ method: 'get',
+ asynchronous: true,
+ onSuccess: function(t) { gui_feedback("Restarted Asterisk !!",'blue'); } ,
+ onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
+ };
+ var uri = parent.build_action('renamecat', 0, "","", "", "");
+ opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+ var tmp = new Ajax.Request("../../rawman", opt);
+}
</script>
<head>
<title>Asterisk Configuration GUI (Beta)</title>
@@ -231,52 +239,57 @@
</head>
<body onload="registerajax( )" topmargin=1>
<table border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="#dddddd" width=950 height=570>
-<tr height=47><td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
- <td valign='bottom' align='right' bgcolor='white' colspan=2>
- <a href="#" onclick=" system_link()">System Configuration</a> |
- <a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a> |
- <a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a> |
- <a target='_extern' href="http://www.asterisknow.org/help">Help</a>
- <input type="hidden" id="login_name">
- </td>
+<tr height=47>
+ <td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
+ <td valign='middle' align='center' bgcolor='white'>
+ <div id="feedback_round" style="display:none;background-color: #FFFFFF; width:400px">
+ <div id='feedback' style="font-family: Arial, sans-serif, Helvetica, Trebuchet MS ;font-size: 13px;font-weight : bold;"></div>
+ </div>
+
+ </td>
+ <td valign='bottom' align='right' bgcolor='white'>
+ <!-- <a href="#" onclick=" system_link()">System Configuration</a> | -->
+ <a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a> |
+ <a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a> |
+ <a target='_extern' href="http://www.asterisknow.org/help">Help</a>
+ <input type="hidden" id="login_name">
+ </td>
</tr>
-<tr><td height="505"><div id="configpanel" style="width:150px; height: 505px;">
- <script>
- for (var i = 0; i < panels.length; i++) {
- document.write("<div onmouseover='show_Acctooltip(\""+ panels[i].name +"\", \""+ panels[i].content +"\")' onmouseout='show_Acctooltip(\""+ panels[i].name +"\", \"" + tooltip_default +"\")'>");
- document.write(" <div id='" + panels[i].name + "' class='accordionTabTitleBar'>");
- document.write(" <nobr><img style='vertical-align:middle' src='images/" + panels[i].icon + "'>");
- document.write(" <span style='margin-left: 0px;font-weight:bold'>" + panels[i].label + "</span></nobr>");
- document.write(" </div>");
- document.write(" <div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>");
- document.write(panels[i].content);
- document.write(" </div>");
- document.write("</div>");
- }
- </script>
- </div>
- </td>
- <td width="550" height="505" bgcolor="#EFEFEF" valign="top" id="screenholder">
- <div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:48px">
- <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>
- </td>
- <td valign=top width=250 height="505">
- <div id="logoutlink" class="mainscreenTooltipBar" align=right style="font-weight:bold;cursor: pointer; cursor: hand;"> </div>
- <div id="tooltip_round" class="tooltip_round">
- <div id='tooltip' style="margin-left:4px; height:100px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
- </div>
- <BR><BR>
- <center>
- <div id="buynow_div"></div>
- </center>
- </td>
+<tr><td height="505">
+ <div id="configpanel" style="width:150px; height: 505px;">
+ <script>
+ for (var i = 0; i < panels.length; i++) {
+ var t = "<div onmouseover='show_Acctooltip(\""+ panels[i].name +"\", \""+ panels[i].content +"\")' onmouseout='show_Acctooltip(\""+ panels[i].name +"\", \"" + tooltip_default +"\")'>";
+ t += " <div id='" + panels[i].name + "' class='accordionTabTitleBar'>";
+ t += " <nobr><img style='vertical-align:middle' src='images/" + panels[i].icon + "'>";
+ t += " <span style='margin-left: 0px;font-weight:bold'>" + panels[i].label + "</span></nobr>";
+ t += " </div>";
+ t += " <div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>" + panels[i].content + "</div>";
+ t += "</div>";
+ document.write(t);
+ }
+ </script>
+ </div>
+ </td>
+ <td width="550" height="505" bgcolor="#EFEFEF" valign="top" id="screenholder">
+ <div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:48px">
+ <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>
+ </td>
+ <td valign=top width=250 height="505">
+ <div class="mainscreenTooltipBar" align=right>
+ <span id="reloadconfig" style="display:none"></span> <span id="logoutlink" style="display:none"></span>
+ </div>
+ <div id="tooltip_round" class="tooltip_round">
+ <div id='tooltip' style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
+ </div>
+ </td>
</tr>
<tr><td colspan="3" align=center height=18>
<div id="status" class="statusbar">Copyright ©2006-2007 Digium, Inc. Digium® and Asterisk® are registered <a href="http://www.digium.com/en/company/profile/trademarkpolicy.php">trademarks</a> of Digium, Inc. All Rights Reserved. <i><a href="#">Legal Information</a></i></div>
</td>
</tr>
</table>
-</body>
+</body>
Modified: branches/asterisknow/config/guialert.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/guialert.html?view=diff&rev=489&r1=488&r2=489
==============================================================================
--- branches/asterisknow/config/guialert.html (original)
+++ branches/asterisknow/config/guialert.html Mon Mar 26 14:20:37 2007
@@ -17,28 +17,28 @@
</script>
<head>
</head>
-<body onload="update( )" topmargin=0 leftmargin=0 style="background-color: transparent">
- <div id="div_alert" STYLE="display:none; position: absolute; left: 260; top: 180; width:360; background-color:#FFFFFF; border-width: 2px; border-color: #7E5538; border-style: solid; background-style: solid;">
- <table width="100%" cellpadding=0 cellspacing=0>
- <TR bgcolor="#7E5538" style="background-image:url('images/title_gradient.gif');">
- <TD Height="20" align="center">
- <font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">Alert !</font>
- </TD>
- <TD Height="20" align="right">
- <A href="#" onclick="close_guialert();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
- </TD>
- <TD width=4></TD>
- </TR>
- </table>
- <TABLE cellpadding=0 cellspacing=3 border=0 width="100%">
- <TR><TD colspan=2 height=10></TD></TR>
- <TR><TD align="right"></TD>
- <TD align="center" bgcolor="#FFFFFF"><div id='message'></div> </TD>
- </TR>
- <TR><TD colspan=2 height=10></TD></TR>
- <TR> <TD align="center" colspan=2> <input type="button" id="ok" onclick="close_guialert()" value="Ok"> </TD>
- <TR><TD colspan=2 height=10></TD></TR>
- </TR>
- </TABLE>
- </div>
+<body onload="update()" topmargin=0 leftmargin=0 style="background-color: transparent; cursor: not-allowed">
+ <div id="div_alert" STYLE="display:none; position: absolute; left: 260; top: 180; width:360; background-color:#FFFFFF; border-width: 2px; border-color: #7E5538; border-style: solid; background-style: solid; cursor: default">
+ <table width="100%" cellpadding=0 cellspacing=0>
+ <TR bgcolor="#7E5538" style="background-image:url('images/title_gradient.gif');">
+ <TD Height="20" align="center">
+ <font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">Alert !</font>
+ </TD>
+ <TD Height="20" align="right">
+ <A href="#" onclick="close_guialert();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
+ </TD>
+ <TD width=4></TD>
+ </TR>
+ </table>
+ <TABLE cellpadding=0 cellspacing=3 border=0 width="100%">
+ <TR><TD colspan=2 height=10></TD></TR>
+ <TR><TD align="right"></TD>
+ <TD align="center" bgcolor="#FFFFFF"><div id='message'></div> </TD>
+ </TR>
+ <TR><TD colspan=2 height=10></TD></TR>
+ <TR> <TD align="center" colspan=2> <input type="button" id="ok" onclick="close_guialert()" value="Ok"> </TD>
+ <TR><TD colspan=2 height=10></TD></TR>
+ </TR>
+ </TABLE>
+ </div>
</body>
Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=489&r1=488&r2=489
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Mon Mar 26 14:20:37 2007
@@ -23,191 +23,164 @@
<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 demo = new Object;
- var localloggedon = -1;
- var asterisk_guitools = parent.asterisk_guitools;
-
- function updateButtons()
- {
- if (parent.loggedon) {
- $('username').disabled = 1;
- $('secret').disabled = 1;
- $('logoff').disabled = 0;
- $('reloadconfig').disabled = 0;
- $('login').disabled = 1;
- } else {
- $('username').disabled = 0;
- $('secret').disabled = 0;
- $('logoff').disabled = 1;
- $('reloadconfig').disabled = 1;
- $('login').disabled = 0;
- try{ $('username').focus(); }catch(err){ }
- }
- }
-
- function loggedOn() {
- if ((parent.loggedon == 1) && (localloggedon == 1))
- return;
- if($('secret').value=="password"){
- parent.loggedon = 1;
- localloggedon = 1;
- parent.document.getElementById('logoutlink').innerHTML = "Logout";
- parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
- parent.gui_alert("You are using the default password provided by AsteriskNOW !! \n\n It is strongly recommended that you change your default password ");
- window.location.href="options.html";
- return;
- }
-
- //if(!asterisk_guitools || !correct version || !hasSetup ){
- // redirect to setup
- //}
-
- if( parent.asterisk_guitools_inextconf == 0){
- checkessentials();
- }
-
- parent.setLoggedOn(1);
+var demo = new Object;
+var localloggedon = -1;
+var asterisk_guitools = parent.asterisk_guitools;
+
+function updateButtons(){
+ var f = parent.loggedon;
+ _$('username').disabled = (f)?1:0;
+ _$('secret').disabled = (f)?1:0;
+ _$('logoff').disabled = (f)?0:1;
+ _$('login').disabled = (f)?1:0;
+ if(!f){ try{ _$('username').focus();}catch(err){ } }
+}
+
+function loggedOn() {
+ if ((parent.loggedon == 1) && (localloggedon == 1)){ return; }
+ if(_$('secret').value=="password"){
parent.loggedon = 1;
localloggedon = 1;
- $('username').className = "input9_disabled";
- $('secret').className = "input9_disabled";
- updateButtons();
- $('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
- parent.document.getElementById('logoutlink').innerHTML = "Logout";
- parent.document.getElementById('logoutlink').onclick = parent.Logoff ;
- }
-
- function loggedOff() {
- if ((parent.loggedon == 0) && (localloggedon == 0))
- return;
- parent.setLoggedOn(0);
- parent.document.getElementById('logoutlink').innerHTML = " ";
- localloggedon = 0;
- $('username').className = "input9";
- $('secret').className = "input9";
[... 15329 lines stripped ...]
More information about the asterisk-gui-commits
mailing list