statuspage: компактный блок часов, offset в секундах
- Шрифт часов 20 (был 22), bold оставлен - Убраны зазоры: padding 10px→1px, margins 12,8→4,0, spacing 8→2 - Offset в NTP-статусе: микросекунды → секунды (114.8 s) - Убран зазор (пустая строка) между NTP и Connections
This commit is contained in:
1 parent
1d5081a7cc
commit
b2653cf2e1
2 files changed
+6
-8
No files matched your search
@@ -26,21 +26,21 @@ StatusPage::StatusPage(UtunNode* node, QWidget* parent)
|
||||
, m_node(node)
|
||||
{
|
||||
auto* layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(8);
|
||||
layout->setSpacing(2);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
/* ── clock block ── */
|
||||
m_clockFrame = new QFrame(this);
|
||||
m_clockFrame->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
|
||||
m_clockFrame->setStyleSheet(
|
||||
"QFrame { border: 1px solid palette(mid); border-radius: 6px;"
|
||||
" padding: 10px; background: palette(alternate-base); }");
|
||||
"QFrame { border: 1px solid palette(mid); border-radius: 2px;"
|
||||
" padding: 1px; background: palette(alternate-base); }");
|
||||
|
||||
auto* clockLayout = new QVBoxLayout(m_clockFrame);
|
||||
clockLayout->setContentsMargins(12, 8, 12, 8);
|
||||
clockLayout->setContentsMargins(4, 0, 4, 0);
|
||||
|
||||
m_clockLabel = new QLabel("--:--:--", m_clockFrame);
|
||||
QFont clockFont("monospace", 22);
|
||||
QFont clockFont("monospace", 20);
|
||||
clockFont.setBold(true);
|
||||
m_clockLabel->setFont(clockFont);
|
||||
m_clockLabel->setAlignment(Qt::AlignCenter);
|
||||
|
||||
@@ -835,7 +835,7 @@ static void chat_core_collect_status(void) {
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "=== NTP ===\n");
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Enabled: %s\n", ntp->enabled ? "yes" : "no");
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Synced: %s\n", ntp->synced ? "yes" : "no");
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Offset: %lld us\n", (long long)ntp->offset_us);
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Offset: %.1f s\n", ntp->offset_us / 1000000.0);
|
||||
if (ntp->server_count > 0 && ntp->servers) {
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Servers: %d\n", ntp->server_count);
|
||||
for (int i = 0; i < ntp->server_count && ntp->servers[i]; i++)
|
||||
@@ -847,8 +847,6 @@ static void chat_core_collect_status(void) {
|
||||
uint64_t ago_sec = (now_tb - ntp->last_sync_tb) / 10000;
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "Last sync: %llu sec ago\n", (unsigned long long)ago_sec);
|
||||
}
|
||||
off += snprintf(buf + off, sizeof(buf) - off, "\n");
|
||||
|
||||
/* ─── Connections ─── */
|
||||
int conn_count = 0;
|
||||
struct ll_entry* entry = g_cc.inst->connections->head;
|
||||
|
||||
Reference in new issue
Block a user