Browse Source

Initial import

Rafal Kupiec 5 years ago
parent
commit
9318b5b444
45 changed files with 1687 additions and 4 deletions
  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 View File

@@ -0,0 +1,339 @@
1
+                    GNU GENERAL PUBLIC LICENSE
2
+                       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+                            Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Lesser General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+                    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+    b) Accompany it with a written offer, valid for at least three
143
+    years, to give any third party, for a charge no more than your
144
+    cost of physically performing source distribution, a complete
145
+    machine-readable copy of the corresponding source code, to be
146
+    distributed under the terms of Sections 1 and 2 above on a medium
147
+    customarily used for software interchange; or,
148
+
149
+    c) Accompany it with the information you received as to the offer
150
+    to distribute corresponding source code.  (This alternative is
151
+    allowed only for noncommercial distribution and only if you
152
+    received the program in object code or executable form with such
153
+    an offer, in accord with Subsection b above.)
154
+
155
+The source code for a work means the preferred form of the work for
156
+making modifications to it.  For an executable work, complete source
157
+code means all the source code for all modules it contains, plus any
158
+associated interface definition files, plus the scripts used to
159
+control compilation and installation of the executable.  However, as a
160
+special exception, the source code distributed need not include
161
+anything that is normally distributed (in either source or binary
162
+form) with the major components (compiler, kernel, and so on) of the
163
+operating system on which the executable runs, unless that component
164
+itself accompanies the executable.
165
+
166
+If distribution of executable or object code is made by offering
167
+access to copy from a designated place, then offering equivalent
168
+access to copy the source code from the same place counts as
169
+distribution of the source code, even though third parties are not
170
+compelled to copy the source along with the object code.
171
+
172
+  4. You may not copy, modify, sublicense, or distribute the Program
173
+except as expressly provided under this License.  Any attempt
174
+otherwise to copy, modify, sublicense or distribute the Program is
175
+void, and will automatically terminate your rights under this License.
176
+However, parties who have received copies, or rights, from you under
177
+this License will not have their licenses terminated so long as such
178
+parties remain in full compliance.
179
+
180
+  5. You are not required to accept this License, since you have not
181
+signed it.  However, nothing else grants you permission to modify or
182
+distribute the Program or its derivative works.  These actions are
183
+prohibited by law if you do not accept this License.  Therefore, by
184
+modifying or distributing the Program (or any work based on the
185
+Program), you indicate your acceptance of this License to do so, and
186
+all its terms and conditions for copying, distributing or modifying
187
+the Program or works based on it.
188
+
189
+  6. Each time you redistribute the Program (or any work based on the
190
+Program), the recipient automatically receives a license from the
191
+original licensor to copy, distribute or modify the Program subject to
192
+these terms and conditions.  You may not impose any further
193
+restrictions on the recipients' exercise of the rights granted herein.
194
+You are not responsible for enforcing compliance by third parties to
195
+this License.
196
+
197
+  7. If, as a consequence of a court judgment or allegation of patent
198
+infringement or for any other reason (not limited to patent issues),
199
+conditions are imposed on you (whether by court order, agreement or
200
+otherwise) that contradict the conditions of this License, they do not
201
+excuse you from the conditions of this License.  If you cannot
202
+distribute so as to satisfy simultaneously your obligations under this
203
+License and any other pertinent obligations, then as a consequence you
204
+may not distribute the Program at all.  For example, if a patent
205
+license would not permit royalty-free redistribution of the Program by
206
+all those who receive copies directly or indirectly through you, then
207
+the only way you could satisfy both it and this License would be to
208
+refrain entirely from distribution of the Program.
209
+
210
+If any portion of this section is held invalid or unenforceable under
211
+any particular circumstance, the balance of the section is intended to
212
+apply and the section as a whole is intended to apply in other
213
+circumstances.
214
+
215
+It is not the purpose of this section to induce you to infringe any
216
+patents or other property right claims or to contest validity of any
217
+such claims; this section has the sole purpose of protecting the
218
+integrity of the free software distribution system, which is
219
+implemented by public license practices.  Many people have made
220
+generous contributions to the wide range of software distributed
221
+through that system in reliance on consistent application of that
222
+system; it is up to the author/donor to decide if he or she is willing
223
+to distribute software through any other system and a licensee cannot
224
+impose that choice.
225
+
226
+This section is intended to make thoroughly clear what is believed to
227
+be a consequence of the rest of this License.
228
+
229
+  8. If the distribution and/or use of the Program is restricted in
230
+certain countries either by patents or by copyrighted interfaces, the
231
+original copyright holder who places the Program under this License
232
+may add an explicit geographical distribution limitation excluding
233
+those countries, so that distribution is permitted only in or among
234
+countries not thus excluded.  In such case, this License incorporates
235
+the limitation as if written in the body of this License.
236
+
237
+  9. The Free Software Foundation may publish revised and/or new versions
238
+of the General Public License from time to time.  Such new versions will
239
+be similar in spirit to the present version, but may differ in detail to
240
+address new problems or concerns.
241
+
242
+Each version is given a distinguishing version number.  If the Program
243
+specifies a version number of this License which applies to it and "any
244
+later version", you have the option of following the terms and conditions
245
+either of that version or of any later version published by the Free
246
+Software Foundation.  If the Program does not specify a version number of
247
+this License, you may choose any version ever published by the Free Software
248
+Foundation.
249
+
250
+  10. If you wish to incorporate parts of the Program into other free
251
+programs whose distribution conditions are different, write to the author
252
+to ask for permission.  For software which is copyrighted by the Free
253
+Software Foundation, write to the Free Software Foundation; we sometimes
254
+make exceptions for this.  Our decision will be guided by the two goals
255
+of preserving the free status of all derivatives of our free software and
256
+of promoting the sharing and reuse of software generally.
257
+
258
+                            NO WARRANTY
259
+
260
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
262
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
266
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
267
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+REPAIR OR CORRECTION.
269
+
270
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+POSSIBILITY OF SUCH DAMAGES.
279
+
280
+                     END OF TERMS AND CONDITIONS
281
+
282
+            How to Apply These Terms to Your New Programs
283
+
284
+  If you develop a new program, and you want it to be of the greatest
285
+possible use to the public, the best way to achieve this is to make it
286
+free software which everyone can redistribute and change under these terms.
287
+
288
+  To do so, attach the following notices to the program.  It is safest
289
+to attach them to the start of each source file to most effectively
290
+convey the exclusion of warranty; and each file should have at least
291
+the "copyright" line and a pointer to where the full notice is found.
292
+
293
+    <one line to give the program's name and a brief idea of what it does.>
294
+    Copyright (C) <year>  <name of author>
295
+
296
+    This program is free software; you can redistribute it and/or modify
297
+    it under the terms of the GNU General Public License as published by
298
+    the Free Software Foundation; either version 2 of the License, or
299
+    (at your option) any later version.
300
+
301
+    This program is distributed in the hope that it will be useful,
302
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
304
+    GNU General Public License for more details.
305
+
306
+    You should have received a copy of the GNU General Public License along
307
+    with this program; if not, write to the Free Software Foundation, Inc.,
308
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+Also add information on how to contact you by electronic and paper mail.
311
+
312
+If the program is interactive, make it output a short notice like this
313
+when it starts in an interactive mode:
314
+
315
+    Gnomovision version 69, Copyright (C) year name of author
316
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+    This is free software, and you are welcome to redistribute it
318
+    under certain conditions; type `show c' for details.
319
+
320
+The hypothetical commands `show w' and `show c' should show the appropriate
321
+parts of the General Public License.  Of course, the commands you use may
322
+be called something other than `show w' and `show c'; they could even be
323
+mouse-clicks or menu items--whatever suits your program.
324
+
325
+You should also get your employer (if you work as a programmer) or your
326
+school, if any, to sign a "copyright disclaimer" for the program, if
327
+necessary.  Here is a sample; alter the names:
328
+
329
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+  <signature of Ty Coon>, 1 April 1989
333
+  Ty Coon, President of Vice
334
+
335
+This General Public License does not permit incorporating your program into
336
+proprietary programs.  If your program is a subroutine library, you may
337
+consider it more useful to permit linking proprietary applications with the
338
+library.  If this is what you want to do, use the GNU Lesser General
339
+Public License instead of this License.

+ 10
- 0
README View File

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

+ 0
- 4
README.md View File

@@ -1,4 +0,0 @@
1
-webui
2
-=====
3
-
4
-Kagera Web Interface

+ 8
- 0
files/etc/config/kagera View File

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

+ 33
- 0
files/etc/init.d/webui View File

@@ -0,0 +1,33 @@
1
+#!/bin/sh /etc/rc.common
2
+
3
+START=51
4
+PID_HTTP=/var/run/webui-http.pid
5
+PID_HTTPS=/var/run/webui-https.pid
6
+
7
+start() {
8
+	config_load "kagera"
9
+	config_get CERT_FILE "webui" cert_file
10
+	config_get HTTP_PORT "webui" http_port
11
+	config_get HTTPS_PORT "webui" https_port
12
+	config_get UI_LANG "webui" language
13
+	config_get PROTOCOL "webui" protocol
14
+
15
+	[ -z "$CERT_FILE" ] && CERT_FILE="/usr/lib/kagera/kagera.pem"
16
+	[ -z "$HTTP_PORT" ] && HTTP_PORT="80"
17
+	[ -z "$HTTPS_PORT" ] && HTTPS_PORT="443"
18
+	[ -z "$UI_LANG" ] && UI_LANG="english"
19
+	[ -z "$PROTOCOL" ] && PROTOCOL="http"
20
+
21
+	if [ "$PROTOCOL" == "http" ]; then
22
+		kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTP" -p "$HTTP_PORT" -L "$UI_LANG" 2>/dev/null
23
+	elif [ "$PROTOCOL" == "https" ]; then
24
+		kuhttpd -d "/usr/lib/kagera/webui" -i "$PID_HTTPS" -p "$HTTPS_PORT" -S -E "$CERT_FILE" -L "$UI_LANG" 2>/dev/null
25
+	else
26
+		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
27
+	fi
28
+}
29
+
30
+stop() {
31
+	[ -f "$PID_HTTP" ] && kill "$(cat $PID_HTTP)" 2>/dev/null
32
+	[ -f "$PID_HTTPS" ] && kill "$(cat $PID_HTTPS)" 2>/dev/null
33
+}

+ 8
- 0
files/usr/lib/kagera/config/about.cbsi View File

@@ -0,0 +1,8 @@
1
+#!/usr/bin/cbsi
2
+
3
+<h1><%@ About Firmware %></h1>
4
+<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>
5
+
6
+<h2><%@ License Information %></h2>
7
+<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>
8
+<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 View File

@@ -0,0 +1,17 @@
1
+#!/usr/bin/cbsi
2
+
3
+<h1><%@ Run Custom Commands %></h1>
4
+<form>
5
+	<textarea id="cmds"></textarea>
6
+	<div class="hidden">
7
+		<h2><%@ Output %></h2>
8
+		<div class="code">
9
+			<pre id="output"></pre>
10
+		</div>
11
+	</div>
12
+	<hr />
13
+	<div class="formctrl">
14
+		<input type="reset" value="<%@ Reset %>" />
15
+		<input type="button" value="<%@ Run %>" onclick="runScript()" />
16
+	</div>
17
+</form>

+ 114
- 0
files/usr/lib/kagera/config/overview.cbsi View File

@@ -0,0 +1,114 @@
1
+#!/usr/bin/cbsi
2
+
3
+<%
4
+	. /etc/version && . /etc/openwrt_release
5
+	MEM_FREE=$(sed -e '/^MemFree: /!d; s#MemFree: *##; s# kB##g' /proc/meminfo | awk '{printf "%.2f", $1/1000}')
6
+	MEM_TOTAL=$(sed -e '/^MemTotal: /!d; s#MemTotal: *##; s# kB##g' /proc/meminfo | awk '{printf "%.2f", $1/1000}')
7
+	MEM_PERCENT=$(echo "${MEM_FREE} ${MEM_TOTAL}" | awk '{printf "%.2f", $1*100/$2}')
8
+	UPTIME=$(cat /proc/uptime | cut -d '.' -f1)
9
+	UPTIME_S=$(printf "%02d" $((UPTIME%60)))
10
+	UPTIME_M=$(printf "%02d" $((UPTIME/60%60)))
11
+	UPTIME_H=$(printf "%02d" $((UPTIME/60/60%24)))
12
+	UPTIME_D=$((UPTIME/60/60/24))
13
+
14
+	if [ -f /sbin/swconfig ]; then
15
+		BOARD=$(cat /tmp/sysinfo/board_name)
16
+		case "${BOARD}" in
17
+			routerstation-pro)
18
+				SWPORTS="4 3 2"
19
+				WANPORT="eth0";;
20
+			*)
21
+				SWPORTS="";;
22
+		esac
23
+		if [ "${SWPORTS}" != "" ]; then
24
+			if [ "$(ethtool ${WANPORT} | grep "Link detected" | cut -d" " -f3)" == "no" ]; then
25
+				STATUS="-----"
26
+				IMG="off"
27
+			else
28
+				LINK=$(ethtool ${WANPORT} | grep "Speed" | cut -d" " -f2)
29
+				IMG="on"
30
+				case "${LINK}" in
31
+					"1000Mb/s") STATUS="1 Gbit/s";;
32
+					"100Mb/s") STATUS="100 Mbit/s";;
33
+					*) STATUS="10 Mbit/s";;
34
+				esac
35
+			fi
36
+			PORTNO="${PORTNO}<td>WAN</td><td></td>"
37
+			PORTIMG="${PORTIMG}<td><img src=\"themes/kagera/images/rj45${IMG}.gif\" alt=\"${IMG}\" /></td><td></td>"
38
+			PORTSPEED="${PORTSPEED}<td>${STATUS}</td><td></td>"
39
+			for PORT in ${SWPORTS}; do
40
+				LINK=$(swconfig dev switch0 port $PORT get link | cut -f2,3 -d" ")
41
+				N=$((N+1))
42
+				case "${LINK}" in
43
+					"link:up speed:1000baseT") STATUS="1 Gbit/s" IMG="on";;
44
+					"link:up speed:100baseT") STATUS="100 Mbit/s" IMG="on";;
45
+					"link:up speed:10baseT") STATUS="10 Mbit/s" IMG="on";;
46
+					"link:down") STATUS="-----" IMG="off";;
47
+				esac
48
+				PORTNO="${PORTNO}<td>LAN ${N}</td>"
49
+				PORTIMG="${PORTIMG}<td><img src=\"themes/kagera/images/rj45${IMG}.gif\" alt=\"${IMG}\" /></td>"
50
+				PORTSPEED="${PORTSPEED}<td>${STATUS}</td>"
51
+			done
52
+		fi
53
+	fi
54
+%>
55
+<h1><%@ System Overview %></h1>
56
+<table class="confdata">
57
+	<tr>
58
+		<td class="name"><%@ Router Model %></td>
59
+		<td class="value"><% [ -e /tmp/sysinfo/model ] && cat /tmp/sysinfo/model || %><%@ Unknown %></td>
60
+	</tr>
61
+	<tr>
62
+		<td class="name"><%@ Chipset %></td>
63
+		<td class="value"><% cat /proc/cpuinfo | sed 2,20d | cut -c16-  %></td>
64
+	</tr>
65
+	<tr>
66
+		<td class="name"><%@ CPU Frequency %></td>
67
+		<td class="value"><% dmesg | grep Clocks: | awk -F: '{print $3}' | cut -d. -f1 %> <small>MHz</small></td>
68
+	</tr>
69
+	<tr>
70
+		<td class="name"><%@ Flash Size %></td>
71
+		<td class="value"><% dmesg | grep m25p80 | grep Kbytes | cut -d '(' -f2 | cut -d ' ' -f1 | awk '{print $1/1024}' %> <small>MB</small></td>
72
+	</tr>
73
+	<tr>
74
+		<td class="name"><%@ Firmware Version %></td>
75
+		<td class="value"><%: ${SYSTEM_VERSION} %>, <%@ built on %>&nbsp;<%: ${SYSTEM_BUILDDATE} %></td>
76
+	</tr>
77
+	<tr>
78
+		<td class="name"><%@ OpenWrt Revision %></td>
79
+		<td class="value"><%: ${DISTRIB_REVISION} %></td>
80
+	</tr>
81
+	<tr>
82
+		<td class="spacer" colspan="2"></td>
83
+	</tr>
84
+	<tr>
85
+		<td class="name"><%@ Current Date & Time %></td>
86
+		<td class="value"><% date "+%d/%m/%Y %H:%M:%S %Z" %></td>
87
+	</tr>
88
+	<tr>
89
+		<td class="name"><%@ System Uptime %></td>
90
+		<td class="value"><%: ${UPTIME_D} %>&nbsp;<%@ days %>, <%: ${UPTIME_H}:${UPTIME_M}:${UPTIME_S} %></td>
91
+	</tr>
92
+	<tr>
93
+		<td class="name"><%@ Total / Free Memory %></td>
94
+		<td class="value"><%: ${MEM_TOTAL} %> <small>MB</small> / <%: ${MEM_FREE} %> <small>MB (<%: ${MEM_PERCENT}% %>)</small></td>
95
+	</tr>
96
+	<tr>
97
+		<td class="name"><%@ CPU Load <small>(1 / 5 / 15 mins)</small> %></td>
98
+		<td class="value"><% awk '{print $1 " / " $2 " / " $3}' /proc/loadavg %></td>
99
+	</tr>
100
+</table>
101
+<% if [ "${SWPORTS}" != "" ]; then %>
102
+	<h2><%@ Ethernet Ports State %></h2>
103
+	<table class="portstate">
104
+		<tr class="portno">
105
+			<%: ${PORTNO} %>
106
+		</tr>
107
+		<tr class="portimg">
108
+			<%: ${PORTIMG} %>
109
+		</tr>
110
+		<tr class="portspeed">
111
+			<%: ${PORTSPEED} %>
112
+		</tr>
113
+	</table>
114
+<% fi %>

+ 25
- 0
files/usr/lib/kagera/config/syslogs.cbsi View File

@@ -0,0 +1,25 @@
1
+#!/usr/bin/cbsi
2
+
3
+<h1><%@ System Logs %></h1>
4
+<table class="confdata">
5
+	<tr>
6
+		<td class="name"><%@ Displayed Logs %></td>
7
+		<td class="value">
8
+			<label class="select"><select id="switch" onchange="switchView('output', this.value);">
9
+				<option value="syslog" selected="selected"><%@ General System Logs %></option>
10
+				<option value="krnlog"><%@ Kernel Messages %></option>
11
+				<option value="prclog"><%@ List of Processes %></option>
12
+				<option value="mntlog"><%@ Mount Points %></option>
13
+			</select></label>
14
+		</td>
15
+	</tr>
16
+	<tr>
17
+		<td class="spacer" colspan="2"></td>
18
+	</tr>
19
+</table>
20
+<div class="code" id="output">
21
+	<pre id="syslog"><% logread %></pre>
22
+	<pre id="krnlog"><% dmesg %></pre>
23
+	<pre id="prclog"><% ps %></pre>
24
+	<pre id="mntlog"><% mount %></pre>
25
+</div>

+ 32
- 0
files/usr/lib/kagera/kagera.pem View File

@@ -0,0 +1,32 @@
1
+-----BEGIN PRIVATE KEY-----
2
+MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAM/u0ggHo+9vrGdJ
3
+0vFAMFc9zoVE2NeNfy1bo/B1bTRvYM+9k5w1cB16A8eLXGnF+12t2BPsLdAfw6XH
4
+WhsRQ5YWE73MYpwcL2JVPnUyOfPpNHiI3wF7TeINVZI7YRiezUdMJvroCcYyQamt
5
+y3xRLRlfHHrKdC396lAlrA9Y1YbzAgMBAAECgYB6rYKJbkiQWaiz/+BOqfpbXoHc
6
+KvRsqHTiQ/EDS6S0jQnnRwgx321YVsaoElbhqQdXC9wyVOPqqPL7ehR1Z8ghUTrL
7
+5aoNXhTXTEd5KqQQsiR3NvY/s7V74wZRz2nMBF57wPFovQu1ddgeH/ZUR1HT9XTY
8
+8a+bv1JrhObGv9JMUQJBAP4yHT97tY42YeIOdNmP4BufpVdMK4IvF0nkWdBssBvJ
9
+aDHMv40z92Uf08EFRdxmEZglHUvlbgR6dMW7lFE2aQ8CQQDRaKT08QzSasp/CJx6
10
+Nd+XC3KSzAkBrgQVP1+Z+m/cGfHHA+zXomaKMtnvw4ywFf6vWeSzbX2gtC2VSbEN
11
+M9vdAkA5qAJMUPIIVLt0+9RzOJgbi+WD3IoN2EKPBxV8GfsEAnX4vblA/OWDcWml
12
+YV3MNPaOrPRtL5f5uhDcfMSSeyXvAkEAtUSaFhVa/gHHC7POj9N2mm8kXIIWAcg6
13
+bJIRFV692Y7zxUxWhkpj7JkcIfnqHLrNXci4ucC7kJKnKqVBh6YuWQJBAPfMcEEl
14
+OHplIKZtBGVkX4PQFnhTJIO0hNCgdMNjw8Xn2kyvnc22fO3iKeLjPBssi6u1bdPF
15
+N4il4Ch/p4Kr+Pc=
16
+-----END PRIVATE KEY-----
17
+-----BEGIN CERTIFICATE-----
18
+MIICfzCCAeigAwIBAgIJAKL/ci6AhIbiMA0GCSqGSIb3DQEBBQUAMHYxCzAJBgNV
19
+BAYTAkVVMRcwFQYDVQQIEw5FdXJvcGVhbiBVbmlvbjEjMCEGA1UEChMaQXNpbyBT
20
+b2Z0d2FyZSBUZWNobm9sb2dpZXMxKTAnBgNVBAMTIEthZ2VyYSBSb3V0ZXIgTWFu
21
+YWdlbWVudCBVdGlsaXR5MB4XDTEzMDUwMTExMTQyNFoXDTMzMTExMjExMTQyNFow
22
+djELMAkGA1UEBhMCRVUxFzAVBgNVBAgTDkV1cm9wZWFuIFVuaW9uMSMwIQYDVQQK
23
+ExpBc2lvIFNvZnR3YXJlIFRlY2hub2xvZ2llczEpMCcGA1UEAxMgS2FnZXJhIFJv
24
+dXRlciBNYW5hZ2VtZW50IFV0aWxpdHkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ
25
+AoGBAM/u0ggHo+9vrGdJ0vFAMFc9zoVE2NeNfy1bo/B1bTRvYM+9k5w1cB16A8eL
26
+XGnF+12t2BPsLdAfw6XHWhsRQ5YWE73MYpwcL2JVPnUyOfPpNHiI3wF7TeINVZI7
27
+YRiezUdMJvroCcYyQamty3xRLRlfHHrKdC396lAlrA9Y1YbzAgMBAAGjFTATMBEG
28
+CWCGSAGG+EIBAQQEAwIGQDANBgkqhkiG9w0BAQUFAAOBgQCZJJzk1vhwnsgSXoSb
29
+Q2ycYOfqnxQ7SHCZgmBWTsLs3COWf663KD1DwbUx8fqioXuhYvjZqGDbb/F2FpB6
30
+Lv4uf/+O4VgNaum3E3TZW1M52/Oge3Zf0x95UWbh5+I0WmD+DqeXBXt1215axpVo
31
+6wthLQu85vsgaVLbc2k8aEAxTw==
32
+-----END CERTIFICATE-----

+ 14
- 0
files/usr/lib/kagera/langs/TEMPLATE/about.dic View File

@@ -0,0 +1,14 @@
1
+msgid "About Firmware"
2
+msgstr ""
3
+
4
+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>."
5
+msgstr ""
6
+
7
+msgid "License Information"
8
+msgstr ""
9
+
10
+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."
11
+msgstr ""
12
+
13
+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."
14
+msgstr ""

+ 11
- 0
files/usr/lib/kagera/langs/TEMPLATE/command.dic View File

@@ -0,0 +1,11 @@
1
+msgid "Run Custom Commands"
2
+msgstr ""
3
+
4
+msgid "Output"
5
+msgstr ""
6
+
7
+msgid "Reset"
8
+msgstr ""
9
+
10
+msgid "Run"
11
+msgstr ""

+ 59
- 0
files/usr/lib/kagera/langs/TEMPLATE/common.dic View File

@@ -0,0 +1,59 @@
1
+msgid "Executing commands..."
2
+msgstr ""
3
+
4
+msgid "Applying system changes..."
5
+msgstr ""
6
+
7
+msgid "Restarting services..."
8
+msgstr ""
9
+
10
+msgid "Downloading firmware image..."
11
+msgstr ""
12
+
13
+msgid "Flashing image..."
14
+msgstr ""
15
+
16
+msgid "Rebooting device..."
17
+msgstr ""
18
+
19
+msgid "Do you really want to reboot?"
20
+msgstr ""
21
+
22
+msgid "Reboot"
23
+msgstr ""
24
+
25
+msgid "Logout"
26
+msgstr ""
27
+
28
+msgid "Status"
29
+msgstr ""
30
+
31
+msgid "Overview"
32
+msgstr ""
33
+
34
+msgid "Run Command"
35
+msgstr ""
36
+
37
+msgid "System Logs"
38
+msgstr ""
39
+
40
+msgid "System"
41
+msgstr ""
42
+
43
+msgid "About Kagera"
44
+msgstr ""
45
+
46
+msgid "Authorization Required"
47
+msgstr ""
48
+
49
+msgid "User Name:"
50
+msgstr ""
51
+
52
+msgid "Password:"
53
+msgstr ""
54
+
55
+msgid "Reset"
56
+msgstr ""
57
+
58
+msgid "Login"
59
+msgstr ""

+ 44
- 0
files/usr/lib/kagera/langs/TEMPLATE/overview.dic View File

@@ -0,0 +1,44 @@
1
+msgid "System Overview"
2
+msgstr ""
3
+
4
+msgid "Router Model"
5
+msgstr ""
6
+
7
+msgid "Unknown"
8
+msgstr ""
9
+
10
+msgid "Chipset"
11
+msgstr ""
12
+
13
+msgid "CPU Frequency"
14
+msgstr ""
15
+
16
+msgid "Flash Size"
17
+msgstr ""
18
+
19
+msgid "Firmware Version"
20
+msgstr ""
21
+
22
+msgid "built on"
23
+msgstr ""
24
+
25
+msgid "OpenWrt Revision"
26
+msgstr ""
27
+
28
+msgid "Current Date & Time"
29
+msgstr ""
30
+
31
+msgid "System Uptime"
32
+msgstr ""
33
+
34
+msgid "days"
35
+msgstr ""
36
+
37
+msgid "Total / Free Memory"
38
+msgstr ""
39
+
40
+msgid "CPU Load <small>(1 / 5 / 15 mins)</small>"
41
+msgstr ""
42
+
43
+msgid "Ethernet Ports State"
44
+msgstr ""

+ 17
- 0
files/usr/lib/kagera/langs/TEMPLATE/syslogs.dic View File

@@ -0,0 +1,17 @@
1
+msgid "System Logs"
2
+msgstr ""
3
+
4
+msgid "Displayed Logs"
5
+msgstr ""
6
+
7
+msgid "General System Logs"
8
+msgstr ""
9
+
10
+msgid "Kernel Messages"
11
+msgstr ""
12
+
13
+msgid "List of Processes"
14
+msgstr ""
15
+
16
+msgid "Mount Points"
17
+msgstr ""

+ 104
- 0
files/usr/lib/kagera/webui/index.sh View File

@@ -0,0 +1,104 @@
1
+#!/usr/bin/cbsi
2
+<%
3
+	THEME=$(uci get kagera.webui.theme)
4
+	TIMEOUT=$(uci get kagera.webui.timeout)
5
+	if [ "${GET_option}" == "logout" ]; then
6
+		eval $(sessmgr -l -r "index.sh?option=overview")
7
+	elif [ "${POST_sessopen}" == "1" ] && [ -n "${POST_sesspass}" ]; then
8
+		sleep 3
9
+		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}")
10
+	fi
11
+	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}")
12
+	[ -f /usr/lib/kagera/config/${GET_option}.cbsi ] || GET_option="overview"
13
+	if [ -n "${GET_refresh}" ]; then
14
+		echo "Content-type: text/plain; charset=utf-8"
15
+		if [ -n "${VALIDSESS}" ]; then
16
+			if [ "${GET_runcommand}" == "1" ]; then
17
+				if [ -n "${POST_commands}" ]; then
18
+					echo ""
19
+					echo "${POST_commands}" | tr -d "\r" > /tmp/run.sh
20
+					sh /tmp/run.sh
21
+					rm -f /tmp/run.sh
22
+				fi
23
+			else
24
+				/usr/bin/cbsi /usr/lib/kagera/config/${GET_option}.cbsi
25
+			fi
26
+		fi
27
+		exit
28
+	fi
29
+	echo "Content-type: text/html; charset=utf-8"
30
+	. /etc/version
31
+%>
32
+<!DOCTYPE html>
33
+<html>
34
+	<head>
35
+		<title>Kagera Router Management Utility</title>
36
+		<meta name="robots" content="noindex,nofollow" />
37
+		<link rel="shortcut icon" href="/themes/kagera/images/favicon.ico"/>
38
+		<link rel="stylesheet" href="<%: themes/${THEME}/style.css %>" />
39
+		<script src="scripts/kagera.js" type="text/javascript"></script>
40
+		<script src="<%: scripts/${GET_option}.js %>" type="text/javascript"></script>
41
+		<script>
42
+			var sysmsg = ["<%@ Executing commands... %>", "<%@ Applying system changes... %>", "<%@ Restarting services... %>", "<%@ Downloading firmware image... %>", "<%@ Flashing image... %>", "<%@ Rebooting device... %>", "<%@ Do you really want to reboot? %>"];
43
+			var multimenu = <% uci get kagera.webui.multimenu %>;
44
+		</script>
45
+	</head>
46
+	<body>
47
+		<% if [ "${VALIDSESS}" == "1" ]; then %>
48
+			<div class="webui">
49
+				<div class="header">
50
+					<div class="logo">
51
+						<span id="title"><%: ${SYSTEM_DESCRIPTION} %></span>
52
+						<span id="version"><%: ${SYSTEM_VERSION} %></span>
53
+					</div>
54
+					<div class="controls">
55
+						<input type="button" class="creboot" value="<%@ Reboot %>" onclick="reboot(true);" />
56
+						<input type="button" class="clogout" value="<%@ Logout %>" onclick="logout();" />
57
+					</div>
58
+				</div>
59
+				<div class="body">
60
+					<div id="mainmenu">
61
+						<div class="navbox">
62
+							<span class="navheader"><%@ Status %></span>
63
+							<ul class="navbody">
64
+								<li><a href="index.sh?option=overview"><%@ Overview %></a></li>
65
+								<li><a href="index.sh?option=command"><%@ Run Command %></a></li>
66
+								<li><a href="index.sh?option=syslogs"><%@ System Logs %></a></li>
67
+							</ul>
68
+							<span class="navfooter"></span>
69
+						</div>
70
+						<div class="navbox">
71
+							<span class="navheader"><%@ System %></span>
72
+							<ul class="navbody">
73
+								<li><a href="index.sh?option=about"><%@ About Kagera %></a></li>
74
+							</ul>
75
+							<span class="navfooter"></span>
76
+						</div>
77
+					</div>
78
+					<div id="content">
79
+						<% /usr/bin/cbsi -t ${GET_option} /usr/lib/kagera/config/${GET_option}.cbsi %>
80
+					</div>
81
+				</div>
82
+				<div class="footer">
83
+					Copyright&copy; 2010-2013, <a href="http://www.asiotec.eu.org" target="_blank">Asio Software Technologies</a>
84
+				</div>
85
+		<% else %>
86
+			<div class="loginbox">
87
+				<div class="body">
88
+					<form action="<%: index.sh?option=${GET_option} %>" method="POST">
89
+						<h1><%@ Authorization Required %></h1>
90
+						<label><%@ User Name: %></label><input type="text" name="sessuser" autofocus="autofocus" />
91
+						<label><%@ Password: %></label><input type="password" name="sesspass" />
92
+						<hr />
93
+						<div class="formctrl">
94
+							<input type="hidden" name="sessopen" value="1" />
95
+							<input type="reset" value="<%@ Reset %>" />
96
+							<input type="submit" value="<%@ Login %>" />
97
+						</div>
98
+					</form>
99
+				</div>
100
+		<% fi %>
101
+			</div>
102
+			<div id="dim"></div><div id="msg"><img src="<%: themes/${THEME}/images/loader.gif %>" alt="L" /></div>
103
+	</body>
104
+</html>

+ 11
- 0
files/usr/lib/kagera/webui/scripts/command.js View File

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

+ 245
- 0
files/usr/lib/kagera/webui/scripts/kagera.js View File

@@ -0,0 +1,245 @@
1
+function getRequest() {
2
+	var req;
3
+	if(window.XMLHttpRequest) {
4
+		req = new XMLHttpRequest();
5
+	} else {
6
+		req = new ActiveXObject("Microsoft.XMLHTTP");
7
+	}
8
+	return req;
9
+}
10
+
11
+function initMenu() {
12
+	this.menu = document.getElementById("mainmenu");
13
+	this.submenus = this.menu.getElementsByTagName("div");
14
+	this.oneSmOnly = 3;
15
+
16
+	this.collapseMenu = function(submenu) {
17
+		var minHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
18
+		var moveBy = Math.round(4 * submenu.getElementsByTagName("a").length);
19
+		var mainInstance = this;
20
+		var intId = setInterval(function() {
21
+			var curHeight = submenu.offsetHeight;
22
+			var newHeight = curHeight - moveBy;
23
+			if(newHeight > minHeight) {
24
+				submenu.style.height = newHeight + "px";
25
+			} else {
26
+				clearInterval(intId);
27
+				submenu.style.height = "";
28
+				submenu.className = "collapsed";
29
+				mainInstance.memorize();
30
+			}
31
+		}, 30);
32
+	};
33
+
34
+	this.collapseOthers = function(submenu) {
35
+		if(!multimenu) {
36
+			for(var i = 0; i < this.submenus.length; i++) {
37
+				if(this.submenus[i] != submenu && this.submenus[i].className != "collapsed") {
38
+					this.collapseMenu(this.submenus[i]);
39
+				}
40
+			}
41
+		}
42
+	};
43
+
44
+	this.expandMenu = function(submenu) {
45
+		var fullHeight = submenu.getElementsByTagName("span")[0].offsetHeight;
46
+		var links = submenu.getElementsByTagName("a");
47
+		for(var i = 0; i < links.length; i++) {
48
+			fullHeight += links[i].offsetHeight;
49
+		}
50
+		var moveBy = Math.round(4 * links.length);
51
+		var mainInstance = this;
52
+		var intId = setInterval(function() {
53
+			var curHeight = submenu.offsetHeight;
54
+			var newHeight = curHeight + moveBy;
55
+			if(newHeight < fullHeight) {
56
+				submenu.style.height = newHeight + "px";
57
+			} else {
58
+				clearInterval(intId);
59
+				submenu.style.height= "";
60
+				submenu.className = "navbox";
61
+				mainInstance.memorize();
62
+			}
63
+		}, 30);
64
+		this.collapseOthers(submenu);
65
+	};
66
+
67
+	this.init = function() {
68
+		var mainInstance = this;
69
+		for(var i = 0; i < this.submenus.length; i++) {
70
+			this.submenus[i].getElementsByTagName("span")[0].onclick = function() {
71
+				if(this.parentNode.className == "collapsed") {
72
+					mainInstance.expandMenu(this.parentNode);
73
+				} else {
74
+					mainInstance.collapseMenu(this.parentNode);
75
+				}
76
+			};
77
+		}
78
+		var links = this.menu.getElementsByTagName("a");
79
+		links[0].className = "active";
80
+		for(var i = 0; i < links.length; i++) {
81
+			if(links[i].href == document.location.href) {
82
+				links[0].className = "";
83
+				links[i].className = "active";
84
+				break;
85
+			}
86
+		}
87
+		var regex = new RegExp("kagera_" + encodeURIComponent("mainmenu") + "=([01]+)");
88
+		var match = regex.exec(document.cookie);
89
+		if(match) {
90
+			var states = match[1].split("");
91
+			for(var i = 0; i < states.length; i++) {
92
+				this.submenus[i].className = (states[i] == 0 ? "collapsed" : "navbox");
93
+			}
94
+		} else if(!multimenu) {
95
+			this.collapseOthers(this.submenus[0]);
96
+		}
97
+	};
98
+
99
+	this.memorize = function() {
100
+		var states = new Array();
101
+		for(var i = 0; i < this.submenus.length; i++) {
102
+			states.push(this.submenus[i].className == "collapsed" ? 0 : 1);
103
+			var d = new Date();
104
+			d.setTime(d.getTime() + (30 * 24 * 60 * 60 * 1000));
105
+			document.cookie = "kagera_" + encodeURIComponent("mainmenu") + "=" + states.join("") + "; expires=" + d.toGMTString() + "; path=/";
106
+		}
107
+	};
108
+}
109
+
110
+function initTips() {
111
+	var help = document.getElementById("help")
112
+	if(help) {
113
+		var abbrs = document.getElementsByTagName("abbr");
114
+		var tips = help.getElementsByTagName("div");
115
+		var mouseX, mouseY;
116
+		document.onmousemove = function(e) {
117
+			mouseX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
118
+			mouseY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
119
+		};
120
+		for(var i = 0; i < abbrs.length; i++) {
121
+			abbrs[i].onclick = function() {
122
+				for(var a = 0; a < tips.length; a++) {
123
+					if("s" + tips[a].id == this.id) {
124
+						tips[a].style.left = mouseX + "px";
125
+						tips[a].style.top = (mouseY - (tips[a].offsetHeight + 3)) + "px";
126
+						tips[a].style.visibility = "visible";
127
+						break;
128
+					}
129
+				}
130
+			};
131
+			abbrs[i].onmouseout = function() {
132
+				for(var a = 0; a < tips.length; a++) {
133
+					if("s" + tips[a].id == this.id) {
134
+						tips[a].style.visibility = "hidden";
135
+						break;
136
+					}
137
+				}
138
+			};
139
+		}
140
+	}
141
+}
142
+
143
+function logout() {
144
+	window.location.href="index.sh?option=logout";
145
+}
146
+
147
+function reboot(ask) {
148
+	var boot = true;
149
+	if(ask) {
150
+		var answer = confirm(sysmsg[6]);
151
+		if(!answer) {
152
+			boot = false;
153
+		}
154
+	}
155
+	if(boot) {
156
+		toggleMsg(sysmsg[5]);
157
+		statefunc = function() {
158
+			window.location.href="index.sh?option=overview";
159
+		}
160
+		testcon = function() {
161
+			runRequest("GET", document.location.href, "&refresh=1", statefunc, false);
162
+		}
163
+		runCommand("reboot", statefunc, true);
164
+		setInterval("testcon()", 5000);
165
+	}
166
+}
167
+
168
+function refreshData(func) {
169
+	statefunc = function(req) {
170
+		document.getElementById("content").innerHTML = req.responseText;
171
+		var target = document.getElementById("content");
172
+		var scripts = target.getElementsByTagName("script");
173
+		for (var i = 0; i < scripts.length; i++) {
174
+			eval(scripts[i].innerHTML);
175
+		}
176
+		if(typeof func == "function") {
177
+			func();
178
+		}
179
+	}
180
+	runRequest("GET", document.location.href, "&refresh=1", statefunc, false);
181
+}
182
+
183
+function runCommand(params, statefunc, noreload) {
184
+	runRequest("POST", document.location.href + "&refresh=1&runcommand=1", "commands=" + params, statefunc, noreload);
185
+}
186
+
187
+function runRequest(method, url, params, statefunc, noreload) {
188
+	var req = getRequest();
189
+	if(req) {
190
+		req.onreadystatechange = function() {
191
+			if(req.readyState == 4 && req.status == 200) {
192
+				if(req.responseText != "") {
193
+					statefunc(req);
194
+				} else if(!noreload) {
195
+					location.reload(true);
196
+				}
197
+			}
198
+		}
199
+		if(method == "POST") {
200
+			req.open("POST", url, true);
201
+			req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
202
+			req.send(params);
203
+		} else {
204
+			req.open("GET", url + params, true);
205
+			req.send();
206
+		}
207
+	}
208
+	return req;
209
+}
210
+
211
+function switchView(outid, swval) {
212
+	sw = document.getElementById(outid);
213
+	for(var i = 0; i < sw.children.length; i++) {
214
+		if(sw.children[i].id == swval) {
215
+			sw.children[i].style.display = "block";
216
+		} else {
217
+			sw.children[i].style.display = "none";
218
+		}
219
+	}
220
+}
221
+
222
+function toggleMsg(msg) {
223
+	dimbox = document.getElementById("dim");
224
+	msgbox = document.getElementById("msg");
225
+	if(msg) {
226
+		document.body.style.overflow = "hidden";
227
+		msgbox.innerHTML = msgtxt + "&nbsp;&nbsp;" + msg;
228
+		dimbox.style.display = "inline";
229
+		msgbox.style.display = "inline";
230
+	} else {
231
+		msgbox.style.display = "none";
232
+		dimbox.style.display = "none";
233
+		document.body.style.overflow = "auto";
234
+	}
235
+}
236
+
237
+window.onload = function() {
238
+	msgtxt = document.getElementById("msg").innerHTML;
239
+	mainmenu = new initMenu();
240
+	mainmenu.init();
241
+	initTips();
242
+	if(typeof initModule == "function") {
243
+		initModule();
244
+	}
245
+}

+ 3
- 0
files/usr/lib/kagera/webui/scripts/overview.js View File

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

+ 3
- 0
files/usr/lib/kagera/webui/scripts/syslogs.js View File

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

BIN
files/usr/lib/kagera/webui/themes/kagera/images/arrow.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/bg.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/body.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/button.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/checkbox.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/clogout.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/creboot.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/favicon.ico View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/footer.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/header.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/loader.gif View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/loginbox.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/msg.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navbody.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navfoot.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navhead1.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/navhead2.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/radiobtn.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/rj45off.gif View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/rj45on.gif View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/select.png View File


BIN
files/usr/lib/kagera/webui/themes/kagera/images/stripes.png View File


+ 576
- 0
files/usr/lib/kagera/webui/themes/kagera/style.css View File

@@ -0,0 +1,576 @@
1
+a {
2
+	color					: #868686;
3
+	text-decoration			: none;
4
+}
5
+
6
+abbr {
7
+	border-bottom			: 1px dotted #666;
8
+	cursor					: help;
9
+	font-variant			: normal;
10
+}
11
+
12
+body {
13
+	background-attachment	: fixed;
14
+	background-image		: url('images/bg.png');
15
+	color					: #868686;
16
+	font-family				: Arial;
17
+	padding-top				: 25px;
18
+}
19
+
20
+button, input[type=button], input[type=reset], input[type=submit] {
21
+	background				: transparent url('images/button.png');
22
+	border					: 0px;
23
+	color					: #DDDDDD;
24
+	height					: 31px;
25
+	text-shadow				: #000000 1px 1px;
26
+	width					: 104px;
27
+}
28
+
29
+button:hover, input[type=button]:hover, input[type=reset]:hover, input[type=submit]:hover {
30
+	background-position		: center;
31
+}
32
+
33
+button:active, input[type=button]:active, input[type=reset]:active, input[type=submit]:active {
34
+	background-position		: bottom;
35
+}
36
+
37
+h1 {
38
+	border-bottom			: 1px solid #C9C9C9;
39
+	color					: #C9C9C9;
40
+	font-family				: "trebuchet ms";
41
+	font-size				: 20px;
42
+	font-weight				: bold;
43
+	margin					: 2px 0px 15px 0px;
44
+	text-shadow				: 1px 1px #000000;
45
+}
46
+
47
+h2 {
48
+	border-bottom			: 1px solid #C9C9C9;
49
+	color					: #C9C9C9;
50
+	font-family				: "trebuchet ms";
51
+	font-size				: 20px;
52
+	font-weight				: bold;
53
+	margin					: 35px 0px 15px 0px;
54
+	text-shadow				: 1px 1px #000000;
55
+}
56
+
57
+hr {
58
+	border-bottom			: 1px solid #3F3A3E;
59
+	border-left				: none;
60
+	border-right			: none;
61
+	border-top				: 1px solid #000000;
62
+	clear					: both;
63
+	margin-top				: 35px;
64
+}
65
+
66
+img {
67
+	border					: 0px;
68
+}
69
+
70
+input[type=checkbox], input[type=radio] {
71
+	display					: none;
72
+}
73
+
74
+input[type=checkbox] + label, input[type=radio] + label {
75
+	background-repeat		: no-repeat;
76
+	background-position		: 0 0;
77
+	cursor					: pointer;
78
+	display					: inline-block;
79
+	font-size				: 12px;
80
+	height					: 15px;
81
+	line-height				: 15px;
82
+	padding-left			: 20px;
83
+	vertical-align			: middle;
84
+}
85
+
86
+input[type=checkbox]:checked + label, input[type=radio]:checked + label {
87
+	background-position		: 0 -15px;
88
+}
89
+
90
+input[type=checkbox]:checked + label:hover, input[type=radio]:checked + label:hover {
91
+	background-position		: 0 -45px;
92
+}
93
+
94
+input[type=checkbox] + label:hover, input[type=radio] + label:hover {
95
+	background-position		: 0 -30px;
96
+}
97
+
98
+input[type="checkbox"]:disabled + label, input[type="radio"]:disabled + label {
99
+	background-position		: 0 -60px;
100
+	color					: #505050;
101
+	cursor					: default;
102
+}
103
+
104
+input[type=checkbox] + label {
105
+	background-image		: url('images/checkbox.png');
106
+}
107
+
108
+input[type=radio] + label {
109
+	background-image		: url('images/radiobtn.png');
110
+}
111
+
112
+input[type=password], input[type=text] {
113
+	background-color		: #2B2B2B;
114
+	border					: 1px solid #191919;
115
+	box-shadow				: inset 0px 2px 1px #242424, 0 1px 0 #303030;
116
+	color					: #919191;
117
+	font-family				: arial;
118
+	font-size				: 12px;
119
+	height					: 16px;
120
+	margin					: -1px 0px -1px 0px;
121
+	padding					: 0px 3px 0px 3px;
122
+	width					: 278px;
123
+}
124
+
125
+input[type=password]:focus, input[type=text]:focus, input[type=password]:hover, input[type=text]:hover {
126
+	background-color		: #383838;
127
+	box-shadow				: inset 0px 2px 1px #292929, 0 1px 0 #303030;
128
+}
129
+
130
+input[type=password]:disabled, input[type=text]:disabled {
131
+	background-color		: #1E1E1E;
132
+	box-shadow				: inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
133
+	color					: #505050;
134
+}
135
+
136
+input.clogout {
137
+	background				: transparent url('images/clogout.png');
138
+	border					: 0px;
139
+	color					: #DDDDDD;
140
+	font-family				: Arial;
141
+	font-size				: 12px;
142
+	height					: 81px;
143
+	padding-top				: 41px;
144
+	text-shadow				: #000000 1px 1px;
145
+	width					: 80px;
146
+}
147
+
148
+input.creboot {
149
+	background				: transparent url('images/creboot.png');
150
+	border					: 0px;
151
+	color					: #DDDDDD;
152
+	font-family				: Arial;
153
+	font-size				: 12px;
154
+	height					: 81px;
155
+	padding-top				: 41px;
156
+	text-shadow				: #000000 1px 1px;
157
+	width					: 80px;
158
+}
159
+
160
+input.creboot:hover, input.clogout:hover {
161
+	background-position		: center;
162
+}
163
+
164
+input.creboot:active, input.clogout:active {
165
+	background-position		: bottom;
166
+}
167
+
168
+option {
169
+	cursor					: default;
170
+}
171
+
172
+p {
173
+	margin-bottom			: 10px;
174
+	text-align				: justify;
175
+}
176
+
177
+p a {
178
+	border-bottom			: 1px dotted #666;
179
+}
180
+
181
+pre {
182
+	color					: #B9B9B9;
183
+	font-size				: 12px;
184
+	margin					: 2px 2px 2px 2px;
185
+}
186
+
187
+select {
188
+	-moz-appearance			: none;
189
+	-webkit-appearance		: none;
190
+	appearance				: none;
191
+	background-color		: #2B2B2B;
192
+	border					: 1px solid #191919;
193
+	box-shadow				: inset 0px 2px 1px #242424, 0 1px 0 #303030;
194
+	color					: #919191;
195
+	cursor					: pointer;
196
+	display					: inline-block;
197
+	font-family				: arial;
198
+	font-size				: 12px;
199
+	height					: 17px;
200
+	margin					: -1px 0px -1px 0px;
201
+	outline					: none;
202
+	padding					: 0px 3px 0px 0px;
203
+	width					: 285px;
204
+}
205
+
206
+select:hover {
207
+	background-color		: #383838;
208
+	box-shadow				: inset 0px 2px 1px #292929, 0 1px 0 #303030;
209
+}
210
+
211
+select:disabled {
212
+	background-color		: #1E1E1E;
213
+	box-shadow				: inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
214
+	color					: #505050;
215
+	cursor					: default;
216
+}
217
+
218
+small {
219
+	font-size				: 11px;
220
+}
221
+
222
+table {
223
+	border-collapse			: collapse;
224
+	border-spacing			: 0px;
225
+}
226
+
227
+textarea {
228
+	background-color		: #2B2B2B;
229
+	border					: 1px solid #191919;
230
+	box-shadow				: inset 0px 2px 1px #242424, 0 1px 0 #303030;
231
+	color					: #919191;
232
+	font-size				: 12px;
233
+	height					: 300px;
234
+	padding					: 2px 2px 2px 2px;
235
+	overflow				: auto;
236
+	resize					: vertical;
237
+	white-space				: pre;
238
+	width					: 766px;
239
+	word-wrap				: normal;
240
+}
241
+
242
+textarea:focus, textarea:hover {
243
+	background-color		: #383838;
244
+	box-shadow				: inset 0px 2px 1px #292929, 0 1px 0 #303030;
245
+}
246
+
247
+textarea:disabled, textarea:disabled {
248
+	background-color		: #1E1E1E;
249
+	box-shadow				: inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
250
+	color					: #505050;
251
+}
252
+
253
+.body {
254
+	background-image		: url('images/body.png');
255
+	clear					: both;
256
+	float					: left;
257
+	width					: 1006px;
258
+}
259
+
260
+.code {
261
+	background-color		: #1D1D1D;
262
+	border					: 1px solid #141414;
263
+	box-shadow				: inset 0px 2px 1px #1B1B1B, 0 1px 0 #303030;
264
+	height					: 500px;
265
+	overflow				: auto;
266
+	width					: 770px;
267
+}
268
+
269
+.collapsed {
270
+	margin-bottom			: 20px;
271
+	margin-top				: 7px;
272
+	overflow				: hidden;
273
+	height					: 40px;
274
+}
275
+
276
+.collapsed .navbody a.active {
277
+	border-top				: none;
278
+	margin-top				: 0px;
279
+}
280
+
281
+.collapsed .navheader {
282
+	background-image		: url('images/navhead2.png');
283
+	background-repeat		: no-repeat;
284
+}
285
+
286
+#content {
287
+	color					: #919191;
288
+	float					: right;
289
+	font-family				: Arial;
290
+	font-size				: 14px;
291
+	margin-bottom			: 7px;
292
+	margin-right			: 20px;
293
+	margin-top				: 7px;
294
+	padding-left			: 7px;
295
+	width					: 771px;
296
+}
297
+
298
+.controls {
299
+	float					: right;
300
+	margin-right			: 15px;
301
+	margin-top				: 17px;
302
+	text-align				: right;
303
+}
304
+
305
+.confdata {
306
+	line-height				: 18px;
307
+	width					: 772px;
308
+}
309
+
310
+.confdata .name {
311
+	background-color		: #1D1D1D;
312
+	border					: 1px solid #141414;
313
+	padding					: 5px 30px 5px 5px;
314
+	width					: 40%;
315
+}
316
+
317
+.confdata .spacer {
318
+	height					: 15px;
319
+	padding					: 5px 5px 5px 5px;
320
+}
321
+
322
+.confdata .title {
323
+	background-color		: #1D1D1D;
324
+	border					: 1px solid #141414;
325
+	color					: #C9C9C9;
326
+	font-weight				: bold;
327
+	height					: 25px;
328
+	text-align				: center;
329
+}
330
+
331
+.confdata .value {
332
+	background-color		: #262626;
333
+	border					: 1px solid #141414;
334
+	padding					: 5px 5px 5px 5px;
335
+}
336
+
337
+#dim {
338
+	-moz-opacity			: 0.8;
339
+	background-color		: #000000;
340
+	display					: none;
341
+	filter					: alpha(opacity=80);
342
+	height					: 200%;
343
+	left					: 0px;
344
+	opacity					: 0.8;
345
+	position				: absolute;
346
+	top						: 0px;
347
+	width					: 100%;
348
+	z-index					: 20;
349
+}
350
+
351
+.footer {
352
+	background-image		: url('images/footer.png');
353
+	background-repeat		: no-repeat;
354
+	clear					: both;
355
+	font-size				: 10px;
356
+	padding-right			: 10px;
357
+	padding-top				: 7px;
358
+	text-align				: right;
359
+	width					: 996px;
360
+}
361
+
362
+.formctrl {
363
+	text-align				: right;
364
+	width					: 100%;
365
+}
366
+
367
+.header {
368
+	background-image		: url('images/header.png');
369
+	height					: 107px;
370
+	width					: 1006px;
371
+}
372
+
373
+.hidden {
374
+	display					: none;
375
+}
376
+
377
+.hidden .code {
378
+	height					: 250px;
379
+}
380
+
381
+.loginbox {
382
+	background				: transparent url('images/loginbox.png') no-repeat;
383
+	font-size				: 14px;
384
+	height					: 191px;
385
+	left					: 50%;
386
+	margin					: -150px 0px 0px -224px;
387
+	padding					: 22px 0px 0px 25px;
388
+	position				: absolute;
389
+	top						: 50%;
390
+	width					: 448px;
391
+}
392
+
393
+.loginbox input[type=password], .loginbox input[type=text] {
394
+	margin-bottom			: 12px;
395
+	float					: left;
396
+	width					: 205px;
397
+}
398
+
399
+.loginbox label {
400
+	float					: left;
401
+	margin-right			: 5px;
402
+	text-align				: right;
403
+	width					: 180px;
404
+}
405
+
406
+.loginbox .body {
407
+	background				: none;
408
+	width					: 398px;
409
+}
410
+
411
+.logo {
412
+	color					: #6C6C6C;
413
+	float					: left;
414
+	font-size				: 10px;
415
+	padding-top				: 83px;
416
+	text-align				: right;
417
+	width					: 428px;
418
+}
419
+
420
+#mainmenu {
421
+	float					: left;
422
+	font-family				: Arial, sans-serif;
423
+	padding-left			: 12px;
424
+	width					: 190px;
425
+}
426
+
427
+#msg {
428
+	background				: url('images/msg.png');
429
+	color					: #FFFFFF;
430
+	display					: none;
431
+	font-size				: 16px;
432
+	font-weight				: bold;
433
+	height					: 38px;
434
+	left					: 50%;
435
+	margin					: -23px 0px 0px -247px;
436
+	padding					: 8px 0px 0px 8px;
437
+	position				: absolute;
438
+	text-shadow				: #000000 1px 1px;
439
+	top						: 50%;
440
+	width					: 487px;
441
+	z-index					: 21;
442
+}
443
+
444
+#msg img {
445
+	vertical-align			: middle;
446
+}
447
+
448
+.navbody {
449
+	border					: none;
450
+	display					: block;
451
+	list-style				: none;
452
+	margin					: 0px 0px 0px 0px;
453
+	padding					: 0px 0px 0px 0px;
454
+}
455
+
456
+.navbody a {
457
+	color					: #C9C9C9;
458
+	display					: block;
459
+	font-family				: verdana;
460
+	font-size				: 13px;
461
+	font-weight				: bold;
462
+	padding					: 6px 9px 6px 9px;
463
+	text-decoration			: none;
464
+	text-shadow				: #000000 1px 1px;
465
+}
466
+
467
+.navbody a:hover {
468
+	background-color		: #2F2F2F;
469
+	border-bottom			: 1px solid #161616;
470
+	border-top				: 1px solid #161616;
471
+	margin-top				: -1px;
472
+	padding					: 6px 9px 5px 9px;
473
+}
474
+
475
+.navbody a.active {
476
+	color					: #FE8013;
477
+	background-color		: #2F2F2F;
478
+	border-bottom			: 1px solid #161616;
479
+	border-top				: 1px solid #161616;
480
+	margin-top				: -1px;
481
+	padding					: 6px 9px 5px 9px;
482
+}
483
+
484
+.navbody li {
485
+	background-image		: url('images/navbody.png');
486
+	padding					: 0px 4px 0px 4px;
487
+}
488
+
489
+.navbox {
490
+	margin-top				: 7px;
491
+	overflow				: hidden;
492
+}
493
+
494
+.navfooter {
495
+	background-image		: url('images/navfoot.png');
496
+	display					: block;
497
+	height					: 4px;
498
+	margin					: -1px 0px 10px 0px;
499
+}
500
+
501
+.navheader {
502
+	background-image		: url('images/navhead1.png');
503
+	color					: #FFFFFF;
504
+	cursor					: default;
505
+	display					: block;
506
+	font-family				: arial;
507
+	font-size				: 14px;
508
+	font-weight				: bold;
509
+	height					: 26px;
510
+	padding-left			: 12px;
511
+	padding-top				: 14px;
512
+	text-shadow				: #000000 1px 1px;
513
+	width					: 190px;
514
+}
515
+
516
+.portno {
517
+	font-weight				: bold;
518
+}
519
+
520
+.portspeed {
521
+	font-size				: 10px;
522
+}
523
+
524
+.portstate td {
525
+	text-align				: center;
526
+	width					: 80px;
527
+}
528
+
529
+.select {
530
+	position				: relative;
531
+	font-size				: 16px;
532
+}
533
+
534
+.select:after {
535
+	background-image		: url('images/arrow.png');
536
+	content					: '';
537
+	height					: 4px;
538
+	pointer-events			: none;
539
+	position				: absolute;
540
+	right					: 7px;
541
+	top						: 8px;
542
+	width					: 8px;
543
+}
544
+
545
+.select:before {
546
+	background-color		: #2E2E2E;
547
+	box-shadow				: inset 0px 5px 4px #3E3E3E;
548
+	border					: 1px solid #191919;
549
+	content					: '';
550
+	height					: 15px;
551
+	pointer-events			: none;
552
+	position				: absolute;
553
+	right					: 0px;
554
+	top						: 1px;
555
+	width					: 20px;
556
+}
557
+
558
+.tips div {
559
+	background-color		: #FFFFAA;
560
+	border					: 1px solid #FE8013;
561
+	color					: #000000;
562
+	font-family				: verdana;
563
+	font-size				: 12px;
564
+	padding					: 3px;
565
+	position				: absolute;
566
+	visibility				: hidden;
567
+	z-index					: 10;
568
+}
569
+
570
+.webui {
571
+	background-image		: url('images/stripes.png');
572
+	background-repeat		: no-repeat;
573
+	margin-left				: auto;
574
+	margin-right			: auto;
575
+	width					: 1006px;
576
+}

+ 1
- 0
files/usr/lib/kagera/webui/themes/kagera/style.dat View File

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

+ 13
- 0
prepdicts.sh View File

@@ -0,0 +1,13 @@
1
+#!/bin/bash
2
+
3
+prepare() {
4
+	FILENAME=$(basename ${1})
5
+	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
6
+}
7
+
8
+mkdir -p ./files/usr/lib/kagera/langs/TEMPLATE
9
+
10
+while read FILE; do
11
+	prepare ${FILE}
12
+done < <(find ./files/ -type f -name \*.cbsi -o -name \*.sh)
13
+mv ./files/usr/lib/kagera/langs/TEMPLATE/index.dic ./files/usr/lib/kagera/langs/TEMPLATE/common.dic

Loading…
Cancel
Save