harbour-server 0.1.0: schermata parametri server (schema status/1)
Prima release dell'app Sailfish: schermata unica con CPU, memoria, disco, container, backup, servizi, SSH, aggiornamenti e VPN, letti da un endpoint read-only /v1/status. Soglie giallo/rosso, aggiornamento ogni 60 s, copertina, impostazioni con indirizzo e token.
This commit is contained in:
commit
24e1f3b376
20 files changed
+1112
No files matched your search
@@ -0,0 +1,52 @@
|
||||
import QtQuick 2.0
|
||||
import Sailfish.Silica 1.0
|
||||
|
||||
CoverBackground {
|
||||
id: cover
|
||||
|
||||
// Guardie: quando lo snapshot non è ancora arrivato i campi mancano e in
|
||||
// JS leggere una proprietà di undefined solleva un'eccezione.
|
||||
function num(v, fallback) {
|
||||
return (v === undefined || v === null) ? fallback : v
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 2 * Theme.paddingLarge
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
Label {
|
||||
text: "Server"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.secondaryColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
text: statusClient.error !== "" ? "—" : statusClient.fmtNum(num(statusClient.data.cpu ? statusClient.data.cpu.percent : undefined, -1), 0) + " %"
|
||||
font.pixelSize: Theme.fontSizeExtraLarge
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
text: "CPU"
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.secondaryColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
text: statusClient.fetchedAt !== "" ? statusClient.fetchedAt : ""
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
color: Theme.secondaryColor
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
CoverActionList {
|
||||
CoverAction {
|
||||
iconSource: "image://theme/icon-cover-refresh"
|
||||
onTriggered: statusClient.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user