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 = () => {
592592 </div >
593593 <div class =" right" >
594594 <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 >
595598 </div >
596599 <div class =" end" >
597600 <TopBar />
Original file line number Diff line number Diff line change 5656 -ms-box-sizing : border-box ;
5757 box-sizing : border-box ;
5858 }
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+ }
5972 }
6073
6174 .end {
Original file line number Diff line number Diff line change @@ -252,7 +252,21 @@ export const useMainStore = defineStore("main", () => {
252252 }
253253 }
254254
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+
255264 const displayRows = computed ( ( ) => {
265+
266+ if ( searchbarValid . value . length > 0 ) {
267+ return [ ]
268+ }
269+
256270 const selectedFacets : Record < string , string [ ] > = { }
257271 for ( let i in facets . value ) {
258272 facets . value [ i ] . items . forEach ( el => {
@@ -312,7 +326,6 @@ export const useMainStore = defineStore("main", () => {
312326 if ( searchbar . value . length < 3 ) {
313327 return true
314328 }
315-
316329 return ( r . msg . content || "" ) . search ( new RegExp ( searchbar . value , 'i' ) ) >= 0
317330 } )
318331 } )
@@ -365,6 +378,7 @@ export const useMainStore = defineStore("main", () => {
365378
366379 facets,
367380 searchbar,
381+ searchbarValid,
368382
369383 toggleRowMark
370384 } ;
Original file line number Diff line number Diff line change @@ -4,6 +4,5 @@ export function formatThousands(x: number): string {
44
55export function getUrlParam ( url : string , param : string ) : string | null {
66 let params = new URLSearchParams ( url )
7- console . log ( params , url )
87 return params . get ( param )
98}
You can’t perform that action at this time.
0 commit comments