diff --git a/polemarch/__init__.py b/polemarch/__init__.py index 4943aab1..83e18735 100644 --- a/polemarch/__init__.py +++ b/polemarch/__init__.py @@ -31,6 +31,6 @@ "VST_ROOT_URLCONF": os.getenv("VST_ROOT_URLCONF", 'vstutils.urls'), } -__version__ = "1.3.0" +__version__ = "1.3.1" prepare_environment(**default_settings) diff --git a/polemarch/static/js/pmDashboard.js b/polemarch/static/js/pmDashboard.js index 7290d4d4..3e62b0a1 100644 --- a/polemarch/static/js/pmDashboard.js +++ b/polemarch/static/js/pmDashboard.js @@ -203,6 +203,10 @@ guiWidgets.history_chart = class HistoryChart extends guiWidgets.line_chart { let record = stats[index]; let status = record.status.toLowerCase(); + if(!data[status]) { + continue; + } + data[status].sum += record.sum; } diff --git a/polemarch/static/js/pmHistory.js b/polemarch/static/js/pmHistory.js index b5d5a1cc..79cd67fd 100644 --- a/polemarch/static/js/pmHistory.js +++ b/polemarch/static/js/pmHistory.js @@ -205,7 +205,23 @@ var history_pk_mixin = { was_cleared: undefined, } }, - + /** + * Redefinition of 'beforeRouteUpdate' hook of view_with_autoupdate_mixin. + */ + beforeRouteUpdate(to, from, next) { + this.stopChildrenAutoUpdate(); + this.stopAutoUpdate(); + next(); + }, + /** + * Redefinition of 'beforeRouteUpdate' hook of view_with_autoupdate_mixin. + */ + beforeRouteLeave(to, from, next) { + this.stopChildrenAutoUpdate(); + this.stopAutoUpdate(); + this.$destroy(); + next(); + }, computed: { /** * Property, that returns inventory field instance from inventory section. @@ -273,6 +289,16 @@ var history_pk_mixin = { } }, methods: { + /** + * Stops autoupdate of history_stdout component. + */ + stopChildrenAutoUpdate() { + this.$children.forEach(child => { + if(child.stopAutoUpdate && typeof child.stopAutoUpdate == 'function') { + child.stopAutoUpdate(); + } + }); + }, /** * Method, that sends API request for cleaning of history stdout. */ diff --git a/setup.py b/setup.py index 315e9420..418d27e4 100644 --- a/setup.py +++ b/setup.py @@ -346,6 +346,9 @@ def make_setup(**opts): kwargs = dict( name='polemarch', ext_modules_list=ext_list, + static_exclude_min=[ + 'polemarch/templates/gui/service-worker.js', + ], install_requires=[ ] + load_requirements('requirements.txt', os.getcwd()),