@@ -3,14 +3,16 @@ import FilterInput from "@/components/FilterInput.vue";
3
3
import { storeToRefs } from " pinia" ;
4
4
import { FieldNames , useAuditStore } from " @/stores/AuditStore.ts" ;
5
5
import ListFilterSelector from " @/components/audit/ListFilterSelector.vue" ;
6
- import { computed } from " vue" ;
6
+ import { computed , useTemplateRef } from " vue" ;
7
7
import DatePickerRange from " @/components/audit/DatePickerRange.vue" ;
8
+ import { Tippy , TippyComponent } from " vue-tippy" ;
8
9
9
10
const store = useAuditStore ();
10
11
const { sortBy, messageFilterString, selectedEndpointName, endpoints, itemsPerPage, dateRange } = storeToRefs (store );
11
12
const endpointNames = computed (() => {
12
13
return [... new Set (endpoints .value .map ((endpoint ) => endpoint .name ))].sort ();
13
14
});
15
+ const wildcardTooltipRef = useTemplateRef <TippyComponent | null >(" wildcardTooltipRef" );
14
16
const sortByItemsMap = new Map ([
15
17
[" Latest sent" , ` ${FieldNames .TimeSent },desc ` ],
16
18
[" Oldest sent" , ` ${FieldNames .TimeSent },asc ` ],
@@ -51,13 +53,31 @@ function findKeyByValue(searchValue: string) {
51
53
}
52
54
return " " ;
53
55
}
56
+
57
+ function toggleWildcardToolTip(show : boolean ) {
58
+ if (show ) {
59
+ wildcardTooltipRef .value ?.show ();
60
+ } else {
61
+ wildcardTooltipRef .value ?.hide ();
62
+ }
63
+ }
54
64
</script >
55
65
56
66
<template >
57
67
<div class =" filters" >
58
68
<div class =" filter" >
59
69
<div class =" filter-label" ></div >
60
- <div class =" filter-component text-search-container" ><FilterInput v-model =" messageFilterString" placeholder =" Search messages..." aria-label =" Search messages" /></div >
70
+ <div class =" filter-component text-search-container" >
71
+ <Tippy ref =" wildcardTooltipRef" trigger =" click" :hideOnClick =" false" >
72
+ <template #content >
73
+ <h4 >Use <i class =" fa fa-asterisk asterisk" /> to do wildcard searches <i class =" fa fa-lightbulb-o" style =" color : #e6c201 " /></h4 >
74
+ <p >
75
+ Example: <i ><i class =" fa fa-asterisk asterisk" />World!</i > or <i >Hello<i class =" fa fa-asterisk asterisk" /></i >, to look for <i >Hello World!</i >
76
+ </p >
77
+ </template >
78
+ <FilterInput v-model =" messageFilterString" placeholder =" Search messages..." aria-label =" Search messages" @focus =" () => toggleWildcardToolTip(true)" @blur =" () => toggleWildcardToolTip(false)" />
79
+ </Tippy >
80
+ </div >
61
81
</div >
62
82
<div class =" filter" >
63
83
<div class =" filter-label" >Endpoint:</div >
@@ -87,6 +107,10 @@ function findKeyByValue(searchValue: string) {
87
107
</template >
88
108
89
109
<style scoped>
110
+ .asterisk {
111
+ color : #04b9ff ;
112
+ font-size : 1.2rem ;
113
+ }
90
114
.filters {
91
115
background-color : #f3f3f3 ;
92
116
border : #8c8c8c 1px solid ;
0 commit comments