Przeglądaj źródła

Initial import

master
Rafal Kupiec 6 lat temu
rodzic
commit
9318b5b444
45 zmienionych plików z 1687 dodań i 4 usunięć
  1. 339
    0
      COPYING
  2. 10
    0
      README
  3. 0
    4
      README.md
  4. 8
    0
      files/etc/config/kagera
  5. 33
    0
      files/etc/init.d/webui
  6. 8
    0
      files/usr/lib/kagera/config/about.cbsi
  7. 17
    0
      files/usr/lib/kagera/config/command.cbsi
  8. 114
    0
      files/usr/lib/kagera/config/overview.cbsi
  9. 25
    0
      files/usr/lib/kagera/config/syslogs.cbsi
  10. 32
    0
      files/usr/lib/kagera/kagera.pem
  11. 14
    0
      files/usr/lib/kagera/langs/TEMPLATE/about.dic
  12. 11
    0
      files/usr/lib/kagera/langs/TEMPLATE/command.dic
  13. 59
    0
      files/usr/lib/kagera/langs/TEMPLATE/common.dic
  14. 44
    0
      files/usr/lib/kagera/langs/TEMPLATE/overview.dic
  15. 17
    0
      files/usr/lib/kagera/langs/TEMPLATE/syslogs.dic
  16. 104
    0
      files/usr/lib/kagera/webui/index.sh
  17. 11
    0
      files/usr/lib/kagera/webui/scripts/command.js
  18. 245
    0
      files/usr/lib/kagera/webui/scripts/kagera.js
  19. 3
    0
      files/usr/lib/kagera/webui/scripts/overview.js
  20. 3
    0
      files/usr/lib/kagera/webui/scripts/syslogs.js
  21. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/arrow.png
  22. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/bg.png
  23. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/body.png
  24. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/button.png
  25. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/checkbox.png
  26. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/clogout.png
  27. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/creboot.png
  28. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/favicon.ico
  29. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/footer.png
  30. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/header.png
  31. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/loader.gif
  32. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/loginbox.png
  33. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/msg.png
  34. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/navbody.png
  35. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/navfoot.png
  36. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/navhead1.png
  37. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/navhead2.png
  38. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/radiobtn.png
  39. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/rj45off.gif
  40. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/rj45on.gif
  41. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/select.png
  42. BIN
      files/usr/lib/kagera/webui/themes/kagera/images/stripes.png
  43. 576
    0
      files/usr/lib/kagera/webui/themes/kagera/style.css
  44. 1
    0
      files/usr/lib/kagera/webui/themes/kagera/style.dat
  45. 13
    0
      prepdicts.sh

+ 339
- 0
COPYING Wyświetl plik

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble

The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.

When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.

We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and
modification follow.

GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

END OF TERMS AND CONDITIONS

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>

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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:

Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.

<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

+ 10
- 0
README Wyświetl plik

@@ -0,0 +1,10 @@
Kagera Web Interface
====================

Kagera WebUI is a Web-based User Interface (WUI) for the Kagera Router Management
Utility, that accepts input and provide output by generating web pages which are
transmitted via the network and viewed by the end-user using a web browser. This
software utilizes Bash, JavaScript and AJAX technologies to provide a real-time
control in the networking environment, eliminating the need to refresh a
traditional web browser and thus, allowing to easily configure embedded devices,
Kagera is running on.

+ 0
- 4
README.md Wyświetl plik

@@ -1,4 +0,0 @@
webui
=====

Kagera Web Interface

+ 8
- 0
files/etc/config/kagera Wyświetl plik

@@ -0,0 +1,8 @@
config webui webui
option protocol "http"
option http_port "80"
option https_port "443"
option multimenu "1"
option language "english"
option theme "kagera"
option timeout "15"

+ 33
- 0
files/etc/init.d/webui Wyświetl plik

@@ -0,0 +1,33 @@
#!/bin/sh /etc/rc.common

START=51
PID_HTTP=/var/run/webui-http.pid
PID_HTTPS=/var/run/webui-https.pid

start() {
config_load "kagera"
config_get CERT_FILE "webui" cert_file
config_get HTTP_PORT "webui" http_port
config_get HTTPS_PORT "webui" https_port
config_get UI_LANG "webui" language
config_get PROTOCOL "webui" protocol

[ -z "$CERT_FILE" ] && CERT_FILE="/usr/lib/kagera/kagera.pem"
[ -z "$HTTP_PORT" ] && HTTP_PORT="80"
[ -z "$HTTPS_PORT" ] && HTTPS_PORT="443"
[ -z "$UI_LANG" ] && UI_LANG="english"
[ -z "$PROTOCOL" ] && PROTOCOL="http"

if [ "$PROTOCOL" == "http" ]; then
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTP" -p "$HTTP_PORT" -L "$UI_LANG" 2>/dev/null
elif [ "$PROTOCOL" == "https" ]; then
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTPS" -p "$HTTPS_PORT" -S -E "$CERT_FILE" -L "$UI_LANG" 2>/dev/null
else
kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTPS" -p "$HTTP_PORT" -SP "$HTTPS_PORT" -S -E "$CERT_FILE" -L "$UI_LANG" 2>/dev/null
fi
}

stop() {
[ -f "$PID_HTTP" ] && kill "$(cat $PID_HTTP)" 2>/dev/null
[ -f "$PID_HTTPS" ] && kill "$(cat $PID_HTTPS)" 2>/dev/null
}

+ 8
- 0
files/usr/lib/kagera/config/about.cbsi Wyświetl plik

@@ -0,0 +1,8 @@
#!/usr/bin/cbsi

<h1><%@ About Firmware %></h1>
<p><%@ Kagera Router Management Utility is a Linux based alternative Open Source firmware for powering a variety of WLAN routers. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used. Kagera is built atop the OpenWrt project, which has great Linux Kernel support for many embedded devices, bringing its strengths and opens a whole new world of possibilities. This project would clearly not have been possible without all the hard work of the OpenWrt Team. More information about the firmware can be found on the <a href="http://kagera.eu.org/" target="_blank">Kagera project website</a>. %></p>

<h2><%@ License Information %></h2>
<p><%@ Kagera Router Management Utility is a free software; you can redistribute it and/or modify it under the terms of the <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GNU General Public License version 2.0</a> as published by the Free Software Foundation. Part of this license outlines requirements for derivative works, such as plugins or themes. There is some legal grey area regarding what is considered a derivative work, but we feel strongly that plugins and themes are derivative work and thus inherit the GPL license. %></p>
<p><%@ 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 v2 for more details. %></p>

+ 17
- 0
files/usr/lib/kagera/config/command.cbsi Wyświetl plik

@@ -0,0 +1,17 @@
#!/usr/bin/cbsi

<h1><%@ Run Custom Commands %></h1>
<form>
<textarea id="cmds"></textarea>
<div class="hidden">
<h2><%@ Output %></h2>
<div class="code">
<pre id="output"></pre>
</div>
</div>
<hr />
<div class="formctrl">
<input type="reset" value="<%@ Reset %>" />
<input type="button" value="<%@ Run %>" onclick="runScript()" />
</div>
</form>

+ 114
- 0
files/usr/lib/kagera/config/overview.cbsi Wyświetl plik

@@ -0,0 +1,114 @@
#!/usr/bin/cbsi

<%
. /etc/version && . /etc/openwrt_release
MEM_FREE=$(sed -e '/^MemFree: /!d; s#MemFree: *##; s# kB##g' /proc/meminfo | awk '{printf "%.2f", $1/1000}')
MEM_TOTAL=$(sed -e '/^MemTotal: /!d; s#MemTotal: *##; s# kB##g' /proc/meminfo | awk '{printf "%.2f", $1/1000}')
MEM_PERCENT=$(echo "${MEM_FREE} ${MEM_TOTAL}" | awk '{printf "%.2f", $1*100/$2}')
UPTIME=$(cat /proc/uptime | cut -d '.' -f1)
UPTIME_S=$(printf "%02d" $((UPTIME%60)))
UPTIME_M=$(printf "%02d" $((UPTIME/60%60)))
UPTIME_H=$(printf "%02d" $((UPTIME/60/60%24)))
UPTIME_D=$((UPTIME/60/60/24))

if [ -f /sbin/swconfig ]; then
BOARD=$(cat /tmp/sysinfo/board_name)
case "${BOARD}" in
routerstation-pro)
SWPORTS="4 3 2"
WANPORT="eth0";;
*)
SWPORTS="";;
esac
if [ "${SWPORTS}" != "" ]; then
if [ "$(ethtool ${WANPORT} | grep "Link detected" | cut -d" " -f3)" == "no" ]; then
STATUS="-----"
IMG="off"
else
LINK=$(ethtool ${WANPORT} | grep "Speed" | cut -d" " -f2)
IMG="on"
case "${LINK}" in
"1000Mb/s") STATUS="1 Gbit/s";;
"100Mb/s") STATUS="100 Mbit/s";;
*) STATUS="10 Mbit/s";;
esac
fi
PORTNO="${PORTNO}<td>WAN</td><td></td>"
PORTIMG="${PORTIMG}<td><img src=\"themes/kagera/images/rj45${IMG}.gif\" alt=\"${IMG}\" /></td><td></td>"
PORTSPEED="${PORTSPEED}<td>${STATUS}</td><td></td>"
for PORT in ${SWPORTS}; do
LINK=$(swconfig dev switch0 port $PORT get link | cut -f2,3 -d" ")
N=$((N+1))
case "${LINK}" in
"link:up speed:1000baseT") STATUS="1 Gbit/s" IMG="on";;
"link:up speed:100baseT") STATUS="100 Mbit/s" IMG="on";;
"link:up speed:10baseT") STATUS="10 Mbit/s" IMG="on";;
"link:down") STATUS="-----" IMG="off";;
esac
PORTNO="${PORTNO}<td>LAN ${N}</td>"
PORTIMG="${PORTIMG}<td><img src=\"themes/kagera/images/rj45${IMG}.gif\" alt=\"${IMG}\" /></td>"
PORTSPEED="${PORTSPEED}<td>${STATUS}</td>"
done
fi
fi
%>
<h1><%@ System Overview %></h1>
<table class="confdata">
<tr>
<td class="name"><%@ Router Model %></td>
<td class="value"><% [ -e /tmp/sysinfo/model ] && cat /tmp/sysinfo/model || %><%@ Unknown %></td>
</tr>
<tr>
<td class="name"><%@ Chipset %></td>
<td class="value"><% cat /proc/cpuinfo | sed 2,20d | cut -c16- %></td>
</tr>
<tr>
<td class="name"><%@ CPU Frequency %></td>
<td class="value"><% dmesg | grep Clocks: | awk -F: '{print $3}' | cut -d. -f1 %> <small>MHz</small></td>
</tr>
<tr>
<td class="name"><%@ Flash Size %></td>
<td class="value"><% dmesg | grep m25p80 | grep Kbytes | cut -d '(' -f2 | cut -d ' ' -f1 | awk '{print $1/1024}' %> <small>MB</small></td>
</tr>
<tr>
<td class="name"><%@ Firmware Version %></td>
<td class="value"><%: ${SYSTEM_VERSION} %>, <%@ built on %>&nbsp;<%: ${SYSTEM_BUILDDATE} %></td>
</tr>
<tr>
<td class="name"><%@ OpenWrt Revision %></td>
<td class="value"><%: ${DISTRIB_REVISION} %></td>
</tr>
<tr>
<td class="spacer" colspan="2"></td>
</tr>
<tr>
<td class="name"><%@ Current Date & Time %></td>
<td class="value"><% date "+%d/%m/%Y %H:%M:%S %Z" %></td>
</tr>
<tr>
<td class="name"><%@ System Uptime %></td>
<td class="value"><%: ${UPTIME_D} %>&nbsp;<%@ days %>, <%: ${UPTIME_H}:${UPTIME_M}:${UPTIME_S} %></td>
</tr>
<tr>
<td class="name"><%@ Total / Free Memory %></td>
<td class="value"><%: ${MEM_TOTAL} %> <small>MB</small> / <%: ${MEM_FREE} %> <small>MB (<%: ${MEM_PERCENT}% %>)</small></td>
</tr>
<tr>
<td class="name"><%@ CPU Load <small>(1 / 5 / 15 mins)</small> %></td>
<td class="value"><% awk '{print $1 " / " $2 " / " $3}' /proc/loadavg %></td>
</tr>
</table>
<% if [ "${SWPORTS}" != "" ]; then %>
<h2><%@ Ethernet Ports State %></h2>
<table class="portstate">
<tr class="portno">
<%: ${PORTNO} %>
</tr>
<tr class="portimg">
<%: ${PORTIMG} %>
</tr>
<tr class="portspeed">
<%: ${PORTSPEED} %>
</tr>
</table>
<% fi %>

+ 25
- 0
files/usr/lib/kagera/config/syslogs.cbsi Wyświetl plik

@@ -0,0 +1,25 @@
#!/usr/bin/cbsi

<h1><%@ System Logs %></h1>
<table class="confdata">
<tr>
<td class="name"><%@ Displayed Logs %></td>
<td class="value">
<label class="select"><select id="switch" onchange="switchView('output', this.value);">
<option value="syslog" selected="selected"><%@ General System Logs %></option>
<option value="krnlog"><%@ Kernel Messages %></option>
<option value="prclog"><%@ List of Processes %></option>
<option value="mntlog"><%@ Mount Points %></option>
</select></label>
</td>
</tr>
<tr>
<td class="spacer" colspan="2"></td>
</tr>
</table>
<div class="code" id="output">
<pre id="syslog"><% logread %></pre>
<pre id="krnlog"><% dmesg %></pre>
<pre id="prclog"><% ps %></pre>
<pre id="mntlog"><% mount %></pre>
</div>

+ 32
- 0
files/usr/lib/kagera/kagera.pem Wyświetl plik

@@ -0,0 +1,32 @@
-----BEGIN PRIVATE KEY-----
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAM/u0ggHo+9vrGdJ
0vFAMFc9zoVE2NeNfy1bo/B1bTRvYM+9k5w1cB16A8eLXGnF+12t2BPsLdAfw6XH
WhsRQ5YWE73MYpwcL2JVPnUyOfPpNHiI3wF7TeINVZI7YRiezUdMJvroCcYyQamt
y3xRLRlfHHrKdC396lAlrA9Y1YbzAgMBAAECgYB6rYKJbkiQWaiz/+BOqfpbXoHc
KvRsqHTiQ/EDS6S0jQnnRwgx321YVsaoElbhqQdXC9wyVOPqqPL7ehR1Z8ghUTrL
5aoNXhTXTEd5KqQQsiR3NvY/s7V74wZRz2nMBF57wPFovQu1ddgeH/ZUR1HT9XTY
8a+bv1JrhObGv9JMUQJBAP4yHT97tY42YeIOdNmP4BufpVdMK4IvF0nkWdBssBvJ
aDHMv40z92Uf08EFRdxmEZglHUvlbgR6dMW7lFE2aQ8CQQDRaKT08QzSasp/CJx6
Nd+XC3KSzAkBrgQVP1+Z+m/cGfHHA+zXomaKMtnvw4ywFf6vWeSzbX2gtC2VSbEN
M9vdAkA5qAJMUPIIVLt0+9RzOJgbi+WD3IoN2EKPBxV8GfsEAnX4vblA/OWDcWml
YV3MNPaOrPRtL5f5uhDcfMSSeyXvAkEAtUSaFhVa/gHHC7POj9N2mm8kXIIWAcg6
bJIRFV692Y7zxUxWhkpj7JkcIfnqHLrNXci4ucC7kJKnKqVBh6YuWQJBAPfMcEEl
OHplIKZtBGVkX4PQFnhTJIO0hNCgdMNjw8Xn2kyvnc22fO3iKeLjPBssi6u1bdPF
N4il4Ch/p4Kr+Pc=
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
MIICfzCCAeigAwIBAgIJAKL/ci6AhIbiMA0GCSqGSIb3DQEBBQUAMHYxCzAJBgNV
BAYTAkVVMRcwFQYDVQQIEw5FdXJvcGVhbiBVbmlvbjEjMCEGA1UEChMaQXNpbyBT
b2Z0d2FyZSBUZWNobm9sb2dpZXMxKTAnBgNVBAMTIEthZ2VyYSBSb3V0ZXIgTWFu
YWdlbWVudCBVdGlsaXR5MB4XDTEzMDUwMTExMTQyNFoXDTMzMTExMjExMTQyNFow
djELMAkGA1UEBhMCRVUxFzAVBgNVBAgTDkV1cm9wZWFuIFVuaW9uMSMwIQYDVQQK
ExpBc2lvIFNvZnR3YXJlIFRlY2hub2xvZ2llczEpMCcGA1UEAxMgS2FnZXJhIFJv
dXRlciBNYW5hZ2VtZW50IFV0aWxpdHkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
AoGBAM/u0ggHo+9vrGdJ0vFAMFc9zoVE2NeNfy1bo/B1bTRvYM+9k5w1cB16A8eL
XGnF+12t2BPsLdAfw6XHWhsRQ5YWE73MYpwcL2JVPnUyOfPpNHiI3wF7TeINVZI7
YRiezUdMJvroCcYyQamty3xRLRlfHHrKdC396lAlrA9Y1YbzAgMBAAGjFTATMBEG
CWCGSAGG+EIBAQQEAwIGQDANBgkqhkiG9w0BAQUFAAOBgQCZJJzk1vhwnsgSXoSb
Q2ycYOfqnxQ7SHCZgmBWTsLs3COWf663KD1DwbUx8fqioXuhYvjZqGDbb/F2FpB6
Lv4uf/+O4VgNaum3E3TZW1M52/Oge3Zf0x95UWbh5+I0WmD+DqeXBXt1215axpVo
6wthLQu85vsgaVLbc2k8aEAxTw==
-----END CERTIFICATE-----

+ 14
- 0
files/usr/lib/kagera/langs/TEMPLATE/about.dic Wyświetl plik

@@ -0,0 +1,14 @@
msgid "About Firmware"
msgstr ""

msgid "Kagera Router Management Utility is a Linux based alternative Open Source firmware for powering a variety of WLAN routers. The main emphasis lies on providing the easiest possible handling while at the same time supporting a great number of functionalities within the framework of the respective hardware platform used. Kagera is built atop the OpenWrt project, which has great Linux Kernel support for many embedded devices, bringing its strengths and opens a whole new world of possibilities. This project would clearly not have been possible without all the hard work of the OpenWrt Team. More information about the firmware can be found on the <a href="http://kagera.eu.org/" target="_blank">Kagera project website</a>."
msgstr ""

msgid "License Information"
msgstr ""

msgid "Kagera Router Management Utility is a free software; you can redistribute it and/or modify it under the terms of the <a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank">GNU General Public License version 2.0</a> as published by the Free Software Foundation. Part of this license outlines requirements for derivative works, such as plugins or themes. There is some legal grey area regarding what is considered a derivative work, but we feel strongly that plugins and themes are derivative work and thus inherit the GPL license."
msgstr ""

msgid "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 v2 for more details."
msgstr ""

+ 11
- 0
files/usr/lib/kagera/langs/TEMPLATE/command.dic Wyświetl plik

@@ -0,0 +1,11 @@
msgid "Run Custom Commands"
msgstr ""

msgid "Output"
msgstr ""

msgid "Reset"
msgstr ""

msgid "Run"
msgstr ""

+ 59
- 0
files/usr/lib/kagera/langs/TEMPLATE/common.dic Wyświetl plik

@@ -0,0 +1,59 @@
msgid "Executing commands..."
msgstr ""

msgid "Applying system changes..."
msgstr ""

msgid "Restarting services..."
msgstr ""

msgid "Downloading firmware image..."
msgstr ""

msgid "Flashing image..."
msgstr ""

msgid "Rebooting device..."
msgstr ""

msgid "Do you really want to reboot?"
msgstr ""

msgid "Reboot"
msgstr ""

msgid "Logout"
msgstr ""

msgid "Status"
msgstr ""

msgid "Overview"
msgstr ""

msgid "Run Command"
msgstr ""

msgid "System Logs"
msgstr ""

msgid "System"
msgstr ""

msgid "About Kagera"
msgstr ""

msgid "Authorization Required"
msgstr ""

msgid "User Name:"
msgstr ""

msgid "Password:"
msgstr ""

msgid "Reset"
msgstr ""

msgid "Login"
msgstr ""

+ 44
- 0
files/usr/lib/kagera/langs/TEMPLATE/overview.dic Wyświetl plik

@@ -0,0 +1,44 @@
msgid "System Overview"
msgstr ""

msgid "Router Model"
msgstr ""

msgid "Unknown"
msgstr ""

msgid "Chipset"
msgstr ""

msgid "CPU Frequency"
msgstr ""

msgid "Flash Size"
msgstr ""

msgid "Firmware Version"
msgstr ""

msgid "built on"
msgstr ""

msgid "OpenWrt Revision"
msgstr ""

msgid "Current Date & Time"
msgstr ""

msgid "System Uptime"
msgstr ""

msgid "days"
msgstr ""

msgid "Total / Free Memory"
msgstr ""

msgid "CPU Load <small>(1 / 5 / 15 mins)</small>"
msgstr ""

msgid "Ethernet Ports State"
msgstr ""

+ 17
- 0
files/usr/lib/kagera/langs/TEMPLATE/syslogs.dic Wyświetl plik

@@ -0,0 +1,17 @@
msgid "System Logs"
msgstr ""

msgid "Displayed Logs"
msgstr ""

msgid "General System Logs"
msgstr ""

msgid "Kernel Messages"
msgstr ""

msgid "List of Processes"
msgstr ""

msgid "Mount Points"
msgstr ""

+ 104
- 0
files/usr/lib/kagera/webui/index.sh Wyświetl plik

@@ -0,0 +1,104 @@
#!/usr/bin/cbsi
<%
THEME=$(uci get kagera.webui.theme)
TIMEOUT=$(uci get kagera.webui.timeout)
if [ "${GET_option}" == "logout" ]; then
eval $(sessmgr -l -r "index.sh?option=overview")
elif [ "${POST_sessopen}" == "1" ] && [ -n "${POST_sesspass}" ]; then
sleep 3
eval $(sessmgr -u "${POST_sessuser}" -p "${POST_sesspass}" -b "${COOKIE_browser_time}" -a "${HTTP_USER_AGENT}" -i "${REMOTE_ADDR}" -t "${TIMEOUT}" -r "index.sh?option=${GET_option}")
fi
eval $(sessmgr -c "${COOKIE_kagera_sid}" -u "${COOKIE_kagera_usr}" -e "${COOKIE_kagera_exp}" -b "${COOKIE_browser_time}" -a "${HTTP_USER_AGENT}" -i "${REMOTE_ADDR}" -t "${TIMEOUT}")
[ -f /usr/lib/kagera/config/${GET_option}.cbsi ] || GET_option="overview"
if [ -n "${GET_refresh}" ]; then
echo "Content-type: text/plain; charset=utf-8"
if [ -n "${VALIDSESS}" ]; then
if [ "${GET_runcommand}" == "1" ]; then
if [ -n "${POST_commands}" ]; then
echo ""
echo "${POST_commands}" | tr -d "\r" > /tmp/run.sh
sh /tmp/run.sh
rm -f /tmp/run.sh
fi
else
/usr/bin/cbsi /usr/lib/kagera/config/${GET_option}.cbsi
fi
fi
exit
fi
echo "Content-type: text/html; charset=utf-8"
. /etc/version
%>
<!DOCTYPE html>
<html>
<head>
<title>Kagera Router Management Utility</title>
<meta name="robots" content="noindex,nofollow" />
<link rel="shortcut icon" href="/themes/kagera/images/favicon.ico"/>
<link rel="stylesheet" href="<%: themes/${THEME}/style.css %>" />
<script src="scripts/kagera.js" type="text/javascript"></script>
<script src="<%: scripts/${GET_option}.js %>" type="text/javascript"></script>
<script>
var sysmsg = ["<%@ Executing commands... %>", "<%@ Applying system changes... %>", "<%@ Restarting services... %>", "<%@ Downloading firmware image... %>", "<%@ Flashing image... %>", "<%@ Rebooting device... %>", "<%@ Do you really want to reboot? %>"];
var multimenu = <% uci get kagera.webui.multimenu %>;
</script>
</head>
<body>
<% if [ "${VALIDSESS}" == "1" ]; then %>
<div class="webui">
<div class="header">
<div class="logo">
<span id="title"><%: ${SYSTEM_DESCRIPTION} %></span>
<span id="version"><%: ${SYSTEM_VERSION} %></span>
</div>
<div class="controls">
<input type="button" class="creboot" value="<%@ Reboot %>" onclick="reboot(true);" />
<input type="button" class="clogout" value="<%@ Logout %>" onclick="logout();" />
</div>
</div>
<div class="body">
<div id="mainmenu">
<div class="navbox">
<span class="navheader"><%@ Status %></span>
<ul class="navbody">
<li><a href="index.sh?option=overview"><%@ Overview %></a></li>
<li><a href="index.sh?option=command"><%@ Run Command %></a></li>
<li><a href="index.sh?option=syslogs"><%@ System Logs %></a></li>
</ul>
<span class="navfooter"></span>
</div>
<div class="navbox">
<span class="navheader"><%@ System %></span>
<ul class="navbody">
<li><a href="index.sh?option=about"><%@ About Kagera %></a></li>
</ul>
<span class="navfooter"></span>
</div>
</div>
<div id="content">
<% /usr/bin/cbsi -t ${GET_option} /usr/lib/kagera/config/${GET_option}.cbsi %>
</div>
</div>
<div class="footer">
Copyright&copy; 2010-2013, <a href="http://www.asiotec.eu.org" target="_blank">Asio Software Technologies</a>
</div>
<% else %>
<div class="loginbox">
<div class="body">
<form action="<%: index.sh?option=${GET_option} %>" method="POST">
<h1><%@ Authorization Required %></h1>
<label><%@ User Name: %></label><input type="text" name="sessuser" autofocus="autofocus" />
<label><%@ Password: %></label><input type="password" name="sesspass" />
<hr />
<div class="formctrl">
<input type="hidden" name="sessopen" value="1" />
<input type="reset" value="<%@ Reset %>" />
<input type="submit" value="<%@ Login %>" />
</div>
</form>
</div>
<% fi %>
</div>
<div id="dim"></div><div id="msg"><img src="<%: themes/${THEME}/images/loader.gif %>" alt="L" /></div>
</body>
</html>

+ 11
- 0
files/usr/lib/kagera/webui/scripts/command.js Wyświetl plik

@@ -0,0 +1,11 @@
function runScript() {
toggleMsg(sysmsg[0]);
var commands = [];
commands.push(document.getElementById("cmds").value);
statefunc = function(req) {
document.getElementById("output").innerHTML = req.responseText;
document.getElementsByClassName("hidden")[0].style.display = "inline";
toggleMsg();
}
runCommand(commands.join("\n"), statefunc, false);
}

+ 245
- 0
files/usr/lib/kagera/webui/scripts/kagera.js Wyświetl plik

@@ -0,0 +1,245 @@
function getRequest() {
var req;
if(window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
return req;
}

function initMenu() {
this.menu = document.getElementById("mainmenu");
this.submenus = this.menu.getElementsByTagName("div");
this.oneSmOnly = 3;

this.collapseMenu = function(submenu) {
var minHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
var moveBy = Math.round(4 * submenu.getElementsByTagName("a").length);
var mainInstance = this;
var intId = setInterval(function() {
var curHeight = submenu.offsetHeight;
var newHeight = curHeight - moveBy;
if(newHeight > minHeight) {
submenu.style.height = newHeight + "px";
} else {
clearInterval(intId);
submenu.style.height = "";
submenu.className = "collapsed";
mainInstance.memorize();
}
}, 30);
};

this.collapseOthers = function(submenu) {
if(!multimenu) {
for(var i = 0; i < this.submenus.length; i++) {
if(this.submenus[i] != submenu && this.submenus[i].className != "collapsed") {
this.collapseMenu(this.submenus[i]);
}
}
}
};

this.expandMenu = function(submenu) {
var fullHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
var links = submenu.getElementsByTagName("a");
for(var i = 0; i < links.length; i++) {
fullHeight += links[i].offsetHeight;
}
var moveBy = Math.round(4 * links.length);
var mainInstance = this;
var intId = setInterval(function() {
var curHeight = submenu.offsetHeight;
var newHeight = curHeight + moveBy;
if(newHeight < fullHeight) {
submenu.style.height = newHeight + "px";
} else {
clearInterval(intId);
submenu.style.height= "";
submenu.className = "navbox";
mainInstance.memorize();
}
}, 30);
this.collapseOthers(submenu);
};

this.init = function() {
var mainInstance = this;
for(var i = 0; i < this.submenus.length; i++) {
this.submenus[i].getElementsByTagName("span")[0].onclick = function() {
if(this.parentNode.className == "collapsed") {
mainInstance.expandMenu(this.parentNode);
} else {
mainInstance.collapseMenu(this.parentNode);
}
};
}
var links = this.menu.getElementsByTagName("a");
links[0].className = "active";
for(var i = 0; i < links.length; i++) {
if(links[i].href == document.location.href) {
links[0].className = "";
links[i].className = "active";
break;
}
}
var regex = new RegExp("kagera_" + encodeURIComponent("mainmenu") + "=([01]+)");
var match = regex.exec(document.cookie);
if(match) {
var states = match[1].split("");
for(var i = 0; i < states.length; i++) {
this.submenus[i].className = (states[i] == 0 ? "collapsed" : "navbox");
}
} else if(!multimenu) {
this.collapseOthers(this.submenus[0]);
}
};

this.memorize = function() {
var states = new Array();
for(var i = 0; i < this.submenus.length; i++) {
states.push(this.submenus[i].className == "collapsed" ? 0 : 1);
var d = new Date();
d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
document.cookie = "kagera_" + encodeURIComponent("mainmenu") + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";
}
};
}

function initTips() {
var help = document.getElementById("help")
if(help) {
var abbrs = document.getElementsByTagName("abbr");
var tips = help.getElementsByTagName("div");
var mouseX, mouseY;
document.onmousemove = function(e) {
mouseX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
mouseY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
};
for(var i = 0; i < abbrs.length; i++) {
abbrs[i].onclick = function() {
for(var a = 0; a < tips.length; a++) {
if("s" + tips[a].id == this.id) {
tips[a].style.left = mouseX + "px";
tips[a].style.top = (mouseY - (tips[a].offsetHeight + 3)) + "px";
tips[a].style.visibility = "visible";
break;
}
}
};
abbrs[i].onmouseout = function() {
for(var a = 0; a < tips.length; a++) {
if("s" + tips[a].id == this.id) {
tips[a].style.visibility = "hidden";
break;
}
}
};
}
}
}

function logout() {
window.location.href="index.sh?option=logout";
}

function reboot(ask) {
var boot = true;
if(ask) {
var answer = confirm(sysmsg[6]);
if(!answer) {
boot = false;
}
}
if(boot) {
toggleMsg(sysmsg[5]);
statefunc = function() {
window.location.href="index.sh?option=overview";
}
testcon = function() {
runRequest("GET", document.location.href, "&refresh=1", statefunc, false);
}
runCommand("reboot", statefunc, true);
setInterval("testcon()", 5000);
}
}

function refreshData(func) {
statefunc = function(req) {
document.getElementById("content").innerHTML = req.responseText;
var target = document.getElementById("content");
var scripts = target.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++) {
eval(scripts[i].innerHTML);
}
if(typeof func == "function") {
func();
}
}
runRequest("GET", document.location.href, "&refresh=1", statefunc, false);
}

function runCommand(params, statefunc, noreload) {
runRequest("POST", document.location.href + "&refresh=1&runcommand=1", "commands=" + params, statefunc, noreload);
}

function runRequest(method, url, params, statefunc, noreload) {
var req = getRequest();
if(req) {
req.onreadystatechange = function() {
if(req.readyState == 4 && req.status == 200) {
if(req.responseText != "") {
statefunc(req);
} else if(!noreload) {
location.reload(true);
}
}
}
if(method == "POST") {
req.open("POST", url, true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
} else {
req.open("GET", url + params, true);
req.send();
}
}
return req;
}

function switchView(outid, swval) {
sw = document.getElementById(outid);
for(var i = 0; i < sw.children.length; i++) {
if(sw.children[i].id == swval) {
sw.children[i].style.display = "block";
} else {
sw.children[i].style.display = "none";
}
}
}

function toggleMsg(msg) {
dimbox = document.getElementById("dim");
msgbox = document.getElementById("msg");
if(msg) {
document.body.style.overflow = "hidden";
msgbox.innerHTML = msgtxt + "&nbsp;&nbsp;" + msg;
dimbox.style.display = "inline";
msgbox.style.display = "inline";
} else {
msgbox.style.display = "none";
dimbox.style.display = "none";
document.body.style.overflow = "auto";
}
}

window.onload = function() {
msgtxt = document.getElementById("msg").innerHTML;
mainmenu = new initMenu();
mainmenu.init();
initTips();
if(typeof initModule == "function") {
initModule();
}
}

+ 3
- 0
files/usr/lib/kagera/webui/scripts/overview.js Wyświetl plik

@@ -0,0 +1,3 @@
function initModule() {
setInterval("refreshData()", 10000);
}

+ 3
- 0
files/usr/lib/kagera/webui/scripts/syslogs.js Wyświetl plik

@@ -0,0 +1,3 @@
function initModule() {
switchView("output", document.getElementById("switch").value);
}

BIN
files/usr/lib/kagera/webui/themes/kagera/images/arrow.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/bg.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/body.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/button.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/checkbox.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/clogout.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/creboot.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/favicon.ico Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/footer.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/header.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/loader.gif Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/loginbox.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/msg.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navbody.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navfoot.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navhead1.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navhead2.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/radiobtn.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/rj45off.gif Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/rj45on.gif Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/select.png Wyświetl plik


BIN
files/usr/lib/kagera/webui/themes/kagera/images/stripes.png Wyświetl plik


+ 576
- 0
files/usr/lib/kagera/webui/themes/kagera/style.css Wyświetl plik

@@ -0,0 +1,576 @@
a {
color : #868686;
text-decoration : none;
}

abbr {
border-bottom : 1px dotted #666;
cursor : help;
font-variant : normal;
}

body {
background-attachment : fixed;
background-image : url('images/bg.png');
color : #868686;
font-family : Arial;
padding-top : 25px;
}

button, input[type=button], input[type=reset], input[type=submit] {
background : transparent url('images/button.png');
border : 0px;
color : #DDDDDD;
height : 31px;
text-shadow : #000000 1px 1px;
width : 104px;
}

button:hover, input[type=button]:hover, input[type=reset]:hover, input[type=submit]:hover {
background-position : center;
}

button:active, input[type=button]:active, input[type=reset]:active, input[type=submit]:active {
background-position : bottom;
}

h1 {
border-bottom : 1px solid #C9C9C9;
color : #C9C9C9;
font-family : "trebuchet ms";
font-size : 20px;
font-weight : bold;
margin : 2px 0px 15px 0px;
text-shadow : 1px 1px #000000;
}

h2 {
border-bottom : 1px solid #C9C9C9;
color : #C9C9C9;
font-family : "trebuchet ms";
font-size : 20px;
font-weight : bold;
margin : 35px 0px 15px 0px;
text-shadow : 1px 1px #000000;
}

hr {
border-bottom : 1px solid #3F3A3E;
border-left : none;
border-right : none;
border-top : 1px solid #000000;
clear : both;
margin-top : 35px;
}

img {
border : 0px;
}

input[type=checkbox], input[type=radio] {
display : none;
}

input[type=checkbox] + label, input[type=radio] + label {
background-repeat : no-repeat;
background-position : 0 0;
cursor : pointer;
display : inline-block;
font-size : 12px;
height : 15px;
line-height : 15px;
padding-left : 20px;
vertical-align : middle;
}

input[type=checkbox]:checked + label, input[type=radio]:checked + label {
background-position : 0 -15px;
}

input[type=checkbox]:checked + label:hover, input[type=radio]:checked + label:hover {
background-position : 0 -45px;
}

input[type=checkbox] + label:hover, input[type=radio] + label:hover {
background-position : 0 -30px;
}

input[type="checkbox"]:disabled + label, input[type="radio"]:disabled + label {
background-position : 0 -60px;
color : #505050;
cursor : default;
}

input[type=checkbox] + label {
background-image : url('images/checkbox.png');
}

input[type=radio] + label {
background-image : url('images/radiobtn.png');
}

input[type=password], input[type=text] {
background-color : #2B2B2B;
border : 1px solid #191919;
box-shadow : inset 0px 2px 1px #242424, 0 1px 0 #303030;
color : #919191;
font-family : arial;
font-size : 12px;
height : 16px;
margin : -1px 0px -1px 0px;
padding : 0px 3px 0px 3px;
width : 278px;
}

input[type=password]:focus, input[type=text]:focus, input[type=password]:hover, input[type=text]:hover {
background-color : #383838;
box-shadow : inset 0px 2px 1px #292929, 0 1px 0 #303030;
}

input[type=password]:disabled, input[type=text]:disabled {
background-color : #1E1E1E;
box-shadow : inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
color : #505050;
}

input.clogout {
background : transparent url('images/clogout.png');
border : 0px;
color : #DDDDDD;
font-family : Arial;
font-size : 12px;
height : 81px;
padding-top : 41px;
text-shadow : #000000 1px 1px;
width : 80px;
}

input.creboot {
background : transparent url('images/creboot.png');
border : 0px;
color : #DDDDDD;
font-family : Arial;
font-size : 12px;
height : 81px;
padding-top : 41px;
text-shadow : #000000 1px 1px;
width : 80px;
}

input.creboot:hover, input.clogout:hover {
background-position : center;
}

input.creboot:active, input.clogout:active {
background-position : bottom;
}

option {
cursor : default;
}

p {
margin-bottom : 10px;
text-align : justify;
}

p a {
border-bottom : 1px dotted #666;
}

pre {
color : #B9B9B9;
font-size : 12px;
margin : 2px 2px 2px 2px;
}

select {
-moz-appearance : none;
-webkit-appearance : none;
appearance : none;
background-color : #2B2B2B;
border : 1px solid #191919;
box-shadow : inset 0px 2px 1px #242424, 0 1px 0 #303030;
color : #919191;
cursor : pointer;
display : inline-block;
font-family : arial;
font-size : 12px;
height : 17px;
margin : -1px 0px -1px 0px;
outline : none;
padding : 0px 3px 0px 0px;
width : 285px;
}

select:hover {
background-color : #383838;
box-shadow : inset 0px 2px 1px #292929, 0 1px 0 #303030;
}

select:disabled {
background-color : #1E1E1E;
box-shadow : inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
color : #505050;
cursor : default;
}

small {
font-size : 11px;
}

table {
border-collapse : collapse;
border-spacing : 0px;
}

textarea {
background-color : #2B2B2B;
border : 1px solid #191919;
box-shadow : inset 0px 2px 1px #242424, 0 1px 0 #303030;
color : #919191;
font-size : 12px;
height : 300px;
padding : 2px 2px 2px 2px;
overflow : auto;
resize : vertical;
white-space : pre;
width : 766px;
word-wrap : normal;
}

textarea:focus, textarea:hover {
background-color : #383838;
box-shadow : inset 0px 2px 1px #292929, 0 1px 0 #303030;
}

textarea:disabled, textarea:disabled {
background-color : #1E1E1E;
box-shadow : inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
color : #505050;
}

.body {
background-image : url('images/body.png');
clear : both;
float : left;
width : 1006px;
}

.code {
background-color : #1D1D1D;
border : 1px solid #141414;
box-shadow : inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
height : 500px;
overflow : auto;
width : 770px;
}

.collapsed {
margin-bottom : 20px;
margin-top : 7px;
overflow : hidden;
height : 40px;
}

.collapsed .navbody a.active {
border-top : none;
margin-top : 0px;
}

.collapsed .navheader {
background-image : url('images/navhead2.png');
background-repeat : no-repeat;
}

#content {
color : #919191;
float : right;
font-family : Arial;
font-size : 14px;
margin-bottom : 7px;
margin-right : 20px;
margin-top : 7px;
padding-left : 7px;
width : 771px;
}

.controls {
float : right;
margin-right : 15px;
margin-top : 17px;
text-align : right;
}

.confdata {
line-height : 18px;
width : 772px;
}

.confdata .name {
background-color : #1D1D1D;
border : 1px solid #141414;
padding : 5px 30px 5px 5px;
width : 40%;
}

.confdata .spacer {
height : 15px;
padding : 5px 5px 5px 5px;
}

.confdata .title {
background-color : #1D1D1D;
border : 1px solid #141414;
color : #C9C9C9;
font-weight : bold;
height : 25px;
text-align : center;
}

.confdata .value {
background-color : #262626;
border : 1px solid #141414;
padding : 5px 5px 5px 5px;
}

#dim {
-moz-opacity : 0.8;
background-color : #000000;
display : none;
filter : alpha(opacity=80);
height : 200%;
left : 0px;
opacity : 0.8;
position : absolute;
top : 0px;
width : 100%;
z-index : 20;
}

.footer {
background-image : url('images/footer.png');
background-repeat : no-repeat;
clear : both;
font-size : 10px;
padding-right : 10px;
padding-top : 7px;
text-align : right;
width : 996px;
}

.formctrl {
text-align : right;
width : 100%;
}

.header {
background-image : url('images/header.png');
height : 107px;
width : 1006px;
}

.hidden {
display : none;
}

.hidden .code {
height : 250px;
}

.loginbox {
background : transparent url('images/loginbox.png') no-repeat;
font-size : 14px;
height : 191px;
left : 50%;
margin : -150px 0px 0px -224px;
padding : 22px 0px 0px 25px;
position : absolute;
top : 50%;
width : 448px;
}

.loginbox input[type=password], .loginbox input[type=text] {
margin-bottom : 12px;
float : left;
width : 205px;
}

.loginbox label {
float : left;
margin-right : 5px;
text-align : right;
width : 180px;
}

.loginbox .body {
background : none;
width : 398px;
}

.logo {
color : #6C6C6C;
float : left;
font-size : 10px;
padding-top : 83px;
text-align : right;
width : 428px;
}

#mainmenu {
float : left;
font-family : Arial, sans-serif;
padding-left : 12px;
width : 190px;
}

#msg {
background : url('images/msg.png');
color : #FFFFFF;
display : none;
font-size : 16px;
font-weight : bold;
height : 38px;
left : 50%;
margin : -23px 0px 0px -247px;
padding : 8px 0px 0px 8px;
position : absolute;
text-shadow : #000000 1px 1px;
top : 50%;
width : 487px;
z-index : 21;
}

#msg img {
vertical-align : middle;
}

.navbody {
border : none;
display : block;
list-style : none;
margin : 0px 0px 0px 0px;
padding : 0px 0px 0px 0px;
}

.navbody a {
color : #C9C9C9;
display : block;
font-family : verdana;
font-size : 13px;
font-weight : bold;
padding : 6px 9px 6px 9px;
text-decoration : none;
text-shadow : #000000 1px 1px;
}

.navbody a:hover {
background-color : #2F2F2F;
border-bottom : 1px solid #161616;
border-top : 1px solid #161616;
margin-top : -1px;
padding : 6px 9px 5px 9px;
}

.navbody a.active {
color : #FE8013;
background-color : #2F2F2F;
border-bottom : 1px solid #161616;
border-top : 1px solid #161616;
margin-top : -1px;
padding : 6px 9px 5px 9px;
}

.navbody li {
background-image : url('images/navbody.png');
padding : 0px 4px 0px 4px;
}

.navbox {
margin-top : 7px;
overflow : hidden;
}

.navfooter {
background-image : url('images/navfoot.png');
display : block;
height : 4px;
margin : -1px 0px 10px 0px;
}

.navheader {
background-image : url('images/navhead1.png');
color : #FFFFFF;
cursor : default;
display : block;
font-family : arial;
font-size : 14px;
font-weight : bold;
height : 26px;
padding-left : 12px;
padding-top : 14px;
text-shadow : #000000 1px 1px;
width : 190px;
}

.portno {
font-weight : bold;
}

.portspeed {
font-size : 10px;
}

.portstate td {
text-align : center;
width : 80px;
}

.select {
position : relative;
font-size : 16px;
}

.select:after {
background-image : url('images/arrow.png');
content : '';
height : 4px;
pointer-events : none;
position : absolute;
right : 7px;
top : 8px;
width : 8px;
}

.select:before {
background-color : #2E2E2E;
box-shadow : inset 0px 5px 4px #3E3E3E;
border : 1px solid #191919;
content : '';
height : 15px;
pointer-events : none;
position : absolute;
right : 0px;
top : 1px;
width : 20px;
}

.tips div {
background-color : #FFFFAA;
border : 1px solid #FE8013;
color : #000000;
font-family : verdana;
font-size : 12px;
padding : 3px;
position : absolute;
visibility : hidden;
z-index : 10;
}

.webui {
background-image : url('images/stripes.png');
background-repeat : no-repeat;
margin-left : auto;
margin-right : auto;
width : 1006px;
}

+ 1
- 0
files/usr/lib/kagera/webui/themes/kagera/style.dat Wyświetl plik

@@ -0,0 +1 @@
Kagera Original

+ 13
- 0
prepdicts.sh Wyświetl plik

@@ -0,0 +1,13 @@
#!/bin/bash

prepare() {
FILENAME=$(basename ${1})
perl -lne 'print for /(<%@ .*? %>)/g;' ${1} | uniq | awk '{sub($1,"",$0); sub(/^ */,"msgid \"",$0); sub($NF"$","",$0); sub(/ *$/,"\"\nmsgstr \"\"\n",$0); print}' | head -n-1 > ./files/usr/lib/kagera/langs/TEMPLATE/${FILENAME%%.*}.dic
}

mkdir -p ./files/usr/lib/kagera/langs/TEMPLATE

while read FILE; do
prepare ${FILE}
done < <(find ./files/ -type f -name \*.cbsi -o -name \*.sh)
mv ./files/usr/lib/kagera/langs/TEMPLATE/index.dic ./files/usr/lib/kagera/langs/TEMPLATE/common.dic

Ładowanie…
Anuluj
Zapisz