]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Show more detailed job file list - idea proposed by Wanderlei Huttel
authorMarcin Haba <marcin.haba@bacula.pl>
Wed, 28 Oct 2020 05:37:43 +0000 (06:37 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Wed, 28 Oct 2020 05:37:43 +0000 (06:37 +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/Portlets/JobListFiles.php
gui/baculum/protected/Web/Portlets/JobListFiles.tpl

index 1ab9758dce9cb89d2c7763c4d54dfdd785bea2e8..1bca58b070efbd27d67e13a803e5fd7fa8b92d6e 100644 (file)
@@ -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;
index 01d671f5f0db05e035cc0f45b756a1e70cae196c..9a2a56d63656ace9f8b4e5fff3bfd6647bdef78e 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 936ee4629f0bf805054d96a2701a0c7fb5a251b5..11ee4e7991554358555c54e44c92a5fdf82d8f3a 100644 (file)
@@ -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"
index b74b610fec1aea79204523b1391ca43220f39e25..1bc58cd094f26562d2c24fb6076a17856a247819 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 2400ae006623d8f91cae489f42e9798b4daab5ee..72415e8207d3ad91c252a6991dee83cdc42f8e99 100644 (file)
@@ -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"
index 77e676a6d5e8395291bc7b0703b836052454c56a..12b8c083d9c81e09611d0e251424c0da17f76475 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 2ba865292da820fdcbdd5c682eb289a2588e4dc4..5b593d85fac75d1471d392bdc9af4aec9c1e23c6 100644 (file)
@@ -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"
index 1dba63d4b75d07e19599044fc07013b022c22904..da0155da423bfafefa370237744982f772bf700e 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 2eed72e1848ab930a81612c7cf0acb14b1705cfc..2154506f1e441f9f6fd15c617e702fc1f6a8da3b 100644 (file)
@@ -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"
index de1e3078124ede5ff2da684611cd3a7d8e29acb7..9b369323c55b30e472aa4ba2235c015ddbbb5f2a 100644 (file)
@@ -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 . '<strong class="w3-text-red">' . $key . '</strong>' . $str2;
+                       $key = substr($file_list[$i]->file, $pos, $key_len);
+                       $str2 = substr($file_list[$i]->file, ($pos + $key_len));
+                       $file_list[$i]->file = $str1 . '<strong class="w3-text-red">' . $key . '</strong>' . $str2;
                }
-               return $result;
        }
 
        /**
index e6a8b6d0fef637550372fbfea85f53d24190ca9e..3026445e15756450cf94c591550d52d8428abfc1 100644 (file)
        <div id="job_list_files_no_result" class="w3-panel w3-center" style="display: none"><strong><%[ No item result ]%></strong></div>
        <com:TActiveRepeater ID="FileList">
                <prop:HeaderTemplate>
-                       <ul>
+                       <table class="w3-table w3-striped w3-white w3-margin-bottom dataTable dtr-column" style="table-layout: fixed">
+                               <thead>
+                                       <tr class="row">
+                                               <th class="w3-center w3-hide-small" style="width: 65px"><%[ Attributes ]%></th>
+                                               <th class="w3-center w3-hide-small" style="width: 39px; padding: 10px 3px">UID</th>
+                                               <th class="w3-center w3-hide-small" style="width: 39px; padding: 10px 3px">GID</th>
+                                               <th class="w3-center w3-hide-small" style="width: 40px">Size</th>
+                                               <th class="w3-center w3-hide-small" style="width: 125px">MTIME</th>
+                                               <th class="w3-center"><%[ File ]%></th>
+                                               <th class="w3-center w3-hide-small" style="width: 50px"><%[ State ]%></th>
+                                       </tr>
+                               </thead>
                </prop:HeaderTemplate>
                <prop:ItemTemplate>
-                       <li><%=$this->Data%></li>
+                       <tr class="row">
+                               <td class="w3-hide-small"><%#$this->Data->lstat->mode%></td>
+                               <td class="w3-center w3-hide-small"><%#$this->Data->lstat->uid%></td>
+                               <td class="w3-center w3-hide-small"><%#$this->Data->lstat->gid%></td>
+                               <td class="w3-hide-small"><span class="size w3-right"><%#$this->Data->lstat->size%></span></td>
+                               <td class="udatetime w3-hide-small"><%#$this->Data->lstat->mtime%></td>
+                               <td style="word-wrap: break-word"><%#$this->Data->file%></td>
+                               <td class="<%#$this->Data->fileindex > 0 ? 'w3-text-green' : 'w3-text-orange'%> w3-center w3-hide-small"><strong><%#$this->Data->fileindex > 0 ? Prado::localize('saved') : Prado::localize('deleted')%></strong></td>
+                       </tr>
                </prop:ItemTemplate>
                <prop:FooterTemplate>
-                       </ul>
+                       </table>
                </prop:FooterTemplate>
        </com:TActiveRepeater>
 </div>
@@ -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();"
 />
 <script>
 function get_job_list_files(page_direction) {