39 lines
2.3 KiB
QML
39 lines
2.3 KiB
QML
pragma ComponentBehavior: Bound
|
||
import QtQuick
|
||
import QtQuick.Controls
|
||
import QtQuick.Controls.Material
|
||
import QtQuick.Layouts
|
||
import "services"
|
||
|
||
ScrollView {
|
||
id: root
|
||
contentWidth: availableWidth
|
||
clip: true
|
||
ColumnLayout {
|
||
width: root.availableWidth
|
||
spacing: 12
|
||
Label { text: "О системе"; font.pixelSize: 24; font.bold: true; color: Theme.primary }
|
||
Label { text: "Сведения обновляются автоматически. Изменение параметров системы здесь не выполняется."; wrapMode: Text.Wrap; Layout.fillWidth: true; color: Theme.outline }
|
||
Label { visible: SystemInfo.error.length > 0; text: SystemInfo.error; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||
Repeater {
|
||
model: [
|
||
{label: "Операционная система", value: SystemInfo.details.os || "—"},
|
||
{label: "Ядро Linux", value: SystemInfo.details.kernel || "—"},
|
||
{label: "Архитектура", value: SystemInfo.details.architecture || "—"},
|
||
{label: "Имя устройства", value: SystemInfo.details.hostname || "—"},
|
||
{label: "Оперативная память", value: SystemInfo.details.memoryTotalMiB ? (Math.round(SystemInfo.details.memoryTotalMiB / 102.4) / 10) + " ГиБ" : "—"},
|
||
{label: "Доступная память", value: SystemInfo.details.memoryAvailableMiB ? (Math.round(SystemInfo.details.memoryAvailableMiB / 102.4) / 10) + " ГиБ" : "—"},
|
||
{label: "Время работы", value: SystemInfo.details.uptimeSeconds !== undefined ? Math.floor(SystemInfo.details.uptimeSeconds / 3600) + " ч " + Math.floor(SystemInfo.details.uptimeSeconds % 3600 / 60) + " мин" : "—"}
|
||
]
|
||
ColumnLayout {
|
||
required property var modelData
|
||
Layout.fillWidth: true
|
||
spacing: 2
|
||
Label { text: modelData.label; font.pixelSize: 12; color: Theme.outline }
|
||
Label { text: modelData.value; font.pixelSize: 16; color: Theme.foreground; wrapMode: Text.Wrap; Layout.fillWidth: true }
|
||
}
|
||
}
|
||
Button { text: "Обновить"; enabled: !SystemInfo.busy; onClicked: SystemInfo.refresh() }
|
||
}
|
||
}
|