summaryrefslogtreecommitdiff
path: root/vendor/assets
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-07 19:55:07 +0200
committerRémy Coutable <remy@rymai.me>2017-06-09 17:21:39 +0200
commite85914532970d61d53f025f3ff0d85891bab2637 (patch)
treea54bac63e63570a31ff31d4cafffc31e1636a1a0 /vendor/assets
parent55631e3d52dd2e16b69b02ffc99207b60a22989e (diff)
downloadgitlab-ce-e85914532970d61d53f025f3ff0d85891bab2637.tar.gz
Fix Rubocop offenses, improve SQL duration format and changelog entry
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'vendor/assets')
-rw-r--r--vendor/assets/javascripts/peek.js30
-rw-r--r--vendor/assets/stylesheets/peek.scss13
2 files changed, 12 insertions, 31 deletions
diff --git a/vendor/assets/javascripts/peek.js b/vendor/assets/javascripts/peek.js
index 0aec31ee2cb..4db076d259a 100644
--- a/vendor/assets/javascripts/peek.js
+++ b/vendor/assets/javascripts/peek.js
@@ -1,6 +1,4 @@
-var requestId;
-
-requestId = null;
+let requestId = null;
(function($) {
var fetchRequestResults, getRequestId, peekEnabled, toggleBar, updatePerformanceBar;
@@ -16,9 +14,11 @@ requestId = null;
};
updatePerformanceBar = function(results) {
var key, label, data, table, html, tr, duration_td, sql_td, strong;
- for (key in results.data) {
- for (label in results.data[key]) {
+
+ Object.keys(results.data).forEach((key) => {
+ Object.keys(results.data[key]).forEach((label) => {
data = results.data[key][label];
+
if (label == 'queries') {
table = document.createElement('table');
@@ -40,12 +40,11 @@ requestId = null;
table.className = 'table';
$("[data-defer-to=" + key + "-" + label + "]").html(table);
- }
- else {
+ } else {
$("[data-defer-to=" + key + "-" + label + "]").text(results.data[key][label]);
}
- }
- }
+ });
+ });
return $(document).trigger('peek:render', [getRequestId(), results]);
};
toggleBar = function(event) {
@@ -77,19 +76,6 @@ requestId = null;
};
$(document).on('keypress', toggleBar);
$(document).on('peek:update', fetchRequestResults);
- $(document).on('pjax:end', function(event, xhr, options) {
- if (xhr != null) {
- requestId = xhr.getResponseHeader('X-Request-Id');
- }
- if (peekEnabled()) {
- return $(this).trigger('peek:update');
- }
- });
- $(document).on('page:change turbolinks:load', function() {
- if (peekEnabled()) {
- return $(this).trigger('peek:update');
- }
- });
return $(function() {
if (peekEnabled()) {
return $(this).trigger('peek:update');
diff --git a/vendor/assets/stylesheets/peek.scss b/vendor/assets/stylesheets/peek.scss
index 224ecc4245e..4977487d3ae 100644
--- a/vendor/assets/stylesheets/peek.scss
+++ b/vendor/assets/stylesheets/peek.scss
@@ -6,16 +6,11 @@ header.navbar-gitlab.with-peek {
}
#peek {
- background: #000;
+ background: $black;
height: 35px;
line-height: 35px;
color: #999;
- .hidden {
- display: none;
- visibility: visible;
- }
-
&.disabled {
display: none;
}
@@ -58,12 +53,12 @@ header.navbar-gitlab.with-peek {
}
strong {
- color: #fff;
+ color: $white-light;
}
table {
strong {
- color: #000;
+ color: $black;
}
}
@@ -95,5 +90,5 @@ header.navbar-gitlab.with-peek {
}
#modal-peek-pg-queries-content {
- color: #000;
+ color: $black;
}