[PATCH] web-app: show newest messages logs first and add message level colors

28 views
Skip to first unread message

Adrian DC

unread,
Nov 3, 2024, 10:41:11 AM11/3/24
to swup...@googlegroups.com, Adrian DC
For developers / users, especially if an update fails,
the most relevant messages logs are the latest ones,
hence reverse the order of messages by prepending latests first.

Also rework the messages logs output with more colors per level
---

Signed-off-by: Adrian DC <radi...@gmail.com>
---
web-app/js/swupdate.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/web-app/js/swupdate.js b/web-app/js/swupdate.js
index faeca3d2..dfbcd74f 100755
--- a/web-app/js/swupdate.js
+++ b/web-app/js/swupdate.js
@@ -155,7 +155,11 @@ window.onload = function () {
p.text(msg.text)
p.addClass('mb-1')
if (msg.level <= 3) { p.addClass('text-danger') }
- $('#messages').append(p)
+ else if (msg.level <= 4) { p.addClass('text-info') }
+ else if (msg.level <= 5) { }
+ else if (msg.level <= 6) { p.addClass('text-success') }
+ else if (msg.level <= 7) { p.addClass('text-muted') }
+ $('#messages').prepend(p)
break
}
case 'status': {
--
2.43.0

Stefano Babic

unread,
Nov 4, 2024, 4:36:15 AM11/4/24
to Adrian DC, swup...@googlegroups.com
Hi Adrian,

On 11/3/24 16:41, Adrian DC wrote:
> For developers / users, especially if an update fails,
> the most relevant messages logs are the latest ones,
> hence reverse the order of messages by prepending latests first.
>
> Also rework the messages logs output with more colors per level

This is a long story. And yes, for developers make sense to do as you
suggest. That is the reason I implemented in the early beginning exactly
in this way, with last messages on the top. But there were complains,
because this is not the usual way to show logs, and putting new messages
on the top were judge "unnatural".

I will avoid to start again to switch up and down the order of messages.
I will just accept a change in the GUI where it is possible to switch
the order at runtime (via button, ...).

Best regards,
Stefano Babic

Adrian DC

unread,
Nov 8, 2024, 8:34:43 PM11/8/24
to swupdate
Hi Stefano,

Ok I'm fine with the reasoning and history.
I'll rework it into a configurable build option to toggle it upwards if opt-in requested.

What about the message level colors implemented ?
Checking SWUpdate logs and issues, such as compatibility issues (wrong machine, incompatible partitions layout, or faulty update signatures)
have become easier and less magical / less complex to understand since then.

Best regards,

Adrian DC

unread,
Feb 20, 2026, 4:17:06 PM (2 days ago) Feb 20
to swup...@googlegroups.com, Stefano Babic, Adrian DC
For final clients, users and developers, especially if an update fails,
the most relevant messages logs or current progress are the lowest ones,
hence reverse the order of messages by prepending latests first.

If making this reverse order change could be an option,
I'm happily open to suggestions on how you'd prefer to do it.
Reply all
Reply to author
Forward
0 new messages