From b0af385ea0f13d279109e0c1e737878ec06efc89 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Mon, 17 Aug 2020 17:23:30 +0530 Subject: [PATCH] Fixed an issue where the entire logs is in red text when the user runs backup and restore. Fixes #5604 --- docs/en_US/release_notes_4_25.rst | 1 + .../misc/bgprocess/static/js/bgprocess.js | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_4_25.rst b/docs/en_US/release_notes_4_25.rst index 90db208bb..44e946c23 100644 --- a/docs/en_US/release_notes_4_25.rst +++ b/docs/en_US/release_notes_4_25.rst @@ -35,6 +35,7 @@ Bug fixes | `Issue #5490 `_ - Make the runtime configuration dialog non-modal. | `Issue #5526 `_ - Fixed an issue where copying and pasting a cell with multiple line data will result in multiple rows. | `Issue #5567 `_ - Fixed an issue where conversion of bytea to the binary string results in an error. +| `Issue #5604 `_ - Fixed an issue where the entire logs is in red text when the user runs backup and restore. | `Issue #5632 `_ - Ensure that the user will be able to modify the start value of the Identity column. | `Issue #5646 `_ - Ensure that RLS Policy node should be searchable using search object. | `Issue #5664 `_ - Fixed an issue where 'ALTER VIEW' statement is missing when the user sets the default value of a column for View. diff --git a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js index 5d4917212..d17d63c2e 100644 --- a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js +++ b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js @@ -193,7 +193,13 @@ define('misc.bgprocess', [ if (pgAdmin.natural_sort(out[io][0], err[ie][0]) <= 0) { res.push('
  • ' + escapeHTML(out[io++][1]) + '
  • '); } else { - res.push('
  • ' + escapeHTML(err[ie++][1]) + '
  • '); + let log_msg = escapeHTML(err[ie++][1]); + let regex_obj = new RegExp(': (' + gettext('error') + '|' + gettext('fatal') + '):', 'i'); + if (regex_obj.test(log_msg)) { + res.push('
  • ' + log_msg + '
  • '); + } else { + res.push('
  • ' + log_msg + '
  • '); + } } } @@ -202,7 +208,13 @@ define('misc.bgprocess', [ } while (ie < err.length) { - res.push('
  • ' + escapeHTML(err[ie++][1]) + '
  • '); + let log_msg = escapeHTML(err[ie++][1]); + let regex_obj = new RegExp(': (' + gettext('error') + '|' + gettext('fatal') + '):', 'i'); + if (regex_obj.test(log_msg)) { + res.push('
  • ' + log_msg + '
  • '); + } else { + res.push('
  • ' + log_msg + '
  • '); + } } if (res.length) {