]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Show error message on status client request if client is not available
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 29 Jul 2019 05:22:36 +0000 (07:22 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 14:55:27 +0000 (15:55 +0100)
gui/baculum/protected/Web/JavaScript/misc.js
gui/baculum/protected/Web/Lang/en/messages.mo
gui/baculum/protected/Web/Lang/en/messages.po
gui/baculum/protected/Web/Lang/ja/messages.mo
gui/baculum/protected/Web/Lang/ja/messages.po
gui/baculum/protected/Web/Lang/pl/messages.mo
gui/baculum/protected/Web/Lang/pl/messages.po
gui/baculum/protected/Web/Lang/pt/messages.mo
gui/baculum/protected/Web/Lang/pt/messages.po
gui/baculum/protected/Web/Pages/ClientView.page
gui/baculum/protected/Web/Pages/JobHistoryList.page

index 833a85591b3392a7bd7508062c2f36fd7b6d4873..7b70867c3b5f658d7ec80d48d58e8523e5ff1999 100644 (file)
@@ -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
                                },
index 7173c91755c615d0afb14762fb21341eeb90e451..a6bacfbbc90eed6d7d2ef21be35ddfe4699aa64a 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/en/messages.mo and b/gui/baculum/protected/Web/Lang/en/messages.mo differ
index 93497873551c6fac78ef6519b621d9e0ffee99ee..5a0ba22c25b3558dae88b77385b9125237d7e7e4 100644 (file)
@@ -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."
index 55728b51649f2775f6c59305c1f5b9a416d1fbde..b3572ed1c13b3f0a1f6b71eabdfec23758a48355 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/ja/messages.mo and b/gui/baculum/protected/Web/Lang/ja/messages.mo differ
index 7296bb8ea368d32f393396a6a89b01ddb591030e..96bc28b992340dd3901039a4ddcd1b0a9bf4ac62 100644 (file)
@@ -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."
index 31e122c609c1e83e2f3ecf8ee35fa9c0dbfca1d3..b974331756a0dd93183b643a24657f355cb29796 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pl/messages.mo and b/gui/baculum/protected/Web/Lang/pl/messages.mo differ
index 693bd1ceaaecd77438c8b7bc2dad9d0ea3822797..44160a81bab2225ad7ef3558a7d77e009e5f9161 100644 (file)
@@ -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."
index 42de8261d51d998393d03524b46d6e8a6304c768..bf215332452a06eb927200b7b64801c05dc57096 100644 (file)
Binary files a/gui/baculum/protected/Web/Lang/pt/messages.mo and b/gui/baculum/protected/Web/Lang/pt/messages.mo differ
index 6800b726607e7486d8a680d720a5ade34ab34835..bed1c3cdd929d016b2a5491caff334445ec0fe1c 100644 (file)
@@ -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."
index 24c31e77bd13c0adfb2674f1c686321527d37e59..73aacb502f95d7af241f77cb0b31dc8d91b2ed33 100644 (file)
                        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);"
                >
                        <prop:Text><%=Prado::localize('Status client')%> &nbsp;<i class="fa fa-file-medical-alt"></i></prop:Text>
                </com:TActiveLinkButton>
-               <i id="status_client_loading" class="fa fa-sync w3-spin" style="display: none; vertical-align: super; margin-left: 6px;"></i>
+               <i id="status_client_loading" class="fa fa-sync w3-spin" style="display: none; vertical-align: super; margin-left: 6px;"></i> <span id="status_client_error" class="w3-text-red" style="display: none"></span>
                <div id="show_client_container">
                        <div id="status_client_text_output" class="w3-code">
                                <pre><com:TActiveLabel ID="ShowLog" /></pre>
@@ -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();
 </script>
                                </div>
index f074ecb91e3b5eb1caaa49da762155009d3e8abb..d276a51f47359f019b92225df9359c272d44d52d 100644 (file)
@@ -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'},