diff --git a/dashboard/api.py b/dashboard/api.py index 376a470..520e953 100644 --- a/dashboard/api.py +++ b/dashboard/api.py @@ -126,8 +126,6 @@ class TaskBoardHandler( self.handle_files_post() elif self.path == '/api/refresh-index': self.handle_refresh_index() - elif self.path == '/api/git-commit': - self.handle_git_commit() elif self.path == '/api/pdf': self.handle_pdf_post() elif self.path == '/api/habits': diff --git a/dashboard/handlers/git.py b/dashboard/handlers/git.py index 8d6efe4..0d24050 100644 --- a/dashboard/handlers/git.py +++ b/dashboard/handlers/git.py @@ -1,8 +1,6 @@ """Git status / diff / commit handlers for dashboard + workspace projects.""" import json -import re import subprocess -import sys import urllib.error import urllib.request from datetime import datetime @@ -25,30 +23,6 @@ class GitHandlers: timeout=timeout, ) - # ── /api/git-commit (legacy — delegates to tools/git_commit.py) ── - def handle_git_commit(self): - """Run tools/git_commit.py --push against the echo-core repo.""" - try: - script = constants.TOOLS_DIR / 'git_commit.py' - result = subprocess.run( - [sys.executable, str(script), '--push'], - capture_output=True, - text=True, - timeout=60, - cwd=str(constants.BASE_DIR), - ) - output = result.stdout + result.stderr - - 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) - # ── /api/git (dashboard repo) ─────────────────────────────── def handle_git_status(self): """Get git status for the echo-core repo.""" diff --git a/dashboard/index.html b/dashboard/index.html index d674a87..a669620 100644 --- a/dashboard/index.html +++ b/dashboard/index.html @@ -1364,7 +1364,7 @@ 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 response = await fetch('/echo/api/eco/git-commit', { method: 'POST' }); const result = await response.json(); if (result.success) { showToast('Commit reușit: ' + (result.files || 0) + ' fișiere', 'success');