mirror of
https://github.com/andrey271192/vps_monitoring.git
synced 2026-09-20 11:55:34 +00:00
fix: xterm.js CDN → jsdelivr, port 8000 → 7272, custom port in installer
- Switch xterm.js from cdnjs (404) to jsdelivr (working) - Add xterm-addon-fit for auto-resize terminal - Change default port from 8000 to 7272 everywhere - Install script: --port flag for custom port selection - sed-based port injection into systemd service at install time Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -96,4 +96,4 @@ async def health():
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run("server.main:app", host="0.0.0.0", port=8000, reload=True)
|
||||
uvicorn.run("server.main:app", host="0.0.0.0", port=7272, reload=True)
|
||||
|
||||
@@ -42,7 +42,7 @@ async def start_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
]
|
||||
|
||||
keyboard.append([
|
||||
InlineKeyboardButton("🌐 Открыть панель", url=f"http://{_get_host()}:8000")
|
||||
InlineKeyboardButton("🌐 Открыть панель", url=f"http://{_get_host()}:7272")
|
||||
])
|
||||
|
||||
reply_markup = InlineKeyboardMarkup(keyboard)
|
||||
|
||||
@@ -234,6 +234,15 @@ function openSSH(id, name) {
|
||||
});
|
||||
|
||||
term.open(container);
|
||||
|
||||
// Fit addon
|
||||
if (typeof FitAddon !== 'undefined') {
|
||||
const fitAddon = new FitAddon.FitAddon();
|
||||
term.loadAddon(fitAddon);
|
||||
setTimeout(() => fitAddon.fit(), 100);
|
||||
window.addEventListener('resize', () => fitAddon.fit());
|
||||
}
|
||||
|
||||
currentTerminal = term;
|
||||
|
||||
const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>VPS Monitoring</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.min.css">
|
||||
<script src="/static/js/theme.js"></script>
|
||||
<script src="/static/js/i18n.js"></script>
|
||||
</head>
|
||||
@@ -165,7 +165,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.8.0/lib/xterm-addon-fit.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user