diff options
author | varac <varacanero@zeromail.org> | 2016-07-13 20:07:09 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-07-13 20:07:09 +0200 |
commit | 5d01197cf893d4a8c9a57f7c963f47393d34e157 (patch) | |
tree | 860e97c0af1ad8c7d4bd1aecb0b7e6658b312846 /dashboards |
initial commit, import from pixelated_dashboard
Diffstat (limited to 'dashboards')
-rw-r--r-- | dashboards/dashboard.erb | 13 | ||||
-rw-r--r-- | dashboards/default.erb | 15 | ||||
-rw-r--r-- | dashboards/layout.erb | 51 |
3 files changed, 79 insertions, 0 deletions
diff --git a/dashboards/dashboard.erb b/dashboards/dashboard.erb new file mode 100644 index 0000000..ba450cf --- /dev/null +++ b/dashboards/dashboard.erb @@ -0,0 +1,13 @@ +<li data-row="1" data-col="1" data-sizex="2" data-sizey="3"> + <div data-id="jenkinsBuildStatus" data-view="JenkinsBuildStatus" data-title="Jenkins"></div> +</li> + +<li data-row="2" data-col="2" data-sizex="2" data-sizey="1"> + <div data-id="nagios-dev" data-view="Nagios" data-unordered="true" data-title="Nagios dev" data-moreinfo="Unacknowledged events"></div> +</li> +<li data-row="2" data-col="3" data-sizex="2" data-sizey="1"> + <div data-id="nagios-unstable" data-view="Nagios" data-unordered="true" data-title="Nagios unstable" data-moreinfo="Unacknowledged events"></div> +</li> +<li data-row="2" data-col="4" data-sizex="2" data-sizey="1"> + <div data-id="nagios-cdev" data-view="Nagios" data-unordered="true" data-title="Nagios cdev" data-moreinfo="Unacknowledged events"></div> +</li> diff --git a/dashboards/default.erb b/dashboards/default.erb new file mode 100644 index 0000000..d5441b8 --- /dev/null +++ b/dashboards/default.erb @@ -0,0 +1,15 @@ +<script type='text/javascript'> +$(function() { +// These settings override the defaults set in application.coffee. You can do this on a per dashboard basis. + Dashing.widget_margins = [2, 2] + Dashing.widget_base_dimensions = [235, 295] + Dashing.numColumns = 6 +}); +</script> + +<% content_for :title do %>LEAP Dashboard for Laptops<% end %> +<div class="gridster"> + <ul> + <%= erb :'dashboard' %> + </ul> +</div> diff --git a/dashboards/layout.erb b/dashboards/layout.erb new file mode 100644 index 0000000..5c8dfb8 --- /dev/null +++ b/dashboards/layout.erb @@ -0,0 +1,51 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"/> + <meta name="description" content=""> + <meta name="viewport" content="width=device-width"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + + <title><%= yield_content(:title) %></title> + + <!-- The javascript and css are managed by sprockets. The files can be found in the /assets folder--> + <script type="text/javascript" src="/assets/application.js"></script> + <link rel="stylesheet" href="/assets/application.css"> + + <link href='//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700' rel='stylesheet' type='text/css'> + <link rel="icon" href="/assets/favicon.ico"> + + +</head> + <body> + <script> + // Redirect handler + (function() { + var delayInSeconds = 5; + var pageLoaded = Date.now(); + var source = new EventSource('events') + source.addEventListener('message', function(e) { + var data = JSON.parse(e.data); + if (data.id === 'redirect' && typeof data.location != 'undefined') { + if (data.updatedAt - pageLoaded/1000 > delayInSeconds) { + window.location = data.location; + } else { + console.log('Refresh was too fast (or initial page load).'); + } + } + }); + })(); + </script> + <div id="container"> + <%= yield %> + </div> + + <% if development? %> + <div id="saving-instructions"> + <p>Paste the following at the top of <i><%= params[:dashboard] %>.erb</i></p> + <textarea id="gridster-code"></textarea> + </div> + <a href="#saving-instructions" id="save-gridster">Save this layout</a> + <% end %> + </body> +</html> |