File tree Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Expand file tree Collapse file tree 4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -592,6 +592,9 @@ const updateSampleLine = () => {
592
592
</div >
593
593
<div class =" right" >
594
594
<input type =" text" class =" searchbar" v-model =" store.searchbar" placeholder =" Search logs..." />
595
+ <br />
596
+ <span class =" search-error" v-if =" store.searchbarValid.length > 0" >Invalid search query: {{ store.searchbarValid
597
+ }}</span >
595
598
</div >
596
599
<div class =" end" >
597
600
<TopBar />
Original file line number Diff line number Diff line change 56
56
-ms-box-sizing : border-box ;
57
57
box-sizing : border-box ;
58
58
}
59
+
60
+ .search-error {
61
+ font-family : ' Roboto mono' , sans-serif ;
62
+ font-size : 12px ;
63
+ padding : 5px ;
64
+ background : var (--hl-bg );
65
+ margin-left :10px ;
66
+ -webkit-box-sizing : border-box ;
67
+ -moz-box-sizing : border-box ;
68
+ -o-box-sizing : border-box ;
69
+ -ms-box-sizing : border-box ;
70
+ box-sizing : border-box ;
71
+ }
59
72
}
60
73
61
74
.end {
Original file line number Diff line number Diff line change @@ -252,7 +252,21 @@ export const useMainStore = defineStore("main", () => {
252
252
}
253
253
}
254
254
255
+ const searchbarValid = computed ( ( ) => {
256
+ try {
257
+ new RegExp ( searchbar . value , 'i' )
258
+ return ''
259
+ } catch ( e ) {
260
+ return ( e as any ) . message
261
+ }
262
+ } )
263
+
255
264
const displayRows = computed ( ( ) => {
265
+
266
+ if ( searchbarValid . value . length > 0 ) {
267
+ return [ ]
268
+ }
269
+
256
270
const selectedFacets : Record < string , string [ ] > = { }
257
271
for ( let i in facets . value ) {
258
272
facets . value [ i ] . items . forEach ( el => {
@@ -312,7 +326,6 @@ export const useMainStore = defineStore("main", () => {
312
326
if ( searchbar . value . length < 3 ) {
313
327
return true
314
328
}
315
-
316
329
return ( r . msg . content || "" ) . search ( new RegExp ( searchbar . value , 'i' ) ) >= 0
317
330
} )
318
331
} )
@@ -365,6 +378,7 @@ export const useMainStore = defineStore("main", () => {
365
378
366
379
facets,
367
380
searchbar,
381
+ searchbarValid,
368
382
369
383
toggleRowMark
370
384
} ;
Original file line number Diff line number Diff line change @@ -4,6 +4,5 @@ export function formatThousands(x: number): string {
4
4
5
5
export function getUrlParam ( url : string , param : string ) : string | null {
6
6
let params = new URLSearchParams ( url )
7
- console . log ( params , url )
8
7
return params . get ( param )
9
8
}
You can’t perform that action at this time.
0 commit comments