riemann / riemann-dash

An HTTP dashboard for Riemann.
MIT License
248 stars 102 forks source link

Theme and Custom views support. Would you be interested in this addition? #102

Open byllc opened 9 years ago

byllc commented 9 years ago

For our use case we'll need to be able to theme the dashboards and add custom views quickly. We'd like to be able to add css custom to a specific installation without touching the gem directories or the index.erubis file where those are added.

We'd rather not work off of a fork of the gem while developing views either. So the functionality we were planning to add was an ability to add a secondary views and styles path in the config file. We thought it could be accomplished as follows.

Change the index.erubis to populate styles and views as follows:

<% config.views.each do |custom_view|  %>
  <script src="<%= custom_view %>"></script>
<% end %>

And this to the styles section

<% config.styles.each do |custom_style|  %>
  <script src="<%= custom_style %>"></script>
<% end %>

Now we can add content easily from config without having to change the index file

Now we can add some options (and subsequent processing) for the config file config['custom_content'] A directory that will get symlinked in to the public path

that allows you to specify a local directory and two lists config['custom_views'] Views located in the custom_content directory that you want to use config['custom_styles'] CSS located in the custom_content directory that you want to use

Now when the server boots up it can make sure there is a symlink to the custom_content path, and the index will include your custom content last so that you can override any of the default styles.

We need this functionality for what we are doing. If you understand what we are trying to achieve and you think the gem already supports this, and we are missing it, we would happily do it the right way.

Otherwise, If we do make this adjustment would you be interested in it?

shanielh commented 8 years ago

I'm really interested in custom styles, Mostly I want to add

.container {
   overflow:scroll;
}

I'm also interested in custom behaviors, I would like to change the hostname (by default it's localhost in my configuration) to the hostname by the url of the riemann-dash.