ravenclaw900 / DietPi-Dashboard

A lightweight, standalone web dashboard for DietPi
GNU General Public License v3.0
126 stars 17 forks source link

[Visual] enhance text allignment on Management > System Info #40

Closed echtfrank closed 2 years ago

echtfrank commented 2 years ago

On the "Management" page of the dashboard, there is a 'system information' block (two columns it looks like). The 'uptime' line is constantly refreshed (every second). A zero-value is not printed, nor the unit in textform (the text "seconds"). The whole line - for a short time - much shorter than the secons before or the second after. As a result the two columns have different widths.

This is ugly to see ;-) May be you could use a (shorter) form(at) for the uptime? So that any uptime is the same text width?

MichaIng commented 2 years ago

Many thanks for your suggestion.

You used the stable version, right? This has been addressed already with: https://github.com/ravenclaw900/DietPi-Dashboard/commit/9bd30338e458666a46542067ed6b2584f42d019e Some pages are not constantly reloading data now. Since the seconds timer is pretty overkill on the management page, now only minutes are shown, and the page needs to be reloaded or or navigation button clicked again to have the values updated.

echtfrank commented 2 years ago

OK, thanks for the quick reply. Yes, I'm on stable. I didn't notice it was already addressed. And indeed seconds is an overkill. Nevertheless, I think you should explicitly state zero-values here. How does uptime count further? Is there a maximum number for #hours? What is displayed after that? Or do you use, hour, day, weeks, months, yerars and so on?

MichaIng commented 2 years ago

Leading and trailing zero units are omitted completely by the used humanizeDuration function. Would be pretty ugly either to show 0 years 0 months 0 weeks 6 days 13 hours 42 minutes 0 seconds 😄. Those are added on demand and as of the rounding to minutes that it done now, the seconds are omitted implicitly in every case. What I agree with, it could be beneficial to keep showing 0 minutes, to make clear that minutes is the precision shown.

Here the documentation of the module: https://github.com/EvanHahn/HumanizeDuration.js This could be tried:

((uptime = humanizeDuration(socketData.uptime * 60000, { units: ['y', 'mo', 'w', 'd', 'h', 'm'] })),

Leading zero units are not shown by this, but with some luck tailing ones are. Otherwise I do not see an option to define the minimum unit to show, respectively whether to show zero value units or not.

ravenclaw900 commented 2 years ago

No, it doesn't look like trailing units are shown, even with that.

MichaIng commented 2 years ago

Okay, however it shouldn't be a big issue that in 1 of 60 cases the minutes are omitted, especially since it is not live updated but only when when re-navigating to that page.

ravenclaw900 commented 2 years ago

@echtfrank Can this be closed then?

echtfrank commented 2 years ago

Hi, sorry for my late reaction. Yes, absolutely can this be closed. thanks for the background information. I have other ideas for the dashboard. I am new to Github. What is the preferred method posting new ideas? I don't want to open an 'issue' for an 'idea'...

Joulinar commented 2 years ago

It's not a problem to open new issues for your ideas. Best is one issue per idea. We will assign the correct label.