+
diff --git a/src/views/dashboard/configuration/widget/RelatedTraceOptions.vue b/src/views/dashboard/configuration/widget/RelatedTraceOptions.vue
index c08fdbde..75fb0fe1 100644
--- a/src/views/dashboard/configuration/widget/RelatedTraceOptions.vue
+++ b/src/views/dashboard/configuration/widget/RelatedTraceOptions.vue
@@ -20,7 +20,7 @@ limitations under the License. -->
:value="status"
:options="Status"
placeholder="Select a status"
- @change="updateConfig({ status })"
+ @change="updateConfig({ status: $event[0].value })"
/>
@@ -30,25 +30,16 @@ limitations under the License. -->
:value="queryOrder"
:options="QueryOrders"
placeholder="Select a option"
- @change="updateConfig({ queryOrder })"
+ @change="updateConfig({ queryOrder: $event[0].value })"
/>
-
{{ t("setLatencyDuration") }}
@@ -56,16 +47,14 @@ limitations under the License. -->
import { ref } from "vue";
import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard";
-import { Status } from "../../data";
-import { QueryOrders } from "../../data";
+import { Status, QueryOrders } from "../../data";
const { t } = useI18n();
const dashboardStore = useDashboardStore();
-const traceOpt = dashboardStore.selectedGrid.relatedTrace;
+const traceOpt = dashboardStore.selectedGrid.relatedTrace || {};
const status = ref(traceOpt.status || Status[0].value);
const queryOrder = ref(traceOpt.queryOrder || QueryOrders[0].value);
-// const setDuration = ref(traceOpt.setDuration || false);
-const setLatencyDuration = ref(traceOpt.setLatencyDuration || false);
+const latency = ref(traceOpt.setLatencyDuration || false);
function updateConfig(param: { [key: string]: unknown }) {
const relatedTrace = {
@@ -83,10 +72,6 @@ function updateConfig(param: { [key: string]: unknown }) {
margin-bottom: 5px;
}
-.input {
- width: 500px;
-}
-
.item {
margin-bottom: 10px;
}
diff --git a/src/views/dashboard/related/trace/Header.vue b/src/views/dashboard/related/trace/Header.vue
index 9d38c746..0792f303 100644
--- a/src/views/dashboard/related/trace/Header.vue
+++ b/src/views/dashboard/related/trace/Header.vue
@@ -81,15 +81,19 @@ const state = reactive({
endpoint: "",
service: "",
});
-const items = Object.keys(filters).map((d: string) => {
- return { key: d, value: filtersKeys[d] };
-});
-const conditions = ref(items[0].key);
+const conditions = ref("");
+const items = ref<{ key: string; value: string }[]>([]);
init();
async function init() {
if (!filters.id) {
+ for (const d of Object.keys(filters)) {
+ if (filters[d]) {
+ items.value.push({ key: d, value: filtersKeys[d] });
+ }
+ }
+ conditions.value = (items.value[0] && items.value[0].key) || "";
state.service = selectorStore.currentService.id;
if (dashboardStore.entity === EntityType[2].value) {
state.instance = selectorStore.currentPod.id;
@@ -154,8 +158,8 @@ function setCondition() {
};
// echarts
if (!filters.id) {
- for (const k of items) {
- if (k.key === conditions.value) {
+ for (const k of items.value) {
+ if (k.key === conditions.value && filters[k.key]) {
params[k.value] = filters[k.key];
}
}