8000 Bug fix/ui moving documents (#2981) · Hotkey/arangodb@32836b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 32836b0

Browse files
hkernbachfceller
authored andcommitted
Bug fix/ui moving documents (arangodb#2981)
* ui - added bind parameters to slow query history view * also added bind params to running query view * ui: fixed a bug when moving multiple documents was not possible
1 parent ec5dde4 commit 32836b0

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
devel
22
-----
33

4+
* ui: fixed a bug when moving multiple documents was not possible
5+
6+
* ui: added bind parameters to slow query history view
7+
48
* fixed docs for issue #2968
59

610
* AQL CHAR_LENGTH(null) returns now 0. Since AQL TO_STRING(null) is '' (string of length 0)

js/apps/system/_admin/aardvark/APP/frontend/js/collections/arangoQueries.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
if (this.activeUser === false || this.activeUser === null) {
3838
this.activeUser = 'root';
3939
}
40-
console.log(response);
4140

4241
if (response.user === self.activeUser) {
4342
try {

js/apps/system/_admin/aardvark/APP/frontend/js/models/queryManagement.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
defaults: {
77
id: '',
88
query: '',
9+
bindVars: '',
910
started: '',
1011
runTime: ''
1112
}

js/apps/system/_admin/aardvark/APP/frontend/js/templates/arangoTable.ejs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script id="arangoTable.ejs" type="text/template">
22
<div class="tableWrapper">
3+
<% var type = type; %>
34
<table class="arango-table" id="<%=content.id%>">
45
<thead>
56
<tr>
@@ -13,7 +14,15 @@
1314
<% _.each(content.rows, function(k) { var counter=0;%>
1415
<tr>
1516
<% _.each(k, function(x) { %>
16-
<td class="arango-table-td table-cell<%=counter%>"><%=(content.unescaped && content.unescaped[counter] ? x : _.escape(x))%></td>
17+
<% if (type && type[counter] === 'pre') { %>
18+
<td class="arango-table-td table-cell<%=counter%>">
19+
<pre class="tablePre">
20+
<%=(content.unescaped && content.unescaped[counter] ? x : _.escape(x))%>
21+
</pre>
22+
</td>
23+
<% } else { %>
24+
<td class="arango-table-td table-cell<%=counter%>"><%=(content.unescaped && content.unescaped[counter] ? x : _.escape(x))%></td>
25+
<% } %>
1726
<% counter++;});%>
1827
</tr>
1928
<%});%>

js/apps/system/_admin/aardvark/APP/frontend/js/views/documentsView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@
722722
confirmMoveSelectedDocs: function () {
723723
var toMove = this.getSelectedDocs();
724724
var self = this;
725-
var toCollection = $('.modal-body').last().find('#move-documents-to').val();
725+
var toCollection = $('#move-documents-to').val();
726726

727727
var callback = function () {
728728
this.collection.getDocuments(this.getDocsCallback.bind(this));

js/apps/system/_admin/aardvark/APP/frontend/js/views/queryManagementView.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
tableDescription: {
4848
id: 'arangoQueryManagementTable',
49-
titles: ['ID', 'Query String', 'Runtime', 'Started', ''],
49+
titles: ['ID', 'Query String', 'Bind parameter', 'Runtime', 'Started', ''],
5050
rows: [],
5151
unescaped: [false, false, false, false, true]
5252
},
@@ -156,15 +156,25 @@
156156

157157
renderActive: function () {
158158
this.$el.html(this.templateActive.render({}));
159-
$(this.id).append(this.table.render({content: this.tableDescription}));
159+
$(this.id).append(this.table.render({
160+
content: this.tableDescription,
161+
type: {
162+
1: 'pre',
163+
2: 'pre'
164+
}
165+
}));
160166
$('#activequeries').addClass('arango-active-tab');
161167
this.addEvents();
162168
},
163169

164170
renderSlow: function () {
165171
this.$el.html(this.templateSlow.render({}));
166172
$(this.id).append(this.table.render({
167-
content: this.tableDescription
173+
content: this.tableDescription,
174+
type: {
175+
1: 'pre',
176+
2: 'pre'
177+
}
168178
}));
169179
$('#slowqueries').addClass('arango-active-tab');
170180
this.addEvents();
@@ -190,6 +200,7 @@
190200
rowsArray.push([
191201
model.get('id'),
192202
model.get('query'),
203+
JSON.stringify(model.get('bindVars'), null, 2),
193204
model.get('runTime').toFixed(2) + ' s',
194205
model.get('started'),
195206
button

js/apps/system/_admin/aardvark/APP/frontend/scss/_arangoTable.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
th {
88
border-bottom: 1px solid $c-c2grey;
99
font-weight: 500;
10-
text-align: left;
11-
padding-left: 18px;
1210
height: 43px;
11+
padding-left: 18px;
12+
text-align: left;
1313
}
1414
}
1515

@@ -25,6 +25,11 @@
2525

2626
td {
2727
padding: 10px 18px;
28+
29+
pre {
30+
background: none;
31+
border: 0;
32+
}
2833
}
2934
}
3035
}

0 commit comments

Comments
 (0)
0