From: Marcin Haba Date: Mon, 29 Jul 2019 05:22:36 +0000 (+0200) Subject: baculum: Show error message on status client request if client is not available X-Git-Tag: Release-9.6.0~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ef7b19f19abab89d6cd4a89fb3b860983b34198;p=thirdparty%2Fbacula.git baculum: Show error message on status client request if client is not available --- diff --git a/gui/baculum/protected/Web/JavaScript/misc.js b/gui/baculum/protected/Web/JavaScript/misc.js index 833a85591..7b70867c3 100644 --- a/gui/baculum/protected/Web/JavaScript/misc.js +++ b/gui/baculum/protected/Web/JavaScript/misc.js @@ -442,7 +442,7 @@ var oLastJobsList = { { data: 'level', render: function(data, type, row) { - return JobLevel.get_level(data); + return (['R', 'D'].indexOf(row.type) === -1 ? JobLevel.get_level(data) : '-'); }, responsivePriority: 3 }, diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index 7173c9175..a6bacfbbc 100644 Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/en/messages.po b/gui/baculum/protected/Web/Lang/en/messages.po index 934978735..5a0ba22c2 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -2290,3 +2290,6 @@ msgstr "No jobs running" msgid "Graphical client status is supported for Bacula clients version 9.0 and greater." msgstr "Graphical client status is supported for Bacula clients version 9.0 and greater." + +msgid "Status request timed out. The most probably the Bacula client is not available or it is not running." +msgstr "Status request timed out. The most probably the Bacula client is not available or it is not running." diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index 55728b516..b3572ed1c 100644 Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/ja/messages.po b/gui/baculum/protected/Web/Lang/ja/messages.po index 7296bb8ea..96bc28b99 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -2376,3 +2376,6 @@ msgstr "No jobs running" msgid "Graphical client status is supported for Bacula clients version 9.0 and greater." msgstr "Graphical client status is supported for Bacula clients version 9.0 and greater." + +msgid "Status request timed out. The most probably the Bacula client is not available or it is not running." +msgstr "Status request timed out. The most probably the Bacula client is not available or it is not running." diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index 31e122c60..b97433175 100644 Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pl/messages.po b/gui/baculum/protected/Web/Lang/pl/messages.po index 693bd1cea..44160a81b 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -2297,3 +2297,6 @@ msgstr "Nie ma uruchomionych zadań" msgid "Graphical client status is supported for Bacula clients version 9.0 and greater." msgstr "Graficzny status klienta jest wspierany dla klientów Bacula w wersji 9.0 i większych." + +msgid "Status request timed out. The most probably the Bacula client is not available or it is not running." +msgstr "Upłynął limit czasu żądania statusu. Najprawdopodobniej klient Bacula nie jest dostępny lub nie jest uruchomiony." diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 42de8261d..bf2153324 100644 Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ diff --git a/gui/baculum/protected/Web/Lang/pt/messages.po b/gui/baculum/protected/Web/Lang/pt/messages.po index 6800b7266..bed1c3cdd 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -2305,3 +2305,6 @@ msgstr "No jobs running" msgid "Graphical client status is supported for Bacula clients version 9.0 and greater." msgstr "Graphical client status is supported for Bacula clients version 9.0 and greater." + +msgid "Status request timed out. The most probably the Bacula client is not available or it is not running." +msgstr "Status request timed out. The most probably the Bacula client is not available or it is not running." diff --git a/gui/baculum/protected/Web/Pages/ClientView.page b/gui/baculum/protected/Web/Pages/ClientView.page index 24c31e77b..73aacb502 100644 --- a/gui/baculum/protected/Web/Pages/ClientView.page +++ b/gui/baculum/protected/Web/Pages/ClientView.page @@ -24,12 +24,13 @@ OnClick="status" CssClass="w3-button w3-green w3-margin-bottom" CausesValidation="false" - ClientSide.OnLoading="$('#status_client_loading').show();" + ClientSide.OnLoading="$('#status_client_loading').show();$('#status_client_error').hide();" ClientSide.OnSuccess="$('#status_client_loading').hide();$('#show_client_container').hide();$('#status_client_container').show();oGraphicalClientStatus.set_refresh_timeout(document.getElementById('status_client_refresh_interval').value);" + ClientSide.OnFailure="$('#status_client_loading').hide();status_client_show_error(parameter);" > <%=Prado::localize('Status client')%>   - +
@@ -137,7 +138,7 @@ var oGraphicalClientStatus = { } else if (/(darwin|mac\s?os)/i.test(value)) { img.className += ' fa-apple'; } else { - img.className += ' fa-question'; + img.className = 'fa fa-2x fa-question'; } img.style.marginRight = '10px'; var el = document.createElement('SPAN'); @@ -273,7 +274,7 @@ var oGraphicalClientStatus = { this.add_job_row(table, '<%[ Type: ]%>', type); // Level - var level = JobLevel.get_level(job.level); + var level = job.type === 'R' ? '-' : JobLevel.get_level(job.level); this.add_job_row(table, '<%[ Level: ]%>', level); // Job bytes @@ -401,6 +402,15 @@ var oGraphicalClientStatus = { function init_graphical_client_status(data) { oGraphicalClientStatus.update(data); } +function status_client_show_error(error) { + var errmsg = error; + if (error === 'timeout') { + errmsg = '<%[ Status request timed out. The most probably the Bacula client is not available or it is not running. ]%>'; + } + var err_el = document.getElementById('status_client_error'); + err_el.textContent = errmsg; + err_el.style.display = ''; +} oGraphicalClientStatus.init();
diff --git a/gui/baculum/protected/Web/Pages/JobHistoryList.page b/gui/baculum/protected/Web/Pages/JobHistoryList.page index f074ecb91..d276a51f4 100644 --- a/gui/baculum/protected/Web/Pages/JobHistoryList.page +++ b/gui/baculum/protected/Web/Pages/JobHistoryList.page @@ -77,7 +77,7 @@ var oJobList = { { data: 'level', render: function(data, type, row) { - return JobLevel.get_level(data); + return (['R', 'D'].indexOf(row.type) === -1 ? JobLevel.get_level(data) : '-'); } }, {data: 'starttime'},