From f225d460dc187b16ea522ff1e5b302ece2e7a498 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Tue, 8 Mar 2011 01:31:53 +0000 Subject: [PATCH] initial import of V2 mini asterisk GUI git-svn-id: https://svn.code.sf.net/p/freetel/code@277 01035d8c-6547-0410-b346-abe4f91aad63 --- mini-asterisk-gui2/README.txt | 15 ++ mini-asterisk-gui2/cgi-bin/asterisk.cgi | 25 +++ mini-asterisk-gui2/cgi-bin/fpingnodes.cgi | 24 +++ mini-asterisk-gui2/cgi-bin/getconf.cgi | 28 +++ mini-asterisk-gui2/cgi-bin/ifconfig.cgi | 24 +++ mini-asterisk-gui2/cgi-bin/setline.cgi | 24 +++ mini-asterisk-gui2/cgi-bin/smokeping.cgi | 81 ++++++++ mini-asterisk-gui2/cross.png | Bin 0 -> 959 bytes mini-asterisk-gui2/menu.js | 63 ++++++ mini-asterisk-gui2/minicommon.js | 242 ++++++++++++++++++++++ mini-asterisk-gui2/ministyle.css | 70 +++++++ mini-asterisk-gui2/network.html | 53 +++++ mini-asterisk-gui2/network.js | 112 ++++++++++ mini-asterisk-gui2/phones.html | 29 +++ mini-asterisk-gui2/phones.js | 110 ++++++++++ mini-asterisk-gui2/tick.png | Bin 0 -> 1045 bytes mini-asterisk-gui2/tooltip.css | 7 + mini-asterisk-gui2/tooltip.js | 7 + 18 files changed, 914 insertions(+) create mode 100644 mini-asterisk-gui2/README.txt create mode 100755 mini-asterisk-gui2/cgi-bin/asterisk.cgi create mode 100755 mini-asterisk-gui2/cgi-bin/fpingnodes.cgi create mode 100755 mini-asterisk-gui2/cgi-bin/getconf.cgi create mode 100755 mini-asterisk-gui2/cgi-bin/ifconfig.cgi create mode 100755 mini-asterisk-gui2/cgi-bin/setline.cgi create mode 100755 mini-asterisk-gui2/cgi-bin/smokeping.cgi create mode 100644 mini-asterisk-gui2/cross.png create mode 100644 mini-asterisk-gui2/menu.js create mode 100644 mini-asterisk-gui2/minicommon.js create mode 100644 mini-asterisk-gui2/ministyle.css create mode 100644 mini-asterisk-gui2/network.html create mode 100644 mini-asterisk-gui2/network.js create mode 100644 mini-asterisk-gui2/phones.html create mode 100644 mini-asterisk-gui2/phones.js create mode 100644 mini-asterisk-gui2/tick.png create mode 100644 mini-asterisk-gui2/tooltip.css create mode 100644 mini-asterisk-gui2/tooltip.js diff --git a/mini-asterisk-gui2/README.txt b/mini-asterisk-gui2/README.txt new file mode 100644 index 00000000..43518a6b --- /dev/null +++ b/mini-asterisk-gui2/README.txt @@ -0,0 +1,15 @@ +Mini Asterisk GUI Version 2 +=========================== + +Rewrite of original concept using Javascript. + +TODO +---- + +[ ] fping ipkg dependancy +[ ] blog post + + javascript with firebox is a joy to debug + + cf server side, CGIs + + keep CGIs really small, very productive + + BASIC style string processing versus regexp + diff --git a/mini-asterisk-gui2/cgi-bin/asterisk.cgi b/mini-asterisk-gui2/cgi-bin/asterisk.cgi new file mode 100755 index 00000000..74d163b9 --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/asterisk.cgi @@ -0,0 +1,25 @@ +#!/bin/sh +# asterisk.cgi +# David Rowe 22 Dec 2010 +# +# CGI to return the output from an Asterisk command line + +cat < + + + + + + +EOF + +CLI=`echo "$QUERY_STRING" | sed -n "s/.*cli=//p" | sed -n "s/%20/ /pg"` +asterisk -rx "$CLI" +echo hello +cat < + +EOF diff --git a/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi b/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi new file mode 100755 index 00000000..d0c19faf --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/fpingnodes.cgi @@ -0,0 +1,24 @@ +#!/bin/sh +# fpingnodes.cgi +# David Rowe 5 Dec 2010 +# +# CGI to fping a bunch of nodes + +cat < + + + + + +EOF + +ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"` +fping $ip -a -b1400 -r1 2>/dev/null + +cat < + +EOF diff --git a/mini-asterisk-gui2/cgi-bin/getconf.cgi b/mini-asterisk-gui2/cgi-bin/getconf.cgi new file mode 100755 index 00000000..c1115a3f --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/getconf.cgi @@ -0,0 +1,28 @@ +#!/bin/sh +# getconf.cgi +# David Rowe 12 Dec 2010 +# +# CGI to return an Asterisk conf file + +cat < + + + + + + +EOF + +CONF_PATH=/etc/asterisk +FILE=`echo "$QUERY_STRING" | sed -n "s/.*file=//p"` +if [ -f $CONF_PATH/$FILE ] ; then + cat $CONF_PATH/$FILE +fi + +cat < + +EOF diff --git a/mini-asterisk-gui2/cgi-bin/ifconfig.cgi b/mini-asterisk-gui2/cgi-bin/ifconfig.cgi new file mode 100755 index 00000000..98685c4f --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/ifconfig.cgi @@ -0,0 +1,24 @@ +#!/bin/sh +# asterisk.cgi +# David Rowe 3 March 2011 +# +# CGI to return the output from an Asterisk command line + +cat < + + + + + + +EOF + +arg=`echo "$QUERY_STRING" | sed -n "s/.*arg=//p"` +ifconfig $arg +cat < + +EOF diff --git a/mini-asterisk-gui2/cgi-bin/setline.cgi b/mini-asterisk-gui2/cgi-bin/setline.cgi new file mode 100755 index 00000000..610b997e --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/setline.cgi @@ -0,0 +1,24 @@ +#!/bin/sh +# setline.cgi +# David Rowe 12 Dec 2010 +# +# CGI to set the text on a particular line + +cat < + + + + + +EOF + +LINE=`echo "$QUERY_STRING" | sed -n "s/.*line=//p"` +echo $LINE + +cat < + +EOF diff --git a/mini-asterisk-gui2/cgi-bin/smokeping.cgi b/mini-asterisk-gui2/cgi-bin/smokeping.cgi new file mode 100755 index 00000000..6cac2404 --- /dev/null +++ b/mini-asterisk-gui2/cgi-bin/smokeping.cgi @@ -0,0 +1,81 @@ +#!/usr/bin/speedy -w +# -*-perl-*- + +use lib qw(/usr/share/perl5/smokeping); +use CGI::Carp qw(fatalsToBrowser); + +use Smokeping 2.003006; + +Smokeping::cgi("/etc/smokeping/config"); + +=head1 NAME + +smokeping.cgi - SmokePing webfrontend + +=head1 OVERVIEW + +This script acts as a 'website' for your SmokePing monitoring operation. It +presents the targets you are looking at in a tree structure and draws graphs +as they are required by people looking at the pages. + +=head1 DESCRIPTION + +To get B going, you need a webserver which allows you to run +cgi scripts. The system must be setup so that the B is +allowed to write to the image caching area as defined in the config file. + +This script runs with normal perl. B it will appear to be very slow, +because it does a lot of things when starting up. So if the script has to be +started a fresh on every click, this is both slow and a tough thing for your +webserver. I therefore strongly recomment using SpeedyCGI. + +Please refer to the installation document for detailed setup instructions. + +=head1 SETUP + +When installing SmokePing, this file has to be adjusted to fit your +local system. Three paths have to be entered. + + use lib qw(/usr/pack/rrdtool-1.0.33-to/lib/perl); + +One pointing to your B installation + + use lib qw(/home/oetiker/public_html/smokeping/lib); + +One pointing to the place where you have installed the SmokePing libraries + + use Smokeping; + + Smokeping::cgi("/home/oetiker/.smokeping/config"); + +The third path is the argument to the Smokeping::cgi command. It points to +the SmokePing configuration file. + +=head1 COPYRIGHT + +Copyright (c) 2001 by Tobias Oetiker. All right reserved. + +=head1 LICENSE + +This program is free software; you can redistribute it +and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be +useful, but WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public +License along with this program; if not, write to the Free +Software Foundation, Inc., 675 Mass Ave, Cambridge, MA +02139, USA. + +=head1 AUTHOR + +Tobias Oetiker Etobi@oetiker.chE + +=cut diff --git a/mini-asterisk-gui2/cross.png b/mini-asterisk-gui2/cross.png new file mode 100644 index 0000000000000000000000000000000000000000..05baecdbf71f9aae80e6d98952b09453ca17459f GIT binary patch literal 959 zcmV;w13>(VP)}DZ)(;L`xc8p- zy?f4g6n(V<3Yd31@AJ`expZJ;gq+q$vx#hPBT+;v2zU_$Y{qf4EAkoeMHSL6hw3A9 zf!qG!!yk^%%wSm-v|9VfOcWtuh%_1`VaR&3$v-0B0~e|g0a$&VeLXfk{ZaYM8LUD9 z<+@;5pgP|a0b_blX-cu(#xiEI0Vn6+o7*6|)8NJ7$;sI_PM=2Q^QdAGRVty69z_id zpz?X}Je22Q&CK9lx|E&EBW@mlZ_ff?n`rtv-`SVaJVeZ}~ zSzbos7-wMtJvD_{TVtnI!)$FKVTegnRv~J`n>O%)KR)i;whc*=;m8pvl>pGS8v4;A z^s!^;sVOjq-RsvuYm{vxmW57JhGC!%b2e~p(DyR|;ustUbMGG3!~_ftfl}D>^I+Qm zB+JW~hYz#&)j9)E0_t#11C_k%B0D>onqi1+Zj#)(g*<N$2!jSgjBGU7S>WP-i z6s~Bk^`MI5o;4&4F+qSleM)lkCN!HppDNo%6^ohDA{qM1famLQj-b>jx{!U6yb002ovPDHLkV1n%^yFCB^ literal 0 HcmV?d00001 diff --git a/mini-asterisk-gui2/menu.js b/mini-asterisk-gui2/menu.js new file mode 100644 index 00000000..3e2cb8d3 --- /dev/null +++ b/mini-asterisk-gui2/menu.js @@ -0,0 +1,63 @@ +/* + menu.js + David Rowe + Jan 4 2010 + + Function(s) to create main menu. Interesting to compare this to static HTML. +*/ + +var menuItems = [ + 'Phone System', + 'About', + 'Admin', + 'FAQ', + 'IP Phones', + 'Logout', + 'Network', + 'VOIP Line' +]; + +var menuTips = [ + 'phones_tip', + 'about_tip', + 'admin_tip', + 'faq_tip', + 'ipphones_tip', + 'logout_tip', + 'network_tip', + 'voipline_tip' +]; + +var menuToolTips = [ + '
Lists your phones and phone lines
', + '
Boring information like software version numbers
', + '
Change your password, reset the default settings, upgrade software
', + '
Frequently asked questions and links to further information
', + '
Set up your IP phones
', + '
I think you can work this one out....
', + '
Connect the phone system to your network and the Internet
', + '
Set up your VOIP phone line
' +]; + +function mainMenu() { + var html = ''; + + for(var i=0; i' + menuItems[i] + '' + "\n"; + } + + html += ''; + + document.getElementById('menu').innerHTML = html; +} diff --git a/mini-asterisk-gui2/minicommon.js b/mini-asterisk-gui2/minicommon.js new file mode 100644 index 00000000..3b2cb45b --- /dev/null +++ b/mini-asterisk-gui2/minicommon.js @@ -0,0 +1,242 @@ +/* + minicommon.js + David Rowe + Dec 16 2010 + + Common functions used by Mini Asterisk GUI. +*/ + +// index Zaptel port number (1,2,...), value extension (6001,6002...) + +var analog_ext = []; + +// zaptel port number (1,2,...), value FXS/FXO + +var zap = []; + +// all IP extensions, index ext, value true|false to indicate if live + +var ip_ext = []; + +function loadExtensions() { + + /* + Kick off cascading CGIs and callbacks to load analog and ip + extension data. + + From extensions.conf and zaptel.conf, determine which zap ports + are live and what type they are (FXS or FXO). + + From extensions.conf determine, asterisk -r sip show peers + to determine which sip extenions are live + + That will do for now...... + */ + + downloadUrl("/cgi-bin/getconf.cgi?file=../zaptel.conf", loadZapata); +} + +// remove leading and trailing whitespace from a string + +function trim(stringToTrim) { + return stringToTrim.replace(/^\s+|\s+$/g,""); +} + + +/* + Given extenions.conf lines like this: + + exten => 6011,1,Dial(SIP/6011) + exten => 6001,1,Dial(Zap/1) + exten => EXT,1,Dial(TECH1/TECH2) + + returns EXT, TECH1, TECH2 +*/ + +function parseDialPlan(line) { + var split1 = line.split(","); + var split2 = split1[0].split("=>"); + var ext = trim(split2[1]); + var tech = split1[2]; + var index1 = tech.indexOf('('); + var index2 = tech.indexOf('/'); + var index3 = tech.indexOf(')'); + + var tech1 = tech.substr(index1+1, index2-index1-1); + var tech2 = tech.substr(index2+1, index3-index2-1); + + return [ext,tech1,tech2]; +} + + +// called to process /etc/zapata.conf +// creates an associative array of active Zap ports + +function loadZapata(doc,status) { + loadHtmlTextFile( + doc, + function(line) { + + if (line.indexOf('fxoks') != -1) { + var split1 = line.split("="); + var ports = split1[1].split(","); + for(var i=0; i") != -1) && + (line.indexOf("mini_ext") != -1)) { + var ret = parseDialPlan(line); + var ext = ret[0]; + var tech1 = ret[1]; + var tech2 = ret[2]; + if (tech1 == "Zap") { + if (zap[tech2] == undefined) + analog_ext[tech2] = ""; + else + analog_ext[tech2] = ext; + } + if (tech1 == "SIP") { + ip_ext[ext] = ""; + } + } + } + ); + + // we get ip extensions from "sip show peer" at asterisk CLI + + downloadUrl("/cgi-bin/asterisk.cgi?cli=sip show peers", loadIpExtensions); +} + + +function parseSipShowPeers(line) { + var myregexp = /\s+/; + var s = line.split(myregexp); + var ext = s[0].substr(0,4); + var ip = s[1]; + if (ip_ext[ext] != undefined) { + if (line.indexOf("OK") != -1) + ip_ext[ext] = ip; + } +} + +// called to process asterisk CLI "sip show peers" +// creates an associative array of IP extensions + +function loadIpExtensions(doc,status) { + loadHtmlTextFile(doc, function(line) { + parseSipShowPeers(line); + } + ); + + initialisePage(); +} + + +// Load a html encoded text file, strips off the HTML tags +// and calls textLineProcessing() for every line + +function loadHtmlTextFile(doc, textLineProcessing) { + + var lines = doc.split("\n"); + var state = "looking for body"; + var next_state; + + for (var j in lines) { + next_state = state; + if (state == "looking for body") { + if (lines[j].indexOf('') != -1) + next_state = "body"; + } + if (state == "body") { + if (lines[j].indexOf('') != -1) + next_state = "finished"; + else { + // main processing of text here + textLineProcessing(lines[j]); + } + } + state = next_state; + } +} + + +/** + * Returns an XMLHttp instance to use for asynchronous + * downloading. This method will never throw an exception, but will + * return NULL if the browser does not support XmlHttp for any reason. + * @return {XMLHttpRequest|Null} + */ + +function createXmlHttpRequest() { + try { + if (typeof ActiveXObject != 'undefined') { + return new ActiveXObject('Microsoft.XMLHTTP'); + } else if (window["XMLHttpRequest"]) { + return new XMLHttpRequest(); + } + } catch (e) { + changeStatus(e); + } + return null; +}; + + +/** + * This functions wraps XMLHttpRequest open/send function. + * It lets you specify a URL and will call the callback if + * it gets a status code of 200. + * @param {String} url The URL to retrieve + * @param {Function} callback The function to call once retrieved. + */ +function downloadUrl(url, callback) { + var status = -1; + var request = createXmlHttpRequest(); + if (!request) { + return false; + } + + request.onreadystatechange = function() { + if (request.readyState == 4) { + try { + status = request.status; + } catch (e) { + // Usually indicates request timed out in FF. + } + if (status == 200) { + callback(request.responseText, request.status); + request.onreadystatechange = function() {}; + } + } + } + request.open('GET', url, true); + try { + request.send(null); + } catch (e) { + changeStatus(e); + } +}; diff --git a/mini-asterisk-gui2/ministyle.css b/mini-asterisk-gui2/ministyle.css new file mode 100644 index 00000000..d72344f5 --- /dev/null +++ b/mini-asterisk-gui2/ministyle.css @@ -0,0 +1,70 @@ +html,body{ + margin:0; + padding:0; + width:100%; + height:100%; + font-family:Arial, Helvetica, sans-serif; +} + +div#header{ + vertical-align:middle; + border-bottom:1px solid #000; +} +div#main-map{ + width:70%; + height:100%; + float:left; +} +div#side{ + width:30%; + float:left; +} + +div#dataPanel{ + width:90%; + height:50%; + overflow:auto; + border:2px solid #DDDDDD; +} +input{ + width:90%; +} + +input.navi{ + font-size:12px; + height:30px; + margin-bottom:10px; +} +div ul{ + margin-top:30px; + margin-bottom:30px; +} +div ul li{ + display: inline; + list-style-type: none; + padding-right: 40px; + font-size:18px; + font-weight:bold; +} + +div ul li.title{ + font-size:22px; + color:#888; +} + +div#header p{ + color:#888; + font-size:14px; + padding-left:20px; +} +span.instruction{ + font-weight:bold; + +} + +.message-box { text-align: center; padding: 5px; color:#545454; width:80%; margin:5px auto; font-size:12px;} +.clean { background-color: #efefef; border-top: 2px solid #dedede; border-bottom: 2px solid #dedede; } +.info { background-color: #f7fafd; border-top: 2px solid #b5d3ff; border-bottom: 2px solid #b5d3ff; } +.ok { background-color: #d7f7c4; border-top: 2px solid #82cb2f; border-bottom: 2px solid #82cb2f; } +.alert { background-color: #fef5be; border-top: 2px solid #fdd425; border-bottom: 2px solid #fdd425; } +.error { background-color: #ffcdd1; border-top: 2px solid #e10c0c; border-bottom: 2px solid #e10c0c; } \ No newline at end of file diff --git a/mini-asterisk-gui2/network.html b/mini-asterisk-gui2/network.html new file mode 100644 index 00000000..943e3ace --- /dev/null +++ b/mini-asterisk-gui2/network.html @@ -0,0 +1,53 @@ + + + + +Mini Asterisk - Phones + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + +

Network

StaticDHCP
IP Address:
Netmask:
Gateway:
DNS:
Emergency IP:
Internet Connection:
+  
+
+ +
+ + diff --git a/mini-asterisk-gui2/network.js b/mini-asterisk-gui2/network.js new file mode 100644 index 00000000..a5fb5d57 --- /dev/null +++ b/mini-asterisk-gui2/network.js @@ -0,0 +1,112 @@ +/* + network.js + David Rowe + March 7 2011 + + Network screen for Mini Asterisk GUI. +*/ + +var dhcp; + +// Called when we load page + +function initialise() { + mainMenu(); + + // kick off cascading CGIs, initialisePage() will be called when complete + + // determine if DHCP or static + + downloadUrl("/cgi-bin/getdhcp.cgi", processDhcp); +} + + +// called when DHCP CGI returns + +function processDhcp(doc,status) { + dhcp = "no"; + + loadHtmlTextFile(doc, function(line) { + parseNetwork(line); + } + ); + + if (dhcp == "no") { + downloadUrl("/cgi-bin/getdhcpconf.cgi?file=../init.d/network-static", processDhcp); + } + else { + // grey out fields + initilaisePage(); + } +} + + +// called when static IP CGI returns + +function processStatic(doc,status) { + loadHtmlTextFile(doc, function(line) { + parseNetwork(line); + } + ); + + initialisePage(); +} + + +function parseNetwork(line) { + + if (line.indexOf("DHCP=") != -1) { + var s = line.split('"'); + dhcp = "yes"; + } + + if (line.indexOf("IPADDRESS=") != -1) { + var s = line.split('"'); + var ip = s(2); + document.getElementById('ip').innerHTML = ip; + } + + if (line.indexOf("NETMASK=") != -1) { + var s = line.split('"'); + var netmask = s(2); + document.getElementById('netmask').innerHTML = netmask; + } + + if (line.indexOf("GATEWAY=") != -1) { + var s = line.split('"'); + var gateway = s(2); + document.getElementById('gateway').innerHTML = gateway; + } + + if (line.indexOf("DNS=") != -1) { + var s = line.split('"'); + var dns = s(2); + document.getElementById('dns').innerHTML = dns; + } + +} + + +// http://moblog.bradleyit.com/2009/06/javascript-ip-address-validation.html + +function isIP(obj) { + var ary = obj.value.split("."); + var ip = true; + + ip = (ary.length == 4); + + if (ip) { + for (var i=0; i<4; i++) { + ip = (!ary[i].match(/^\d{1,3}$/) || (Number(ary[i]) > 255)) ? false : ip; + } + } + + if (!ip) { + // the value is NOT a valid IP address + obj.style.background = "red"; + obj.select(); + } + else { obj.style.background = ""; } // the value IS a valid IP address + + return ip; +} diff --git a/mini-asterisk-gui2/phones.html b/mini-asterisk-gui2/phones.html new file mode 100644 index 00000000..a299aa01 --- /dev/null +++ b/mini-asterisk-gui2/phones.html @@ -0,0 +1,29 @@ + + + + +Mini Asterisk - Phones + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/mini-asterisk-gui2/phones.js b/mini-asterisk-gui2/phones.js new file mode 100644 index 00000000..970595e4 --- /dev/null +++ b/mini-asterisk-gui2/phones.js @@ -0,0 +1,110 @@ +/* + phones.js + David Rowe + Dec 12 2010 + + Phones screen for Mini Asterisk GUI. +*/ + +var update_time = 10; + + +// Called when we load page + +function initialise() { + mainMenu(); + + // kick off cascading CGIs, initialisePage() will be called when complete + + loadExtensions(); +} + + +function initialisePage() { + // construct list of phone extensions + + var icon = 'Analog Phone OK'; + var html = ''; + + html += ''; + + // print out internet connection + + html += ''; + html += ''; + html += ''; + html += ''; + + // print out analog phones + + html += ''; + for(var i=0; i" + ""; + html += ""; + } + } + + // print out IP phones + + for (j in ip_ext) { + if (ip_ext[j] != '') { + html += "" + ""; + html += ""; + } + } + + // print out phone lines + + html += ''; + for(var i=0; i" + ""; + html += ""; + } + } + + html += '

Phone System

Internet Connection:
Phone System IP Address:
 

Phones

" + "Analog Phone" + "Port" + i + "
" + j + "" + "IP Phone" + "" + ip_ext[j] + "

Phone Lines

" + "Analog Phone" + "Port" + i + "
'; + + document.getElementById("phones_table").innerHTML += html; + + // fire off fping CGI + + downloadUrl("/cgi-bin/fpingnodes.cgi?ip=google.com", processFping); + + // fire off Ifconfig IP address to get IP Address + + downloadUrl("/cgi-bin/ifconfig.cgi?arg=wlan0", processIfconfig); +} + + +// called when Fping CGI returns + +function processFping(doc, status) { + + // Change icon based on ping results + + var icon; + + if (doc.indexOf("google.com") != -1) + icon = ''; + else + icon = ''; + + document.getElementById('internet').innerHTML = icon; +} + +// called when ifconfig CGI returns + +function processIfconfig(doc, status) { + + var ip=""; + + if (doc.indexOf("inet addr:") != -1) { + ip = doc.substr(doc.indexOf("inet addr:"), doc.length); + ip = ip.substr(10, ip.length); + ip = ip.substr(0, ip.indexOf(" ")); + } + + document.getElementById('ipaddress').innerHTML = ip; +} diff --git a/mini-asterisk-gui2/tick.png b/mini-asterisk-gui2/tick.png new file mode 100644 index 0000000000000000000000000000000000000000..c155dff45aab836b2182044d9ea3dbfe82c13e5c GIT binary patch literal 1045 zcmV+w1nT>VP)=yb?=?``#tY@THHHhj`KXLvpBzVp6B`h zAI0*R8B@S>z}|APG+wJ#i^@}EVu+K3BuH*qW4{MJrQSHb{JL5O8&ar48~W~leB;0{ zm1>!YgivAv8{tdDf(>akTZHpLE}=aL?4#a@?gq|`Z7qAnA0{?#>l?hMA0s(2DUrkk zavQcFAqx`FwgJ)A5a!J<2v1XQG;afE#x|6^;_oj$@>E}cbuAiAh9Q=OKw^9eS+F5( z2|6$d@omUjwVJ=KT|_Qt$AInB8%B3~_VvWbw!Z%AeNlpmA_;lxDLU z=3Vb)N)(xs>+Fv9^P4$~gTgvMpYG*qzEc-m?}?tC8ZjA>BouJ*B_fcB6obXmOO3a@ zos=ljl7Kz&N1V5R<0yqjcZS-l0k*r9O1UQ{rB~n;cL$H^QEo|_BX))hGDjjQlg`J7Q0F*Vrs8)_9l$bZX7kEsMqJVqVDt0-~Fv0`4IBeCM0I*n&niE(o zvXtG>fM&Iu~^2!w7r1SE$f!Fxgkvqoj&Jc5o`x2fF;y% zoTR=DIg-urYWyJ$dydWwR!dLu)4ExPEZ3t7kX?XLL`rr&a1ngATnPw_$g6@f&A5|b_d-na0NnFZcozHMHj ztfmp92mnM=CI% z!_E9SFiE{}dF2J$f%XD# wp) lv -= ew/2; lv += 'px';tv += 'px'; ds.left = lv; ds.top = tv; ds.visibility = "visible";}}} + -- 2.25.1