Skip to content

Commit

Permalink
added a link on profile list page to search without app filter
Browse files Browse the repository at this point in the history
  • Loading branch information
shagtv committed Feb 28, 2019
1 parent 8a5bc71 commit 11f37f3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

There are next changes:

## 1.1.7

There are next changes:

- added a link on profile list page to search without the app filter

## 1.1.6

There are next changes:
Expand Down
23 changes: 20 additions & 3 deletions src/templates/profile_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<tr>
<th class="sorter-false filter-false" style="width: 100px;">#</th>
<th class="filter-select filter-onlyAvail filter-select-sort-desc sorter-text" data-value="<?= $data['date'] ?>">last snapshot</th>
<th class="sorter-text" data-value="<?= $data['label'] ?>">label</th>
<th class="sorter-text filter-label" data-value="<?= $data['label'] ?>">label</th>
<th class="filter-select filter-onlyAvail sorter-text" data-value="<?= $data['app'] ?>">app</th>
<th class="filter-false">calls count
<span data-toggle="tooltip" title="Calls count recorded during specified day" class="glyphicon glyphicon-question-sign"></span>
Expand Down Expand Up @@ -78,6 +78,10 @@
</tbody>
</table>

<div id="empty-result-link" style="display: none;">
Empty result. Try to <a href="">search</a> without the app filter.
</div>

<div id="pager" class="pager">
<form>
<span class="first glyphicon glyphicon-step-backward" title="First page" ></span>
Expand Down Expand Up @@ -253,12 +257,25 @@ function (resp) {
savePages : true,
updateArrows: true,
output: '{startRow:input} – {endRow} / {totalRows} rows',
});
}).bind('filterEnd', function() {
let found = $('.sortable tbody tr:visible').length;
let app = "<?= $data['app'] ?>";
let label = $('.tablesorter-filter[data-column=2]').val();

if (found === 0 && app !== "" && label !== "") {
$('#empty-result-link a').attr("href", "/profiler/result-list.phtml?label=" + label + "&app=");
$('#empty-result-link').show();
} else {
$('#empty-result-link').hide();
}
});

$('[data-toggle="tooltip"]').tooltip();

$('select[data-column=3]').unbind().change(function (event) {
event.stopPropagation();
location.replace('?app=' + $(this).val());
let label = $('.tablesorter-filter[data-column=2]').val();
location.replace('?app=' + $(this).val() + '&label=' + label);
});

$('.aggregate-snapshot-button').on('click', function () {
Expand Down

0 comments on commit 11f37f3

Please sign in to comment.