Spaces:
Paused
Paused
Update templates/index.html
Browse files15 unmodified lines16171819202122232425262728293 unmodified lines333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271284 unmodified lines1331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482491 unmodified line2512522532542552562572582592602612622632642652662672682691 unmodified line27127227327427527627715 unmodified lines<body><div class="app-container"><!-- Sidebar Navigation --><nav class="sidebar"><div class="sidebar-header"><i class="fas fa-database"></i><span>Migrator</span></div><ul class="sidebar-nav"><li><a href="#" class="nav-link active" data-target="dashboard"><i class="fas fa-tachometer-alt"></i><span>Dashboard</span></a></li><li><a href="#" class="nav-link" data-target="connections"><i class="fas fa-plug"></i><span>Connections</span></a></li><li><a href="#" class="nav-link" data-target="dump"><i class="fas fa-download"></i><span>Dump</span></a></li><li><a href="#" class="nav-link" data-target="restore"><i class="fas fa-upload"></i><span>Restore</span></a></li><li><a href="#" class="nav-link" data-target="logs"><i class="fas fa-scroll"></i><span>Logs</span></a></li>3 unmodified lines<!-- Main Content --><main class="main-content"><header class="main-header"><h1 id="header-title">Dashboard</h1><div id="status-badge" class="status-badge idle"><span class="status-dot"></span><span class="status-text">Idle</span></div></header><!-- Page Content Area --><div class="page-content"><!-- Dashboard Page --><section id="dashboard-page" class="page active"><div class="dashboard-grid"><div class="dashboard-card status-highlight"><h4>Current Status</h4><p id="dashboard-status-text">The system is currently idle and ready for a new operation.</p><div class="quick-actions"><button id="dashboard-goto-dump" class="btn btn-primary"><i class="fas fa-download"></i> Start New Dump</button><button id="dashboard-goto-restore" class="btn btn-secondary"><i class="fas fa-upload"></i> Start New Restore</button></div></div><div class="dashboard-card"><h4>Last Operation</h4><div id="last-operation-summary"><p class="text-muted">No operations have been run yet.</p></div></div><div class="dashboard-card full-width"><h4>Recent Activity</h4><div id="mini-log-feed" class="mini-log-feed"><!-- Mini logs will be inserted here by JS --></div></div></div></section><!-- Connections Page --><section id="connections-page" class="page"><div class="connection-grid"><!-- Source DB --><div class="form-card"><h3><i class="fas fa-server"></i> Source Database</h3><div class="form-group"><label for="source-conn">Connection String</label><div class="input-group"><input type="password" id="source-conn" class="form-control" placeholder="postgresql://user:pass@host:5432/db"><button class="btn-icon" id="toggle-source-visibility" title="Toggle visibility"><i class="fas fa-eye-slash"></i></button></div></div><button id="test-source-btn" class="btn btn-primary"><i class="fas fa-plug"></i> Test Connection</button><div id="source-status-details" class="connection-details"></div></div><!-- Target DB --><div class="form-card"><h3><i class="fas fa-cloud-upload-alt"></i> Target Database</h3><div class="form-group"><label for="target-conn">Connection String</label><div class="input-group"><input type="password" id="target-conn" class="form-control" placeholder="postgresql://user:pass@host:5432/db"><button class="btn-icon" id="toggle-target-visibility" title="Toggle visibility"><i class="fas fa-eye-slash"></i></button></div></div><button id="test-target-btn" class="btn btn-primary"><i class="fas fa-plug"></i> Test Connection</button><div id="target-status-details" class="connection-details"></div></div></div></section><!-- Dump Page --><section id="dump-page" class="page"><!-- Dump Configuration View --><div id="dump-config-view"><div class="form-card"><h3><i class="fas fa-cog"></i> Dump Settings</h3><div class="form-grid"><div class="form-group"><label for="dump-format">Format</label><select id="dump-format" class="form-control"><option value="c" selected>Custom (compressed, flexible)</option><option value="d">Directory (for parallel restores)</option><option value="p">Plain SQL (readable)</option></select></div><div class="form-group"><label for="dump-compression">Compression</label><select id="dump-compression" class="form-control"><option value="default" selected>Default</option><option value="0">0 (None)</option><option value="5">5 (Balanced)</option><option value="9">9 (Max)</option></select></div><div class="form-group"><label for="schema-filter">Schema (Optional)</label>4 unmodified lines<input type="text" id="dump-filename" class="form-control" value="timescale_backup"></div></div><div class="form-actions"><button id="start-dump-btn" class="btn btn-primary btn-lg"><i class="fas fa-play"></i> Start Dump</button></div></div></div><!-- Dump Progress View --><div id="dump-progress-view" class="hidden"><div class="progress-card"><div class="progress-header"><h3><i class="fas fa-sync fa-spin"></i> Dump in Progress</h3><button id="stop-dump-btn" class="btn btn-danger"><i class="fas fa-stop"></i> Stop</button></div><div class="progress-stats"><div class="stat-item"><span class="stat-label">Elapsed Time</span><span class="stat-value" id="dump-elapsed-time">00:00:00</span></div><div class="stat-item"><span class="stat-label">Backup Size</span><span class="stat-value" id="dump-file-size">0.00 MB</span></div><div class="stat-item"><span class="stat-label">Current Task</span><span class="stat-value" id="dump-current-table">-</span></div></div><div class="progress-tracker"><label>Data Size Progress (<span id="dump-size-progress-text">0%</span>)</label><div class="progress-bar-container"><div id="dump-size-progress-bar" class="progress-bar"></div></div><span class="progress-subtext" id="dump-size-subtext">0 B / 0 B</span></div><div class="progress-tracker"><label>Chunk Count Progress (<span id="dump-count-progress-text">0%</span>)</label><div class="progress-bar-container"><div id="dump-count-progress-bar" class="progress-bar secondary"></div></div><span class="progress-subtext" id="dump-count-subtext">0 / 0 Chunks</span></div></div></div></section><!-- Restore Page --><section id="restore-page" class="page"><!-- Restore Configuration View --><div id="restore-config-view"><div class="form-card"><h3><i class="fas fa-cog"></i> Restore Settings</h3><div class="form-group"><label for="server-backup-file">Select Backup File</label><select id="server-backup-file" class="form-control"><option value="">-- Loading backups... --</option></select></div><div class="form-group"><label>Restore Options</label><div class="checkbox-group"><label><input type="checkbox" id="timescaledb-pre-restore" checked> Run `timescaledb_pre_restore()`</label><label><input type="checkbox" id="timescaledb-post-restore" checked> Run `timescaledb_post_restore()` & ANALYZE</label><label><input type="checkbox" id="no-owner" checked> Ignore object ownership</label><label><input type="checkbox" id="clean"> Clean (drop) objects before recreating</label></div></div><div class="form-actions"><button id="start-restore-btn" class="btn btn-primary btn-lg"><i class="fas fa-play"></i> Start Restore</button></div></div></div><!-- Restore Progress View --><div id="restore-progress-view" class="hidden"><div class="progress-card"><div class="progress-header"><h3><i class="fas fa-sync fa-spin"></i> Restore in Progress</h3><button id="stop-restore-btn" class="btn btn-danger"><i class="fas fa-stop"></i> Stop</button></div><div class="progress-stats"><div class="stat-item"><span class="stat-label">Elapsed Time</span><span class="stat-value" id="restore-elapsed-time">00:00:00</span></div><div class="stat-item"><span class="stat-label">Tables Restored</span><span class="stat-value" id="restore-tables-completed">0</span></div><div class="stat-item"><span class="stat-label">Current Task</span><span class="stat-value" id="restore-current-table">-</span></div></div><p class="text-muted text-center">Restore progress is monitored via logs. Check the Logs tab for detailed, real-time output.</p></div></div></section><!-- Logs Page --><section id="logs-page" class="page"><div class="log-container"><div class="log-header"><h3><i class="fas fa-scroll"></i> Operation Logs</h3><div class="log-controls"><label class="toggle-switch"><input type="checkbox" id="log-autoscroll-toggle" checked><span class="slider"></span></label><span>Auto-Scroll</span></div></div><div id="log-output" class="log-output"><!-- Log entries will be inserted here --></div></div></section>1 unmodified line</main></div><!-- Toast Notification Container --><div id="toast-container"></div><!-- Confirmation Modal --><div id="confirm-modal" class="modal-backdrop hidden"><div class="modal"><div class="modal-header"><h3 id="confirm-modal-title">Confirm Action</h3><button id="close-confirm-modal" class="btn-icon">×</button></div><div class="modal-body"><p id="confirm-modal-body">Are you sure you want to proceed?</p></div><div class="modal-footer"><button id="cancel-confirm-btn" class="btn btn-secondary">Cancel</button><button id="confirm-action-btn" class="btn btn-danger">Confirm</button>1 unmodified line</div></div><!-- JavaScript --><script src="/static/js/app.js" defer></script></body></html>15 unmodified lines161718192021222324252627283 unmodified lines32333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586874 unmodified lines92939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591 unmodified line1611621631641651661671681691701711 unmodified line17317417517617717817918018118215 unmodified lines<body><div class="app-container"><!-- Sidebar Navigation --><nav class="sidebar" id="sidebar"><div class="sidebar-header"><i class="fas fa-database"></i><span class="sidebar-title">Migrator</span></div><ul class="sidebar-nav"><li><a href="#" class="nav-link active" data-target="connections"><i class="fas fa-plug"></i><span>Connections</span></a></li><li><a href="#" class="nav-link" data-target="dump"><i class="fas fa-download"></i><span>Dump</span></a></li><li><a href="#" class="nav-link" data-target="restore"><i class="fas fa-upload"></i><span>Restore</span></a></li><li><a href="#" class="nav-link" data-target="logs"><i class="fas fa-scroll"></i><span>Logs</span></a></li>3 unmodified lines<!-- Main Content --><main class="main-content"><header class="main-header"><button class="menu-toggle" id="menu-toggle"><i class="fas fa-bars"></i></button><h1 id="header-title">Connections</h1><div id="status-badge" class="status-badge idle"><span class="status-dot"></span><span class="status-text">Idle</span></div></header><div class="page-content"><!-- Connections Page --><section id="connections-page" class="page active"><div class="grid-container"><div class="card"><h3><i class="fas fa-server"></i> Source Database</h3><div class="form-group"><label for="source-conn">Connection String</label><input type="password" id="source-conn" class="form-control" placeholder="postgresql://user:pass@host:5432/db"></div><button id="test-source-btn" class="btn btn-primary"><i class="fas fa-plug"></i> Test Connection</button><div class="connection-status-card" id="source-status-card"><p class="text-muted">Test connection to see details.</p></div></div><div class="card"><h3><i class="fas fa-cloud-upload-alt"></i> Target Database</h3><div class="form-group"><label for="target-conn">Connection String</label><input type="password" id="target-conn" class="form-control" placeholder="postgresql://user:pass@host:5432/db"></div><button id="test-target-btn" class="btn btn-primary"><i class="fas fa-plug"></i> Test Connection</button><div class="connection-status-card" id="target-status-card"><p class="text-muted">Test connection to see details.</p></div></div></div></section><!-- Dump Page --><section id="dump-page" class="page"><div id="dump-config-view"><div class="card"><h3><i class="fas fa-cog"></i> Dump Settings</h3><div class="grid-container"><div class="form-group"><label for="dump-format">Format</label><select id="dump-format" class="form-control"><option value="c" selected>Custom</option><option value="d">Directory</option></select></div><div class="form-group"><label for="dump-compression">Compression</label><select id="dump-compression" class="form-control"><option value="default" selected>Default</option><option value="0">0</option><option value="9">9</option></select></div><div class="form-group"><label for="schema-filter">Schema (Optional)</label>4 unmodified lines<input type="text" id="dump-filename" class="form-control" value="timescale_backup"></div></div><div class="command-preview" id="dump-command-preview"></div><div class="form-actions"><button id="start-dump-btn" class="btn btn-primary btn-lg"><i class="fas fa-play"></i> Start Dump</button></div></div></div><div id="dump-monitoring-view" class="hidden"></div></section><!-- Restore Page --><section id="restore-page" class="page"><div id="restore-config-view"><div class="card"><h3><i class="fas fa-cog"></i> Restore Settings</h3><div class="form-group"><label for="server-backup-file">Select Backup File</label><select id="server-backup-file" class="form-control"><option value="">-- Loading... --</option></select></div><div class="form-group"><label>Options</label><div class="checkbox-group"><label><input type="checkbox" id="timescaledb-pre-restore" checked> Run pre-restore</label><label><input type="checkbox" id="timescaledb-post-restore" checked> Run post-restore & ANALYZE</label><label><input type="checkbox" id="no-owner" checked> Ignore ownership</label><label><input type="checkbox" id="clean"> Clean (drop) objects</label></div></div><div class="command-preview" id="restore-command-preview"></div><div class="form-actions"><button id="start-restore-btn" class="btn btn-primary btn-lg"><i class="fas fa-play"></i> Start Restore</button></div></div></div><div id="restore-monitoring-view" class="hidden"></div></section><!-- Logs Page --><section id="logs-page" class="page"><div class="card log-explorer"><div class="log-header"><h3><i class="fas fa-scroll"></i> Log Explorer</h3><div class="log-controls"><input type="text" id="log-search" class="form-control" placeholder="Search logs..."><div class="btn-group" id="log-level-filters"><button class="btn btn-sm active" data-level="all">All</button><button class="btn btn-sm" data-level="info">Info</button><button class="btn btn-sm" data-level="success">Success</button><button class="btn btn-sm" data-level="warning">Warning</button><button class="btn btn-sm" data-level="error">Error</button></div></div></div><div class="log-output" id="log-output"></div><div class="log-footer"><div class="autoscroll-toggle"><input type="checkbox" id="log-autoscroll-toggle" checked><label for="log-autoscroll-toggle">Auto-Scroll</label></div><div class="log-actions"><button id="export-logs-btn" class="btn btn-secondary"><i class="fas fa-file-export"></i> Export</button><button id="clear-logs-btn" class="btn btn-danger"><i class="fas fa-trash"></i> Clear</button></div></div></div></section>1 unmodified line</main></div><!-- Confirmation Modal --><div id="confirm-modal" class="modal-backdrop hidden"><div class="modal"><div class="modal-header"><h3 id="confirm-modal-title"></h3></div><div class="modal-body"><p id="confirm-modal-body"></p></div><div class="modal-footer"><button id="cancel-confirm-btn" class="btn btn-secondary">Cancel</button><button id="confirm-action-btn" class="btn btn-danger">Confirm</button>1 unmodified line</div></div><!-- Toast Notification Container --><div id="toast-container"></div><!-- JavaScript --><script src="/static/js/app.js"></script></body></html>
templates/index.html+59-154