1
0
Fork 0

fixed issue: #1881

This commit is contained in:
hkernbach 2016-07-22 20:36:54 +02:00
parent bbf5aa6899
commit b74437716b
2 changed files with 34 additions and 7 deletions

View File

@ -1,18 +1,30 @@
/* jshint browser: true */
/* jshint unused: false */
/* global window, Backbone, $, frontendConfig */
/* global window, Backbone, arangoHelper, $, frontendConfig */
(function () {
'use strict';
window.QueryManagementActive = Backbone.Collection.extend({
model: window.queryManagementModel,
url: function () {
return frontendConfig.basePath + '/_api/query/current';
var url = frontendConfig.basePath + '/_api/query/current';
if (window.frontendConfig.db !== '_system') {
url = arangoHelper.databaseUrl('/_api/query/current');
}
return url;
},
killRunningQuery: function (id, callback) {
var url = frontendConfig.basePath + '/_api/query/' + encodeURIComponent(id);
if (window.frontendConfig.db !== '_system') {
url = arangoHelper.databaseUrl('/_api/query/' + encodeURIComponent(id));
}
$.ajax({
url: frontendConfig.basePath + '/_api/query/' + encodeURIComponent(id),
url: url,
type: 'DELETE',
success: function (result) {
callback();

View File

@ -1,21 +1,36 @@
/* jshint browser: true */
/* jshint unused: false */
/* global window, Backbone, $ */
/* global window, Backbone, arangoHelper, frontendConfig, $ */
(function () {
'use strict';
window.QueryManagementSlow = Backbone.Collection.extend({
model: window.queryManagementModel,
url: '/_api/query/slow',
url: function () {
var url = frontendConfig.basePath + '/_api/query/slow';
if (window.frontendConfig.db !== '_system') {
url = arangoHelper.databaseUrl('/_api/query/slow');
}
return url;
},
deleteSlowQueryHistory: function (callback) {
var self = this;
var url = frontendConfig.basePath + '/_api/query/slow';
if (window.frontendConfig.db !== '_system') {
url = arangoHelper.databaseUrl('/_api/query/slow');
}
$.ajax({
url: self.url,
url: url,
type: 'DELETE',
success: function (result) {
callback();
}
});
}
});
}());