mirror of
https://github.com/healthchecks/healthchecks.git
synced 2025-04-07 14:15:34 +00:00
Update the uuid/slug switching links to not lose currently selected tags
This commit is contained in:
parent
0b7b77c8d7
commit
d77b96a40f
2 changed files with 13 additions and 2 deletions
|
@ -140,6 +140,17 @@ $(function () {
|
|||
// User changes the search string: apply filters
|
||||
$("#search").keyup(applyFilters);
|
||||
|
||||
function switchUrlFormat(format) {
|
||||
var url = new URL(window.location.href);
|
||||
url.searchParams.delete("urls");
|
||||
url.searchParams.append("urls", format);
|
||||
window.location.href = url.toString();
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#to-uuid").click(e => switchUrlFormat("uuid"));
|
||||
$("#to-slug").click(e => switchUrlFormat("slug"));
|
||||
|
||||
$(".show-log").click(function(e) {
|
||||
var code = $(this).closest("tr.checks-row").attr("id");
|
||||
var url = base + "/checks/" + code + "/details/";
|
||||
|
|
|
@ -27,8 +27,8 @@
|
|||
<span class="visible-md-inline">{{ project.show_slugs|yesno:"Key/Slug,UUID" }}</span>
|
||||
{% if rw %}
|
||||
<small id="url-style-switcher">
|
||||
<a href="?urls=uuid" {% if not project.show_slugs %}class="active"{% endif %}>uuid</a>
|
||||
<a href="?urls=slug" {% if project.show_slugs %}class="active"{% endif %}>slug</a>
|
||||
<a id="to-uuid" href="?urls=uuid" {% if not project.show_slugs %}class="active"{% endif %}>uuid</a>
|
||||
<a id="to-slug" href="?urls=slug" {% if project.show_slugs %}class="active"{% endif %}>slug</a>
|
||||
</small>
|
||||
{% endif %}
|
||||
</th>
|
||||
|
|
Loading…
Add table
Reference in a new issue