Module: check_mk
Branch: master
Commit: a553c83cc3ac5a031ba6633fdf5276e5af2da19d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a553c83cc3ac5a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Sep 26 11:30:09 2016 +0200
Minor cleanup and note update
---
web/htdocs/index.py | 4 ++--
web/htdocs/modules.py | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index abfddc8..76ea094 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -112,13 +112,13 @@ def handler(req, fields = None, is_profiling = False):
# Initialize the multiste i18n. This will be replaced by
# language settings stored in the user profile after the user
# has been initialized
- previous_language = current_language
+ previous_language = i18n.get_current_language()
i18n.localize(html.var("lang", config.get_language()))
# All plugins might have to be reloaded due to a language change. Only trigger
# a second plugin loading when the user is really using a custom localized GUI.
# Otherwise the load_all_plugins() at the beginning of the request is sufficient.
- if current_language != previous_language:
+ if i18n.get_current_language() != previous_language:
modules.load_all_plugins()
# User allowed to login at all?
diff --git a/web/htdocs/modules.py b/web/htdocs/modules.py
index 6096433..6113883 100644
--- a/web/htdocs/modules.py
+++ b/web/htdocs/modules.py
@@ -86,7 +86,7 @@ def init_modules():
# Load the list of internal hard coded modules
for module_name in internal_module_names:
- # FIXME: use __import__
+ # TODO: use __import__
modules.append(import_module(module_name))
# Load all multisite pages which will also perform imports of the needed modules
@@ -102,7 +102,7 @@ g_all_modules_loaded = False
def load_all_plugins():
global g_all_modules_loaded
- # CLEANUP: Move this to the pagehandlers if this concept works out.
+ # TODO: CLEANUP: Move this to the pagehandlers if this concept works out.
if html.myfile == "ajax_graph" and g_all_modules_loaded:
only_modules = ["metrics"]
else:
Module: check_mk
Branch: master
Commit: 98367ba686a058c740b4d393e0c75d62680044d9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=98367ba686a058…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 23 15:43:56 2016 +0200
3892 FIX CSV export of views: Joined columns have now a title
The title cells of joined columns (service columns in host views) had no title in
CSV exports of views. Now, the titles have been added and are computed as follows:
[painter_name].[service_description_of_join_service]
For example:
perfometer.CPU load
---
.werks/3892 | 16 ++++++++++++++++
ChangeLog | 1 +
web/htdocs/views.py | 9 +++++++++
web/plugins/views/webservice.py | 6 +++---
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/.werks/3892 b/.werks/3892
new file mode 100644
index 0000000..9e35ffb
--- /dev/null
+++ b/.werks/3892
@@ -0,0 +1,16 @@
+Title: CSV export of views: Joined columns have now a title
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i1
+Date: 1474638125
+Class: fix
+
+The title cells of joined columns (service columns in host views) had no title in
+CSV exports of views. Now, the titles have been added and are computed as follows:
+
+[painter_name].[service_description_of_join_service]
+
+For example:
+
+perfometer.CPU load
diff --git a/ChangeLog b/ChangeLog
index e1ca282..c9c0568 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -520,6 +520,7 @@
* 3871 FIX: stale services view: excluded services in downtime per default
* 3874 FIX: fixed graphs displaying wrong labels
* 3885 FIX: Fixed sorting of version in werk list (1.2.8p10 and 1.2.8p11 were not listed on top)
+ * 3892 FIX: CSV export of views: Joined columns have now a title...
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node selection...
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 7c5c601..08c4797 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -704,6 +704,10 @@ class Cell(object):
return self._painter_name
+ def export_title(self):
+ return self._painter_name
+
+
def painter_options(self):
return self.painter().get("options", [])
@@ -982,6 +986,11 @@ class JoinCell(Cell):
return self._join_service_descr
+ def export_title(self):
+ return "%s.%s" % (self._painter_name, self.join_service())
+
+
+
class EmptyCell(Cell):
def __init__(self, view):
diff --git a/web/plugins/views/webservice.py b/web/plugins/views/webservice.py
index 5fa0f9d..32cbaa8 100644
--- a/web/plugins/views/webservice.py
+++ b/web/plugins/views/webservice.py
@@ -41,7 +41,7 @@ multisite_layouts["python-raw"] = {
def render_python(rows, view, group_cells, cells, num_columns, show_checkboxes):
html.write("[\n")
- html.write(repr([cell.painter_name() for cell in cells]))
+ html.write(repr([cell.export_title() for cell in cells]))
html.write(",\n")
for row in rows:
html.write("[")
@@ -71,7 +71,7 @@ def render_json(rows, view, group_cells, cells, num_columns, show_checkboxes, ex
header_row = []
for cell in cells:
- header_row.append(html.strip_tags(cell.painter_name()))
+ header_row.append(html.strip_tags(cell.export_title()))
painted_rows.append(header_row)
for row in rows:
@@ -135,7 +135,7 @@ def render_csv(rows, view, group_cells, cells, num_columns, show_checkboxes, exp
first = False
else:
html.write(csv_separator)
- content = cell.painter_name()
+ content = cell.export_title()
content = type(content) in [ int, float ] and str(content) or content
stripped = html.strip_tags(content).replace('\n', '').replace('"', '""')
html.write('"%s"' % stripped.encode("utf-8"))
Module: check_mk
Branch: master
Commit: 6b706f6bf0a874863a28ce4ac66445a91cffe321
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b706f6bf0a874…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 23 15:19:23 2016 +0200
3891 Changed graph time range choices
It seems more practical to have slightly wider time ranges, e.g. 8 days instead of 7 days
to have a little more context. We also extended the "month" and "year" time ranges.
You have now the following available:
The last 4 hours
The last 25 hours
The last 8 days
The last 35 days
The last 400 days
---
.werks/3891 | 18 ++++++++++++++++++
ChangeLog | 1 +
web/htdocs/valuespec.py | 14 +++++++-------
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/.werks/3891 b/.werks/3891
new file mode 100644
index 0000000..4e40ce3
--- /dev/null
+++ b/.werks/3891
@@ -0,0 +1,18 @@
+Title: Changed graph time range choices
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.4.0i1
+Date: 1474636659
+Class: feature
+
+It seems more practical to have slightly wider time ranges, e.g. 8 days instead of 7 days
+to have a little more context. We also extended the "month" and "year" time ranges.
+
+You have now the following available:
+
+The last 4 hours
+The last 25 hours
+The last 8 days
+The last 35 days
+The last 400 days
diff --git a/ChangeLog b/ChangeLog
index 3311e42..e1ca282 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -436,6 +436,7 @@
* 3847 Painter options can now be reset to defaults...
* 3856 Improved handling of Check_MK GUI request timeouts...
* 3876 New filter option: negation for several service and host groups
+ * 3891 Changed graph time range choices...
* 3059 FIX: Fixed highlighting of availability timeline time slices
* 3175 FIX: Fix timeranges of graphs that are embedded in a dashboard...
* 3076 FIX: fixed broken views in check_mk raw edition
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 699629d..c8ac050 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -2460,9 +2460,9 @@ class Timerange(CascadingDropdown):
kwargs['choices'] += [
( "4h", _("The last 4 hours")),
( "25h", _("The last 25 hours")),
- ( "7d", _("The last 7 days")),
- ( "31d", _("The last 31 days")),
- ( "365d", _("The last 365 days")),
+ ( "8d", _("The last 8 days")),
+ ( "35d", _("The last 35 days")),
+ ( "400d", _("The last 400 days")),
( "d0", _("Today") ),
( "d1", _("Yesterday") ),
@@ -2520,9 +2520,9 @@ class Timerange(CascadingDropdown):
rangespec = {
1: "4h",
2: "25h",
- 3: "7d",
- 4: "31d",
- 5: "365d"
+ 3: "8d",
+ 4: "35d",
+ 5: "400d"
}.get(rangespec[1], "4h")
now = time.time()
@@ -2547,7 +2547,7 @@ class Timerange(CascadingDropdown):
else:
until_time = now
- if rangespec[0].isdigit(): # 4h, 365d
+ if rangespec[0].isdigit(): # 4h, 400d
count = int(rangespec[:-1])
from_time = TimeHelper.add(now, count * -1, rangespec[-1])
unit_name = {