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

Dashboard Updates #1025

Merged
merged 36 commits into from Apr 29, 2020
Merged

Dashboard Updates #1025

merged 36 commits into from Apr 29, 2020

Conversation

jonathanadams
Copy link
Contributor

@jonathanadams jonathanadams commented Apr 18, 2020

Description:

Updates to the dashboard UI interface and the javascript backend.

Submitted as draft as still some work to be done but wanted other peoples opinions.

login

3-col-layout

Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#

To be completed.

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

@mbo18
Copy link
Contributor

mbo18 commented Apr 19, 2020

Will also close this request:
https://community.home-assistant.io/t/cosmetic-esphome-addon-dash-device-workflow/147540

@holdestmade
Copy link

Looks good to me, would 3 colums fit ? there seems to be a lot of white space in the cards.

@jonathanadams
Copy link
Contributor Author

@holdestmade I will adjust the code and post a screenshot of x3 columns later. My only fear with this is long node names spanning over two lines.

@holdestmade
Copy link

Yes, I see what you mean, but most node names are not that long. Could the path be shortened ? Not sure it really needs config/esphome/ maybe just the filename ?

@holdestmade
Copy link

holdestmade commented Apr 19, 2020

Off topic but how did you get a subtitle in your first node ?

Scrap that, found it

@mbo18
Copy link
Contributor

mbo18 commented Apr 19, 2020

Could the number of columns be dynamic (from number of nodes and screen size)?

@jonathanadams
Copy link
Contributor Author

Could the number of columns be dynamic (from number of nodes and screen size)?

The number of column is setup to be dynamic based upon the number of nodes present. It then responsively reduces the number of columns as the screen size gets smaller.

/**
* Dashboard Dynamic Grid
*/
const nodeGrid = () => {
const nodeCount = $('#nodes .card').length
const nodeGrid = $('#nodes #grid')
if (nodeCount >= 6) {
$(nodeGrid).addClass("grid-2-col");
} else {
$(nodeGrid).addClass("grid-1-col");
}
}

@jonathanadams
Copy link
Contributor Author

jonathanadams commented Apr 19, 2020

3-col-layout

Example of a 3 column layout. I've had to fiddle with the container size to make it work. What do you all think?

@holdestmade
Copy link

Does the webserver icon fit OK ?

@jonathanadams
Copy link
Contributor Author

Does the webserver icon fit OK ?

Yes it does. It goes on the same line as the update icon and the 3 vertical lines. Just realised non of the images show it.

@holdestmade
Copy link

holdestmade commented Apr 21, 2020

Just realised non of the images show it.

Yes thats why I asked, great work.

@jonathanadams
Copy link
Contributor Author

I think these are enough changes to start off with.

@jonathanadams jonathanadams marked this pull request as ready for review April 24, 2020 13:23
@sauloonze
Copy link

Hi @jonathanadams Good job here. Looking forward to use it.

@jonathanadams
Copy link
Contributor Author

@sermayoral thanks for fixing the lint issues.

@sermayoral
Copy link
Contributor

@sermayoral thanks for fixing the lint issues.

@jonathanadams You are welcome :-)

@glmnet
Copy link
Member

glmnet commented Apr 29, 2020

Awesome!

@glmnet glmnet merged commit af66753 into esphome:dev Apr 29, 2020
@holdestmade
Copy link

Look great, any chance of adding an option to sort by node name instead of filename ?

@theone11
Copy link

Very nice looks good and more useful than before.

Can you add an option to filter or sort by online/offline/all.

@jonathanadams
Copy link
Contributor Author

Very nice looks good and more useful than before.

Can you add an option to filter or sort by online/offline/all.

I plan on adding filtering/search options in some further updates in the near future. I wanted to get these changes merged and see if any bugs crop up before making further updates.

@sermayoral
Copy link
Contributor

@jonathanadams it's quite understandable :-)

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.