mirror of https://gitee.com/bigwinds/arangodb
fixed issue: #1881
This commit is contained in:
parent
bbf5aa6899
commit
b74437716b
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}());
|
||||
|
|
Loading…
Reference in New Issue