From: conxuro Date: Wed, 9 Jan 2013 08:12:20 +0000 (+0100) Subject: Changed and made configurable the order position of the web menu X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=28957aa1a995d35921b82c5498cd25be88311f43;p=feed%2Frouting.git Changed and made configurable the order position of the web menu --- diff --git a/bmx6-luci/files/etc/config/luci-bmx6 b/bmx6-luci/files/etc/config/luci-bmx6 index 72aeab6..f70205b 100644 --- a/bmx6-luci/files/etc/config/luci-bmx6 +++ b/bmx6-luci/files/etc/config/luci-bmx6 @@ -2,5 +2,6 @@ config 'bmx6' 'luci' option ignore '0' #option place 'admin status Bmx6' option place 'qmp Mesh' + option position '3' #option json 'http://127.0.0.1/cgi-bin/bmx6-info?' option json 'exec:/www/cgi-bin/bmx6-info -s' diff --git a/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua b/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua index ed02a84..a9f2533 100644 --- a/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua +++ b/bmx6-luci/files/usr/lib/lua/luci/controller/bmx6.lua @@ -44,12 +44,20 @@ function index() local util = require "luci.util" place = util.split(uci_place," ") end + + -- getting position of menu + local uci_position = uci:get("luci-bmx6","luci","position") + --------------------------- -- Starting with the pages --------------------------- --- status (default) - entry(place,call("action_status_j"),place[#place]) + 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) -- not visible table.insert(place,"nodes_nojs") @@ -76,14 +84,14 @@ function index() --entry(place,call("action_gateways_j"),"Gateways").leaf = true --table.remove(place) - --- chat + --- Chat table.insert(place,"Chat") - entry(place,call("action_chat"),"Chat") + entry(place,call("action_chat"),"Chat",5) table.remove(place) --- Graph table.insert(place,"Graph") - entry(place, template("bmx6/graph",4), "Graph") + entry(place, template("bmx6/graph"), "Graph",4) table.remove(place) --- Topology (hidden)