⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localexts.html

📁 asterisk 的图形管理界面
💻 HTML
字号:
<!--
 * Asterisk-GUI	-	an Asterisk configuration interface
 *
 * 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.
 *
-->
<script src="scripts/prototype.js"></script>
<script src="scripts/rico.js"></script>
<script src="scripts/astman.js"></script>
<script src="scripts/tooltip.js"></script>
<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 usercallbacks = new Object;
var fieldnames = ['allow_aliasextns', 'allow_an_extns', 'callwaiting', 'cancel', 'hasagent', 'hasdirectory', 'hasiax', 'hasmanager', 'hassip', 'hasvoicemail', 'localextenlength', 'save', 'threewaycalling', 'userbase', 'vmsecret'];
var widgets = {};


function tosetup(){
	parent.window.location.href = "./setup/install.html";
}

usercallbacks.format =  function(t) {
	if(t.name == "general" ){ return t.name; }
	return null;
}

usercallbacks.savechanges = function(){
	//
}

usercallbacks.beforeSaving= function(){
	if( _$('localextenlength').value != "0" && _$('localextenlength').value != _$('userbase').value.length ){
		gui_feedback("'length of Local Extensions' does not match <BR> the length of 'First Extension number'");
		return false;
	}

	return true;
}

usercallbacks.loaded = function(){
	var d = _$('devices') ; 
	d.selectitem(0);
	
	if ( typeof d.stored_config.catbyname['general'].fieldbyname['localextenlength'] == "undefined" ){ 
		var opt = {
			method: 'get',
			asynchronous: true,
			onSuccess: function(t) { 
				_$('localextenlength').selectedIndex = 2 ;
				parent.loadscreen(this);
			},
			onFailure: function(t) {
				gui_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(asterisk_rawmanPath , opt);
		return;
	}
	parent.loadscreen(this);
}


function localajaxinit(){
	setWindowTitle("Local Extension Settings");
	for (var x =0 ; x < fieldnames.length ; x++ ) {
		widgets[fieldnames[x]] = _$(fieldnames[x]);
		widgets[fieldnames[x]].disabled = true;
	}

	add_event( _$('localextenlength') , 'change' , update_spae ) ;
	parent.astmanEngine.config2list("users.conf", _$('devices'),widgets, usercallbacks);
}


function update_spae(){
	var lel = _$('localextenlength');
	var ub = _$('userbase') ;

	if( lel.value == "0" ) { return; }

	if( lel.value == ub.value.length ) { 
		return;
	}else if( lel.value < ub.value.length ){
		ub.value = ub.value.substr(0,lel);
		return;
	}else if( lel.value > ub.value.length ){
		while ( lel.value != ub.value.length  ){ ub.value = ub.value + "0" ; }
	}
}

function free_mem( ){
	if( navigator.userAgent.indexOf("MSIE") == -1 ){ return true; }
	try{
		widgets['save'].hostselectbox = null ;
		widgets['cancel'].hostselectbox = null ;
		purge( document.body );
	} catch(e){ }
}

function basicadvanced(){
	var _url = "";
	if(top.window.location.href.match("advanced=yes") ){ _url = "./cfgbasic.html"; }else{ _url = "./cfgbasic.html?advanced=yes" }
	parent.window.location.href = _url ;
}

</script>
<body id="foo" onload="localajaxinit()" bgcolor="EFEFEF"  onunload="free_mem()">
<div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options - Local Extension Settings</span></div>
<div class="mainscreenContentBox" id="userscontent">
<TABLE align=center width="520" cellpadding=0 cellspacing=0 style="margin: 5px 0 0 0;">
<TR>
	<TD valign="bottom" align="center" class="tab"><a href="#" class="tabselected">Local Extension settings</a></TD>
	<TD><a href="options.html" class="tab">Change Password</a></TD>
	<TD valign="bottom" align="left">
		<a href="#" class="tab" onclick="basicadvanced();">
		<script>
			if( top.window.location.href.match("advanced=yes") ){ document.write("Basic"); }else{ document.write("Advanced"); }
		</script>
		</a>
	</TD>
	<TD valign="bottom" align="left"><a href="#" class="tab" onclick="tosetup();">Run Setup Wizard</a></TD> 
</TR>
</TABLE>
<BR>
<table class="mainscreenTable" align="center">
<tr>	
<td align="center" valign="top">
	<select id="devices" style="display:none"></select> 
	<fieldset  style="width: 400px">
		<legend>&nbsp;Local Extension Settings:&nbsp;</legend>
		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
		<tr ><td class="field_text" align=left>
			Local Extensions are 
			<select id="localextenlength" class="input9">
			<option value="2">2 digits</option>
			<option value="3">3 digits</option>
			<option value="4">4 digits</option>
			<option value="5">5 digits</option>
			<option value="0">Varying</option>
			</select>&nbsp;</td>
		</tr>
		<tr><td class="field_text" align=left>First Extension Number : <input type=text id="userbase" size=5  class="input9"></td></tr>
		<tr><td class="field_text" align="left"><input type=checkbox id="allow_aliasextns">Allow analog phones to be assigned to multiple extensions</td></tr>
		<tr><td class="field_text" align="left"><input type=checkbox id="allow_an_extns">Allow extensions to be AlphaNumeric (SIP/IAX users)</td></tr>
		</table>
	</fieldset><BR>
	<fieldset style="width: 400px">
		<legend>&nbsp;Default Settings for a New User:&nbsp;</legend>
		<table align='center'  width='390'  cellpadding=2 cellspacing=1>
		<tr>	<td onmouseover="show_tooltip('en', 'users', 15);" class="field_text" align="right"><input type='checkbox' id='hasagent'></td>
			<td onmouseover="show_tooltip('en', 'users', 15);" class="field_text" >Is Agent</td>
			<td onmouseover="show_tooltip('en', 'users', 8);" align=right><input type='checkbox' id='hasvoicemail'></td>
			<td onmouseover="show_tooltip('en', 'users', 8);" class="field_text" align="left">Voicemail</td>
		</tr>
		<tr>	<td onmouseover="show_tooltip('en', 'users', 9);" class="field_text" align="right"><input type='checkbox' id='hasdirectory'></td>
			<td onmouseover="show_tooltip('en', 'users', 9);" class="field_text" >In Directory</td>
			<td onmouseover="show_tooltip('en', 'users', 12);" align=right><input type='checkbox' id='hasmanager'></td>
			<td onmouseover="show_tooltip('en', 'users', 12);" class="field_text" align="left">CTI</td>
		</tr>
		<tr>	<td onmouseover="show_tooltip('en', 'users', 10);" class="field_text" align="right"><input type='checkbox' id='hassip'></td>
			<td onmouseover="show_tooltip('en', 'users', 10);"  class="field_text" >SIP</td>
			<td onmouseover="show_tooltip('en', 'users', 11);" align=right><input type='checkbox' id='hasiax'></td>
			<td onmouseover="show_tooltip('en', 'users', 11);" class="field_text" align="left">IAX</td>
		</tr>
		<tr>	<td onmouseover="show_tooltip('en', 'users', 13);" class="field_text" align="right"><input type='checkbox' id='callwaiting'></td>
			<td onmouseover="show_tooltip('en', 'users', 13);" class="field_text" >Call Waiting</td>
			<td onmouseover="show_tooltip('en', 'users', 14);" align=right><input type='checkbox' id='threewaycalling'></td>
			<td onmouseover="show_tooltip('en', 'users', 14);" class="field_text" align="left">3-Way&nbsp;Calling</td>
		</tr>
		<tr>	<td onmouseover="show_tooltip('en', 'users', 16);" align=right><input size='3' id='vmsecret' pattern='^[0-9*]*$'  class="input9">&nbsp;</td>
			<td onmouseover="show_tooltip('en', 'users', 16);" class="field_text" align="left">VoiceMail Password</td>
			<td align=right></td>
			<td  class="field_text" align="left"></td>
		</tr>
		</table>
	</fieldset>
	<center>
		<div height=10></div><BR>
		<input type=button id="save" value="Save">&nbsp;&nbsp;<input type=button id="cancel" value="Cancel">
	</center>
</td>
</tr>
<tr valign="top" height="18"><td></td></tr>
</table>
</div>
</body>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -