Update ashboard, dashboard, memory (+1 ~4)
This commit is contained in:
@@ -454,6 +454,100 @@
|
||||
font-size: var(--text-xs);
|
||||
}
|
||||
|
||||
/* Git status */
|
||||
.git-card {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.git-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3) var(--space-4);
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.git-header:hover { background: var(--bg-elevated); }
|
||||
|
||||
.git-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: var(--radius-md);
|
||||
background: rgba(249, 115, 22, 0.15);
|
||||
color: #f97316;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.git-icon svg { width: 18px; height: 18px; }
|
||||
|
||||
.git-info { flex: 1; min-width: 0; }
|
||||
|
||||
.git-title {
|
||||
font-size: var(--text-sm);
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.git-subtitle {
|
||||
font-size: 13px;
|
||||
color: var(--text-secondary);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.git-badge {
|
||||
padding: 3px 10px;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.git-badge.ok { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
|
||||
.git-badge.warning { background: rgba(249, 115, 22, 0.15); color: #f97316; }
|
||||
.git-badge.error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
|
||||
|
||||
.git-actions {
|
||||
display: flex;
|
||||
gap: var(--space-2);
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.git-toggle {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
color: var(--text-muted);
|
||||
transition: transform var(--transition-fast);
|
||||
}
|
||||
|
||||
.git-card.collapsed .git-toggle { transform: rotate(-90deg); }
|
||||
.git-card.collapsed .git-details { display: none; }
|
||||
|
||||
.git-details {
|
||||
padding: 0 var(--space-4) var(--space-3);
|
||||
padding-left: calc(var(--space-4) + 32px + var(--space-3));
|
||||
}
|
||||
|
||||
.git-detail-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
font-size: 13px;
|
||||
color: var(--text-primary);
|
||||
padding: 2px 0;
|
||||
}
|
||||
|
||||
.git-detail-item svg { width: 14px; height: 14px; color: var(--text-secondary); }
|
||||
.git-detail-item.uncommitted { color: #f97316; }
|
||||
|
||||
/* Spinner */
|
||||
.spinner {
|
||||
display: inline-block;
|
||||
@@ -573,6 +667,45 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Git -->
|
||||
<div class="section" id="sec-git">
|
||||
<div class="section-header" onclick="toggleSec('sec-git')">
|
||||
<h2 class="section-title">
|
||||
<i data-lucide="git-branch" style="width:18px;height:18px;"></i>
|
||||
Git
|
||||
</h2>
|
||||
<svg class="s-chevron sec-chev" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>
|
||||
</div>
|
||||
<div class="section-body">
|
||||
<div class="git-card" id="gitCard">
|
||||
<div class="git-header" onclick="toggleGitDetails()">
|
||||
<div class="git-icon">
|
||||
<i data-lucide="git-branch"></i>
|
||||
</div>
|
||||
<div class="git-info">
|
||||
<div class="git-title">
|
||||
Git
|
||||
<span class="git-badge ok" id="gitBadge">curat</span>
|
||||
</div>
|
||||
<div class="git-subtitle" id="gitSubtitle">Se incarca...</div>
|
||||
</div>
|
||||
<div class="git-actions" onclick="event.stopPropagation()">
|
||||
<button class="btn btn-secondary" onclick="ecoGitCommit()" title="Commit & Push" style="font-size:var(--text-xs);padding:var(--space-1) var(--space-2);">
|
||||
<i data-lucide="git-commit"></i> Commit
|
||||
</button>
|
||||
<button class="btn btn-secondary" onclick="loadGitStatus()" title="Refresh" style="font-size:var(--text-xs);padding:var(--space-1) var(--space-2);">
|
||||
<i data-lucide="refresh-cw"></i>
|
||||
</button>
|
||||
</div>
|
||||
<i data-lucide="chevron-down" class="git-toggle"></i>
|
||||
</div>
|
||||
<div class="git-details" id="gitDetails">
|
||||
<!-- Populated by JS -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sessions -->
|
||||
<div class="section" id="sec-sessions">
|
||||
<div class="section-header" onclick="toggleSec('sec-sessions')">
|
||||
@@ -1034,13 +1167,81 @@
|
||||
|
||||
function refreshAll() {
|
||||
loadStatus();
|
||||
loadGitStatus();
|
||||
loadLogs();
|
||||
}
|
||||
|
||||
// ── Git ──────────────────────────────────────────────────
|
||||
|
||||
function toggleGitDetails() {
|
||||
document.getElementById('gitCard').classList.toggle('collapsed');
|
||||
}
|
||||
|
||||
async function loadGitStatus() {
|
||||
try {
|
||||
const response = await fetch('/echo/api/eco/git?' + Date.now());
|
||||
if (!response.ok) throw new Error('API error');
|
||||
const git = await response.json();
|
||||
|
||||
const badge = document.getElementById('gitBadge');
|
||||
if (git.clean) {
|
||||
badge.textContent = 'curat';
|
||||
badge.className = 'git-badge ok';
|
||||
} else {
|
||||
badge.textContent = git.uncommittedCount + ' modificari';
|
||||
badge.className = 'git-badge warning';
|
||||
}
|
||||
|
||||
const subtitle = document.getElementById('gitSubtitle');
|
||||
subtitle.textContent = `${git.branch} · ${git.lastCommit.time}`;
|
||||
|
||||
const details = document.getElementById('gitDetails');
|
||||
let html = `
|
||||
<div class="git-detail-item">
|
||||
<i data-lucide="git-commit"></i>
|
||||
<span><strong>${git.lastCommit.hash}</strong> ${git.lastCommit.message.substring(0, 50)}${git.lastCommit.message.length > 50 ? '...' : ''} (${git.lastCommit.time})</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
if (git.uncommittedCount > 0) {
|
||||
const files = (git.uncommittedParsed || []).slice(0, 5).map(f => f.path).join(', ');
|
||||
const more = git.uncommittedCount > 5 ? ` +${git.uncommittedCount - 5}` : '';
|
||||
html += `<div class="git-detail-item uncommitted">
|
||||
<i data-lucide="alert-circle"></i>
|
||||
<span><strong>${git.uncommittedCount}</strong> necomise: ${files}${more}</span>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
details.innerHTML = html;
|
||||
lucide.createIcons();
|
||||
} catch (e) {
|
||||
console.error('Git status error:', e);
|
||||
document.getElementById('gitBadge').textContent = 'eroare';
|
||||
document.getElementById('gitBadge').className = 'git-badge error';
|
||||
}
|
||||
}
|
||||
|
||||
async function ecoGitCommit() {
|
||||
if (!confirm('Fac commit si push la toate modificarile echo-core?')) return;
|
||||
try {
|
||||
const res = await fetch('/echo/api/eco/git-commit', { method: 'POST' });
|
||||
const result = await res.json();
|
||||
if (result.success) {
|
||||
alert('Commit reusit: ' + (result.files || 0) + ' fisiere');
|
||||
setTimeout(loadGitStatus, 1000);
|
||||
} else {
|
||||
alert('Eroare: ' + (result.error || 'necunoscuta'));
|
||||
}
|
||||
} catch (e) {
|
||||
alert('Eroare la commit: ' + e.message);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Init ────────────────────────────────────────────────
|
||||
|
||||
loadStatus();
|
||||
loadSessions();
|
||||
loadGitStatus();
|
||||
loadLogs();
|
||||
lucide.createIcons();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user