kanaui 0.6.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kanaui
4
+ class SettingsController < Kanaui::EngineController
5
+ def index; end
6
+
7
+ # update would have been nicer, but it's hard to pass the id in the url
8
+ def create
9
+ Kanaui::DashboardHelper::DashboardApi.refresh(params.require(:account_id), options_for_klient)
10
+ redirect_to({ action: :index }, notice: 'Account successfully refreshed')
11
+ end
12
+ end
13
+ end
@@ -1,6 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kanaui
2
4
  module ApplicationHelper
3
-
4
-
5
5
  end
6
6
  end
@@ -1,11 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Kanaui
2
4
  module DashboardHelper
3
-
4
5
  class DashboardApi < KillBillClient::Model::Resource
5
-
6
- KILLBILL_ANALYTICS_PREFIX = "/plugins/killbill-analytics"
6
+ KILLBILL_ANALYTICS_PREFIX = '/plugins/killbill-analytics'
7
7
 
8
8
  class << self
9
+ def refresh(account_id, options = {})
10
+ path = "#{KILLBILL_ANALYTICS_PREFIX}/#{account_id}"
11
+ KillBillClient::API.put path, {}, {}, options
12
+ end
9
13
 
10
14
  def available_reports(options = {})
11
15
  path = "#{KILLBILL_ANALYTICS_PREFIX}/reports"
@@ -48,7 +52,5 @@ module Kanaui
48
52
  end
49
53
  end
50
54
  end
51
-
52
55
  end
53
56
  end
54
-
@@ -1,142 +1,170 @@
1
- <div class="row">
2
- <!-- MENU -->
3
- <div class="col-md-3 col-sm-12 col-lg-4 reports-options">
4
- <div class="row">
5
- <% if params[:name] && @report['reportType'] == 'TIMELINE' %>
6
- <div id="date-picker" class="col-md-12">
7
- <h4>End date</h4>
8
- <%= form_tag kanaui_engine.dashboard_index_path, :method => :get do %>
9
- <input name="name" type="hidden" value="<%= @raw_name %>">
10
- <input name="smooth" type="hidden" value="<%= params[:smooth] %>">
11
- <input name="sql_only" type="hidden" value="<%= params[:sql_only] %>">
12
- <input name="format" type="hidden" value="<%= params[:format] %>">
13
- <input name="delta_days" type="hidden" value="<%= (@end_date.to_date - @start_date.to_date).to_i %>">
1
+ <div class="flex-panel">
2
+ <!-- MENU -->
3
+ <div class="reports-options flex-inner-left-panel">
4
+ <div class="row">
5
+ <% if params[:name] %>
6
+ <div class="info-wrapper">
7
+ <div class="tag-bar tag-bar-breathe">
8
+ <div class="tag-select" onclick="void(0);">
9
+ <span><i class="fa fa-calendar"></i><i class="fa fa-caret-down"></i></span>
14
10
 
15
- <div class="form-group">
16
- <div class="col-md-5">
17
- <input class="form-control" name="end_date" type="text" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @end_date %>">
18
- </div>
19
- </div>
20
- <div class="form-group">
21
- <%= submit_tag 'Refresh', :class => 'btn btn-default' %>
22
- </div>
23
- <% end %>
24
- </div>
25
- <% end %>
26
- <div class="col-md-12 col-sm-8">
27
- <h4><%= link_to 'Available Reports', kanaui_engine.url_for(:controller => :reports) %></h4>
28
- <ul class="nav nav-tabs nav-stacked">
29
- <% if Rails.env.development? %>
30
- <li class="nav-element">
31
- <%= link_to "Fake pie", kanaui_engine.dashboard_index_path(:fake => 1, :name => 'fake_pie', :type => 'pie') %>
32
- </li>
33
- <li class="nav-element">
34
- <%= link_to "Fake line", kanaui_engine.dashboard_index_path(:fake => 1, :name => 'fake_line', :type => 'line') %>
35
- </li>
36
- <% end %>
37
- <% @reports.each do |r| %>
38
- <% link = kanaui_engine.dashboard_index_path(params.to_h.merge(:name => r['reportName'])) %>
39
- <li class="nav-element <%= params[:name] == r['reportName'] ? 'current' : '' %>">
40
- <%= link_to r['reportPrettyName'], link, :class => "truncate-text", title: r['reportName'].titleize %>
41
- </li>
42
- <% end %>
43
- </ul>
44
- </div>
45
- </div>
46
- </div>
47
-
48
- <!-- DASHBOARD -->
49
- <div class="col-md-9 col-sm-12 col-lg-8">
50
- <div class="row">
51
- <% if params[:name] %>
52
- <h2 class="chart-title">
53
- <%= @raw_name.titleize %>
54
- </h2>
55
- <div id="loading-spinner"></div>
56
- <div id="chartAnchor" data-reports-path="<%= kanaui_engine.reports_path(params.to_h) %>"></div>
57
- <div id="date-controls" style="display: none;">
58
- <ul class="nav nav-pills nav-justified">
59
- <% @available_start_dates.each do |key, value| %>
60
- <li><%= link_to key, kanaui_engine.dashboard_index_path(params.to_h.merge(:start_date => value)) %></li>
61
- <% end %>
62
- </ul>
63
- </div>
64
- <hr>
65
- <div class="pull-right">
66
- <%= link_to 'Download raw data', kanaui_engine.reports_path(params.to_h.merge(:format => 'csv')), class: 'btn btn-default' %>
67
- </div>
68
- <a class="btn btn-default" role="button" data-toggle="collapse" href="#advanced-controls" aria-expanded="false" aria-controls="advanced-controls">
69
- Advanced controls
70
- </a>
71
- <div class="collapse" id="advanced-controls">
72
- <div class="well">
73
- <ul>
74
- <% if @report['reportType'] == 'TIMELINE' %>
75
- <% at_least_two_months = params[:start_date].blank? || params[:end_date].blank? || (params[:end_date].to_date.beginning_of_month - 1.month > params[:start_date].to_date) %>
76
- <% at_least_two_weeks = params[:start_date].blank? || params[:end_date].blank? || (params[:end_date].to_date.beginning_of_week - 1.week > params[:start_date].to_date) %>
77
- <% if params[:smooth] != 'AVERAGE_WEEKLY' && at_least_two_weeks %>
78
- <li><%= link_to 'Weekly average', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'AVERAGE_WEEKLY')) %></li>
79
- <% end %>
80
- <% if params[:smooth] != 'AVERAGE_MONTHLY' && at_least_two_months %>
81
- <li><%= link_to 'Monthly average', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'AVERAGE_MONTHLY')) %></li>
82
- <% end %>
83
- <% if params[:smooth] != 'SUM_WEEKLY' && at_least_two_weeks %>
84
- <li><%= link_to 'Weekly sum', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'SUM_WEEKLY')) %></li>
85
- <% end %>
86
- <% if params[:smooth] != 'SUM_MONTHLY' && at_least_two_months %>
87
- <li><%= link_to 'Monthly sum', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'SUM_MONTHLY')) %></li>
88
- <% end %>
89
- <% end %>
90
- <% filter_fields = ((@report['schema'] || {})['fields'] || []).select { |field| !field['distinctValues'].blank? && field['dataType'] =~ /char/ } # To ignore tenant_record_id %>
91
- <% unless filter_fields.empty? %>
92
- <li>Slicing & Dicing:
93
- <%= form_tag kanaui_engine.dashboard_index_path(params.to_h), :method => :get, :class => 'form-horizontal' do %>
94
- <input name="start_date" type="hidden" value="<%= @start_date %>">
95
- <input name="end_date" type="hidden" value="<%= @end_date %>">
11
+ <div class="tag-select-box">
12
+ <%= form_tag kanaui_engine.dashboard_index_path, :class => 'form-horizontal', :method => :get do %>
96
13
  <input name="name" type="hidden" value="<%= @raw_name %>">
97
14
  <input name="smooth" type="hidden" value="<%= params[:smooth] %>">
98
15
  <input name="sql_only" type="hidden" value="<%= params[:sql_only] %>">
99
16
  <input name="format" type="hidden" value="<%= params[:format] %>">
17
+ <input name="delta_days" type="hidden" value="<%= (@end_date.to_date - @start_date.to_date).to_i %>">
100
18
 
101
- <fieldset class="form-group">
102
- <legend>Filters</legend>
103
- <% filter_fields.each do |field| %>
104
- <div class="form-group">
105
- <%= label_tag "filter_#{field['name']}", field['name'], :class => 'col-sm-2 control-label' %>
106
- <div class="col-sm-10">
107
- <%= select_tag "filter_#{field['name']}", options_for_select(field['distinctValues']), :multiple => true, :class => 'form-control' %>
108
- </div>
109
- </div>
110
- <% end %>
111
- </fieldset>
112
- <fieldset class="form-group">
113
- <legend>Dimensions to plot</legend>
114
- <% filter_fields.each do |field| %>
115
- <div class="form-group">
116
- <%= label_tag "group_#{field['name']}", field['name'], :class => 'col-sm-2 control-label' %>
117
- <div class="col-sm-10">
118
- <%= select_tag "group_#{field['name']}", options_for_select(field['distinctValues']), :multiple => true, :class => 'form-control' %>
119
- </div>
120
- </div>
121
- <% end %>
122
- </fieldset>
123
-
124
19
  <div class="form-group">
125
- <div class="col-sm-offset-2 col-sm-10">
20
+ <div class="col-md-7">
21
+ <% # TODO datepicker breaks :hover %>
22
+ From:<input class="form-control" name="start_date" type="text" data-provide="datepicker-BROKEN" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @start_date %>">
23
+ </div>
24
+ </div>
25
+ <div class="form-group">
26
+ <div class="col-md-7">
27
+ <% # TODO datepicker breaks :hover %>
28
+ To:<input class="form-control" name="end_date" type="text" data-provide="datepicker-BROKEN" data-date-format="yyyy-mm-dd" data-date-today-highlight="true" value="<%= @end_date %>">
29
+ </div>
30
+ </div>
31
+ <div class="form-group">
32
+ <div class="col-sm-12">
126
33
  <%= submit_tag 'Refresh', :class => 'btn btn-default' %>
127
34
  </div>
128
35
  </div>
129
36
  <% end %>
37
+ </div><!-- /.tag-select-box -->
38
+ </div><!-- /.tag-select -->
39
+ </div><!-- /.tag-bar -->
40
+ </div><!-- /.info-wrapper -->
41
+ <% end %>
42
+ <div class="col-md-12 col-sm-8">
43
+ <h4><%= link_to 'Available Reports', kanaui_engine.url_for(:controller => :reports) %></h4>
44
+ <ul class="nav nav-tabs nav-stacked">
45
+ <% if Rails.env.development? && @reports.empty? %>
46
+ <li class="nav-element">
47
+ <%= link_to "Fake pie", kanaui_engine.dashboard_index_path(:fake => 1, :name => 'fake_pie', :type => 'pie') %>
130
48
  </li>
131
- <li>Current Analytics query:&nbsp;<%= link_to '<i class="fa fa-question-circle"></i>'.html_safe, 'http://docs.killbill.io/latest/userguide_analytics.html#_dashboard_api', :target => '_blank' %>
132
- <pre><%= params[:name] -%></pre>
49
+ <li class="nav-element">
50
+ <%= link_to "Fake line", kanaui_engine.dashboard_index_path(:fake => 1, :name => 'fake_line', :type => 'line') %>
133
51
  </li>
52
+ <% end %>
53
+ <% @reports.each do |r| %>
54
+ <% link = kanaui_engine.dashboard_index_path(params.to_h.merge(:name => r['reportName'])) %>
55
+ <li class="nav-element <%= params[:name] == r['reportName'] ? 'current' : '' %>">
56
+ <%= link_to r['reportPrettyName'], link, :class => "truncate-text", title: r['reportName'].titleize %>
57
+ </li>
134
58
  <% end %>
135
- <li><%= link_to 'SQL query', kanaui_engine.reports_path(params.to_h.merge(:sql_only => true)) %></li>
136
- </ul>
137
- </div>
59
+ </ul>
60
+ </div>
61
+ </div>
62
+ <div class="row">
63
+ <div class="col-md-12 col-sm-8">
64
+ <h5><%= link_to 'Settings', kanaui_engine.url_for(:controller => :settings) %></h5>
138
65
  </div>
139
- <% end %>
66
+ </div>
67
+ </div>
68
+
69
+ <!-- DASHBOARD -->
70
+ <div class="flex-inner-right-panel">
71
+ <div class="row">
72
+ <div class="col-sm-12">
73
+ <% if params[:name] %>
74
+ <h2 class="chart-title">
75
+ <%= @raw_name.titleize %>
76
+ </h2>
77
+ <div id="loading-spinner"></div>
78
+ <div id="chartAnchor" data-reports-path="<%= kanaui_engine.reports_path(params.to_h) %>"></div>
79
+ <div id="date-controls" style="display: none;">
80
+ <ul class="nav nav-pills nav-justified">
81
+ <% @available_start_dates.each do |key, value| %>
82
+ <li><%= link_to key, kanaui_engine.dashboard_index_path(params.to_h.merge(:start_date => value)) %></li>
83
+ <% end %>
84
+ </ul>
85
+ </div>
86
+ <hr>
87
+ <div class="pull-right">
88
+ <% if @report['reportType'] == 'TABLE' %>
89
+ <input type="hidden" id="visible-table-columns" value="<%= @visible_columns %>">
90
+ <a class="btn btn-default" id="copy-url" data-reports-path="<%= kanaui_engine.dashboard_index_path(params.to_h) %>">Copy URL</a>
91
+ <input id="url-placeholder" class="form-control hidden">
92
+ <% end %>
93
+ <%= link_to 'Download raw data', kanaui_engine.reports_path(params.to_h.merge(:format => 'csv')), class: 'btn btn-default' %>
94
+ </div>
95
+ <a class="btn btn-default" role="button" data-toggle="collapse" href="#advanced-controls" aria-expanded="false" aria-controls="advanced-controls">
96
+ Advanced controls
97
+ </a>
98
+ <div class="collapse" id="advanced-controls">
99
+ <div class="well">
100
+ <ul>
101
+ <% if @report['reportType'] == 'TIMELINE' %>
102
+ <% at_least_two_months = params[:start_date].blank? || params[:end_date].blank? || (params[:end_date].to_date.beginning_of_month - 1.month > params[:start_date].to_date) %>
103
+ <% at_least_two_weeks = params[:start_date].blank? || params[:end_date].blank? || (params[:end_date].to_date.beginning_of_week - 1.week > params[:start_date].to_date) %>
104
+ <% if params[:smooth] != 'AVERAGE_WEEKLY' && at_least_two_weeks %>
105
+ <li><%= link_to 'Weekly average', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'AVERAGE_WEEKLY')) %></li>
106
+ <% end %>
107
+ <% if params[:smooth] != 'AVERAGE_MONTHLY' && at_least_two_months %>
108
+ <li><%= link_to 'Monthly average', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'AVERAGE_MONTHLY')) %></li>
109
+ <% end %>
110
+ <% if params[:smooth] != 'SUM_WEEKLY' && at_least_two_weeks %>
111
+ <li><%= link_to 'Weekly sum', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'SUM_WEEKLY')) %></li>
112
+ <% end %>
113
+ <% if params[:smooth] != 'SUM_MONTHLY' && at_least_two_months %>
114
+ <li><%= link_to 'Monthly sum', kanaui_engine.dashboard_index_path(params.to_h.merge(:smooth => 'SUM_MONTHLY')) %></li>
115
+ <% end %>
116
+ <% end %>
117
+ <% filter_fields = ((@report['schema'] || {})['fields'] || []).select { |field| !field['distinctValues'].blank? && field['dataType'] =~ /char/ } # To ignore tenant_record_id %>
118
+ <% unless filter_fields.empty? %>
119
+ <li>Slicing & Dicing:
120
+ <%= form_tag kanaui_engine.dashboard_index_path(params.to_h), :method => :get, :class => 'form-horizontal' do %>
121
+ <input name="start_date" type="hidden" value="<%= @start_date %>">
122
+ <input name="end_date" type="hidden" value="<%= @end_date %>">
123
+ <input name="name" type="hidden" value="<%= @raw_name %>">
124
+ <input name="smooth" type="hidden" value="<%= params[:smooth] %>">
125
+ <input name="sql_only" type="hidden" value="<%= params[:sql_only] %>">
126
+ <input name="format" type="hidden" value="<%= params[:format] %>">
127
+
128
+ <fieldset class="form-group">
129
+ <legend>Filters</legend>
130
+ <% filter_fields.each do |field| %>
131
+ <div class="form-group">
132
+ <%= label_tag "filter_#{field['name']}", field['name'], :class => 'col-sm-2 control-label' %>
133
+ <div class="col-sm-10">
134
+ <%= select_tag "filter_#{field['name']}", options_for_select(field['distinctValues']), :multiple => true, :class => 'form-control' %>
135
+ </div>
136
+ </div>
137
+ <% end %>
138
+ </fieldset>
139
+ <fieldset class="form-group">
140
+ <legend>Dimensions to plot</legend>
141
+ <% filter_fields.each do |field| %>
142
+ <div class="form-group">
143
+ <%= label_tag "group_#{field['name']}", field['name'], :class => 'col-sm-2 control-label' %>
144
+ <div class="col-sm-10">
145
+ <%= select_tag "group_#{field['name']}", options_for_select(field['distinctValues']), :multiple => true, :class => 'form-control' %>
146
+ </div>
147
+ </div>
148
+ <% end %>
149
+ </fieldset>
150
+
151
+ <div class="form-group">
152
+ <div class="col-sm-offset-2 col-sm-10">
153
+ <%= submit_tag 'Refresh', :class => 'btn btn-default' %>
154
+ </div>
155
+ </div>
156
+ <% end %>
157
+ </li>
158
+ <li>Current Analytics query:&nbsp;<%= link_to '<i class="fa fa-question-circle"></i>'.html_safe, 'http://docs.killbill.io/latest/userguide_analytics.html#_dashboard_api', :target => '_blank' %>
159
+ <pre><%= params[:name] -%></pre>
160
+ </li>
161
+ <% end %>
162
+ <li><%= link_to 'SQL query', kanaui_engine.reports_path(params.to_h.merge(:sql_only => true)) %></li>
163
+ </ul>
164
+ </div>
165
+ </div>
166
+ <% end %>
167
+ </div>
168
+ </div>
140
169
  </div>
141
- </div>
142
170
  </div>
@@ -1,48 +1,62 @@
1
1
  <%= form_tag @report[:reportName].blank? ? url_for(:controller => :reports, :action => :create) : report_path(@report[:reportName]), :method => (@report[:reportName].blank? ? :post : :put), :class => 'form-horizontal' do %>
2
2
  <div class="form-group">
3
- <%= label_tag :report_name, 'Report name', :class => 'col-sm-2 control-label' %>
4
- <div class="col-sm-10">
3
+ <%= label_tag :report_name, 'Report name', :class => 'col-sm-3 control-label' %>
4
+ <div class="col-sm-9">
5
5
  <%= text_field_tag :report_name, @report[:reportName], :class => 'form-control', :disabled => !@report[:reportName].blank?, :read_only => !@report[:reportName].blank? %>
6
6
  </div>
7
7
  </div>
8
8
  <div class="form-group">
9
- <%= label_tag :report_pretty_name, 'Pretty name', :class => 'col-sm-2 control-label' %>
10
- <div class="col-sm-10">
9
+ <%= label_tag :report_pretty_name, 'Pretty name', :class => 'col-sm-3 control-label' %>
10
+ <div class="col-sm-9">
11
11
  <%= text_field_tag :report_pretty_name, @report[:reportPrettyName], :class => 'form-control' %>
12
12
  </div>
13
13
  </div>
14
14
  <div class="form-group">
15
- <%= label_tag :report_type, 'Type', :class => 'col-sm-2 control-label' %>
16
- <div class="col-sm-10">
15
+ <%= label_tag :report_type, 'Type', :class => 'col-sm-3 control-label' %>
16
+ <div class="col-sm-9">
17
17
  <%= select_tag :report_type, options_for_select(%w(TIMELINE COUNTERS TABLE), @report[:reportType] || 'TABLE'), :class => 'form-control' %>
18
18
  </div>
19
19
  </div>
20
20
  <div class="form-group">
21
- <%= label_tag :source_table_name, 'Source', :class => 'col-sm-2 control-label' %>
22
- <div class="col-sm-10">
21
+ <%= label_tag :source_table_name, 'Source', :class => 'col-sm-3 control-label' %>
22
+ <div class="col-sm-9">
23
23
  <%= text_field_tag :source_table_name, @report[:sourceTableName], :class => 'form-control' %>
24
24
  </div>
25
25
  </div>
26
26
  <div class="form-group">
27
- <%= label_tag :refresh_procedure_name, 'Refresh procedure', :class => 'col-sm-2 control-label' %>
28
- <div class="col-sm-10">
27
+ <%= label_tag :source_name, 'Source name', :class => 'col-sm-3 control-label' %>
28
+ <div class="col-sm-9">
29
+ <%= text_field_tag :source_name, @report[:sourceName], :class => 'form-control' %>
30
+ <span>Must match a database configuration entry in the Analytics plugin</span>
31
+ </div>
32
+ </div>
33
+ <div class="form-group">
34
+ <%= label_tag :source_query, 'SQL query', :class => 'col-sm-3 control-label' %>
35
+ <div class="col-sm-9">
36
+ <%= text_area_tag :source_query, @report[:sourceQuery], rows: 10, cols: 25, :class => 'form-control' %>
37
+ <span>Don't add a trailing ;</span>
38
+ </div>
39
+ </div>
40
+ <div class="form-group">
41
+ <%= label_tag :refresh_procedure_name, 'Refresh procedure', :class => 'col-sm-3 control-label' %>
42
+ <div class="col-sm-9">
29
43
  <%= text_field_tag :refresh_procedure_name, @report[:refreshProcedureName], :class => 'form-control' %>
30
44
  </div>
31
45
  </div>
32
46
  <div class="form-group">
33
- <%= label_tag :refresh_frequency, 'Refresh frequency', :class => 'col-sm-2 control-label' %>
34
- <div class="col-sm-10">
35
- <%= select_tag :refresh_frequency, options_for_select(%w(HOURLY DAILY), @report[:refreshFrequency] || 'HOURLY'), :class => 'form-control' %>
47
+ <%= label_tag :refresh_frequency, 'Refresh frequency', :class => 'col-sm-3 control-label' %>
48
+ <div class="col-sm-9">
49
+ <%= select_tag :refresh_frequency, options_for_select(%w(HOURLY DAILY), @report[:refreshFrequency]), :class => 'form-control', :include_blank => true %>
36
50
  </div>
37
51
  </div>
38
52
  <div class="form-group">
39
- <%= label_tag :refresh_hour_of_day_gmt, 'Refresh hour (GMT)', :class => 'col-sm-2 control-label' %>
40
- <div class="col-sm-10">
53
+ <%= label_tag :refresh_hour_of_day_gmt, 'Refresh hour (GMT)', :class => 'col-sm-3 control-label' %>
54
+ <div class="col-sm-9">
41
55
  <%= number_field_tag :refresh_hour_of_day_gmt, @report[:refreshHourOfDayGmt], {:min => 1, :max => 23, :class => 'form-control'} %>
42
56
  </div>
43
57
  </div>
44
58
  <div class="form-group">
45
- <div class="col-sm-offset-2 col-sm-10">
59
+ <div class="col-sm-offset-3 col-sm-9">
46
60
  <%= submit_tag 'Save', :class => 'btn btn-default' %>
47
61
  </div>
48
62
  </div>
@@ -5,6 +5,8 @@
5
5
  <th>Pretty name</th>
6
6
  <th>Type</th>
7
7
  <th>Source</th>
8
+ <th>Source Name</th>
9
+ <th>Source Query</th>
8
10
  <th>Refresh procedure</th>
9
11
  <th>Refresh frequency</th>
10
12
  <th>Refresh hour (GMT)</th>
@@ -19,6 +21,23 @@
19
21
  <td><%= report[:reportPrettyName] %></td>
20
22
  <td><%= report[:reportType] %></td>
21
23
  <td><%= report[:sourceTableName] %></td>
24
+ <td><%= report[:sourceName] %></td>
25
+ <td>
26
+ <% unless report[:sourceQuery].blank? %>
27
+ <a href="" data-toggle="modal" data-target="#<%= report[:reportName] %>-query-modal">
28
+ Show SQL
29
+ </a>
30
+ <div class="modal fade" id="<%= report[:reportName] %>-query-modal" tabindex="-1" role="dialog">
31
+ <div class="modal-dialog" role="document">
32
+ <div class="modal-content column-block">
33
+ <div class="modal-body">
34
+ <p><pre class="sql-query"><code><%= report[:sourceQuery] %></code></pre></p>
35
+ </div>
36
+ </div><!-- /.modal-content -->
37
+ </div><!-- /.modal-dialog -->
38
+ </div><!-- /.modal -->
39
+ <% end %>
40
+ </td>
22
41
  <td><%= report[:refreshProcedureName] %></td>
23
42
  <td><%= report[:refreshFrequency] %></td>
24
43
  <td><%= report[:refreshHourOfDayGmt] %></td>
@@ -42,6 +61,7 @@
42
61
  <%= javascript_tag do %>
43
62
  $(document).ready(function() {
44
63
  $('#reports-table').dataTable({
64
+ "scrollX": true,
45
65
  "dom": "t",
46
66
  "paging": false,
47
67
  "columns": [
@@ -52,6 +72,8 @@
52
72
  null,
53
73
  null,
54
74
  null,
75
+ null,
76
+ null,
55
77
  { "orderable": false },
56
78
  { "orderable": false }
57
79
  ]