From bfac3536373cdd298169019d80a0af7078ce37b9 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Mon, 7 Apr 2008 13:56:10 +0000 Subject: Added expert and logfile functionallity. git-svn-id: svn://svn.alpinelinux.org/acf/quagga/trunk@951 ab2d0c66-481e-0410-8bed-d214d4d58bed --- Makefile | 4 +- quagga-controller.lua | 2 +- quagga-expert-html.lsp | 113 ++++++++++++++++++++++++++++++++++++++++++++++++ quagga-logfile-html.lsp | 78 +++++++++++++++++++++++++++++++++ quagga-model.lua | 1 + quagga.menu | 4 +- 6 files changed, 198 insertions(+), 4 deletions(-) create mode 100644 quagga-expert-html.lsp create mode 100644 quagga-logfile-html.lsp diff --git a/Makefile b/Makefile index da669d4..05737da 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ APP_NAME=quagga PACKAGE=acf-$(APP_NAME) -VERSION=0.1.2 +VERSION=0.2.0 APP_DIST=\ quagga-controller.lua \ quagga-model.lua \ quagga-status-html.lsp \ + quagga-logfile-html.lsp \ + quagga-expert-html.lsp \ quagga.menu \ diff --git a/quagga-controller.lua b/quagga-controller.lua index ac216e7..8550fb5 100644 --- a/quagga-controller.lua +++ b/quagga-controller.lua @@ -98,7 +98,7 @@ expert = function (self) end -- Display management buttons management = displaycmdmanagement(disablestart,disablestop,disablerestart) - + return ( { status = status, file = file, diff --git a/quagga-expert-html.lsp b/quagga-expert-html.lsp new file mode 100644 index 0000000..cf70091 --- /dev/null +++ b/quagga-expert-html.lsp @@ -0,0 +1,113 @@ + +DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] +?> + 0) then + val.class = "error" + io.write(" class='error'") + end + io.write(">" .. val.label .. "") + io.write("\n\t\t
") + if (viewtype == "viewonly") then + io.write(val.value) + elseif (val.type == "radio") and (type(val.option) == "table") and (#val.option > 0) then + io.write("") + for k1,v1 in pairs(val.option) do + io.write(tostring(v1.label) .. ":") + io.write("") + end + io.write("") + else + io.write(html.form[val.type](val)) + end + if (val.descr) and (#val.descr > 0) then io.write("\n\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

") end + if (#val.errtxt > 0) then io.write("\n\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

") end + io.write("\n\t\t
\n") + end + end +end +?> + +

SYSTEM INFO

+
+ +
+ + +
+

CONFIGURATION

+

Expert config

+

File details

+
+ +
+ +

FILE CONTENT

+ + +

SAVE AND APPLY ABOVE SETTINGS

+
+ +
+ +
+ +') + io.write('

MANAGEMENT

') + io.write('
') + io.write('
' .. cmdform[tags[1]]["label"] .. '
') + io.write('
') + for k,v in pairs(tags) do + if (cmdform[v]) then + io.write(html.form[cmdform[v].type](cmdform[v])) + end + end + io.write('
') + + if (cmdresult) and (cmdresult.action) and (#cmdresult.action.descr > 0) then + io.write('
' .. cmdresult.label .. '
') + io.write('
' .. cmdresult.action.descr .. '
') + end + io.write('
') +end ?> + +DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] +?> + diff --git a/quagga-logfile-html.lsp b/quagga-logfile-html.lsp new file mode 100644 index 0000000..6f8f8f7 --- /dev/null +++ b/quagga-logfile-html.lsp @@ -0,0 +1,78 @@ + + +DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] +?> + 0) then + val.class = "error" + io.write(" class='error'") + end + io.write(">" .. val.label .. "") + io.write("\n\t\t
") + if (viewtype == "viewonly") then + io.write(val.value) + elseif (val.type == "radio") and (type(val.option) == "table") and (#val.option > 0) then + io.write("") + for k1,v1 in pairs(val.option) do + io.write(tostring(v1.label) .. ":") + io.write("") + end + io.write("") + else + io.write(html.form[val.type](val)) + end + if (val.descr) and (#val.descr > 0) then io.write("\n\t\t

" .. string.gsub(val.descr, "\n", "
") .. "

") end + if (#val.errtxt > 0) then io.write("\n\t\t

" .. string.gsub(val.errtxt, "\n", "
") .. "

") end + io.write("\n\t\t
\n") + end + end +end +?> + +

SYSTEM INFO

+
+ +
+ + + +
+

LOGFILE

+

Details

+
+ +
+ +

FILE CONTENT

+ + +
+ +DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] +?> diff --git a/quagga-model.lua b/quagga-model.lua index 8153fa2..279a1a2 100644 --- a/quagga-model.lua +++ b/quagga-model.lua @@ -4,6 +4,7 @@ require("fs") require("procps") require("getopts") require("format") +require("posix") require("daemoncontrol") require("validator") diff --git a/quagga.menu b/quagga.menu index 57c49a0..d0d6b24 100644 --- a/quagga.menu +++ b/quagga.menu @@ -1,5 +1,5 @@ #CAT GROUP/DESC TAB ACTION Networking 46BGP Status status -#Networking 46BGP Expert expert -#Networking 46BGP Logfile logfile +Networking 46BGP Expert expert +Networking 46BGP Logfile logfile -- cgit v1.2.3