From 6db24206188614256283f52aecb155c84ca01730 Mon Sep 17 00:00:00 2001 From: ttrask Date: Thu, 5 Feb 2009 21:08:17 +0000 Subject: Modified network stats again to combine legend with checkboxes, and sorted by interface name. Makes chart larger again, but have to pre-define colors. git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@1699 ab2d0c66-481e-0410-8bed-d214d4d58bed --- health-networkstats-html.lsp | 69 ++++++++++++++++++++++++++++++++------------ 1 file changed, 51 insertions(+), 18 deletions(-) diff --git a/health-networkstats-html.lsp b/health-networkstats-html.lsp index 29f2be0..888a73e 100644 --- a/health-networkstats-html.lsp +++ b/health-networkstats-html.lsp @@ -1,6 +1,35 @@ <% local view, viewlibrary, page_info = ... %> <% require("viewfunctions") %> <% require("json") %> +<% + -- Table of colors + local rgb = { + {"rgb(0,192,128)","rgb(64,255,192)"}, + {"rgb(128,0,192)","rgb(192,64,255)"}, + {"rgb(0,128,192)","rgb(64,192,255)"}, + {"rgb(192,0,128)","rgb(255,64,192)"}, + {"rgb(128,192,0)","rgb(192,255,64)"}, + {"rgb(192,128,0)","rgb(255,192,64)"}, + {"rgb(0,0,0)","rgb(128,128,128)"}, + {"rgb(128,0,0)","rgb(192,64,64)"}, + {"rgb(0,128,0)","rgb(64,192,64)"}, + {"rgb(0,0,128)","rgb(64,64,192)"}, + {"rgb(128,128,0)","rgb(192,192,64)"}, + {"rgb(0,128,128)","rgb(64,192,192)"}, + {"rgb(128,0,128)","rgb(192,64,192)"}, + {"rgb(192,192,192)","rgb(255,255,255)"}, + {"rgb(192,128,128)","rgb(255,192,192)"}, + {"rgb(128,192,128)","rgb(192,255,192)"}, + {"rgb(128,128,192)","rgb(192,192,255)"}, + {"rgb(192,128,192)","rgb(255,192,255)"}, + {"rgb(128,192,192)","rgb(192,255,255)"}, + {"rgb(192,192,128)","rgb(255,255,192)"}, + } + + local interfaces = {} + for intf in pairs(view.value) do table.insert(interfaces, intf) end + table.sort(interfaces) +%>