diff --git a/luci-app-bmx7/COPYING b/luci-app-bmx7/COPYING deleted file mode 100644 index d511905..0000000 --- a/luci-app-bmx7/COPYING +++ /dev/null @@ -1,339 +0,0 @@ - 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. - - - Copyright (C) - - 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. - - , 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. diff --git a/luci-app-bmx7/Makefile b/luci-app-bmx7/Makefile deleted file mode 100644 index dbd71c8..0000000 --- a/luci-app-bmx7/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright © 2011 Pau Escrich -# Contributors Roger Pueyo Centelles -# -# 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. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-bmx7 -PKG_RELEASE:=0.1-alpha - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) -PKG_LICENSE:=GPL-2.0+ - -include $(INCLUDE_DIR)/package.mk - -define Package/luci-app-bmx7 - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:= LuCI support for BMX7 - DEPENDS:=+luci-lib-json +luci-mod-admin-full +bmx7 +bmx7-json - MAINTAINER:= Roger Pueyo and Pau Escrich -endef - -define Package/luci-app-bmx7/description - LuCI application for web-based configuration and visualization of the BMX7 routing daemon -endef - -define Package/luci-app-bmx7/conffiles - /etc/config/luci-bmx7 -endef - -define Build/Prepare -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/luci-app-bmx7/install - $(CP) ./files/* $(1)/ - chmod 755 $(1)/www/cgi-bin/bmx7-info -endef - -$(eval $(call BuildPackage,luci-app-bmx7)) - diff --git a/luci-app-bmx7/files/etc/config/luci-bmx7 b/luci-app-bmx7/files/etc/config/luci-bmx7 deleted file mode 100644 index 46a7727..0000000 --- a/luci-app-bmx7/files/etc/config/luci-bmx7 +++ /dev/null @@ -1,7 +0,0 @@ -config 'bmx7' 'luci' - option ignore '0' - option place 'admin network BMX7' - #option place 'qmp Mesh' - option position '3' - #option json 'http://127.0.0.1/cgi-bin/bmx7-info?' - option json 'exec:/www/cgi-bin/bmx7-info -s' diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/controller/bmx7.lua b/luci-app-bmx7/files/usr/lib/lua/luci/controller/bmx7.lua deleted file mode 100644 index 482fb5d..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/controller/bmx7.lua +++ /dev/null @@ -1,101 +0,0 @@ ---[[ - Copyright (C) 2011 Pau Escrich - Contributors Jo-Philipp Wich - Roger Pueyo Centelles - - 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. - - The full GNU General Public License is included in this distribution in - the file called "COPYING". ---]] - -module("luci.controller.bmx7", package.seeall) - -function index() - local place = {} - local ucim = require "luci.model.uci" - local uci = ucim.cursor() - - -- checking if ignore is on - if uci:get("luci-bmx7","luci","ignore") == "1" then - return nil - end - - -- getting value from uci database - local uci_place = uci:get("luci-bmx7","luci","place") - - -- default values - if uci_place == nil then - place = {"bmx7"} - else - local util = require "luci.util" - place = util.split(uci_place," ") - end - - -- getting position of menu - local uci_position = uci:get("luci-bmx7","luci","position") - - - --------------------------- - -- Placing the pages in the menu - --------------------------- - - -- Status (default) - entry(place,call("action_status_j"),place[#place],tonumber(uci_position)) - - table.insert(place,"Status") - entry(place,call("action_status_j"),"Status",0) - table.remove(place) - - -- Topology - table.insert(place,"Topology") - entry(place,call("topology"),"Topology",1) - table.remove(place) - - -- Nodes - table.insert(place,"Nodes") - entry(place,call("action_nodes_j"),"Nodes",2) - table.remove(place) - - -- Tunnels - table.insert(place,"Gateways") - entry(place,call("action_tunnels_j"),"Gateways",3) - table.remove(place) - - -- Integrate bmx7-mdns if present - if nixio.fs.stat("/usr/lib/lua/luci/model/cbi/bmx7-mdns.lua","type") ~= nil then - table.insert(place,"mDNS") - entry(place, cbi("bmx7-mdns"), "mesh DNS", 1).dependent=false - table.remove(place) - end - -end - - -function action_status_j() - luci.template.render("bmx7/status_j", {}) -end - -function action_tunnels_j() - luci.template.render("bmx7/tunnels_j", {}) -end - -function topology() - luci.template.render("bmx7/topology", {}) -end - -function action_nodes_j() - luci.template.render("bmx7/nodes_j", {}) -end diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/view/admin_status/index/bmx7_nodes.htm b/luci-app-bmx7/files/usr/lib/lua/luci/view/admin_status/index/bmx7_nodes.htm deleted file mode 100644 index 8a6aefa..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/view/admin_status/index/bmx7_nodes.htm +++ /dev/null @@ -1,40 +0,0 @@ -
-
- <%:Bmx7 mesh nodes%> -
-
-
-
<%:Name%>
-
<%:Short ID%>
-
<%:S/s/T/t%>
-
<%:Primary IPv6%>
-
<%:Via Neighbour%>
-
<%:Device%>
-
<%:Metric%>
-
<%:Last Ref%>
-
-
-
-
-
- - - diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/nodes_j.htm b/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/nodes_j.htm deleted file mode 100644 index a631c93..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/nodes_j.htm +++ /dev/null @@ -1,155 +0,0 @@ -<%# - Copyright © 2011 Pau Escrich - Contributors Lluis Esquerda - Roger Pueyo Centelles - - 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. - - The full GNU General Public License is included in this distribution in - the file called "COPYING". --%> - -<%+header%> - - - - - - -
- -

Mesh nodes

-
-
-
-
- Tip: click the icon to see individual node information. -
-
- - -
- <%:Originators%> -
-
-
-
-
<%:Name%>
-
<%:Short ID%>
-
<%:S/s/T/t%>
-
<%:Primary IPv6%>
-
<%:Via Neighbour%>
-
<%:Metric%>
-
<%:Last Desc%>
-
<%:Last Ref%>
-
<%: %>
-
-
-
-
- -
- - - -<%+footer%> diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/status_j.htm b/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/status_j.htm deleted file mode 100644 index b7609d7..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/status_j.htm +++ /dev/null @@ -1,130 +0,0 @@ -<%+header%> - - - -
-
- -
-
- A mesh routing protocol for Linux devices.
- Visit bmx6.net for more information.
-
-
- -
- -
- <%:Node configuration%> -
-
-
-
<%:Short ID%>
-
<%:Node name%>
-
<%:Primary IPv6 address%>
-
<%:Node key%>
-
<%:Short DHash%>
-
<%:BMX7 revision%>
-
-
-
-
- - -
- <%:Node status%> -
-
-
-
<%:Nodes seen%>
-
<%:Neighbours%>
-
<%:Tunnelled IPv6 address%>
-
<%:Tunnelled IPv4 address%>
-
<%:Uptime%>
-
<%:CPU usage%>
-
<%:Memory usage%>
-
<%:Tx queue%>
-
-
-
-
- -
- <%:Network interfaces%> -
-
-
-
<%:Interface%>
-
<%:State%>
-
<%:Type%>
-
<%:Max rate%>
-
<%:LinkLocal Ipv6%>
-
<%:RX BpP%>
-
<%:TX BpP%>
-
-
-
-
- - -
- <%:Links%> -
- -
-
- -
- - - -<%+footer%> diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/topology.htm b/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/topology.htm deleted file mode 100644 index 58ce9fd..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/topology.htm +++ /dev/null @@ -1,54 +0,0 @@ -<%+header%> - - - - - - -<%+footer%> - diff --git a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/tunnels_j.htm b/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/tunnels_j.htm deleted file mode 100644 index aaa79a8..0000000 --- a/luci-app-bmx7/files/usr/lib/lua/luci/view/bmx7/tunnels_j.htm +++ /dev/null @@ -1,76 +0,0 @@ -<%# - Copyright (C) 2011 Pau Escrich - Contributors Lluis Esquerda - - 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. - - The full GNU General Public License is included in this distribution in - the file called "COPYING". --%> - - -<%+header%> - - - -
-

Gateway announcements

-
Networks announced by mesh nodes
- -
- <%:Announcements%> -
-
-
-
<%:Status%>
-
<%:Name%>
-
<%:Node%>
-
<%:Network%>
-
<%:Bandwith%>
-
<%:Local net%>
-
<%:Path Metric%>
-
<%:Tun Metric%>
-
<%:Rating%>
-
-
-
-
- -
- - - -<%+footer%> diff --git a/luci-app-bmx7/files/www/cgi-bin/bmx7-info b/luci-app-bmx7/files/www/cgi-bin/bmx7-info deleted file mode 100755 index 7388ed1..0000000 --- a/luci-app-bmx7/files/www/cgi-bin/bmx7-info +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/sh -# Copyright © 2011 Pau Escrich -# Contributors Jo-Philipp Wich -# Roger Pueyo Centelles -# -# 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. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# This script gives information about bmx7 -# Can be executed from a linux shell: ./bmx7-info -s links -# Or from web interfae (with cgi enabled): http://host/cgi-bin/bmx7-info?links -# If you ask for a directory you wil get the directory contents in JSON forman - -BMX7_DIR="$(uci get bmx7.general.runtimeDir 2>/dev/null)" || BMX7_DIR="/var/run/bmx7/json" - -#Checking if shell mode or cgi-bin mode -if [ "$1" == "-s" ]; then - QUERY="$2" -else - QUERY="${QUERY_STRING%%=*}" - echo "Content-type: application/json" - echo "" -fi - -check_path() { - [ -d "$1" ] && path=$(cd $1; pwd) - [ -f "$1" ] && path=$(cd $1/..; pwd) - [ $(echo "$path" | grep -c "^$BMX7_DIR") -ne 1 ] && exit 1 -} - -print_mem() { - echo -n '{ "memory": { "bmx7": "' - cat /proc/$(cat /var/run/bmx7/pid)/status |grep -i VmSize | tr -s " " | cut -d " " -f 2,3 | tr -d "\n" - echo '"}}' -} - -print_query() { - # If the query is a directory - [ -d "$BMX7_DIR/$1" ] && - { - # If /all has not been specified - [ -z "$QALL" ] && - { - total=$(ls $BMX7_DIR/$1 | wc -w) - i=1 - echo -n "{ \"$1\": [ " - for f in $(ls $BMX7_DIR/$1); do - echo -n "{ \"name\": \"$f\" }" - [ $i -lt $total ] && echo -n ',' - i=$(( $i + 1 )) - done - echo -n " ] }" - - # If /all has been specified, printing all the files together - } || { - comma="" - echo -n "[ " - for entry in "$BMX7_DIR/$1/"*; do - [ -f "$entry" ] && - { - ${comma:+echo "$comma"} - tr -d '\n' < "$entry" - comma="," - } - done - echo -n " ]" - } - } - - # If the query is a file, just printing the file - [ -f "$BMX7_DIR/$1" ] && [ -s "$BMX7_DIR/$1" ] && cat "$BMX7_DIR/$1" && return 0 || return 1 -} - -if [ "${QUERY##*/}" == "all" ]; then - QUERY="${QUERY%/all}" - QALL=1 -fi - -if [ "$QUERY" == '$info' ]; then - echo '{ "info": [ ' - print_query status - echo -n "," - print_query interfaces && echo -n "," || echo -n '{ "interfaces": "" },' - print_query links && echo -n "," || echo -n '{ "links": "" },' - print_mem - echo "] }" -fi - -if [ "$QUERY" == '$neighbours' ]; then - QALL=1 - echo '{ "neighbours": [ ' - echo '{ "originators": ' - print_query originators - echo '}, ' - echo '{ "descriptions": ' - print_query descriptions - echo "} ] }" - exit 0 - -else if [ "$QUERY" == '$tunnels' ]; then - bmx7 -c --jshow tunnels /r=0 - exit 0 - - else if [ "$QUERY" == '$originators' ]; then - bmx7 -c --jshow originators /r=0 - exit 0 - - else - check_path "$BMX7_DIR/$QUERY" - print_query $QUERY - exit 0 - fi - fi -fi -fi - -ls -1F "$BMX7_DIR" -exit 0 - diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/bmx7logo.png b/luci-app-bmx7/files/www/luci-static/resources/bmx7/bmx7logo.png deleted file mode 100644 index c7d9cea..0000000 Binary files a/luci-app-bmx7/files/www/luci-static/resources/bmx7/bmx7logo.png and /dev/null differ diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph-theme.css b/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph-theme.css deleted file mode 100644 index 276d362..0000000 --- a/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph-theme.css +++ /dev/null @@ -1,59 +0,0 @@ -.njg-overlay{ - background: #fbfbfb; - border-radius: 2px; - border: 1px solid #ccc; - color: #6d6357; - font-family: Arial, sans-serif; - font-family: sans-serif; - font-size: 14px; - line-height: 20px; - height: auto; - max-width: 400px; - min-width: 200px; - padding: 0 15px; - right: 10px; - top: 10px; - width: auto; -} - -.njg-metadata{ - background: #fbfbfb; - border-radius: 2px; - border: 1px solid #ccc; - color: #6d6357; - display: none; - font-family: Arial, sans-serif; - font-family: sans-serif; - font-size: 14px; - height: auto; - left: 10px; - max-width: 500px; - min-width: 200px; - padding: 0 15px; - top: 10px; - width: auto; -} - -.njg-node{ - stroke-opacity: 0.5; - stroke-width: 7px; - stroke: #fff; -} - -.njg-node:hover, -.njg-node.njg-open { - stroke: rgba(0, 0, 0, 0.2); -} - -.njg-link{ - cursor: pointer; - stroke: #999; - stroke-width: 2; - stroke-opacity: 0.25; -} - -.njg-link:hover, -.njg-link.njg-open{ - stroke-width: 4 !important; - stroke-opacity: 0.5; -} diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph.css b/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph.css deleted file mode 100644 index 556c520..0000000 --- a/luci-app-bmx7/files/www/luci-static/resources/bmx7/css/netjsongraph.css +++ /dev/null @@ -1,62 +0,0 @@ -.njg-hidden { - display: none !important; - visibility: hidden !important; -} - -.njg-tooltip{ - font-family: sans-serif; - font-size: 10px; - fill: #000; - opacity: 0.5; - text-anchor: middle; -} - -.njg-overlay{ - display: none; - position: absolute; - z-index: 11; -} - -.njg-close{ - cursor: pointer; - position: absolute; - right: 10px; - top: 10px; -} -.njg-close:before { content: "\2716"; } - -.njg-metadata{ - display: none; - position: absolute; - z-index: 12; -} - -.njg-node{ cursor: pointer } -.njg-link{ cursor: pointer } - -#njg-select-group { - text-align: center; - box-shadow: 0 0 10px #ccc; - position: fixed; - left: 50%; - top: 50%; - width: 50%; - margin-top: -7.5em; - margin-left: -25%; - padding: 5em 2em; -} - -#njg-select-group select { - font-size: 2em; - padding: 10px 15px; - width: 50%; - cursor: pointer; -} - -#njg-select-group option { - padding: 0.5em; -} - -#njg-select-group option[value=""] { - color: #aaa; -} diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/netjsongraph.js b/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/netjsongraph.js deleted file mode 100644 index 66d0a5f..0000000 --- a/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/netjsongraph.js +++ /dev/null @@ -1,568 +0,0 @@ -// version 0.1 -(function () { - /** - * vanilla JS implementation of jQuery.extend() - */ - d3._extend = function(defaults, options) { - var extended = {}, - prop; - for(prop in defaults) { - if(Object.prototype.hasOwnProperty.call(defaults, prop)) { - extended[prop] = defaults[prop]; - } - } - for(prop in options) { - if(Object.prototype.hasOwnProperty.call(options, prop)) { - extended[prop] = options[prop]; - } - } - return extended; - }; - - /** - * @function - * @name d3._pxToNumber - * Convert strings like "10px" to 10 - * - * @param {string} val The value to convert - * @return {int} The converted integer - */ - d3._pxToNumber = function(val) { - return parseFloat(val.replace('px')); - }; - - /** - * @function - * @name d3._windowHeight - * - * Get window height - * - * @return {int} The window innerHeight - */ - d3._windowHeight = function() { - return window.innerHeight || document.documentElement.clientHeight || 600; - }; - - /** - * @function - * @name d3._getPosition - * - * Get the position of `element` relative to `container` - * - * @param {object} element - * @param {object} container - */ - d3._getPosition = function(element, container) { - var n = element.node(), - nPos = n.getBoundingClientRect(); - cPos = container.node().getBoundingClientRect(); - return { - top: nPos.top - cPos.top, - left: nPos.left - cPos.left, - width: nPos.width, - bottom: nPos.bottom - cPos.top, - height: nPos.height, - right: nPos.right - cPos.left - }; - }; - - /** - * netjsongraph.js main function - * - * @constructor - * @param {string} url The NetJSON file url - * @param {object} opts The object with parameters to override {@link d3.netJsonGraph.opts} - */ - d3.netJsonGraph = function(url, opts) { - /** - * Default options - * - * @param {string} el "body" The container element el: "body" [description] - * @param {bool} metadata true Display NetJSON metadata at startup? - * @param {bool} defaultStyle true Use css style? - * @param {bool} animationAtStart false Animate nodes or not on load - * @param {array} scaleExtent [0.25, 5] The zoom scale's allowed range. @see {@link https://github.com/mbostock/d3/wiki/Zoom-Behavior#scaleExtent} - * @param {int} charge -130 The charge strength to the specified value. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#charge} - * @param {int} linkDistance 50 The target distance between linked nodes to the specified value. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#linkDistance} - * @param {float} linkStrength 0.2 The strength (rigidity) of links to the specified value in the range. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#linkStrength} - * @param {float} friction 0.9 The friction coefficient to the specified value. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#friction} - * @param {string} chargeDistance Infinity The maximum distance over which charge forces are applied. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#chargeDistance} - * @param {float} theta 0.8 The Barnes–Hut approximation criterion to the specified value. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#theta} - * @param {float} gravity 0.1 The gravitational strength to the specified numerical value. @see {@link https://github.com/mbostock/d3/wiki/Force-Layout#gravity} - * @param {int} circleRadius 8 The radius of circles (nodes) in pixel - * @param {string} labelDx "0" SVG dx (distance on x axis) attribute of node labels in graph - * @param {string} labelDy "-1.3em" SVG dy (distance on y axis) attribute of node labels in graph - * @param {function} onInit Callback function executed on initialization - * @param {function} onLoad Callback function executed after data has been loaded - * @param {function} onEnd Callback function executed when initial animation is complete - * @param {function} linkDistanceFunc By default high density areas have longer links - * @param {function} redraw Called when panning and zooming - * @param {function} prepareData Used to convert NetJSON NetworkGraph to the javascript data - * @param {function} onClickNode Called when a node is clicked - * @param {function} onClickLink Called when a link is clicked - */ - opts = d3._extend({ - el: "body", - metadata: true, - defaultStyle: true, - animationAtStart: true, - scaleExtent: [0.25, 5], - charge: -130, - linkDistance: 50, - linkStrength: 0.2, - friction: 0.9, // d3 default - chargeDistance: Infinity, // d3 default - theta: 0.8, // d3 default - gravity: 0.1, - circleRadius: 8, - labelDx: "0", - labelDy: "-1.3em", - nodeClassProperty: null, - linkClassProperty: null, - /** - * @function - * @name onInit - * - * Callback function executed on initialization - * @param {string|object} url The netJson remote url or object - * @param {object} opts The object of passed arguments - * @return {function} - */ - onInit: function(url, opts) {}, - /** - * @function - * @name onLoad - * - * Callback function executed after data has been loaded - * @param {string|object} url The netJson remote url or object - * @param {object} opts The object of passed arguments - * @return {function} - */ - onLoad: function(url, opts) {}, - /** - * @function - * @name onEnd - * - * Callback function executed when initial animation is complete - * @param {string|object} url The netJson remote url or object - * @param {object} opts The object of passed arguments - * @return {function} - */ - onEnd: function(url, opts) {}, - /** - * @function - * @name linkDistanceFunc - * - * By default, high density areas have longer links - */ - linkDistanceFunc: function(d){ - var val = opts.linkDistance; - if(d.source.linkCount >= 4 && d.target.linkCount >= 4) { - return val * 2; - } - return val; - }, - /** - * @function - * @name redraw - * - * Called on zoom and pan - */ - redraw: function() { - panner.attr("transform", - "translate(" + d3.event.translate + ") " + - "scale(" + d3.event.scale + ")" - ); - }, - /** - * @function - * @name prepareData - * - * Convert NetJSON NetworkGraph to the data structure consumed by d3 - * - * @param graph {object} - */ - prepareData: function(graph) { - var nodesMap = {}, - nodes = graph.nodes.slice(), // copy - links = graph.links.slice(), // copy - nodes_length = graph.nodes.length, - links_length = graph.links.length; - - for(var i = 0; i < nodes_length; i++) { - // count how many links every node has - nodes[i].linkCount = 0; - nodesMap[nodes[i].id] = i; - } - for(var c = 0; c < links_length; c++) { - var sourceIndex = nodesMap[links[c].source], - targetIndex = nodesMap[links[c].target]; - // ensure source and target exist - if(!nodes[sourceIndex]) { throw("source '" + links[c].source + "' not found"); } - if(!nodes[targetIndex]) { throw("target '" + links[c].target + "' not found"); } - links[c].source = nodesMap[links[c].source]; - links[c].target = nodesMap[links[c].target]; - // add link count to both ends - nodes[sourceIndex].linkCount++; - nodes[targetIndex].linkCount++; - } - return { "nodes": nodes, "links": links }; - }, - /** - * @function - * @name onClickNode - * - * Called when a node is clicked - */ - onClickNode: function(n) { - var overlay = d3.select(".njg-overlay"), - overlayInner = d3.select(".njg-overlay > .njg-inner"), - html = "

id: " + n.id + "

"; - if(n.label) { html += "

label: " + n.label + "

"; } - if(n.properties) { - for(var key in n.properties) { - if(!n.properties.hasOwnProperty(key)) { continue; } - html += "

"+key.replace(/_/g, " ")+": " + n.properties[key] + "

"; - } - } - if(n.linkCount) { html += "

links: " + n.linkCount + "

"; } - if(n.local_addresses) { - html += "

local addresses:
" + n.local_addresses.join('
') + "

"; - } - overlayInner.html(html); - overlay.classed("njg-hidden", false); - overlay.style("display", "block"); - // set "open" class to current node - removeOpenClass(); - d3.select(this).classed("njg-open", true); - }, - /** - * @function - * @name onClickLink - * - * Called when a node is clicked - */ - onClickLink: function(l) { - var overlay = d3.select(".njg-overlay"), - overlayInner = d3.select(".njg-overlay > .njg-inner"), - html = "

source: " + (l.source.label || l.source.id) + "

"; - html += "

target: " + (l.target.label || l.target.id) + "

"; - html += "

cost: " + l.cost + "

"; - if(l.properties) { - for(var key in l.properties) { - if(!l.properties.hasOwnProperty(key)) { continue; } - html += "

"+ key.replace(/_/g, " ") +": " + l.properties[key] + "

"; - } - } - overlayInner.html(html); - overlay.classed("njg-hidden", false); - overlay.style("display", "block"); - // set "open" class to current link - removeOpenClass(); - d3.select(this).classed("njg-open", true); - } - }, opts); - - // init callback - opts.onInit(url, opts); - - if(!opts.animationAtStart) { - opts.linkStrength = 2; - opts.friction = 0.3; - opts.gravity = 0; - } - if(opts.el == "body") { - var body = d3.select(opts.el), - rect = body.node().getBoundingClientRect(); - if (d3._pxToNumber(d3.select("body").style("height")) < 60) { - body.style("height", d3._windowHeight() - rect.top - rect.bottom + "px"); - } - } - var el = d3.select(opts.el).style("position", "relative"), - width = d3._pxToNumber(el.style('width')), - height = d3._pxToNumber(el.style('height')), - force = d3.layout.force() - .charge(opts.charge) - .linkStrength(opts.linkStrength) - .linkDistance(opts.linkDistanceFunc) - .friction(opts.friction) - .chargeDistance(opts.chargeDistance) - .theta(opts.theta) - .gravity(opts.gravity) - // width is easy to get, if height is 0 take the height of the body - .size([width, height]), - zoom = d3.behavior.zoom().scaleExtent(opts.scaleExtent), - // panner is the element that allows zooming and panning - panner = el.append("svg") - .attr("width", width) - .attr("height", height) - .call(zoom.on("zoom", opts.redraw)) - .append("g") - .style("position", "absolute"), - svg = d3.select(opts.el + " svg"), - drag = force.drag(), - overlay = d3.select(opts.el).append("div").attr("class", "njg-overlay"), - closeOverlay = overlay.append("a").attr("class", "njg-close"), - overlayInner = overlay.append("div").attr("class", "njg-inner"), - metadata = d3.select(opts.el).append("div").attr("class", "njg-metadata"), - metadataInner = metadata.append("div").attr("class", "njg-inner"), - closeMetadata = metadata.append("a").attr("class", "njg-close"), - // container of ungrouped networks - str = [], - selected = [], - /** - * @function - * @name removeOpenClass - * - * Remove open classes from nodes and links - */ - removeOpenClass = function () { - d3.selectAll("svg .njg-open").classed("njg-open", false); - }; - processJson = function(graph) { - /** - * Init netJsonGraph - */ - init = function(url, opts) { - d3.netJsonGraph(url, opts); - }; - /** - * Remove all instances - */ - destroy = function() { - force.stop(); - d3.select("#selectGroup").remove(); - d3.select(".njg-overlay").remove(); - d3.select(".njg-metadata").remove(); - overlay.remove(); - overlayInner.remove(); - metadata.remove(); - svg.remove(); - node.remove(); - link.remove(); - nodes = []; - links = []; - }; - /** - * Destroy and e-init all instances - * @return {[type]} [description] - */ - reInit = function() { - destroy(); - init(url, opts); - }; - - var data = opts.prepareData(graph), - links = data.links, - nodes = data.nodes; - - // disable some transitions while dragging - drag.on('dragstart', function(n){ - d3.event.sourceEvent.stopPropagation(); - zoom.on('zoom', null); - }) - // re-enable transitions when dragging stops - .on('dragend', function(n){ - zoom.on('zoom', opts.redraw); - }) - .on("drag", function(d) { - // avoid pan & drag conflict - d3.select(this).attr("x", d.x = d3.event.x).attr("y", d.y = d3.event.y); - }); - - force.nodes(nodes).links(links).start(); - - var link = panner.selectAll(".link") - .data(links) - .enter().append("line") - .attr("class", function (link) { - var baseClass = "njg-link", - addClass = null; - value = link.properties && link.properties[opts.linkClassProperty]; - if (opts.linkClassProperty && value) { - // if value is stirng use that as class - if (typeof(value) === "string") { - addClass = value; - } - else if (typeof(value) === "number") { - addClass = opts.linkClassProperty + value; - } - else if (value === true) { - addClass = opts.linkClassProperty; - } - return baseClass + " " + addClass; - } - return baseClass; - }) - .on("click", opts.onClickLink), - groups = panner.selectAll(".node") - .data(nodes) - .enter() - .append("g"); - node = groups.append("circle") - .attr("class", function (node) { - var baseClass = "njg-node", - addClass = null; - value = node.properties && node.properties[opts.nodeClassProperty]; - if (opts.nodeClassProperty && value) { - // if value is stirng use that as class - if (typeof(value) === "string") { - addClass = value; - } - else if (typeof(value) === "number") { - addClass = opts.nodeClassProperty + value; - } - else if (value === true) { - addClass = opts.nodeClassProperty; - } - return baseClass + " " + addClass; - } - return baseClass; - }) - .attr("r", opts.circleRadius) - .on("click", opts.onClickNode) - .call(drag); - - var labels = groups.append('text') - .text(function(n){ return n.label || n.id }) - .attr('dx', opts.labelDx) - .attr('dy', opts.labelDy) - .attr('class', 'njg-tooltip'); - - // Close overlay - closeOverlay.on("click", function() { - removeOpenClass(); - overlay.classed("njg-hidden", true); - }); - // Close Metadata panel - closeMetadata.on("click", function() { - // Reinitialize the page - if(graph.type === "NetworkCollection") { - reInit(); - } - else { - removeOpenClass(); - metadata.classed("njg-hidden", true); - } - }); - // default style - // TODO: probably change defaultStyle - // into something else - if(opts.defaultStyle) { - var colors = d3.scale.category20c(); - node.style({ - "fill": function(d){ return colors(d.linkCount); }, - "cursor": "pointer" - }); - } - // Metadata style - if(opts.metadata) { - metadata.attr("class", "njg-metadata").style("display", "block"); - } - - var attrs = ["protocol", - "version", - "revision", - "metric", - "router_id", - "topology_id"], - html = ""; - if(graph.label) { - html += "

" + graph.label + "

"; - } - for(var i in attrs) { - var attr = attrs[i]; - if(graph[attr]) { - html += "

" + attr + ": " + graph[attr] + "

"; - } - } - // Add nodes and links count - html += "

nodes: " + graph.nodes.length + "

"; - html += "

links: " + graph.links.length + "

"; - metadataInner.html(html); - metadata.classed("njg-hidden", false); - - // onLoad callback - opts.onLoad(url, opts); - - force.on("tick", function() { - link.attr("x1", function(d) { - return d.source.x; - }) - .attr("y1", function(d) { - return d.source.y; - }) - .attr("x2", function(d) { - return d.target.x; - }) - .attr("y2", function(d) { - return d.target.y; - }); - - node.attr("cx", function(d) { - return d.x; - }) - .attr("cy", function(d) { - return d.y; - }); - - labels.attr("transform", function(d) { - return "translate(" + d.x + "," + d.y + ")"; - }); - }) - .on("end", function(){ - force.stop(); - // onEnd callback - opts.onEnd(url, opts); - }); - - return force; - }; - - if(typeof(url) === "object") { - processJson(url); - } - else { - /** - * Parse the provided json file - * and call processJson() function - * - * @param {string} url The provided json file - * @param {function} error - */ - d3.json(url, function(error, graph) { - if(error) { throw error; } - /** - * Check if the json contains a NetworkCollection - */ - if(graph.type === "NetworkCollection") { - var selectGroup = body.append("div").attr("id", "njg-select-group"), - select = selectGroup.append("select") - .attr("id", "select"); - str = graph; - select.append("option") - .attr({ - "value": "", - "selected": "selected", - "name": "default", - "disabled": "disabled" - }) - .html("Choose the network to display"); - graph.collection.forEach(function(structure) { - select.append("option").attr("value", structure.type).html(structure.type); - // Collect each network json structure - selected[structure.type] = structure; - }); - select.on("change", function() { - selectGroup.attr("class", "njg-hidden"); - // Call selected json structure - processJson(selected[this.options[this.selectedIndex].value]); - }); - } - else { - processJson(graph); - } - }); - } - }; -})(); diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/polling.js b/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/polling.js deleted file mode 100644 index 234391a..0000000 --- a/luci-app-bmx7/files/www/luci-static/resources/bmx7/js/polling.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright © 2011 Pau Escrich - Contributors Lluis Esquerda - - 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. - - The full GNU General Public License is included in this distribution in - the file called "COPYING". -*/ - - -/* - Table pooler is a function to easy call XHR poller. - - new TablePooler(5,"/cgi-bin/bmx7-info", {'status':''}, "status_table", function(st){ - var table = Array() - table.push(st.first,st.second) - return table - } - - The parameters are: - polling_time: time between pollings - json_url: the json url to fetch the data - json_call: the json call - output_table_id: the table where javascript will put the data - callback_function: the function that will be executed each polling_time - - The callback_function must return an array of arrays (matrix). - In the code st is the data obtained from the json call -*/ - -function TablePooler (time, jsonurl, getparams, div_id, callback) { - this.div_id = div_id; - this.div = document.getElementById(div_id); - this.callback = callback; - this.jsonurl = jsonurl; - this.getparams = getparams; - this.time = time; - - this.start = function(){ - XHR.poll(this.time, this.jsonurl, this.getparams, function(x, st){ - var data = this.callback(st); - var content; - for (var i = 0; i < data.length; i++){ - rowId = "trDiv_" + this.div_id + i; - rowDiv = document.getElementById(rowId); - if (rowDiv === null) { - rowDiv = document.createElement("div"); - rowDiv.id = rowId; - rowDiv.className = "tr"; - this.div.appendChild(rowDiv); - } - for (var j = 0; j < data[i].length; j++){ - cellId = "tdDiv_" + this.div_id + i + j; - cellDiv = document.getElementById(cellId); - if (cellDiv === null) { - cellDiv = document.createElement("div"); - cellDiv.id = cellId; - cellDiv.className = "td"; - rowDiv.appendChild(cellDiv); - } - if (typeof data[i][j] !== 'undefined' && data[i][j].length == 2) { - content = data[i][j][0] + "/" + data[i][j][1]; - } - else content = data[i][j]; - cellDiv.innerHTML = content; - } - } - }.bind(this)); - } - - - this.start(); -} diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/world.png b/luci-app-bmx7/files/www/luci-static/resources/bmx7/world.png deleted file mode 100644 index 29b53c9..0000000 Binary files a/luci-app-bmx7/files/www/luci-static/resources/bmx7/world.png and /dev/null differ diff --git a/luci-app-bmx7/files/www/luci-static/resources/bmx7/world_small.png b/luci-app-bmx7/files/www/luci-static/resources/bmx7/world_small.png deleted file mode 100644 index f5f3105..0000000 Binary files a/luci-app-bmx7/files/www/luci-static/resources/bmx7/world_small.png and /dev/null differ