Fix ALT bootstrap package and polish UI controls

parent 036b6fa1
...@@ -23,6 +23,7 @@ cephdeploy.db ...@@ -23,6 +23,7 @@ cephdeploy.db
cephdeploy.db-wal cephdeploy.db-wal
cephdeploy.db-shm cephdeploy.db-shm
cephdeploy.db-journal cephdeploy.db-journal
cephdeploy_run*.log
# Локальные конфиги # Локальные конфиги
.env .env
......
...@@ -18,17 +18,17 @@ ...@@ -18,17 +18,17 @@
- lvm2 - lvm2
state: present state: present
update_cache: true update_cache: true
when: ansible_os_family == "Debian" when: ansible_facts["os_family"] == "Debian"
- name: Установить cephadm (ALT Linux) - name: Установить cephadm (ALT Linux)
community.general.apt_rpm: community.general.apt_rpm:
package: package:
- cephadm - cephadm
- python3-pip - python3-module-pip
- lvm2 - lvm2
state: present state: present
update_cache: true update_cache: true
when: ansible_os_family == "Altlinux" when: ansible_facts["os_family"] == "Altlinux"
- name: Установить cephadm (RHEL/CentOS/Rocky) - name: Установить cephadm (RHEL/CentOS/Rocky)
ansible.builtin.dnf: ansible.builtin.dnf:
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
- python3-pip - python3-pip
- lvm2 - lvm2
state: present state: present
when: ansible_os_family == "RedHat" when: ansible_facts["os_family"] == "RedHat"
# ── Проверка наличия chronyc и firewalld без зависимости от pkg-facts # ── Проверка наличия chronyc и firewalld без зависимости от pkg-facts
- name: Проверить наличие chronyc - name: Проверить наличие chronyc
......
...@@ -149,7 +149,7 @@ class ClustersWidget(BasePage): ...@@ -149,7 +149,7 @@ class ClustersWidget(BasePage):
self._btn_create.setFixedHeight(32) self._btn_create.setFixedHeight(32)
self._btn_create.setStyleSheet( self._btn_create.setStyleSheet(
"QPushButton { background: #1565c0; color: #fff; border-radius: 5px; " "QPushButton { background: #1565c0; color: #fff; border-radius: 5px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 12px; }"
"QPushButton:hover { background: #1976d2; }" "QPushButton:hover { background: #1976d2; }"
) )
self._btn_create.clicked.connect(self._on_create) self._btn_create.clicked.connect(self._on_create)
...@@ -159,7 +159,7 @@ class ClustersWidget(BasePage): ...@@ -159,7 +159,7 @@ class ClustersWidget(BasePage):
self._btn_delete_cluster.setEnabled(False) self._btn_delete_cluster.setEnabled(False)
self._btn_delete_cluster.setStyleSheet( self._btn_delete_cluster.setStyleSheet(
"QPushButton { background: #b71c1c; color: #fff; border-radius: 5px; " "QPushButton { background: #b71c1c; color: #fff; border-radius: 5px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 12px; }"
"QPushButton:hover { background: #c62828; }" "QPushButton:hover { background: #c62828; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
......
...@@ -112,7 +112,8 @@ class DeployWidget(BasePage): ...@@ -112,7 +112,8 @@ class DeployWidget(BasePage):
self._btn_check.setEnabled(False) self._btn_check.setEnabled(False)
self._btn_check.setStyleSheet( self._btn_check.setStyleSheet(
"QPushButton { background: #2a3040; color: #8fbcbb; " "QPushButton { background: #2a3040; color: #8fbcbb; "
"border: 1px solid #3a4050; border-radius: 5px; font-size: 13px; }" "border: 1px solid #3a4050; border-radius: 5px; "
"font-size: 13px; padding: 0 12px; }"
"QPushButton:hover { background: #2e4a7a; color: #fff; }" "QPushButton:hover { background: #2e4a7a; color: #fff; }"
"QPushButton:disabled { color: #444; border-color: #2a3040; }" "QPushButton:disabled { color: #444; border-color: #2a3040; }"
) )
...@@ -162,7 +163,7 @@ class DeployWidget(BasePage): ...@@ -162,7 +163,7 @@ class DeployWidget(BasePage):
self._btn_deploy.setEnabled(False) self._btn_deploy.setEnabled(False)
self._btn_deploy.setStyleSheet( self._btn_deploy.setStyleSheet(
"QPushButton { background: #2e7d32; color: #fff; border-radius: 6px; " "QPushButton { background: #2e7d32; color: #fff; border-radius: 6px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 14px; }"
"QPushButton:hover { background: #388e3c; }" "QPushButton:hover { background: #388e3c; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
...@@ -173,7 +174,7 @@ class DeployWidget(BasePage): ...@@ -173,7 +174,7 @@ class DeployWidget(BasePage):
self._btn_stop.setEnabled(False) self._btn_stop.setEnabled(False)
self._btn_stop.setStyleSheet( self._btn_stop.setStyleSheet(
"QPushButton { background: #b71c1c; color: #fff; border-radius: 6px; " "QPushButton { background: #b71c1c; color: #fff; border-radius: 6px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 14px; }"
"QPushButton:hover { background: #c62828; }" "QPushButton:hover { background: #c62828; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
...@@ -184,7 +185,7 @@ class DeployWidget(BasePage): ...@@ -184,7 +185,7 @@ class DeployWidget(BasePage):
self._btn_cleanup.setEnabled(False) self._btn_cleanup.setEnabled(False)
self._btn_cleanup.setStyleSheet( self._btn_cleanup.setStyleSheet(
"QPushButton { background: #5d4037; color: #fff; border-radius: 6px; " "QPushButton { background: #5d4037; color: #fff; border-radius: 6px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 14px; }"
"QPushButton:hover { background: #6d4c41; }" "QPushButton:hover { background: #6d4c41; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
...@@ -195,7 +196,8 @@ class DeployWidget(BasePage): ...@@ -195,7 +196,8 @@ class DeployWidget(BasePage):
self._btn_open_dir.setEnabled(False) self._btn_open_dir.setEnabled(False)
self._btn_open_dir.setStyleSheet( self._btn_open_dir.setStyleSheet(
"QPushButton { background: #2a3040; color: #8fbcbb; " "QPushButton { background: #2a3040; color: #8fbcbb; "
"border: 1px solid #3a4050; border-radius: 6px; font-size: 13px; }" "border: 1px solid #3a4050; border-radius: 6px; "
"font-size: 13px; padding: 0 14px; }"
"QPushButton:hover { background: #2e4a7a; color: #fff; }" "QPushButton:hover { background: #2e4a7a; color: #fff; }"
"QPushButton:disabled { color: #444; border-color: #2a3040; }" "QPushButton:disabled { color: #444; border-color: #2a3040; }"
) )
......
...@@ -128,6 +128,12 @@ class MonitoringDialog(QDialog): ...@@ -128,6 +128,12 @@ class MonitoringDialog(QDialog):
self._btn_stop = QPushButton("⏹ Остановить") self._btn_stop = QPushButton("⏹ Остановить")
self._btn_stop.setFixedHeight(32) self._btn_stop.setFixedHeight(32)
self._btn_stop.setEnabled(False) self._btn_stop.setEnabled(False)
self._btn_stop.setStyleSheet(
"QPushButton { background: #b71c1c; color: #fff; border-radius: 6px; "
"font-weight: bold; padding: 4px 18px; }"
"QPushButton:hover { background: #c62828; }"
"QPushButton:disabled { background: #333; color: #555; }"
)
self._btn_stop.clicked.connect(self._stop) self._btn_stop.clicked.connect(self._stop)
btn_row.addWidget(self._btn_start) btn_row.addWidget(self._btn_start)
......
...@@ -249,7 +249,8 @@ class NetworkScanWidget(BasePage): ...@@ -249,7 +249,8 @@ class NetworkScanWidget(BasePage):
self._btn_scan.setFixedSize(160, 36) self._btn_scan.setFixedSize(160, 36)
self._btn_scan.setStyleSheet( self._btn_scan.setStyleSheet(
"QPushButton { background: #2e7d32; color: #fff; " "QPushButton { background: #2e7d32; color: #fff; "
"border-radius: 6px; font-size: 13px; font-weight: bold; }" "border-radius: 6px; font-size: 13px; font-weight: bold; "
"padding: 0 12px; }"
"QPushButton:hover { background: #388e3c; }" "QPushButton:hover { background: #388e3c; }"
"QPushButton:pressed { background: #1b5e20; }" "QPushButton:pressed { background: #1b5e20; }"
) )
...@@ -260,7 +261,8 @@ class NetworkScanWidget(BasePage): ...@@ -260,7 +261,8 @@ class NetworkScanWidget(BasePage):
self._btn_stop.setEnabled(False) self._btn_stop.setEnabled(False)
self._btn_stop.setStyleSheet( self._btn_stop.setStyleSheet(
"QPushButton { background: #b71c1c; color: #fff; " "QPushButton { background: #b71c1c; color: #fff; "
"border-radius: 6px; font-size: 13px; font-weight: bold; }" "border-radius: 6px; font-size: 13px; font-weight: bold; "
"padding: 0 12px; }"
"QPushButton:hover { background: #c62828; }" "QPushButton:hover { background: #c62828; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
...@@ -487,7 +489,7 @@ class NetworkScanWidget(BasePage): ...@@ -487,7 +489,7 @@ class NetworkScanWidget(BasePage):
btn.setEnabled(info.ssh_auth_ok) btn.setEnabled(info.ssh_auth_ok)
btn.setStyleSheet( btn.setStyleSheet(
"QPushButton { background: #1565c0; color: #fff; border-radius: 4px; " "QPushButton { background: #1565c0; color: #fff; border-radius: 4px; "
"font-size: 11px; }" "font-size: 11px; padding: 0 8px; }"
"QPushButton:hover { background: #1976d2; }" "QPushButton:hover { background: #1976d2; }"
"QPushButton:disabled { background: #2a3040; color: #444; }" "QPushButton:disabled { background: #2a3040; color: #444; }"
) )
......
...@@ -29,6 +29,7 @@ from PyQt6.QtWidgets import ( ...@@ -29,6 +29,7 @@ from PyQt6.QtWidgets import (
QWidget, QWidget,
) )
from core.config import AppConfig
from db import SessionLocal from db import SessionLocal
from db.models import DeviceType, OSDRole from db.models import DeviceType, OSDRole
from db.repository import ( from db.repository import (
...@@ -100,14 +101,17 @@ class DiskFetchWorker(QThread): ...@@ -100,14 +101,17 @@ class DiskFetchWorker(QThread):
client = paramiko.SSHClient() client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try: try:
ssh_timeout = max(20, int(AppConfig.get("scan_ssh_timeout") or 8))
client.connect( client.connect(
self.ip, username=self.user, key_filename=self.key_path, self.ip, username=self.user, key_filename=self.key_path,
timeout=8, banner_timeout=8, auth_timeout=8, timeout=ssh_timeout,
banner_timeout=ssh_timeout,
auth_timeout=ssh_timeout,
look_for_keys=False, allow_agent=False, look_for_keys=False, allow_agent=False,
) )
_, stdout, _ = client.exec_command( _, stdout, _ = client.exec_command(
"lsblk -J -o NAME,SIZE,ROTA,TYPE,FSTYPE,MOUNTPOINT,LABEL 2>/dev/null", "lsblk -J -o NAME,SIZE,ROTA,TYPE,FSTYPE,MOUNTPOINT,LABEL 2>/dev/null",
timeout=10, timeout=ssh_timeout + 10,
) )
raw = stdout.read().decode(errors="replace").strip() raw = stdout.read().decode(errors="replace").strip()
try: try:
...@@ -484,7 +488,7 @@ class OSDWidget(BasePage): ...@@ -484,7 +488,7 @@ class OSDWidget(BasePage):
self._btn_add.setEnabled(False) self._btn_add.setEnabled(False)
self._btn_add.setStyleSheet( self._btn_add.setStyleSheet(
"QPushButton { background: #1565c0; color: #fff; border-radius: 5px; " "QPushButton { background: #1565c0; color: #fff; border-radius: 5px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 12px; }"
"QPushButton:hover { background: #1976d2; }" "QPushButton:hover { background: #1976d2; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
......
...@@ -59,11 +59,12 @@ class ReportWidget(BasePage): ...@@ -59,11 +59,12 @@ class ReportWidget(BasePage):
ctrl_layout.addWidget(self._cluster_combo) ctrl_layout.addWidget(self._cluster_combo)
self._btn_gen = QPushButton("🔄 Сформировать") self._btn_gen = QPushButton("🔄 Сформировать")
self._btn_gen.setFixedHeight(30) self._btn_gen.setFixedHeight(32)
self._btn_gen.setEnabled(False) self._btn_gen.setEnabled(False)
self._btn_gen.setStyleSheet( self._btn_gen.setStyleSheet(
"QPushButton { background: #2a3040; color: #8fbcbb; " "QPushButton { background: #2a3040; color: #8fbcbb; "
"border: 1px solid #3a4050; border-radius: 5px; font-size: 13px; }" "border: 1px solid #3a4050; border-radius: 5px; "
"font-size: 13px; padding: 0 12px; }"
"QPushButton:hover { background: #2e4a7a; color: #fff; }" "QPushButton:hover { background: #2e4a7a; color: #fff; }"
"QPushButton:disabled { color: #444; border-color: #2a3040; }" "QPushButton:disabled { color: #444; border-color: #2a3040; }"
) )
...@@ -71,11 +72,12 @@ class ReportWidget(BasePage): ...@@ -71,11 +72,12 @@ class ReportWidget(BasePage):
ctrl_layout.addWidget(self._btn_gen) ctrl_layout.addWidget(self._btn_gen)
self._btn_save = QPushButton("💾 Сохранить HTML") self._btn_save = QPushButton("💾 Сохранить HTML")
self._btn_save.setFixedHeight(30) self._btn_save.setFixedHeight(32)
self._btn_save.setEnabled(False) self._btn_save.setEnabled(False)
self._btn_save.setStyleSheet( self._btn_save.setStyleSheet(
"QPushButton { background: #1565c0; color: #fff; " "QPushButton { background: #1565c0; color: #fff; "
"border-radius: 5px; font-size: 13px; font-weight: bold; }" "border-radius: 5px; font-size: 13px; font-weight: bold; "
"padding: 0 12px; }"
"QPushButton:hover { background: #1976d2; }" "QPushButton:hover { background: #1976d2; }"
"QPushButton:disabled { background: #333; color: #555; }" "QPushButton:disabled { background: #333; color: #555; }"
) )
......
...@@ -227,7 +227,7 @@ class SettingsWidget(BasePage): ...@@ -227,7 +227,7 @@ class SettingsWidget(BasePage):
self._btn_save.setFixedHeight(34) self._btn_save.setFixedHeight(34)
self._btn_save.setStyleSheet( self._btn_save.setStyleSheet(
"QPushButton { background: #1565c0; color: #fff; border-radius: 6px; " "QPushButton { background: #1565c0; color: #fff; border-radius: 6px; "
"font-size: 13px; font-weight: bold; }" "font-size: 13px; font-weight: bold; padding: 0 14px; }"
"QPushButton:hover { background: #1976d2; }" "QPushButton:hover { background: #1976d2; }"
) )
self._btn_save.clicked.connect(self._save) self._btn_save.clicked.connect(self._save)
...@@ -236,7 +236,8 @@ class SettingsWidget(BasePage): ...@@ -236,7 +236,8 @@ class SettingsWidget(BasePage):
self._btn_reset.setFixedHeight(34) self._btn_reset.setFixedHeight(34)
self._btn_reset.setStyleSheet( self._btn_reset.setStyleSheet(
"QPushButton { background: #2a3040; color: #8fbcbb; " "QPushButton { background: #2a3040; color: #8fbcbb; "
"border: 1px solid #3a4050; border-radius: 6px; font-size: 13px; }" "border: 1px solid #3a4050; border-radius: 6px; "
"font-size: 13px; padding: 0 14px; }"
"QPushButton:hover { background: #2e4a7a; color: #fff; }" "QPushButton:hover { background: #2e4a7a; color: #fff; }"
) )
self._btn_reset.clicked.connect(self._reset) self._btn_reset.clicked.connect(self._reset)
......
...@@ -297,7 +297,8 @@ class StatusWidget(BasePage): ...@@ -297,7 +297,8 @@ class StatusWidget(BasePage):
self._btn_refresh.setEnabled(False) self._btn_refresh.setEnabled(False)
self._btn_refresh.setStyleSheet( self._btn_refresh.setStyleSheet(
"QPushButton { background: #2a3040; color: #8fbcbb; " "QPushButton { background: #2a3040; color: #8fbcbb; "
"border: 1px solid #3a4050; border-radius: 5px; font-size: 13px; }" "border: 1px solid #3a4050; border-radius: 5px; "
"font-size: 13px; padding: 0 12px; }"
"QPushButton:hover { background: #2e4a7a; color: #fff; }" "QPushButton:hover { background: #2e4a7a; color: #fff; }"
"QPushButton:disabled { color: #444; border-color: #2a3040; }" "QPushButton:disabled { color: #444; border-color: #2a3040; }"
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment