Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Select properly the filter elements when page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Jan 18, 2022
1 parent d40663f commit e3f72c7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 29 deletions.
4 changes: 2 additions & 2 deletions web/templates/blocks/health_filter.html.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ define "health_filter" }}
<select name="health" id="health" class="selectpicker" multiple data-selected-text-format="count > 3"
<select name="health" class="selectpicker" multiple data-selected-text-format="count > 3"
data-act/healions-box="true" title="Health status...">
<option data-content="<span class='badge badge-success'>Passing</span>" value="passing">Passing</option>
<option data-content="<span class='badge badge-warning'>Warning</span>" value="warning">Warning</option>
<option data-content="<span class='badge badge-danger'>Critical</span>" value="critical">Critical</option>
</select>
{{- end }}
{{- end }}
17 changes: 7 additions & 10 deletions web/templates/clusters.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@
<div class="horizontal-container">
<script>
$(document).ready(function () {
{{- range $Key, $Value := .AppliedFilters }}
$("#{{ $Key }}").selectpicker("val", {{ $Value }});
{{- end }}
$('#clean').click(function () {
$('.selectpicker').selectpicker("deselectAll")
});
{{- range $Key, $Value := .AppliedFilters }}
$("[name='{{ $Key }}']").selectpicker("val", {{ $Value }});
{{- end }}
});
</script>
{{ template "health_filter" }}
<select name="name" id="name_filter" class="selectpicker" multiple
<select name="name" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="Cluster name">
{{- range .ClustersTable }}
Expand All @@ -38,20 +35,20 @@
{{- end }}
{{- end}}
</select>
<select name="sids" id="sid_filter" class="selectpicker" multiple
<select name="sids" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true" title="SID">
{{- range .FilterSIDs }}
<option value="{{ . }}">{{ . }}</option>
{{- end }}
</select>
<select name="cluster_type" id="cluster_type_filter" class="selectpicker" multiple
<select name="cluster_type" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="Cluster type">
{{- range .FilterClusterTypes }}
<option value="{{ . }}">{{ . }}</option>
{{- end}}
</select>
<select name="tags" id="tags_filter" class="selectpicker" multiple
<select name="tags" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="Tags">
{{- range .FilterTags }}
Expand Down
15 changes: 6 additions & 9 deletions web/templates/hosts.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@
<div class="horizontal-container">
<script>
$(document).ready(function () {
{{- range $Key, $Value := .AppliedFilters }}
$("#{{ $Key }}").selectpicker("val", {{ $Value }});
{{- end }}
$('#clean').click(function () {
$('.selectpicker').selectpicker("deselectAll")
});
{{- range $Key, $Value := .AppliedFilters }}
$("[name='{{ $Key }}']").selectpicker("val", {{ $Value }});
{{- end }}
});
</script>
{{ template "health_filter" }}
<select name="sids" id="trento-sap-systems" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
<select name="sids" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="SAP system...">
{{- range .FilterSIDs }}
<option value="{{ . }}">{{ . }}</option>
{{- end }}
</select>
<select name="tags" id="tags_filter" class="selectpicker" multiple
<select name="tags" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="Tags...">
{{- range .FilterTags }}
Expand Down
13 changes: 5 additions & 8 deletions web/templates/sap_systems.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,19 @@
<div class="horizontal-container">
<script>
$(document).ready(function () {
{{- range $Key, $Value := .AppliedFilters }}
$("#{{ $Key }}").selectpicker("val", {{ $Value }});
{{- end }}
$('#clean').click(function () {
$('.selectpicker').selectpicker("deselectAll")
});
{{- range $Key, $Value := .AppliedFilters }}
$("[name='{{ $Key }}']").selectpicker("val", {{ $Value }});
{{- end }}
});
</script>
{{/* {{ template "health_filter" }} */}}
<select name="sids" id="sids" class="selectpicker" multiple
<select name="sids" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true" title="SID">
{{- range .FilterSIDs }}
<option value="{{ . }}">{{ . }}</option>
{{- end }}
</select>
<select name="tags" id="tags_filter" class="selectpicker" multiple
<select name="tags" class="selectpicker" multiple
data-selected-text-format="count > 3" data-actions-box="true" data-live-search="true"
title="Tags">
{{- range .FilterTags }}
Expand Down

0 comments on commit e3f72c7

Please sign in to comment.