blazer 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -5
- data/app/assets/javascripts/blazer/queries.js +12 -1
- data/app/views/blazer/dashboards/show.html.erb +3 -1
- data/app/views/blazer/queries/show.html.erb +1 -1
- data/lib/blazer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91a6508a46423aa3acbe9151fcc3a7519b27daacaff1ec46a2c5e5cb7afed8f1
|
4
|
+
data.tar.gz: 92f9465aed0bca2ba03b320e6b550271c1fff5c7a06a56905bf51a964e012046
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4b04de87e7b0f32d3cb6f88c02634f4b400bcb9281f4fc9b39db80579abea02feab25f4e7ede93793af5a05a46160d70f8789b37e4d7914ef61427d0e2edeb
|
7
|
+
data.tar.gz: 49a48fdee3660a4178f3df8619f7bee4677da27431af2500d4e312db698090989868778ae8b544cf20f636aa71e63771148ab3a858229a2c1d3ce622258119f5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -150,8 +150,8 @@ Create a user with read-only permissions:
|
|
150
150
|
|
151
151
|
```sql
|
152
152
|
BEGIN;
|
153
|
-
CREATE ROLE blazer LOGIN PASSWORD '
|
154
|
-
GRANT CONNECT ON DATABASE
|
153
|
+
CREATE ROLE blazer LOGIN PASSWORD 'secret';
|
154
|
+
GRANT CONNECT ON DATABASE dbname TO blazer;
|
155
155
|
GRANT USAGE ON SCHEMA public TO blazer;
|
156
156
|
GRANT SELECT ON ALL TABLES IN SCHEMA public TO blazer;
|
157
157
|
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO blazer;
|
@@ -163,7 +163,8 @@ COMMIT;
|
|
163
163
|
Create a user with read-only permissions:
|
164
164
|
|
165
165
|
```sql
|
166
|
-
|
166
|
+
CREATE USER 'blazer'@'127.0.0.1' IDENTIFIED BY 'secret';
|
167
|
+
GRANT SELECT, SHOW VIEW ON dbname.* TO 'blazer'@'127.0.0.1';
|
167
168
|
FLUSH PRIVILEGES;
|
168
169
|
```
|
169
170
|
|
@@ -171,8 +172,8 @@ FLUSH PRIVILEGES;
|
|
171
172
|
|
172
173
|
Create a user with read-only permissions:
|
173
174
|
|
174
|
-
```
|
175
|
-
db.createUser({user: "blazer", pwd: "
|
175
|
+
```javascript
|
176
|
+
db.createUser({user: "blazer", pwd: "secret", roles: ["read"]})
|
176
177
|
```
|
177
178
|
|
178
179
|
Also, make sure authorization is enabled when you start the server.
|
@@ -3,6 +3,9 @@ var runningQueries = []
|
|
3
3
|
var maxQueries = 3
|
4
4
|
|
5
5
|
function runQuery(data, success, error) {
|
6
|
+
if (!data.data_source) {
|
7
|
+
throw new Error("Data source is required to cancel queries")
|
8
|
+
}
|
6
9
|
data.run_id = uuid()
|
7
10
|
var query = {
|
8
11
|
data: data,
|
@@ -50,7 +53,11 @@ function runQueryHelper(query) {
|
|
50
53
|
queryComplete(query)
|
51
54
|
}
|
52
55
|
}).fail( function(jqXHR, textStatus, errorThrown) {
|
53
|
-
|
56
|
+
// check jqXHR.status instead of query.canceled
|
57
|
+
// so it works for page navigation with Firefox and Safari
|
58
|
+
if (jqXHR.status === 0) {
|
59
|
+
cancelServerQuery(query)
|
60
|
+
} else {
|
54
61
|
var message = (typeof errorThrown === "string") ? errorThrown : errorThrown.message
|
55
62
|
if (!message) {
|
56
63
|
message = "An error occurred"
|
@@ -83,6 +90,8 @@ function cancelAllQueries() {
|
|
83
90
|
}
|
84
91
|
}
|
85
92
|
|
93
|
+
// needed for Chrome
|
94
|
+
// queries are canceled before unload with Firefox and Safari
|
86
95
|
$(window).on("unload", cancelAllQueries)
|
87
96
|
|
88
97
|
function cancelQuery(query) {
|
@@ -90,7 +99,9 @@ function cancelQuery(query) {
|
|
90
99
|
if (query.xhr) {
|
91
100
|
query.xhr.abort()
|
92
101
|
}
|
102
|
+
}
|
93
103
|
|
104
|
+
function cancelServerQuery(query) {
|
94
105
|
// tell server
|
95
106
|
var path = Routes.cancel_queries_path()
|
96
107
|
var data = {run_id: query.run_id, data_source: query.data_source}
|
@@ -39,7 +39,9 @@
|
|
39
39
|
</div>
|
40
40
|
</div>
|
41
41
|
<script>
|
42
|
-
|
42
|
+
<% data = {statement: query.statement, query_id: query.id, data_source: query.data_source, variables: variable_params(query), only_chart: true} %>
|
43
|
+
<% data.merge!(cohort_period: params[:cohort_period]) if params[:cohort_period] %>
|
44
|
+
<%= blazer_js_var "data", data %>
|
43
45
|
|
44
46
|
runQuery(data, function (data) {
|
45
47
|
$("#chart-<%= i %>").html(data)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% blazer_title @query.name %>
|
2
2
|
|
3
3
|
<% if @success %>
|
4
|
-
<% run_data = {statement: @query.statement, query_id: @query.id, variables: variable_params(@query)} %>
|
4
|
+
<% run_data = {statement: @query.statement, query_id: @query.id, data_source: @query.data_source, variables: variable_params(@query)} %>
|
5
5
|
<% run_data.merge!(forecast: "t") if params[:forecast] %>
|
6
6
|
<% run_data.merge!(cohort_period: params[:cohort_period]) if params[:cohort_period] %>
|
7
7
|
<% run_data.transform_keys!(&:to_s) if Rails::VERSION::STRING.to_f == 5.0 %>
|
data/lib/blazer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blazer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|