103 lines
3.3 KiB
Python
103 lines
3.3 KiB
Python
from aiogram.types import (
|
||
ReplyKeyboardMarkup,
|
||
KeyboardButton,
|
||
InlineKeyboardMarkup,
|
||
InlineKeyboardButton,
|
||
)
|
||
from state import DOCKER_MAP
|
||
|
||
menu_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="🩺 Health"), KeyboardButton(text="📊 Статус")],
|
||
[KeyboardButton(text="🐳 Docker"), KeyboardButton(text="📦 Backup")],
|
||
[KeyboardButton(text="🧉 Artifacts"), KeyboardButton(text="⚙️ System")],
|
||
[KeyboardButton(text="ℹ️ Help")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
docker_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="🐳 Status"), KeyboardButton(text="🧰 Arcane")],
|
||
[KeyboardButton(text="🔄 Restart"), KeyboardButton(text="📜 Logs")],
|
||
[KeyboardButton(text="⬅️ Назад")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
arcane_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="🔄 Refresh")],
|
||
[KeyboardButton(text="⬅️ Назад")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
backup_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="📦 Status"), KeyboardButton(text="📦 Last snapshot")],
|
||
[KeyboardButton(text="📊 Repo stats"), KeyboardButton(text="🧯 Restore help")],
|
||
[KeyboardButton(text="▶️ Run backup"), KeyboardButton(text="🧾 Queue")],
|
||
[KeyboardButton(text="🧪 Restic check"), KeyboardButton(text="📬 Weekly report"), KeyboardButton(text="⬅️ Назад")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
artifacts_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="🧉 Status"), KeyboardButton(text="🧉 Last artifact")],
|
||
[KeyboardButton(text="📤 Upload")],
|
||
[KeyboardButton(text="⬅️ Назад")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
system_menu_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="ℹ️ Info"), KeyboardButton(text="🛠 Ops")],
|
||
[KeyboardButton(text="📄 Logs"), KeyboardButton(text="⬅️ Назад")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
system_info_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="💽 Disks"), KeyboardButton(text="🔐 Security")],
|
||
[KeyboardButton(text="📈 Metrics"), KeyboardButton(text="🧱 Hardware")],
|
||
[KeyboardButton(text="🧪 SMART test"), KeyboardButton(text="🧪 SMART status")],
|
||
[KeyboardButton(text="⬅️ System")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
system_ops_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="📦 Updates"), KeyboardButton(text="⬆️ Upgrade")],
|
||
[KeyboardButton(text="🔄 Reboot")],
|
||
[KeyboardButton(text="⬅️ System")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
system_logs_kb = ReplyKeyboardMarkup(
|
||
keyboard=[
|
||
[KeyboardButton(text="🧾 Audit"), KeyboardButton(text="📣 Incidents")],
|
||
[KeyboardButton(text="🧰 Processes"), KeyboardButton(text="🔒 SSL")],
|
||
[KeyboardButton(text="🌐 URLs")],
|
||
[KeyboardButton(text="⬅️ System")],
|
||
],
|
||
resize_keyboard=True,
|
||
)
|
||
|
||
|
||
def docker_inline_kb(action: str) -> InlineKeyboardMarkup:
|
||
rows = []
|
||
for alias in DOCKER_MAP.keys():
|
||
rows.append([
|
||
InlineKeyboardButton(
|
||
text=alias,
|
||
callback_data=f"docker:{action}:{alias}"
|
||
)
|
||
])
|
||
return InlineKeyboardMarkup(inline_keyboard=rows)
|