mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-14 09:00:50 +00:00
copy tab link
This commit is contained in:
parent
f9aa6600a7
commit
a7bcbcd979
@ -61,8 +61,17 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
),
|
),
|
||||||
name: "Create",
|
name: "Create",
|
||||||
meta: {
|
meta: {
|
||||||
title: "dashboardEdit",
|
notShow: true,
|
||||||
exact: false,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dashboard/:layerId/:entity/:name/:activeTabIndex",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "dashboards" */ "@/views/dashboard/Edit.vue"
|
||||||
|
),
|
||||||
|
name: "CreateaAtiveTabIndex",
|
||||||
|
meta: {
|
||||||
notShow: true,
|
notShow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -74,8 +83,17 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
),
|
),
|
||||||
name: "View",
|
name: "View",
|
||||||
meta: {
|
meta: {
|
||||||
title: "dashboardEdit",
|
notShow: true,
|
||||||
exact: false,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dashboard/:layerId/:entity/:serviceId/:name/:activeTabIndex",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "dashboards" */ "@/views/dashboard/Edit.vue"
|
||||||
|
),
|
||||||
|
name: "ViewActiveTabIndex",
|
||||||
|
meta: {
|
||||||
notShow: true,
|
notShow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -87,8 +105,17 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
),
|
),
|
||||||
name: "ViewServiceRelation",
|
name: "ViewServiceRelation",
|
||||||
meta: {
|
meta: {
|
||||||
title: "dashboardEdit",
|
notShow: true,
|
||||||
exact: false,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dashboard/related/:layerId/:entity/:serviceId/:destServiceId/:name/:activeTabIndex",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "dashboards" */ "@/views/dashboard/Edit.vue"
|
||||||
|
),
|
||||||
|
name: "ViewServiceRelationActiveTabIndex",
|
||||||
|
meta: {
|
||||||
notShow: true,
|
notShow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -100,8 +127,17 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
),
|
),
|
||||||
name: "ViewPod",
|
name: "ViewPod",
|
||||||
meta: {
|
meta: {
|
||||||
title: "dashboardEdit",
|
notShow: true,
|
||||||
exact: false,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dashboard/:layerId/:entity/:serviceId/:podId/:name/:activeTabIndex",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "dashboards" */ "@/views/dashboard/Edit.vue"
|
||||||
|
),
|
||||||
|
name: "ViewPodActiveTabIndex",
|
||||||
|
meta: {
|
||||||
notShow: true,
|
notShow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -113,8 +149,17 @@ export const routesDashboard: Array<RouteRecordRaw> = [
|
|||||||
),
|
),
|
||||||
name: "ViewPodRelation",
|
name: "ViewPodRelation",
|
||||||
meta: {
|
meta: {
|
||||||
title: "dashboardEdit",
|
notShow: true,
|
||||||
exact: true,
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/dashboard/:layerId/:entity/:serviceId/:podId/:destServiceId/:destPodId/:name/:activeTabIndex",
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "dashboards" */ "@/views/dashboard/Edit.vue"
|
||||||
|
),
|
||||||
|
name: "ViewPodRelationActiveTabIndex",
|
||||||
|
meta: {
|
||||||
notShow: true,
|
notShow: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -55,6 +55,9 @@ limitations under the License. -->
|
|||||||
<el-dropdown-item @click="canEditTabName = true">
|
<el-dropdown-item @click="canEditTabName = true">
|
||||||
<span class="edit-tab">{{ t("editTab") }}</span>
|
<span class="edit-tab">{{ t("editTab") }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="copyLink">
|
||||||
|
<span class="edit-tab">Copy Link</span>
|
||||||
|
</el-dropdown-item>
|
||||||
<el-dropdown-item @click="removeTab">
|
<el-dropdown-item @click="removeTab">
|
||||||
<span>{{ t("delete") }}</span>
|
<span>{{ t("delete") }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
@ -99,6 +102,7 @@ limitations under the License. -->
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ref, watch, defineComponent, toRefs } from "vue";
|
import { ref, watch, defineComponent, toRefs } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { LayoutConfig } from "@/types/dashboard";
|
import { LayoutConfig } from "@/types/dashboard";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
@ -111,6 +115,7 @@ import Text from "./Text.vue";
|
|||||||
import Ebpf from "./Ebpf.vue";
|
import Ebpf from "./Ebpf.vue";
|
||||||
import { dragIgnoreFrom } from "../data";
|
import { dragIgnoreFrom } from "../data";
|
||||||
import DemandLog from "./DemandLog.vue";
|
import DemandLog from "./DemandLog.vue";
|
||||||
|
import copy from "@/utils/copy";
|
||||||
|
|
||||||
const props = {
|
const props = {
|
||||||
data: {
|
data: {
|
||||||
@ -126,7 +131,8 @@ export default defineComponent({
|
|||||||
setup(props) {
|
setup(props) {
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const dashboardStore = useDashboardStore();
|
const dashboardStore = useDashboardStore();
|
||||||
const activeTabIndex = ref<number>(0);
|
const params = useRoute().params;
|
||||||
|
const activeTabIndex = ref<number>(Number(params.activeTabIndex) || 0);
|
||||||
const activeTabWidget = ref<string>("");
|
const activeTabWidget = ref<string>("");
|
||||||
const editTabIndex = ref<number>(NaN); // edit tab item name
|
const editTabIndex = ref<number>(NaN); // edit tab item name
|
||||||
const canEditTabName = ref<boolean>(false);
|
const canEditTabName = ref<boolean>(false);
|
||||||
@ -202,6 +208,10 @@ export default defineComponent({
|
|||||||
dashboardStore.layout[l].children[activeTabIndex.value].children
|
dashboardStore.layout[l].children[activeTabIndex.value].children
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
function copyLink() {
|
||||||
|
const path = useRouter().currentRoute.value.path;
|
||||||
|
copy(path);
|
||||||
|
}
|
||||||
document.body.addEventListener("click", handleClick, false);
|
document.body.addEventListener("click", handleClick, false);
|
||||||
watch(
|
watch(
|
||||||
() => dashboardStore.activedGridItem,
|
() => dashboardStore.activedGridItem,
|
||||||
@ -227,6 +237,7 @@ export default defineComponent({
|
|||||||
deleteTabItem,
|
deleteTabItem,
|
||||||
removeTab,
|
removeTab,
|
||||||
clickTabs,
|
clickTabs,
|
||||||
|
copyLink,
|
||||||
...toRefs(props),
|
...toRefs(props),
|
||||||
activeTabWidget,
|
activeTabWidget,
|
||||||
dashboardStore,
|
dashboardStore,
|
||||||
|
Loading…
Reference in New Issue
Block a user