mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-15 01:33:54 +00:00
implemeted functionlaity to empty taglist internally on cancel
This commit is contained in:
parent
4645d000d4
commit
91a0c2979b
@ -16,10 +16,7 @@ limitations under the License. -->
|
|||||||
<div class="flex-h" :class="{ light: theme === 'light' }">
|
<div class="flex-h" :class="{ light: theme === 'light' }">
|
||||||
<div class="flex-h items-center mr-5">
|
<div class="flex-h items-center mr-5">
|
||||||
<span class="sm grey" v-show="theme === 'dark'">{{ t("tags") }}: </span>
|
<span class="sm grey" v-show="theme === 'dark'">{{ t("tags") }}: </span>
|
||||||
<span
|
<span v-if="tagsList.length" class="trace-tags">
|
||||||
v-if="tagsList.length"
|
|
||||||
class="trace-tags"
|
|
||||||
>
|
|
||||||
<!-- :style="type === 'LOG' ? `min-width: 122px;` : ''" -->
|
<!-- :style="type === 'LOG' ? `min-width: 122px;` : ''" -->
|
||||||
<span class="selected" v-for="(item, index) in tagsList" :key="index">
|
<span class="selected" v-for="(item, index) in tagsList" :key="index">
|
||||||
<span>{{ item }}</span>
|
<span>{{ item }}</span>
|
||||||
@ -62,11 +59,12 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref, defineExpose } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
|
||||||
/*global defineEmits, defineProps */
|
/*global defineEmits, defineProps */
|
||||||
const emit = defineEmits(["update"]);
|
const emit = defineEmits(["update"]);
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
type: { type: String, default: "TRACE" },
|
type: { type: String, default: "TRACE" },
|
||||||
});
|
});
|
||||||
@ -75,6 +73,13 @@ const theme = ref<string>("dark");
|
|||||||
const tags = ref<string>("");
|
const tags = ref<string>("");
|
||||||
const tagsList = ref<string[]>([]);
|
const tagsList = ref<string[]>([]);
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
tagsList,
|
||||||
|
emptyTags
|
||||||
|
})
|
||||||
|
function emptyTags (){
|
||||||
|
tagsList.value = []
|
||||||
|
}
|
||||||
function removeTags(index: number) {
|
function removeTags(index: number) {
|
||||||
tagsList.value.splice(index, 1);
|
tagsList.value.splice(index, 1);
|
||||||
updateTags();
|
updateTags();
|
||||||
@ -99,7 +104,7 @@ function updateTags() {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.items-center{
|
.items-center {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.trace-tags {
|
.trace-tags {
|
||||||
|
@ -61,7 +61,13 @@ limitations under the License. -->
|
|||||||
@change="changeField('instance', $event)"
|
@change="changeField('instance', $event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter" v-if="dashboardStore.entity !== EntityType[2].value && activeFilter === 'endpoints'">
|
<div
|
||||||
|
class="filter"
|
||||||
|
v-if="
|
||||||
|
dashboardStore.entity !== EntityType[2].value &&
|
||||||
|
activeFilter === 'endpoints'
|
||||||
|
"
|
||||||
|
>
|
||||||
<span class="grey mr-5">{{ t("endpoint") }}:</span>
|
<span class="grey mr-5">{{ t("endpoint") }}:</span>
|
||||||
<Selector
|
<Selector
|
||||||
size="small"
|
size="small"
|
||||||
@ -97,6 +103,7 @@ limitations under the License. -->
|
|||||||
<keep-alive>
|
<keep-alive>
|
||||||
<ConditionTags
|
<ConditionTags
|
||||||
v-if="activeFilter === 'tags'"
|
v-if="activeFilter === 'tags'"
|
||||||
|
ref="tagComponent"
|
||||||
:type="'TRACE'"
|
:type="'TRACE'"
|
||||||
@update="updateTags"
|
@update="updateTags"
|
||||||
/>
|
/>
|
||||||
@ -202,6 +209,8 @@ const state = reactive<any>({
|
|||||||
service: { value: "", label: "" },
|
service: { value: "", label: "" },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const tagComponent = ref<InstanceType<typeof ConditionTags> | null>(null)
|
||||||
|
|
||||||
// const dateTime = computed(() => [
|
// const dateTime = computed(() => [
|
||||||
// appStore.durationRow.start,
|
// appStore.durationRow.start,
|
||||||
// appStore.durationRow.end,
|
// appStore.durationRow.end,
|
||||||
@ -272,6 +281,8 @@ function cancelSearch() {
|
|||||||
case "tags":
|
case "tags":
|
||||||
tagsList.value = [];
|
tagsList.value = [];
|
||||||
tagsMap.value = [];
|
tagsMap.value = [];
|
||||||
|
updateTags({ tagsMap: [], tagsList: [] });
|
||||||
|
tagComponent.value?.emptyTags()
|
||||||
break;
|
break;
|
||||||
case "traceId":
|
case "traceId":
|
||||||
traceId.value = "";
|
traceId.value = "";
|
||||||
@ -353,6 +364,7 @@ function changeField(type: string, opt: any) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
||||||
|
console.log(data, tagComponent.value)
|
||||||
tagsList.value = data.tagsList;
|
tagsList.value = data.tagsList;
|
||||||
tagsMap.value = data.tagsMap;
|
tagsMap.value = data.tagsMap;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user