summaryrefslogtreecommitdiff
path: root/api/static/js/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'api/static/js/main.js')
-rw-r--r--api/static/js/main.js50
1 files changed, 5 insertions, 45 deletions
diff --git a/api/static/js/main.js b/api/static/js/main.js
index 21a957a..8c540c3 100644
--- a/api/static/js/main.js
+++ b/api/static/js/main.js
@@ -1,61 +1,21 @@
-/**
- * main.js - Application Entry Point
- */
import { ui } from './ui.js';
-import { api } from './api.js';
-import { terminal } from './components/terminal.js';
-import { config } from './components/config.js';
import { results } from './components/results.js';
async function init() {
- console.log('Initializing AI Reasoning Framework GUI...');
-
- // Init Core Components
- terminal.init();
- await config.init();
+ console.log('Initializing AI Reasoning Dashboard...');
+
await results.init();
// Init UI behaviors
ui.initTabs((tabId) => {
- // Refresh data when switching to results tabs
- if (['csv', 'images', 'judge'].includes(tabId)) {
- results.loadAll();
- }
+ // We could lazy load data here, but for now everything triggers on file/filter change
});
-
- // Initial Status Check
- try {
- const status = await api.get('/api/run/status');
- ui.updateStatus(status.status, status.start_time);
-
- if (status.status === 'running') {
- config.setRunningState(true);
- // Re-attach to stream if page reloaded
- api.streamLogs(
- (log) => terminal.append(log),
- () => {
- config.setRunningState(false);
- ui.updateStatus('complete');
- results.loadAll();
- }
- );
- }
- } catch (e) {
- console.warn('Initial status check failed', e);
- }
}
-// Start the app
function start() {
init().catch(err => {
console.error("Initialization error:", err);
- const logsContainer = document.getElementById('logs-container');
- if (logsContainer) {
- const errorLine = document.createElement('div');
- errorLine.className = 'terminal-line error';
- errorLine.textContent = `[GUI STARTUP ERROR] ${err.message}`;
- logsContainer.appendChild(errorLine);
- }
+ alert(`Dashboard Failed to Load: ${err.message}`);
});
}
@@ -63,4 +23,4 @@ if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', start);
} else {
start();
-}
+} \ No newline at end of file