refactor: Remove deprecated INTERNAL_API_PORT (ultrathin monolith cleanup)
Architecture cleanup after migration to ultrathin monolith: - Remove INTERNAL_API_PORT from .env files (was port 8002) - Clean up bot_main.py: remove uvicorn, Thread, run_internal_api() - Update validate.md to check /api/telegram/health instead of port 8002 - Add deprecation notices to old Windows deployment docs - Update docs/telegram/README.md with architecture note The Telegram internal API is now served at /api/telegram/internal/* on the main backend port (8000/8001) instead of separate port 8002. Also includes: menu updates, ServerLogsView improvements, script fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,8 @@ export const menuSections = [
|
||||
items: [
|
||||
{ to: '/reports/telegram', icon: 'pi pi-telegram', label: 'Telegram Bot' },
|
||||
{ to: '/reports/cache-stats', icon: 'pi pi-chart-bar', label: 'Statistici Cache' },
|
||||
{ to: '/data-entry/ocr-metrics', icon: 'pi pi-eye', label: 'Statistici OCR' }
|
||||
{ to: '/data-entry/ocr-metrics', icon: 'pi pi-eye', label: 'Statistici OCR' },
|
||||
{ to: '/reports/server-logs', icon: 'pi pi-server', label: 'Server Logs' }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -70,7 +70,11 @@
|
||||
<p>No log entries found</p>
|
||||
</div>
|
||||
<div v-else class="logs-container" ref="logsContainer">
|
||||
<pre class="logs-content"><code v-for="(line, index) in logs" :key="index" :class="getLineClass(line)">{{ line }}</code></pre>
|
||||
<pre class="logs-content"><code
|
||||
v-for="(line, index) in logs"
|
||||
:key="index"
|
||||
:style="getLineStyle(line)"
|
||||
>{{ line }}</code></pre>
|
||||
</div>
|
||||
</template>
|
||||
</Card>
|
||||
@@ -173,18 +177,28 @@ const loadLogs = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const getLineClass = (line) => {
|
||||
const getLineStyle = (line) => {
|
||||
const lineLower = line.toLowerCase()
|
||||
const baseStyle = {
|
||||
display: 'block',
|
||||
padding: '3px 8px',
|
||||
borderRadius: '2px',
|
||||
fontFamily: "'Consolas', 'Monaco', 'Courier New', monospace",
|
||||
fontSize: '0.8125rem',
|
||||
lineHeight: '1.6'
|
||||
}
|
||||
|
||||
if (lineLower.includes('error') || lineLower.includes('exception') || lineLower.includes('failed')) {
|
||||
return 'log-error'
|
||||
return { ...baseStyle, color: '#b91c1c', backgroundColor: 'rgba(185, 28, 28, 0.1)', fontWeight: '600' }
|
||||
}
|
||||
if (lineLower.includes('warning') || lineLower.includes('warn')) {
|
||||
return 'log-warning'
|
||||
return { ...baseStyle, color: '#b45309', backgroundColor: 'rgba(180, 83, 9, 0.1)', fontWeight: '500' }
|
||||
}
|
||||
if (lineLower.includes('success') || lineLower.includes('completed')) {
|
||||
return 'log-success'
|
||||
return { ...baseStyle, color: '#047857', backgroundColor: 'rgba(4, 120, 87, 0.1)' }
|
||||
}
|
||||
return 'log-info'
|
||||
// Default: pure black text on light background
|
||||
return { ...baseStyle, color: '#000000', backgroundColor: 'rgba(0, 0, 0, 0.02)' }
|
||||
}
|
||||
|
||||
const toggleAutoRefresh = () => {
|
||||
@@ -329,43 +343,17 @@ onUnmounted(() => {
|
||||
.logs-container {
|
||||
max-height: 600px;
|
||||
overflow-y: auto;
|
||||
background: var(--color-bg-secondary, #1e1e1e);
|
||||
background: #ffffff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: var(--radius-md);
|
||||
padding: var(--space-sm);
|
||||
}
|
||||
|
||||
.logs-content {
|
||||
margin: 0;
|
||||
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.5;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.logs-content code {
|
||||
display: block;
|
||||
padding: 2px var(--space-xs);
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.log-error {
|
||||
color: #f87171;
|
||||
background: rgba(248, 113, 113, 0.1);
|
||||
}
|
||||
|
||||
.log-warning {
|
||||
color: #fbbf24;
|
||||
background: rgba(251, 191, 36, 0.1);
|
||||
}
|
||||
|
||||
.log-success {
|
||||
color: #34d399;
|
||||
background: rgba(52, 211, 153, 0.1);
|
||||
}
|
||||
|
||||
.log-info {
|
||||
color: #e5e7eb;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
|
||||
@@ -83,7 +83,7 @@ import axios from "axios";
|
||||
|
||||
// Telegram API uses /api/telegram (separate from reports)
|
||||
const telegramApi = axios.create({
|
||||
baseURL: import.meta.env.BASE_URL + 'api/telegram',
|
||||
baseURL: '/api/telegram',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user