@@ -190,7 +190,7 @@ function normalizeParsedDate(parsed?: chrono.ParsedComponents): Date | null {
190190 return parsedDate ;
191191}
192192
193- export function parseTimeRangeInput (
193+ function parseTimeRangeInput (
194194 str : string ,
195195 isUTC : boolean = false ,
196196) : [ Date | null , Date | null ] {
@@ -216,70 +216,14 @@ export function parseTimeRangeInput(
216216 }
217217}
218218
219- export const LIVE_TAIL_TIME_QUERY = 'Live Tail' ;
220-
221- export const RELATIVE_TIME_OPTIONS : ( [ string , string ] | 'divider' ) [ ] = [
222- // ['Last 15 seconds', '15s'],
223- // ['Last 30 seconds', '30s'],
224- // 'divider',
225- [ 'Last 1 minute' , '1m' ] ,
226- [ 'Last 5 minutes' , '5m' ] ,
227- [ 'Last 15 minutes' , '15m' ] ,
228- [ 'Last 30 minutes' , '30m' ] ,
229- [ 'Last 45 minutes' , '45m' ] ,
230- 'divider' ,
231- [ 'Last 1 hour' , '1h' ] ,
232- [ 'Last 3 hours' , '3h' ] ,
233- [ 'Last 6 hours' , '6h' ] ,
234- [ 'Last 12 hours' , '12h' ] ,
235- 'divider' ,
236- [ 'Last 1 days' , '1d' ] ,
237- [ 'Last 2 days' , '2d' ] ,
238- [ 'Last 7 days' , '7d' ] ,
239- [ 'Last 14 days' , '14d' ] ,
240- [ 'Last 30 days' , '30d' ] ,
241- ] ;
242-
243- export const DURATION_OPTIONS = [
244- '30s' ,
245- '1m' ,
246- '5m' ,
247- '15m' ,
248- '30m' ,
249- '1h' ,
250- '3h' ,
251- '6h' ,
252- '12h' ,
253- ] ;
254-
255- export const DURATIONS : Record < string , any > = {
256- '30s' : { seconds : 30 } ,
257- '1m' : { minutes : 1 } ,
258- '5m' : { minutes : 5 } ,
259- '15m' : { minutes : 15 } ,
260- '30m' : { minutes : 30 } ,
261- '1h' : { hours : 1 } ,
262- '3h' : { hours : 3 } ,
263- '6h' : { hours : 6 } ,
264- '12h' : { hours : 12 } ,
265- } ;
266-
267- export const dateParser = ( input ?: string ) => {
268- if ( ! input ) {
269- return null ;
270- }
271- const parsed = chrono . casual . parse ( input ) [ 0 ] ;
272- return normalizeParsedDate ( parsed ?. start ) ;
273- } ;
274-
275219// TODO: Dedup from DBSearchPageFilters
276220function isFieldPrimary ( tableMetadata : TableMetadata | undefined , key : string ) {
277221 return tableMetadata ?. primary_key ?. includes ( key ) ;
278222}
279223
280224// TODO: Dedup w/ app/src/utils.ts
281225// Date formatting
282- export const mergePath = ( path : string [ ] , jsonColumns : string [ ] = [ ] ) => {
226+ const mergePath = ( path : string [ ] , jsonColumns : string [ ] = [ ] ) => {
283227 const [ key , ...rest ] = path ;
284228 if ( rest . length === 0 ) {
285229 return key ;
0 commit comments