mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Merge pull request #4094 from spalger/fix/agressiveIECaching
Fix agressive IE caching
This commit is contained in:
commit
4df590c034
3 changed files with 35 additions and 15 deletions
|
@ -31,7 +31,7 @@
|
|||
"bluebird": "~2.1.3",
|
||||
"bootstrap": "~3.3.1",
|
||||
"d3": "~3.4.8",
|
||||
"elasticsearch": "~3.1.1",
|
||||
"elasticsearch": "~4.1.0",
|
||||
"Faker": "~1.1.0",
|
||||
"FileSaver": "*",
|
||||
"font-awesome": "~4.2.0",
|
||||
|
@ -55,6 +55,7 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"resolutions": {
|
||||
"angular-bootstrap": "~0.12"
|
||||
"angular-bootstrap": "~0.12",
|
||||
"elasticsearch": "~4.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,20 +103,16 @@ define(function (require) {
|
|||
|
||||
$scope.title = inflection.singularize(serviceObj.title);
|
||||
|
||||
es.mget({
|
||||
body: {
|
||||
docs: [{
|
||||
_index: config.file.kibana_index,
|
||||
_type: service.type,
|
||||
_id: $routeParams.id
|
||||
}]
|
||||
}
|
||||
es.get({
|
||||
index: config.file.kibana_index,
|
||||
type: service.type,
|
||||
id: $routeParams.id
|
||||
})
|
||||
.then(function (resp) {
|
||||
$scope.obj = resp.docs[0];
|
||||
$scope.link = service.urlFor($scope.obj._id);
|
||||
.then(function (obj) {
|
||||
$scope.obj = obj;
|
||||
$scope.link = service.urlFor(obj._id);
|
||||
|
||||
var fields = _.reduce($scope.obj._source, createField, []);
|
||||
var fields = _.reduce(obj._source, createField, []);
|
||||
if (service.Class) readObjectClass(fields, service.Class);
|
||||
$scope.fields = _.sortBy(fields, 'name');
|
||||
})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
define(function (require) {
|
||||
require('elasticsearch');
|
||||
var _ = require('lodash');
|
||||
|
||||
var es; // share the client amoungst all apps
|
||||
require('modules')
|
||||
|
@ -10,7 +11,29 @@ define(function (require) {
|
|||
es = esFactory({
|
||||
host: configFile.elasticsearch,
|
||||
log: 'info',
|
||||
requestTimeout: 0
|
||||
requestTimeout: 0,
|
||||
plugins: [function (Client, config) {
|
||||
|
||||
// esFactory automatically injects the AngularConnector to the config
|
||||
// https://github.com/elastic/elasticsearch-js/blob/master/src/lib/connectors/angular.js
|
||||
_(CustomAngularConnector).inherits(config.connectionClass);
|
||||
function CustomAngularConnector(host, config) {
|
||||
CustomAngularConnector.Super.call(this, host, config);
|
||||
|
||||
var originalRequest = this.request;
|
||||
this.request = function (params) {
|
||||
if (String(params.method).toUpperCase() === 'GET') {
|
||||
params.query = params.query || {};
|
||||
params.query._ = Date.now();
|
||||
}
|
||||
|
||||
return originalRequest.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
config.connectionClass = CustomAngularConnector;
|
||||
|
||||
}]
|
||||
});
|
||||
|
||||
return es;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue