templates/index.html aktualisiert

This commit is contained in:
2026-03-04 12:13:07 +00:00
parent be2ebb3ecb
commit 42ddb3dcf4

View File

@@ -93,11 +93,35 @@
// Initialisiere GridStack // Initialisiere GridStack
var grid = GridStack.init({ var grid = GridStack.init({
cellHeight: 70, cellHeight: 70,
acceptWidgets: true, margin: 5,
dragIn: '.newWidget',
resizable: { handles: 'se, sw, ne, nw, e, w, s, n' } resizable: { handles: 'se, sw, ne, nw, e, w, s, n' }
}); });
// FUNKTION: Layout laden
function loadLayout() {
let serialization = localStorage.getItem('grid-layout');
if (serialization) {
let layout = JSON.parse(serialization);
grid.load(layout);
}
}
// FUNKTION: Layout speichern
function saveLayout() {
let serialization = grid.save();
localStorage.setItem('grid-layout', JSON.stringify(serialization));
}
// Events: Speichere bei jeder Änderung
grid.on('dragstop resizestop', function(event, el) {
saveLayout();
// Falls du das Terminal-Plugin 'fit' nutzt, hier triggern:
// fitAddon.fit();
});
// Beim Start das gespeicherte Layout laden
loadLayout();
// Xterm.js Setup // Xterm.js Setup
const term = new Terminal({ theme: { background: '#000' }, fontSize: 13, cursorBlink: true }); const term = new Terminal({ theme: { background: '#000' }, fontSize: 13, cursorBlink: true });
term.open(document.getElementById('terminal')); term.open(document.getElementById('terminal'));