Skip to content

Commit a6217d1

Browse files
committed
Revert "gui: drop the about info page from site"
This reverts commit 508af93. Reason for revert: breaks integration tests Change-Id: I8d2b26b89636444b2699c0278182266924f944f4
1 parent 7914a2c commit a6217d1

File tree

7 files changed

+77
-0
lines changed

7 files changed

+77
-0
lines changed

cmk/gui/help_menu.py

+7
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ def default_developer_items() -> list[TopicMenuItem]:
142142

143143
def default_about_checkmk_items() -> list[TopicMenuItem]:
144144
return [
145+
TopicMenuItem(
146+
name="info",
147+
title=_("Info"),
148+
url="info.py",
149+
sort_index=20,
150+
icon="checkmk_logo_min",
151+
),
145152
TopicMenuItem(
146153
name="change_log",
147154
title=_("Change log (Werks)"),

cmk/gui/werks.py

+59
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
)
5454
from cmk.gui.pages import Page, PageRegistry, PageResult
5555
from cmk.gui.table import Table, table_element
56+
from cmk.gui.theme.current_theme import theme
5657
from cmk.gui.utils.escaping import escape_to_html_permissive, strip_tags
5758
from cmk.gui.utils.flashed_messages import flash, get_flashed_messages
5859
from cmk.gui.utils.html import HTML
@@ -78,6 +79,7 @@
7879

7980

8081
def register(page_registry: PageRegistry) -> None:
82+
page_registry.register_page("info")(AboutCheckmkPage)
8183
page_registry.register_page("change_log")(ChangeLogPage)
8284
page_registry.register_page_handler("werk", page_werk)
8385

@@ -120,6 +122,63 @@ class WerkTableOptions(TypedDict):
120122
]
121123

122124

125+
class AboutCheckmkPage(Page):
126+
def _title(self) -> str:
127+
return _("About Checkmk")
128+
129+
def page(self) -> PageResult:
130+
breadcrumb = make_simple_page_breadcrumb(mega_menu_registry["help_links"], _("Info"))
131+
make_header(
132+
html,
133+
self._title(),
134+
breadcrumb=breadcrumb,
135+
)
136+
137+
html.open_div(id_="info_title")
138+
html.h1(_("Your IT monitoring platform"))
139+
html.a(
140+
html.render_img(theme.url("images/checkmk_logo.svg")),
141+
"https://checkmk.com",
142+
target="_blank",
143+
)
144+
html.close_div()
145+
146+
html.div(None, id_="info_underline")
147+
148+
html.open_div(id_="info_intro_text")
149+
html.span(
150+
_(
151+
"Gain a complete view of your entire IT infrastructure: from public cloud providers, to your data centers, across servers, networks, containers, and more. Checkmk enables ITOps and DevOps teams to run your IT at peak performance."
152+
)
153+
)
154+
html.span(
155+
_("Visit our %s to learn more about Checkmk and about the %s.")
156+
% (
157+
HTMLWriter.render_a(_("website"), "https://checkmk.com", target="_blank"),
158+
HTMLWriter.render_a(
159+
_("latest version"),
160+
"https://checkmk.com/product/latest-version",
161+
target="_blank",
162+
),
163+
)
164+
)
165+
html.close_div()
166+
167+
html.open_div(id="info_image")
168+
html.open_a(href="https://checkmk.com/product/latest-version", target="_blank")
169+
html.img(theme.url("images/monitoring-machine.png"))
170+
html.close_a()
171+
html.close_div()
172+
173+
html.close_div()
174+
175+
html.open_div(id_="info_footer")
176+
html.span(_("© %s Checkmk GmbH. All Rights Reserved.") % time.strftime("%Y"))
177+
html.a(_("License agreement"), href="https://checkmk.com/legal.html", target="_blank")
178+
html.close_div()
179+
return None
180+
181+
123182
class ChangeLogPage(Page):
124183
def _title(self) -> str:
125184
return _("Change log (Werks)")
Loading
Loading

tests/gui_e2e/test_menu_help.py

+6
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ def test_help_menu(
115115
new_page = new_tab_info.value
116116
new_page.wait_for_url(url=re.compile(help_menu_button.url_pattern), wait_until="load")
117117
new_page.close()
118+
119+
120+
def test_help_info(dashboard_page: Dashboard) -> None:
121+
dashboard_page.main_menu.help_info.click()
122+
dashboard_page.page.wait_for_url(url=re.compile("info.py$"), wait_until="load")
123+
dashboard_page.main_area.check_page_title("About Checkmk")

tests/gui_e2e/testlib/playwright/pom/page.py

+4
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,10 @@ def help_rest_api_docs(self) -> Locator:
310310
def help_rest_api_gui(self) -> Locator:
311311
return self.help_menu("REST API interactive GUI")
312312

313+
@property
314+
def help_info(self) -> Locator:
315+
return self.help_menu("Info")
316+
313317
@property
314318
def help_saas_status_page(self) -> Locator:
315319
return self.help_menu("Status page")

tests/unit/cmk/gui/test_pages.py

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ def test_registered_pages() -> None:
100100
"host_inv_api",
101101
"host_service_graph_popup",
102102
"index",
103+
"info",
103104
"login",
104105
"logout",
105106
"logwatch",

0 commit comments

Comments
 (0)