revert 6a0dd75f10
revert Enhance debugging and logging in settings and toast rendering; add JSON parsing output and improve toast container handling
This commit is contained in:
parent
b876f1f469
commit
e8483c859b
2 changed files with 4 additions and 18 deletions
|
@ -442,9 +442,6 @@ def settings():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
state = json.loads(form['formState'])
|
state = json.loads(form['formState'])
|
||||||
import pprint
|
|
||||||
print("🧠 Parsed state:")
|
|
||||||
pprint.pprint(state, indent=2, width=120)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
flash("Invalid form state submitted. JSON decode failed.", "danger")
|
flash("Invalid form state submitted. JSON decode failed.", "danger")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
|
@ -1,26 +1,15 @@
|
||||||
const ToastConfig = {
|
function renderToast({ message, type = 'info', timeout = 3000 }) {
|
||||||
containerId: 'toast-container',
|
|
||||||
positionClasses: 'toast-container position-fixed bottom-0 end-0 p-3',
|
|
||||||
defaultType: 'info',
|
|
||||||
defaultTimeout: 3000
|
|
||||||
};
|
|
||||||
|
|
||||||
function updateToastConfig(overrides = {}) {
|
|
||||||
Object.assign(ToastConfig, overrides);
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderToast({ message, type = ToastConfig.defaultType, timeout = ToastConfig.defaultTimeout }) {
|
|
||||||
if (!message) {
|
if (!message) {
|
||||||
console.warn('renderToast was called without a message.');
|
console.warn('renderToast was called without a message.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auto-create the toast container if it doesn't exist
|
// Auto-create the toast container if it doesn't exist
|
||||||
let container = document.getElementById(ToastConfig.containerId);
|
let container = document.getElementById('toast-container');
|
||||||
if (!container) {
|
if (!container) {
|
||||||
container = document.createElement('div');
|
container = document.createElement('div');
|
||||||
container.id = ToastConfig.containerId;
|
container.id = 'toast-container';
|
||||||
container.className = ToastConfig.positionClasses;
|
container.className = 'toast-container position-fixed bottom-0 end-0 p-3';
|
||||||
document.body.appendChild(container);
|
document.body.appendChild(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue