summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-16 17:29:14 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-16 17:29:14 +0200
commitf03077edb70e939bfb447fea4cf46340f736b657 (patch)
treeb59e2d4eb5748d13db4123396446a6f087035475 /ogcp/templates
parent7296372e9c7ff7c354c86c00fa4fbcfbd71df355 (diff)
js: add ogStorage to prevent localStorage key collission
Define ogStorage class to manage the localStorage operations. The new keys are constructed with the following structure: "group-context-id" Where group is either "show" for the collapsed items in the sidebar, or "check" for the selected checkboxes of the sidebar. Add sotrage versioning to delete obsolete localStorage when a new design for the storage is included in ogCP.
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/base.html2
-rw-r--r--ogcp/templates/images.html2
-rw-r--r--ogcp/templates/macros.html2
-rw-r--r--ogcp/templates/repos.html2
4 files changed, 4 insertions, 4 deletions
diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html
index 80a5f7a..5aa84c6 100644
--- a/ogcp/templates/base.html
+++ b/ogcp/templates/base.html
@@ -111,7 +111,7 @@
<!-- ChartJS -->
<script src="{{ url_for('static', filename='AdminLTE/plugins/chart.js/Chart.min.js') }}"></script>
- <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=22"></script>
+ <script src="{{ url_for('static', filename='js/ogcp.js') }}?v=24"></script>
<script>
// error messages
diff --git a/ogcp/templates/images.html b/ogcp/templates/images.html
index 7a16a0d..06d614a 100644
--- a/ogcp/templates/images.html
+++ b/ogcp/templates/images.html
@@ -14,7 +14,7 @@
// in the scope
document.addEventListener('readystatechange', () => {
if (document.readyState === 'complete') {
- keepTreeState('#servers');
+ keepTreeState('#servers', 'images');
keepSelectedClients('images');
checkOnChange('image-server');
}
diff --git a/ogcp/templates/macros.html b/ogcp/templates/macros.html
index 16b3017..790da6d 100644
--- a/ogcp/templates/macros.html
+++ b/ogcp/templates/macros.html
@@ -10,7 +10,7 @@
if (document.readyState === 'complete') {
showSelectedClientsOnEvents();
updateScopeState();
- keepTreeState('#scopes');
+ keepTreeState('#scopes', 'scopes');
let context = {{ selection_mode | tojson | safe }};
{% if selection_mode == 'commands' %}
configureCommandCheckboxes(context);
diff --git a/ogcp/templates/repos.html b/ogcp/templates/repos.html
index 2f5fe1b..7983930 100644
--- a/ogcp/templates/repos.html
+++ b/ogcp/templates/repos.html
@@ -43,7 +43,7 @@
// in the scope
document.addEventListener('readystatechange', () => {
if (document.readyState === 'complete') {
- keepTreeState('#repos-list')
+ keepTreeState('#repos-list', 'repos');
keepSelectedClients('repos');
checkOnChange('repos-server');
}