Fix CSS errors (remove unsupported properties), fix missing _fetch_ips_once method

This commit is contained in:
2026-03-31 21:04:41 -05:00
parent 25f07a6016
commit be61de7a2d
2 changed files with 17 additions and 22 deletions

View File

@@ -66,7 +66,6 @@ REBOOT_COMMAND = [
] ]
UPDATE_CHECK_INTERVAL = 1800 UPDATE_CHECK_INTERVAL = 1800
TILE_GRID_WIDTH = 820 TILE_GRID_WIDTH = 820
@@ -374,8 +373,8 @@ class SovranHubWindow(Adw.ApplicationWindow):
super().__init__( super().__init__(
application=app, application=app,
title="Sovran_SystemsOS Hub", title="Sovran_SystemsOS Hub",
default_width=680, default_width=860,
default_height=780, default_height=800,
) )
self._config = config self._config = config
self._tiles = [] self._tiles = []
@@ -487,7 +486,6 @@ class SovranHubWindow(Adw.ApplicationWindow):
GLib.timeout_add_seconds(5, self._check_for_updates_once) GLib.timeout_add_seconds(5, self._check_for_updates_once)
GLib.timeout_add_seconds(UPDATE_CHECK_INTERVAL, self._periodic_update_check) GLib.timeout_add_seconds(UPDATE_CHECK_INTERVAL, self._periodic_update_check)
GLib.timeout_add_seconds(1, self._fetch_ips_once) GLib.timeout_add_seconds(1, self._fetch_ips_once)
# ── IP Address Bar ─────────────────────────────────────────── # ── IP Address Bar ───────────────────────────────────────────
@@ -515,7 +513,7 @@ class SovranHubWindow(Adw.ApplicationWindow):
) )
internal_label = Gtk.Label( internal_label = Gtk.Label(
label="Internal:", label="Internal:",
css_classes=["ip-label", "dim-label"], css_classes=["dim-label"],
) )
self._internal_ip_label = Gtk.Label( self._internal_ip_label = Gtk.Label(
label="", label="",
@@ -539,7 +537,7 @@ class SovranHubWindow(Adw.ApplicationWindow):
) )
external_label = Gtk.Label( external_label = Gtk.Label(
label="External:", label="External:",
css_classes=["ip-label", "dim-label"], css_classes=["dim-label"],
) )
self._external_ip_label = Gtk.Label( self._external_ip_label = Gtk.Label(
label="", label="",
@@ -556,6 +554,17 @@ class SovranHubWindow(Adw.ApplicationWindow):
return bar return bar
def _fetch_ips_once(self):
thread = threading.Thread(target=self._do_fetch_ips, daemon=True)
thread.start()
return False
def _do_fetch_ips(self):
internal = _get_internal_ip()
GLib.idle_add(self._internal_ip_label.set_label, internal)
external = _get_external_ip()
GLib.idle_add(self._external_ip_label.set_label, external)
# ── Title box ──────────────────────────────────────────────── # ── Title box ────────────────────────────────────────────────
def _build_title_box(self): def _build_title_box(self):
@@ -715,4 +724,4 @@ class SovranHubApp(Adw.Application):
win = self.get_active_window() win = self.get_active_window()
if not win: if not win:
win = SovranHubWindow(self, self._config) win = SovranHubWindow(self, self._config)
win.present() win.present()

View File

@@ -1,12 +1,9 @@
/* ── Tile (locked dimensions) ──────────────────────────────── */ /* ── Tile (locked dimensions via GTK min-width/height only) ── */
.sovran-tile { .sovran-tile {
border-radius: 18px; border-radius: 18px;
padding: 0px; padding: 0px;
min-width: 180px; min-width: 180px;
max-width: 180px;
min-height: 210px; min-height: 210px;
max-height: 210px;
overflow: hidden;
transition: box-shadow 200ms ease-in-out; transition: box-shadow 200ms ease-in-out;
} }
.sovran-tile:hover { .sovran-tile:hover {
@@ -15,16 +12,13 @@
/* ── Tile text ─────────────────────────────────────────────── */ /* ── Tile text ─────────────────────────────────────────────── */
.tile-name { .tile-name {
font-size: 1.0em;
font-weight: bold; font-weight: bold;
} }
.tile-status { .tile-status {
font-size: 0.9em;
} }
/* ── Section headers ───────────────────────────────────────── */ /* ── Section headers ───────────────────────────────────────── */
.section-header { .section-header {
font-size: 1.3em;
font-weight: bold; font-weight: bold;
} }
@@ -36,25 +30,21 @@
/* ── Header / role ─────────────────────────────────────────── */ /* ── Header / role ─────────────────────────────────────────── */
.hub-title { .hub-title {
font-size: 1.2em;
font-weight: bold; font-weight: bold;
} }
.role-badge { .role-badge {
padding: 2px 8px; padding: 2px 8px;
border-radius: 4px; border-radius: 4px;
font-size: 0.85em;
} }
/* ── Update indicator ──────────────────────────────────────── */ /* ── Update indicator ──────────────────────────────────────── */
.update-badge { .update-badge {
color: #2ec27e; color: #2ec27e;
font-size: 1.3em;
font-weight: bold; font-weight: bold;
} }
.update-available { .update-available {
background: #2ec27e; background: #2ec27e;
color: white; color: white;
font-size: 1.0em;
} }
.update-available:hover { .update-available:hover {
background: #26a269; background: #26a269;
@@ -66,13 +56,9 @@
border-radius: 10px; border-radius: 10px;
background: alpha(@card_bg_color, 0.5); background: alpha(@card_bg_color, 0.5);
} }
.ip-label {
font-size: 0.95em;
}
.ip-value { .ip-value {
font-family: monospace; font-family: monospace;
font-weight: bold; font-weight: bold;
font-size: 1.0em;
color: @accent_color; color: @accent_color;
} }