fix: optimize metrics association (#196)

This commit is contained in:
Fine0830
2022-11-29 18:47:53 +08:00
committed by GitHub
parent d4dde7e73b
commit 221751f034
9 changed files with 42 additions and 15 deletions

View File

@@ -85,7 +85,7 @@ const Status = [
const { t } = useI18n();
const dashboardStore = useDashboardStore();
const { graph, relatedTrace } = dashboardStore.selectedGrid;
const traceOpt = (relatedTrace && relatedTrace.traceOpt) || {};
const traceOpt = relatedTrace || {};
const status = ref<string>(traceOpt.status || Status[0].value);
const queryOrder = ref<string>(traceOpt.queryOrder || QueryOrders[0].value);
const latency = ref<boolean>(traceOpt.latency || false);

View File

@@ -65,6 +65,7 @@ limitations under the License. -->
metricConfig: data.metricConfig || [],
filters: data.filters || {},
relatedTrace: data.relatedTrace || {},
associate: data.associate || [],
}"
:needQuery="needQuery"
@click="clickHandle"

View File

@@ -45,6 +45,7 @@ defineProps({
filters: Filters;
relatedTrace: RelatedTrace;
id: string;
associate: { widgetId: string }[];
}
>,
default: () => ({}),

View File

@@ -14,7 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License. -->
<template>
<div class="graph" :class="isRight ? 'flex-h' : 'flex-v'">
<Graph :option="option" @select="clickEvent" :filters="config.filters" />
<Graph
:option="option"
@select="clickEvent"
:filters="config.filters"
:associate="config.associate || []"
/>
<Legend :config="config.legend" :data="data" :intervalTime="intervalTime" />
</div>
</template>
@@ -44,6 +49,7 @@ const props = defineProps({
filters: Filters;
relatedTrace: RelatedTrace;
id: string;
associate: { widgetId: string }[];
}
>,
default: () => ({}),

View File

@@ -19,6 +19,7 @@ limitations under the License. -->
@select="clickEvent"
:filters="config.filters"
:relatedTrace="config.relatedTrace"
:associate="config.associate || []"
/>
<Legend :config="config.legend" :data="data" :intervalTime="intervalTime" />
</div>
@@ -50,6 +51,7 @@ const props = defineProps({
filters?: Filters;
relatedTrace?: RelatedTrace;
id?: string;
associate: { widgetId: string }[];
}
>,
default: () => ({

View File

@@ -58,6 +58,7 @@ limitations under the License. -->
:destroy-on-close="true"
:before-close="() => (showTrace = false)"
:append-to-body="true"
title="The Related Traces"
>
<Trace :data="traceOptions" />
</el-drawer>

View File

@@ -18,7 +18,7 @@ limitations under the License. -->
<el-input size="small" v-model="traceId" class="trace-id" />
</div>
<div class="conditions flex-h" v-else>
<el-radio-group v-model="conditions" @change="changeCondition">
<el-radio-group v-model="conditions" @change="changeCondition" size="small">
<el-radio-button
v-for="(item, index) in items"
:label="item.label"