]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Tweak add button to clear time range filter
authorMarcin Haba <marcin.haba@bacula.pl>
Mon, 15 Nov 2021 03:09:41 +0000 (04:09 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:27 +0000 (09:03 +0100)
gui/baculum/protected/Web/Pages/JobHistoryList.page

index 420d4c507deafdf53e9656b4d2d842ed0c5bd4bb..257f5c75f63a680b1639a4a46237f69b461aac7d 100644 (file)
                                Style="width: 100px"
                                Attributes.placeholder="<%[ To ]%>"
                        />
+                       &nbsp;<i class="fas fa-times" id="table_adv_filters_clear" style="cursor: pointer"></i>
                </div>
        </div>
 <script type="text/javascript">
@@ -223,6 +224,7 @@ var oJobHistoryList = {
                table_adv_filters_value_type: 'table_adv_filters_value_type',
                table_adv_filters_from : '<%=$this->TableAdvFiltersDateFrom->ClientID%>',
                table_adv_filters_to: '<%=$this->TableAdvFiltersDateTo->ClientID%>',
+               table_adv_filters_clear: 'table_adv_filters_clear',
                date_picker: 'TDatePicker_default'
        },
        data: [],
@@ -644,6 +646,11 @@ var oJobHistoryList = {
                        this.table.columns().search('').draw();
                        this.set_job_filter();
                }.bind(this));
+               var clear_btn = document.getElementById(this.ids.table_adv_filters_clear);
+               clear_btn.addEventListener('click', function() {
+                       from.value = to.value = '';
+                       this.table.columns().search('').draw();
+               }.bind(this));
                container.appendChild(body);
                body.style.display = 'block';
        }