Updated elastic.js, improved error text on table
This commit is contained in:
1 parent
68b765789a
commit
e9d1fc7b1a
7 files changed
+2801
-792
No files matched your search
@@ -1,9 +1,10 @@
|
||||
/*! elastic.js - v1.0.0 - 2013-01-15
|
||||
/*! elastic.js - v1.0.0 - 2013-03-05
|
||||
* https://github.com/fullscale/elastic.js
|
||||
* Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */
|
||||
|
||||
/*jshint browser:true */
|
||||
/*global angular:true */
|
||||
/*jshint es5:true */
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
@@ -26,8 +27,8 @@ angular.module('elasticjs.service', [])
|
||||
(successcb || angular.noop)(response.data);
|
||||
return response.data;
|
||||
}, function (response) {
|
||||
(errorcb || angular.noop)(undefined);
|
||||
return undefined;
|
||||
(errorcb || angular.noop)(response.data);
|
||||
return response.data;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/*! elastic.js - v1.0.0 - 2013-01-15
|
||||
/*! elastic.js - v1.0.0 - 2013-03-05
|
||||
* https://github.com/fullscale/elastic.js
|
||||
* Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */
|
||||
"use strict";angular.module("elasticjs.service",[]).factory("ejsResource",["$http",function(e){return function(t){var n=window.ejs||{},r=function(e,t,n){return e.then(function(e){return(t||angular.noop)(e.data),e.data},function(e){return(n||angular.noop)(undefined),undefined})};return t==null&&(t=""),n.client={server:function(e){return e==null?t:(t=e,this)},post:function(n,i,s,o){return n=t+n,r(e.post(n,i),s,o)},get:function(n,i,s,o){return n=t+n,r(e.get(n,i),s,o)},put:function(n,i,s,o){return n=t+n,r(e.put(n,i),s,o)},del:function(n,i,s,o){return n=t+n,r(e.delete(n,i),s,o)},head:function(n,r,i,s){return n=t+n,e.head(n,r).then(function(e){return(i||angular.noop)(e.headers()),e.headers()},function(e){return(s||angular.noop)(undefined),undefined})}},n}}]);
|
||||
"use strict";angular.module("elasticjs.service",[]).factory("ejsResource",["$http",function(e){return function(t){var n=window.ejs||{},r=function(e,t,n){return e.then(function(e){return(t||angular.noop)(e.data),e.data},function(e){return(n||angular.noop)(undefined),undefined})};return t==null&&(t=""),n.client={server:function(e){return e==null?t:(t=e,this)},post:function(n,i,s,o){return n=t+n,r(e.post(n,i),s,o)},get:function(n,i,s,o){return n=t+n,r(e.get(n,i),s,o)},put:function(n,i,s,o){return n=t+n,r(e.put(n,i),s,o)},del:function(n,i,s,o){return n=t+n,r(e.delete(n,i),s,o)},head:function(n,r,i,s){return n=t+n,e.head(n,r).then(function(e){return(i||angular.noop)(e.headers()),e.headers()},function(e){return(s||angular.noop)(undefined),undefined})}},n}}]);
|
||||
+2784
-781
File diff suppressed because it is too large.
Load diff
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
/*! elastic.js - v1.0.0 - 2013-01-15
|
||||
/*! elastic.js - v1.0.0 - 2013-04-04
|
||||
* https://github.com/fullscale/elastic.js
|
||||
* Copyright (c) 2013 FullScale Labs, LLC; Licensed MIT */
|
||||
(function(){"use strict";var e=this,t=e&&e.ejs,n=Array.prototype,r=Object.prototype,i=n.slice,s=r.toString,o=r.hasOwnProperty,u=n.forEach,a=Array.isArray,f={},l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L;typeof exports!="undefined"?L=exports:L=e.ejs={},l=function(e,t){return o.call(e,t)},c=function(e,t,n){if(e==null)return;if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)===f)return}else for(var s in e)if(l(e,s)&&t.call(n,e[s],s,e)===f)return},h=function(e){return c(i.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},p=a||function(e){return s.call(e)==="[object Array]"},d=function(e){return e===Object(e)},v=function(e){return s.call(e)==="[object String]"},m=function(e){return s.call(e)==="[object Number]"},typeof /./!="function"?g=function(e){return typeof e=="function"}:g=function(e){return s.call(e)==="[object Function]"},y=function(e){return d(e)&&l(e,"_type")&&l(e,"_self")&&l(e,"toString")},b=function(e){return y(e)&&e._type()==="query"},w=function(e){return y(e)&&e._type()==="filter"},E=function(e){return y(e)&&e._type()==="facet"},S=function(e){return y(e)&&e._type()==="script field"},x=function(e){return y(e)&&e._type()==="geo point"},T=function(e){return y(e)&&e._type()==="indexed shape"},N=function(e){return y(e)&&e._type()==="shape"},C=function(e){return y(e)&&e._type()==="sort"},k=function(e){return y(e)&&e._type()==="highlight"},L.DateHistogramFacet=function(e){var t={};return t[e]={date_histogram:{}},{field:function(n){return n==null?t[e].date_histogram.field:(t[e].date_histogram.field=n,this)},keyField:function(n){return n==null?t[e].date_histogram.key_field:(t[e].date_histogram.key_field=n,this)},valueField:function(n){return n==null?t[e].date_histogram.value_field:(t[e].date_histogram.value_field=n,this)},interval:function(n){return n==null?t[e].date_histogram.interval:(t[e].date_histogram.interval=n,this)},timeZone:function(n){return n==null?t[e].date_histogram.time_zone:(t[e].date_histogram.time_zone=n,this)},preZone:function(n){return n==null?t[e].date_histogram.pre_zone:(t[e].date_histogram.pre_zone=n,this)},preZoneAdjustLargeInterval:function(n){return n==null?t[e].date_histogram.pre_zone_adjust_large_interval:(t[e].date_histogram.pre_zone_adjust_large_interval=n,this)},postZone:function(n){return n==null?t[e].date_histogram.post_zone:(t[e].date_histogram.post_zone=n,this)},preOffset:function(n){return n==null?t[e].date_histogram.pre_offset:(t[e].date_histogram.pre_offset=n,this)},postOffset:function(n){return n==null?t[e].date_histogram.post_offset:(t[e].date_histogram.post_offset=n,this)},factor:function(n){return n==null?t[e].date_histogram.factor:(t[e].date_histogram.factor=n,this)},valueScript:function(n){return n==null?t[e].date_histogram.value_script:(t[e].date_histogram.value_script=n,this)},order:function(n){if(n==null)return t[e].date_histogram.order;n=n.toLowerCase();if(n==="time"||n==="count"||n==="total")t[e].date_histogram.order=n;return this},lang:function(n){return n==null?t[e].date_histogram.lang:(t[e].date_histogram.lang=n,this)},params:function(n){return n==null?t[e].date_histogram.params:(t[e].date_histogram.params=n,this)},facetFilter:function(n){if(n==null)return t[e].facet_filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].facet_filter=n._self(),this},global:function(n){return n==null?t[e].global:(t[e].global=n,this)},scope:function(n){return n==null?t[e].scope:(t[e].scope=n,this)},cacheFilter:function(n){return n==null?t[e].cache_filter:(t[e].cache_filter=n,this)},nested:function(n){return n==null?t[e].nested:(t[e].nested=n,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"facet"},_self:function(){return t}}},L.FilterFacet=function(e){var t={};return t[e]={},{filter:function(n){if(n==null)return t[e].filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].filter=n._self(),this},facetFilter:function(n){if(n==null)return t[e].facet_filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].facet_filter=n._self(),this},global:function(n){return n==null?t[e].global:(t[e].global=n,this)},scope:function(n){return n==null?t[e].scope:(t[e].scope=n,this)},cacheFilter:function(n){return n==null?t[e].cache_filter:(t[e].cache_filter=n,this)},nested:function(n){return n==null?t[e].nested:(t[e].nested=n,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"facet"},_self:function(){return t}}},L.GeoDistanceFacet=function(e){var t={},n=L.GeoPoint([0,0]),r="location";return t[e]={geo_distance:{location:n._self(),ranges:[]}},{field:function(n){var i=t[e].geo_distance[r];return n==null?r:(delete t[e].geo_distance[r],r=n,t[e].geo_distance[n]=i,this)},point:function(i){if(i==null)return n;if(!x(i))throw new TypeError("Argument must be a GeoPoint");return n=i,t[e].geo_distance[r]=i._self(),this},addRange:function(n,r){return arguments.length===0?t[e].geo_distance.ranges:(t[e].geo_distance.ranges.pushLine truncated
|
||||
(function(){"use strict";var e=this,t=e&&e.ejs,n=Array.prototype,r=Object.prototype,i=n.slice,s=r.toString,o=r.hasOwnProperty,u=n.forEach,a=Array.isArray,f={},l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O;typeof exports!="undefined"?O=exports:O=e.ejs={},l=function(e,t){return o.call(e,t)},c=function(e,t,n){if(e==null)return;if(u&&e.forEach===u)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(t.call(n,e[r],r,e)===f)return}else for(var s in e)if(l(e,s)&&t.call(n,e[s],s,e)===f)return},h=function(e){return c(i.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},p=a||function(e){return s.call(e)==="[object Array]"},d=function(e){return e===Object(e)},v=function(e){return s.call(e)==="[object String]"},m=function(e){return s.call(e)==="[object Number]"},typeof /./!="function"?g=function(e){return typeof e=="function"}:g=function(e){return s.call(e)==="[object Function]"},y=function(e){return d(e)&&l(e,"_type")&&l(e,"_self")&&l(e,"toString")},b=function(e){return y(e)&&e._type()==="query"},w=function(e){return y(e)&&e._type()==="filter"},E=function(e){return y(e)&&e._type()==="facet"},S=function(e){return y(e)&&e._type()==="script field"},x=function(e){return y(e)&&e._type()==="geo point"},T=function(e){return y(e)&&e._type()==="indexed shape"},N=function(e){return y(e)&&e._type()==="shape"},C=function(e){return y(e)&&e._type()==="sort"},k=function(e){return y(e)&&e._type()==="highlight"},L=function(e){return y(e)&&e._type()==="suggest"},A=function(e){return y(e)&&e._type()==="generator"},O.DateHistogramFacet=function(e){var t={};return t[e]={date_histogram:{}},{field:function(n){return n==null?t[e].date_histogram.field:(t[e].date_histogram.field=n,this)},keyField:function(n){return n==null?t[e].date_histogram.key_field:(t[e].date_histogram.key_field=n,this)},valueField:function(n){return n==null?t[e].date_histogram.value_field:(t[e].date_histogram.value_field=n,this)},interval:function(n){return n==null?t[e].date_histogram.interval:(t[e].date_histogram.interval=n,this)},timeZone:function(n){return n==null?t[e].date_histogram.time_zone:(t[e].date_histogram.time_zone=n,this)},preZone:function(n){return n==null?t[e].date_histogram.pre_zone:(t[e].date_histogram.pre_zone=n,this)},preZoneAdjustLargeInterval:function(n){return n==null?t[e].date_histogram.pre_zone_adjust_large_interval:(t[e].date_histogram.pre_zone_adjust_large_interval=n,this)},postZone:function(n){return n==null?t[e].date_histogram.post_zone:(t[e].date_histogram.post_zone=n,this)},preOffset:function(n){return n==null?t[e].date_histogram.pre_offset:(t[e].date_histogram.pre_offset=n,this)},postOffset:function(n){return n==null?t[e].date_histogram.post_offset:(t[e].date_histogram.post_offset=n,this)},factor:function(n){return n==null?t[e].date_histogram.factor:(t[e].date_histogram.factor=n,this)},valueScript:function(n){return n==null?t[e].date_histogram.value_script:(t[e].date_histogram.value_script=n,this)},order:function(n){if(n==null)return t[e].date_histogram.order;n=n.toLowerCase();if(n==="time"||n==="count"||n==="total")t[e].date_histogram.order=n;return this},lang:function(n){return n==null?t[e].date_histogram.lang:(t[e].date_histogram.lang=n,this)},params:function(n){return n==null?t[e].date_histogram.params:(t[e].date_histogram.params=n,this)},facetFilter:function(n){if(n==null)return t[e].facet_filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].facet_filter=n._self(),this},global:function(n){return n==null?t[e].global:(t[e].global=n,this)},mode:function(n){if(n==null)return t[e].mode;n=n.toLowerCase();if(n==="collector"||n==="post")t[e].mode=n;return this},scope:function(e){return this},cacheFilter:function(n){return n==null?t[e].cache_filter:(t[e].cache_filter=n,this)},nested:function(n){return n==null?t[e].nested:(t[e].nested=n,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"facet"},_self:function(){return t}}},O.FilterFacet=function(e){var t={};return t[e]={},{filter:function(n){if(n==null)return t[e].filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].filter=n._self(),this},facetFilter:function(n){if(n==null)return t[e].facet_filter;if(!w(n))throw new TypeError("Argument must be a Filter");return t[e].facet_filter=n._self(),this},global:function(n){return n==null?t[e].global:(t[e].global=n,this)},mode:function(n){if(n==null)return t[e].mode;n=n.toLowerCase();if(n==="collector"||n==="post")t[e].mode=n;return this},scope:function(e){return this},cacheFilter:function(n){return n==null?t[e].cache_filter:(t[e].cache_filter=n,this)},nested:function(n){return n==null?t[e].nested:(t[e].nested=n,this)},toString:function(){return JSON.stringify(t)},_type:function(){return"facet"},_self:function(){return t}}},O.GeoDistanceFacet=function(e){var t={},n=O.GeoPoint([0,0]),r="location";return t[e]={geo_distance:{location:n._self(),ranges:[]}},{field:function(n){var i=t[e].geo_distance[r];return n==null?r:(delete t[e].geo_distance[r],r=n,t[e].gLine truncated
|
||||
@@ -27,7 +27,7 @@ var labjs = $LAB
|
||||
.script("common/lib/angular-strap.min.js")
|
||||
.script("common/lib/angular-sanitize.min.js")
|
||||
.script("common/lib/elastic.min.js")
|
||||
.script("common/lib/elastic-angular-client.min.js")
|
||||
.script("common/lib/elastic-angular-client.js")
|
||||
.script("common/lib/dateformat.js")
|
||||
.script("common/lib/date.js")
|
||||
.script("common/lib/datepicker.js")
|
||||
|
||||
@@ -74,6 +74,11 @@ angular.module('kibana.controllers', [])
|
||||
return 'panels/'+type+'/editor.html';
|
||||
}
|
||||
|
||||
// This is whoafully incomplete, but will do for now
|
||||
$scope.parse_error = function(data) {
|
||||
return data.match("nested: (.*?);")[1]
|
||||
}
|
||||
|
||||
$scope.init();
|
||||
|
||||
})
|
||||
|
||||
@@ -98,7 +98,7 @@ angular.module('kibana.table', [])
|
||||
|
||||
$scope.populate_modal(request)
|
||||
|
||||
var results = request.doSearch();
|
||||
var results = request.doSearch()
|
||||
|
||||
// Populate scope when we have results
|
||||
results.then(function(results) {
|
||||
@@ -110,8 +110,8 @@ angular.module('kibana.table', [])
|
||||
query_id = $scope.query_id = new Date().getTime()
|
||||
}
|
||||
|
||||
if(_.isUndefined(results)) {
|
||||
$scope.panel.error = 'Your query was unsuccessful';
|
||||
if(!(_.isUndefined(results.error))) {
|
||||
$scope.panel.error = $scope.parse_error(results.error);
|
||||
return;
|
||||
}
|
||||
$scope.panel.error = false;
|
||||
|
||||
Reference in new issue
Block a user