0.1.2: backup in giorni interi, verde 1-3 / giallo 4-6 / rosso 7+

This commit is contained in:
Carlo Baratto committed 2026-10-29 07:40:19 +01:00
1 parent f2e4f5ebfc
commit c73af11575
4 files changed
+24 -9

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@ Requisiti: SDK Sailfish in `~/SailfishOS`, build engine Docker.
## Installazione sul telefono
```sh
devel-su rpm -Uvh harbour-server-0.1.1-1.aarch64.rpm
devel-su rpm -Uvh harbour-server-0.1.2-1.aarch64.rpm
```
Poi, all'apertura: indicare indirizzo (es. `http://192.168.3.21:8792`) e token.
+16 -5
View File
@@ -39,13 +39,21 @@ Page {
}
function backupAge() { var d = statusClient.data; return (d && d.backups && d.backups.age_hours !== null && d.backups.age_hours !== undefined) ? d.backups.age_hours : -1 }
function backupResult() { var d = statusClient.data; return (d && d.backups && d.backups.result) ? d.backups.result : "" }
// Giorni INTERI: il valore mostrato e il colore devono raccontare la stessa
// cosa, quindi si arrotonda all'intero piu' vicino (3,6 g -> 4 = giallo).
function backupDays() {
var a = backupAge()
if (a < 0) return -1
return Math.floor(a / 24 + 0.5)
}
// Soglie (decisione utente): verde 1-3 giorni, giallo 4-6, rosso da 7 in su.
function backupLevel() {
if (backupResult() === "") return 1
if (backupResult() !== "success") return 2
var age = backupAge()
if (age < 0) return 1
if (age > 72) return 2
if (age > 36) return 1
var g = backupDays()
if (g < 0) return 1
if (g >= 7) return 2
if (g >= 4) return 1
return 0
}
function failedServices() { var d = statusClient.data; return (d && d.services && d.services.failed) ? d.services.failed.length : 0 }
@@ -186,7 +194,10 @@ Page {
x: Theme.paddingLarge
width: parent.width - 2 * Theme.paddingLarge
title: qsTr("Backup")
value: backupAge() < 0 ? "—" : statusClient.fmtAge(backupAge())
value: backupDays() < 0 ? "—"
: (backupDays() === 0 ? qsTr("meno di 1 giorno")
: (backupDays() === 1 ? qsTr("1 giorno")
: backupDays() + " " + qsTr("giorni")))
detail: backupResult() === "" ? qsTr("nessun dato") : "borg · " + backupResult()
progress: -1
level: backupLevel()
+5 -1
View File
@@ -1,6 +1,6 @@
Name: harbour-server
Summary: Parametri del server in una schermata
Version: 0.1.1
Version: 0.1.2
Release: 1
Group: Qt/Qt
License: MIT
@@ -23,6 +23,10 @@ schermata sola. Il formato consumato (schema status/1) non dipende dalla
macchina: qualunque host che serva lo stesso JSON funziona senza modifiche.
%changelog
* Wed Oct 28 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.1.2-1
- Card Backup: età in GIORNI INTERI (arrotondata, non più "41,5 h" o
"1,7 giorni") con soglie verde 1-3 giorni, giallo 4-6, rosso da 7 in su;
con Borg settimanale il rosso significa "il giro settimanale non è partito"
* Wed Oct 28 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.1.1-1
- Card Aggiornamenti: il dettaglio mostra i pacchetti in attesa e la data
delle liste apt ("liste apt: 28/10 09:09"), così un "nessuno" è
+2 -2
View File
@@ -15,9 +15,9 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
// AppConfigLocation = ~/.config/harbour/server (zona persistente).
app->setOrganizationName(QStringLiteral("harbour"));
app->setApplicationName(QStringLiteral("server"));
app->setApplicationVersion(QStringLiteral("0.1.1"));
app->setApplicationVersion(QStringLiteral("0.1.2"));
qDebug() << "harbour-server v0.1.1 build" << __DATE__ << __TIME__;
qDebug() << "harbour-server v0.1.2 build" << __DATE__ << __TIME__;
Settings settings;
StatusClient status(&settings);