📄 3.html
字号:
<!--
* Asterisk-GUI - an Asterisk configuration interface
*
* Setup WIzard/ Local Extension Preferences
*
* Copyright (C) 2006-2007, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
* Pari Nannapaneni <pari@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*
-->
<HTML>
<HEAD>
<TITLE> Asterisk GUI Setup Wizard</TITLE>
<link href="setup.css" media="all" rel="Stylesheet" type="text/css" />
</HEAD>
<script src="../scripts/prototype.js"></script>
<SCRIPT>
var rawman_url;
var usercallbacks = new Object;
var fieldnames = new Array( 'save','userbase','localextenlength','allow_aliasextns');
var widgets = {};
var go = "";
var nextpage = "4.html";
var prevpage = "1.html";
function localinit(){
var focus_fields = [ 'localextenlength','userbase' ];
for( var r =0; r < focus_fields.length ; r++ ){
var d = _$(focus_fields[r]);
d.onfocus = function(){ this.className = 'input9_hilight'; }
d.onblur = function(){ this.className = 'input9'; }
}
parent._$('next').disabled = true;
parent._$('next').onclick = function(){
if( !_$('save').disabled ){
go = nextpage;
_$('save').click();
}else{
window.location.href=nextpage;
}
};
parent._$('back').disabled = true;
parent._$('back').onclick = function(){
if( !_$('save').disabled ){
go = prevpage;
_$('save').click();
}else{
window.location.href=prevpage;
}
};
rawman_url = parent.rawman_url ;
parent.astmanEngine.setURL(rawman_url);
_$('localextenlength').addEventListener("change", update_spae, false);
ping();
}
function ping(){
var opt = {
method: 'get',
asynchronous: true,
onComplete: isloggedin
};
opt.parameters="action=ping" ;
var tmp = new Ajax.Request(rawman_url , opt);
}
function isloggedin(originalRequest){
if ( originalRequest.responseText.match("Error") ) {
// User is not logged in , show him the login screen
parent.window.location.href = parent.window.location.href ;
}
if ( originalRequest.responseText.match("Pong") ) {
// read users.conf to get localextenlength and userbase
for (var x =0 ; x < fieldnames.length ; x++ ) {
widgets[fieldnames[x]] = _$(fieldnames[x]);
widgets[fieldnames[x]].disabled = true;
}
parent.astmanEngine.config2list("users.conf", _$('devices'),widgets, usercallbacks);
}
}
usercallbacks.format = function(t) {
if(t.name == "general" ){
return t.name;
}
return null;
}
usercallbacks.savechanges = function(){
window.location.href= go;
}
usercallbacks.beforeSaving= function(){
if( _$('localextenlength').value != _$('userbase').value.length ){
alert("'length of Local Extensions' does not match \n the 'length of the Starting point of Allocation'");
return false;
}
return true;
}
usercallbacks.loaded = function(){
_$('localextenlength').addEventListener("change", store_extlength, false);
parent.astmanEngine.pollEvents();
_$('devices').selectitem(0);
parent._$('next').disabled = false;
parent._$('back').disabled = false;
if ( typeof _$('devices').stored_config.catbyname['general'].fieldbyname['localextenlength'] == "undefined" ){
var opt = {
method: 'get',
asynchronous: true,
onSuccess: function(t) {
_$('localextenlength').selectedIndex = 2 ;
parent.localextenlength = 4 ;
},
onFailure: function(t) {
alert("Config Error: " + t.status + ": " + t.statusText);
}
};
opt.parameters="action=updateconfig&srcfilename=" + encodeURIComponent("users.conf") + "&dstfilename=" + encodeURIComponent("users.conf") + "&Action-000000=update&Cat-000000=general&Var-000000=localextenlength&Value-000000=4"; ;
var tmp = new Ajax.Request(rawman_url, opt);
}
}
function store_extlength(){
parent.localextenlength = _$('localextenlength').value ;
parent.userbase = _$('userbase').value ;
}
function update_spae(){
if( _$('localextenlength').value == _$('userbase').value.length ) return;
if( _$('localextenlength').value < _$('userbase').value.length ){
_$('userbase').value = _$('userbase').value.substr(0,_$('localextenlength').value);
return;
}
if( _$('localextenlength').value > _$('userbase').value.length ){
while ( _$('localextenlength').value != _$('userbase').value.length ){
_$('userbase').value = _$('userbase').value + "0" ;
}
}
}
</SCRIPT>
<BODY bgcolor="#FFFFFF" onload="localinit()" topmargin=0 leftmargin=0 onunload="store_extlength()">
<table width="100%" height="100%" border=0 cellpadding=0 cellspacing=0>
<tr> <td width="190" valign=top align=left>
<div id="menu">
<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
<tr><td width=3></td><td>Start</td></tr>
<tr><td></td><td>Verify Analog Ports</td></tr>
<!-- <tr><td></td><td>Date & Time</td></tr> -->
<tr><td></td><td class="slselected">Local Extension Settings</td></tr>
<tr><td></td><td>Service Providers</td></tr>
<tr><td></td><td>Calling Rules</td></tr>
<tr><td></td><td>VoiceMail Settings</td></tr>
<tr><td></td><td>User Extensions</td></tr>
<tr><td></td><td>Incoming Calls</td></tr>
<!-- <tr><td></td><td>VoiceMenus</td></tr> -->
<tr><td></td><td>Finish</td></tr>
</table>
</div>
</td>
<td valign=top align=center>
<!-- this page -->
<select id="devices" style="display:none"></select>
<input type=button id="save" value="Submit" style="display:none">
<div class="heading">Step 2 of <script>document.write(parent.numberofsteps);</script> - Local Extension Settings</div>
<p class="subheading"> Local Extensions are
<select id="localextenlength" class="input9">
<option value="2">2</option>
<option value="3">3</option>
<option value="4" selected>4</option>
<option value="5">5</option>
</select> digits long
</p>
<p class="subheading">First Extension Number : <input type=text id="userbase" size=5 dfalt="6000" class="input9"> </p>
<p class="subheading"><input type=checkbox id="allow_aliasextns"> Allow analog phones to be assigned to multiple extensions</p>
<!-- this page -->
</td>
</tr>
</table>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -