mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-03 01:25:23 +00:00
refactored logs header search terms logic and the handling of active buttons
This commit is contained in:
parent
aa7485391b
commit
59a9bc15ea
@ -108,12 +108,13 @@ limitations under the License. -->
|
|||||||
<el-input v-model="traceId" class="inputs-max" size="small" />
|
<el-input v-model="traceId" class="inputs-max" size="small" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<keep-alive>
|
||||||
<ConditionTags
|
<ConditionTags
|
||||||
v-if="currentSearchTerm === 'tags'"
|
v-if="currentSearchTerm === 'tags'"
|
||||||
:type="'LOG'"
|
:type="'LOG'"
|
||||||
@update="updateTags"
|
@update="updateTags"
|
||||||
/>
|
/>
|
||||||
|
</keep-alive>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-h items-center" v-show="!isBrowser">
|
<div class="flex-h items-center" v-show="!isBrowser">
|
||||||
@ -348,8 +349,37 @@ function removeFromActiveTerms() {
|
|||||||
(term) => term !== currentSearchTerm.value
|
(term) => term !== currentSearchTerm.value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
function searchLogs() {
|
function handleActiveSearchTerms() {
|
||||||
|
switch (currentSearchTerm.value) {
|
||||||
|
case "traceId":
|
||||||
|
if (!traceId.value.length) return;
|
||||||
addToActiveTerms();
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "tags":
|
||||||
|
if (!tagsList.value.length) return;
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "keywords":
|
||||||
|
if (!keywordsOfContent.value.length) return;
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "exclude":
|
||||||
|
if (!excludingKeywordsOfContent.value.length) return;
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "instance":
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "service":
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
case "endpoint":
|
||||||
|
addToActiveTerms();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function searchLogs() {
|
||||||
|
handleActiveSearchTerms();
|
||||||
currentSearchTerm.value = "";
|
currentSearchTerm.value = "";
|
||||||
let endpoint = "",
|
let endpoint = "",
|
||||||
instance = "";
|
instance = "";
|
||||||
@ -434,9 +464,7 @@ function removeExcludeContent(index: number) {
|
|||||||
excludingContentStr.value = "";
|
excludingContentStr.value = "";
|
||||||
}
|
}
|
||||||
function setSearchTerm(term: string) {
|
function setSearchTerm(term: string) {
|
||||||
// if (!term) return;
|
|
||||||
currentSearchTerm.value = term;
|
currentSearchTerm.value = term;
|
||||||
console.log(currentSearchTerm.value);
|
|
||||||
}
|
}
|
||||||
function cancelSearchTerm() {
|
function cancelSearchTerm() {
|
||||||
switch (currentSearchTerm.value) {
|
switch (currentSearchTerm.value) {
|
||||||
@ -465,7 +493,7 @@ function cancelSearchTerm() {
|
|||||||
}
|
}
|
||||||
removeFromActiveTerms();
|
removeFromActiveTerms();
|
||||||
currentSearchTerm.value = "";
|
currentSearchTerm.value = "";
|
||||||
init()
|
init();
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => selectorStore.currentService,
|
() => selectorStore.currentService,
|
||||||
|
Loading…
Reference in New Issue
Block a user