0.1.1: card Aggiornamenti verificabile (pacchetti + data liste apt)
This commit is contained in:
1 parent
a8486a4115
commit
f2e4f5ebfc
6 files changed
+41
-5
No files matched your search
@@ -34,7 +34,7 @@ Requisiti: SDK Sailfish in `~/SailfishOS`, build engine Docker.
|
||||
## Installazione sul telefono
|
||||
|
||||
```sh
|
||||
devel-su rpm -Uvh harbour-server-0.1.0-1.aarch64.rpm
|
||||
devel-su rpm -Uvh harbour-server-0.1.1-1.aarch64.rpm
|
||||
```
|
||||
|
||||
Poi, all'apertura: indicare indirizzo (es. `http://192.168.3.21:8792`) e token.
|
||||
|
||||
@@ -52,6 +52,23 @@ Page {
|
||||
function sshFailed() { var d = statusClient.data; return (d && d.access && d.access.ssh_failed_24h !== undefined) ? d.access.ssh_failed_24h : 0 }
|
||||
function updatesTotal() { var d = statusClient.data; return (d && d.updates && d.updates.total !== undefined) ? d.updates.total : 0 }
|
||||
function updatesSecurity() { var d = statusClient.data; return (d && d.updates && d.updates.security !== undefined) ? d.updates.security : 0 }
|
||||
function updatesPackages() {
|
||||
var d = statusClient.data
|
||||
return (d && d.updates && d.updates.packages) ? d.updates.packages : []
|
||||
}
|
||||
// Il dettaglio deve rendere verificabile uno zero: senza la data delle
|
||||
// liste apt "nessun aggiornamento" e' indistinguibile da "non ho guardato".
|
||||
function updatesDetail() {
|
||||
var d = statusClient.data
|
||||
if (!d || !d.updates) return ""
|
||||
var parts = []
|
||||
if (d.updates.total > 0 && updatesPackages().length > 0)
|
||||
parts.push(updatesPackages().join(", "))
|
||||
parts.push(qsTr("di sicurezza: ") + updatesSecurity())
|
||||
if (d.updates.lists_updated_at)
|
||||
parts.push(qsTr("liste apt: ") + statusClient.fmtStamp(d.updates.lists_updated_at))
|
||||
return parts.join(" · ")
|
||||
}
|
||||
function vpnText() {
|
||||
var d = statusClient.data
|
||||
if (!d || !d.net || !d.net.interfaces || d.net.interfaces.length === 0) return "nessuna"
|
||||
@@ -200,7 +217,7 @@ Page {
|
||||
width: parent.width - 2 * Theme.paddingLarge
|
||||
title: qsTr("Aggiornamenti")
|
||||
value: updatesTotal() === 0 ? qsTr("nessuno") : String(updatesTotal())
|
||||
detail: qsTr("di cui di sicurezza: ") + updatesSecurity()
|
||||
detail: updatesDetail()
|
||||
progress: -1
|
||||
level: updatesSecurity() > 0 ? 1 : 0
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Name: harbour-server
|
||||
Summary: Parametri del server in una schermata
|
||||
Version: 0.1.0
|
||||
Version: 0.1.1
|
||||
Release: 1
|
||||
Group: Qt/Qt
|
||||
License: MIT
|
||||
@@ -23,6 +23,13 @@ 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.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" è
|
||||
verificabile e non indistinguibile da una lettura fallita. Corrisponde ai
|
||||
nuovi campi updates.packages e updates.lists_updated_at dello schema
|
||||
status/1 (caso reale: dist-upgrade automatico delle bind9-* mentre Webmin
|
||||
mostrava ancora 3 update pendenti)
|
||||
* Tue Oct 27 2026 Carlo Baratto <carlo@carlobaratto.it> - 0.1.0-1
|
||||
- Prima release: schermata unica con i parametri del server letti da
|
||||
/v1/status (schema status/1), soglie giallo/rosso, aggiornamento
|
||||
|
||||
+2
-2
@@ -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.0"));
|
||||
app->setApplicationVersion(QStringLiteral("0.1.1"));
|
||||
|
||||
qDebug() << "harbour-server v0.1.0 build" << __DATE__ << __TIME__;
|
||||
qDebug() << "harbour-server v0.1.1 build" << __DATE__ << __TIME__;
|
||||
|
||||
Settings settings;
|
||||
StatusClient status(&settings);
|
||||
|
||||
@@ -187,3 +187,13 @@ QString StatusClient::fmtNum(double value, int decimals) const
|
||||
{
|
||||
return QLocale::system().toString(value, 'f', decimals);
|
||||
}
|
||||
|
||||
QString StatusClient::fmtStamp(const QString &iso) const
|
||||
{
|
||||
if (iso.isEmpty())
|
||||
return QString();
|
||||
QDateTime dt = QDateTime::fromString(iso, Qt::ISODate);
|
||||
if (!dt.isValid())
|
||||
return iso;
|
||||
return dt.toLocalTime().toString(QStringLiteral("dd/MM HH:mm"));
|
||||
}
|
||||
@@ -42,6 +42,8 @@ public:
|
||||
Q_INVOKABLE QString fmtUptime(qint64 seconds) const;
|
||||
Q_INVOKABLE QString fmtAge(double hours) const;
|
||||
Q_INVOKABLE QString fmtNum(double value, int decimals) const;
|
||||
// ISO 8601 dal server (UTC) -> "28/10 09:09" nell'ora locale del telefono.
|
||||
Q_INVOKABLE QString fmtStamp(const QString &iso) const;
|
||||
|
||||
signals:
|
||||
void changed();
|
||||
|
||||
Reference in new issue
Block a user