1
1
<script lang="ts">
2
2
import " bulma/css/bulma.css" ;
3
3
4
- import { defineComponent , onMounted , ref , watchEffect } from " vue" ;
4
+ import { defineComponent , onMounted , ref , watch } from " vue" ;
5
5
6
6
import { Scanners } from " ../scanner" ;
7
7
import type { SearchableType } from " ../schemas" ;
@@ -32,6 +32,8 @@ export default defineComponent({
32
32
const searchableType = ref <SearchableType | undefined >(undefined );
33
33
const scannableType = ref <ScannableType | undefined >(undefined );
34
34
35
+ const synchedAt = ref <string >();
36
+
35
37
onMounted (async () => {
36
38
const options = await getOptions ();
37
39
@@ -109,24 +111,36 @@ export default defineComponent({
109
111
return true ;
110
112
};
111
113
112
- watchEffect (async () => {
113
- if (! isInitialized .value ) {
114
- // do nothing if it is not initialized
115
- return ;
116
- }
117
- await setOptions ({
118
- debug: debug .value ,
119
- strict: strict .value ,
120
- punycode: punycode .value ,
121
- refang: refang .value ,
122
- href: href .value ,
123
- disabledSearcherNames: disabledSearcherNames .value .map ((n ) => n ),
124
- disabledScannerNames: disabledScannerNames .value .map ((n ) => n ),
125
- hybridAnalysisAPIKey: hybridAnalysisAPIKey .value ,
126
- urlscanAPIKey: urlscanAPIKey .value ,
127
- virusTotalAPIKey: virusTotalAPIKey .value ,
128
- });
129
- });
114
+ watch (
115
+ [
116
+ debug ,
117
+ strict ,
118
+ punycode ,
119
+ refang ,
120
+ href ,
121
+ disabledScannerNames ,
122
+ disabledSearcherNames ,
123
+ hybridAnalysisAPIKey ,
124
+ urlscanAPIKey ,
125
+ virusTotalAPIKey ,
126
+ ],
127
+ async () => {
128
+ await setOptions ({
129
+ debug: debug .value ,
130
+ strict: strict .value ,
131
+ punycode: punycode .value ,
132
+ refang: refang .value ,
133
+ href: href .value ,
134
+ disabledSearcherNames: disabledSearcherNames .value .map ((n ) => n ),
135
+ disabledScannerNames: disabledScannerNames .value .map ((n ) => n ),
136
+ hybridAnalysisAPIKey: hybridAnalysisAPIKey .value ,
137
+ urlscanAPIKey: urlscanAPIKey .value ,
138
+ virusTotalAPIKey: virusTotalAPIKey .value ,
139
+ });
140
+
141
+ synchedAt .value = new Date ().toISOString ();
142
+ },
143
+ );
130
144
131
145
return {
132
146
debug ,
@@ -153,6 +167,7 @@ export default defineComponent({
153
167
isSelectedSearcher ,
154
168
selectScannableType ,
155
169
selectSearchableType ,
170
+ synchedAt ,
156
171
};
157
172
},
158
173
});
@@ -166,11 +181,16 @@ export default defineComponent({
166
181
<span class =" navbar-item title" >Mitaka</span >
167
182
</div >
168
183
<div class =" navbar-menu" >
169
- <div class =" navbar-end " >
184
+ <div class =" navbar-start " >
170
185
<a class =" navbar-item" href =" #general" > General </a >
171
186
<a class =" navbar-item" href =" #scanners" > Scanners </a >
172
187
<a class =" navbar-item" href =" #searchers" > Searchers </a >
173
188
</div >
189
+ <div class =" navbar-end" >
190
+ <span class =" navbar-item help" v-if =" synchedAt" >
191
+ (Synced at: {{ synchedAt }})
192
+ </span >
193
+ </div >
174
194
</div >
175
195
</nav >
176
196
<div class =" columns mt-4 is-centered" v-if =" isInitialized" >
0 commit comments