Skip to content
Snippets Groups Projects
Commit a95d585a authored by Jeroen Nijhof's avatar Jeroen Nijhof
Browse files

Restructured some files

parent a6dab346
No related branches found
No related tags found
No related merge requests found
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
Loading
Loading
@@ -4,6 +4,7 @@
<title>GitLab.com Status</title>
<%= stylesheet_link_tag 'application', media: 'all' %>
<%= javascript_include_tag 'application' %>
<%= javascript_include_tag 'https://www.google.com/jsapi' %>
<%= csrf_meta_tags %>
</head>
<body>
Loading
Loading
Loading
Loading
@@ -16,41 +16,40 @@
</div>
<% end %>
 
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart', 'line', 'timeline']});
google.setOnLoadCallback(drawCharts);
<script>
google.load('visualization', '1', {packages: ['corechart', 'line', 'timeline']});
google.setOnLoadCallback(drawCharts);
 
function drawCharts() {
<% idx = 0 %>
<% @stats.keys.each do |key| %>
<% idx += 1 %>
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'X');
data.addColumn('number', '');
function drawCharts() {
<% idx = 0 %>
<% @stats.keys.each do |key| %>
<% idx += 1 %>
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'X');
data.addColumn('number', '');
 
data.addRows([
<% @stats[key].each do |stat| %>
<% value = stat['value'] %>
<% value = '0' if !stat['value'] %>
<% time = Time.at(stat['time']) %>
[new Date(<%= time.year %>,<%= time.month %>,<%= time.day %>,<%= time.hour %>,<%= time.min %>),<%= value.gsub('ms', '').gsub('s', '') %>],
<% end %>
]);
data.addRows([
<% @stats[key].each do |stat| %>
<% value = stat['value'] %>
<% value = '0' if !stat['value'] %>
<% time = Time.at(stat['time']) %>
[new Date(<%= time.year %>,<%= time.month %>,<%= time.day %>,<%= time.hour %>,<%= time.min %>),<%= value.gsub('ms', '').gsub('s', '') %>],
<% end %>
]);
 
var options = {
backgroundColor: '#fff',
legend: {
position: 'none'
},
colors: ['#777'],
timeline: {
groupByRowLabel: true
}
};
var options = {
backgroundColor: '#fff',
legend: {
position: 'none'
},
colors: ['#777'],
timeline: {
groupByRowLabel: true
}
};
 
var chart = new google.visualization.LineChart(document.getElementById("chart_<%= idx %>"));
chart.draw(data, options);
<% end %>
}
var chart = new google.visualization.LineChart(document.getElementById("chart_<%= idx %>"));
chart.draw(data, options);
<% end %>
}
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment