mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 14:25:23 +00:00
fix dashboards
This commit is contained in:
parent
846aada0e2
commit
47f09ff1dd
@ -60,10 +60,10 @@ const p = useRoute().params;
|
||||
const layoutKey = ref<string>(`${p.layerId}_${p.entity}_${p.name}`);
|
||||
|
||||
setTemplate();
|
||||
|
||||
async function setTemplate() {
|
||||
await dashboardStore.setDashboards();
|
||||
if (dashboardStore.currentDashboard) {
|
||||
|
||||
if (!p.entity) {
|
||||
const { layer, entity, name } = dashboardStore.currentDashboard;
|
||||
layoutKey.value = `${layer}_${entity}_${name.split(" ").join("-")}`;
|
||||
}
|
||||
@ -83,8 +83,6 @@ async function setTemplate() {
|
||||
isRoot: layout.isRoot,
|
||||
});
|
||||
}
|
||||
dashboardStore.setLayer(dashboardStore.currentDashboard.layer);
|
||||
dashboardStore.setEntity(dashboardStore.currentDashboard.entity);
|
||||
}
|
||||
function handleClick(e: any) {
|
||||
e.stopPropagation();
|
||||
|
@ -37,6 +37,7 @@ limitations under the License. -->
|
||||
metrics: dashboardStore.selectedGrid.metrics,
|
||||
metricTypes: dashboardStore.selectedGrid.metricTypes,
|
||||
standard: dashboardStore.selectedGrid.standard,
|
||||
isEdit: true,
|
||||
}"
|
||||
/>
|
||||
<div v-show="!dashboardStore.selectedGrid.graph.type" class="no-data">
|
||||
|
@ -179,8 +179,8 @@ async function setMetricType(catalog?: string) {
|
||||
}
|
||||
dashboardStore.selectWidget({
|
||||
...dashboardStore.selectedGrid,
|
||||
metrics,
|
||||
metricTypes,
|
||||
metrics: states.metrics,
|
||||
metricTypes: states.metricTypes,
|
||||
});
|
||||
states.metricTypeList = [];
|
||||
for (const metric of metrics) {
|
||||
@ -321,6 +321,9 @@ function changeMetricType(index: number, opt: Option[] | any) {
|
||||
queryMetrics();
|
||||
}
|
||||
async function queryMetrics() {
|
||||
if (states.isList) {
|
||||
return;
|
||||
}
|
||||
const { standard } = dashboardStore.selectedGrid;
|
||||
const params = useQueryProcessor({ ...states, standard });
|
||||
if (!params) {
|
||||
|
@ -173,6 +173,12 @@ export default defineComponent({
|
||||
function deleteTabItem(e: Event, idx: number) {
|
||||
e.stopPropagation();
|
||||
dashboardStore.removeTabItem(props.data, idx);
|
||||
const kids = dashboardStore.layout[l].children[0];
|
||||
const arr = (kids && kids.children) || [];
|
||||
dashboardStore.setCurrentTabItems(arr);
|
||||
dashboardStore.activeGridItem(0);
|
||||
activeTabIndex.value = 0;
|
||||
needQuery.value = true;
|
||||
}
|
||||
function addTabItem() {
|
||||
dashboardStore.addTabItem(props.data);
|
||||
|
@ -102,6 +102,7 @@ const props = defineProps({
|
||||
i: string;
|
||||
metrics: string[];
|
||||
metricTypes: string[];
|
||||
isEdit: boolean;
|
||||
}
|
||||
>,
|
||||
default: () => ({ dashboardName: "", fontSize: 12, i: "" }),
|
||||
@ -129,6 +130,9 @@ async function queryEndpoints() {
|
||||
}
|
||||
searchEndpoints.value = selectorStore.pods;
|
||||
endpoints.value = selectorStore.pods.splice(0, pageSize);
|
||||
if (props.config.isEdit) {
|
||||
return;
|
||||
}
|
||||
queryEndpointMetrics(endpoints.value);
|
||||
}
|
||||
async function queryEndpointMetrics(currentPods: Endpoint[]) {
|
||||
|
@ -99,6 +99,7 @@ const props = defineProps({
|
||||
i: string;
|
||||
metrics: string[];
|
||||
metricTypes: string[];
|
||||
isEdit: boolean;
|
||||
}
|
||||
>,
|
||||
default: () => ({
|
||||
@ -132,6 +133,9 @@ async function queryInstance() {
|
||||
}
|
||||
searchInstances.value = selectorStore.pods;
|
||||
instances.value = searchInstances.value.splice(0, pageSize);
|
||||
if (props.config.isEdit) {
|
||||
return;
|
||||
}
|
||||
queryInstanceMetrics(instances.value);
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,9 @@ limitations under the License. -->
|
||||
<template #default="scope">
|
||||
<router-link
|
||||
class="link"
|
||||
:to="`/dashboard/${dashboardStore.layerId}/${EntityType[0].value}/${scope.row.id}/${config.dashboardName}`"
|
||||
:to="`/dashboard/${dashboardStore.layerId}/${
|
||||
EntityType[0].value
|
||||
}/${scope.row.id}/${config.dashboardName.split(' ').join('-')}`"
|
||||
:key="1"
|
||||
:style="{ fontSize: `${config.fontSize}px` }"
|
||||
>
|
||||
@ -115,6 +117,7 @@ const props = defineProps({
|
||||
i: string;
|
||||
metrics: string[];
|
||||
metricTypes: string[];
|
||||
isEdit: boolean;
|
||||
}
|
||||
>,
|
||||
default: () => ({ dashboardName: "", fontSize: 12 }),
|
||||
@ -165,7 +168,9 @@ async function queryServices() {
|
||||
}
|
||||
groups.value[s.group] = obj[s.group];
|
||||
}
|
||||
|
||||
if (props.config.isEdit) {
|
||||
return;
|
||||
}
|
||||
queryServiceMetrics(services.value);
|
||||
}
|
||||
async function queryServiceMetrics(currentServices: Service[]) {
|
||||
|
@ -128,6 +128,8 @@ const states = reactive<{
|
||||
currentDestPod: "",
|
||||
});
|
||||
|
||||
dashboardStore.setLayer(params.layerId);
|
||||
dashboardStore.setEntity(params.entity);
|
||||
appStore.setEventStack([initSelector]);
|
||||
|
||||
initSelector();
|
||||
|
Loading…
Reference in New Issue
Block a user