mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
second path to enable GPU temps
This commit is contained in:
@@ -18,6 +18,8 @@ Singleton {
|
|||||||
property bool doNotDisturb: false
|
property bool doNotDisturb: false
|
||||||
property var pinnedApps: []
|
property var pinnedApps: []
|
||||||
property int selectedGpuIndex: 0
|
property int selectedGpuIndex: 0
|
||||||
|
property bool nvidiaGpuTempEnabled: false
|
||||||
|
property bool nonNvidiaGpuTempEnabled: false
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
loadSettings()
|
loadSettings()
|
||||||
@@ -39,6 +41,8 @@ Singleton {
|
|||||||
doNotDisturb = settings.doNotDisturb !== undefined ? settings.doNotDisturb : false
|
doNotDisturb = settings.doNotDisturb !== undefined ? settings.doNotDisturb : false
|
||||||
pinnedApps = settings.pinnedApps !== undefined ? settings.pinnedApps : []
|
pinnedApps = settings.pinnedApps !== undefined ? settings.pinnedApps : []
|
||||||
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
|
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
|
||||||
|
nvidiaGpuTempEnabled = settings.nvidiaGpuTempEnabled !== undefined ? settings.nvidiaGpuTempEnabled : false
|
||||||
|
nonNvidiaGpuTempEnabled = settings.nonNvidiaGpuTempEnabled !== undefined ? settings.nonNvidiaGpuTempEnabled : false
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
||||||
@@ -53,7 +57,9 @@ Singleton {
|
|||||||
"profileLastPath": profileLastPath,
|
"profileLastPath": profileLastPath,
|
||||||
"doNotDisturb": doNotDisturb,
|
"doNotDisturb": doNotDisturb,
|
||||||
"pinnedApps": pinnedApps,
|
"pinnedApps": pinnedApps,
|
||||||
"selectedGpuIndex": selectedGpuIndex
|
"selectedGpuIndex": selectedGpuIndex,
|
||||||
|
"nvidiaGpuTempEnabled": nvidiaGpuTempEnabled,
|
||||||
|
"nonNvidiaGpuTempEnabled": nonNvidiaGpuTempEnabled
|
||||||
}, null, 2))
|
}, null, 2))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +129,16 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setNvidiaGpuTempEnabled(enabled) {
|
||||||
|
nvidiaGpuTempEnabled = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNonNvidiaGpuTempEnabled(enabled) {
|
||||||
|
nonNvidiaGpuTempEnabled = enabled
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: settingsFile
|
id: settingsFile
|
||||||
|
|
||||||
|
|||||||
@@ -1,397 +1,414 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
SysMonitorService.addRef()
|
SysMonitorService.addRef();
|
||||||
}
|
|
||||||
Component.onDestruction: {
|
|
||||||
SysMonitorService.removeRef()
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: (parent.width - Theme.spacingM * 2) / 3
|
|
||||||
height: 80
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (SysMonitorService.sortBy === "cpu")
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16)
|
|
||||||
else if (cpuCardMouseArea.containsMouse)
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08)
|
|
||||||
}
|
}
|
||||||
border.color: SysMonitorService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r,
|
Component.onDestruction: {
|
||||||
Theme.primary.g,
|
SysMonitorService.removeRef();
|
||||||
Theme.primary.b,
|
|
||||||
0.4) : Qt.rgba(
|
|
||||||
Theme.primary.r,
|
|
||||||
Theme.primary.g,
|
|
||||||
Theme.primary.b, 0.2)
|
|
||||||
border.width: SysMonitorService.sortBy === "cpu" ? 2 : 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: cpuCardMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: SysMonitorService.setSortBy("cpu")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Rectangle {
|
||||||
anchors.left: parent.left
|
width: (parent.width - Theme.spacingM * 2) / 3
|
||||||
anchors.leftMargin: Theme.spacingM
|
height: 80
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
radius: Theme.cornerRadius
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "CPU"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: SysMonitorService.sortBy === "cpu" ? Theme.primary : Theme.secondary
|
|
||||||
opacity: SysMonitorService.sortBy === "cpu" ? 1 : 0.8
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: SysMonitorService.totalCpuUsage.toFixed(1) + "%"
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 1
|
|
||||||
height: 20
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
|
||||||
Theme.surfaceText.b, 0.3)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (SysMonitorService.cpuTemperature === undefined
|
|
||||||
|| SysMonitorService.cpuTemperature === null
|
|
||||||
|| SysMonitorService.cpuTemperature < 0) {
|
|
||||||
return "--°"
|
|
||||||
}
|
|
||||||
return Math.round(SysMonitorService.cpuTemperature) + "°"
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: {
|
|
||||||
if (SysMonitorService.cpuTemperature > 80)
|
|
||||||
return Theme.error
|
|
||||||
if (SysMonitorService.cpuTemperature > 60)
|
|
||||||
return Theme.warning
|
|
||||||
return Theme.surfaceText
|
|
||||||
}
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: SysMonitorService.cpuCount + " cores"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: (parent.width - Theme.spacingM * 2) / 3
|
|
||||||
height: 80
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (SysMonitorService.sortBy === "memory")
|
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16)
|
|
||||||
else if (memoryCardMouseArea.containsMouse)
|
|
||||||
return Qt.rgba(Theme.secondary.r, Theme.secondary.g,
|
|
||||||
Theme.secondary.b, 0.12)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.secondary.r, Theme.secondary.g,
|
|
||||||
Theme.secondary.b, 0.08)
|
|
||||||
}
|
|
||||||
border.color: SysMonitorService.sortBy === "memory" ? Qt.rgba(
|
|
||||||
Theme.primary.r,
|
|
||||||
Theme.primary.g,
|
|
||||||
Theme.primary.b,
|
|
||||||
0.4) : Qt.rgba(
|
|
||||||
Theme.secondary.r,
|
|
||||||
Theme.secondary.g,
|
|
||||||
Theme.secondary.b,
|
|
||||||
0.2)
|
|
||||||
border.width: SysMonitorService.sortBy === "memory" ? 2 : 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: memoryCardMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: SysMonitorService.setSortBy("memory")
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Memory"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: SysMonitorService.sortBy === "memory" ? Theme.primary : Theme.secondary
|
|
||||||
opacity: SysMonitorService.sortBy === "memory" ? 1 : 0.8
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: SysMonitorService.formatSystemMemory(
|
|
||||||
SysMonitorService.usedMemoryKB)
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 1
|
|
||||||
height: 20
|
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
|
||||||
Theme.surfaceText.b, 0.3)
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: SysMonitorService.totalSwapKB > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: SysMonitorService.totalSwapKB > 0 ? SysMonitorService.formatSystemMemory(
|
|
||||||
SysMonitorService.usedSwapKB) : ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: SysMonitorService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: SysMonitorService.totalSwapKB > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (SysMonitorService.totalSwapKB > 0) {
|
|
||||||
return "of " + SysMonitorService.formatSystemMemory(
|
|
||||||
SysMonitorService.totalMemoryKB) + " + swap"
|
|
||||||
}
|
|
||||||
return "of " + SysMonitorService.formatSystemMemory(
|
|
||||||
SysMonitorService.totalMemoryKB)
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
color: Theme.surfaceText
|
|
||||||
opacity: 0.7
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on border.color {
|
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: (parent.width - Theme.spacingM * 2) / 3
|
|
||||||
height: 80
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
|
||||||
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08)
|
|
||||||
}
|
|
||||||
|
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
|
||||||
var vendor = gpu.vendor.toLowerCase()
|
|
||||||
|
|
||||||
if (vendor.includes("nvidia")) {
|
|
||||||
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12)
|
|
||||||
} else if (vendor.includes("amd")) {
|
|
||||||
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
|
||||||
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
|
|
||||||
} else if (vendor.includes("intel")) {
|
|
||||||
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
|
||||||
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16)
|
|
||||||
else
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08)
|
|
||||||
}
|
|
||||||
border.color: {
|
|
||||||
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
|
|
||||||
}
|
|
||||||
|
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
|
||||||
var vendor = gpu.vendor.toLowerCase()
|
|
||||||
|
|
||||||
if (vendor.includes("nvidia")) {
|
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3)
|
|
||||||
} else if (vendor.includes("amd")) {
|
|
||||||
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3)
|
|
||||||
} else if (vendor.includes("intel")) {
|
|
||||||
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
|
|
||||||
}
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: gpuCardMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: SysMonitorService.availableGpus.length
|
|
||||||
> 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
onClicked: {
|
|
||||||
if (SysMonitorService.availableGpus.length > 1) {
|
|
||||||
var nextIndex = (SessionData.selectedGpuIndex + 1)
|
|
||||||
% SysMonitorService.availableGpus.length
|
|
||||||
SessionData.setSelectedGpuIndex(nextIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: 2
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "GPU"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.secondary
|
|
||||||
opacity: 0.8
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: {
|
|
||||||
if (!SysMonitorService.availableGpus
|
|
||||||
|| SysMonitorService.availableGpus.length === 0) {
|
|
||||||
return "No GPU"
|
|
||||||
}
|
|
||||||
|
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(
|
|
||||||
SessionData.selectedGpuIndex,
|
|
||||||
SysMonitorService.availableGpus.length - 1)]
|
|
||||||
var temp = gpu.temperature
|
|
||||||
var hasTemp = temp !== undefined && temp !== null && temp !== 0
|
|
||||||
|
|
||||||
if (hasTemp) {
|
|
||||||
return Math.round(temp) + "°"
|
|
||||||
} else {
|
|
||||||
return gpu.vendor
|
|
||||||
}
|
|
||||||
}
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.family: SettingsData.monoFontFamily
|
|
||||||
font.weight: Font.Bold
|
|
||||||
color: {
|
color: {
|
||||||
if (!SysMonitorService.availableGpus
|
if (SysMonitorService.sortBy === "cpu")
|
||||||
|| SysMonitorService.availableGpus.length === 0) {
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
||||||
return Theme.surfaceText
|
else if (cpuCardMouseArea.containsMouse)
|
||||||
}
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
||||||
|
else
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
||||||
SessionData.selectedGpuIndex,
|
|
||||||
SysMonitorService.availableGpus.length - 1)]
|
|
||||||
var temp = gpu.temperature || 0
|
|
||||||
if (temp > 80)
|
|
||||||
return Theme.error
|
|
||||||
if (temp > 60)
|
|
||||||
return Theme.warning
|
|
||||||
return Theme.surfaceText
|
|
||||||
}
|
}
|
||||||
}
|
border.color: SysMonitorService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2)
|
||||||
|
border.width: SysMonitorService.sortBy === "cpu" ? 2 : 1
|
||||||
|
|
||||||
StyledText {
|
MouseArea {
|
||||||
text: {
|
id: cpuCardMouseArea
|
||||||
if (!SysMonitorService.availableGpus
|
|
||||||
|| SysMonitorService.availableGpus.length === 0) {
|
|
||||||
return "No GPUs detected"
|
|
||||||
}
|
|
||||||
|
|
||||||
var gpu = SysMonitorService.availableGpus[Math.min(
|
anchors.fill: parent
|
||||||
SessionData.selectedGpuIndex,
|
hoverEnabled: true
|
||||||
SysMonitorService.availableGpus.length - 1)]
|
cursorShape: Qt.PointingHandCursor
|
||||||
var temp = gpu.temperature
|
onClicked: SysMonitorService.setSortBy("cpu")
|
||||||
var hasTemp = temp !== undefined && temp !== null && temp !== 0
|
|
||||||
|
|
||||||
if (hasTemp) {
|
|
||||||
return gpu.vendor + " " + gpu.displayName
|
|
||||||
} else {
|
|
||||||
return gpu.displayName
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
font.family: SettingsData.monoFontFamily
|
Column {
|
||||||
color: Theme.surfaceText
|
anchors.left: parent.left
|
||||||
opacity: 0.7
|
anchors.leftMargin: Theme.spacingM
|
||||||
width: parent.parent.width - Theme.spacingM * 2
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
elide: Text.ElideRight
|
spacing: 2
|
||||||
maximumLineCount: 1
|
|
||||||
}
|
StyledText {
|
||||||
|
text: "CPU"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: SysMonitorService.sortBy === "cpu" ? Theme.primary : Theme.secondary
|
||||||
|
opacity: SysMonitorService.sortBy === "cpu" ? 1 : 0.8
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: SysMonitorService.totalCpuUsage.toFixed(1) + "%"
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
font.weight: Font.Bold
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 1
|
||||||
|
height: 20
|
||||||
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
if (SysMonitorService.cpuTemperature === undefined || SysMonitorService.cpuTemperature === null || SysMonitorService.cpuTemperature < 0)
|
||||||
|
return "--°";
|
||||||
|
|
||||||
|
return Math.round(SysMonitorService.cpuTemperature) + "°";
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: {
|
||||||
|
if (SysMonitorService.cpuTemperature > 80)
|
||||||
|
return Theme.error;
|
||||||
|
|
||||||
|
if (SysMonitorService.cpuTemperature > 60)
|
||||||
|
return Theme.warning;
|
||||||
|
|
||||||
|
return Theme.surfaceText;
|
||||||
|
}
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: SysMonitorService.cpuCount + " cores"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
color: Theme.surfaceText
|
||||||
|
opacity: 0.7
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on border.color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
Rectangle {
|
||||||
ColorAnimation {
|
width: (parent.width - Theme.spacingM * 2) / 3
|
||||||
duration: Theme.shortDuration
|
height: 80
|
||||||
}
|
radius: Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (SysMonitorService.sortBy === "memory")
|
||||||
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
||||||
|
else if (memoryCardMouseArea.containsMouse)
|
||||||
|
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08);
|
||||||
|
}
|
||||||
|
border.color: SysMonitorService.sortBy === "memory" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.2)
|
||||||
|
border.width: SysMonitorService.sortBy === "memory" ? 2 : 1
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: memoryCardMouseArea
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: SysMonitorService.setSortBy("memory")
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Memory"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: SysMonitorService.sortBy === "memory" ? Theme.primary : Theme.secondary
|
||||||
|
opacity: SysMonitorService.sortBy === "memory" ? 1 : 0.8
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: SysMonitorService.formatSystemMemory(SysMonitorService.usedMemoryKB)
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
font.weight: Font.Bold
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 1
|
||||||
|
height: 20
|
||||||
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: SysMonitorService.totalSwapKB > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: SysMonitorService.totalSwapKB > 0 ? SysMonitorService.formatSystemMemory(SysMonitorService.usedSwapKB) : ""
|
||||||
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: SysMonitorService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: SysMonitorService.totalSwapKB > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
if (SysMonitorService.totalSwapKB > 0)
|
||||||
|
return "of " + SysMonitorService.formatSystemMemory(SysMonitorService.totalMemoryKB) + " + swap";
|
||||||
|
|
||||||
|
return "of " + SysMonitorService.formatSystemMemory(SysMonitorService.totalMemoryKB);
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
color: Theme.surfaceText
|
||||||
|
opacity: 0.7
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on border.color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Rectangle {
|
||||||
|
width: (parent.width - Theme.spacingM * 2) / 3
|
||||||
|
height: 80
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
||||||
|
}
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)];
|
||||||
|
var vendor = gpu.vendor.toLowerCase();
|
||||||
|
if (vendor.includes("nvidia")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12);
|
||||||
|
} else if (vendor.includes("amd")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
|
||||||
|
} else if (vendor.includes("intel")) {
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12);
|
||||||
|
}
|
||||||
|
if (gpuCardMouseArea.containsMouse && SysMonitorService.availableGpus.length > 1)
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
||||||
|
else
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
||||||
|
}
|
||||||
|
border.color: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0)
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)];
|
||||||
|
var vendor = gpu.vendor.toLowerCase();
|
||||||
|
if (vendor.includes("nvidia"))
|
||||||
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3);
|
||||||
|
else if (vendor.includes("amd"))
|
||||||
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3);
|
||||||
|
else if (vendor.includes("intel"))
|
||||||
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3);
|
||||||
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
|
||||||
|
}
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: gpuCardMouseArea
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
cursorShape: SysMonitorService.availableGpus.length > 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
if (mouse.button === Qt.LeftButton) {
|
||||||
|
if (SysMonitorService.availableGpus.length > 1) {
|
||||||
|
var nextIndex = (SessionData.selectedGpuIndex + 1) % SysMonitorService.availableGpus.length;
|
||||||
|
SessionData.setSelectedGpuIndex(nextIndex);
|
||||||
|
}
|
||||||
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
|
gpuContextMenu.popup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "GPU"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.secondary
|
||||||
|
opacity: 0.8
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0)
|
||||||
|
return "No GPU";
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)];
|
||||||
|
var temp = gpu.temperature;
|
||||||
|
var hasTemp = temp !== undefined && temp !== null && temp !== 0;
|
||||||
|
if (hasTemp)
|
||||||
|
return Math.round(temp) + "°";
|
||||||
|
else
|
||||||
|
return gpu.vendor;
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
font.weight: Font.Bold
|
||||||
|
color: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0)
|
||||||
|
return Theme.surfaceText;
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)];
|
||||||
|
var temp = gpu.temperature || 0;
|
||||||
|
if (temp > 80)
|
||||||
|
return Theme.error;
|
||||||
|
|
||||||
|
if (temp > 60)
|
||||||
|
return Theme.warning;
|
||||||
|
|
||||||
|
return Theme.surfaceText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0)
|
||||||
|
return "No GPUs detected";
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)];
|
||||||
|
var temp = gpu.temperature;
|
||||||
|
var hasTemp = temp !== undefined && temp !== null && temp !== 0;
|
||||||
|
if (hasTemp)
|
||||||
|
return gpu.vendor + " " + gpu.displayName;
|
||||||
|
else
|
||||||
|
return gpu.displayName;
|
||||||
|
}
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
font.family: SettingsData.monoFontFamily
|
||||||
|
color: Theme.surfaceText
|
||||||
|
opacity: 0.7
|
||||||
|
width: parent.parent.width - Theme.spacingM * 2
|
||||||
|
elide: Text.ElideRight
|
||||||
|
maximumLineCount: 1
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: gpuContextMenu
|
||||||
|
|
||||||
|
MenuItem {
|
||||||
|
text: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
return "Enable GPU Temperature"
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var isNvidia = gpu.vendor.toLowerCase().includes("nvidia")
|
||||||
|
return isNvidia ? "Enable GPU Temperature" : "Enable GPU Temperature"
|
||||||
|
}
|
||||||
|
checkable: true
|
||||||
|
checked: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var isNvidia = gpu.vendor.toLowerCase().includes("nvidia")
|
||||||
|
return isNvidia ? SysMonitorService.nvidiaGpuTempEnabled : SysMonitorService.nonNvidiaGpuTempEnabled
|
||||||
|
}
|
||||||
|
onTriggered: {
|
||||||
|
if (!SysMonitorService.availableGpus || SysMonitorService.availableGpus.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var gpu = SysMonitorService.availableGpus[Math.min(SessionData.selectedGpuIndex, SysMonitorService.availableGpus.length - 1)]
|
||||||
|
var isNvidia = gpu.vendor.toLowerCase().includes("nvidia")
|
||||||
|
|
||||||
|
if (isNvidia) {
|
||||||
|
SessionData.setNvidiaGpuTempEnabled(checked)
|
||||||
|
} else {
|
||||||
|
SessionData.setNonNvidiaGpuTempEnabled(checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,38 +58,9 @@ PanelWindow {
|
|||||||
return widgetId === "gpuTemp" && widgetEnabled
|
return widgetId === "gpuTemp" && widgetEnabled
|
||||||
})
|
})
|
||||||
|
|
||||||
let hasNvidiaGpuWidget = false
|
SysMonitorService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
|
||||||
let hasNonNvidiaGpuWidget = false
|
SysMonitorService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
|
||||||
|
SysMonitorService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
|
||||||
if (hasGpuTempWidget) {
|
|
||||||
hasNvidiaGpuWidget = allWidgets.some(widget => {
|
|
||||||
const widgetId = typeof widget === "string" ? widget : widget.id
|
|
||||||
const widgetEnabled = typeof widget === "string" ? true : (widget.enabled !== false)
|
|
||||||
if (widgetId !== "gpuTemp" || !widgetEnabled) return false
|
|
||||||
|
|
||||||
const selectedGpuIndex = typeof widget === "string" ? 0 : (widget.selectedGpuIndex || 0)
|
|
||||||
if (SysMonitorService.availableGpus && SysMonitorService.availableGpus[selectedGpuIndex]) {
|
|
||||||
return SysMonitorService.availableGpus[selectedGpuIndex].driver === "nvidia"
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
})
|
|
||||||
|
|
||||||
hasNonNvidiaGpuWidget = allWidgets.some(widget => {
|
|
||||||
const widgetId = typeof widget === "string" ? widget : widget.id
|
|
||||||
const widgetEnabled = typeof widget === "string" ? true : (widget.enabled !== false)
|
|
||||||
if (widgetId !== "gpuTemp" || !widgetEnabled) return false
|
|
||||||
|
|
||||||
const selectedGpuIndex = typeof widget === "string" ? 0 : (widget.selectedGpuIndex || 0)
|
|
||||||
if (SysMonitorService.availableGpus && SysMonitorService.availableGpus[selectedGpuIndex]) {
|
|
||||||
return SysMonitorService.availableGpus[selectedGpuIndex].driver !== "nvidia"
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SysMonitorService.gpuTempEnabled = hasGpuTempWidget
|
|
||||||
SysMonitorService.nvidiaGpuTempEnabled = hasNvidiaGpuWidget
|
|
||||||
SysMonitorService.nonNvidiaGpuTempEnabled = hasNonNvidiaGpuWidget
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -111,6 +82,18 @@ PanelWindow {
|
|||||||
|
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
function onNvidiaGpuTempEnabledChanged() {
|
||||||
|
root.updateGpuTempConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
function onNonNvidiaGpuTempEnabledChanged() {
|
||||||
|
root.updateGpuTempConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
target: SessionData
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.screen
|
target: root.screen
|
||||||
|
|||||||
@@ -294,7 +294,12 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateGpuTemperatures(tempData) {
|
function updateGpuTemperatures(tempData) {
|
||||||
if (availableGpus.length === 0 || tempData.length === 0) return
|
if (availableGpus.length === 0) return
|
||||||
|
|
||||||
|
if (!gpuTempEnabled || tempData.length === 0) {
|
||||||
|
clearGpuTemperatures()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const updatedGpus = []
|
const updatedGpus = []
|
||||||
for (let i = 0; i < availableGpus.length; i++) {
|
for (let i = 0; i < availableGpus.length; i++) {
|
||||||
@@ -325,6 +330,25 @@ Singleton {
|
|||||||
availableGpus = updatedGpus
|
availableGpus = updatedGpus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearGpuTemperatures() {
|
||||||
|
if (availableGpus.length === 0) return
|
||||||
|
|
||||||
|
const clearedGpus = []
|
||||||
|
for (let i = 0; i < availableGpus.length; i++) {
|
||||||
|
const gpu = availableGpus[i]
|
||||||
|
clearedGpus.push({
|
||||||
|
"driver": gpu.driver,
|
||||||
|
"vendor": gpu.vendor,
|
||||||
|
"displayName": gpu.displayName,
|
||||||
|
"fullName": gpu.fullName,
|
||||||
|
"pciId": gpu.pciId,
|
||||||
|
"temperature": 0,
|
||||||
|
"hwmon": "unknown"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
availableGpus = clearedGpus
|
||||||
|
}
|
||||||
|
|
||||||
function parseUnifiedStats(text) {
|
function parseUnifiedStats(text) {
|
||||||
function num(x) {
|
function num(x) {
|
||||||
return (typeof x === "number" && !isNaN(x)) ? x : 0
|
return (typeof x === "number" && !isNaN(x)) ? x : 0
|
||||||
|
|||||||
Reference in New Issue
Block a user