diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home deleted file mode 100755 index ee9cb26..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/home +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/haserl -<% -echo -en "content-type: text/plain\r\n\r\n" - -addr() { - local addr="$(ip -$1 address show dev $2 2> /dev/null | tr '/' ' '| awk '/inet/{ printf("%s ", $2); }')" - echo "${addr:--}" -} - -default_gw() { - ip -$1 route list 0/0 dev $2 2> /dev/null | awk '{print($3); exit(0)}' -} - -print() { - echo " option $1 '$2'" -} - -printList() { - for item in $2; do - echo " list $1 '$item'" - done -} - -#include OpenWrt version -. /etc/openwrt_release -. /etc/firmware_release - -echo "package misc" -echo "config data 'data'" -print 'mac' "$(uci -q get network.mesh.macaddr)" -wanif=$(uci -q get network.wan.ifname) -printList 'freifunk_addr4' "$(addr 4 br-mesh)" -printList 'freifunk_addr6' "$(addr 6 br-mesh)" -printList 'wan_addr4' "$(addr 4 $wanif)" -printList 'wan_addr6' "$(addr 6 $wanif)" - -up="$(uptime)" -print 'load' "${up##*:}" -uptime="${up%%,*}" -print 'uptime' "${uptime##*up}" -print 'uname' "$(uname -s -m -r)" -print 'date' "$(date)" - -if pidof fastd >/dev/null ; then - print 'has_vpn' 'Ja' -else - print 'has_vpn' 'Nein' -fi - -if [ -n "$(default_gw 4 $wanif)" -o -n "$(default_gw 6 $wanif)" ]; then - print 'has_internet' 'Ja' -else - print 'has_internet' 'Nein' -fi - -print 'node_count' "$((`cat /sys/kernel/debug/batman_adv/bat0/transtable_global | grep '^ [^ ]' | cut -b 39-55 | sort | uniq | wc -l 2> /dev/null`+1))" -print 'neigh_count' "$(cat /sys/kernel/debug/batman_adv/bat0/originators | grep '^[0-9a-f]' | cut -b 37-53 | sort | uniq | wc -l 2> /dev/null)" -print 'firmware_version' "$FIRMWARE_VERSION" -print 'fastd_version' "$(fastd --version 2> /dev/null | cut -d' ' -f 2)" -print 'batman_version' "$(cat /sys/module/batman_adv/version 2> /dev/null)" -print 'openwrt_version' "$DISTRIB_DESCRIPTION" -name="$(uci get -q 'system.@system[0].hostname')" -print 'name' "${name:--}" -print 'model' "$(cat /tmp/sysinfo/model 2> /dev/null)" -print 'freifunk_user_count' "$(cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W')" -print 'freifunk_rx_bytes' "$(cat /sys/class/net/br-mesh/statistics/rx_bytes 2> /dev/null)" -print 'freifunk_tx_bytes' "$(cat /sys/class/net/br-mesh/statistics/tx_bytes 2> /dev/null)" -print 'wan_rx_bytes' "$(cat /sys/class/net/$wanif/statistics/rx_bytes 2> /dev/null)" -print 'wan_tx_bytes' "$(cat /sys/class/net/$wanif/statistics/tx_bytes 2> /dev/null)" - -%> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/misc b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/misc deleted file mode 100755 index fc98a65..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/misc +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/haserl -<% -echo -en "content-type: text/plain\r\n\r\n" - -case $GET_func in - reboot) - reboot - echo "(I) Bitte warten. Neustart wird durchgeführt..." - ;; - wifi_status) - wifi status - ;; - wifiscan) - iw dev "$GET_device" scan 2> /dev/null | grep '^BSS \|SSID\|set: channel\|signal\|capability\|MESH ID' - ;; - set_config_file) - file_name="$GET_name" - file_data="$GET_data" - - if echo "$file_data" > "/etc/config/$file_name" 2> /dev/null; then - echo "(I) Einstellungen wurden gespeichert. Bitte Neustarten." - if [ "$file_name" = "system" ]; then - uci get -q 'system.@system[0].hostname' > /proc/sys/kernel/hostname - fi - else - echo "(E) Beim Speichern ist ein Fehler aufgetreten. Bitte Neustarten." - fi - ;; - *) - echo "(E) misc: Invalid command: '$GET_func'" - ;; -esac -%> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/password b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/password deleted file mode 100755 index 0b27024..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/password +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/haserl -<% -echo -en "content-type: text/plain\r\n\r\n" - -pass1="$GET_pass1" -pass2="$GET_pass2" - -(echo "$pass1"; sleep 1; echo "$pass2") | passwd &> /dev/null -if [ $? -eq 0 ]; then - #force instant password change - /etc/init.d/uhttpd restart 2> /dev/null -else - echo "(E) Es ist ein Fehler aufgetreten." -fi - -%> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings deleted file mode 100755 index 8d527a9..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/settings +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/haserl -<% -echo -en "content-type: text/plain\r\n\r\n" - -. /lib/functions.sh - -case "$GET_func" in - get_settings) - uci export -qn system - uci export -qn simple-tc - ;; - *) - echo "(E) settings: Invalid command: '$GET_func'" - ;; -esac -%> diff --git a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade b/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade deleted file mode 100755 index 04f5b58..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/haserl --upload-dir=/tmp --upload-limit=12000 -<% -echo -en "content-type: text/plain\r\n\r\n" - -case "${GET_func:-$POST_func}" in - apply_firmware) - path="$POST_firmware" - keep="$POST_keep_config" - - if [ ! -f "$path" ]; then - echo "(E) Datei nicht gefunden." - exit 1 - fi - - if [ "$keep" = "yes" ]; then - args="" - else - args="-n" - fi - - echo "(I) Starte sysupgrade..." - - #apply openwrt or vendor image - sysupgrade $args $path - ;; - restore_firmware) - echo "(I) Undo all changes ..." - echo y | firstboot - echo "(I) Rebooting now ..." - reboot - ;; - *) - echo "(E) upgrade: Invalid command: '$GET_func'" - ;; -esac -%> diff --git a/src/packages/fff/fff-web/files/www/ssl/home.html b/src/packages/fff/fff-web/files/www/ssl/home.html deleted file mode 100644 index 3cb0583..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/home.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - -Home - - - - - - - -
-System -
?
-
?
-
?
-
?
-
?
-
?
-
?
-
?
-
?
-
?
-
- -
-Netz: Freifunk -
?
-
?
-
?
-
?
-
?
-
- -
-Netz: WAN -
?
-
?
-
?
-
?
-
?
-
- -
-Software -
?
-
?
-
?
-
?
-
- - - diff --git a/src/packages/fff/fff-web/files/www/ssl/home.js b/src/packages/fff/fff-web/files/www/ssl/home.js deleted file mode 100644 index da12f32..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/home.js +++ /dev/null @@ -1,46 +0,0 @@ - -function formatSize(bytes) { - if(typeof bytes === "undefined" || bytes == "") { - return "-"; - } else if (bytes < 1000) { - return bytes + " B"; - } else if (bytes < 1000*1000) { - return (bytes/ 1000.0).toFixed(0) + " KB"; - } else if (bytes < 1000*1000*1000) { - return (bytes/1000.0/1000.0).toFixed(1) + " MB"; - } else { - return (bytes/1000.0/1000.0/1000.0).toFixed(2) + " GB"; - } -} - -function init() { - send("/cgi-bin/home", { }, function(data) { - var obj = fromUCI(data).misc.data; - for(var key in obj) { - var value = obj[key]; - - if(key == 'stype') { - continue; - } - - //for traffic - if(/_bytes$/.test(key)) { - value = formatSize(value); - } - - //for addresses - if(typeof(value) == 'object') { - value = "" - } - - setText(key, value); - } - }); - - addHelpText($("system"), "Eine \xdcbersicht \xfcber den Router."); - addHelpText($("freifunk"), "Das \xf6ffentliche Freifunknetz.."); - addHelpText($("wan"), "Das Netz \xfcber dass das Internet erreicht wird."); - addHelpText($("software"), "Einige installierte Softwareversionen."); - addHelpText($("freifunk_user_count"), "Die Anzahl der Nutzer an diesem Router in den letzten zwei Stunden."); - addHelpText($("has_vpn"), "Status der VPN-Verbindung zum Server im Internet."); -} diff --git a/src/packages/fff/fff-web/files/www/ssl/index.html b/src/packages/fff/fff-web/files/www/ssl/index.html deleted file mode 100644 index 36becce..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/index.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - -Freifunk - - - - - - - - - - -
-

-
-
- -
- - - - - - diff --git a/src/packages/fff/fff-web/files/www/ssl/map.html b/src/packages/fff/fff-web/files/www/ssl/map.html index 03b538e..d1af628 100644 --- a/src/packages/fff/fff-web/files/www/ssl/map.html +++ b/src/packages/fff/fff-web/files/www/ssl/map.html @@ -30,9 +30,7 @@ var map; var marker; function oebn0(name) { - var f = window.opener.uci['system']; - var i = window.opener.firstSectionID(f, "system"); - return window.opener.document.getElementsByName(['system', i, name].join('#'))[0]; + return window.opener.document.getElementsByName(name)[0]; } function add_marker(pos) { @@ -58,8 +56,6 @@ function report_marker_pos() { var lng_field = oebn0('longitude'); lat_field.value = pos.lat.toFixed(8); lng_field.value = pos.lng.toFixed(8); - window.opener.updateFrom(lat_field); - window.opener.updateFrom(lng_field); } function init_map() { diff --git a/src/packages/fff/fff-web/files/www/ssl/password.html b/src/packages/fff/fff-web/files/www/ssl/password.html deleted file mode 100644 index 08f10b4..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/password.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Password - - - - - - - -
- Passwort -
- -
-
- -
-

Das Passwort ist für den Zugriff auf die Weboberfläche des Routers und auch den Zugriff per SSH. Der Benutzername ist 'root'.
-
-
- -
- - - \ No newline at end of file diff --git a/src/packages/fff/fff-web/files/www/ssl/password.js b/src/packages/fff/fff-web/files/www/ssl/password.js deleted file mode 100644 index 96ffd23..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/password.js +++ /dev/null @@ -1,24 +0,0 @@ - -function init() { - $("p1").focus(); -} - -function apply() -{ - p1 = $('p1').value; - p2 = $('p2').value; - - $('p1').value = ""; - $('p2').value = ""; - - if(p1 != p2) { - setText('msg', "(E) Die Passwörter sind nicht identisch."); - return; - } else { - setText('msg', "(I) Das Passwort wird geändert. Bitte die Seite neu laden."); - } - - send("/cgi-bin/password", { func : "set_password", pass1 : p1, pass2 : p2 }, function(data) { - setText('msg', data); - }); -} diff --git a/src/packages/fff/fff-web/files/www/ssl/settings.html b/src/packages/fff/fff-web/files/www/ssl/settings.html deleted file mode 100644 index 73f651c..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/settings.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - -Einstellungen - - - - - - - -
- Allgemeine Einstellungen - -
-
- Bitratenkontrolle - -

Die für das Freifunknetz beanspruchte Internet-Bitrate am WAN kann hier begrenzt werden.
-
- - - - - diff --git a/src/packages/fff/fff-web/files/www/ssl/settings.js b/src/packages/fff/fff-web/files/www/ssl/settings.js deleted file mode 100644 index 082a08d..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/settings.js +++ /dev/null @@ -1,170 +0,0 @@ - -/* -All required uci packages are stored variable uci. -The GUI code displayes and manipulated this variable. -*/ -var uci = {}; -var gid = 0; - - -function init() -{ - send("/cgi-bin/settings", { func : "get_settings" }, function(data) { - uci = fromUCI(data); - rebuild_general(); - adv_apply(); - }); -} - -function updateFrom(src) -{ - var obj = {}; - collect_inputs(src, obj); - for(var name in obj) - { - var value = obj[name]; - var path = name.split('#'); - - var pkg = path[0]; - var sec = path[1]; - var opt = path[2]; - - uci[pkg].pchanged = true; - uci[pkg][sec][opt] = value; - } -} - -function getChangeModeAction(ifname) -{ - return function(e) { - var src = (e.target || e.srcElement); - var mode = (src.data || src.value); - delNetSection(ifname); - addNetSection(ifname, mode); - }; -} - -function appendSetting(p, path, value, mode) -{ - var id = path.join('#'); - var b; - var cfg = path[0]; - var name = path[path.length-1]; - switch(name) - { - case "latitude": - b = append_input(p, "GPS Breitengrad", id, value); - b.lastChild.placeholder = "52.02713078"; - addInputCheck(b.lastChild, /^$|^\d{1,3}\.\d{1,8}$/, "Ung\xfcltige Eingabe. Bitte nur maximal 8 Nachkommastellen und keine Kommas verwenden."); - addHelpText(b, "Die Latitude Koordinate dieses Knotens auf der Freifunk-Karte (z.B. \"52.02713078\")."); - var map_button = append_button(b, "Position auf Karte anzeigen / setzen", function() { - window.open('/map.html', '_blank', 'location=0,status=0,scrollbars=1,width=400,height=300') - }); - b.style["position"] = "relative"; - map_button.style["position"] = "absolute"; - map_button.style["height"] = "44px"; - map_button.style["margin-left"] = "5px"; - break; - case "longitude": - b = append_input(p, "GPS Längengrad", id, value); - b.lastChild.placeholder = "8.52829987"; - addInputCheck(b.lastChild, /^$|^\d{1,3}\.\d{1,8}$/, "Ung\xfcltige Eingabe. Bitte nur maximal 8 Nachkommastellen und keine Kommas verwenden."); - addHelpText(b, "Die Longitude Koordinate dieses Knotens auf der Freifunk-Karte (z.B. \"8.52829987\")."); - break; - case "position_comment": - b = append_input(p, "Standort Beschreibung", id, value); - b.lastChild.placeholder = "Am Antennenmast"; - addInputCheck(b.lastChild, /^$|^[\-\^'\w\.\:\[\]\(\)\/ &@\+\u0080-\u00FF]{0,255}$/, "Ung\xfcltige Eingabe."); - addHelpText(b, "Eine genauere Beschreibung zum Standort"); - break; - case "hostname": - b = append_input(p, "Knotenname", id, value); - b.lastChild.placeholder = "MeinRouter"; - addInputCheck(b.lastChild, /^$|^[\-\^'\w\.\:\[\]\(\)\/ &@\+\u0080-\u00FF]{0,32}$/, "Ung\xfcltige Eingabe."); - addHelpText(b, "Der Name dieses Knotens auf der Freifunk-Karte."); - break; - case "description": - b = append_input(p, "Knotenbeschreibung", id, value); - b.lastChild.placeholder = "In einer grauen Kiste versteckt"; - addInputCheck(b.lastChild, /^$|^[\-\^'\w\.\:\[\]\(\)\/ &@\+\u0080-\u00FF]{0,255}$/, "Ung\xfcltige Eingabe."); - addHelpText(b, "Beschreibung dieses Knotens."); - break; - case "contact": - b = append_input(p, "E-Mail Adresse", id, value); - b.lastChild.placeholder = "info@example.com"; - addInputCheck(b.lastChild, /^$|^[\-\^'\w\.\:\[\]\(\)\/ &@\+\u0080-\u00FF]{0,128}$/, "Ung\xfcltige Eingabe."); - addHelpText(b, "Kontaktdaten f\xfcr die \xf6ffentliche Freifunk-Karte und Statusseite. Falls ihr euch von anderen Leuten kontaktieren lassen wollt (z.B. \"info@example.com\")."); - break; - case "enabled": - if(cfg == "simple-tc") { - b = append_radio(p, "Bitratenkontrolle", id, value, [["An", "1"], ["Aus", "0"]]); - addHelpText(b, "Bitratenkontrolle f\xfcr den Upload-/Download \xfcber das Freifunknetz \xfcber den eigenen Internetanschluss."); - } - break; - case "limit_egress": - b = append_input(p, "Freifunk Upload", id, value); - addInputCheck(b.lastChild, /^\d+$/, "Upload ist ung\xfcltig."); - addHelpText(b, "Maximaler Upload in KBit/s f\xfcr die Bitratenkontrolle."); - break; - case "limit_ingress": - b = append_input(p, "Freifunk Download", id, value); - addInputCheck(b.lastChild, /^\d+$/, "Download ist ung\xfcltig."); - addHelpText(b, "Maximaler Download in KBit/s f\xfcr die Bitratenkontrolle."); - break; - default: - return; - } - - b.id = id; //needed for updateFrom - b.onchange = function() { - updateFrom(b); - }; - - return b; -} - -function rebuild_general() -{ - var gfs = $("general"); - var tfs = $("traffic"); - - removeChilds(gfs); - removeChilds(tfs); - - if('system' in uci) { - var f = uci['system']; - var i = firstSectionID(f, "system"); - appendSetting(gfs, ['system', i, "hostname"], f[i]["hostname"]); - appendSetting(gfs, ['system', i, "description"], f[i]["description"]); - appendSetting(gfs, ['system', i, "latitude"], f[i]["latitude"]); - appendSetting(gfs, ['system', i, "longitude"], f[i]["longitude"]); - appendSetting(gfs, ['system', i, "position_comment"], f[i]["position_comment"]); - appendSetting(gfs, ['system', i, "contact"], f[i]["contact"]); - } - - if('simple-tc' in uci) { - var t = uci['simple-tc']; - var i = firstSectionID(t, "interface"); - appendSetting(tfs, ['simple-tc', i, "enabled"], t[i]["enabled"]); - appendSetting(tfs, ['simple-tc', i, "limit_ingress"], t[i]["limit_ingress"]); - appendSetting(tfs, ['simple-tc', i, "limit_egress"], t[i]["limit_egress"]); - } -} - -function save_data() -{ - for(var name in uci) - { - var obj = uci[name]; - if(!obj.pchanged) - continue; - var data = toUCI(obj); - send("/cgi-bin/misc", { func : "set_config_file", name : name, data : data }, - function(data) { - $('msg').innerHTML = data; - $('msg').focus(); - init(); - } - ); - } -} diff --git a/src/packages/fff/fff-web/files/www/ssl/shared.js b/src/packages/fff/fff-web/files/www/ssl/shared.js deleted file mode 100644 index 1c4c0e0..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/shared.js +++ /dev/null @@ -1,432 +0,0 @@ - -function $(id) { return document.getElementById(id); } -function create(name) { return document.createElement(name); } -function show(e) { e.style.display='block'; } -function hide(e) { e.style.display='none'; } -function addClass(e, c) { e.classList.add(c); } //HTML5! -function removeClass(e, c) { e.classList.remove(c); } -function setText(id, txt) { $(id).innerHTML = txt; } -function inArray(item, array) { return array.indexOf(item) != -1; } - -function split(str) -{ - if(typeof str != 'string') - return []; - var a = str.match(/[^\s]+/g); - return (a ? a : []); -} - -function uniq(arr) -{ - var obj = {}; - for(var i in arr) obj[arr[i]] = 0; - return Object.keys(obj); -} - -//remove an item from a string list -function removeItem(str, item) -{ - var array = split(str); - for(var i in array) - if(array[i] == item) - array.splice(i, 1); - return array.join(' '); -} - -function addItem(str, item) -{ - var array = split(str); - for(var i in array) - if(array[i] == item) - return str; - array.push(item); - return array.join(' '); -} - -function replaceItem(str, old_item, new_item) -{ - var array = split(str); - for(var i in array) - if(array[i] == old_item) - array[i] = new_item; - return array.join(' '); -} - -function addHelpText(elem, text) { - var help = $("help"); - - if(help) { - elem.onmouseover = function(e) { - help.style.top = (e.clientY-20)+"px"; - help.style.left = (e.clientX+80)+"px"; - help.innerHTML = text; - show(help); - }; - - elem.onmouseout = function() { - help.innerHTML = ""; - hide(help); - }; - } -} - -//to config file syntax -function toUCI(pkg_obj) -{ - var str = "\n"; - for(var sid in pkg_obj) - { - if(sid == "pchanged") - continue; - - var options = pkg_obj[sid]; - var sname = (sid.substring(0, 3) != "cfg") ? (" '"+sid+"'") : ""; - str += "config "+options.stype+sname+"\n"; - for(var oname in options) - { - if(oname == "stype") - continue; - var value = options[oname]; - if(typeof value == 'object') - { - for(var i in value) - str += " list "+oname+" '"+value[i]+"'\n"; - } - else - str += " option "+oname+" '"+value+"'\n"; - } - str += "\n"; - } - return str; -} - -// parses output from one or multiple -// calls like "uci export -qn foo" -function fromUCI(pkgs_str) -{ - var pkg_objs = {}; - var pkg; - var cfg; - - var lines = pkgs_str.split("\n"); - for(var i = 0; i < lines.length; ++i) - { - var line = lines[i]; - var items = split(line); - if(items.length < 2) continue; - switch(items[0]) - { - case 'package': - pkg = { pchanged : false }; - pkg_objs[items[1]] = pkg; - break; - case 'config': - var val = (items.length == 3) ? line.match(/'(.*)'/)[1] : ("cfg"+(++gid)); - cfg = { stype : items[1] }; - pkg[val] = cfg; - break; - case 'option': - var val = line.match(/'(.*)'/)[1]; - cfg[items[1]] = val; - break; - case 'list': - var val = line.match(/'(.*)'/)[1]; - if(!(items[1] in cfg)) cfg[items[1]] = []; - cfg[items[1]].push(val); - break; - } - } - return pkg_objs; -} - -function firstSectionID(obj, stype) -{ - for(var id in obj) - if(obj[id].stype == stype) - return id; -} - -function config_foreach(objs, stype, func) -{ - for(var key in objs) - { - var obj = objs[key]; - if((obj["stype"] == stype || stype == "*") && func(key, obj)) - return; - } -} - -function config_find(objs, mobj) -{ - for(var key in objs) - { - var obj = objs[key]; - var found = true; - for(mkey in mobj) - { - if(obj[mkey] != mobj[mkey]) - { - found = false; - break; - } - } - if(found) - return obj; - } - return null; -} - -function params(obj) -{ - var str = ""; - for(var key in obj) { - if(str.length) str += "&"; - else str += "?"; - str += encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]); - } - return str.replace(/%20/g, "+"); -} - -function send(url, obj, func) -{ - url += params(obj); - jx.load(url, func, 'text'); -} - -function onDesc(e, tag, func) -{ - for(var i = 0; i < e.childNodes.length; ++i) { - var c = e.childNodes[i]; - if(c.tagName == tag && func(c) == false) return; - onDesc(c, tag, func); - } -} - -function onChilds(e, tag, func) -{ - for(var i = 0; i < e.childNodes.length; ++i) { - var c = e.childNodes[i]; - if(c.tagName == tag && func(c) == false) return; - } -} - -function onParents(e, tag, func) -{ - while(e != document) { - e = e.parentNode; - if(e.tagName == tag && func(e) == false) return; - } -} - -function removeChilds(p) -{ - while(p.hasChildNodes()) - p.removeChild(p.firstChild); -} - -function show_error(data) -{ - var is_error = (data.substr(0, 3) == "(E)"); - if(is_error) - setText('msg', data); - return is_error; -} - -function checkName(name) -{ - if(/[\w_]{2,12}/.test(name)) - return true; - alert("Name '"+name+"' ist ung\xfcltig."); - return false; -} - -//prepend input check -function addInputCheck(input, regex, msg) -{ - var prev_value = input.value; - var prev_onchange = input.onchange; - input.onchange = function(e) { - if(regex.test(input.value)) { - if(prev_onchange) - prev_onchange(e); - return; - } - alert(msg); - input.value = prev_value; - e.stopPropagation(); - }; -} - -function collect_inputs(p, obj) -{ - if(p.tagName == "SELECT") - obj[p.name] = p.value; - if(p.tagName == "INPUT") - if(p.type == "text" || p.type == "password" || (p.type == "radio" && p.checked)) - obj[p.name] = p.value - else if(p.type == "checkbox" && p.checked) - { - var v = obj[p.name]; - v = (typeof v == "undefined") ? (p.data || p.value) : (v + " " + (p.data || p.value)); - obj[p.name] = v; - } - - for(var i = 0; i < p.childNodes.length; ++i) - collect_inputs(p.childNodes[i], obj); -} - -function append(parent, tag, id) -{ - var e = create(tag); - if(id) e.id = id; - parent.appendChild(e); - return e; -} - -function append_section(parent, title, id) -{ - var fs = append(parent, "fieldset"); - var lg = create("legend"); - lg.innerHTML = title; - if(id) fs.id = id; - fs.appendChild(lg); - return fs; -} - -function append_button(parent, text, onclick) -{ - var button = append(parent, 'button'); - button.type = 'button'; - button.innerHTML = text; - button.onclick = onclick; - return button; -} - -function append_label(parent, title, value) -{ - var div = append(parent, 'div'); - var label = append(div, 'label'); - label.innerHTML = title + ":"; - - if(typeof value == 'string') - { - //div.className = "label_option"; - var span = append(div, 'span'); - span.innerHTML = value; - } - else - { - div.className = "list_option"; - var span = append(div, 'span'); - for(var i in value) - { - var d = append(span, 'div'); - d.innerHTML = value[i]; - } - } - return div; -} - -function append_options(parent, name, selected, choices) -{ - var select = append(parent, 'select'); - select.style.minWidth = "5em"; - select.name = name; - for(var i in choices) - { - var s = (typeof choices[i] != 'object'); - var choice_text = " " + (s ? choices[i] : choices[i][0]); - var choice_value = "" + (s ? choices[i] : choices[i][1]); - - var option = append(select, 'option'); - option.value = choice_value; - option.selected = (choice_value == selected) ? "selected" : ""; - option.innerHTML= choice_text; - } - return select; -} - -function append_selection(parent, title, name, selected, choices) -{ - var p = append(parent, 'div'); - var label = append(p, 'label'); - - p.className = "select_option"; - label.innerHTML = title + ":"; - - append_options(p, name, selected, choices); - return p; -} - -//append an input field -//e.g. append_input(parent, "Name", "name_string", "MyName") -function append_input(parent, title, name, value) -{ - var div = append(parent, 'div'); - var label = create('label'); - var input = create('input'); - - label.innerHTML = title + ":"; - input.value = (typeof value == "undefined") ? "" : value; - input.name = name; - input.type = "text"; - - div.appendChild(label); - div.appendChild(input); - - return div; -} - -//append a radio field -//e.g. append_radio(parent, "Enabled", "enabled", 0, [["Yes", 1], ["No", 0]) -function append_radio(parent, title, name, selected, choices) { - return _selection("radio", parent, title, name, [selected], choices); -} - -//append a checkbox field -//e.g. append_check(parent, "Enabled", "enabled", ["grass"], [["Grass", "grass"], ["Butter", "butter"]]) -function append_check(parent, title, name, selected, choices) { - return _selection("checkbox", parent, title, name, selected, choices); -} - -function _selection(type, parent, title, name, selected, choices) -{ - var p = append(parent, 'div'); - var label = append(p, 'label'); - var span = append(p, 'span'); - - p.className = "radio_option"; - label.innerHTML = title + ":"; - - for (var i in choices) - { - var s = (typeof choices[i] == 'string'); - var choice_text = "" + (s ? choices[i] : choices[i][0]); - var choice_value = "" + (s ? choices[i] : choices[i][1]); - var choice_help = s ? undefined : choices[i][2]; - - var div = append(span, 'div'); - var input = append(div, 'input'); - var label = append(div, 'label'); - - input.name = name; - input.value = choice_value; - input.data = choice_value; //for IE :-( - input.type = type; - if(inArray(choice_value, selected)) - input.checked = "checked" - - label.innerHTML = " " + choice_text; - - if(choice_text == "_") - hide(div); - - if(choice_help) { - addHelpText(label, choice_help); - } - } - return p; -} - -//from jx_compressed.js -jx={getHTTPObject:function(){var A=false;if(typeof ActiveXObject!="undefined"){try{A=new ActiveXObject("Msxml2.XMLHTTP")}catch(C){try{A=new ActiveXObject("Microsoft.XMLHTTP")}catch(B){A=false}}}else{if(window.XMLHttpRequest){try{A=new XMLHttpRequest()}catch(C){A=false}}}return A},load:function(url,callback,format){var http=this.init();if(!http||!url){return }if(http.overrideMimeType){http.overrideMimeType("text/xml")}if(!format){var format="text"}format=format.toLowerCase();var now="uid="+new Date().getTime();url+=(url.indexOf("?")+1)?"&":"?";url+=now;http.open("GET",url,true);http.onreadystatechange=function(){if(http.readyState==4){if(http.status==200){var result="";if(http.responseText){result=http.responseText}if(format.charAt(0)=="j"){result=result.replace(/[\n\r]/g,"");result=eval("("+result+")")}if(callback){callback(result)}}else{if(error){error(http.status)}}}};http.send(null)},init:function(){return this.getHTTPObject()}} diff --git a/src/packages/fff/fff-web/files/www/ssl/style.css b/src/packages/fff/fff-web/files/www/ssl/style.css deleted file mode 100644 index 61fc3f0..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/style.css +++ /dev/null @@ -1,226 +0,0 @@ - -/* common */ - -* { margin:0; padding:0; } - -a { text-decoration: none; } - -li { list-style-type: none; } - -html { - font: 90%/1.3 arial,sans-serif; - padding:1em; - background:#fafafa; -} - -body { - font: normal 16px verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif; -} - - -/* specific */ - -.mac { - color: #0033CC; - cursor: help; -} - -#nds_files label { - width: 18em; -} - -#nds_macs { - margin-bottom: 2em; -} - -#wifiscan table { - text-align: center; -} - -#wifiscan td:nth-of-type(1) { - text-align: left; -} - -#help { - padding: 5px; - height: 0px; - position: absolute; - min-height: 50px; - background-color: #f2f2f2; - display:none; - border: 2px dotted grey; -} - -#switches label { - width: 6em; -} - -/* forms */ - -legend { - color: #0b77b7; - font-size: 1.2em; -} - -label { - float: left; - width: 12em; - text-align: right; - margin-right: 1em; - white-space: nowrap; -} - -fieldset { - border: 1px solid #ddd; - padding: 0.5em; - margin: 0.5em; - width: 36em; -} - -fieldset fieldset { - width: auto; -} - -fieldset > * { - margin: 0.3em 0; - clear: both; -} - -fieldset div > * { - display: inline-block; - vertical-align: middle; -} - -input { - padding: 0.15em; - width: 15em; - border: 1px solid #ddd; - background: #fafafa; - font: bold 0.95em arial, sans-serif; - -moz-border-radius: 0.4em; - -khtml-border-radius: 0.4em; -} - -input:hover, input:focus { - border-color: #c5c5c5; - background: #f6f6f6; -} - -select { - min-width: 4em; -} - -option { - padding-right: 1em; -} - -.radio_option div { - float: left; - white-space: nowrap; - clear: none; -} - -.radio_option div label, .radio_option div input { - vertical-align: middle; - display: inline; - float: none; - width: auto; - background: none; - border: none; -} - -.select_option label { - font-size: 1em; - color: #000; -} - -.list_option div { - clear: left; - margin: 0; - padding: 0; - float: left; - list-style: none; -} - - -/* navigation */ - -#globalnav { - position: relative; - float: auto; - width: 98%; - padding: 0 0 1.75em 1em; - margin: 0; - margin-bottom: 2%; - list-style: none; - line-height: 1em; -} - -#globalnav li { - float: left; - margin: 0; - padding: 0; -} - -#globalnav a { - display: block; - color: #444; - text-decoration: none; - font-weight: bold; - background: #ddd; - margin: 0; - padding: 0.25em 1em; - border-left: 1px solid #fff; - border-top: 1px solid #fff; - border-right: 1px solid #aaa; -} - -#globalnav a:hover, -#globalnav a:active, -#globalnav a.here:link, -#globalnav a.here:visited { - background: #bbb; -} - -#globalnav a.here:link, -#globalnav a.here:visited { - position: relative; - z-index: 102; -} - -/* sub-navigation */ - -#globalnav ul { - position: absolute; - left: 0; - top: 1.5em; - float: left; - background: #bbb; - width: 100%; - margin: 0; - padding: 0.25em 0.25em 0.25em 1em; - list-style: none; - border-top: 1px solid #fff; -} - -#globalnav ul li { - float: left; - display: block; - margin-top: 1px; -} - -#globalnav ul a { - background: #bbb; - color: #fff; - display: inline; - margin: 0; - padding: 0 1em; - border: 0; -} - -#globalnav ul a:hover, -#globalnav ul a:active, -#globalnav ul a.here:link, -#globalnav ul a.here:visited { - color: #444; -} diff --git a/src/packages/fff/fff-web/files/www/ssl/upgrade.html b/src/packages/fff/fff-web/files/www/ssl/upgrade.html deleted file mode 100644 index 41d4543..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/upgrade.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - -Upgrade - - - - - - - -
- Router Zurücksetzen -
- -
-

Alle Einstellungen werden zurückgesetzt und der Router startet neu.
-
-
- Manuelles Update -
-
-
- -
- - -
-
-
-

Hier kann ein Freifunk-Image verwendet werden (*-sysupgrade.bin) oder die Firmware des Routerherstellers.
-
- - - - diff --git a/src/packages/fff/fff-web/files/www/ssl/upgrade.js b/src/packages/fff/fff-web/files/www/ssl/upgrade.js deleted file mode 100644 index b3d6e48..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/upgrade.js +++ /dev/null @@ -1,12 +0,0 @@ - -function init() { - /* Nothing to do */ -} - -function restore_firmware() { - if(!confirm("Sollen alle Einstellungen zur\xFCckgesetzt werden?")) return; - send("/cgi-bin/upgrade", { func : 'restore_firmware' }, function(text) { - setText('msg', text); - }); -} - diff --git a/src/packages/fff/fff-web/files/www/ssl/wifiscan.html b/src/packages/fff/fff-web/files/www/ssl/wifiscan.html deleted file mode 100644 index 9e58c85..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/wifiscan.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - -Wifiscan - - - - - - - -
- Wifi Scan -
- - -
- - - - -
- - - diff --git a/src/packages/fff/fff-web/files/www/ssl/wifiscan.js b/src/packages/fff/fff-web/files/www/ssl/wifiscan.js deleted file mode 100644 index 3be2591..0000000 --- a/src/packages/fff/fff-web/files/www/ssl/wifiscan.js +++ /dev/null @@ -1,77 +0,0 @@ - -function fetch(regex, data) -{ - var result = data.match(regex); - return result ? result[1] : ""; -} - -function append_td(tr, value) { - append(tr, 'td').innerHTML = value ? value : "?"; -} - -function wifi_scan() -{ - var s = $('wifiscan_selection'); - var device = s.options[s.selectedIndex].value; - - send("/cgi-bin/misc", {func:'wifiscan', device:device}, function(data) { - var tbody = $("wifiscan_tbody"); - removeChilds(tbody); - - var items = data.split(/BSS /).filter(Boolean); - for(var i = 0; i < items.length; ++i) - { - var item = items[i]; - var ssid = fetch(/SSID: (.*)\n/, item); - var channel = fetch(/channel (.*)\n/, item); - var signal = fetch(/signal: (.*)\n/, item); - var capability = fetch(/capability: (.*)\n/, item); - var mesh_id = fetch(/MESH ID: (.*)\n/, item); - - var tr = append(tbody, 'tr'); - append_td(tr, mesh_id ? mesh_id : ssid); - append_td(tr, channel); - append_td(tr, signal); - - //determine the wifi mode - if(mesh_id) { - append_td(tr, " 802.11s"); - } else if(/IBSS/.test(capability)) { - append_td(tr, " AdHoc"); - } else if(/ESS/.test(capability)) { - append_td(tr, " AccessPoint"); - } else { - append_td(tr, " ???"); - } - } - - var table = $('wifiscan_table'); - show(table); - }); -} - -function add_list_entry(device, ifname) { - var list = $('wifiscan_selection'); - var o = append(list, 'option'); - o.style.paddingRight = "1em"; - o.innerHTML = device; - o.value = ifname; -} - -/* -* Create a selection of wireless devices -* represented as the first interface found. -*/ -function init() { - send("/cgi-bin/misc", {func:'wifi_status'}, function(data) { - var data = JSON.parse(data); - for(var device in data) { - var interfaces = data[device].interfaces; - if(interfaces.length == 0) - continue; - var ifname = interfaces[0].ifname ; - if(typeof(ifname) == 'string') - add_list_entry(device, ifname); - } - }); -}