new dashboard page

This commit is contained in:
2025-12-31 20:01:57 +01:00
parent 991c58d91d
commit c9c4cc074c
18 changed files with 3400 additions and 2041 deletions

View File

@@ -12,7 +12,7 @@ function getNavbarHTML(activePage: string, showSearch: boolean = true): string {
let navbar = cachedNavbar;
const pages = ['anime', 'books', 'gallery', 'schedule', 'my-list', 'marketplace'];
const pages = ['dashboard', 'anime', 'books', 'gallery', 'schedule' , 'marketplace'];
pages.forEach(page => {
const regex = new RegExp(`(<button class="nav-button[^"]*)"\\s+data-page="${page}"`, 'g');
if (page === activePage) {
@@ -51,10 +51,10 @@ async function viewsRoutes(fastify: FastifyInstance) {
reply.type('text/html').send(htmlWithNavbar);
});
fastify.get('/my-list', (req: FastifyRequest, reply: FastifyReply) => {
const htmlPath = path.join(__dirname, '..', '..', 'views', 'list.html');
fastify.get('/dashboard', (req: FastifyRequest, reply: FastifyReply) => {
const htmlPath = path.join(__dirname, '..', '..', 'views', 'dashboard.html');
const html = fs.readFileSync(htmlPath, 'utf-8');
const htmlWithNavbar = injectNavbar(html, 'my-list', false);
const htmlWithNavbar = injectNavbar(html, 'dashboard', false);
reply.type('text/html').send(htmlWithNavbar);
});