From 1bb4822dca6113f73e3bc89e2acf15935e6f8e92 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 3 Dec 2014 15:17:05 +0100 Subject: Rework LuCI build system * Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich --- .../luasrc/view/status-olsr/routes.htm | 148 +++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm (limited to 'applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm') diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm new file mode 100644 index 0000000000..76e1b1078b --- /dev/null +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/routes.htm @@ -0,0 +1,148 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich +Copyright 2011 Manuel Munz + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 +-%> + +<% + +local olsrtools = require "luci.tools.olsr" +local i = 1 + +if luci.http.formvalue("status") == "1" then + local rv = {} + for k, route in ipairs(routes) do + local ETX = string.format("%.3f", tonumber(route.rtpMetricCost)/1024 or 0) + rv[#rv+1] = { + hostname = route.hostname, + dest = route.destination, + genmask = route.genmask, + gw = route.gateway, + interface = route.networkInterface, + metric = route.metric, + etx = ETX, + color = olsrtools.etx_color(tonumber(ETX)) + } + end + luci.http.prepare_content("application/json") + luci.http.write_json(rv) + return +end + +%> + +<%+header%> + + + + + + +

<%:Known OLSR routes%>

+ +
+ +
+<%:Overview of currently known routes to other OLSR nodes%> + + + + + + + + + + + + + + + <% for k, route in ipairs(routes) do + ETX = tonumber(route.rtpMetricCost)/1024 or '0' + color = olsrtools.etx_color(ETX) + %> + + + + + + + + + <% + i = ((i % 2) + 1) + end %> + +
<%:Announced network%><%:OLSR gateway%><%:Interface%><%:Metric%>ETX
<%=route.destination%>/<%=route.genmask%> + <% if route.proto == '6' then %> + <%=route.gateway%> + <% else %> + <%=route.gateway%> + <% end %> + <% if route.hostname then %> + / <%=route.hostname%> + <% end %> + <%=route.networkInterface%><%=route.metric%><%=string.format("%.3f", ETX)%>
+ +<%+status-olsr/legend%> +
+<%+status-olsr/common_js%> +<%+footer%> -- cgit v1.2.3