Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16e69a2bd6 | ||
|
|
bc4cf2b7a3 |
@@ -30,17 +30,37 @@ _BLOCK_START = "<!-- server-manager:start -->"
|
|||||||
_BLOCK_END = "<!-- server-manager:end -->"
|
_BLOCK_END = "<!-- server-manager:end -->"
|
||||||
|
|
||||||
GLOBAL_CLAUDE_MD_BLOCK = f"""{_BLOCK_START}
|
GLOBAL_CLAUDE_MD_BLOCK = f"""{_BLOCK_START}
|
||||||
## Server Manager — управление серверами
|
## Серверы — ТОЛЬКО через /ssh
|
||||||
|
|
||||||
**ВСЕГДА** используй server manager для подключения к серверам. Никогда не используй `ssh`, `sshpass` или прямые подключения.
|
**НИКОГДА не используй raw `ssh` команды.** НИКОГДА не читай `~/.ssh/config` для поиска серверов.
|
||||||
|
Все операции с серверами — **ТОЛЬКО через скилл `/ssh`** или напрямую через `ssh.py`:
|
||||||
|
|
||||||
- Скилл: `/ssh ALIAS "command"` — выполнить команду на сервере
|
```bash
|
||||||
- Список серверов: `python3 ~/.server-connections/ssh.py --list`
|
python ~/.server-connections/ssh.py --list # список серверов (alias, тип, заметки)
|
||||||
- Документация: `~/.claude/commands/ssh.md`
|
python ~/.server-connections/ssh.py --info ALIAS # инфо (без creds)
|
||||||
- Memory bank: проект `global-infrastructure` → `techContext.md`
|
python ~/.server-connections/ssh.py --status # online/offline
|
||||||
- Инфраструктура: https://git.sensey24.ru/aibot777/infrastructure-docs
|
```
|
||||||
|
|
||||||
**Запрещено:** использовать `ssh`, `sshpass`, читать `~/.server-connections/` напрямую, раскрывать IP/пароли/порты.
|
При вопросе о сервере — **СНАЧАЛА `--list`**, найди нужный алиас по заметкам и **ПРОВЕРЬ ТИП**.
|
||||||
|
Скрипт `ssh.py` сам читает credentials из зашифрованного хранилища. Claude НЕ видит IP, логины, пароли.
|
||||||
|
|
||||||
|
### КРИТИЧНО — команды зависят от типа сервера
|
||||||
|
|
||||||
|
**`ALIAS "command"` (shell) — ТОЛЬКО для типов `ssh` и `telnet`!**
|
||||||
|
|
||||||
|
| Тип | Команды |
|
||||||
|
|-----|---------|
|
||||||
|
| `ssh`/`telnet` | `ALIAS "cmd"`, `--upload ALIAS local remote`, `--download ALIAS remote local` |
|
||||||
|
| `s3` (MinIO и др.) | `--s3-buckets ALIAS`, `--s3-ls ALIAS bucket/prefix`, `--s3-upload ALIAS local bucket/key`, `--s3-download ALIAS bucket/key local`, `--s3-delete ALIAS bucket/key`, `--s3-url ALIAS bucket/key [SEC]` |
|
||||||
|
| `mariadb`/`mssql`/`postgresql` | `--sql ALIAS "SELECT ..."`, `--sql-databases ALIAS`, `--sql-tables ALIAS [db]` |
|
||||||
|
| `redis` | `--redis ALIAS "GET key"`, `--redis-info ALIAS`, `--redis-keys ALIAS "pattern"` |
|
||||||
|
| `grafana` | `--grafana-dashboards ALIAS`, `--grafana-alerts ALIAS` |
|
||||||
|
| `prometheus` | `--prom-query ALIAS "up"`, `--prom-targets ALIAS`, `--prom-alerts ALIAS` |
|
||||||
|
| `winrm` | `--ps ALIAS "Get-Process"`, `--cmd ALIAS "dir"` |
|
||||||
|
|
||||||
|
**Формат: `python ~/.server-connections/ssh.py КОМАНДА АЛИАС АРГУМЕНТЫ`** — алиас ВСЕГДА второй после команды.
|
||||||
|
|
||||||
|
**Запрещено:** использовать `ssh`/`sshpass`, читать `~/.server-connections/` напрямую, раскрывать IP/пароли/порты.
|
||||||
{_BLOCK_END}
|
{_BLOCK_END}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
33
gui/app.py
33
gui/app.py
@@ -2,6 +2,7 @@
|
|||||||
Main application window — sidebar + tabview layout.
|
Main application window — sidebar + tabview layout.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
import tkinter
|
import tkinter
|
||||||
import customtkinter as ctk
|
import customtkinter as ctk
|
||||||
from tkinter import messagebox
|
from tkinter import messagebox
|
||||||
@@ -118,6 +119,32 @@ class App(ctk.CTk):
|
|||||||
# Cleanup on close
|
# Cleanup on close
|
||||||
self.protocol("WM_DELETE_WINDOW", self._on_close)
|
self.protocol("WM_DELETE_WINDOW", self._on_close)
|
||||||
|
|
||||||
|
# Win32: restore window when stuck minimized after Win+D
|
||||||
|
self._restore_check_id = None
|
||||||
|
if sys.platform == "win32":
|
||||||
|
self.after(3000, self._start_restore_watchdog)
|
||||||
|
|
||||||
|
def _start_restore_watchdog(self):
|
||||||
|
"""Start periodic check for stuck minimized state (Windows only)."""
|
||||||
|
try:
|
||||||
|
import ctypes
|
||||||
|
self._user32 = ctypes.windll.user32
|
||||||
|
self._hwnd = int(self.wm_frame(), 16)
|
||||||
|
self._check_restore()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def _check_restore(self):
|
||||||
|
"""If window is iconic but user clicked taskbar, force restore."""
|
||||||
|
try:
|
||||||
|
if self._user32.IsIconic(self._hwnd):
|
||||||
|
fg = self._user32.GetForegroundWindow()
|
||||||
|
if fg == self._hwnd:
|
||||||
|
self._user32.ShowWindow(self._hwnd, 9) # SW_RESTORE
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
self._restore_check_id = self.after(500, self._check_restore)
|
||||||
|
|
||||||
def _build_layout(self):
|
def _build_layout(self):
|
||||||
# PanedWindow — resizable sidebar | main area
|
# PanedWindow — resizable sidebar | main area
|
||||||
self._paned = tkinter.PanedWindow(
|
self._paned = tkinter.PanedWindow(
|
||||||
@@ -682,6 +709,12 @@ class App(ctk.CTk):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _on_close(self):
|
def _on_close(self):
|
||||||
|
# Cancel restore watchdog
|
||||||
|
try:
|
||||||
|
if self._restore_check_id:
|
||||||
|
self.after_cancel(self._restore_check_id)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
# Save window geometry (size + position) and sidebar width
|
# Save window geometry (size + position) and sidebar width
|
||||||
try:
|
try:
|
||||||
geo = self.geometry()
|
geo = self.geometry()
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
"""Version info for ServerManager."""
|
"""Version info for ServerManager."""
|
||||||
|
|
||||||
__version__ = "1.9.19"
|
__version__ = "1.9.21"
|
||||||
__app_name__ = "ServerManager"
|
__app_name__ = "ServerManager"
|
||||||
__author__ = "aibot777"
|
__author__ = "aibot777"
|
||||||
__description__ = "Desktop GUI for managing remote servers"
|
__description__ = "Desktop GUI for managing remote servers"
|
||||||
|
|||||||
Reference in New Issue
Block a user