mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 16:27:33 +00:00
enhance tags
This commit is contained in:
parent
64628ecf6a
commit
fc38dd69a3
@ -35,9 +35,10 @@ limitations under the License. -->
|
||||
size="small"
|
||||
v-model="tags"
|
||||
class="trace-new-tag"
|
||||
@input="searchTags"
|
||||
@input="inputTags"
|
||||
@blur="visible = false"
|
||||
@focus="visible = true"
|
||||
@change="addTags"
|
||||
/>
|
||||
</template>
|
||||
<div class="content">
|
||||
@ -159,13 +160,37 @@ async function fetchTagValues() {
|
||||
searchTags();
|
||||
}
|
||||
|
||||
function inputTags() {
|
||||
if (!tags.value) {
|
||||
tagArr.value = keysList.value;
|
||||
tagKeys.value = keysList.value;
|
||||
tagList.value = tagArr.value;
|
||||
return;
|
||||
}
|
||||
let search = "";
|
||||
if (tags.value.includes("=")) {
|
||||
search = tags.value.split("=")[1];
|
||||
fetchTagValues();
|
||||
} else {
|
||||
search = tags.value;
|
||||
}
|
||||
tagList.value = tagArr.value.filter((d: string) => d.includes(search));
|
||||
}
|
||||
|
||||
function addTags() {
|
||||
if (!tags.value.includes("=")) {
|
||||
return;
|
||||
}
|
||||
addLabels();
|
||||
tagArr.value = tagKeys.value;
|
||||
searchTags();
|
||||
}
|
||||
|
||||
function selectTag(item: string) {
|
||||
if (tags.value.includes("=")) {
|
||||
const key = tags.value.split("=")[0];
|
||||
tags.value = key + "=" + item;
|
||||
addLabels();
|
||||
tagArr.value = tagKeys.value;
|
||||
searchTags();
|
||||
addTags();
|
||||
return;
|
||||
}
|
||||
tags.value = item + "=";
|
||||
@ -173,12 +198,6 @@ function selectTag(item: string) {
|
||||
}
|
||||
|
||||
function searchTags() {
|
||||
if (!tags.value) {
|
||||
tagArr.value = keysList.value;
|
||||
tagKeys.value = keysList.value;
|
||||
tagList.value = tagArr.value;
|
||||
return;
|
||||
}
|
||||
let search = "";
|
||||
if (tags.value.includes("=")) {
|
||||
search = tags.value.split("=")[1];
|
||||
|
Loading…
Reference in New Issue
Block a user