2022-02-20 17:55:26 +01:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Material
|
2022-07-22 12:30:50 +02:00
|
|
|
import QtQuick.Controls.Material.impl
|
2022-05-05 13:02:54 +02:00
|
|
|
import ScreenPlaySysInfo
|
2022-02-20 17:55:26 +01:00
|
|
|
|
|
|
|
Window {
|
|
|
|
id: root
|
|
|
|
width: 1366
|
|
|
|
height: 768
|
|
|
|
visible: true
|
|
|
|
title: qsTr("ScreenPlaySysInfo")
|
|
|
|
|
2022-07-22 12:30:50 +02:00
|
|
|
property color accentColor: Material.secondaryTextColor
|
2022-02-20 17:55:26 +01:00
|
|
|
property string fontFamily: "Arial"
|
2022-07-22 12:30:50 +02:00
|
|
|
property int fontPointSize: 14
|
2022-02-20 17:55:26 +01:00
|
|
|
|
|
|
|
SysInfo {
|
2022-03-12 14:30:03 +01:00
|
|
|
id: sysInfo
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
IpAddress {
|
|
|
|
id: ipAddress
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
function stringListToString(list) {
|
2023-02-02 15:25:26 +01:00
|
|
|
let out = "";
|
2022-03-12 14:30:03 +01:00
|
|
|
for (var i = 0; i < list.length; i++) {
|
2023-02-02 15:25:26 +01:00
|
|
|
out += "\n" + list[i];
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2023-02-02 15:25:26 +01:00
|
|
|
return out;
|
2022-03-12 14:30:03 +01:00
|
|
|
}
|
2022-02-20 17:55:26 +01:00
|
|
|
|
2022-07-22 12:30:50 +02:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: wrapper
|
|
|
|
anchors.margins: -50
|
|
|
|
color: Material.backgroundColor
|
|
|
|
radius: 4
|
|
|
|
|
|
|
|
layer.enabled: true
|
|
|
|
layer.effect: ElevationEffect {
|
|
|
|
elevation: 4
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
RowLayout {
|
2023-02-02 15:25:26 +01:00
|
|
|
id: wrapper
|
2022-03-12 14:30:03 +01:00
|
|
|
spacing: 40
|
2022-07-22 12:30:50 +02:00
|
|
|
anchors.centerIn: parent
|
2022-03-12 14:30:03 +01:00
|
|
|
ColumnLayout {
|
|
|
|
id: wrapperLeft
|
2022-07-22 12:30:50 +02:00
|
|
|
Layout.preferredWidth: 500
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
ColumnLayout {
|
2022-07-22 12:30:50 +02:00
|
|
|
spacing: 10
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: "Private Addresses"
|
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 24
|
|
|
|
family: root.fontFamily
|
|
|
|
}
|
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
Text {
|
2023-02-02 15:25:26 +01:00
|
|
|
text: root.stringListToString(ipAddress.privateIpV4AddressList)
|
2022-03-12 14:30:03 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: "Fira Code"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Text {
|
2023-02-02 15:25:26 +01:00
|
|
|
text: root.stringListToString(ipAddress.privateIpV6AddressList)
|
2022-03-12 14:30:03 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: "Fira Code"
|
|
|
|
}
|
|
|
|
}
|
2022-07-22 12:30:50 +02:00
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
Rectangle {
|
|
|
|
color: root.accentColor
|
2022-07-22 12:30:50 +02:00
|
|
|
Layout.preferredHeight: 3
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
Item {
|
2022-03-12 14:30:03 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
2022-07-22 12:30:50 +02:00
|
|
|
Text {
|
|
|
|
text: "Public Addresses"
|
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 24
|
|
|
|
family: root.fontFamily
|
|
|
|
}
|
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
|
|
|
|
Text {
|
|
|
|
text: ipAddress.publicIpV4Address
|
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: root.fontFamily
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: ipAddress.publicIpV6Address
|
|
|
|
color: root.accentColor
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: root.fontFamily
|
|
|
|
}
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
Rectangle {
|
2022-02-20 17:55:26 +01:00
|
|
|
color: root.accentColor
|
2022-07-22 12:30:50 +02:00
|
|
|
Layout.preferredHeight: 600
|
|
|
|
width: 3
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
ColumnLayout {
|
|
|
|
id: wrapperRight
|
2022-07-22 12:30:50 +02:00
|
|
|
spacing: 20
|
|
|
|
Layout.preferredWidth: 500
|
2022-02-20 17:55:26 +01:00
|
|
|
Text {
|
2022-03-12 14:30:03 +01:00
|
|
|
id: txtGPU
|
|
|
|
text: "GPU"
|
2022-02-20 17:55:26 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
2022-07-22 12:30:50 +02:00
|
|
|
font.pointSize: 36
|
2022-03-12 14:30:03 +01:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Text {
|
|
|
|
text: sysInfo.gpu.vendor
|
|
|
|
color: root.accentColor
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: "Fira Code"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: sysInfo.gpu.name
|
|
|
|
color: root.accentColor
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font {
|
|
|
|
pointSize: 16
|
|
|
|
family: root.fontFamily
|
|
|
|
}
|
|
|
|
}
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
|
2022-02-20 17:55:26 +01:00
|
|
|
Text {
|
2022-03-12 14:30:03 +01:00
|
|
|
id: txtUptime
|
|
|
|
text: "UPTIME"
|
2022-02-20 17:55:26 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
2022-07-22 12:30:50 +02:00
|
|
|
font.pointSize: 36
|
2022-03-12 14:30:03 +01:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
RowLayout {
|
|
|
|
id: valuesLayout
|
|
|
|
spacing: 20
|
|
|
|
Text {
|
|
|
|
text: "DAYS " + sysInfo.uptime.days
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
font.pointSize: root.fontPointSize
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: "HOURS " + sysInfo.uptime.hours
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
font.pointSize: root.fontPointSize
|
|
|
|
}
|
|
|
|
Text {
|
|
|
|
text: "MINUTES " + sysInfo.uptime.minutes
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
font.pointSize: root.fontPointSize
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: txtSeconds
|
|
|
|
text: "SECONDS " + sysInfo.uptime.seconds
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
font.pointSize: root.fontPointSize
|
|
|
|
}
|
|
|
|
}
|
2022-02-20 17:55:26 +01:00
|
|
|
Text {
|
2022-03-12 14:30:03 +01:00
|
|
|
id: txtCPU
|
|
|
|
text: "CPU"
|
2022-02-20 17:55:26 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
2022-07-22 12:30:50 +02:00
|
|
|
font.pointSize: 36
|
2022-03-12 14:30:03 +01:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2022-07-22 12:30:50 +02:00
|
|
|
RowLayout {
|
2022-03-12 14:30:03 +01:00
|
|
|
spacing: 10
|
2022-07-22 12:30:50 +02:00
|
|
|
Layout.preferredWidth: 300
|
2022-03-12 14:30:03 +01:00
|
|
|
Text {
|
|
|
|
id: txtCPUValue
|
|
|
|
text: Math.floor(sysInfo.cpu.usage)
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
width: 70
|
|
|
|
}
|
|
|
|
ProgressBar {
|
|
|
|
from: 0
|
|
|
|
to: 100
|
|
|
|
value: Math.floor(sysInfo.cpu.usage)
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-20 17:55:26 +01:00
|
|
|
Text {
|
2022-03-12 14:30:03 +01:00
|
|
|
id: txtStorage
|
|
|
|
text: "STORAGE"
|
2022-02-20 17:55:26 +01:00
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
2022-07-22 12:30:50 +02:00
|
|
|
font.pointSize: 36
|
2022-03-12 14:30:03 +01:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
2022-03-12 14:30:03 +01:00
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: storageListView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: 100
|
|
|
|
model: sysInfo.storage
|
|
|
|
delegate: Item {
|
2022-07-22 12:30:50 +02:00
|
|
|
width: 500
|
2022-03-12 14:30:03 +01:00
|
|
|
height: 40
|
2022-07-22 12:30:50 +02:00
|
|
|
RowLayout {
|
2022-03-12 14:30:03 +01:00
|
|
|
spacing: 10
|
2022-07-22 12:30:50 +02:00
|
|
|
width: 500
|
|
|
|
|
2022-03-12 14:30:03 +01:00
|
|
|
Text {
|
|
|
|
id: txtStorageName
|
|
|
|
text: name
|
|
|
|
color: root.accentColor
|
|
|
|
font.family: root.fontFamily
|
|
|
|
width: 70
|
|
|
|
}
|
|
|
|
ProgressBar {
|
|
|
|
from: 0
|
|
|
|
to: bytesTotal
|
|
|
|
value: bytesAvailable
|
2022-07-22 12:30:50 +02:00
|
|
|
Layout.fillWidth: true
|
2022-03-12 14:30:03 +01:00
|
|
|
}
|
2022-02-20 17:55:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|