Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rendering of uptime in web UI #607

Open
stupsi099 opened this issue Nov 15, 2023 · 3 comments
Open

Improve rendering of uptime in web UI #607

stupsi099 opened this issue Nov 15, 2023 · 3 comments

Comments

@stupsi099
Copy link

stupsi099 commented Nov 15, 2023

if you look in status field you can see only a rising number (no date/time)
not shure if its a bug or a feature.

grafik

br
rupert

@matjack1
Copy link
Collaborator

Hey @stupsi099 the uptime is in seconds now. I agree that it would be nicer if it was parsed and shown in days/hours/seconds.

If anyone wants to try improving that let me know, I can help giving you directions on how to implement this.

@matjack1 matjack1 changed the title Build 163 - Uptime in Status only a number... Improve rendering of uptime in web UI Nov 17, 2023
@matjack1 matjack1 added this to the V2 milestone Jan 16, 2024
@pvtex
Copy link

pvtex commented Jun 8, 2024

this is no problem just change the file wsRepsonse.esp
in the function

void ICACHE_FLASH_ATTR sendStatus(AsyncWebSocketClient *client)

change this line:

root["uptime"] = uptimeSeconds;

tp:

int h = uptimeSeconds / 3600;
int rem = uptimeSeconds % 3600;
int m = rem / 60;
int s = rem % 60;
char uptimebuffer[9];
sprintf(uptimebuffer, "%02d:%02d:%02d", h, m, s);
root["uptime"] = uptimebuffer;

@omersiar
Copy link
Collaborator

Rather than making the transformation on limited esp hardware, it would be better to handle it on Client side (browser).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants