This commit is contained in:
Qiuxia Fan 2022-03-23 20:34:32 +08:00
parent 33365f2a14
commit 3b348cff65
2 changed files with 12 additions and 3 deletions

View File

@ -42,7 +42,7 @@ limitations under the License. -->
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="Service Instances"> <el-table-column label="Attributes">
<template #default="scope"> <template #default="scope">
<div class="attributes" v-if="scope.row.attributes.length"> <div class="attributes" v-if="scope.row.attributes.length">
<div <div
@ -186,6 +186,10 @@ function clickInstance(scope: any) {
layer: dashboardStore.layerId, layer: dashboardStore.layerId,
entity: EntityType[3].value, entity: EntityType[3].value,
}); });
if (!d) {
ElMessage.error("No this dashboard");
return;
}
router.push( router.push(
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${ `/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${
scope.row.id scope.row.id

View File

@ -127,6 +127,7 @@ const params = useRoute().params;
const toolIcons = ref<{ name: string; content: string; id: string }[]>( const toolIcons = ref<{ name: string; content: string; id: string }[]>(
EndpointRelationTools EndpointRelationTools
); );
const limit = ref<number>(10);
const loading = ref<boolean>(false); const loading = ref<boolean>(false);
const states = reactive<{ const states = reactive<{
destService: string; destService: string;
@ -401,7 +402,7 @@ async function fetchPods(type: string, serviceId: string, setPod: boolean) {
let resp; let resp;
switch (type) { switch (type) {
case EntityType[2].value: case EntityType[2].value:
resp = await selectorStore.getEndpoints({ serviceId }); resp = await selectorStore.getEndpoints({ serviceId, limit });
if (setPod) { if (setPod) {
selectorStore.setCurrentPod( selectorStore.setCurrentPod(
selectorStore.pods.length ? selectorStore.pods[0] : null selectorStore.pods.length ? selectorStore.pods[0] : null
@ -419,7 +420,11 @@ async function fetchPods(type: string, serviceId: string, setPod: boolean) {
} }
break; break;
case EntityType[6].value: case EntityType[6].value:
resp = await selectorStore.getEndpoints({ serviceId, isRelation: true }); resp = await selectorStore.getEndpoints({
serviceId,
isRelation: true,
limit,
});
if (setPod) { if (setPod) {
selectorStore.setCurrentDestPod( selectorStore.setCurrentDestPod(
selectorStore.destPods.length ? selectorStore.destPods[0] : null selectorStore.destPods.length ? selectorStore.destPods[0] : null