更新readme文档
This commit is contained in:
175
web/static/index.html
Normal file
175
web/static/index.html
Normal file
@@ -0,0 +1,175 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>IOV Data Analysis Agent</title>
|
||||
<link rel="stylesheet" href="/static/style.css?v=2.0">
|
||||
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Markdown Parser -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="app-container">
|
||||
<!-- Sidebar -->
|
||||
<aside class="sidebar">
|
||||
<div class="brand">
|
||||
<i class="fa-solid fa-robot"></i>
|
||||
<h1>IOV Agent</h1>
|
||||
</div>
|
||||
|
||||
<!-- Navigation -->
|
||||
<nav class="main-nav">
|
||||
<button class="nav-btn active" onclick="switchView('analysis')">
|
||||
<i class="fa-solid fa-chart-line"></i> Analysis
|
||||
</button>
|
||||
<button class="nav-btn" onclick="switchView('tools')">
|
||||
<i class="fa-solid fa-toolbox"></i> Data Tools
|
||||
</button>
|
||||
<button class="nav-btn" onclick="switchView('gallery')">
|
||||
<i class="fa-solid fa-images"></i> Gallery
|
||||
</button>
|
||||
<button class="nav-btn" onclick="switchView('help')">
|
||||
<i class="fa-solid fa-circle-question"></i> Help
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<!-- Analysis Controls (Visible only in Analysis View) -->
|
||||
<div id="analysisControls" class="control-group-wrapper">
|
||||
<div class="control-group">
|
||||
<h3>1. Data Upload</h3>
|
||||
<div class="upload-zone" id="uploadZone">
|
||||
<i class="fa-solid fa-cloud-arrow-up"></i>
|
||||
<p>Drag & Drop CSV/Excel</p>
|
||||
<input type="file" id="fileInput" accept=".csv,.xlsx,.xls" multiple hidden>
|
||||
<button class="btn secondary" onclick="document.getElementById('fileInput').click()">Select
|
||||
Files</button>
|
||||
<div id="fileList" class="file-list"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<h3>2. Analysis Config</h3>
|
||||
<textarea id="requirementInput"
|
||||
placeholder="Enter your analysis requirement here...">基于所有运维工单,整理一份工单健康度报告...</textarea>
|
||||
<button id="startBtn" class="btn primary">
|
||||
<i class="fa-solid fa-play"></i> Start Analysis
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="status-indicator">
|
||||
<span id="statusDot" class="dot"></span>
|
||||
<span id="statusText">Idle</span>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<!-- Main Content Area -->
|
||||
<main class="main-content">
|
||||
|
||||
<!-- VIEW: ANALYSIS -->
|
||||
<div id="viewAnalysis" class="view-section active">
|
||||
<div class="tabs">
|
||||
<button class="tab-btn active" onclick="switchTab('logs')">
|
||||
<i class="fa-solid fa-terminal"></i> Live Logs
|
||||
</button>
|
||||
<button class="tab-btn" onclick="switchTab('report')">
|
||||
<i class="fa-solid fa-file-invoice-dollar"></i> Report
|
||||
</button>
|
||||
<div style="margin-left: auto; display: flex; align-items: center;">
|
||||
<button id="exportBtn" class="btn secondary"
|
||||
style="padding: 0.4rem 1rem; font-size: 0.8rem; width: auto;" onclick="triggerExport()">
|
||||
<i class="fa-solid fa-download"></i> Export Report (ZIP)
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Log View -->
|
||||
<div id="logsTab" class="tab-content active">
|
||||
<div class="terminal-window">
|
||||
<pre id="logOutput">Waiting to start...</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Report View -->
|
||||
<div id="reportTab" class="tab-content">
|
||||
<div id="reportContainer" class="markdown-body">
|
||||
<div class="empty-state">
|
||||
<i class="fa-solid fa-chart-simple"></i>
|
||||
<p>No report generated yet.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- VIEW: TOOLS -->
|
||||
<div id="viewTools" class="view-section" style="display: none;">
|
||||
<div class="tools-grid">
|
||||
<!-- Tool Card 1: Merge Excel -->
|
||||
<div class="tool-card">
|
||||
<div class="tool-icon"><i class="fa-solid fa-file-csv"></i></div>
|
||||
<h3>Excel to CSV Merger</h3>
|
||||
<p>Merge multiple .xlsx files from the uploads directory into a single CSV for analysis.</p>
|
||||
<div class="tool-actions">
|
||||
<input type="text" id="mergeSource" value="uploads" placeholder="Source Directory"
|
||||
class="input-sm">
|
||||
<button class="btn secondary" onclick="triggerMerge()">
|
||||
<i class="fa-solid fa-bolt"></i> Merge Now
|
||||
</button>
|
||||
</div>
|
||||
<div id="mergeResult" class="tool-result"></div>
|
||||
</div>
|
||||
|
||||
<!-- Tool Card 2: Sort CSV -->
|
||||
<div class="tool-card">
|
||||
<div class="tool-icon"><i class="fa-solid fa-arrow-down-a-z"></i></div>
|
||||
<h3>Time Sorter</h3>
|
||||
<p>Sort a CSV file by 'SendTime' or time column to fix ordering issues.</p>
|
||||
<div class="tool-actions">
|
||||
<input type="text" id="sortTarget" value="cleaned_data.csv" placeholder="Target Filename"
|
||||
class="input-sm">
|
||||
<button class="btn secondary" onclick="triggerSort()">
|
||||
<i class="fa-solid fa-sort"></i> Sort Now
|
||||
</button>
|
||||
</div>
|
||||
<div id="sortResult" class="tool-result"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- VIEW: GALLERY -->
|
||||
<div id="viewGallery" class="view-section" style="display: none;">
|
||||
<div id="galleryContainer" class="gallery-grid">
|
||||
<div class="empty-state">
|
||||
<i class="fa-solid fa-images"></i>
|
||||
<p>No images generated yet.<br>Start an analysis to see results here.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- VIEW: HELP -->
|
||||
<div id="viewHelp" class="view-section" style="display: none;">
|
||||
<div class="help-header">
|
||||
<h2>Troubleshooting Guide</h2>
|
||||
<button class="btn secondary" onclick="fetchHelp()">Refresh</button>
|
||||
</div>
|
||||
<div id="helpContainer" class="markdown-body help-body">
|
||||
<p>Loading guide...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script src="/static/script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
362
web/static/script.js
Normal file
362
web/static/script.js
Normal file
@@ -0,0 +1,362 @@
|
||||
|
||||
const uploadZone = document.getElementById('uploadZone');
|
||||
const fileInput = document.getElementById('fileInput');
|
||||
const fileList = document.getElementById('fileList');
|
||||
const startBtn = document.getElementById('startBtn');
|
||||
const requirementInput = document.getElementById('requirementInput');
|
||||
const statusDot = document.getElementById('statusDot');
|
||||
const statusText = document.getElementById('statusText');
|
||||
const logOutput = document.getElementById('logOutput');
|
||||
const reportContainer = document.getElementById('reportContainer');
|
||||
const galleryContainer = document.getElementById('galleryContainer');
|
||||
|
||||
let isRunning = false;
|
||||
let pollingInterval = null;
|
||||
let currentSessionId = null;
|
||||
|
||||
// --- Upload Logic ---
|
||||
if (uploadZone) {
|
||||
uploadZone.addEventListener('dragover', (e) => {
|
||||
e.preventDefault();
|
||||
uploadZone.classList.add('dragover');
|
||||
});
|
||||
uploadZone.addEventListener('dragleave', () => uploadZone.classList.remove('dragover'));
|
||||
uploadZone.addEventListener('drop', (e) => {
|
||||
e.preventDefault();
|
||||
uploadZone.classList.remove('dragover');
|
||||
handleFiles(e.dataTransfer.files);
|
||||
});
|
||||
}
|
||||
if (fileInput) {
|
||||
fileInput.addEventListener('change', (e) => handleFiles(e.target.files));
|
||||
}
|
||||
|
||||
async function handleFiles(files) {
|
||||
if (files.length === 0) return;
|
||||
|
||||
fileList.innerHTML = '';
|
||||
const formData = new FormData();
|
||||
|
||||
for (const file of files) {
|
||||
formData.append('files', file);
|
||||
const fileItem = document.createElement('div');
|
||||
fileItem.innerText = `📄 ${file.name}`;
|
||||
fileItem.style.fontSize = '0.8rem';
|
||||
fileItem.style.color = '#fff';
|
||||
fileList.appendChild(fileItem);
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/upload', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
});
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
console.log('Upload success:', data);
|
||||
} else {
|
||||
alert('Upload failed');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert('Upload failed');
|
||||
}
|
||||
}
|
||||
|
||||
// --- Start Analysis ---
|
||||
if (startBtn) {
|
||||
startBtn.addEventListener('click', async () => {
|
||||
if (isRunning) return;
|
||||
|
||||
const requirement = requirementInput.value.trim();
|
||||
if (!requirement) {
|
||||
alert('Please enter analysis requirement');
|
||||
return;
|
||||
}
|
||||
|
||||
setRunningState(true);
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/start', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ requirement })
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
currentSessionId = data.session_id; // Store Session ID
|
||||
console.log("Started Session:", currentSessionId);
|
||||
|
||||
startPolling();
|
||||
switchTab('logs');
|
||||
} else {
|
||||
const err = await res.json();
|
||||
alert('Failed to start: ' + err.detail);
|
||||
setRunningState(false);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert('Error starting analysis');
|
||||
setRunningState(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setRunningState(running) {
|
||||
isRunning = running;
|
||||
startBtn.disabled = running;
|
||||
startBtn.innerHTML = running ? '<i class="fa-solid fa-spinner fa-spin"></i> Running...' : '<i class="fa-solid fa-play"></i> Start Analysis';
|
||||
|
||||
if (running) {
|
||||
statusDot.className = 'dot running';
|
||||
statusText.innerText = 'Analysis in Progress';
|
||||
} else {
|
||||
statusDot.className = 'dot done';
|
||||
statusText.innerText = 'Completed';
|
||||
}
|
||||
}
|
||||
|
||||
// --- Status Polling ---
|
||||
function startPolling() {
|
||||
if (pollingInterval) clearInterval(pollingInterval);
|
||||
if (!currentSessionId) return;
|
||||
|
||||
pollingInterval = setInterval(async () => {
|
||||
try {
|
||||
const res = await fetch(`/api/status?session_id=${currentSessionId}`);
|
||||
if (!res.ok) return;
|
||||
const data = await res.json();
|
||||
|
||||
// Update Logs
|
||||
logOutput.innerText = data.log || "Waiting for logs...";
|
||||
// Auto scroll to bottom
|
||||
const term = document.querySelector('.terminal-window');
|
||||
if (term) term.scrollTop = term.scrollHeight;
|
||||
|
||||
if (!data.is_running && isRunning) {
|
||||
// Just finished
|
||||
setRunningState(false);
|
||||
clearInterval(pollingInterval);
|
||||
|
||||
if (data.has_report) {
|
||||
loadReport();
|
||||
loadGallery(); // Load images when done
|
||||
switchTab('report');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Polling error', e);
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
async function loadReport() {
|
||||
if (!currentSessionId) return;
|
||||
try {
|
||||
const res = await fetch(`/api/report?session_id=${currentSessionId}`);
|
||||
const data = await res.json();
|
||||
|
||||
// Render Markdown
|
||||
reportContainer.innerHTML = marked.parse(data.content);
|
||||
|
||||
// Fix images relative path for display if needed
|
||||
// The backend should return a base_path or we handle it here
|
||||
if (data.base_path) {
|
||||
// Backend already handled replacement?
|
||||
// The backend returns content with updated paths.
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
reportContainer.innerHTML = '<p class="error">Failed to load report.</p>';
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
async function loadGallery() {
|
||||
if (!currentSessionId) return;
|
||||
|
||||
// Switch to gallery view logic if we were already there
|
||||
// But this is just data loading
|
||||
try {
|
||||
const res = await fetch(`/api/figures?session_id=${currentSessionId}`);
|
||||
const data = await res.json();
|
||||
|
||||
const galleryGrid = document.getElementById('galleryContainer');
|
||||
if (!data.figures || data.figures.length === 0) {
|
||||
galleryGrid.innerHTML = `
|
||||
<div class="empty-state">
|
||||
<i class="fa-solid fa-images"></i>
|
||||
<p>No images generated in this session.</p>
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
let html = '';
|
||||
data.figures.forEach(fig => {
|
||||
html += `
|
||||
<div class="gallery-card">
|
||||
<div class="img-wrapper">
|
||||
<img src="${fig.web_url}" alt="${fig.filename}" onclick="window.open('${fig.web_url}', '_blank')">
|
||||
</div>
|
||||
<div class="card-content">
|
||||
<h4>${fig.filename}</h4>
|
||||
<p class="desc">${fig.description || 'No description'}</p>
|
||||
${fig.analysis ? `<div class="analysis-box"><i class="fa-solid fa-magnifying-glass"></i> ${fig.analysis}</div>` : ''}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
galleryGrid.innerHTML = html;
|
||||
|
||||
} catch (e) {
|
||||
console.error("Gallery load failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
// --- Export Report ---
|
||||
window.triggerExport = async function () {
|
||||
if (!currentSessionId) {
|
||||
alert("No active session to export.");
|
||||
return;
|
||||
}
|
||||
|
||||
const btn = document.getElementById('exportBtn');
|
||||
const originalText = btn.innerHTML;
|
||||
btn.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> Zipping...';
|
||||
btn.disabled = true;
|
||||
|
||||
try {
|
||||
// Trigger download
|
||||
// We can't use fetch for file download easily if we want browser to handle save dialog
|
||||
// So we create a link approach or check status first
|
||||
|
||||
// Check if download is possible
|
||||
const url = `/api/export?session_id=${currentSessionId}`;
|
||||
const res = await fetch(url, { method: 'HEAD' });
|
||||
if (res.ok) {
|
||||
window.location.href = url;
|
||||
} else {
|
||||
alert("Export failed: No data available.");
|
||||
}
|
||||
} catch (e) {
|
||||
alert("Export failed: " + e.message);
|
||||
} finally {
|
||||
btn.innerHTML = originalText;
|
||||
btn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// --- Tabs (Inner) ---
|
||||
window.switchTab = function (tabName) {
|
||||
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
||||
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
|
||||
|
||||
const btn = document.querySelector(`button[onclick="switchTab('${tabName}')"]`);
|
||||
if (btn) btn.classList.add('active');
|
||||
|
||||
const tab = document.getElementById(`${tabName}Tab`);
|
||||
if (tab) tab.classList.add('active');
|
||||
}
|
||||
|
||||
// --- View Navigation (Outer Sidebar) ---
|
||||
window.switchView = function (viewName) {
|
||||
// 1. Update Sidebar Buttons
|
||||
document.querySelectorAll('.nav-btn').forEach(b => b.classList.remove('active'));
|
||||
const navBtn = document.querySelector(`button[onclick="switchView('${viewName}')"]`);
|
||||
if (navBtn) navBtn.classList.add('active');
|
||||
|
||||
// 2. Switch Main Content Sections
|
||||
const viewId = 'view' + viewName.charAt(0).toUpperCase() + viewName.slice(1);
|
||||
|
||||
document.querySelectorAll('.view-section').forEach(v => {
|
||||
// Hide all
|
||||
v.style.display = 'none';
|
||||
v.classList.remove('active');
|
||||
});
|
||||
|
||||
const activeView = document.getElementById(viewId);
|
||||
if (activeView) {
|
||||
// Analysis view uses flex for layout (logs scrolling), others use block
|
||||
if (viewName === 'analysis') {
|
||||
activeView.style.display = 'flex';
|
||||
activeView.style.flexDirection = 'column';
|
||||
} else {
|
||||
activeView.style.display = 'block';
|
||||
// If switching to gallery, reload it if session exists
|
||||
if (viewName === 'gallery' && currentSessionId) {
|
||||
loadGallery();
|
||||
}
|
||||
}
|
||||
activeView.classList.add('active');
|
||||
}
|
||||
|
||||
// 3. Toggle Sidebar Controls (only show Analysis Controls in analysis view)
|
||||
const analysisControls = document.getElementById('analysisControls');
|
||||
if (analysisControls) {
|
||||
analysisControls.style.display = (viewName === 'analysis') ? 'block' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// --- Tool Functions ---
|
||||
window.triggerMerge = async function () {
|
||||
const sourceDir = document.getElementById('mergeSource').value;
|
||||
const resultDiv = document.getElementById('mergeResult');
|
||||
|
||||
resultDiv.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> Merging...';
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/tools/merge', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ source_dir: sourceDir, output_filename: 'merged_output.csv' })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.status === 'success') {
|
||||
resultDiv.innerHTML = `<span style="color:var(--success)"><i class="fa-solid fa-check"></i> ${data.message}</span>`;
|
||||
} else {
|
||||
resultDiv.innerHTML = `<span style="color:var(--warning)">${data.message}</span>`;
|
||||
}
|
||||
} catch (e) {
|
||||
resultDiv.innerHTML = `<span style="color:red">Error: ${e.message}</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
window.triggerSort = async function () {
|
||||
const targetFile = document.getElementById('sortTarget').value;
|
||||
const resultDiv = document.getElementById('sortResult');
|
||||
|
||||
resultDiv.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> Sorting...';
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/tools/sort', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ target_file: targetFile })
|
||||
});
|
||||
const data = await res.json();
|
||||
if (data.status === 'success') {
|
||||
resultDiv.innerHTML = `<span style="color:var(--success)"><i class="fa-solid fa-check"></i> ${data.message}</span>`;
|
||||
} else {
|
||||
resultDiv.innerHTML = `<span style="color:var(--warning)">${data.message}</span>`;
|
||||
}
|
||||
} catch (e) {
|
||||
resultDiv.innerHTML = `<span style="color:red">Error: ${e.message}</span>`;
|
||||
}
|
||||
}
|
||||
|
||||
// --- Help Functions ---
|
||||
window.fetchHelp = async function () {
|
||||
const container = document.getElementById('helpContainer');
|
||||
container.innerHTML = 'Loading...';
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/help/troubleshooting');
|
||||
const data = await res.json();
|
||||
container.innerHTML = marked.parse(data.content);
|
||||
} catch (e) {
|
||||
container.innerHTML = 'Failed to load guide.';
|
||||
}
|
||||
}
|
||||
387
web/static/style.css
Normal file
387
web/static/style.css
Normal file
@@ -0,0 +1,387 @@
|
||||
:root {
|
||||
--bg-color: #0f172a;
|
||||
--sidebar-bg: rgba(30, 41, 59, 0.7);
|
||||
--glass-border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
--primary-color: #6366f1;
|
||||
--primary-hover: #4f46e5;
|
||||
--text-main: #f8fafc;
|
||||
--text-muted: #94a3b8;
|
||||
--card-bg: rgba(30, 41, 59, 0.4);
|
||||
--success: #10b981;
|
||||
--warning: #f59e0b;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--bg-color);
|
||||
background-image:
|
||||
radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
|
||||
radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
|
||||
color: var(--text-main);
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.app-container {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
/* Sidebar */
|
||||
.sidebar {
|
||||
width: 320px;
|
||||
background: var(--sidebar-bg);
|
||||
backdrop-filter: blur(12px);
|
||||
border-right: var(--glass-border);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.brand i {
|
||||
font-size: 1.5rem;
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.brand h1 {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.control-group h3 {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
/* Upload Zone */
|
||||
.upload-zone {
|
||||
border: 2px dashed rgba(255, 255, 255, 0.1);
|
||||
border-radius: 0.75rem;
|
||||
padding: 2rem 1rem;
|
||||
text-align: center;
|
||||
transition: all 0.2s;
|
||||
background: rgba(255, 255, 255, 0.02);
|
||||
}
|
||||
|
||||
.upload-zone.dragover {
|
||||
border-color: var(--primary-color);
|
||||
background: rgba(99, 102, 241, 0.1);
|
||||
}
|
||||
|
||||
.upload-zone i {
|
||||
font-size: 2rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.upload-zone p {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
/* Inputs */
|
||||
textarea {
|
||||
width: 100%;
|
||||
height: 120px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border: var(--glass-border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
color: var(--text-main);
|
||||
font-family: inherit;
|
||||
resize: none;
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn {
|
||||
width: 100%;
|
||||
padding: 0.75rem;
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
transition: all 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn.primary:hover {
|
||||
background: var(--primary-hover);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.btn.secondary {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
color: var(--text-main);
|
||||
font-size: 0.8rem;
|
||||
padding: 0.5rem;
|
||||
width: auto;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.btn:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
/* Status */
|
||||
.status-indicator {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
padding-top: 1rem;
|
||||
border-top: var(--glass-border);
|
||||
}
|
||||
|
||||
.dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--text-muted);
|
||||
}
|
||||
|
||||
.dot.running {
|
||||
background-color: var(--warning);
|
||||
box-shadow: 0 0 8px var(--warning);
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
.dot.done {
|
||||
background-color: var(--success);
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Main Content */
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 1.5rem;
|
||||
gap: 1rem;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
/* Crucial for nested flex scroll */
|
||||
}
|
||||
|
||||
/* View Section needs to fill space for analysis view */
|
||||
.view-section {
|
||||
flex: 1;
|
||||
display: none;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.view-section.active {
|
||||
display: flex;
|
||||
/* Changed from block to flex for analysis view layout */
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tabs {
|
||||
flex-shrink: 0;
|
||||
/* Prevent tabs from shrinking */
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
border-bottom: var(--glass-border);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* ... existing tab-btn styles ... */
|
||||
|
||||
.tab-content {
|
||||
display: none;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
/* Crucial for nested flex scroll */
|
||||
animation: fadeIn 0.3s ease;
|
||||
}
|
||||
|
||||
.tab-content.active {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* Logs */
|
||||
.terminal-window {
|
||||
background: #000;
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
min-height: 0;
|
||||
/* Crucial for nested flex scroll */
|
||||
border: var(--glass-border);
|
||||
font-family: 'JetBrains Mono', 'Menlo', monospace;
|
||||
font-size: 0.85rem;
|
||||
color: #4ade80;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
#logOutput {
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Report */
|
||||
#reportContainer {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
background: white;
|
||||
color: #1e293b;
|
||||
border-radius: 0.75rem;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #94a3b8;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.empty-state i {
|
||||
font-size: 3rem;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Markdown Styles Override for Report */
|
||||
.markdown-body img {
|
||||
max-width: 100%;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.markdown-body h1,
|
||||
.markdown-body h2,
|
||||
.markdown-body h3 {
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 0.5em;
|
||||
color: #111827;
|
||||
}
|
||||
|
||||
.markdown-body p {
|
||||
margin-bottom: 1em;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
/* New: Tools Grid */
|
||||
.tools-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
||||
gap: 1.5rem;
|
||||
padding: 1rem 0;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tool-card {
|
||||
background: var(--card-bg);
|
||||
border: var(--glass-border);
|
||||
border-radius: 1rem;
|
||||
padding: 1.5rem;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
|
||||
.tool-card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--primary-color);
|
||||
}
|
||||
|
||||
.tool-icon {
|
||||
font-size: 2rem;
|
||||
color: var(--primary-color);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.tool-card h3 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.tool-card p {
|
||||
font-size: 0.9rem;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 1.5rem;
|
||||
min-height: 3em;
|
||||
}
|
||||
|
||||
.tool-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.input-sm {
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border: var(--glass-border);
|
||||
color: white;
|
||||
padding: 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Help Styles */
|
||||
.help-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.help-body {
|
||||
background: white;
|
||||
color: #1e293b;
|
||||
padding: 2rem;
|
||||
border-radius: 0.75rem;
|
||||
overflow-y: auto;
|
||||
flex: 1;
|
||||
}
|
||||
Reference in New Issue
Block a user