From: Marcin Haba Date: Wed, 28 Oct 2020 05:37:43 +0000 (+0100) Subject: baculum: Show more detailed job file list - idea proposed by Wanderlei Huttel X-Git-Tag: Release-9.6.7~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e827c79594478feb8c538b42510db9b64f69486;p=thirdparty%2Fbacula.git baculum: Show more detailed job file list - idea proposed by Wanderlei Huttel --- diff --git a/gui/baculum/protected/Web/JavaScript/misc.js b/gui/baculum/protected/Web/JavaScript/misc.js index 1ab9758dc..1bca58b07 100644 --- a/gui/baculum/protected/Web/JavaScript/misc.js +++ b/gui/baculum/protected/Web/JavaScript/misc.js @@ -258,7 +258,8 @@ var Formatters = { formatter: [ {css_class: 'size', format_func: function(val) { return Units.get_formatted_size(val); }}, {css_class: 'time', format_func: function(val) { return Units.format_time_period(val); }}, - {css_class: 'datetime', format_func: function(val) { return Units.format_date_str(val); }} + {css_class: 'datetime', format_func: function(val) { return Units.format_date_str(val); }}, + {css_class: 'udatetime', format_func: function(val) { return Units.format_date(val); }} ], set_formatters: function() { var elements, formatter, txt, val; diff --git a/gui/baculum/protected/Web/Lang/en/messages.mo b/gui/baculum/protected/Web/Lang/en/messages.mo index 01d671f5f..9a2a56d63 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 936ee4629..11ee4e799 100644 --- a/gui/baculum/protected/Web/Lang/en/messages.po +++ b/gui/baculum/protected/Web/Lang/en/messages.po @@ -3073,3 +3073,12 @@ msgstr "match exact filename" msgid "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." msgstr "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." + +msgid "State" +msgstr "State" + +msgid "saved" +msgstr "saved" + +msgid "deleted" +msgstr "deleted" diff --git a/gui/baculum/protected/Web/Lang/ja/messages.mo b/gui/baculum/protected/Web/Lang/ja/messages.mo index b74b610fe..1bc58cd09 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 2400ae006..72415e820 100644 --- a/gui/baculum/protected/Web/Lang/ja/messages.po +++ b/gui/baculum/protected/Web/Lang/ja/messages.po @@ -3159,3 +3159,12 @@ msgstr "match exact filename" msgid "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." msgstr "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." + +msgid "State" +msgstr "State" + +msgid "saved" +msgstr "saved" + +msgid "deleted" +msgstr "deleted" diff --git a/gui/baculum/protected/Web/Lang/pl/messages.mo b/gui/baculum/protected/Web/Lang/pl/messages.mo index 77e676a6d..12b8c083d 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 2ba865292..5b593d85f 100644 --- a/gui/baculum/protected/Web/Lang/pl/messages.po +++ b/gui/baculum/protected/Web/Lang/pl/messages.po @@ -3084,3 +3084,12 @@ msgstr "dopasuj dokładną nazwę pliku" msgid "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." msgstr "Z tą opcją są przeszukiwane pliki z nazwą równą dostarczonej nazwie pliku, w przeciwnym razie są wyszukiwane pliki z nazwami zawierającymi podaną nazwę pliku, np. *nazwapliku*." + +msgid "State" +msgstr "Stan" + +msgid "saved" +msgstr "zapisany" + +msgid "deleted" +msgstr "skasowany" diff --git a/gui/baculum/protected/Web/Lang/pt/messages.mo b/gui/baculum/protected/Web/Lang/pt/messages.mo index 1dba63d4b..da0155da4 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 2eed72e18..2154506f1 100644 --- a/gui/baculum/protected/Web/Lang/pt/messages.po +++ b/gui/baculum/protected/Web/Lang/pt/messages.po @@ -3083,3 +3083,12 @@ msgstr "match exact filename" msgid "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." msgstr "With this option are searched files with names equal provided filename, otherwise there are searched files with names containing provided filename like *filename*." + +msgid "State" +msgstr "State" + +msgid "saved" +msgstr "saved" + +msgid "deleted" +msgstr "deleted" diff --git a/gui/baculum/protected/Web/Portlets/JobListFiles.php b/gui/baculum/protected/Web/Portlets/JobListFiles.php index de1e30781..9b369323c 100644 --- a/gui/baculum/protected/Web/Portlets/JobListFiles.php +++ b/gui/baculum/protected/Web/Portlets/JobListFiles.php @@ -3,7 +3,7 @@ * Bacula(R) - The Network Backup Solution * Baculum - Bacula web interface * - * Copyright (C) 2013-2019 Kern Sibbald + * Copyright (C) 2013-2020 Kern Sibbald * * The main author of Baculum is Marcin Haba. * The original author of Bacula is Kern Sibbald, with contributions @@ -61,18 +61,19 @@ class JobListFiles extends Portlets { if (!empty($this->FileListSearch->Text)) { $params['search'] = $this->FileListSearch->Text; } + $params['details'] = '1'; $query = '?' . http_build_query($params); $result = $this->getModule('api')->get( array('jobs', $this->getJobId(), 'files', $query) ); if ($result->error === 0) { - $file_list = $result->output->items; + $file_list = $result->output; if (!empty($this->FileListSearch->Text)) { - $file_list = $this->findFileListItems($file_list, $this->FileListSearch->Text); + $this->findFileListItems($file_list, $this->FileListSearch->Text); } $this->FileList->DataSource = $file_list; $this->FileList->dataBind(); - $this->FileListCount->Text = $result->output->total; + $this->FileListCount->Text = count($file_list); } else { $this->FileList->DataSource = array(); $this->FileList->dataBind(); @@ -80,17 +81,15 @@ class JobListFiles extends Portlets { } } - private function findFileListItems($file_list, $keyword) { - $result = array(); + private function findFileListItems(&$file_list, $keyword) { for ($i = 0; $i < count($file_list); $i++) { - $pos = stripos($file_list[$i], $keyword); - $str1 = substr($file_list[$i], 0, $pos); + $pos = stripos($file_list[$i]->file, $keyword); + $str1 = substr($file_list[$i]->file, 0, $pos); $key_len = strlen($keyword); - $key = substr($file_list[$i], $pos, $key_len); - $str2 = substr($file_list[$i], ($pos + $key_len)); - $result[] = $str1 . '' . $key . '' . $str2; + $key = substr($file_list[$i]->file, $pos, $key_len); + $str2 = substr($file_list[$i]->file, ($pos + $key_len)); + $file_list[$i]->file = $str1 . '' . $key . '' . $str2; } - return $result; } /** diff --git a/gui/baculum/protected/Web/Portlets/JobListFiles.tpl b/gui/baculum/protected/Web/Portlets/JobListFiles.tpl index e6a8b6d0f..3026445e1 100644 --- a/gui/baculum/protected/Web/Portlets/JobListFiles.tpl +++ b/gui/baculum/protected/Web/Portlets/JobListFiles.tpl @@ -33,13 +33,32 @@ -
    + + + + + + + + + + + + -
  • <%=$this->Data%>
  • +
    + + + + + + + + - +
    <%[ Attributes ]%>UIDGIDSizeMTIME<%[ File ]%><%[ State ]%>
    <%#$this->Data->lstat->mode%><%#$this->Data->lstat->uid%><%#$this->Data->lstat->gid%><%#$this->Data->lstat->size%><%#$this->Data->lstat->mtime%><%#$this->Data->file%><%#$this->Data->fileindex > 0 ? Prado::localize('saved') : Prado::localize('deleted')%>
    @@ -47,7 +66,7 @@ ID="LoadJobFileList" OnCallback="loadFileList" ClientSide.OnLoading="show_job_list_files_loader(true)" - ClientSide.OnComplete="job_list_files_msg(); show_job_list_files_loader(false)" + ClientSide.OnComplete="job_list_files_msg(); show_job_list_files_loader(false); Formatters.set_formatters();" />