The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/common/lib/elastic.min.js

4 lines
91 KiB

13 years ago
/*! elastic.js - v1.0.0 - 2013-01-15
* 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