|
31 | 31 | > |
32 | 32 | <a-descriptions-item v-for="item in detailEntries" :key="item.key"> |
33 | 33 | <template #label>{{ item.key }}</template> |
34 | | - <template v-if="item.key === 'versionGroups' && Array.isArray(item.value)"> |
35 | | - <a-space direction="vertical" size="small"> |
36 | | - <a-space v-for="(vg, idx) in item.value" :key="idx" size="small"> |
37 | | - <a-tag>version: {{ vg?.version ?? '无' }}</a-tag> |
38 | | - <a-tag>group: {{ vg?.group ?? '无' }}</a-tag> |
39 | | - </a-space> |
40 | | - </a-space> |
41 | | - </template> |
42 | | - <template v-else> |
43 | | - <a-typography-paragraph style="margin-bottom: 0">{{ |
44 | | - formatValueForDisplay(item.value) |
45 | | - }}</a-typography-paragraph> |
46 | | - </template> |
| 34 | + {{ formatValueForDisplay(item.value) }} |
47 | 35 | </a-descriptions-item> |
48 | 36 | </a-descriptions> |
49 | 37 | </a-spin> |
@@ -169,26 +157,15 @@ const detailTitle = computed(() => { |
169 | 157 | return currentDetailKey.value ? `${base}:${currentDetailKey.value}` : base |
170 | 158 | }) |
171 | 159 |
|
| 160 | +const detailEntryBlacklist = new Set<string>(['versionGroups', 'appName']) |
| 161 | +
|
172 | 162 | const detailEntries = computed(() => { |
173 | 163 | const data = detailData.value ?? {} |
174 | | - const preferredKeys = ['versionGroups', 'avgRT', 'avgQPS', 'requestTotal'] |
175 | | - const pairs = Object.entries(data).filter( |
176 | | - ([, v]) => v !== undefined && v !== null && String(v) !== '' |
177 | | - ) |
178 | | - const ordered: Array<[string, unknown]> = [] |
179 | | - const used = new Set<string>() |
180 | | - for (const k of preferredKeys) { |
181 | | - const hit = pairs.find(([key]) => key === k) |
182 | | - if (hit) { |
183 | | - ordered.push(hit) |
184 | | - used.add(k) |
185 | | - } |
186 | | - } |
187 | | - const rest = pairs |
188 | | - .filter(([k]) => !used.has(k)) |
189 | | - .sort((a, b) => (a[0] > b[0] ? 1 : a[0] < b[0] ? -1 : 0)) |
190 | | - ordered.push(...rest) |
191 | | - return ordered.map(([key, value]) => ({ key, value })) |
| 164 | + return Object.entries(data) |
| 165 | + .filter( |
| 166 | + ([k, v]) => !detailEntryBlacklist.has(k) && v !== undefined && v !== null && String(v) !== '' |
| 167 | + ) |
| 168 | + .map(([key, value]) => ({ key, value })) |
192 | 169 | }) |
193 | 170 |
|
194 | 171 | const formatValueForDisplay = (v: unknown) => { |
|
0 commit comments