refactor: split large files into single-responsibility modules, add server-configuration section
Frontend: - Extract Layout.tsx (801 lines) into navData.ts, Sidebar.tsx, and thin Layout.tsx - Split Settings.tsx into settings/FormControls, ContactTab, BasicTab, NameserversSection - Add server-configuration/ section with index card grid and one file per tool (13 tools) - Add shared SectionCard and ComingSoon components - Nav category headers with a section index link (optional `to` field on NavCategory) - /settings redirects to /server-configuration/basic-setup Backend: - Split accounts.ts (671 lines) into accounts/list, create, modify, status sub-plugins - Add GET /api/nixserver/system/network-interfaces for ETHDEV dropdown Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
da55367039
commit
c5498994c3
@@ -99,6 +99,20 @@ export default async function systemRoutes(fastify: FastifyInstance) {
|
||||
})
|
||||
})
|
||||
|
||||
// GET /api/nixserver/system/network-interfaces
|
||||
fastify.get('/network-interfaces', { preHandler: [requireAdmin] }, async (_request, reply) => {
|
||||
try {
|
||||
const result = await exec('ls', ['/sys/class/net'])
|
||||
const ifaces = result.stdout
|
||||
.split('\n')
|
||||
.map(s => s.trim())
|
||||
.filter(s => s && s !== 'lo') // exclude loopback
|
||||
return reply.send({ success: true, data: ifaces })
|
||||
} catch {
|
||||
return reply.send({ success: true, data: [] })
|
||||
}
|
||||
})
|
||||
|
||||
// GET /api/nixserver/system/settings
|
||||
fastify.get('/settings', { preHandler: [requireAdmin] }, async (request, reply) => {
|
||||
const settings = await prisma.setting.findMany({ orderBy: { key: 'asc' } })
|
||||
|
||||
Reference in New Issue
Block a user