47 lines
1.3 KiB
QML
47 lines
1.3 KiB
QML
pragma ComponentBehavior: Bound
|
|
|
|
import QtQuick
|
|
import "." as M
|
|
import "../services" as S
|
|
import "../applets" as C
|
|
import NovaStats as NS
|
|
|
|
M.BarModule {
|
|
id: root
|
|
active: NS.ModulesService.systemdEnable
|
|
tooltip: {
|
|
const fc = S.SystemdService.failedCount;
|
|
return fc === 0 ? "systemd: ok" : "systemd: " + fc + " failed";
|
|
}
|
|
panelNamespace: "nova-systemd"
|
|
panelContentWidth: 320
|
|
panelComponent: Component {
|
|
C.SystemdApplet {
|
|
width: parent.width
|
|
accentColor: root.accentColor
|
|
active: root._showPanel
|
|
onContentResized: root.keepPanelOpen(300)
|
|
}
|
|
}
|
|
|
|
Connections {
|
|
target: S.SystemdService
|
|
function onFailedUnitsChanged() {
|
|
root.keepPanelOpen(300);
|
|
}
|
|
}
|
|
|
|
readonly property color _stateColor: S.SystemdService.failedCount > 0 ? NS.ThemeService.base0A : root.accentColor
|
|
|
|
M.BarIcon {
|
|
icon: ""
|
|
color: root._stateColor
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
M.BarLabel {
|
|
label: S.SystemdService.failedCount > 0 ? S.SystemdService.failedCount + " failed" : "ok"
|
|
minText: "0 failed"
|
|
color: root._stateColor
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
}
|
|
}
|