Module: check_mk
Branch: master
Commit: 6dc7291477ecc5252eedabc7666e01da0f149cd4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6dc7291477ecc5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 23 06:28:52 2010 +0100
webconf: Titles
---
web/htdocs/htmllib.py | 4 +++-
web/htdocs/webconf.py | 28 +++++++++++++++++++++-------
web/plugins/sidebar/webconf.py | 4 ++--
3 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 4974597..ddae25f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -117,6 +117,7 @@ class html:
self.global_vars = []
self.browser_reload = 0
self.events = set([]) # currently used only for sounds
+ self.header_sent = False
def write(self, text):
if type(text) == unicode:
@@ -353,7 +354,7 @@ class html:
self.req.headers_out.add("refresh", "%d; URL=%s" % (secs,
url))
def header(self, title=''):
- if not self.req.header_sent:
+ if not self.header_sent:
self.html_head(title)
if type(self.req.user) == str:
login_text = "<b>%s</b> (%s)" % (config.user,
config.role)
@@ -364,6 +365,7 @@ class html:
"%s <b class=headertime>%s</b>
<img
src=\"images/mk_logo_klein.png\"></td></tr></table>"
%
(title, login_text, time.strftime("%H:%M")))
self.write("<hr class=header>\n")
+ self.header_sent = True
def footer(self):
if self.req.header_sent:
diff --git a/web/htdocs/webconf.py b/web/htdocs/webconf.py
index 6645891..5706128 100644
--- a/web/htdocs/webconf.py
+++ b/web/htdocs/webconf.py
@@ -61,9 +61,6 @@ def page_index(h):
g_filename, title = check_filename()
read_configuration_file()
- html.header("Check_MK Configuration - " + title)
- html.write("<div class=webconf>\n")
-
modefuncs = {
"newhost" : lambda phase: mode_edithost(phase, True),
"edithost" : lambda phase: mode_edithost(phase, False),
@@ -98,6 +95,11 @@ def page_index(h):
action_message = e.message
html.add_user_error(e.varname, e.message)
+ # Title
+ html.header("Check_MK WATO - %s - %s" % (title,
modefunc("title")))
+ html.write("<div class=webconf>\n")
+
+
# Show contexts buttons
html.begin_context_buttons()
modefunc("buttons")
@@ -126,7 +128,10 @@ def page_index(h):
# -----------------------------------------------------------------
def mode_index(phase):
- if phase == "buttons":
+ if phase == "title":
+ return "Hosts list"
+
+ elif phase == "buttons":
html.context_button("Create new host", make_link([("mode",
"newhost")]))
changelog_button()
@@ -220,7 +225,10 @@ def render_audit_log(log, what):
def mode_changelog(phase):
- if phase == "buttons":
+ if phase == "title":
+ return "Change log"
+
+ elif phase == "buttons":
html.context_button("Create new host", make_link([("mode",
"newhost")]))
html.context_button("Host list", make_link([("mode",
"index")]))
@@ -276,7 +284,10 @@ def mode_edithost(phase, new):
alias, ipaddress, tags = None, None, []
mode = "new"
- if phase == "buttons":
+ if phase == "title":
+ return title
+
+ elif phase == "buttons":
html.context_button("Abort", make_link([("mode",
"index")]))
if not new:
html.context_button("Services", make_link([("mode",
"inventory"), ("host", hostname)]))
@@ -393,7 +404,10 @@ def mode_inventory(phase, firsttime):
if hostname not in g_hosts:
raise MKGeneralException("You called this page for a non-existing
host.")
- if phase == "action":
+ if phase == "title":
+ return "Services of host %s" % hostname
+
+ elif phase == "action":
if html.check_transaction():
table = check_mk_automation("try-inventory", ["tcp",
hostname])
table.sort()
diff --git a/web/plugins/sidebar/webconf.py b/web/plugins/sidebar/webconf.py
index 2e802b3..73dda7a 100644
--- a/web/plugins/sidebar/webconf.py
+++ b/web/plugins/sidebar/webconf.py
@@ -16,8 +16,8 @@ def render_webconf_files():
bulletlink(title, "webconf.py?filename=%s" % filename)
sidebar_snapins["webconf"] = {
- "title" : "Check_MK Webconfig",
- "description" : "Web configuration GUI for Check_MK - manage hosts to
be monitored without access to the command line",
+ "title" : "Check_MK Web Administration Tool",
+ "description" : "WATO - the Web Administration Tool of Check_MK -
manage hosts to be monitored without access to the command line",
"author" : "Mathias Kettner",
"render" : render_webconf_files,
"allowed" : [ "admin", "user" ],