@@ -24,8 +24,8 @@ import { apiGetServersAdmin } from "../api";
2424import { ContainerWithHeaderAndButtons } from "../component/ContainerWithHeaderAndButtons.tsx" ;
2525import { PaginatorLocal } from "../component/forum/PaginatorLocal.tsx" ;
2626import { ServerEditorModal } from "../component/modal/ServerEditorModal.tsx" ;
27+ import { BoolCell } from "../component/table/BoolCell.tsx" ;
2728import { DataTable } from "../component/table/DataTable.tsx" ;
28- import { TableCellBool } from "../component/table/TableCellBool.tsx" ;
2929import { TableCellString } from "../component/table/TableCellString.tsx" ;
3030import { TableCellStringHidden } from "../component/table/TableCellStringHidden.tsx" ;
3131import { useUserFlashCtx } from "../hooks/useUserFlashCtx.ts" ;
@@ -38,7 +38,17 @@ const serversSearchSchema = z.object({
3838 page_size : z . number ( ) . optional ( ) . catch ( RowsPerPage . TwentyFive ) ,
3939 sort_order : z . enum ( [ "desc" , "asc" ] ) . optional ( ) . catch ( "desc" ) ,
4040 sort_column : z
41- . enum ( [ "server_id" , "short_name" , "name" , "address" , "port" , "region" , "cc" , "enable_stats" , "is_enabled" ] )
41+ . enum ( [
42+ "server_id" ,
43+ "short_name" ,
44+ "name" ,
45+ "address" ,
46+ "port" ,
47+ "region" ,
48+ "cc" ,
49+ "enable_stats" ,
50+ "is_enabled" ,
51+ ] )
4252 . optional ( ) ,
4353} ) ;
4454
@@ -56,7 +66,10 @@ export const Route = createFileRoute("/_admin/admin/servers")({
5666 } ,
5767 head : ( { match } ) => {
5868 return {
59- meta : [ { name : "description" , content : "Server Editor" } , match . context . title ( "Edit Servers" ) ] ,
69+ meta : [
70+ { name : "description" , content : "Server Editor" } ,
71+ match . context . title ( "Edit Servers" ) ,
72+ ] ,
6073 } ;
6174 } ,
6275
@@ -76,7 +89,10 @@ function AdminServers() {
7689 const onCreate = async ( ) => {
7790 try {
7891 const newServer = ( await NiceModal . show ( ServerEditorModal , { } ) ) as Server ;
79- queryClient . setQueryData ( [ "serversAdmin" ] , [ ...( servers ?? [ ] ) , newServer ] ) ;
92+ queryClient . setQueryData (
93+ [ "serversAdmin" ] ,
94+ [ ...( servers ?? [ ] ) , newServer ] ,
95+ ) ;
8096 sendFlash ( "success" , "Server created successfully" ) ;
8197 } catch ( e ) {
8298 sendFlash ( "error" , `Failed to create new server: ${ e } ` ) ;
@@ -168,7 +184,9 @@ const AdminServersTable = ({
168184 accessorKey : "server_id" ,
169185 size : 40 ,
170186 header : "ID" ,
171- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
187+ cell : ( info ) => (
188+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
189+ ) ,
172190 } ,
173191 {
174192 accessorKey : "short_name" ,
@@ -177,7 +195,9 @@ const AdminServersTable = ({
177195 tooltip : "Short unique server identifier" ,
178196 } ,
179197 header : "Name" ,
180- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
198+ cell : ( info ) => (
199+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
200+ ) ,
181201 } ,
182202 {
183203 accessorKey : "name" ,
@@ -186,43 +206,60 @@ const AdminServersTable = ({
186206 tooltip : "Full name of the server, AKA srcds hostname" ,
187207 } ,
188208 header : "Name Long" ,
189- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
209+ cell : ( info ) => (
210+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
211+ ) ,
190212 } ,
191213 {
192214 accessorKey : "address" ,
193215 meta : {
194216 tooltip : "IP or DNS/Hostname of the server" ,
195217 } ,
196218 header : "Address" ,
197- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
219+ cell : ( info ) => (
220+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
221+ ) ,
198222 } ,
199223 {
200224 accessorKey : "port" ,
201225 size : 50 ,
202226 header : "Port" ,
203- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
227+ cell : ( info ) => (
228+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
229+ ) ,
204230 } ,
205231 {
206232 accessorKey : "rcon" ,
207233 meta : {
208234 tooltip : "Standard RCON password" ,
209235 } ,
210236 header : ( ) => "RCON" ,
211- cell : ( info ) => < TableCellStringHidden > { info . getValue ( ) as string } </ TableCellStringHidden > ,
237+ cell : ( info ) => (
238+ < TableCellStringHidden >
239+ { info . getValue ( ) as string }
240+ </ TableCellStringHidden >
241+ ) ,
212242 } ,
213243 {
214244 accessorKey : "password" ,
215245 meta : {
216- tooltip : "A password that the server uses to authenticate with the central gbans server" ,
246+ tooltip :
247+ "A password that the server uses to authenticate with the central gbans server" ,
217248 } ,
218249 header : ( ) => "Auth Key" ,
219- cell : ( info ) => < TableCellStringHidden > { info . getValue ( ) as string } </ TableCellStringHidden > ,
250+ cell : ( info ) => (
251+ < TableCellStringHidden >
252+ { info . getValue ( ) as string }
253+ </ TableCellStringHidden >
254+ ) ,
220255 } ,
221256 {
222257 accessorKey : "region" ,
223258 size : 75 ,
224259 header : "Region" ,
225- cell : ( info ) => < TableCellString > { info . getValue ( ) as string } </ TableCellString > ,
260+ cell : ( info ) => (
261+ < TableCellString > { info . getValue ( ) as string } </ TableCellString >
262+ ) ,
226263 } ,
227264 // {
228265 // accessorKey: 'cc',
@@ -257,7 +294,11 @@ const AdminServersTable = ({
257294 tooltip : "Last time the server authenticated itself" ,
258295 } ,
259296 header : "Last Auth" ,
260- cell : ( info ) => < TableCellString > { renderDateTime ( info . getValue ( ) as Date ) } </ TableCellString > ,
297+ cell : ( info ) => (
298+ < TableCellString >
299+ { renderDateTime ( info . getValue ( ) as Date ) }
300+ </ TableCellString >
301+ ) ,
261302 } ,
262303 {
263304 accessorKey : "enable_stats" ,
@@ -266,7 +307,7 @@ const AdminServersTable = ({
266307 tooltip : "Stat Tracking Enabled" ,
267308 } ,
268309 header : "St" ,
269- cell : ( info ) => < TableCellBool enabled = { info . getValue ( ) as boolean } /> ,
310+ cell : ( info ) => < BoolCell enabled = { info . getValue ( ) as boolean } /> ,
270311 } ,
271312 {
272313 accessorKey : "is_enabled" ,
@@ -275,7 +316,7 @@ const AdminServersTable = ({
275316 tooltip : "Enabled" ,
276317 } ,
277318 header : "En." ,
278- cell : ( info ) => < TableCellBool enabled = { info . getValue ( ) as boolean } /> ,
319+ cell : ( info ) => < BoolCell enabled = { info . getValue ( ) as boolean } /> ,
279320 } ,
280321 {
281322 id : "actions" ,
0 commit comments