From 116d2438209781f88faaac07a48fb801852247e7 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Thu, 10 Jan 2008 14:52:47 +0000 Subject: Changing tabnames and first page info git-svn-id: svn://svn.alpinelinux.org/acf/openntpd/trunk@536 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openntpd-advanced-html.lsp | 43 --------------------- openntpd-config-html.lsp | 95 ++++++++++++++++++++++++++++++++++++++++++++++ openntpd-controller.lua | 30 +++++++-------- openntpd-expert-html.lsp | 77 +++++++++++++++++++++++++++++++++++++ openntpd-model.lua | 12 +++--- openntpd-read-html.lsp | 27 ------------- openntpd-settings-html.lsp | 84 ---------------------------------------- openntpd-status-html.lsp | 29 ++++++++++++++ openntpd.menu | 2 +- 9 files changed, 222 insertions(+), 177 deletions(-) delete mode 100644 openntpd-advanced-html.lsp create mode 100644 openntpd-config-html.lsp create mode 100644 openntpd-expert-html.lsp delete mode 100644 openntpd-read-html.lsp delete mode 100644 openntpd-settings-html.lsp create mode 100644 openntpd-status-html.lsp diff --git a/openntpd-advanced-html.lsp b/openntpd-advanced-html.lsp deleted file mode 100644 index 7baaa56..0000000 --- a/openntpd-advanced-html.lsp +++ /dev/null @@ -1,43 +0,0 @@ - - - -

System time

- -

SYSTEM INFO

- -
Process status
-
- -
Start or stop process
-
- -

Details

- -
File name
-
- -
File size
-
- -
Last modified
-
- - -
Error message
-
- - -

Content

-
- - - -
- - - diff --git a/openntpd-config-html.lsp b/openntpd-config-html.lsp new file mode 100644 index 0000000..b389ad6 --- /dev/null +++ b/openntpd-config-html.lsp @@ -0,0 +1,95 @@ + + +

CONFIGURATION

+ +

Enable/Disable

+
Change status for this program
+
>Enable + >Disable
+ +

Guided config

+

General settings

+ + +

System time

+ +

SYSTEM INFO

+ +
Process status
+
+ +
Start or stop process
+
+
+
+
+ + + +
+ +
Set time immediately at startup
+
>
+ +
Save the above settings
+
(see above)
+
+ +

'SET TIME' OPTIONS

+ +
+
Timeserver hosts...
+
+
+In most cases you could use pool.ntp.org or [countryname].pool.ntp.org (if listed in http://www.pool.ntp.org/). +"..view.errors.hosts_list.."

") end ?>
+ +
Delete selected host
+
(see above)
+ +
Host to add
+
"..view.errors.hosts_add.."

") end ?>
+
Type of above server
+
Single server: Server pool:
+ +
Add new host
+
+
+ +

'PRESENT TIME' OPTIONS (ACT AS TIME SERVER)

+ +
+
Listen on address...
+
+
Empty list = Listening (acting as server) is disabled
"*" = Listen on all local addresses +"..view.errors.listen_list.."

") end ?> +
+ +
Delete selected address
+
(see above)
+ +
Add new listen address
+
"..view.errors.listen_add.."

") end ?>
+
+ + + diff --git a/openntpd-controller.lua b/openntpd-controller.lua index 6a22744..b7d8c8e 100644 --- a/openntpd-controller.lua +++ b/openntpd-controller.lua @@ -19,7 +19,7 @@ mvc.on_load = function(self, parent) end -settings = function (self) +config = function (self) local cmd = self.clientdata.cmd local errors = {} local modify_opts = nil @@ -76,12 +76,12 @@ settings = function (self) if ( cmd ~= nil ) then local startstop = self.model:startstop_service( cmd ) posix.sleep(1) -- Wait for the process to start|stop - return ( {statusinfo = self.model:get(), + return ( {status = self.model:get(), startstop = "", modify_opts=modify_opts, url = url } ) else - return ( {statusinfo = self.model:get(), startstop = "", + return ( {status = self.model:get(), startstop = "", errors = errors, modify_opts=modify_opts, url = url, @@ -94,35 +94,35 @@ logfile = function (self) return ( {logfile = self.model:get_logfile(), url = url } ) end -read = function (self) +status = function (self) local cmd = self.clientdata.cmd local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller - return ( {statusinfo = self.model:get(), url = url } ) + return ( {status = self.model:get(), url = url } ) end -advanced = function (self) - local filecontent = self.clientdata.modifications or "" +expert = function (self) + local file = self.clientdata.modifications or "" local cmd = self.clientdata.cmd local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller - if ( filecontent ~= "") then - local me = ( {filecontent = self.model:update_filecontent(filecontent), url = url } ) + if ( file ~= "") then + local me = ( {file = self.model:update_filecontent(file), url = url } ) return ( {startstop = "", - statusinfo = self.model:get(), - filecontent = self.model:get_filecontent(), + status = self.model:get(), + file = self.model:get_filecontent(), url = url } ) else if ( cmd ~= nil ) then local startstop = self.model:startstop_service( cmd ) posix.sleep(1) -- Wait for the process to start|stop return ( {startstop = startstop, - statusinfo = self.model:get(), - filecontent = self.model:get_filecontent(), + status = self.model:get(), + filec = self.model:get_filecontent(), url = url } ) else return ( {startstop = "", - statusinfo = self.model:get(), - filecontent = self.model:get_filecontent(), + status = self.model:get(), + file = self.model:get_filecontent(), url = url } ) end end diff --git a/openntpd-expert-html.lsp b/openntpd-expert-html.lsp new file mode 100644 index 0000000..c74b30d --- /dev/null +++ b/openntpd-expert-html.lsp @@ -0,0 +1,77 @@ + + + +

CONFIGURATION

+ +

Enable/Disable

+
Change status for this program
+
>Enable + >Disable
+ +

Expert config

+ +

File details

+ +
File name
+
+ +
File size
+
+ +
Last modified
+
+ +

File content

+ +
+ + + +

Save and apply above settings

+
Apply settings
+
+
+ + + +

System time

+ +

SYSTEM INFO

+ +
Process status
+
+ +
Start or stop process
+
+ +

Details

+ +
File name
+
+ +
File size
+
+ +
Last modified
+
+ + +
Error message
+
+ + +

Content

+
+ + + +
+ + + + diff --git a/openntpd-model.lua b/openntpd-model.lua index f74f941..4960534 100644 --- a/openntpd-model.lua +++ b/openntpd-model.lua @@ -40,7 +40,7 @@ local function file_info ( path ) filedetails["group"]=rawget((posix.getgroup(filedetails["gid"])),"name") filedetails["atimelong"]=os.date("%c", filedetails["atime"]) filedetails["mtimelong"]=os.date("%c", filedetails["mtime"]) - filedetails["longname"]=path + filedetails["path"]=path filedetails["name"]=basename(path) if ( filedetails["size"] > 1073741824 ) then @@ -69,9 +69,7 @@ local is_running = function( process ) local cmdoutput = string.gsub(cmd:read("*a"), "%s", "") cmd:close() if (cmdoutput ~= "") then - statusreport = "Running" - else - statusreport = "Stopped" + statusreport = "Yes" end return statusreport end @@ -209,7 +207,7 @@ function get () end config["version"] = string.match(get_version(), "^(%S*)" ) config["date"] = os.date() - config["status"] = startstop + config["enabled"] = startstop config["confd"],config["setstimeonstartup"] = get_confdopts("-s") config["listenstate"] = server config["timechanged"] = last_time_change() @@ -235,8 +233,8 @@ function get_filecontent (self) local configstatus = get() local file = io.open( path ) local file_result = file:read("*a") or "unknown" - file_content["filedetails"]=filedetails - file_content["value"]=file_result + file_content["details"]=filedetails + file_content["content"]=file_result file:close() else file_content = {value="", errtxt="File is missing, but will be created when you save your new settings",filedetails={longname=path, size="0", mtimelong=""}} diff --git a/openntpd-read-html.lsp b/openntpd-read-html.lsp deleted file mode 100644 index 4d1e840..0000000 --- a/openntpd-read-html.lsp +++ /dev/null @@ -1,27 +0,0 @@ - - -

System time

- -

SYSTEM INFO

- -
Program version
-
- -
Process status
-
- -
Configured as server (listens)
-
- -
Current time
-
- -
Previous time adjustment
-
- - diff --git a/openntpd-settings-html.lsp b/openntpd-settings-html.lsp deleted file mode 100644 index a44eb19..0000000 --- a/openntpd-settings-html.lsp +++ /dev/null @@ -1,84 +0,0 @@ - - -

System time

- -

SYSTEM INFO

- -
Process status
-
- -
Start or stop process
-
-
-
-
- -

NTPD SETTINGS

- -
- -
Set time immediately at startup
-
>
- -
Save the above settings
-
(see above)
-
- -

'SET TIME' OPTIONS

- -
-
Timeserver hosts...
-
-
-In most cases you could use pool.ntp.org or [countryname].pool.ntp.org (if listed in http://www.pool.ntp.org/). -"..view.errors.hosts_list.."

") end ?>
- -
Delete selected host
-
(see above)
- -
Host to add
-
"..view.errors.hosts_add.."

") end ?>
-
Type of above server
-
Single server: Server pool:
- -
Add new host
-
-
- -

'PRESENT TIME' OPTIONS (ACT AS TIME SERVER)

- -
-
Listen on address...
-
-
Empty list = Listening (acting as server) is disabled
"*" = Listen on all local addresses -"..view.errors.listen_list.."

") end ?> -
- -
Delete selected address
-
(see above)
- -
Add new listen address
-
"..view.errors.listen_add.."

") end ?>
-
- - - diff --git a/openntpd-status-html.lsp b/openntpd-status-html.lsp new file mode 100644 index 0000000..d1211c5 --- /dev/null +++ b/openntpd-status-html.lsp @@ -0,0 +1,29 @@ + + +

SYSTEM INFO

+ +

SYSTEM INFO

+ +
Program status
+
+ +
Program version
+
+ +

PROGRAM SPECIFIC OPTIONS/INFORMATION

+ +
Configured as server (listens)
+
+ +
Current time
+
+ +
Previous time adjustment
+
+ + diff --git a/openntpd.menu b/openntpd.menu index 2274c41..46706ab 100644 --- a/openntpd.menu +++ b/openntpd.menu @@ -1,2 +1,2 @@ #CAT GROUP/DESC TAB ACTION -Networking 20NTPD_config NTPD_config read +Networking 20NTPD_config NTPD_config status -- cgit v1.2.3