mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 14:44:10 +00:00
watch selector for widgets
This commit is contained in:
parent
e72aa2f99b
commit
9b5913177a
@ -165,11 +165,7 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => [
|
||||
selectorStore.currentService,
|
||||
selectorStore.currentDestService,
|
||||
appStore.durationTime,
|
||||
],
|
||||
() => [selectorStore.currentService, selectorStore.currentDestService],
|
||||
() => {
|
||||
if (
|
||||
dashboardStore.entity === EntityType[0].value ||
|
||||
|
@ -64,7 +64,7 @@ limitations under the License. -->
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { PropType } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, reactive } from "vue";
|
||||
import { ref, onMounted, onBeforeUnmount, reactive, watch } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import * as d3 from "d3";
|
||||
import d3tip from "d3-tip";
|
||||
@ -95,8 +95,8 @@ const { t } = useI18n();
|
||||
const selectorStore = useSelectorStore();
|
||||
const topologyStore = useTopologyStore();
|
||||
const dashboardStore = useDashboardStore();
|
||||
const height = ref<number>(0);
|
||||
const width = ref<number>(0);
|
||||
const height = ref<number>(100);
|
||||
const width = ref<number>(100);
|
||||
const loading = ref<boolean>(false);
|
||||
const simulation = ref<any>(null);
|
||||
const svg = ref<Nullable<any>>(null);
|
||||
@ -120,7 +120,6 @@ const items = ref<
|
||||
const depth = ref<number>(props.config.graph.depth || 2);
|
||||
|
||||
onMounted(async () => {
|
||||
console.log(props.config.graph);
|
||||
loading.value = true;
|
||||
const resp = await getTopology();
|
||||
loading.value = false;
|
||||
@ -473,6 +472,12 @@ async function changeDepth(opt: Option[] | any) {
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener("resize", resize);
|
||||
});
|
||||
watch(
|
||||
() => [selectorStore.currentService, selectorStore.currentDestService],
|
||||
() => {
|
||||
freshNodes();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.topo-svg {
|
||||
|
@ -71,6 +71,7 @@ limitations under the License. -->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { watch } from "vue";
|
||||
import type { PropType } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
@ -96,8 +97,8 @@ const dashboardStore = useDashboardStore();
|
||||
const selectorStore = useSelectorStore();
|
||||
const topologyStore = useTopologyStore();
|
||||
const loading = ref<boolean>(false);
|
||||
const height = ref<number>(0);
|
||||
const width = ref<number>(0);
|
||||
const height = ref<number>(100);
|
||||
const width = ref<number>(100);
|
||||
const showSettings = ref<boolean>(false);
|
||||
const settings = ref<any>({});
|
||||
const operationsPos = reactive<{ x: number; y: number }>({ x: NaN, y: NaN });
|
||||
@ -215,11 +216,19 @@ function handleClick(event: any) {
|
||||
topologyStore.setLink(null);
|
||||
}
|
||||
}
|
||||
watch(
|
||||
() => [selectorStore.currentPod],
|
||||
() => {
|
||||
loadTopology(selectorStore.currentPod.id);
|
||||
topologyStore.setNode(null);
|
||||
topologyStore.setLink(null);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.sankey {
|
||||
margin-top: 10px;
|
||||
background-color: #333840;
|
||||
background-color: #333840 !important;
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,16 @@ function updateTags(data: { tagsMap: Array<Option>; tagsList: string[] }) {
|
||||
tagsMap.value = data.tagsMap;
|
||||
}
|
||||
watch(
|
||||
() => selectorStore.currentService,
|
||||
() => [selectorStore.currentPod],
|
||||
() => {
|
||||
if (dashboardStore.entity === EntityType[0].value) {
|
||||
return;
|
||||
}
|
||||
init();
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => [selectorStore.currentService],
|
||||
() => {
|
||||
if (dashboardStore.entity !== EntityType[0].value) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user