mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-17 04:35:23 +00:00
search endpoints
This commit is contained in:
parent
10fbf33d5d
commit
d53fe5ed73
@ -86,14 +86,14 @@ export const logStore = defineStore({
|
||||
] || [{ value: " 0", label: "All" }];
|
||||
return res.data;
|
||||
},
|
||||
async getEndpoints(id: string) {
|
||||
async getEndpoints(id: string, keyword?: string) {
|
||||
const serviceId = this.selectorStore.currentService
|
||||
? this.selectorStore.currentService.id
|
||||
: id;
|
||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||
serviceId,
|
||||
duration: this.durationTime,
|
||||
keyword: "",
|
||||
keyword: keyword || "",
|
||||
});
|
||||
if (res.data.errors) {
|
||||
return res.data;
|
||||
|
@ -101,14 +101,14 @@ export const traceStore = defineStore({
|
||||
] || [{ value: " 0", label: "All" }];
|
||||
return res.data;
|
||||
},
|
||||
async getEndpoints(id: string) {
|
||||
async getEndpoints(id: string, keyword?: string) {
|
||||
const serviceId = this.selectorStore.currentService
|
||||
? this.selectorStore.currentService.id
|
||||
: id;
|
||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||
serviceId,
|
||||
duration: this.durationTime,
|
||||
keyword: "",
|
||||
keyword: keyword || "",
|
||||
});
|
||||
if (res.data.errors) {
|
||||
return res.data;
|
||||
|
@ -42,7 +42,9 @@ limitations under the License. -->
|
||||
@change="changePods"
|
||||
@query="searchPods"
|
||||
class="selectorPod"
|
||||
:isRemote="true"
|
||||
:isRemote="
|
||||
['EndpointRelation', 'Endpoint'].includes(dashboardStore.entity)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="selectors-item" v-if="states.key === 2 || states.key === 4">
|
||||
@ -62,8 +64,8 @@ limitations under the License. -->
|
||||
dashboardStore.entity === "EndpointRelation"
|
||||
? "$DestinationEndpoint"
|
||||
: "$DestinationServiceInstance"
|
||||
}}</span
|
||||
>
|
||||
}}
|
||||
</span>
|
||||
<Selector
|
||||
v-model="states.currentDestPod"
|
||||
:options="selectorStore.destPods"
|
||||
@ -71,6 +73,8 @@ limitations under the License. -->
|
||||
placeholder="Select a data"
|
||||
@change="changePods"
|
||||
class="selectorPod"
|
||||
@query="searchPods"
|
||||
:isRemote="dashboardStore.entity === 'EndpointRelation'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -46,6 +46,8 @@ limitations under the License. -->
|
||||
:options="logStore.endpoints"
|
||||
placeholder="Select a endpoint"
|
||||
@change="changeField('endpoint', $event)"
|
||||
:isRemote="true"
|
||||
@query="searchEndpoints"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -243,6 +245,12 @@ function changeField(type: string, opt: any) {
|
||||
getInstances(state.service.id);
|
||||
}
|
||||
}
|
||||
async function searchEndpoints(keyword: string) {
|
||||
const resp = await logStore.getEndpoints(state.service.id, keyword);
|
||||
if (resp.errors) {
|
||||
ElMessage.error(resp.errors);
|
||||
}
|
||||
}
|
||||
function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
||||
tagsList.value = data.tagsList;
|
||||
tagsMap.value = data.tagsMap;
|
||||
|
@ -41,7 +41,9 @@ limitations under the License. -->
|
||||
:value="state.endpoint.value"
|
||||
:options="traceStore.endpoints"
|
||||
placeholder="Select a endpoint"
|
||||
:isRemote="true"
|
||||
@change="changeField('endpoint', $event)"
|
||||
@query="searchEndpoints"
|
||||
/>
|
||||
</div>
|
||||
<div class="mr-5">
|
||||
@ -149,8 +151,8 @@ async function getServices() {
|
||||
getInstances(state.service.id);
|
||||
}
|
||||
|
||||
async function getEndpoints(id?: string) {
|
||||
const resp = await traceStore.getEndpoints(id);
|
||||
async function getEndpoints(id?: string, keyword?: string) {
|
||||
const resp = await traceStore.getEndpoints(id, keyword);
|
||||
if (resp.errors) {
|
||||
ElMessage.error(resp.errors);
|
||||
return;
|
||||
@ -208,6 +210,12 @@ function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
||||
tagsList.value = data.tagsList;
|
||||
tagsMap.value = data.tagsMap;
|
||||
}
|
||||
async function searchEndpoints(keyword: string) {
|
||||
const resp = await traceStore.getEndpoints(state.service.id, keyword);
|
||||
if (resp.errors) {
|
||||
ElMessage.error(resp.errors);
|
||||
}
|
||||
}
|
||||
watch(
|
||||
() => [selectorStore.currentPod],
|
||||
() => {
|
||||
|
Loading…
Reference in New Issue
Block a user