fix: 自适应表格高度并改用中文标签
This commit is contained in:
@@ -187,10 +187,16 @@ const columns = computed<DataTableColumns<Endpoint>>(() => [
|
||||
render: (r) => (r.login_locked ? "是" : "否"),
|
||||
},
|
||||
{
|
||||
title: "最近在线",
|
||||
title: "最近上线",
|
||||
key: "online_since_ms",
|
||||
width: 160,
|
||||
render: (r) => formatLocalMs(r.online ? r.online_since_ms : r.offline_since_ms),
|
||||
render: (r) => formatLocalMs(r.online_since_ms),
|
||||
},
|
||||
{
|
||||
title: "最近离线",
|
||||
key: "offline_since_ms",
|
||||
width: 160,
|
||||
render: (r) => formatLocalMs(r.offline_since_ms),
|
||||
},
|
||||
{
|
||||
title: "创建时间",
|
||||
@@ -496,6 +502,7 @@ function onPageSizeChange(s: number) {
|
||||
<div class="page-body">
|
||||
<LoadFailed v-if="loadError" :description="loadError" @retry="load" />
|
||||
<template v-else>
|
||||
<div class="page-filters">
|
||||
<SecretOnceAlert
|
||||
v-if="onceSecret"
|
||||
:title="onceSecret.title"
|
||||
@@ -527,15 +534,17 @@ function onPageSizeChange(s: number) {
|
||||
<HelpTip>admin=后台开通,self=自助注册。</HelpTip>
|
||||
</span>
|
||||
</n-space>
|
||||
</div>
|
||||
<div class="page-table">
|
||||
<n-data-table
|
||||
remote
|
||||
flex-height
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:data="rows"
|
||||
:row-key="(r: Endpoint) => r.id"
|
||||
:checked-row-keys="checkedKeys"
|
||||
:max-height="480"
|
||||
:scroll-x="1200"
|
||||
:scroll-x="1400"
|
||||
:pagination="{
|
||||
page,
|
||||
pageSize,
|
||||
@@ -547,6 +556,7 @@ function onPageSizeChange(s: number) {
|
||||
}"
|
||||
@update:checked-row-keys="(k) => (checkedKeys = k)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -688,8 +698,17 @@ function onPageSizeChange(s: number) {
|
||||
}
|
||||
.page-body {
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
padding: 16px;
|
||||
}
|
||||
.page-filters {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.page-table {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user