summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Pueyo Centelles2016-03-10 10:17:33 +0000
committerRoger Pueyo Centelles2016-05-04 13:18:48 +0000
commit1ee363fc224f9aa414165418e5cd0a94e7a45568 (patch)
treebdf5288ce1b6ba71fc5e9c50bb502d114681c947
parentd918b65774f59890398c98eebba7a826e15adf25 (diff)
downloadrouting-1ee363fc224f9aa414165418e5cd0a94e7a45568.tar.gz
[luci-app-bmx7] Add empty controller and default configurations for BMX7 LuCI
-rw-r--r--luci-app-bmx7/files/etc/config/luci-bmx77
-rw-r--r--luci-app-bmx7/files/usr/lib/lua/luci/controller/bmx7.lua50
2 files changed, 57 insertions, 0 deletions
diff --git a/luci-app-bmx7/files/etc/config/luci-bmx7 b/luci-app-bmx7/files/etc/config/luci-bmx7
new file mode 100644
index 0000000..46a7727
--- /dev/null
+++ b/luci-app-bmx7/files/etc/config/luci-bmx7
@@ -0,0 +1,7 @@
+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
new file mode 100644
index 0000000..a94b5e1
--- /dev/null
+++ b/luci-app-bmx7/files/usr/lib/lua/luci/controller/bmx7.lua
@@ -0,0 +1,50 @@
+--[[
+ Copyright (C) 2011 Pau Escrich <pau@dabax.net>
+ Contributors Jo-Philipp Wich <xm@subsignal.org>
+ Roger Pueyo Centelles <roger.pueyo@guifi.net>
+
+ 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")
+
+end \ No newline at end of file