mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-15 09:48:43 +00:00
conditionally render graph based on route fullview
This commit is contained in:
parent
efc4bcd61a
commit
ed3433c01e
@ -21,7 +21,9 @@ limitations under the License. -->
|
|||||||
:is-resizable="dashboardStore.editMode"
|
:is-resizable="dashboardStore.editMode"
|
||||||
v-if="dashboardStore.layout.length"
|
v-if="dashboardStore.layout.length"
|
||||||
>
|
>
|
||||||
|
<FullVue v-if="isFullview" :items="dashboardStore.layout"></FullVue>
|
||||||
<grid-item
|
<grid-item
|
||||||
|
v-else
|
||||||
v-for="item in dashboardStore.layout"
|
v-for="item in dashboardStore.layout"
|
||||||
:x="item.x"
|
:x="item.x"
|
||||||
:y="item.y"
|
:y="item.y"
|
||||||
@ -39,17 +41,23 @@ limitations under the License. -->
|
|||||||
<div class="no-data-tips" v-else>{{ t("noWidget") }}</div>
|
<div class="no-data-tips" v-else>{{ t("noWidget") }}</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, onBeforeUnmount } from "vue";
|
import { defineComponent, computed, onBeforeUnmount } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { LayoutConfig } from "@/types/dashboard";
|
import { LayoutConfig } from "@/types/dashboard";
|
||||||
import controls from "../controls/index";
|
import controls from "../controls/index";
|
||||||
|
import FullVue from "@/components/FullVue.vue";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "Layout",
|
name: "Layout",
|
||||||
components: { ...controls },
|
components: { ...controls, FullVue },
|
||||||
setup() {
|
setup() {
|
||||||
|
const { path } = useRoute();
|
||||||
|
const isFullview = computed(() => {
|
||||||
|
return path.includes("fullview");
|
||||||
|
});
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
@ -69,6 +77,7 @@ export default defineComponent({
|
|||||||
dashboardStore.setConfigPanel(false);
|
dashboardStore.setConfigPanel(false);
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
|
isFullview,
|
||||||
dashboardStore,
|
dashboardStore,
|
||||||
clickGrid,
|
clickGrid,
|
||||||
t,
|
t,
|
||||||
|
Loading…
Reference in New Issue
Block a user