SystemMonitorTab: add network polling

This commit is contained in:
Ly-sec
2025-11-27 16:10:36 +01:00
parent 4e4a974f2c
commit 3f02b28ecc
14 changed files with 73 additions and 4 deletions

View File

@@ -1845,6 +1845,9 @@
"description": "Passe die Warn-/Kritisch-Schwellen und die Abfrageintervalle für jede Systemmetrik an.",
"label": "Schwellenwerte"
},
"network-section": {
"label": "Netzwerk"
},
"title": "Systemmonitor",
"use-custom-highlight-colors": {
"description": "Wenn deaktiviert, werden die Standard-Hervorhebungsfarben des Themes verwendet.",

View File

@@ -1814,9 +1814,6 @@
"disk-warning-threshold": {
"label": "Warning threshold"
},
"network-section": {
"label": "Network"
},
"general": {
"section": {
"description": "Configure the system monitor behavior and appearance.",
@@ -1841,6 +1838,9 @@
"polling-interval": {
"label": "Polling interval"
},
"network-section": {
"label": "Network"
},
"temp-warning-threshold": {
"label": "Warning threshold"
},

View File

@@ -1845,6 +1845,9 @@
"description": "Ajusta los umbrales de advertencia/crítico y los intervalos de sondeo para cada métrica del sistema.",
"label": "Umbrales"
},
"network-section": {
"label": "Red"
},
"title": "Monitor del sistema",
"use-custom-highlight-colors": {
"description": "Cuando está desactivado, se usan los colores de resaltado predeterminados del tema.",

View File

@@ -1845,6 +1845,9 @@
"description": "Ajustez les seuils davertissement/critiques et les intervalles dinterrogation pour chaque métrique système.",
"label": "Seuils"
},
"network-section": {
"label": "Réseau"
},
"title": "Moniteur système",
"use-custom-highlight-colors": {
"description": "Lorsque cette option est désactivée, les couleurs de surbrillance par défaut du thème sont utilisées.",

View File

@@ -1845,6 +1845,9 @@
"description": "Pas de waarschuwing/kritieke drempels en de pollingsintervallen voor elke systeemmetriek aan.",
"label": "Drempels"
},
"network-section": {
"label": "Netwerk"
},
"title": "Systeemmonitor",
"use-custom-highlight-colors": {
"description": "Indien uitgeschakeld, worden de standaard markeerkleuren van het thema gebruikt.",

View File

@@ -1845,6 +1845,9 @@
"description": "Ajuste os limites de aviso/crítico e os intervalos de consulta para cada métrica do sistema.",
"label": "Limiares"
},
"network-section": {
"label": "Rede"
},
"title": "Monitor do Sistema",
"use-custom-highlight-colors": {
"description": "Quando desativado, são usadas as cores de destaque padrão do tema.",

View File

@@ -1845,6 +1845,9 @@
"description": "Настройте пороги предупреждения/критические пороги и интервалы опроса для каждой системной метрики.",
"label": "Пороги"
},
"network-section": {
"label": "Сеть"
},
"title": "Системный монитор",
"use-custom-highlight-colors": {
"description": "Если отключено, используются цвета выделения по умолчанию темы.",

View File

@@ -1845,6 +1845,9 @@
"description": "Her sistem metriği için uyarı/kritik eşiklerini ve yoklama aralıklarını ayarlayın.",
"label": "Eşikler"
},
"network-section": {
"label": "Ağ"
},
"title": "Sistem İzleme",
"use-custom-highlight-colors": {
"description": "Devre dışı bırakıldığında, tema varsayılan vurgulama renkleri kullanılır.",

View File

@@ -1845,6 +1845,9 @@
"description": "Налаштуйте пороги попередження/критичні пороги та інтервали опитування для кожного системного показника.",
"label": "Пороги"
},
"network-section": {
"label": "Мережа"
},
"title": "Системний монітор",
"use-custom-highlight-colors": {
"description": "Якщо вимкнено, використовуються кольори підсвічування за замовчуванням теми.",

View File

@@ -1845,6 +1845,9 @@
"description": "为每个系统指标调整警告/严重阈值和轮询间隔。",
"label": "阈值"
},
"network-section": {
"label": "网络"
},
"title": "系统监视器",
"use-custom-highlight-colors": {
"description": "关闭时将使用主题默认高亮颜色。",

View File

@@ -238,6 +238,7 @@
"tempPollingInterval": 3000,
"memPollingInterval": 3000,
"diskPollingInterval": 3000,
"networkPollingInterval": 3000,
"useCustomColors": false,
"warningColor": "",
"criticalColor": ""

View File

@@ -414,6 +414,7 @@ Singleton {
property int tempPollingInterval: 3000
property int memPollingInterval: 3000
property int diskPollingInterval: 3000
property int networkPollingInterval: 3000
property bool useCustomColors: false
property string warningColor: ""
property string criticalColor: ""

View File

@@ -433,4 +433,39 @@ ColumnLayout {
}
}
}
// Network
NText {
Layout.fillWidth: true
Layout.topMargin: Style.marginM
text: I18n.tr("settings.system-monitor.network-section.label")
pointSize: Style.fontSizeM
}
RowLayout {
Layout.fillWidth: true
spacing: Style.marginM
ColumnLayout {
Layout.fillWidth: true
spacing: Style.marginM
NText {
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
text: I18n.tr("settings.system-monitor.polling-interval.label")
pointSize: Style.fontSizeS
}
NSpinBox {
Layout.alignment: Qt.AlignHCenter
from: 250
to: 10000
stepSize: 250
value: Settings.data.systemMonitor.networkPollingInterval
onValueChanged: Settings.data.systemMonitor.networkPollingInterval = value
suffix: " ms"
}
}
}
}

View File

@@ -117,10 +117,15 @@ Singleton {
// Timer for network speeds
Timer {
id: networkTimer
interval: root.defaultIntervalMs
interval: root.normalizeInterval(Settings.data.systemMonitor.networkPollingInterval)
repeat: true
running: true
triggeredOnStart: true
onIntervalChanged: {
if (running) {
restart();
}
}
onTriggered: netDevFile.reload()
}