0
0
Fork 0
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:
Pēteris Caune 2024-09-30 10:29:30 +03:00
parent 0b7b77c8d7
commit d77b96a40f
No known key found for this signature in database
GPG key ID: E28D7679E9A9EDE2
2 changed files with 13 additions and 2 deletions
static/js
templates/front

View file

@ -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/";

View file

@ -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>