Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/apps/system/api/apikey.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from common.utils.time import get_timestamp
import secrets

router = APIRouter(tags=["system_apikey"], prefix="/system/apikey")
router = APIRouter(tags=["system_apikey"], prefix="/system/apikey", include_in_schema=False)

@router.get("")
async def grid(session: SessionDep, current_user: CurrentUser) -> list[ApikeyGridItem]:
Expand Down
14 changes: 13 additions & 1 deletion frontend/src/components/layout/Apikey.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ const deleteHandler = (row: any) => {
},
})
}
const sortChange = (param: any) => {
if (param?.order === 'ascending') {
state.tableData.sort((a: any, b: any) => a.create_time - b.create_time)
} else {
state.tableData.sort((a: any, b: any) => b.create_time - a.create_time)
}
}
const loadGridData = () => {
request.get('/system/apikey').then((res: any) => {
state.tableData = res || []
Expand Down Expand Up @@ -133,7 +140,12 @@ onMounted(() => {
</el-button>
</div>
<div class="api-key-grid">
<el-table ref="multipleTableRef" :data="state.tableData" style="width: 100%">
<el-table
ref="multipleTableRef"
:data="state.tableData"
style="width: 100%"
@sort-change="sortChange"
>
<el-table-column prop="access_key" label="Access Key" width="256">
<template #default="scope">
<div class="user-status-container">
Expand Down