Skip to content

Commit d30120f

Browse files
authored
fix: config save cookie (#297)
* fix config save cookie * remove debugging
1 parent 3944336 commit d30120f

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

web/static/config/edit.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@
143143
axios.post('/api/config/layers/' + layer, value)
144144
.then(response => {
145145
// Set cookie named 'message' with the value 'Data saved successfully'
146-
document.cookie = 'message=The layer "' + layer + '" saved successfully.; path=/;';
147-
146+
document.cookie = 'message=The layer "' + layer + '" saved successfully. Please restart all nodes using the layer "' + layer + '".; path=/;';
148147
window.location.href = '/pages/config/list/';
149148
})
150149
.catch(error => {

web/static/pages/config/list/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<div class="row">
1313
<div class="col-md-3"></div>
1414
<div class="col-md-3 pt-4" style="width: 70%">
15-
<h2 style="text-wrap: nowrap">Configuration Editor</h2>
16-
<h4 style="text-wrap: nowrap">Click on a layer to edit its configuration</h4>
15+
<h2 style="white-space: nowrap">Configuration Editor</h2>
16+
<h4 style="white-space: nowrap">Click on a layer to edit its configuration</h4>
1717
<config-list></config-list>
1818
</div>
1919
<div class="col-md-3"></div>

web/static/ux/curio-ux.mjs

-16
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ class CurioUX extends LitElement {
9696

9797
// how Bootstrap & DataTables expect dark mode declared.
9898
document.documentElement.classList.add('dark');
99-
100-
this.messsage = this.getCookieMessage();
10199

102100
var s = document.body.style;
103101
s.padding = 0;
@@ -210,20 +208,6 @@ class CurioUX extends LitElement {
210208
`;
211209
}
212210

213-
getCookieMessage() {
214-
const name = 'message';
215-
const cookies = document.cookie.split(';');
216-
for (let i = 0; i < cookies.length; i++) {
217-
const cookie = cookies[i].trim();
218-
if (cookie.startsWith(name + '=')) {
219-
var val = cookie.substring(name.length + 1);
220-
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
221-
return val;
222-
}
223-
}
224-
return null;
225-
}
226-
227211
};
228212

229213
customElements.define('curio-ux', CurioUX);

0 commit comments

Comments
 (0)