lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
April 2017
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
11 participants
159 discussions
Start a n
N
ew thread
Fixed recently introduced exception on global setting page
by Lars Michelsen
Module: check_mk Branch: master Commit: a5d82c15b73cca0f6230826e5688fee2a4f0ac77 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a5d82c15b73cca…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Apr 13 10:26:44 2017 +0200 Fixed recently introduced exception on global setting page Change-Id: I219f7153e6d1b53b3ec77b91e904a1f5f87f639c --- web/htdocs/wato.py | 3 +++ web/htdocs/watolib.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 42683c7..30fb88c 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -6721,6 +6721,9 @@ def render_global_configuration_variables(group_names, default_values, current_s else: continue + if not configvar_show_in_global_settings(varname): + continue + help_text = valuespec.help() or '' title_text = valuespec.title() diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index bc04187..598eed0 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -3157,6 +3157,13 @@ def configvar_order(): return g_configvar_order +def configvar_show_in_global_settings(varname): + try: + return configvars()[varname][-1] + except KeyError: + return False + + # domain is one of "check_mk", "multisite" or "nagios" def register_configvar(group, varname, valuespec, domain="check_mk", need_restart=False, allow_reset=True, in_global_settings=True):
7 years, 5 months
1
0
0
0
Fixed invalid localization calls
by Lars Michelsen
Module: check_mk Branch: master Commit: fa01ba48073ebf29b4959b1a5eb9614325845cc5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa01ba48073ebf…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Apr 13 08:38:54 2017 +0200 Fixed invalid localization calls Change-Id: I17434d8237023b339251923d57885de561492d8b --- web/htdocs/wato.py | 2 +- web/plugins/sidebar/shipped.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index eaa6ad2..77f980b 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -5432,7 +5432,7 @@ class ModeActivateChanges(WatoMode, ActivateChanges): # Livestatus table.cell(_("Status"), css="narrow nobr") - html.status_label(content=_(status), status=status, help=_("This site is %s") % status) + html.status_label(content=status, status=status, help=_("This site is %s") % status) # Livestatus-/Check_MK-Version table.cell(_("Version"), site_status.get("livestatus_version", ""), css="narrow nobr") diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py index c38b560..c1e3ebd 100644 --- a/web/plugins/sidebar/shipped.py +++ b/web/plugins/sidebar/shipped.py @@ -511,7 +511,7 @@ def render_sitestatus(): html.write(text) html.close_td() html.open_td(class_="state") - html.status_label_button(content=_(state["state"]), status=state["state"], + html.status_label_button(content=state["state"], status=state["state"], help=_("%s this site") % (state["state"] == "disabled" and _("enable") or _("disable")), onclick="switch_site('_site_switch=%s:%s')" % (sitename, switch)) html.close_tr()
7 years, 5 months
1
0
0
0
CME: Added warning message when assigning sites to customers that have no users
by Lars Michelsen
Module: check_mk Branch: master Commit: 6009ea03f72e2f5b639819e08cb7b97c1a63df14 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6009ea03f72e2f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Apr 13 08:58:53 2017 +0200 CME: Added warning message when assigning sites to customers that have no users Change-Id: I8e6aaac32f11e2e6f2d91733f72f2b4d0d4d3a02 --- web/htdocs/wato.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 77f980b..42683c7 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -9632,7 +9632,7 @@ class ModeEditSite(ModeSites): if not re.match("^[-a-z0-9A-Z_]+$", self._id): raise MKUserError("id", _("The site id must consist only of letters, digit and the underscore.")) - self._set_site_attributes() + detail_msg = self._set_site_attributes() configured_sites[self._id] = self._new_site save_sites(configured_sites) @@ -9653,7 +9653,7 @@ class ModeEditSite(ModeSites): # On central site issue a change only affecting the GUI add_change("edit-sites", msg, sites=[config.omd_site()], domains=[ConfigDomainGUI]) - return "sites" + return "sites", detail_msg def _set_site_attributes(self):
7 years, 5 months
1
0
0
0
Refactored rendering of WATO main menu buttons (CSS styled now)
by Lars Michelsen
Module: check_mk Branch: master Commit: cfcb31fe64a3128fb0e21496966fec4a32704b1e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cfcb31fe64a312…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Apr 11 13:26:51 2017 +0200 Refactored rendering of WATO main menu buttons (CSS styled now) Change-Id: I40bfefdbd5f7abcdcfa69f9c84dbd93c7c83fc47 --- web/htdocs/check_mk.css | 9 ++++++--- web/htdocs/images/wato_mainmenu_button_clicked.png | Bin 636 -> 0 bytes web/htdocs/images/wato_mainmenu_button_hi.png | Bin 873 -> 0 bytes web/htdocs/images/wato_mainmenu_button_lo.png | Bin 875 -> 0 bytes web/htdocs/wato.css | 14 ++------------ 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css index 11a89dc..95fdc79 100644 --- a/web/htdocs/check_mk.css +++ b/web/htdocs/check_mk.css @@ -153,7 +153,8 @@ select.icon option { height: 18px; } -input.button { +input.button, +.wato div.mainmenu a { border-color: #86A9B8 #22404D #22414D #86A9B8; border-radius: 5px 5px 5px 5px; border-style: solid; @@ -166,11 +167,13 @@ input.button { cursor: pointer; } -input.button:hover { +input.button:hover, +.wato div.mainmenu a:hover { background-color: #6da1b8; text-decoration: none; } -input.button:active { +input.button:active, +.wato div.mainmenu a:active { border-color: #22414d #86a9b8 #86a9b8 #22404d; background-color: #3b6678; box-shadow: inset 0 0 0.5px #444444; diff --git a/web/htdocs/images/wato_mainmenu_button_clicked.png b/web/htdocs/images/wato_mainmenu_button_clicked.png deleted file mode 100644 index 0694a44..0000000 Binary files a/web/htdocs/images/wato_mainmenu_button_clicked.png and /dev/null differ diff --git a/web/htdocs/images/wato_mainmenu_button_hi.png b/web/htdocs/images/wato_mainmenu_button_hi.png deleted file mode 100644 index 17a31fd..0000000 Binary files a/web/htdocs/images/wato_mainmenu_button_hi.png and /dev/null differ diff --git a/web/htdocs/images/wato_mainmenu_button_lo.png b/web/htdocs/images/wato_mainmenu_button_lo.png deleted file mode 100644 index 7dbfda7..0000000 Binary files a/web/htdocs/images/wato_mainmenu_button_lo.png and /dev/null differ diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css index b0808fd..0645d2a 100644 --- a/web/htdocs/wato.css +++ b/web/htdocs/wato.css @@ -691,19 +691,10 @@ form.search { width: 317px; height: 76px; display: block; - background-image: url("images/wato_mainmenu_button_lo.png"); - background-repeat: no-repeat; float: left; position: relative; - margin: 0px -1px -1px 0px; - left: -2px; - text-decoration: none; -} -.wato div.mainmenu a:hover { - background-image: url("images/wato_mainmenu_button_hi.png"); -} -.wato div.mainmenu a:active { - background-image: url("images/wato_mainmenu_button_clicked.png"); + margin: 0px 2px 2px 0px; + padding: 0; } .wato div.mainmenu div { @@ -731,7 +722,6 @@ form.search { overflow: hidden; } - /* Special styles for roles editor (permissions) */ .wato table.form table.permissions { border-collapse: collapse;
7 years, 5 months
1
0
0
0
Refactored CSS of login dialog
by Lars Michelsen
Module: check_mk Branch: master Commit: 8e13f327ea9f3d32c5893d0504840865b30c361c URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8e13f327ea9f3d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Apr 11 09:04:15 2017 +0200 Refactored CSS of login dialog Change-Id: Ide0659d59e56464cab2aabe3d5dfde732dcdef06 --- web/htdocs/login.css | 69 ++++++++++++++++----------------------- web/htdocs/login.py | 3 +- web/plugins/dashboard/dashlets.py | 2 +- 3 files changed, 31 insertions(+), 43 deletions(-) diff --git a/web/htdocs/login.css b/web/htdocs/login.css index 282b334..6497ff9 100644 --- a/web/htdocs/login.css +++ b/web/htdocs/login.css @@ -49,23 +49,25 @@ div#login { width: 770px; height: 605px; position: absolute; - top: 50%; - left: 50%; - margin: -276px 0px 0px -386px; - /* border: 1px solid yellow; */ + top:0; + bottom: 0; + left: 0; + right: 0; + margin: auto; } body.main.screenshotmode div#login { background-image: url(""); } -img#login_window { +#login_window { + background-image: url("images/login_window.png"); width: 370px; height: 230px; - position: relative; left: 10px; - top: 160px; - float: none; + top: 187px; + position: relative; + margin: -30px auto 10px auto; } label { @@ -76,36 +78,36 @@ label { position: absolute; text-align: right; width: 150px; - top: 173px; - left: 415px; + top: 15px; + right: 20px; color: white; font-size: 8pt; } #label_user, #label_pass { - left: 264px; + left: 55px; } #input_user, #input_pass { - left: 330px; + left: 121px; } #label_user { position: absolute; - top: 275px; + top: 115px; } #input_user { position: absolute; - top: 270px; + top: 110px; } #label_pass { position: absolute; - top: 315px; + top: 155px; } #input_pass { position: absolute; - top: 310px; + top: 150px; } #input_user, #input_pass { @@ -125,33 +127,16 @@ label { background-repeat: no-repeat; } -#button_login { - position: absolute; - top: 345px; - left: 505px; -} - -#button_login img { - width: 63px; - height: 32px; -} - -#button_text { +#_login { position: absolute; - top: 356px; - left: 508px; - text-align: center; - width: 61px; - color: white; - z-index: 100; - font-size: 10px; - text-transform: uppercase; + bottom: 15px; + right: 15px; } #login_error { position: absolute; - top: 347px; - left: 320px; + bottom: 15px; + left: 105px; width: 180px; height: 30px; z-index: 100; @@ -173,13 +158,15 @@ label { } #foot { - position: absolute; text-align: center; - top: 400px; - left: 220px; width: 350px; color: white; font-size: 8pt; + + position: relative; + left: 10px; + top: 187px; + margin: 0 auto 10px auto; } diff --git a/web/htdocs/login.py b/web/htdocs/login.py index 0dc45a6..7dc5ff7 100644 --- a/web/htdocs/login.py +++ b/web/htdocs/login.py @@ -431,7 +431,7 @@ def normal_login_page(called_directly = True): html.http_redirect(origtarget and origtarget or 'index.py') html.open_div(id_="login") - html.img(id_="login_window", src="images/login_window.png") + html.open_div(id_="login_window") html.div(cmk.__version__, id_="version") html.begin_form("login", method = 'POST', add_transid = False, action = 'login.py') @@ -452,6 +452,7 @@ def normal_login_page(called_directly = True): html.open_div(id_="button_text") html.button("_login", _('Login')) html.close_div() + html.close_div() html.open_div(id_="foot") html.write("Version: %s - © " % cmk.__version__) diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py index d5f82f8..2de259f 100644 --- a/web/plugins/dashboard/dashlets.py +++ b/web/plugins/dashboard/dashlets.py @@ -257,7 +257,7 @@ def render_statistics(pie_id, what, table, filter, dashlet): table_entries = pies while len(table_entries) < 6: - table_entries = table_entries + [ (("", "#95BBCD", "", ""), HTML(" ")) ] + table_entries = table_entries + [ (("", None, "", ""), HTML(" ")) ] table_entries.append(((_("Total"), "", "all%s" % what, ""), total)) for (name, color, viewurl, query), count in table_entries:
7 years, 5 months
1
0
0
0
Refactored the site status button to be rendered using pure HTML/CSS
by Lars Michelsen
Module: check_mk Branch: master Commit: 9d94d53ea24bf7adb97ff41306a0d7f2505cd58a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9d94d53ea24bf7…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Apr 12 09:13:59 2017 +0200 Refactored the site status button to be rendered using pure HTML/CSS Change-Id: Ie18cf077e273050c61ec53c9ec4b667e81e3d7b4 --- web/htdocs/htmllib.py | 12 ++++ web/htdocs/images/button_sitestatus_dead.png | Bin 972 -> 0 bytes web/htdocs/images/button_sitestatus_disabled.png | Bin 941 -> 0 bytes web/htdocs/images/button_sitestatus_down.png | Bin 992 -> 0 bytes web/htdocs/images/button_sitestatus_online.png | Bin 1067 -> 0 bytes web/htdocs/images/button_sitestatus_partial.png | Bin 1025 -> 0 bytes web/htdocs/images/button_sitestatus_unknown.png | Bin 1159 -> 0 bytes web/htdocs/images/button_sitestatus_unreach.png | Bin 1131 -> 0 bytes web/htdocs/images/button_sitestatus_waiting.png | Bin 1132 -> 0 bytes web/htdocs/status.css | 75 +++++++++++++++-------- web/htdocs/wato.py | 2 +- web/plugins/sidebar/shipped.py | 6 +- 12 files changed, 64 insertions(+), 31 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 65e0ffc..675d3b7 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -2198,6 +2198,18 @@ class html(HTMLGenerator, Encoder, RequestHandler): self.close_x() + # Shows a colored badge with text (used on WATO activation page for the site status) + def status_label(self, content, status, help, **attrs): + self.status_label_button(content, status, help, onclick=None, **attrs) + + + # Shows a colored button with text (used in site and customer status snapins) + def status_label_button(self, content, status, help, onclick, **attrs): + button_cls = "button" if onclick else None + self.div(content, title=help, class_=[ "status_label", button_cls, status ], + onclick=onclick, **attrs) + + def number_input(self, varname, deflt = "", size=8, style="", submit=None): if deflt != None: deflt = str(deflt) diff --git a/web/htdocs/images/button_sitestatus_dead.png b/web/htdocs/images/button_sitestatus_dead.png deleted file mode 100644 index 269924d..0000000 Binary files a/web/htdocs/images/button_sitestatus_dead.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_disabled.png b/web/htdocs/images/button_sitestatus_disabled.png deleted file mode 100644 index 7d49bc6..0000000 Binary files a/web/htdocs/images/button_sitestatus_disabled.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_down.png b/web/htdocs/images/button_sitestatus_down.png deleted file mode 100644 index dd0a9cd..0000000 Binary files a/web/htdocs/images/button_sitestatus_down.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_online.png b/web/htdocs/images/button_sitestatus_online.png deleted file mode 100644 index 2ca8955..0000000 Binary files a/web/htdocs/images/button_sitestatus_online.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_partial.png b/web/htdocs/images/button_sitestatus_partial.png deleted file mode 100644 index 4ec2117..0000000 Binary files a/web/htdocs/images/button_sitestatus_partial.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_unknown.png b/web/htdocs/images/button_sitestatus_unknown.png deleted file mode 100644 index a3824b6..0000000 Binary files a/web/htdocs/images/button_sitestatus_unknown.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_unreach.png b/web/htdocs/images/button_sitestatus_unreach.png deleted file mode 100644 index a2775c1..0000000 Binary files a/web/htdocs/images/button_sitestatus_unreach.png and /dev/null differ diff --git a/web/htdocs/images/button_sitestatus_waiting.png b/web/htdocs/images/button_sitestatus_waiting.png deleted file mode 100644 index b6d3215..0000000 Binary files a/web/htdocs/images/button_sitestatus_waiting.png and /dev/null differ diff --git a/web/htdocs/status.css b/web/htdocs/status.css index f293de4..b45029a 100644 --- a/web/htdocs/status.css +++ b/web/htdocs/status.css @@ -145,41 +145,62 @@ img.pluginurl { /* Status of sites in sidebar and in WATO */ -.sitestatus.online { - background-color: #3c0; +.status_label { + border-color: #1b333d #264c18 #1b333d #274141; + border-radius: 4px; + border-style: solid; + border-width: 1px; + box-shadow: 0 0 1px rgba(255, 255, 255, 0.8), + 1px 1px 0px 0px rgba(255, 255, 255, 0.4) inset; + + width: 56px; + height: 12px; + + font-size: 7pt; color: #fff; - border-color: #0f0; + text-align: center; + line-height: 12px; + + cursor: default; +} + +.status_label.button { + cursor: pointer; } -.sitestatus.disabled { - background-color: #666; - color: #ccc; - border-color: #888; + +.status_label.button:hover { + /* TODO: create a better hover effect */ + opacity: 0.5; + filter: alpha(opacity=50); /* For IE8 and earlier */ } -.sitestatus.dead { - background-color: #c00; - color: #f88; - border-color: #f44; + +.status_label.disabled { + background-color: #787878; + color: #b2b2b2; } -.sitestatus.waiting { - background-color: #666; - color: #fff; - border-color: #ccc; +.status_label.dead { + background-color: #b91e1d; } -.sitestatus.down { - background-color: #f00; - color: #fff; - border-color: #800; +.status_label.down { + background-color: #f60000; } -.sitestatus.unreach { - background-color: #f80; - color: #fff; - border-color: #840; +.status_label.online { + background-color: #54a626; } -.sitestatus.unknown { - background-color: #26c; - color: #fff; - border-color: #44f; +.status_label.partial { + background-color: #bd8a3f; } +.status_label.unknown { + background-color: #a96394; +} +.status_label.unreach { + background-color: #ef7b08; +} +.status_label.waiting { + background-color: #3574c2; +} + + /* Performeter styling */ table.data tr.data td.perfometer { diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 55e6ef5..1612259 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -5432,7 +5432,7 @@ class ModeActivateChanges(WatoMode, ActivateChanges): # Livestatus table.cell(_("Status"), css="narrow nobr") - html.write('<img src="images/button_sitestatus_%s.png">' % (status)) + html.status_label(content=_(status), status=status, help=_("This site is %s") % status) # Livestatus-/Check_MK-Version table.cell(_("Version"), site_status.get("livestatus_version", ""), css="narrow nobr") diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py index ca0cebb..28b72bc 100644 --- a/web/plugins/sidebar/shipped.py +++ b/web/plugins/sidebar/shipped.py @@ -510,10 +510,10 @@ def render_sitestatus(): html.open_td(class_="left") html.write(text) html.close_td() - onclick = "switch_site('_site_switch=%s:%s')" % (sitename, switch) html.open_td(class_="state") - html.icon_button("#", _("%s this site") % (state["state"] == "disabled" and "enable" or "disable"), - "sitestatus_%s" % state["state"], onclick=onclick) + html.status_label_button(content=_(state["state"]), status=state["state"], + help=_("%s this site") % (state["state"] == "disabled" and _("enable") or _("disable")), + onclick="switch_site('_site_switch=%s:%s')" % (sitename, switch)) html.close_tr() html.close_table()
7 years, 5 months
1
0
0
0
Refactored on/off toggle swithch to be pure HTML/CSS rendered
by Lars Michelsen
Module: check_mk Branch: master Commit: f46065c934175f60b2acd30382694e284edceb96 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f46065c934175f…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Apr 12 12:28:37 2017 +0200 Refactored on/off toggle swithch to be pure HTML/CSS rendered Change-Id: Iab136adfc92cb62e40255f675202b185709e679a --- web/htdocs/check_mk.css | 56 +++++++++++++++++++++++++ web/htdocs/htmllib.py | 20 +++++++++ web/htdocs/images/button_snapin_switch_off.png | Bin 972 -> 0 bytes web/htdocs/images/button_snapin_switch_on.png | Bin 1085 -> 0 bytes web/htdocs/wato.css | 1 - web/htdocs/wato.py | 11 ++--- web/plugins/sidebar/shipped.py | 13 +++--- 7 files changed, 89 insertions(+), 12 deletions(-) diff --git a/web/htdocs/check_mk.css b/web/htdocs/check_mk.css index 95fdc79..1a4c300 100644 --- a/web/htdocs/check_mk.css +++ b/web/htdocs/check_mk.css @@ -205,6 +205,62 @@ input.button.hot:active { border-color: #6d5723 #d9bf81 #d9bf81 #6d5723; } +/* on/off toggle button */ + +.toggle_switch { + border-color: #1b333d #264c18 #1b333d #274141; + border-radius: 4px; + border-style: solid; + border-width: 1px; + box-shadow: 0 0 1px rgba(255, 255, 255, 0.8), + 1px 1px 0px 0px rgba(0, 0, 0, 0.4) inset; + + background-color: #427b94; + + width: 56px; + height: 12px; +} + +.toggle_switch a, +.wato div.globalvars .toggle_switch a { + display: block; + + border-color: #1b333d #264c18 #1b333d #274141; + border-radius: 4px; + border-style: solid; + box-shadow: 1px 1px 1px 0px rgba(255, 255, 255, 0.4) inset; + + width: 30px; + height: 12px; + + color: #fff; + text-decoration: none; + font-size: 7pt; + text-align: center; + line-height: 10px; + + cursor: pointer; +} + +.toggle_switch.on a { + float: right; + background-color: #54a626; + border-width: 0 0 0 1px; +} + +.toggle_switch.off a { + background-color: #f60000; + border-width: 0 1px 0 0; +} + +.toggle_switch a:hover { + /* TODO: create a better hover effect */ + text-decoration: none !important; + opacity: 0.5; + filter: alpha(opacity=50); /* For IE8 and earlier */ +} + + /* pattern / regex input styling */ diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 675d3b7..547e0e6 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -2210,6 +2210,26 @@ class html(HTMLGenerator, Encoder, RequestHandler): onclick=onclick, **attrs) + def toggle_switch(self, enabled, help, **attrs): + # Same API as other elements: class_ can be a list or string/None + if "class_" in attrs: + if type(attrs["class_"]) != list: + attrs["class_"] = [ attrs["class_"] ] + else: + attrs["class_"] = [] + + attrs["class_"] += [ "toggle_switch", "on" if enabled else "off", ] + + link_attrs = { + "href" : attrs.pop("href", None), + "onclick" : attrs.pop("onclick", None), + } + + self.open_div(**attrs) + self.a(_("on") if enabled else _("off"), title=help, **link_attrs) + self.close_div() + + def number_input(self, varname, deflt = "", size=8, style="", submit=None): if deflt != None: deflt = str(deflt) diff --git a/web/htdocs/images/button_snapin_switch_off.png b/web/htdocs/images/button_snapin_switch_off.png deleted file mode 100644 index fc85e83..0000000 Binary files a/web/htdocs/images/button_snapin_switch_off.png and /dev/null differ diff --git a/web/htdocs/images/button_snapin_switch_on.png b/web/htdocs/images/button_snapin_switch_on.png deleted file mode 100644 index 234473d..0000000 Binary files a/web/htdocs/images/button_snapin_switch_on.png and /dev/null differ diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css index 0645d2a..5156e39 100644 --- a/web/htdocs/wato.css +++ b/web/htdocs/wato.css @@ -1313,7 +1313,6 @@ table.nform.rulesettings td.legend div.title { max-width: 300px; } - /*--Profile Repl-----------------------------------------------------------. | ____ __ _ _ ____ _ | | | _ \ _ __ ___ / _(_) | ___ | _ \ ___ _ __ | | | diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 39897bc..eaa6ad2 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -6757,8 +6757,6 @@ def render_global_configuration_variables(group_names, default_values, current_s simple = False forms.section(title, simple=simple) - toggle_url = html.makeactionuri([("_action", "toggle"), ("_varname", varname)]) - if varname in current_settings: value = current_settings[varname] modified_cls = "modified" @@ -6767,9 +6765,12 @@ def render_global_configuration_variables(group_names, default_values, current_s modified_cls = None if is_a_checkbox(valuespec): - html.icon_button(toggle_url, _("Immediately toggle this setting"), - "snapin_switch_" + (value and "on" or "off"), - cssclass=modified_cls) + html.toggle_switch( + enabled=value, + help=_("Immediately toggle this setting"), + href=html.makeactionuri([("_action", "toggle"), ("_varname", varname)]), + class_=modified_cls + ) else: html.a(HTML(to_text), href=edit_url, class_=modified_cls) diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py index 28b72bc..c38b560 100644 --- a/web/plugins/sidebar/shipped.py +++ b/web/plugins/sidebar/shipped.py @@ -1228,9 +1228,11 @@ def render_master_control(): html.open_tr() html.td(title, class_="left") html.open_td() - html.icon_button("#", _("Switch %s %s") % (title, colvalue and "off" or "on"), - "snapin_switch_" + (colvalue and "on" or "off"), onclick=onclick) - # html.write("<a onclick=\"%s\" href=\"#\">%s</a>" % (title, enabled, onclick, enabled)) + html.toggle_switch( + enabled=colvalue, + help=_("Switch '%s' to '%s'") % (title, _("off") if colvalue else _("on")), + onclick=onclick, + ) html.close_td() html.close_tr() html.close_table() @@ -1251,9 +1253,8 @@ div.snapin table.master_control { border-spacing: 0px; } -div.snapin table.master_control td { - padding: 0px 0px; - text-align: right; +div.snapin table.master_control td div.toggle_switch { + float: right; } div.snapin table.master_control td.left a {
7 years, 5 months
1
0
0
0
Added missing files
by Lars Michelsen
Module: check_mk Branch: master Commit: 0eb8282f7f526e7e3645cdb53736f8d9d8cd3b2a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0eb8282f7f526e…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Apr 12 19:21:16 2017 +0200 Added missing files Change-Id: I395f282df6577c9ebcb4499a7b80ec3019cc171f --- web/plugins/sidebar/gui_color.py | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/web/plugins/sidebar/gui_color.py b/web/plugins/sidebar/gui_color.py new file mode 100644 index 0000000..3fd9714 --- /dev/null +++ b/web/plugins/sidebar/gui_color.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- encoding: utf-8; py-indent-offset: 4 -*- +# +------------------------------------------------------------------+ +# | ____ _ _ __ __ _ __ | +# | / ___| |__ ___ ___| | __ | \/ | |/ / | +# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +# | | |___| | | | __/ (__| < | | | | . \ | +# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +# | | +# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de | +# +------------------------------------------------------------------+ +# +# This file is part of Check_MK. +# The official homepage is at
http://mathias-kettner.de/check_mk
. +# +# check_mk is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation in version 2. check_mk is distributed +# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. See the GNU General Public License for more de- +# tails. You should have received a copy of the GNU General Public +# License along with GNU Make; see the file COPYING. If not, write +# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +# Boston, MA 02110-1301 USA. + +gui_colors = { + 1 : ( 73, 138, 166), + 2 : ( 73, 166, 157), + 3 : ( 84, 166, 73), + 4 : (166, 166, 73), + 5 : (166, 115, 73), + 6 : (209, 92, 92), + 7 : (201, 96, 219), + 8 : (140, 142, 207), + 9 : (160, 160, 160), +} + + +def render_gui_color(): + html.open_div(class_="gui_color") + for name, rgb_int in gui_colors.items(): + html.div("", + class_ = "pick_gui_color", + style = "background-color: rgb(%d,%d,%d);" % rgb_int, + onclick = "set_gui_color(%d,%d,%d);" % rgb_int, + ) + html.close_div() + + +def ajax_set_gui_color(): + html.log(html.all_vars()) + r = int(html.var("r")) + g = int(html.var("g")) + b = int(html.var("b")) + config.user.save_file("gui_color", (r, g, b)) + + +sidebar_snapins["gui_color"] = { + "title" : _("GUI Color"), + "description" : _("Choose your favourite color of the user interface"), + "render" : render_gui_color, + "allowed" : [ "admin", "user", ], + "styles" : """ + +div.gui_color { + text-align: center; + width: 100%; +} + +div.pick_gui_color { + width: 18.2px; + height: 18.5px; + float: none; + display: inline-block; + margin-right: 5px; + border: 1px solid black; + box-shadow: 0.5px 0.5px 1px rgba(0, 0, 0, 0.5); +} + +div.pick_gui_color:hover { + transform: scale(1.1); + cursor: pointer; + box-shadow: 1.5px 1.5px 3px rgba(0, 0, 0, 0.5); +} +""" +} + +
7 years, 5 months
1
0
0
0
Started applying GUI color set changes; cleaning up
by Lars Michelsen
Module: check_mk Branch: master Commit: a4b481fa626244606605985b795cdc615bb97770 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4b481fa626244…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Tue Apr 11 07:43:02 2017 +0200 Started applying GUI color set changes; cleaning up Change-Id: Ic22ad3031f2603727382a6a24acc8469adcc3cfa --- web/htdocs/html_mod_python.py | 4 ++++ web/htdocs/sidebar.css | 7 +++++++ web/plugins/sidebar/wato.py | 7 ------- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py index 074c80d..9623666 100644 --- a/web/htdocs/html_mod_python.py +++ b/web/htdocs/html_mod_python.py @@ -296,6 +296,10 @@ class html_mod_python(htmllib.html): if config.custom_style_sheet: self.write('<link rel="stylesheet" type="text/css" href="%s">\n' % config.custom_style_sheet) + if cmk.is_managed_edition(): + import gui_colors + gui_colors.GUIColors().render_html() + def plugin_stylesheets(self): plugin_stylesheets = set([]) diff --git a/web/htdocs/sidebar.css b/web/htdocs/sidebar.css index 1e5b7b0..fa94229 100644 --- a/web/htdocs/sidebar.css +++ b/web/htdocs/sidebar.css @@ -255,6 +255,13 @@ div.snapin div.content { width: 228px; } +div.snapin select { + background-color: #6da1b8; + color: #fff; + border-color: #123a4a; + font-size: 8pt; +} + /* * General styles for snapin contents */ diff --git a/web/plugins/sidebar/wato.py b/web/plugins/sidebar/wato.py index 1aa6209..d0360f3 100644 --- a/web/plugins/sidebar/wato.py +++ b/web/plugins/sidebar/wato.py @@ -284,13 +284,6 @@ sidebar_snapins['wato_foldertree'] = { width: 190px; height: 19px; margin-bottom: 2px; - background-color: #6da1b8; - color: #fff; - border-color: #123a4a; - font-size: 8pt; -} -#snapin_wato_foldertree select option { - background-color: #6da1b8; } #snapin_wato_foldertree span { margin-top: 1px;
7 years, 5 months
1
0
0
0
Minor code cleanup
by Lars Michelsen
Module: check_mk Branch: master Commit: 19135fe771a16c78eb5426722ec2bbf558b57ccc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19135fe771a16c…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Apr 12 11:08:36 2017 +0200 Minor code cleanup Change-Id: Ib1cca07411c9716e07f2e33aa5453ef18b3fac7b --- web/htdocs/wato.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index 1612259..39897bc 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -6737,7 +6737,7 @@ def render_global_configuration_variables(group_names, default_values, current_s forms.header(group_name, isopen=search) header_is_painted = True - defaultvalue = default_values.get(varname, valuespec.default_value()) + default_value = default_values.get(varname, valuespec.default_value()) edit_url = folder_preserving_link([("mode", edit_mode), ("varname", varname), @@ -6749,7 +6749,7 @@ def render_global_configuration_variables(group_names, default_values, current_s if varname in current_settings: to_text = valuespec.value_to_text(current_settings[varname]) else: - to_text = valuespec.value_to_text(defaultvalue) + to_text = valuespec.value_to_text(default_value) # Is this a simple (single) value or not? change styling in these cases... simple = True @@ -6758,20 +6758,21 @@ def render_global_configuration_variables(group_names, default_values, current_s forms.section(title, simple=simple) toggle_url = html.makeactionuri([("_action", "toggle"), ("_varname", varname)]) + if varname in current_settings: - if is_a_checkbox(valuespec): - html.icon_button(toggle_url, _("Immediately toggle this setting"), - "snapin_switch_" + (current_settings[varname] and "on" or "off"), - cssclass="modified") - else: - html.a(HTML(to_text), href=edit_url, class_="modified") + value = current_settings[varname] + modified_cls = "modified" else: - if is_a_checkbox(valuespec): - html.icon_button(toggle_url, _("Immediately toggle this setting"), - # "snapin_greyswitch_" + (defaultvalue and "on" or "off")) - "snapin_switch_" + (defaultvalue and "on" or "off")) - else: - html.a(HTML(to_text), href=edit_url) + value = default_value + modified_cls = None + + if is_a_checkbox(valuespec): + html.icon_button(toggle_url, _("Immediately toggle this setting"), + "snapin_switch_" + (value and "on" or "off"), + cssclass=modified_cls) + + else: + html.a(HTML(to_text), href=edit_url, class_=modified_cls) if header_is_painted: forms.end()
7 years, 5 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200