]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add table filters
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 17 Nov 2019 21:29:46 +0000 (22:29 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sat, 14 Dec 2019 15:02:16 +0000 (16:02 +0100)
15 files changed:
gui/baculum/protected/Web/JavaScript/misc.js
gui/baculum/protected/Web/Pages/ClientList.page
gui/baculum/protected/Web/Pages/ClientView.page
gui/baculum/protected/Web/Pages/FileSetList.page
gui/baculum/protected/Web/Pages/JobHistoryList.page
gui/baculum/protected/Web/Pages/JobList.page
gui/baculum/protected/Web/Pages/JobView.page
gui/baculum/protected/Web/Pages/PoolList.page
gui/baculum/protected/Web/Pages/PoolView.page
gui/baculum/protected/Web/Pages/RestoreWizard.page
gui/baculum/protected/Web/Pages/StorageList.page
gui/baculum/protected/Web/Pages/VolumeList.page
gui/baculum/protected/Web/Pages/VolumeView.page
gui/baculum/protected/Web/Portlets/StatusSchedule.tpl
gui/baculum/themes/Baculum-v2/css/baculum.css

index 7095262b5f2f2a9b111a2f363750abd5fef4280b..d73b25170bd5e48986d3456bb9d576f0cc7205e4 100644 (file)
@@ -1044,6 +1044,12 @@ function handle_touch_move(e, callbacks) {
        touch_start_y = null;
 }
 
+function sort_natural(a, b) {
+       a = a.toString();
+       b = b.toString();
+       return a.localeCompare(b, undefined, {numeric: true});
+}
+
 $(function() {
        W3SideBar.init();
        set_sbbr_compatibility();
index ecb1c9c6ca9a771ed927ee3202a98b929c363ef8..eb3d238a1ebbeea9e8a8e3fb943e2ab7d4d1488b 100644 (file)
                                        <th><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="client_list_body">
-                       </tbody>
+                       <tbody id="client_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th>ClientId</th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Uname ]%></th>
+                                       <th><%[ AutoPrune ]%></th>
+                                       <th><%[ Job retention ]%></th>
+                                       <th><%[ File retention ]%></th>
+                                       <th><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -60,7 +71,7 @@ var oClientList = {
                                        data: 'jobretention',
                                        render: function (data, type, row) {
                                                var ret;
-                                               if (type == 'display') {
+                                               if (type == 'display' || type == 'filter') {
                                                        var time = Units.format_time_period(data);
                                                        ret = time.value + ' ' + time.format + ((time.value > 0) ? 's': '');
                                                } else {
@@ -73,7 +84,7 @@ var oClientList = {
                                        data: 'fileretention',
                                        render: function (data, type, row) {
                                                var ret;
-                                               if (type == 'display') {
+                                               if (type == 'display' || type == 'filter') {
                                                        var time = Units.format_time_period(data);
                                                        ret = time.value + ' ' + time.format + ((time.value > 0) ? 's': '');
                                                } else {
@@ -113,7 +124,35 @@ var oClientList = {
                                className: "dt-center",
                                targets: [ 1, 4, 5, 6, 7 ]
                        }],
-                       order: [2, 'asc']
+                       order: [2, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 5, 6]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 5 || column[0][0] == 6) {
+                                               column.data().unique().sort(sort_natural).each(function (d, j) {
+                                                       var time = Units.format_time_period(d);
+                                                       var time_f = time.value + ' ' + time.format + ((time.value > 0) ? 's': '');
+                                                       select.append('<option value="' + time_f + '">' + time_f + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       if (d) {
+                                                               select.append('<option value="' + d + '">' + d + '</option>');
+                                                       }
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 5319b9269e306d985d4c163ba98c8f61bd255770..6483620cedafd8ea026a382e9bf7bb2a98cdd53d 100644 (file)
@@ -526,8 +526,22 @@ oGraphicalClientStatus.init();
                                        <th class="w3-center"><%[ Action ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="job_for_client_list_body">
-                       </tbody>
+                       <tbody id="job_for_client_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ JobId ]%></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Type ]%></th>
+                                       <th class="w3-center"><%[ Level ]%></th>
+                                       <th class="w3-center"><%[ Start time ]%></th>
+                                       <th class="w3-center"><%[ End time ]%></th>
+                                       <th class="w3-center"><%[ Job status ]%></th>
+                                       <th class="w3-center"><%[ Size ]%></th>
+                                       <th class="w3-center"><%[ Files ]%></th>
+                                       <th class="w3-center"><%[ Action ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -639,7 +653,31 @@ var oJobForClientList = {
                                className: "dt-body-right",
                                targets: [ 8 ]
                        }],
-                       order: [1, 'desc']
+                       order: [1, 'desc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 7]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 7) {
+                                               column.data().unique().sort().each(function (d, j) {
+                                                       select.append('<option value="' + d + '" title="' + JobStatus.get_desc(d) + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 5a8a639e13f4c47325524c157f3eae2ff62509ee..31a579a082e8c5d823eb716db39dbf401c27d6e6 100644 (file)
                                </tr>
                        </thead>
                        <tbody id="fileset_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Director ]%></th>
+                                       <th class="w3-center"><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -75,7 +83,25 @@ var oFileSetList = {
                                className: "dt-center",
                                targets: [ 3 ]
                        }],
-                       order: [1, 'asc']
+                       order: [1, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([1, 2]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                               select.append('<option value="' + d + '">' + d + '</option>');
+                                       });
+                               });
+                       }
                });
        }
 };
index d276a51f47359f019b92225df9359c272d44d52d..5892818cb800936c655a5fec0a00b184171a6184 100644 (file)
                                        <th class="w3-center"><%[ Action ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="job_list_body">
-                       </tbody>
+                       <tbody id="job_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ JobId ]%></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Type ]%></th>
+                                       <th class="w3-center"><%[ Level ]%></th>
+                                       <th class="w3-center"><%[ Start time ]%></th>
+                                       <th class="w3-center"><%[ End time ]%></th>
+                                       <th class="w3-center"><%[ Job status ]%></th>
+                                       <th class="w3-center"><%[ Size ]%></th>
+                                       <th class="w3-center"><%[ Files ]%></th>
+                                       <th class="w3-center"><%[ Action ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
        <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
@@ -112,22 +126,11 @@ var oJobList = {
                                        data: 'jobid',
                                        render: function (data, type, row) {
                                                var container = document.createElement('DIV');
-
-                                               // job details button
-                                               var btn = document.createElement('BUTTON');
-                                               btn.className = 'w3-button w3-green w3-right';
-                                               btn.type = 'button';
-                                               var i = document.createElement('I');
-                                               i.className = 'fa fa-list-ul';
-                                               btn.title = '<%[ Details ]%>';
-                                               btn.appendChild(i);
-                                               btn.innerHTML += '&nbsp';
-                                               btn.setAttribute('onclick', "document.location.href = '/web/job/history/" + data + "/'");
-                                               container.appendChild(btn);
+                                               var btn, i;
                                                if (['C', 'R'].indexOf(row.jobstatus) === -1) {
                                                        // rerun job button
                                                        btn = document.createElement('BUTTON');
-                                                       btn.className = 'w3-button w3-green w3-right';
+                                                       btn.className = 'w3-button w3-green';
                                                        btn.type = 'button';
                                                        i = document.createElement('I');
                                                        btn.title = '<%[ Run job again ]%>';
@@ -137,7 +140,7 @@ var oJobList = {
                                                } else {
                                                        // cancel job button
                                                        btn = document.createElement('BUTTON');
-                                                       btn.className = 'w3-button w3-green w3-right';
+                                                       btn.className = 'w3-button w3-green';
                                                        btn.type = 'button';
                                                        i = document.createElement('I');
                                                        btn.title = '<%[ Cancel job ]%>';
@@ -146,6 +149,20 @@ var oJobList = {
                                                        btn.setAttribute('onclick', 'cancel_job_callback.setCallbackParameter(' + data + '); cancel_job_callback.dispatch();');
                                                }
                                                container.appendChild(btn);
+                                               var space = document.createTextNode(' ');
+                                               container.appendChild(space);
+
+                                               // job details button
+                                               btn = document.createElement('BUTTON');
+                                               btn.className = 'w3-button w3-green';
+                                               btn.type = 'button';
+                                               i = document.createElement('I');
+                                               i.className = 'fa fa-list-ul';
+                                               btn.title = '<%[ Details ]%>';
+                                               btn.appendChild(i);
+                                               btn.innerHTML += '&nbsp';
+                                               btn.setAttribute('onclick', "document.location.href = '/web/job/history/" + data + "/'");
+                                               container.appendChild(btn);
                                                return container.outerHTML;
                                        }
                                }
@@ -173,7 +190,31 @@ var oJobList = {
                                className: "dt-body-right",
                                targets: [ 8 ]
                        }],
-                       order: [1, 'desc']
+                       order: [1, 'desc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 7]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 7) {
+                                               column.data().unique().sort().each(function (d, j) {
+                                                       select.append('<option value="' + d + '" title="' + JobStatus.get_desc(d) + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 2ee6826083e11dab5a0ef6ccd123b4fce00a67f2..75fac8cfe71fbc8509950c9fea5393a33522d2be 100644 (file)
                                        <th><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="job_history_list_body">
-                       </tbody>
+                       <tbody id="job_history_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Director ]%></th>
+                                       <th><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
        <com:Application.Web.Portlets.RunJob ID="RunJobModal" />
@@ -85,7 +92,25 @@ var oJobHistoryList = {
                                className: "dt-center",
                                targets: [ 3 ]
                        }],
-                       order: [1, 'asc']
+                       order: [1, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([1, 2]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       column.data().unique().sort().each(function (d, j) {
+                                               select.append('<option value="' + d + '">' + d + '</option>');
+                                       });
+                               });
+                       }
                });
        }
 };
index df44730cc172739ce2b43d8f2b52c043506f49da..1bdc394f45e75c058492aafdce4fa1a8ea37c800 100644 (file)
                                        <th class="w3-center"><%[ Action ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="job_history_list_body">
-                       </tbody>
+                       <tbody id="job_history_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ JobId ]%></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Type ]%></th>
+                                       <th class="w3-center"><%[ Level ]%></th>
+                                       <th class="w3-center"><%[ Start time ]%></th>
+                                       <th class="w3-center"><%[ End time ]%></th>
+                                       <th class="w3-center"><%[ Job status ]%></th>
+                                       <th class="w3-center"><%[ Size ]%></th>
+                                       <th class="w3-center"><%[ Files ]%></th>
+                                       <th class="w3-center"><%[ Action ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
 <script type="text/javascript">
 var oJobHistoryList = {
@@ -204,7 +218,31 @@ var oJobHistoryList = {
                                className: "dt-body-right",
                                targets: [ 8 ]
                        }],
-                       order: [1, 'desc']
+                       order: [1, 'desc'],
+                       initComplete: function () {
+                               this.api().columns([3, 4, 7]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 7) {
+                                               column.data().unique().sort().each(function (d, j) {
+                                                       select.append('<option value="' + d + '" title="' + JobStatus.get_desc(d) + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 5e5fb73d507083a2f1772ba2762b8db963958c36..3c17b18aa2888d9bcbd9d696eacbff6735d51f4e 100644 (file)
                                        <th><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="pool_list_body">
-                       </tbody>
+                       <tbody id="pool_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th>PoolId</th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ No. vols ]%></th>
+                                       <th><%[ Max. vols ]%></th>
+                                       <th><%[ Vol. retention ]%></th>
+                                       <th><%[ AutoPrune ]%></th>
+                                       <th><%[ Recycle ]%></th>
+                                       <th><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -60,7 +72,7 @@ var oPoolList = {
                                        data: 'volretention',
                                        render: function (data, type, row) {
                                                var ret;
-                                               if (type == 'display') {
+                                               if (type == 'display' || type == 'filter') {
                                                        var time = Units.format_time_period(data);
                                                        ret = time.value + ' ' + time.format + ((time.value > 0) ? 's': '');
                                                } else {
@@ -112,7 +124,37 @@ var oPoolList = {
                                className: "dt-center",
                                targets: [ 1, 3, 4, 6, 7, 8 ]
                        }],
-                       order: [2, 'asc']
+                       order: [2, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 5, 6, 7]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if ([3, 4].indexOf(column[0][0]) !== -1) {
+                                               column.cells('', column[0]).render('display').unique().sort(sort_natural).each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       } else if (column[0][0] == 5) {
+                                               column.data().unique().sort(sort_natural).each(function (d, j) {
+                                                       var time = Units.format_time_period(d);
+                                                       var time_f = time.value + ' ' + time.format + ((time.value > 0) ? 's': '');
+                                                       select.append('<option value="' + time_f + '">' + time_f + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index a68fb04c457a56b25d4c0b6f28d3047c854a0d75..bd63924816f4656ca761579cf9e62fdf12239b1f 100644 (file)
                                        <th><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="volume_list_body">
-                       </tbody>
+                       <tbody id="volume_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th>MediaId</th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Slot ]%></th>
+                                       <th>InChanger</th>
+                                       <th><%[ Vol. status ]%></th>
+                                       <th>MediaType</th>
+                                       <th><%[ Last written ]%></th>
+                                       <th><%[ Vol. jobs ]%></th>
+                                       <th><%[ Vol. bytes ]%></th>
+                                       <th><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
        <div class="w3-container tab_item" id="pool_config" style="display: none">
@@ -187,7 +201,7 @@ var oVolumeList = {
                                        data: 'volbytes',
                                        render: function (data, type, row) {
                                                var s;
-                                               if (type == 'display') {
+                                               if (type == 'display' || type == 'filter') {
                                                        s = Units.get_formatted_size(data)
                                                } else {
                                                        s = data;
@@ -230,7 +244,31 @@ var oVolumeList = {
                                className: "dt-body-right",
                                targets: [ 9 ]
                        }],
-                       order: [3, 'asc']
+                       order: [3, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 5, 6]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 3) {
+                                               column.cells('', column[0]).render('display').unique().sort(sort_natural).each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 37d09bc762da0e74c5f21fb34a2bb12dfc464426..80e3122da6a2e52b5d91c417eb7a570b323fff73 100644 (file)
                                <p><%[ Backup for restore: ]%></p>
                                <table id="job_to_restore_list" style="width: 100%">
                                        <thead>
-                                               <th></th>
-                                               <th>JobId</th>
-                                               <th><%[ Job name ]%></th>
-                                               <th><%[ Type ]%></th>
-                                               <th><%[ Level ]%></th>
-                                               <th><%[ Job status ]%></th>
-                                               <th><%[ Size ]%></th>
-                                               <th><%[ Files ]%></th>
-                                               <th><%[ End time ]%></th>
-                                               <th><%[ Select ]%></th>
+                                               <tr>
+                                                       <th></th>
+                                                       <th>JobId</th>
+                                                       <th><%[ Job name ]%></th>
+                                                       <th><%[ Type ]%></th>
+                                                       <th><%[ Level ]%></th>
+                                                       <th><%[ Job status ]%></th>
+                                                       <th><%[ Size ]%></th>
+                                                       <th><%[ Files ]%></th>
+                                                       <th><%[ End time ]%></th>
+                                                       <th><%[ Select ]%></th>
+                                               </tr>
                                        </thead>
-                                       <tbody id="job_to_restore_list_body">
-                                       </tbody>
+                                       <tbody id="job_to_restore_list_body"></tbody>
+                                       <tfoot>
+                                               <tr>
+                                                       <th></th>
+                                                       <th>JobId</th>
+                                                       <th><%[ Job name ]%></th>
+                                                       <th><%[ Type ]%></th>
+                                                       <th><%[ Level ]%></th>
+                                                       <th><%[ Job status ]%></th>
+                                                       <th><%[ Size ]%></th>
+                                                       <th><%[ Files ]%></th>
+                                                       <th><%[ End time ]%></th>
+                                                       <th><%[ Select ]%></th>
+                                               </tr>
+                                       </tfoot>
                                </table>
 <script type="text/javascript">
 var oJobsToRestoreList = {
@@ -210,13 +225,19 @@ var oJobsToRestoreList = {
                                        data: 'name',
                                        responsivePriority: 3,
                                        render: function(data, type, row) {
-                                               var i = document.createElement('I');
-                                               i.className = 'fa fa-external-link-alt fa-xs';
-                                               var a = document.createElement('A');
-                                               a.href = '/web/job/' + encodeURIComponent(data) + '/';
-                                               a.appendChild(i);
-                                               a.title = '<%[ Go to job %job ]%>'.replace('%job', data);
-                                               return (data + ' ' + a.outerHTML);
+                                               var ret;
+                                               if (type == 'display') {
+                                                       var i = document.createElement('I');
+                                                       i.className = 'fa fa-external-link-alt fa-xs';
+                                                       var a = document.createElement('A');
+                                                       a.href = '/web/job/' + encodeURIComponent(data) + '/';
+                                                       a.appendChild(i);
+                                                       a.title = '<%[ Go to job %job ]%>'.replace('%job', data);
+                                                       ret = (data + ' ' + a.outerHTML);
+                                               } else {
+                                                       ret = data;
+                                               }
+                                               return ret;
                                        }
                                },
                                {
@@ -304,7 +325,31 @@ var oJobsToRestoreList = {
                                className: "dt-body-right",
                                targets: [ 6 ]
                        }],
-                       order: [1, 'desc']
+                       order: [1, 'desc'],
+                       initComplete: function () {
+                               this.api().columns([2, 4, 5]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] === 2 || column[0][0] == 5) {
+                                               column.data().unique().sort().each(function (d, j) {
+                                                       select.append('<option value="' + d + '" title="' + JobStatus.get_desc(d) + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index f5f8975c69b8632f259d34362d3a6522c336e919..f6a3a537364cb0e68db903d0c1ae9d4ea5749f27 100644 (file)
                                        <th class="w3-center"><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="storage_list_body">
-                       </tbody>
+                       <tbody id="storage_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th>StorageId</th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Autochanger ]%></th>
+                                       <th class="w3-center"><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -86,7 +94,25 @@ var oStorageList = {
                                className: "dt-center",
                                targets: [ 1, 3, 4 ]
                        }],
-                       order: [1, 'asc']
+                       order: [1, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                               select.append('<option value="' + d + '">' + d + '</option>');
+                                       });
+                               });
+                       }
                });
        }
 };
index eb1a05608777345633619b80b0a23ad37d856027..72ba97ac2021344bbe848e8ce66e70f62b0888a6 100644 (file)
                                        <th><%[ Actions ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="pool_list_body">
-                       </tbody>
+                       <tbody id="pool_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th>MediaId</th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Slot ]%></th>
+                                       <th>InChanger</th>
+                                       <th><%[ Vol. status ]%></th>
+                                       <th>MediaType</th>
+                                       <th><%[ Last written ]%></th>
+                                       <th><%[ Vol. bytes ]%></th>
+                                       <th><%[ Actions ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
 <script type="text/javascript">
@@ -111,7 +124,31 @@ var oVolumeList = {
                                className: "dt-body-right",
                                targets: [ 8 ]
                        }],
-                       order: [3, 'asc']
+                       order: [3, 'asc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 5, 6]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 3) {
+                                               column.cells('', column[0]).render('display').unique().sort(sort_natural).each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 8fe0b5e8af3339d177da4a85659711e2a7d20ff4..ab57219a6a63fa0244df20f34673c253183fec87 100644 (file)
                                        <th class="w3-center"><%[ Action ]%></th>
                                </tr>
                        </thead>
-                       <tbody id="jobs_on_volume_list_body">
-                       </tbody>
+                       <tbody id="jobs_on_volume_list_body"></tbody>
+                       <tfoot>
+                               <tr>
+                                       <th></th>
+                                       <th><%[ JobId ]%></th>
+                                       <th><%[ Name ]%></th>
+                                       <th><%[ Type ]%></th>
+                                       <th class="w3-center"><%[ Level ]%></th>
+                                       <th class="w3-center"><%[ Start time ]%></th>
+                                       <th class="w3-center"><%[ End time ]%></th>
+                                       <th class="w3-center"><%[ Job status ]%></th>
+                                       <th class="w3-center"><%[ Size ]%></th>
+                                       <th class="w3-center"><%[ Files ]%></th>
+                                       <th class="w3-center"><%[ Action ]%></th>
+                               </tr>
+                       </tfoot>
                </table>
        </div>
        <div class="w3-container tab_item" id="volume_config" style="display: none">
@@ -447,7 +461,31 @@ var oJobsOnVolumeList = {
                                className: "dt-body-right",
                                targets: [ 8 ]
                        }],
-                       order: [1, 'desc']
+                       order: [1, 'desc'],
+                       initComplete: function () {
+                               this.api().columns([2, 3, 4, 7]).every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 7) {
+                                               column.data().unique().sort().each(function (d, j) {
+                                                       select.append('<option value="' + d + '" title="' + JobStatus.get_desc(d) + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index f4e2c68225da55fc67c532d84d23d2a86634f0fb..80a6df24befb89d2bea2beb22ded36daadb98c34 100644 (file)
                                <th><%[ Schedule ]%></th>
                        </tr>
                </thead>
-               <tbody id="schedule_list_body">
-               </tbody>
+               <tbody id="schedule_list_body"></tbody>
+               <tfoot>
+                       <tr>
+                               <th></th>
+                               <th><%[ Level ]%></th>
+                               <th><%[ Type ]%></th>
+                               <th><%[ Priority ]%></th>
+                               <th><%[ Scheduled ]%></th>
+                               <%=empty($this->Job) ? '<th>' . Prado::localize('Job name') . '</th>': ''%>
+                               <th><%[ Client ]%></th>
+                               <th><%[ FileSet ]%></th>
+                               <th><%[ Schedule ]%></th>
+                       </tr>
+               </tfoot>
        </table>
 </div>
 <script type="text/javascript">
@@ -191,7 +203,31 @@ var oJobScheduleList = {
                                responsivePriority: 5,
                                targets: 2
                        }],
-                       order: [4, 'asc']
+                       order: [4, 'asc'],
+                       initComplete: function () {
+                               this.api().columns().every(function () {
+                                       var column = this;
+                                       var select = $('<select><option value=""></option></select>')
+                                       .appendTo($(column.footer()).empty())
+                                       .on('change', function () {
+                                               var val = $.fn.dataTable.util.escapeRegex(
+                                                       $(this).val()
+                                               );
+                                               column
+                                               .search(val ? '^' + val + '$' : '', true, false)
+                                               .draw();
+                                       });
+                                       if (column[0][0] == 3) {
+                                               column.cells('', column[0]).render('display').unique().sort(sort_natural).each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       } else {
+                                               column.cells('', column[0]).render('display').unique().sort().each(function(d, j) {
+                                                       select.append('<option value="' + d + '">' + d + '</option>');
+                                               });
+                                       }
+                               });
+                       }
                });
        }
 };
index 7376fdd2d7aa1e4b224fde93065f9284cc3d4213..496d14abd59d9e05a0fcf131527eed67d2af8f09 100644 (file)
@@ -23,6 +23,10 @@ th, table.dataTable thead td {
        border-bottom: none !important;
 }
 
+table.dataTable tbody td {
+       vertical-align: middle;
+}
+
 table.dataTable.no-footer {
        border-bottom: none !important;
 }
@@ -48,11 +52,12 @@ table.dataTable.no-footer {
 }
 
 th.action_col, td.action_col {
-       width: 90px !important;
+       width: 110px !important;
 }
 
 td.action_col button {
-       margin-right: 3px;
+       display: inline-block;
+       margin: 0 auto;
 }
 
 .hide {