@infinilabs/discover 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{components-DlsG7KXM.js → components-BZTcWo0D.js} +202 -174
- package/dist/{components-Cked4i6N.cjs → components-DzA4fVqH.cjs} +44 -44
- package/dist/index.cjs +2 -2
- package/dist/index.js +3 -3
- package/dist/{public-DkeTAKT1.cjs → public-BWdftR10.cjs} +1 -1
- package/dist/{public-C7v4cYKr.js → public-kDgoH8_s.js} +3 -3
- package/dist/{query_bar_top_row-C4FJnfpT.cjs → query_bar_top_row-DFBab9DF.cjs} +1 -1
- package/dist/{query_bar_top_row-C4dG0iOd.js → query_bar_top_row-DaHCNARQ.js} +112 -7
- package/dist/{query_bar_top_row-DmZrrXbn.js → query_bar_top_row-Dzd1EBWC.js} +4 -4
- package/dist/{query_bar_top_row-BIrC8hTD.cjs → query_bar_top_row-hkYli4mo.cjs} +1 -1
- package/dist/{query_string_input-DNXpRmoi.js → query_string_input-B6lvPXEY.js} +1 -1
- package/dist/{query_string_input-CQY2NhLF.cjs → query_string_input-jELi9JGI.cjs} +1 -1
- package/dist/{query_string_input-CrAgrfO0.js → query_string_input-o_vEPSg2.js} +2 -2
- package/dist/query_string_input-wee-LHxT.cjs +1 -0
- package/dist/{search_bar-BkPfxWbV.js → search_bar-Ho9D93zT.js} +4 -4
- package/dist/{search_bar-Dauppm1q.cjs → search_bar-aRdyo2C0.cjs} +1 -1
- package/dist/src/components/context.d.ts +17 -1
- package/package.json +1 -1
- package/dist/query_string_input-kkcxi4p_.cjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as __toESM, r as __export, t as __commonJSMin } from "./chunk-D-4zIDrl.js";
|
|
2
|
-
import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-
|
|
2
|
+
import { C as BehaviorSubject, E as Subscription, T as operate, _ as onRedirectNoIndexPattern, b as FilterManager, d as baseFormattersPublic, f as getTimezone, g as onUnsupportedTimePattern, h as IndexPatternsApiClient, l as generateFilters, m as SavedObjectsClientPublicToCommon, n as search, p as deserializeFieldFormat, u as createSearchBar, v as TimeHistory, w as createOperatorSubscriber, x as AutocompleteService, y as Timefilter } from "./public-kDgoH8_s.js";
|
|
3
3
|
import { a as createHashHistory, c as require_object_assign, d as FieldIcon, i as setIndexPatterns$1, l as require_url, o as _extends, t as getIndexPatterns, u as FieldButton } from "./services-C8UxrSbr.js";
|
|
4
4
|
import { t as require_classnames } from "./classnames-BCXlvRQ0.js";
|
|
5
5
|
import { t as require_lodash } from "./lodash-Gv_ptthU.js";
|
|
@@ -50,7 +50,7 @@ import { icon as icon$30 } from "@elastic/eui/es/components/icon/assets/tokenIP"
|
|
|
50
50
|
import { icon as icon$31 } from "@elastic/eui/es/components/icon/assets/tokenBoolean";
|
|
51
51
|
import { icon as icon$32 } from "@elastic/eui/es/components/icon/assets/tokenObject";
|
|
52
52
|
import { icon as icon$33 } from "@elastic/eui/es/components/icon/assets/tokenNested";
|
|
53
|
-
import { icon as icon$34 } from "@elastic/eui/es/components/icon/assets/
|
|
53
|
+
import { icon as icon$34 } from "@elastic/eui/es/components/icon/assets/tokenGeo";
|
|
54
54
|
import { icon as icon$35 } from "@elastic/eui/es/components/icon/assets/tokenHistogram";
|
|
55
55
|
import { icon as icon$36 } from "@elastic/eui/es/components/icon/assets/tokenFile";
|
|
56
56
|
import { icon as icon$37 } from "@elastic/eui/es/components/icon/assets/sortRight";
|
|
@@ -1085,7 +1085,7 @@ function DiscoverSidebar({ columns: e, fieldCounts: t, hits: n, onAddField: i, o
|
|
|
1085
1085
|
children: C.selected_label || "Selected fields"
|
|
1086
1086
|
}),
|
|
1087
1087
|
/* @__PURE__ */ jsx("ul", {
|
|
1088
|
-
className: "dscSidebarList dscFieldList--selected mb-8px",
|
|
1088
|
+
className: "dscSidebarList dscFieldList--selected mb-8px py-2px",
|
|
1089
1089
|
"aria-labelledby": "selected_fields",
|
|
1090
1090
|
children: F.map((t) => /* @__PURE__ */ jsx("li", {
|
|
1091
1091
|
"data-attr-field": t.name,
|
|
@@ -1153,6 +1153,7 @@ function DiscoverSidebar({ columns: e, fieldCounts: t, hits: n, onAddField: i, o
|
|
|
1153
1153
|
})] }),
|
|
1154
1154
|
/* @__PURE__ */ jsx("div", {
|
|
1155
1155
|
id: "fields-tree-wrapper",
|
|
1156
|
+
className: "py-2px",
|
|
1156
1157
|
children: /* @__PURE__ */ jsx(Tree, {
|
|
1157
1158
|
showLine: !1,
|
|
1158
1159
|
showIcon: !1,
|
|
@@ -1270,40 +1271,40 @@ var require_react_is_production_min = /* @__PURE__ */ __commonJSMin(((e) => {
|
|
|
1270
1271
|
function Z(e) {
|
|
1271
1272
|
return A(e) === m;
|
|
1272
1273
|
}
|
|
1273
|
-
function
|
|
1274
|
+
function KZ(e) {
|
|
1274
1275
|
return A(e) === f;
|
|
1275
1276
|
}
|
|
1276
|
-
function
|
|
1277
|
+
function Q(e) {
|
|
1277
1278
|
return A(e) === u;
|
|
1278
1279
|
}
|
|
1279
|
-
function
|
|
1280
|
+
function qZ(e) {
|
|
1280
1281
|
return typeof e == "object" && !!e && e.$$typeof === n;
|
|
1281
1282
|
}
|
|
1282
|
-
function
|
|
1283
|
+
function JZ(e) {
|
|
1283
1284
|
return A(e) === g;
|
|
1284
1285
|
}
|
|
1285
|
-
function
|
|
1286
|
+
function YZ(e) {
|
|
1286
1287
|
return A(e) === a;
|
|
1287
1288
|
}
|
|
1288
|
-
function
|
|
1289
|
+
function XZ(e) {
|
|
1289
1290
|
return A(e) === S;
|
|
1290
1291
|
}
|
|
1291
|
-
function
|
|
1292
|
+
function ZZ(e) {
|
|
1292
1293
|
return A(e) === x;
|
|
1293
1294
|
}
|
|
1294
|
-
function
|
|
1295
|
+
function QZ(e) {
|
|
1295
1296
|
return A(e) === i;
|
|
1296
1297
|
}
|
|
1297
|
-
function
|
|
1298
|
+
function $Z(e) {
|
|
1298
1299
|
return A(e) === s;
|
|
1299
1300
|
}
|
|
1300
|
-
function
|
|
1301
|
+
function eQ(e) {
|
|
1301
1302
|
return A(e) === o;
|
|
1302
1303
|
}
|
|
1303
|
-
function
|
|
1304
|
+
function tQ(e) {
|
|
1304
1305
|
return A(e) === y;
|
|
1305
1306
|
}
|
|
1306
|
-
e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer =
|
|
1307
|
+
e.AsyncMode = M, e.ConcurrentMode = N, e.ContextConsumer = P, e.ContextProvider = F, e.Element = I, e.ForwardRef = L, e.Fragment = R, e.Lazy = z, e.Memo = B, e.Portal = V, e.Profiler = U, e.StrictMode = W, e.Suspense = G, e.isAsyncMode = J, e.isConcurrentMode = Z, e.isContextConsumer = KZ, e.isContextProvider = Q, e.isElement = qZ, e.isForwardRef = JZ, e.isFragment = YZ, e.isLazy = XZ, e.isMemo = ZZ, e.isPortal = QZ, e.isProfiler = $Z, e.isStrictMode = eQ, e.isSuspense = tQ, e.isValidElementType = O, e.typeOf = A;
|
|
1307
1308
|
})();
|
|
1308
1309
|
})), require_react_is = /* @__PURE__ */ __commonJSMin(((e, t) => {
|
|
1309
1310
|
process.env.NODE_ENV === "production" ? t.exports = require_react_is_production_min() : t.exports = require_react_is_development();
|
|
@@ -2197,7 +2198,8 @@ var import_lodash$7 = require_lodash(), import_url$1 = require_url(), JSON_CONTE
|
|
|
2197
2198
|
}, renameKeys = (e, t) => Object.keys(t).reduce((n, i) => ({
|
|
2198
2199
|
...n,
|
|
2199
2200
|
[e[i] || i]: t[i]
|
|
2200
|
-
}), {})
|
|
2201
|
+
}), {});
|
|
2202
|
+
const timeBucketConfig = {
|
|
2201
2203
|
"histogram:maxBars": 100,
|
|
2202
2204
|
"histogram:barTarget": 50,
|
|
2203
2205
|
dateFormat: "YYYY-MM-DD",
|
|
@@ -2209,7 +2211,8 @@ var import_lodash$7 = require_lodash(), import_url$1 = require_url(), JSON_CONTE
|
|
|
2209
2211
|
["P1DT", "YYYY-MM-DD"],
|
|
2210
2212
|
["P1YT", "YYYY"]
|
|
2211
2213
|
]
|
|
2212
|
-
}
|
|
2214
|
+
};
|
|
2215
|
+
var basePath = {
|
|
2213
2216
|
get: () => "",
|
|
2214
2217
|
prepend: (e) => e,
|
|
2215
2218
|
remove: (e) => e,
|
|
@@ -2305,7 +2308,8 @@ var indexPatternsApiClient = new IndexPatternsApiClient(http$1), uiconfigs = {
|
|
|
2305
2308
|
};
|
|
2306
2309
|
remove = (e) => this.store.removeItem(e);
|
|
2307
2310
|
clear = () => this.store.clear();
|
|
2308
|
-
}, filterManager$1 = new FilterManager(), storage$1 = new Storage(localStorage), queryStringManager$1 = new QueryStringManager(storage$1)
|
|
2311
|
+
}, filterManager$1 = new FilterManager(), storage$1 = new Storage(localStorage), queryStringManager$1 = new QueryStringManager(storage$1);
|
|
2312
|
+
const timefilterConfig = {
|
|
2309
2313
|
timeDefaults: {
|
|
2310
2314
|
from: "",
|
|
2311
2315
|
to: ""
|
|
@@ -2314,7 +2318,8 @@ var indexPatternsApiClient = new IndexPatternsApiClient(http$1), uiconfigs = {
|
|
|
2314
2318
|
pause: !0,
|
|
2315
2319
|
value: 1e4
|
|
2316
2320
|
}
|
|
2317
|
-
}
|
|
2321
|
+
};
|
|
2322
|
+
var timefilter$1 = new Timefilter(timefilterConfig, new TimeHistory(storage$1)), getTimeBuckets$1 = (e) => {
|
|
2318
2323
|
let t = timefilter$1.getBounds();
|
|
2319
2324
|
if (t.max && t.min) {
|
|
2320
2325
|
let n = new TimeBuckets(timeBucketConfig);
|
|
@@ -2349,20 +2354,24 @@ const getContext = () => ({
|
|
|
2349
2354
|
var getEsQuery$1 = (e) => {
|
|
2350
2355
|
let t = timefilter$1.createFilter(e);
|
|
2351
2356
|
return buildEsQuery(e, queryStringManager$1.getQuery(), [...filterManager$1.getFilters(), ...t ? [t] : []]);
|
|
2352
|
-
}, getSearchParams$1 = (e, t, n, i, a, o, s, u = 20) => {
|
|
2353
|
-
let
|
|
2354
|
-
n && (
|
|
2357
|
+
}, getSearchParams$1 = (e, t, n, i, a, o, s, u = 20, f) => {
|
|
2358
|
+
let p = getTimeBuckets$1(t)?.getInterval(!0).expression, m = e.timeFieldName ? [{ [e.timeFieldName]: { order: "desc" } }] : [];
|
|
2359
|
+
n && (m = n.reduce((e, t) => {
|
|
2355
2360
|
let [n, i] = t;
|
|
2356
2361
|
return e.push({ [n]: { order: i } }), e;
|
|
2357
2362
|
}, []));
|
|
2358
|
-
let
|
|
2359
|
-
|
|
2360
|
-
[
|
|
2363
|
+
let g = {};
|
|
2364
|
+
e.timeFieldName && (p ? g.counts = { date_histogram: {
|
|
2365
|
+
[p.includes("w") || p.includes("d") || p.includes("y") || p.includes("M") ? "calendar_interval" : "fixed_interval"]: p,
|
|
2361
2366
|
field: e.timeFieldName,
|
|
2362
2367
|
min_doc_count: 1,
|
|
2363
|
-
time_zone:
|
|
2368
|
+
time_zone: f
|
|
2369
|
+
} } : g.counts = { auto_date_histogram: {
|
|
2370
|
+
field: e.timeFieldName,
|
|
2371
|
+
buckets: 10,
|
|
2372
|
+
time_zone: f
|
|
2364
2373
|
} });
|
|
2365
|
-
let
|
|
2374
|
+
let y = {
|
|
2366
2375
|
index: e.index || e.title,
|
|
2367
2376
|
body: {
|
|
2368
2377
|
query: getEsQuery$1(e),
|
|
@@ -2373,10 +2382,10 @@ var getEsQuery$1 = (e) => {
|
|
|
2373
2382
|
post_tags: ["@/highlighted-field@"],
|
|
2374
2383
|
fields: { "*": {} }
|
|
2375
2384
|
},
|
|
2376
|
-
sort:
|
|
2385
|
+
sort: m
|
|
2377
2386
|
}
|
|
2378
2387
|
};
|
|
2379
|
-
return e.timeFieldName && (
|
|
2388
|
+
return e.timeFieldName && (y.body.aggs = g), i && (y.body.aggs = i), a?.field && a?.enabled && (y.distinct_by_field = a), s && (y.body.track_total_hits = s), y;
|
|
2380
2389
|
}, fetchESRequest$1 = (e, t, n) => {}, import_prop_types = /* @__PURE__ */ __toESM(require_prop_types(), 1), DiscoverNoResultsUI = class extends Component {
|
|
2381
2390
|
static propTypes = { timeFieldName: import_prop_types.default.string };
|
|
2382
2391
|
render() {
|
|
@@ -3091,25 +3100,25 @@ function highlight_default(e, t) {
|
|
|
3091
3100
|
numberStyle: A,
|
|
3092
3101
|
startingLineNumber: T,
|
|
3093
3102
|
codeString: W
|
|
3094
|
-
}) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" },
|
|
3095
|
-
className: K.className ? `${
|
|
3103
|
+
}) : null, Z = s.hljs || s["pre[class*=\"language-\"]"] || { backgroundColor: "#fff" }, KZ = isHighlightJs(G) ? "hljs" : "prismjs", Q = y ? Object.assign({}, K, { style: Object.assign({}, Z, f) }) : Object.assign({}, K, {
|
|
3104
|
+
className: K.className ? `${KZ} ${K.className}` : KZ,
|
|
3096
3105
|
style: Object.assign({}, f)
|
|
3097
3106
|
});
|
|
3098
|
-
if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z,
|
|
3107
|
+
if (P ? m.style = _objectSpread({ whiteSpace: "pre-wrap" }, m.style) : m.style = _objectSpread({ whiteSpace: "pre" }, m.style), !G) return /* @__PURE__ */ React.createElement(z, Q, J, /* @__PURE__ */ React.createElement(V, m, W));
|
|
3099
3108
|
(M === void 0 && L || P) && (M = !0), L ||= defaultRenderer;
|
|
3100
|
-
var
|
|
3109
|
+
var qZ = [{
|
|
3101
3110
|
type: "text",
|
|
3102
3111
|
value: W
|
|
3103
|
-
}],
|
|
3112
|
+
}], JZ = getCodeTree({
|
|
3104
3113
|
astGenerator: G,
|
|
3105
3114
|
language: i,
|
|
3106
3115
|
code: W,
|
|
3107
|
-
defaultCodeValue:
|
|
3116
|
+
defaultCodeValue: qZ
|
|
3108
3117
|
});
|
|
3109
|
-
|
|
3110
|
-
var
|
|
3111
|
-
return /* @__PURE__ */ React.createElement(z,
|
|
3112
|
-
rows:
|
|
3118
|
+
JZ.language === null && (JZ.value = qZ);
|
|
3119
|
+
var YZ = T + (W.match(/\n/g)?.length ?? 0), XZ = processLines(JZ, M, I, x, C, T, YZ, A, P);
|
|
3120
|
+
return /* @__PURE__ */ React.createElement(z, Q, /* @__PURE__ */ React.createElement(V, m, !C && J, L({
|
|
3121
|
+
rows: XZ,
|
|
3113
3122
|
stylesheet: s,
|
|
3114
3123
|
useInlineStyles: y
|
|
3115
3124
|
})));
|
|
@@ -20997,7 +21006,7 @@ var pageCount = 20, table_default = React.memo(({ columns: e, hits: t, sortOrder
|
|
|
20997
21006
|
});
|
|
20998
21007
|
});
|
|
20999
21008
|
init_moment();
|
|
21000
|
-
var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD
|
|
21009
|
+
var Info_default = ({ bucketInterval: e, dateFormat: t = "YYYY-MM-DD HH:mm:ss", timeRange: n, stateInterval: i, total: a, took: o }) => {
|
|
21001
21010
|
let { i18n: s } = useContext(GlobalConfigContext), u = s?.result || {}, [f, p] = useState(i), m = useCallback((e) => e ? t ? moment_default(e).format(t) : e : "", [t]);
|
|
21002
21011
|
return useEffect(() => {
|
|
21003
21012
|
p(i);
|
|
@@ -51573,53 +51582,53 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51573
51582
|
store: FilterStateStore.APP_STATE
|
|
51574
51583
|
})));
|
|
51575
51584
|
}, []);
|
|
51576
|
-
let [
|
|
51585
|
+
let [A, M] = useState({
|
|
51577
51586
|
columns: s.columns || ["_source"],
|
|
51578
51587
|
interval: "15s",
|
|
51579
51588
|
sort: s.sort || []
|
|
51580
|
-
}),
|
|
51589
|
+
}), N = {
|
|
51581
51590
|
type: "string",
|
|
51582
51591
|
field: "",
|
|
51583
51592
|
enabled: !1
|
|
51584
|
-
}, [
|
|
51585
|
-
|
|
51586
|
-
...
|
|
51593
|
+
}, [P, F] = React.useState(N), I = (e) => {
|
|
51594
|
+
F({
|
|
51595
|
+
...P,
|
|
51587
51596
|
...e
|
|
51588
51597
|
});
|
|
51589
51598
|
};
|
|
51590
51599
|
useMemo(() => {
|
|
51591
|
-
|
|
51592
|
-
...
|
|
51593
|
-
type:
|
|
51594
|
-
field:
|
|
51600
|
+
F({
|
|
51601
|
+
...P,
|
|
51602
|
+
type: N.type,
|
|
51603
|
+
field: N.field
|
|
51595
51604
|
});
|
|
51596
51605
|
}, [t]), useEffect(() => {
|
|
51597
|
-
if (t) if (
|
|
51598
|
-
...
|
|
51599
|
-
type:
|
|
51600
|
-
field:
|
|
51606
|
+
if (t) if (F({
|
|
51607
|
+
...P,
|
|
51608
|
+
type: N.type,
|
|
51609
|
+
field: N.field
|
|
51601
51610
|
}), t?.timeFieldName) {
|
|
51602
51611
|
let e = [[t?.timeFieldName, "desc"]];
|
|
51603
|
-
|
|
51604
|
-
...
|
|
51612
|
+
M({
|
|
51613
|
+
...A,
|
|
51605
51614
|
columns: ["_source"],
|
|
51606
51615
|
sort: e
|
|
51607
|
-
}),
|
|
51608
|
-
} else
|
|
51609
|
-
...
|
|
51616
|
+
}), V({ sort: e });
|
|
51617
|
+
} else M({
|
|
51618
|
+
...A,
|
|
51610
51619
|
columns: ["_source"],
|
|
51611
51620
|
sort: []
|
|
51612
|
-
}),
|
|
51621
|
+
}), V({ sort: [] });
|
|
51613
51622
|
}, [t]);
|
|
51614
|
-
let
|
|
51623
|
+
let L = useMemo(() => {
|
|
51615
51624
|
let e = new Subscription();
|
|
51616
51625
|
return e.add(timefilter.getAutoRefreshFetch$().subscribe({ next: () => {
|
|
51617
|
-
|
|
51626
|
+
V();
|
|
51618
51627
|
} })), e;
|
|
51619
|
-
}, [t]), [
|
|
51628
|
+
}, [t]), [R, z] = React.useState(0), B = A.columns, V = useCallback(async (e) => {
|
|
51620
51629
|
if (!t || !o) return;
|
|
51621
|
-
|
|
51622
|
-
let n = e?.sort ||
|
|
51630
|
+
J((e) => e === "next" ? e : "loading"), e?.isScrollLoad || z(0);
|
|
51631
|
+
let n = e?.sort || A.sort, i = getSearchParams(t, e?.interval || A.interval, e?.sort || A.sort, e?.aggs || null, P || {}, e?.isScrollLoad ? R : 0, !1, 20, S), a = (0, import_lodash.cloneDeep)(i?.body?.query?.bool?.filter || []);
|
|
51623
51632
|
if (a.length > 0) {
|
|
51624
51633
|
let t = a[a.length - 1];
|
|
51625
51634
|
t?.hasOwnProperty("range") && (e?.rangeFilter ? (a[a.length - 1] = (0, import_lodash.cloneDeep)(e?.rangeFilter), i.body.query.bool.filter = a) : E.current = t);
|
|
@@ -51627,8 +51636,8 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51627
51636
|
let { index: f, body: p } = i, m = await o(f, p);
|
|
51628
51637
|
(!m || !m.hits) && (m.hits = { hits: [] }), T(m);
|
|
51629
51638
|
let { query: g } = queryStringManager.getQuery(), y = filterManager.getFilters();
|
|
51630
|
-
u(
|
|
51631
|
-
...
|
|
51639
|
+
u({
|
|
51640
|
+
...s,
|
|
51632
51641
|
query: g == s.query ? s.query : g,
|
|
51633
51642
|
range: [timefilter._time?.from, timefilter._time?.to],
|
|
51634
51643
|
sort: n,
|
|
@@ -51640,61 +51649,80 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51640
51649
|
query: n
|
|
51641
51650
|
};
|
|
51642
51651
|
})
|
|
51643
|
-
})
|
|
51652
|
+
});
|
|
51644
51653
|
}, [
|
|
51645
|
-
|
|
51646
|
-
|
|
51654
|
+
A.interval,
|
|
51655
|
+
A.sort,
|
|
51647
51656
|
t,
|
|
51648
|
-
|
|
51649
|
-
|
|
51657
|
+
P,
|
|
51658
|
+
R,
|
|
51650
51659
|
t?.timeFieldName,
|
|
51651
|
-
s
|
|
51660
|
+
s,
|
|
51661
|
+
S
|
|
51652
51662
|
]);
|
|
51653
51663
|
useEffect(() => {
|
|
51654
|
-
|
|
51664
|
+
R > 0 && V({
|
|
51655
51665
|
isScrollLoad: !0,
|
|
51656
51666
|
rangeFilter: E.current
|
|
51657
51667
|
});
|
|
51658
|
-
}, [
|
|
51659
|
-
isFrist ? isFrist = !isFrist :
|
|
51668
|
+
}, [R]), useEffect(() => {
|
|
51669
|
+
isFrist ? isFrist = !isFrist : V();
|
|
51660
51670
|
}, [e.indices]);
|
|
51661
|
-
let
|
|
51662
|
-
e &&
|
|
51663
|
-
...
|
|
51671
|
+
let U = (e) => {
|
|
51672
|
+
e && M({
|
|
51673
|
+
...A,
|
|
51664
51674
|
interval: e
|
|
51665
51675
|
});
|
|
51666
|
-
}, [
|
|
51667
|
-
if (!w.hits.hits || w.hits.hits.length == 0) return
|
|
51668
|
-
if (!t?.timeFieldName || !w.aggregations || !w.aggregations.counts) return
|
|
51676
|
+
}, [G, J] = useState("loading"), { histogramData: Z, timeChartProps: Q } = useMemo(() => {
|
|
51677
|
+
if (!w.hits.hits || w.hits.hits.length == 0) return J("none"), {};
|
|
51678
|
+
if (!t?.timeFieldName || !w.aggregations || !w.aggregations.counts) return J("ready"), {
|
|
51679
|
+
histogramData: null,
|
|
51680
|
+
timeChartProps: null
|
|
51681
|
+
};
|
|
51682
|
+
let e = [];
|
|
51683
|
+
w.aggregations.counts.buckets.forEach((t) => {
|
|
51684
|
+
e.push(t);
|
|
51685
|
+
});
|
|
51686
|
+
let n, i = getTimeBuckets(A.interval);
|
|
51687
|
+
if (i) n = timefilter;
|
|
51688
|
+
else {
|
|
51689
|
+
let t = e[0]?.key, a = e[e.length - 1]?.key;
|
|
51690
|
+
if (t && a) {
|
|
51691
|
+
n = new Timefilter(timefilterConfig, new Storage(localStorage)), n.setTime({
|
|
51692
|
+
from: moment_default(t).toISOString(),
|
|
51693
|
+
to: moment_default(a).toISOString(),
|
|
51694
|
+
mode: "absolute"
|
|
51695
|
+
});
|
|
51696
|
+
let e = n.getBounds(), o = new TimeBuckets(timeBucketConfig);
|
|
51697
|
+
o.setBounds(e), o.setInterval(w.aggregations.counts.interval), i = o;
|
|
51698
|
+
}
|
|
51699
|
+
}
|
|
51700
|
+
if (!i) return J("ready"), {
|
|
51669
51701
|
histogramData: null,
|
|
51670
51702
|
timeChartProps: null
|
|
51671
51703
|
};
|
|
51672
|
-
let
|
|
51704
|
+
let a = i.getInterval(!0), o = {
|
|
51673
51705
|
columns: [{
|
|
51674
51706
|
id: "key",
|
|
51675
|
-
name: `${t?.getTimeField().displayName} per ${
|
|
51707
|
+
name: `${t?.getTimeField().displayName} per ${a.description}`
|
|
51676
51708
|
}, {
|
|
51677
51709
|
id: "doc_count",
|
|
51678
51710
|
name: "count"
|
|
51679
51711
|
}],
|
|
51680
|
-
rows:
|
|
51681
|
-
}
|
|
51682
|
-
w.aggregations.counts.buckets.forEach((e) => {
|
|
51683
|
-
i.rows.push(e);
|
|
51684
|
-
});
|
|
51685
|
-
let a = {
|
|
51712
|
+
rows: e
|
|
51713
|
+
}, s = {
|
|
51686
51714
|
x: {
|
|
51687
51715
|
accessor: 0,
|
|
51688
51716
|
format: {
|
|
51689
51717
|
id: "date",
|
|
51690
|
-
params: { pattern:
|
|
51718
|
+
params: { pattern: i.getScaledDateFormat() }
|
|
51691
51719
|
},
|
|
51692
51720
|
params: {
|
|
51693
51721
|
date: !0,
|
|
51694
|
-
interval: moment_default.duration(
|
|
51695
|
-
intervalESValue:
|
|
51696
|
-
intervalESUnit:
|
|
51697
|
-
bounds:
|
|
51722
|
+
interval: moment_default.duration(a.esValue, a.esUnit),
|
|
51723
|
+
intervalESValue: a.esValue,
|
|
51724
|
+
intervalESUnit: a.esUnit,
|
|
51725
|
+
bounds: i.getBounds()
|
|
51698
51726
|
}
|
|
51699
51727
|
},
|
|
51700
51728
|
y: {
|
|
@@ -51703,70 +51731,70 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51703
51731
|
label: "Count"
|
|
51704
51732
|
}
|
|
51705
51733
|
};
|
|
51706
|
-
|
|
51707
|
-
let
|
|
51734
|
+
J("ready");
|
|
51735
|
+
let u = {
|
|
51708
51736
|
timeRange: {
|
|
51709
|
-
from:
|
|
51710
|
-
to:
|
|
51737
|
+
from: n?.getBounds().min,
|
|
51738
|
+
to: n?.getBounds().max
|
|
51711
51739
|
},
|
|
51712
|
-
stateInterval:
|
|
51740
|
+
stateInterval: A.interval || w.aggregations.counts.interval || "15s",
|
|
51713
51741
|
options: intervalOptions,
|
|
51714
|
-
onIntervalChange:
|
|
51742
|
+
onIntervalChange: U,
|
|
51715
51743
|
bucketInterval: {
|
|
51716
|
-
...
|
|
51744
|
+
...a,
|
|
51717
51745
|
timeFieldName: t?.timeFieldName
|
|
51718
51746
|
}
|
|
51719
51747
|
};
|
|
51720
51748
|
return {
|
|
51721
|
-
histogramData: buildPointSeriesData(
|
|
51722
|
-
timeChartProps:
|
|
51749
|
+
histogramData: buildPointSeriesData(o, s),
|
|
51750
|
+
timeChartProps: u
|
|
51723
51751
|
};
|
|
51724
51752
|
}, [
|
|
51725
51753
|
w,
|
|
51726
51754
|
t,
|
|
51727
51755
|
t?.timeFieldName,
|
|
51728
|
-
|
|
51756
|
+
A.interval
|
|
51729
51757
|
]);
|
|
51730
51758
|
useEffect(() => {
|
|
51731
51759
|
u((e) => ({
|
|
51732
51760
|
...e,
|
|
51733
|
-
columns:
|
|
51761
|
+
columns: A.columns
|
|
51734
51762
|
}));
|
|
51735
|
-
}, [
|
|
51736
|
-
let { onAddColumn:
|
|
51763
|
+
}, [A.columns]);
|
|
51764
|
+
let { onAddColumn: qZ, onRemoveColumn: JZ, onMoveColumn: YZ, onSetColumns: XZ } = useMemo(() => getStateColumnActions({
|
|
51737
51765
|
indexPattern: t,
|
|
51738
|
-
setAppState:
|
|
51739
|
-
state:
|
|
51766
|
+
setAppState: M,
|
|
51767
|
+
state: A,
|
|
51740
51768
|
useNewFieldsApi: !1
|
|
51741
|
-
}), [t,
|
|
51742
|
-
|
|
51743
|
-
...
|
|
51769
|
+
}), [t, A]), ZZ = useCallback((e) => {
|
|
51770
|
+
M({
|
|
51771
|
+
...A,
|
|
51744
51772
|
sort: e
|
|
51745
|
-
}),
|
|
51746
|
-
}, [
|
|
51773
|
+
}), V({ sort: e.reverse() });
|
|
51774
|
+
}, [A, t]), QZ = useCallback((e, n, i) => {
|
|
51747
51775
|
typeof e == "string" || e.name;
|
|
51748
51776
|
let a = generateFilters(filterManager, e, n, i, String(t.id));
|
|
51749
|
-
filterManager.addFilters(a),
|
|
51750
|
-
}, [t,
|
|
51777
|
+
filterManager.addFilters(a), V();
|
|
51778
|
+
}, [t, V]), $Z = (e) => {
|
|
51751
51779
|
timefilter.setTime({
|
|
51752
51780
|
from: moment_default(e.from).toISOString(),
|
|
51753
51781
|
to: moment_default(e.to).toISOString(),
|
|
51754
51782
|
mode: "absolute"
|
|
51755
|
-
}),
|
|
51756
|
-
},
|
|
51783
|
+
}), V();
|
|
51784
|
+
}, eQ = w.hits.hits || [], [tQ, nQ] = useState([]);
|
|
51757
51785
|
useMemo(() => {
|
|
51758
|
-
eQ.length > 0 ?
|
|
51786
|
+
eQ.length > 0 ? nQ(R > 0 ? (e) => [...e, ...eQ] : eQ) : R === 0 && nQ([]);
|
|
51759
51787
|
}, [eQ]);
|
|
51760
|
-
let
|
|
51788
|
+
let rQ = {
|
|
51761
51789
|
savedSearch: {},
|
|
51762
51790
|
timefield: t?.getTimeField()?.displayName,
|
|
51763
51791
|
chartAggConfigs: {}
|
|
51764
|
-
},
|
|
51765
|
-
for (let e of
|
|
51766
|
-
let
|
|
51767
|
-
saveDocument:
|
|
51768
|
-
deleteDocument:
|
|
51769
|
-
}), [
|
|
51792
|
+
}, iQ = {};
|
|
51793
|
+
for (let e of tQ) for (let n of Object.keys(t.flattenHit(e, !0))) iQ[n] = (iQ[n] || 0) + 1;
|
|
51794
|
+
let aQ = Number.isInteger(w.hits.total?.value) ? w.hits.total?.value : 0, oQ = t?.timeFieldName != "", sQ = useCallback(async ({ _index: e, _id: t, _type: n, _source: i, is_new: a }) => !1, [V]), cQ = useCallback(async ({ _index: e, _id: t, _type: n }) => !1, [V]), lQ = useMemo(() => ({
|
|
51795
|
+
saveDocument: sQ,
|
|
51796
|
+
deleteDocument: cQ
|
|
51797
|
+
}), [sQ, cQ]), uQ = async (e, n, i) => {
|
|
51770
51798
|
let a = e?.spec?.name || e?.name;
|
|
51771
51799
|
if (!a || !o) return;
|
|
51772
51800
|
if (e.isMulti) a = `${a}.keyword`;
|
|
@@ -51792,7 +51820,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51792
51820
|
size: s.topNumber || 5,
|
|
51793
51821
|
shard_size: 25
|
|
51794
51822
|
} }
|
|
51795
|
-
}, f = getSearchParams(t,
|
|
51823
|
+
}, f = getSearchParams(t, A.interval, A.sort, u, P || {}, 0, !0, 0, S), p = f?.body?.query?.bool?.filter || [];
|
|
51796
51824
|
if (p.length > 0 && E.current) {
|
|
51797
51825
|
let e = p[p.length - 1], t = (0, import_lodash.cloneDeep)(E.current);
|
|
51798
51826
|
e?.hasOwnProperty("range") ? (p[p.length - 1] = t, f.body.query.bool.filter = p) : p.push(t), f.body.query.bool.filter = p;
|
|
@@ -51802,19 +51830,19 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51802
51830
|
let e = s.sampleRecords === "all" ? y?.aggregations?.top5?.buckets : y?.aggregations?.sample?.top5?.buckets, t = s.sampleRecords === "all" ? y?.aggregations?.top5?.sum_other_doc_count : y?.aggregations?.sample?.sample_count?.value;
|
|
51803
51831
|
i(e || [], t || 0, y?.error);
|
|
51804
51832
|
}
|
|
51805
|
-
},
|
|
51806
|
-
|
|
51833
|
+
}, dQ = async (e) => {
|
|
51834
|
+
L.unsubscribe(), t.timeFieldName = e, n(t);
|
|
51807
51835
|
let i = [[e, "desc"]];
|
|
51808
|
-
|
|
51809
|
-
...
|
|
51836
|
+
M({
|
|
51837
|
+
...A,
|
|
51810
51838
|
columns: ["_source"],
|
|
51811
51839
|
sort: i
|
|
51812
|
-
}),
|
|
51813
|
-
},
|
|
51840
|
+
}), V({ sort: i });
|
|
51841
|
+
}, fQ = async (e, n, i) => {
|
|
51814
51842
|
if (!o) return;
|
|
51815
|
-
|
|
51816
|
-
let { index: a, body: s } = getSearchParams(t,
|
|
51817
|
-
i?.(f,
|
|
51843
|
+
J("downloading");
|
|
51844
|
+
let { index: a, body: s } = getSearchParams(t, A.interval, A.sort, null, P || {}, e, !1, n, S), u = await o(a, s), f = Array.isArray(u?.hits?.hits) ? u?.hits?.hits : [], p = t.timeFieldName;
|
|
51845
|
+
i?.(f, B, p), J("ready");
|
|
51818
51846
|
};
|
|
51819
51847
|
return /* @__PURE__ */ jsxs(Card, {
|
|
51820
51848
|
className: "h-full",
|
|
@@ -51823,7 +51851,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51823
51851
|
showSearchBar: !1,
|
|
51824
51852
|
showQueryBar: !0,
|
|
51825
51853
|
showQueryInput: !0,
|
|
51826
|
-
showDatePicker:
|
|
51854
|
+
showDatePicker: oQ,
|
|
51827
51855
|
showFilterBar: !0,
|
|
51828
51856
|
useDefaultBehaviors: !0,
|
|
51829
51857
|
screenTitle: "",
|
|
@@ -51840,32 +51868,32 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51840
51868
|
queryString: queryStringManager,
|
|
51841
51869
|
timefilter,
|
|
51842
51870
|
storage,
|
|
51843
|
-
onQuerySubmit:
|
|
51871
|
+
onQuerySubmit: V,
|
|
51844
51872
|
services,
|
|
51845
51873
|
dateRangeFrom: s.range && s.range[0],
|
|
51846
51874
|
dateRangeTo: s.range && s.range[1],
|
|
51847
51875
|
selectedIndexPattern: t,
|
|
51848
51876
|
setIndexPattern: (e) => {
|
|
51849
|
-
|
|
51877
|
+
L.unsubscribe(), i(e);
|
|
51850
51878
|
},
|
|
51851
51879
|
indices: e.indices,
|
|
51852
|
-
histogramData:
|
|
51880
|
+
histogramData: Z,
|
|
51853
51881
|
timefilterUpdateHandler: $Z,
|
|
51854
|
-
histogramOpts:
|
|
51882
|
+
histogramOpts: rQ,
|
|
51855
51883
|
timeSetting: {
|
|
51856
|
-
...
|
|
51884
|
+
...Q || {},
|
|
51857
51885
|
showTimeSetting: !0,
|
|
51858
51886
|
showTimeField: !0,
|
|
51859
51887
|
timeField: t.timeFieldName,
|
|
51860
51888
|
timeFields: t.fields.filter((e) => e.spec.type === "date").map((e) => e.displayName),
|
|
51861
51889
|
showTimeInterval: !1,
|
|
51862
|
-
timeInterval:
|
|
51890
|
+
timeInterval: Q?.stateInterval,
|
|
51863
51891
|
timeIntervals: intervalOptions?.map(({ display: e, val: t }) => ({
|
|
51864
51892
|
label: e,
|
|
51865
51893
|
value: t
|
|
51866
51894
|
})),
|
|
51867
51895
|
onTimeSettingChange: ({ timeField: e, timeInterval: n }) => {
|
|
51868
|
-
t.timeFieldName !== e &&
|
|
51896
|
+
t.timeFieldName !== e && dQ(e), Q?.stateInterval !== n && U(n);
|
|
51869
51897
|
},
|
|
51870
51898
|
timeZone: S,
|
|
51871
51899
|
onTimeZoneChange: C,
|
|
@@ -51877,29 +51905,29 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51877
51905
|
className: "flex-1 min-h-0 relative",
|
|
51878
51906
|
children: /* @__PURE__ */ jsx("div", {
|
|
51879
51907
|
className: "absolute inset-0 flex border-t border-t-solid border-[var(--ant-color-border)]",
|
|
51880
|
-
children:
|
|
51881
|
-
timeFieldName:
|
|
51882
|
-
queryLanguage:
|
|
51908
|
+
children: G === "none" && R === 0 ? /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(DiscoverNoResults, {
|
|
51909
|
+
timeFieldName: rQ.timefield,
|
|
51910
|
+
queryLanguage: A.query?.language || "",
|
|
51883
51911
|
range: s.range
|
|
51884
51912
|
}) }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [!b.sideBar && /* @__PURE__ */ jsx("div", {
|
|
51885
51913
|
className: "h-full w-300px p-8px border-r border-r-solid border-[var(--ant-color-border)] overflow-y-auto infini-discover-side",
|
|
51886
51914
|
children: /* @__PURE__ */ jsx(SidebarMemoized, {
|
|
51887
51915
|
config: {},
|
|
51888
|
-
columns:
|
|
51889
|
-
fieldCounts:
|
|
51890
|
-
hits:
|
|
51916
|
+
columns: B,
|
|
51917
|
+
fieldCounts: iQ,
|
|
51918
|
+
hits: tQ,
|
|
51891
51919
|
indexPatterns: [t],
|
|
51892
|
-
onAddField:
|
|
51920
|
+
onAddField: qZ,
|
|
51893
51921
|
onAddFilter: QZ,
|
|
51894
51922
|
onRemoveField: JZ,
|
|
51895
51923
|
selectedIndexPattern: t,
|
|
51896
51924
|
setIndexPattern: () => {},
|
|
51897
|
-
setAppState:
|
|
51898
|
-
state:
|
|
51899
|
-
distinctParams:
|
|
51900
|
-
onDistinctParamsChange:
|
|
51901
|
-
total:
|
|
51902
|
-
onFieldAgg:
|
|
51925
|
+
setAppState: M,
|
|
51926
|
+
state: A,
|
|
51927
|
+
distinctParams: P,
|
|
51928
|
+
onDistinctParamsChange: I,
|
|
51929
|
+
total: aQ,
|
|
51930
|
+
onFieldAgg: uQ,
|
|
51903
51931
|
whetherToSample: s.whetherToSample,
|
|
51904
51932
|
sampleSize: s.sampleSize,
|
|
51905
51933
|
topNumber: s.topNumber,
|
|
@@ -51914,7 +51942,7 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51914
51942
|
className: "flex-1 flex flex-col h-full overflow-hidden relative",
|
|
51915
51943
|
children: [
|
|
51916
51944
|
/* @__PURE__ */ jsx("div", {
|
|
51917
|
-
style: { display:
|
|
51945
|
+
style: { display: G !== "loading" && G !== "downloading" ? "none" : "" },
|
|
51918
51946
|
children: /* @__PURE__ */ jsx("div", {
|
|
51919
51947
|
className: "dscOverlay",
|
|
51920
51948
|
children: /* @__PURE__ */ jsx(LoadingSpinner, {})
|
|
@@ -51923,43 +51951,43 @@ var SidebarMemoized = React.memo(DiscoverSidebar), { filterManager, queryStringM
|
|
|
51923
51951
|
/* @__PURE__ */ jsx(ResultHeader, {
|
|
51924
51952
|
showCollapse: {
|
|
51925
51953
|
sideBar: !0,
|
|
51926
|
-
histogram: !!
|
|
51954
|
+
histogram: !!Z
|
|
51927
51955
|
},
|
|
51928
51956
|
collapseState: b,
|
|
51929
51957
|
setCollapseState: x,
|
|
51930
51958
|
took: w.took || 1,
|
|
51931
|
-
total:
|
|
51932
|
-
timeChartProps:
|
|
51933
|
-
onDownloadQuery:
|
|
51934
|
-
downloading:
|
|
51959
|
+
total: aQ,
|
|
51960
|
+
timeChartProps: Q,
|
|
51961
|
+
onDownloadQuery: fQ,
|
|
51962
|
+
downloading: G === "downloading",
|
|
51935
51963
|
exportMaxSize: g
|
|
51936
51964
|
}),
|
|
51937
|
-
!b.histogram &&
|
|
51965
|
+
!b.histogram && rQ.chartAggConfigs && Z && tQ.length !== 0 && /* @__PURE__ */ jsx("div", {
|
|
51938
51966
|
className: "dscTimechart",
|
|
51939
51967
|
children: /* @__PURE__ */ jsx("div", {
|
|
51940
51968
|
className: "h-100px dscHistogramGrid",
|
|
51941
51969
|
children: /* @__PURE__ */ jsx(DiscoverHistogram, {
|
|
51942
|
-
chartData:
|
|
51970
|
+
chartData: Z,
|
|
51943
51971
|
timefilterUpdateHandler: $Z,
|
|
51944
51972
|
theme: m
|
|
51945
51973
|
})
|
|
51946
51974
|
})
|
|
51947
51975
|
}),
|
|
51948
|
-
|
|
51949
|
-
columns:
|
|
51950
|
-
sortOrder:
|
|
51976
|
+
tQ && tQ.length > 0 ? /* @__PURE__ */ jsx(table_default, {
|
|
51977
|
+
columns: B,
|
|
51978
|
+
sortOrder: A.sort || [],
|
|
51951
51979
|
indexPattern: t,
|
|
51952
51980
|
onFilter: QZ,
|
|
51953
51981
|
onRemoveColumn: JZ,
|
|
51954
51982
|
onMoveColumn: YZ,
|
|
51955
|
-
onAddColumn:
|
|
51983
|
+
onAddColumn: qZ,
|
|
51956
51984
|
onChangeSortOrder: ZZ,
|
|
51957
|
-
document:
|
|
51958
|
-
hits:
|
|
51959
|
-
hitsTotal:
|
|
51960
|
-
queryFrom:
|
|
51985
|
+
document: lQ,
|
|
51986
|
+
hits: tQ,
|
|
51987
|
+
hitsTotal: aQ,
|
|
51988
|
+
queryFrom: R,
|
|
51961
51989
|
setQueryFrom: (e) => {
|
|
51962
|
-
|
|
51990
|
+
J("next"), z(e);
|
|
51963
51991
|
},
|
|
51964
51992
|
theme: m
|
|
51965
51993
|
}) : null
|