File tree Expand file tree Collapse file tree
src/app/[locale]/(main)/admin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import type { ScoreItem } from '@/lib/api/services/admin';
1818import { scriptService } from '@/lib/api/services/scripts/scripts' ;
1919import { APIError } from '@/types/api' ;
2020import type { ColumnsType } from 'antd/es/table' ;
21+ import { Link } from '@/i18n/routing' ;
2122
2223export default function ScoresClient ( ) {
2324 const t = useTranslations ( 'admin.scores' ) ;
@@ -86,14 +87,22 @@ export default function ScoresClient() {
8687 } ,
8788 {
8889 title : t ( 'col_username' ) ,
89- dataIndex : 'username' ,
9090 key : 'username' ,
91+ render : ( _ : unknown , record : ScoreItem ) => (
92+ < Link href = { `/users/${ record . user_id } ` } target = "_blank" >
93+ { record . username }
94+ </ Link >
95+ ) ,
9196 } ,
9297 {
9398 title : t ( 'col_script' ) ,
94- dataIndex : 'script_name' ,
9599 key : 'script_name' ,
96100 ellipsis : true ,
101+ render : ( _ : unknown , record : ScoreItem ) => (
102+ < Link href = { `/script-show-page/${ record . script_id } ` } target = "_blank" >
103+ { record . script_name }
104+ </ Link >
105+ ) ,
97106 } ,
98107 {
99108 title : t ( 'col_score' ) ,
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import type { ScriptItem } from '@/lib/api/services/admin';
1919import { scriptService } from '@/lib/api/services/scripts/scripts' ;
2020import { APIError } from '@/types/api' ;
2121import type { ColumnsType } from 'antd/es/table' ;
22+ import { Link } from '@/i18n/routing' ;
2223
2324export default function ScriptsClient ( ) {
2425 const t = useTranslations ( 'admin.scripts' ) ;
@@ -155,14 +156,22 @@ export default function ScriptsClient() {
155156 } ,
156157 {
157158 title : t ( 'col_name' ) ,
158- dataIndex : 'name' ,
159159 key : 'name' ,
160160 ellipsis : true ,
161+ render : ( _ : unknown , record : ScriptItem ) => (
162+ < Link href = { `/script-show-page/${ record . id } ` } target = "_blank" >
163+ { record . name }
164+ </ Link >
165+ ) ,
161166 } ,
162167 {
163168 title : t ( 'col_author' ) ,
164- dataIndex : 'username' ,
165169 key : 'username' ,
170+ render : ( _ : unknown , record : ScriptItem ) => (
171+ < Link href = { `/users/${ record . user_id } ` } target = "_blank" >
172+ { record . username }
173+ </ Link >
174+ ) ,
166175 } ,
167176 {
168177 title : t ( 'col_type' ) ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import { adminService } from '@/lib/api/services/admin';
1818import type { UserItem } from '@/lib/api/services/admin' ;
1919import { APIError } from '@/types/api' ;
2020import type { ColumnsType } from 'antd/es/table' ;
21+ import { Link } from '@/i18n/routing' ;
2122
2223export default function UsersClient ( ) {
2324 const t = useTranslations ( 'admin.users' ) ;
@@ -129,8 +130,12 @@ export default function UsersClient() {
129130 } ,
130131 {
131132 title : t ( 'col_username' ) ,
132- dataIndex : 'username' ,
133133 key : 'username' ,
134+ render : ( _ : unknown , record : UserItem ) => (
135+ < Link href = { `/users/${ record . id } ` } target = "_blank" >
136+ { record . username }
137+ </ Link >
138+ ) ,
134139 } ,
135140 {
136141 title : t ( 'col_email' ) ,
You can’t perform that action at this time.
0 commit comments