Enhance debugging and logging in settings and toast rendering; add JSON parsing output and improve toast container handling
This commit is contained in:
parent
398800b681
commit
6a0dd75f10
3 changed files with 19 additions and 4 deletions
|
@ -442,6 +442,9 @@ def settings():
|
|||
|
||||
try:
|
||||
state = json.loads(form['formState'])
|
||||
import pprint
|
||||
print("🧠 Parsed state:")
|
||||
pprint.pprint(state, indent=2, width=120)
|
||||
except Exception:
|
||||
flash("Invalid form state submitted. JSON decode failed.", "danger")
|
||||
traceback.print_exc()
|
||||
|
|
|
@ -1,15 +1,26 @@
|
|||
function renderToast({ message, type = 'info', timeout = 3000 }) {
|
||||
const ToastConfig = {
|
||||
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) {
|
||||
console.warn('renderToast was called without a message.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Auto-create the toast container if it doesn't exist
|
||||
let container = document.getElementById('toast-container');
|
||||
let container = document.getElementById(ToastConfig.containerId);
|
||||
if (!container) {
|
||||
container = document.createElement('div');
|
||||
container.id = 'toast-container';
|
||||
container.className = 'toast-container position-fixed bottom-0 end-0 p-3';
|
||||
container.id = ToastConfig.containerId;
|
||||
container.className = ToastConfig.positionClasses;
|
||||
document.body.appendChild(container);
|
||||
}
|
||||
|
||||
|
|
|
@ -164,6 +164,7 @@
|
|||
const roomOptions = Array.from(document.getElementById('room-list').options);
|
||||
const rooms = roomOptions.map(opt => {
|
||||
const data = opt.dataset;
|
||||
console.log('Room:', opt.value, opt.textContent.trim(), opt.dataset.sectionId, opt.dataset.functionId);
|
||||
|
||||
return {
|
||||
id: opt.value || undefined,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue