pghero 2.8.3 → 3.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +47 -0
- data/LICENSE.txt +1 -1
- data/app/assets/javascripts/pghero/Chart.bundle.js +23379 -19766
- data/app/assets/javascripts/pghero/application.js +13 -12
- data/app/assets/javascripts/pghero/chartkick.js +834 -764
- data/app/assets/javascripts/pghero/highlight.min.js +440 -0
- data/app/assets/javascripts/pghero/jquery.js +318 -197
- data/app/assets/javascripts/pghero/nouislider.js +676 -1066
- data/app/assets/stylesheets/pghero/application.css +8 -2
- data/app/assets/stylesheets/pghero/nouislider.css +4 -10
- data/app/controllers/pg_hero/home_controller.rb +103 -37
- data/app/helpers/pg_hero/home_helper.rb +2 -2
- data/app/views/layouts/pg_hero/application.html.erb +4 -2
- data/app/views/pg_hero/home/_query_stats_slider.html.erb +6 -6
- data/app/views/pg_hero/home/connections.html.erb +6 -6
- data/app/views/pg_hero/home/explain.html.erb +4 -2
- data/app/views/pg_hero/home/index.html.erb +3 -1
- data/app/views/pg_hero/home/queries.html.erb +4 -2
- data/app/views/pg_hero/home/relation_space.html.erb +1 -1
- data/app/views/pg_hero/home/show_query.html.erb +17 -13
- data/app/views/pg_hero/home/space.html.erb +44 -40
- data/app/views/pg_hero/home/system.html.erb +6 -6
- data/lib/generators/pghero/query_stats_generator.rb +1 -0
- data/lib/generators/pghero/space_stats_generator.rb +1 -0
- data/lib/generators/pghero/templates/config.yml.tt +6 -0
- data/lib/pghero/database.rb +0 -7
- data/lib/pghero/engine.rb +1 -1
- data/lib/pghero/methods/basic.rb +6 -9
- data/lib/pghero/methods/connections.rb +5 -5
- data/lib/pghero/methods/constraints.rb +1 -1
- data/lib/pghero/methods/explain.rb +34 -0
- data/lib/pghero/methods/indexes.rb +8 -8
- data/lib/pghero/methods/kill.rb +1 -1
- data/lib/pghero/methods/maintenance.rb +4 -4
- data/lib/pghero/methods/queries.rb +2 -2
- data/lib/pghero/methods/query_stats.rb +28 -29
- data/lib/pghero/methods/replication.rb +2 -2
- data/lib/pghero/methods/sequences.rb +3 -3
- data/lib/pghero/methods/settings.rb +1 -1
- data/lib/pghero/methods/space.rb +20 -14
- data/lib/pghero/methods/suggested_indexes.rb +40 -110
- data/lib/pghero/methods/system.rb +16 -16
- data/lib/pghero/methods/tables.rb +4 -5
- data/lib/pghero/methods/users.rb +12 -4
- data/lib/pghero/version.rb +1 -1
- data/lib/pghero.rb +90 -65
- data/lib/tasks/pghero.rake +11 -1
- data/licenses/LICENSE-chart.js.txt +1 -1
- data/licenses/LICENSE-date-fns.txt +21 -20
- data/licenses/LICENSE-kurkle-color.txt +9 -0
- metadata +9 -8
- data/app/assets/javascripts/pghero/highlight.pack.js +0 -2
@@ -2,11 +2,12 @@
|
|
2
2
|
//= require ./nouislider
|
3
3
|
//= require ./Chart.bundle
|
4
4
|
//= require ./chartkick
|
5
|
-
//= require ./highlight.
|
5
|
+
//= require ./highlight.min
|
6
6
|
|
7
7
|
function highlightQueries() {
|
8
|
-
$("pre code").each(function(i, block) {
|
9
|
-
|
8
|
+
$("pre code").each(function (i, block) {
|
9
|
+
$(block).addClass("language-pgsql");
|
10
|
+
hljs.highlightElement(block);
|
10
11
|
});
|
11
12
|
}
|
12
13
|
|
@@ -45,9 +46,9 @@ function initSlider() {
|
|
45
46
|
});
|
46
47
|
|
47
48
|
// remove outline for mouse only
|
48
|
-
$(".noUi-handle").mousedown(function() {
|
49
|
+
$(".noUi-handle").mousedown(function () {
|
49
50
|
$(this).addClass("no-outline");
|
50
|
-
}).blur(function() {
|
51
|
+
}).blur(function () {
|
51
52
|
$(this).removeClass("no-outline");
|
52
53
|
});
|
53
54
|
|
@@ -61,14 +62,14 @@ function initSlider() {
|
|
61
62
|
var time = timeAt(offset);
|
62
63
|
|
63
64
|
var html = "";
|
64
|
-
if (time
|
65
|
-
if (selector
|
65
|
+
if (time === now) {
|
66
|
+
if (selector === "#range-end") {
|
66
67
|
html = "Now";
|
67
68
|
}
|
68
69
|
} else {
|
69
70
|
html = time.getDate() + " " + months[time.getMonth()] + " " + pad(time.getHours()) + ":" + pad(time.getMinutes());
|
70
71
|
}
|
71
|
-
$(selector).
|
72
|
+
$(selector).text(html);
|
72
73
|
}
|
73
74
|
|
74
75
|
function timeAt(offset) {
|
@@ -77,7 +78,7 @@ function initSlider() {
|
|
77
78
|
}
|
78
79
|
|
79
80
|
function timeParam(time) {
|
80
|
-
return time.toISOString();
|
81
|
+
return time.toISOString().replace(/\.000Z$/, "Z");
|
81
82
|
}
|
82
83
|
|
83
84
|
function queriesPath(params) {
|
@@ -115,7 +116,7 @@ function initSlider() {
|
|
115
116
|
|
116
117
|
var path = queriesPath(params);
|
117
118
|
|
118
|
-
$(".queries-table th a").each(
|
119
|
+
$(".queries-table th a").each(function () {
|
119
120
|
var p = $.extend({}, params, {sort: $(this).data("sort"), min_average_time: minAverageTime, min_calls: minCalls, debug: debug});
|
120
121
|
if (!p.sort) {
|
121
122
|
delete p.sort;
|
@@ -135,7 +136,7 @@ function initSlider() {
|
|
135
136
|
|
136
137
|
var callback = function (response, status, xhr) {
|
137
138
|
if (status === "error" ) {
|
138
|
-
$(".queries-info").css("color", "red").
|
139
|
+
$(".queries-info").css("color", "red").text(xhr.status + " " + xhr.statusText);
|
139
140
|
} else {
|
140
141
|
highlightQueries();
|
141
142
|
}
|
@@ -152,7 +153,7 @@ function initSlider() {
|
|
152
153
|
refreshStats(true);
|
153
154
|
});
|
154
155
|
updateText();
|
155
|
-
$(
|
156
|
+
$(function () {
|
156
157
|
refreshStats(false);
|
157
158
|
});
|
158
159
|
}
|