fix entity

This commit is contained in:
Qiuxia Fan 2022-03-21 21:12:56 +08:00
parent f1e405fbb4
commit bc57e2e368
8 changed files with 21 additions and 12 deletions

View File

@ -35,7 +35,7 @@ limitations under the License. -->
<template #default="scope"> <template #default="scope">
<span <span
class="link" class="link"
@click="clickEndpoint" @click="clickEndpoint(scope)"
:style="{ fontSize: `${config.fontSize}px` }" :style="{ fontSize: `${config.fontSize}px` }"
> >
{{ scope.row.label }} {{ scope.row.label }}

View File

@ -35,7 +35,7 @@ limitations under the License. -->
<template #default="scope"> <template #default="scope">
<span <span
class="link" class="link"
@click="clickInstance" @click="clickInstance(scope)"
:style="{ fontSize: `${config.fontSize}px` }" :style="{ fontSize: `${config.fontSize}px` }"
> >
{{ scope.row.label }} {{ scope.row.label }}

View File

@ -13,12 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<PodTopology :config="config" v-if="isSankey" /> <Graph :config="config" v-if="isService" />
<Graph :config="config" v-else /> <PodTopology :config="config" v-else />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { PropType } from "vue"; import type { PropType } from "vue";
import { ref } from "vue";
import Graph from "./components/Graph.vue"; import Graph from "./components/Graph.vue";
import PodTopology from "./components/PodTopology.vue"; import PodTopology from "./components/PodTopology.vue";
import { EntityType } from "../../data"; import { EntityType } from "../../data";
@ -32,7 +31,7 @@ defineProps({
}, },
}); });
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const isSankey = ref<boolean>( const isService = [EntityType[0].value, EntityType[1].value].includes(
[EntityType[2].value, EntityType[3].value].includes(dashboardStore.entity) dashboardStore.entity
); );
</script> </script>

View File

@ -34,7 +34,12 @@ limitations under the License. -->
@change="changeDepth" @change="changeDepth"
/> />
</span> </span>
<span class="switch-icon ml-5" title="Settings" @click="setConfig"> <span
class="switch-icon ml-5"
title="Settings"
@click="setConfig"
v-if="dashboardStore.editMode"
>
<Icon size="middle" iconName="settings" /> <Icon size="middle" iconName="settings" />
</span> </span>
<span <span

View File

@ -28,7 +28,12 @@ limitations under the License. -->
@change="changeDepth" @change="changeDepth"
/> />
</span> </span>
<span class="switch-icon ml-5" title="Settings" @click="setConfig"> <span
class="switch-icon ml-5"
title="Settings"
@click="setConfig"
v-if="dashboardStore.editMode"
>
<Icon size="middle" iconName="settings" /> <Icon size="middle" iconName="settings" />
</span> </span>
<span <span
@ -221,7 +226,7 @@ async function getTopology(id: string) {
Number(depth.value) Number(depth.value)
); );
break; break;
case EntityType[3].value: case EntityType[4].value:
resp = await topologyStore.getInstanceTopology(); resp = await topologyStore.getInstanceTopology();
break; break;
} }

View File

@ -26,6 +26,7 @@ const emit = defineEmits(["click"]);
const topologyStore = useTopologyStore(); const topologyStore = useTopologyStore();
const option = computed(() => getOption()); const option = computed(() => getOption());
console.log(topologyStore.nodes);
function getOption() { function getOption() {
return { return {
tooltip: { tooltip: {

View File

@ -225,7 +225,6 @@ const states = reactive<{
linkDashboards: [], linkDashboards: [],
nodeDashboards: [], nodeDashboards: [],
}); });
console.log(dashboardStore.selectedGrid);
const isService = [EntityType[0].value, EntityType[1].value].includes( const isService = [EntityType[0].value, EntityType[1].value].includes(
dashboardStore.entity dashboardStore.entity
); );