diff --git a/dashboard/api.py b/dashboard/api.py index cbfc74d..f187850 100644 --- a/dashboard/api.py +++ b/dashboard/api.py @@ -28,9 +28,43 @@ class TaskBoardHandler(SimpleHTTPRequestHandler): self.handle_files_post() elif self.path == '/api/refresh-index': self.handle_refresh_index() + elif self.path == '/api/git-commit': + self.handle_git_commit() else: self.send_error(404) + def handle_git_commit(self): + """Run git commit and push.""" + try: + script = TOOLS_DIR / 'git_commit.py' + result = subprocess.run( + [sys.executable, str(script), '--push'], + capture_output=True, + text=True, + timeout=60, + cwd=str(BASE_DIR) + ) + + output = result.stdout + result.stderr + + # Parse files count + files_match = re.search(r'Files changed: (\d+)', output) + files = int(files_match.group(1)) if files_match else 0 + + if result.returncode == 0 or 'Pushing...' in output: + self.send_json({ + 'success': True, + 'files': files, + 'output': output + }) + else: + self.send_json({ + 'success': False, + 'error': output or 'Unknown error' + }) + except Exception as e: + self.send_json({'success': False, 'error': str(e)}, 500) + def handle_refresh_index(self): """Regenerate memory/kb/index.json""" try: diff --git a/dashboard/index.html b/dashboard/index.html index f0c15ef..5e2ba0e 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -725,12 +725,13 @@ align-items: flex-start; gap: 12px; padding: 10px 12px; - background: #1f2937; + background: #111827; border-radius: 6px; margin-bottom: 6px; transition: all 0.2s; + border: 1px solid #1f2937; } - .todo-item:hover { background: #374151; } + .todo-item:hover { background: #1f2937; } .todo-item.done { opacity: 0.6; } .todo-item.done .todo-text { text-decoration: line-through; } .todo-checkbox { @@ -754,6 +755,7 @@ .todo-checkbox.checked svg { display: block; } .todo-content { flex: 1; min-width: 0; } .todo-text { font-size: 14px; color: #f3f4f6; margin-bottom: 4px; } + .todo-context { font-size: 13px; color: #9ca3af; margin-bottom: 6px; font-style: italic; } .todo-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .todo-domain { font-size: 11px; @@ -771,6 +773,26 @@ } .todo-due.overdue { color: #ef4444; font-weight: 500; } .todo-source { font-size: 11px; color: #6b7280; } + + /* Button icon only */ + .btn-icon { + padding: 6px; + background: transparent; + border: 1px solid #374151; + border-radius: 6px; + color: #9ca3af; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.2s; + } + .btn-icon:hover { + background: #374151; + color: #f3f4f6; + border-color: #4b5563; + } + .btn-icon svg { width: 16px; height: 16px; } .issue-owner.clawdbot { color: #8b5cf6; } .issue-date { @@ -931,7 +953,6 @@
@@ -943,7 +964,10 @@
Se încarcă...
- +
@@ -1017,24 +1041,29 @@
- -
-
+ +
+
- - Activity + Issues
- 0 + 0
-
-
+
+ + + + +
+

Se încarcă...

@@ -1042,22 +1071,19 @@
-
- Todo's
0
-
@@ -1069,30 +1095,23 @@
-
-
+ +
+
- - Issues + Activity
- 0 + 0
-
-
- - - - -
-
+

Se încarcă...

@@ -1279,6 +1298,23 @@ updateStatusSummary(); } + async function gitCommit() { + if (!confirm('Fac commit și push la toate modificările?')) return; + showToast('Se execută commit...', 'info'); + try { + const response = await fetch('/echo/api/git-commit', { method: 'POST' }); + const result = await response.json(); + if (result.success) { + showToast('Commit reușit: ' + (result.files || 0) + ' fișiere', 'success'); + setTimeout(refreshStatus, 1000); + } else { + showToast('Eroare: ' + (result.error || 'necunoscută'), 'error'); + } + } catch (error) { + showToast('Eroare la commit: ' + error.message, 'error'); + } + } + async function refreshStatus() { showToast('Se reîmprospătează...'); await loadStatus(); @@ -1551,6 +1587,7 @@
${todo.text}
+ ${todo.context ? `
${todo.context}
` : ''}
@${todo.domain} ${todo.dueDate ? `${formatDate(todo.dueDate)}` : ''} diff --git a/dashboard/todos.json b/dashboard/todos.json index 4b400ec..851a0f0 100644 --- a/dashboard/todos.json +++ b/dashboard/todos.json @@ -1,14 +1,15 @@ { - "lastUpdated": "2026-02-02T10:45:00Z", + "lastUpdated": "2026-02-02T10:52:00Z", "items": [ { "id": "prov-2026-02-02", - "text": "Provocare: Observă când apare vocea critică și dă-i un nume ridicol", + "text": "Provocare: Alege UN lucru și scrie pe hârtie ce EFORT necesită. Întreabă-te: Îmi asum ASTA?", + "context": "Dacă da → fă-l. Dacă nu → ajustează sau renunță fără vinovăție.", "domain": "self", "dueDate": "2026-02-02", "done": false, "doneAt": null, - "source": "morning-coaching", + "source": "Zoltan Vereș - Motivația Intrinsecă", "createdAt": "2026-02-02T09:00:00Z" } ]