feat: update dependencies and improve dashboard functionality
Deploy to VPS / deploy (push) Failing after 1m43s

- Added new dependencies for Next.js and lucide-react in pnpm-workspace.yaml.
- Refactored DashboardPage component to improve readability and error handling.
- Enhanced Header component to display error status with an alert icon.
- Updated MobileTabBar and Sidebar components to use a centralized tabs definition.
- Improved ChannelsView in dashboard-panel to handle channel fetching more cleanly.
- Fixed ActiveSpeaker type to use camelCase for userId.
- Updated MessagesPanel to handle guildId checks more gracefully.
- Adjusted API calls in dashboard and messages to align with backend expectations.
- Refined type definitions across various interfaces for consistency and clarity.
This commit is contained in:
asepharyana
2026-07-26 14:27:36 +07:00
parent 9ecc4a6caa
commit 0a6a9fd982
62 changed files with 2764 additions and 305 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ async function shutdown(signal: string) {
// 1. Stop accepting new HTTP connections
if (httpServer) {
await new Promise<void>((resolve) => {
httpServer!.close(() => {
httpServer?.close(() => {
logger.info("HTTP server closed");
resolve();
});
@@ -2,7 +2,7 @@ import { createChildLogger } from "@bete/shared/logger";
import { getPool } from "../../shared/database/index.js";
import type { ListUsersQuery } from "./dashboard.service.js";
const logger = createChildLogger("dashboard.repository");
const _logger = createChildLogger("dashboard.repository");
export class DashboardRepository {
async getStats() {
@@ -1,6 +1,6 @@
import type { Router } from "express";
import express from "express";
import { collectDefaultMetrics, register } from "prom-client";
import { collectDefaultMetrics } from "prom-client";
import { handleHealthCheck, handleMetrics } from "./health.controller.js";
// Initialize default Node.js runtime metrics (event loop lag, memory, GC, etc.)
@@ -1,7 +1,7 @@
import { createChildLogger } from "@bete/shared/logger";
import { healthRepository } from "./health.repository.js";
const logger = createChildLogger("health.service");
const _logger = createChildLogger("health.service");
export class HealthService {
async getHealth(verbose = false) {
@@ -4,7 +4,7 @@
* Prometheus metrics for AI moderation pipeline.
* Defined in backend (where prom-client is installed + /api/metrics endpoint).
*/
import { Counter, Histogram, register } from "prom-client";
import { Counter, Histogram } from "prom-client";
// ── LLM Call Metrics ──
export const llmCallsTotal = new Counter({
@@ -56,7 +56,7 @@ export const handleMascotChat = asyncHandler(
export const getMascotChatHistory = asyncHandler(
async (req: Request, res: Response) => {
const userId = (req as AuthenticatedRequest).userId || "anonymous";
const limit = Math.min(parseInt(req.query.limit as string) || 50, 100);
const limit = Math.min(parseInt(req.query.limit as string, 10) || 50, 100);
const history = await mascotChatService.getChatHistory(userId, limit);
@@ -66,7 +66,7 @@ function normalizeMediaState(raw: Record<string, unknown>): MediaState {
type MediaReplyData = Record<string, unknown> | MediaState;
function fromReply(data: MediaReplyData): MediaState {
function _fromReply(data: MediaReplyData): MediaState {
return normalizeMediaState(data as Record<string, unknown>);
}
@@ -68,7 +68,7 @@ export class RecordingsService {
const items = rows.slice(0, limit) as unknown as RecordingRow[];
const hasMore = rows.length > limit;
const nextCursor = hasMore
? String(items[items.length - 1]!.created_at)
? String(items[items.length - 1]?.created_at)
: null;
return { items, nextCursor, hasMore };
@@ -1,6 +1,5 @@
import type { CommandReply } from "@bete/shared";
import { createChildLogger } from "@bete/shared/logger";
import { publishCommand, readRedisStatus } from "./redis/index.js";
export { createChildLogger };