Rework LuCI build system
[project/luci.git] / applications / luci-app-olsr / luasrc / tools / olsr.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11 ]]--
12
13 module("luci.tools.olsr", package.seeall)
14
15 function etx_color(etx)
16         local color = "#bb3333"
17         if etx == 0 then
18                 color = "#bb3333"
19         elseif etx < 2 then
20                 color = "#00cc00"
21         elseif etx < 4 then
22                 color = "#ffcb05"
23         elseif etx < 10 then
24                 color = "#ff6600"
25         end
26         return color
27 end
28
29 function snr_color(snr)
30         local color = "#bb3333"
31         if snr == 0 then
32                 color = "#bb3333"
33         elseif snr > 30 then
34                 color = "#00cc00"
35         elseif snr > 20 then
36                 color = "#ffcb05"
37         elseif snr > 5 then
38                 color = "#ff6600"
39         end
40         return color
41 end
42