sql-jarvis 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 34198e54e403b305e786f655f80fa32640a8939e
4
- data.tar.gz: aeb3642e1a933845877f02bf2ad1ca9828d9176a
2
+ SHA256:
3
+ metadata.gz: a3232731e4d33526a1e36b5d7b14e143a535097ec826163326fec0bb8d7f9add
4
+ data.tar.gz: a64d8ea6bb11dbd6dab1b6e74b36c144d5effba442d68eef7f7dd095789b7327
5
5
  SHA512:
6
- metadata.gz: e3f891d5ab28aedae39534548471ec2270b213f01dd4f7dc6b83aaf3a70381f4411587cdfc00319d5f16bdba612d8ce4f41342bf17fe49228009b2249d3f2716
7
- data.tar.gz: 8cf3a8a8834f1d4f38430a38b7b8c0ea53dc7cf9027fd70709771a2657a47039f4c3e54cf517712ec5f7ee1112994e64ffc7e761c01c3fada63d67f8d3d18186
6
+ metadata.gz: 71f0f0ea4e2229ef1dd6d09d7f92e65b883ad657fd07f1ef05c6370cd9b19d52e7fc5154440ceb3a5a9e58990dc9ce21ad90d9bb117dc4adbcead2fc4045c3d8
7
+ data.tar.gz: ef24ade3db2314f19a02276ed0874112e4ac458052fa1f24b22f83e7130ed9f56f962251ef400be4bba4b02a81b977b2eea1836be5bb6f3e92d67e7f06851206
@@ -177,7 +177,7 @@ module Blazer
177
177
 
178
178
  def destroy
179
179
  @query.destroy if @query.editable?(blazer_user)
180
- redirect_to root_url
180
+ redirect_to root_url(subdomain: Blazer.subdomain)
181
181
  end
182
182
 
183
183
  def tables
@@ -1,6 +1,6 @@
1
1
  <ul>
2
2
  <% @checks.each do |check| %>
3
- <li><%= link_to check.query.name, query_url(check.query_id) %> <%= check.state %></li>
3
+ <li><%= link_to check.query.name, query_url(check.query_id, subdomain: Blazer.subdomain) %> <%= check.state %></li>
4
4
  <% end %>
5
5
  </ul>
6
- <p><%= link_to "Manage checks", checks_url %></p>
6
+ <p><%= link_to "Manage checks", checks_url(subdomain: Blazer.subdomain) %></p>
@@ -2,7 +2,7 @@
2
2
  <head>
3
3
  </head>
4
4
  <body style="font-family: 'Helvetica Neue', Arial, Helvetica; font-size: 14px; color: #333;">
5
- <p><%= link_to "View", query_url(@check.query_id) %></p>
5
+ <p><%= link_to "View", query_url(@check.query_id, subdomain: Blazer.subdomain) %></p>
6
6
  <% if @error %>
7
7
  <p><%= @error %></p>
8
8
  <% elsif @rows_count > 0 && @check_type == "bad_data" %>
@@ -2,14 +2,18 @@
2
2
  <div id="header" style="margin-bottom: 20px;">
3
3
  <div class="pull-right">
4
4
  <% if blazer_user %>
5
- <%= link_to "All", root_path, class: !params[:filter] ? "active" : nil, style: "margin-right: 40px;" %>
6
-
7
- <% if Blazer.audit %>
8
- <%= link_to "Viewed", root_path(filter: "viewed"), class: params[:filter] == "viewed" ? "active" : nil, style: "margin-right: 40px;" %>
9
- <% end %>
10
-
11
- <%= link_to "Mine", root_path(filter: "mine"), class: params[:filter] == "mine" ? "active" : nil, style: "margin-right: 40px;" %>
5
+ <div class='btn-group' style='margin-right: 20px;'>
6
+ <%= link_to "All", root_path, class: !params[:filter] ? 'active btn btn-default btn-xs' : 'btn btn-default btn-xs' %>
7
+ <% if Blazer.audit %>
8
+ <%= link_to "Viewed", root_path(filter: "viewed"), class: params[:filter] == "viewed" ? 'active btn btn-default btn-xs' : 'btn btn-default btn-xs' %>
9
+ <% end %>
10
+ <%= link_to "Mine", root_path(filter: "mine"), class: params[:filter] == "mine" ? 'active btn btn-default btn-xs' : 'btn btn-default btn-xs' %>
11
+ </div>
12
12
  <% end %>
13
+ <div class='btn-group'>
14
+ <%= link_to "Dashboards", dashboards_path, class: 'btn btn-default' %>
15
+ <%= link_to "Checks", checks_path, class: 'btn btn-default' %>
16
+ </div>
13
17
  <div class="btn-group">
14
18
  <%= link_to "New Query", new_query_path, class: "btn btn-info" %>
15
19
  <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@@ -17,9 +21,6 @@
17
21
  <span class="sr-only">Toggle Dropdown</span>
18
22
  </button>
19
23
  <ul class="dropdown-menu">
20
- <li><%= link_to "Dashboards", dashboards_path %></li>
21
- <li><%= link_to "Checks", checks_path %></li>
22
- <li role="separator" class="divider"></li>
23
24
  <li><%= link_to "New Dashboard", new_dashboard_path %></li>
24
25
  <li><%= link_to "New Check", new_check_path %></li>
25
26
  </ul>
data/lib/blazer.rb CHANGED
@@ -31,6 +31,7 @@ module Blazer
31
31
  attr_writer :user_method
32
32
  attr_accessor :before_action
33
33
  attr_accessor :from_email
34
+ attr_accessor :subdomain
34
35
  attr_accessor :cache
35
36
  attr_accessor :transform_statement
36
37
  attr_accessor :check_schedules
@@ -48,6 +49,7 @@ module Blazer
48
49
  self.check_schedules = ["5 minutes", "1 hour", "1 day"]
49
50
  self.mapbox_access_token = nil
50
51
  self.assignees = []
52
+ self.subdomain = nil
51
53
  self.anomaly_checks = false
52
54
  self.async = false
53
55
  self.images = false
@@ -121,6 +123,11 @@ module Blazer
121
123
  statement.gsub(/\-\-.+/, "").gsub(/\/\*.+\*\//m, "").scan(/\{\w*?\}/i).map { |v| v[1...-1] }.reject { |v| /\A\d+(\,\d+)?\z/.match(v) || v.empty? }.uniq
122
124
  end
123
125
 
126
+ def self.send_failing_after_checks(schedule: nil)
127
+ run_checks(schedule)
128
+ send_failing_checks
129
+ end
130
+
124
131
  def self.run_checks(schedule: nil)
125
132
  checks = Blazer::Check.includes(:query)
126
133
  checks = checks.where(schedule: schedule) if schedule
data/lib/blazer/engine.rb CHANGED
@@ -11,6 +11,7 @@ module Blazer
11
11
  Blazer.audit = Blazer.settings.key?("audit") ? Blazer.settings["audit"] : true
12
12
  Blazer.user_name = Blazer.settings["user_name"] if Blazer.settings["user_name"]
13
13
  Blazer.from_email = Blazer.settings["from_email"] if Blazer.settings["from_email"]
14
+ Blazer.subdomain = Blazer.settings["subdomain"] if Blazer.settings["subdomain"]
14
15
  Blazer.before_action = Blazer.settings["before_action_method"] if Blazer.settings["before_action_method"]
15
16
  Blazer.check_schedules = Blazer.settings["check_schedules"] if Blazer.settings.key?("check_schedules")
16
17
 
@@ -1,3 +1,3 @@
1
1
  module Blazer
2
- VERSION = "1.9.8"
2
+ VERSION = "1.9.9"
3
3
  end
@@ -53,6 +53,8 @@ audit: true
53
53
  # email to send checks from
54
54
  # from_email: blazer@example.org
55
55
 
56
+ # subdomain: admin
57
+
56
58
  mapbox_access_token: <%= ENV["MAPBOX_ACCESS_TOKEN"] %>
57
59
 
58
60
  #assignees: 'SELECT id, name FROM users ORDER BY id ASC'
@@ -7,4 +7,9 @@ namespace :blazer do
7
7
  task send_failing_checks: :environment do
8
8
  Blazer.send_failing_checks
9
9
  end
10
+
11
+ desc "send failing after real checks"
12
+ task :send_failing_after_checks, [:schedule] => :environment do |_, args|
13
+ Blazer.send_failing_after_checks(schedule: args[:schedule] || ENV["SCHEDULE"])
14
+ end
10
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql-jarvis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.8
4
+ version: 1.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - ThanhKhoaIT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-30 00:00:00.000000000 Z
11
+ date: 2018-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -205,8 +205,6 @@ files:
205
205
  - lib/generators/blazer/templates/config.yml.tt
206
206
  - lib/generators/blazer/templates/install.rb.tt
207
207
  - lib/tasks/blazer.rake
208
- - sql-jarvis-1.9.6.gem
209
- - sql-jarvis-1.9.7.gem
210
208
  homepage: https://github.com/ThanhKhoaIT/blazer
211
209
  licenses:
212
210
  - MIT
@@ -227,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
225
  version: '0'
228
226
  requirements: []
229
227
  rubyforge_project:
230
- rubygems_version: 2.6.14
228
+ rubygems_version: 2.7.7
231
229
  signing_key:
232
230
  specification_version: 4
233
231
  summary: Fork from ankane! Explore your data with SQL. Easily create charts and dashboards,
data/sql-jarvis-1.9.6.gem DELETED
Binary file
data/sql-jarvis-1.9.7.gem DELETED
Binary file