File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
frontend/src/components/layout Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 88from common .utils .time import get_timestamp
99import secrets
1010
11- router = APIRouter (tags = ["system_apikey" ], prefix = "/system/apikey" )
11+ router = APIRouter (tags = ["system_apikey" ], prefix = "/system/apikey" , include_in_schema = False )
1212
1313@router .get ("" )
1414async def grid (session : SessionDep , current_user : CurrentUser ) -> list [ApikeyGridItem ]:
Original file line number Diff line number Diff line change @@ -80,6 +80,13 @@ const deleteHandler = (row: any) => {
8080 },
8181 })
8282}
83+ const sortChange = (param : any ) => {
84+ if (param ?.order === ' ascending' ) {
85+ state .tableData .sort ((a : any , b : any ) => a .create_time - b .create_time )
86+ } else {
87+ state .tableData .sort ((a : any , b : any ) => b .create_time - a .create_time )
88+ }
89+ }
8390const loadGridData = () => {
8491 request .get (' /system/apikey' ).then ((res : any ) => {
8592 state .tableData = res || []
@@ -133,7 +140,12 @@ onMounted(() => {
133140 </el-button >
134141 </div >
135142 <div class =" api-key-grid" >
136- <el-table ref =" multipleTableRef" :data =" state.tableData" style =" width : 100% " >
143+ <el-table
144+ ref =" multipleTableRef"
145+ :data =" state.tableData"
146+ style =" width : 100% "
147+ @sort-change =" sortChange"
148+ >
137149 <el-table-column prop =" access_key" label =" Access Key" width =" 256" >
138150 <template #default =" scope " >
139151 <div class =" user-status-container" >
You can’t perform that action at this time.
0 commit comments