This commit is contained in:
Fine 2025-06-03 18:31:45 +08:00
parent 88553431b8
commit 4685f66a78
2 changed files with 7 additions and 5 deletions

View File

@ -13,10 +13,12 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<el-table :data="[data]" class="mb-5" :row-style="{ backgroundColor: 'var(--layout-background)' }"> <el-table :data="data" class="mb-5" :row-style="{ backgroundColor: 'var(--layout-background)' }">
<el-table-column v-for="column in metricsRows" :prop="column.value" :label="column.label" :key="column.value"> <el-table-column v-for="column in metricsRows" :prop="column.value" :label="column.label" :key="column.value">
<el-table-column v-for="item in column.children" :prop="item.value" :label="item.label" :key="item.value"> <el-table-column v-for="item in column.children" :prop="item.value" :label="item.label" :key="item.value">
{{ data ? (data[item.value] < 0 ? "N/A" : data[item.value]) : "N/A" }} <template #default="scope">
{{ scope.row && scope.row[item.value] ? (scope.row[item.value] < 0 ? "N/A" : scope.row[item.value]) : "N/A" }}
</template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -29,6 +31,6 @@ limitations under the License. -->
type: Array as PropType<{ label: string; value: string; children: Option[] }[]>, type: Array as PropType<{ label: string; value: string; children: Option[] }[]>,
default: () => [], default: () => [],
}, },
data: { type: Object as PropType<Indexable>, default: () => {} }, data: { type: Array as PropType<Indexable[]>, default: () => [] },
}); });
</script> </script>

View File

@ -15,9 +15,9 @@ limitations under the License. -->
<template> <template>
<div class="ttl"> <div class="ttl">
<div class="label">{{ t("metricsTTL") }}</div> <div class="label">{{ t("metricsTTL") }}</div>
<DoubleHeaderTable :data="settingsStore.configTTL.metrics" :metricsRows="MetricsTTLRow" /> <DoubleHeaderTable :data="[settingsStore.configTTL.metrics]" :metricsRows="MetricsTTLRow" />
<div class="label">{{ t("recordsTTL") }}</div> <div class="label">{{ t("recordsTTL") }}</div>
<DoubleHeaderTable :data="settingsStore.configTTL.records" :metricsRows="RecordsTTLRow" /> <DoubleHeaderTable :data="[settingsStore.configTTL.records]" :metricsRows="RecordsTTLRow" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>