-
Notifications
You must be signed in to change notification settings - Fork 149
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
Multiple Dashboards #22
Comments
I would create unique ids for all widgets. You could prefix them with your dashboard's name for example or whatever. Dashing-rails also handle Devise authentications. Please see here Dashboard are basically just HTML placeholders, you can even use Shopify JS libraries to navigate between your different dashboards here. |
Thanks for the help ! This is just great, that I can use the devise authentication is dashing-rails. But, this was no where to be found in the dashing-rails wiki. Should we document it ? |
Yes we should probably add a "how to" in the readme. Let me know if you run into any issue regarding sinatra_cyclist. |
Hey, I have a question around this too. Thanks!! |
Well the naive approach is to create 30 dashboard layouts with unique widget ids (per user, using the user id maybe?). But that's not really DRY nor scalable. So you could define one layout file and inject widget ids dynamically using local view variable. Here is an example of a widget defined dymanically: <li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="synergy-<%= user.id %>" data-view="Meter" data-title="Synergy" data-min="0" data-max="100"></div>
</li> Given that you provide the |
@gottfrois I'm so glad that I found this thread, I had in mind the same implementation plan but not 100% sure. I have a couple of questions, but first I would like to present my idea. I want to create a dashboard / user, basically users can register -> log in -> create dashboards -> add widgets for each dashboard I would have the following models: User, Dashboard, Widget ( I would use inheritance for widgets, so I can have multiple types ) But my question is, how would you send the data from the jobs. It is really ok to have something like: Lets say we have 3 users, all of the have one dashboard and one git hub pull request widget.
Is this a ok way to send data dynamically for individual widgets corresponding to different users? Thank you, all your answers really help, you're doing an amazing job! |
it will surely work but won't scale very well as you add more widgets. You don't want to be doing too much requests against github api. |
Oh I did not notice I was scheduling every 2 seconds, it will be done every 15 minutes. However my concern is about the 'Widget.where(type: "Widgets::PullRequest")', if there are 1000 users each with 1 pull request widget, this job will iterate and send them data ( even if they are not 'online' or viwing the dashboard ). How would you approach this problem? A better data model? I was thinking about using ActionCable and subscribe to a channel for each dashboard, and this will allow me to know if the dashboard is live or no, therefore send data only to live dashboards. |
honestly, if you plan to have a lot of users active on your dashboard, rails and action cable is not the right tool for the job https://dockyard.com/blog/2016/08/09/phoenix-channels-vs-rails-action-cable |
How, should I go about adding multiple dashboards, say for each of the user in my database.
I know I can handle user authorization, by following from here https://github.com/Shopify/dashing/wiki/How-to%3A-Add-authentication, and redirect user to its specific dashboard.
But, what would be the best practice to create multiple dashboard ? Should I just create a new Job file for each dashboard/user, and give all the widgets unique Id for all the dashboard ?
The text was updated successfully, but these errors were encountered: