diff --git a/README.md b/README.md index 50636cf..447dc97 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/qml/pages/StatusPage.qml b/qml/pages/StatusPage.qml index 3d7fa10..d40b4fe 100644 --- a/qml/pages/StatusPage.qml +++ b/qml/pages/StatusPage.qml @@ -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() diff --git a/rpm/harbour-server.spec b/rpm/harbour-server.spec index 975d4db..d42e864 100644 --- a/rpm/harbour-server.spec +++ b/rpm/harbour-server.spec @@ -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 - 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 - 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" è diff --git a/src/main.cpp b/src/main.cpp index 4260f3a..d2b8748 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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);