Add Remote DNS

This commit is contained in:
2026-09-04 08:55:35 +02:00
parent 910c04f845
commit 902c177330
9 changed files with 876 additions and 599 deletions
+16 -19
View File
@@ -8,28 +8,25 @@ from PyQt6.QtCore import Qt
from PyQt6.QtGui import QColor, QFont
from app.core import history as hist
_DARK = "#1c2833"
_DARK2 = "#17202a"
from app.ui import theme
_CSS = f"""
QDialog {{ background: {_DARK2}; }}
QLabel {{ color: white; background: transparent; }}
QDialog {{ background: {theme.BG_SUNKEN}; }}
QLabel {{ color: {theme.TEXT}; background: transparent; }}
QTableWidget {{
background: {_DARK}; color: white; gridline-color: #2e4057;
background: {theme.BG}; color: {theme.TEXT}; gridline-color: {theme.BG_RAISED};
border: none; font-size: 11px;
}}
QHeaderView::section {{
background: #2e4057; color: white; padding: 5px;
background: {theme.BG_RAISED}; color: {theme.TEXT}; padding: 5px;
border: none; font-weight: bold; font-size: 11px;
}}
QTableWidget::item:selected {{ background: #2471a3; }}
QTableWidget::item:selected {{ background: {theme.ACCENT}; }}
QPushButton {{
background: #2e4057; color: white; border-radius: 5px;
background: {theme.BG_RAISED}; color: {theme.TEXT}; border-radius: 5px;
padding: 6px 14px; border: none;
}}
QPushButton:hover {{ background: #3d5166; }}
QPushButton:hover {{ background: {theme.ACCENT_HOVER}; }}
"""
@@ -51,7 +48,7 @@ class HistoryDialog(QDialog):
banner = QLabel(" 📊 Historique des sessions VPN")
banner.setFixedHeight(40)
banner.setStyleSheet(
f"background: {_DARK2}; color: white; font-size: 14px; font-weight: bold;"
f"background: {theme.BG_SUNKEN}; color: {theme.TEXT}; font-size: 14px; font-weight: bold;"
)
layout.addWidget(banner)
@@ -68,14 +65,14 @@ class HistoryDialog(QDialog):
self._table.setAlternatingRowColors(True)
self._table.setStyleSheet(
_CSS +
"QTableWidget { alternate-background-color: #212f3d; }"
f"QTableWidget {{ alternate-background-color: {theme.BG_RAISED}; }}"
)
layout.addWidget(self._table)
# Barre infos + boutons
bar = QLabel("")
bar.setFixedHeight(1)
bar.setStyleSheet(f"background: #2e4057;")
bar.setStyleSheet(f"background: {theme.BG_RAISED};")
layout.addWidget(bar)
btn_row_w = QVBoxLayout()
@@ -85,15 +82,15 @@ class HistoryDialog(QDialog):
bottom.setContentsMargins(14, 8, 14, 12)
self._summary_lbl = QLabel("")
self._summary_lbl.setStyleSheet("color: #5d6d7e; font-size: 11px;")
self._summary_lbl.setStyleSheet(f"color: {theme.TEXT_FAINT}; font-size: 11px;")
bottom.addWidget(self._summary_lbl)
bottom.addStretch()
btn_clear = QPushButton("🗑️ Effacer l'historique")
btn_clear.setStyleSheet(
"QPushButton { background: #6e2e1c; color: white; border-radius: 5px;"
f"QPushButton {{ background: {theme.FAIL_SOLID}; color: {theme.TEXT}; border-radius: 5px;"
" padding: 6px 14px; border: none; }"
"QPushButton:hover { background: #922b21; }"
"QPushButton:hover { background: #e74c3c; }"
)
btn_clear.clicked.connect(self._clear)
btn_close = QPushButton("Fermer")
@@ -102,7 +99,7 @@ class HistoryDialog(QDialog):
bottom.addWidget(btn_close)
bottom_w = QWidget()
bottom_w.setStyleSheet(f"background: {_DARK2};")
bottom_w.setStyleSheet(f"background: {theme.BG_SUNKEN};")
bottom_w.setLayout(bottom)
layout.addWidget(bottom_w)
@@ -114,7 +111,7 @@ class HistoryDialog(QDialog):
for row, s in enumerate(sessions):
self._table.insertRow(row)
end = s.get("end")
color = "#a9dfbf" if end else "#f9e79f" # vert=terminée, jaune=en cours
color = theme.OK_TEXT if end else theme.WARN_TEXT # vert=terminée, jaune=en cours
cells = [
s.get("start", ""),