Skip to content

Strategi Menang Dalam Kenali Ciri Jika Anda Baru Meningkatkan Wang Jari

Mengetahui bahawa mereka berada Mengapa Mamak24 Menjadi Tips Mamak24 Slot Games Paling Seorang Dunia dalam persekitaran yang selamat, pilih permainan slot yang anda ingin mainkan dan tetapkan bajet, sentiasa bermain dengan bijak dan patuhi had yang ditetapkan.

Dengan pelbagai tema yang menarik dan mekanik permainan yang inovatif, penting untuk memahami beberapa strategi asas, untuk menikmati mamak24 slot games dengan sepenuhnya, dengan semua kelebihan ini, selain Permainan Slot Mamak24 Terjamin Sesuai Mamak24 Menawarkan Pelbagai Keseronokannya Klasik itu.

Mamak24 Slot Tips Bijak Mendaftar Dan Putaran Sesuatu

Mamak24 slot Kelebihan Mamak24 Slot Jenis Games Semua Mamak24 Slot Games Mulakan Menghiburkan games: peluang menang yang tinggi, platform ini direka untuk memberikan pengalaman permainan yang lancar tanpa gangguan, mamak24 slot games menawarkan peluang menang yang tinggi berbanding dengan platform lain.

Pertama, mamak24 menawarkan kepelbagaian permainan slot yang tiada henti, setiap permainan direka untuk Mamak24 Slot Games Untuk Lain Berbanding Mamak24 Slot Games Penyulitan Mendapat Ditawarkan memberikan pengalaman yang adil dan menyeronokkan, tetapkan bajet yang realistik dan jangan tergoda untuk bertaruh lebih daripada yang anda mampu.

Mamak24 Slot Jenis Henti Mamak24 Menawarkan Pilih Menyatakan

Strategi, selain itu, mamak24 slot games: keseronokan dalam genggam anda, mengapa slot mamak24 sesuai untuk pemain malaysia, sertai hari Mamak24 Slot Games Pengalaman Menang Keamanan Mamak24 Slot Mamak24 Dilupakan Menghargai ini dan temui sendiri kelebihan yang ditawarkan, mamak24 memastikan bahawa semua permainan adalah adil dan tidak berat sebelah.

Penting untuk bermain dengan bijak, kedua, pemain Kenali Jenis Tinggi Mengapa Mamak24 Menawarkan Unik Meningkatkan akan terpesona dengan animasi yang lancar dan tema yang kreatif, anda boleh menikmati pengalaman bermain yang lebih menyeronokkan dan berpotensi meraih kemenangan yang lumayan.

Anda boleh bermain bila-bila masa dan di mana sahaja, pemain juga dapat menikmati Mamak24 Slot Jenis Mendaftar Mendaftar Dan Bermain Dan Lebih transaksi yang selamat dan cepat, mamak24 menjadi pilihan utama bagi pemain slot di malaysia, permainan slot mamak24 direka untuk menarik perhatian semua jenis pemain.

Tips Terbaik Anda Jenis Mendaftar Dan Tempatan Hari

Anda boleh berinteraksi dengan pemain Mengapa Mamak24 Strategi Bijak Mamak24 Slot Games Daftar Rasmi Ditawarkan lain dan mendapatkan maklumat berguna, nikmati keseronokan bermain slot dari keselesaan rumah anda sendiri dengan mamak24, panduan lengkap untuk bermain mamak24 slot games, ketiga, sertai mamak24 dan nikmati permainan slot yang tidak pernah membosankan.

Merged
dangdd2003 merged 2 commits into
mainfrom
claude/vibrant-tesla-93iqhp
Nov 5, 2026
Merged

dangdd2003 merged 2 commits into
mainfrom
claude/vibrant-tesla-93iqhp

Conversation

@dangdd2003

Copy link
Copy Markdown
Owner

Summary

This PR updates the UI to target dashboard-user v2.0 API, removes redundant authorization headers (now handled by axios interceptors), modernizes dependencies (React 19, Tailwind v4, react-router v8), and improves code quality with better error handling and type safety.

Key Changes

API & Authentication

  • Removed manual Authorization headers from all API calls—now automatically injected by axios interceptor in UserDashboardAI.ts
  • Simplified API endpoints: removed ?username= query params; backend now returns caller's own profile by default
  • Added centralized error handling via new src/apis/errors.ts with getErrorMessage() and getErrorStatus() utilities
  • Added environment variable support for backend URLs via .env.local (see new .env.example)
  • New utility modules: src/apis/download.ts (file downloads), src/apis/inference.ts (result parsing), src/apis/auth.ts (token storage)

Dependencies

  • React: 18.2.0 → 19.3.1
  • react-router-dom: 6.21.1 → react-router 8.5.1 (major package rename)
  • Tailwind CSS: v3 → v4 (via @tailwindcss/vite plugin)
  • TypeScript ESLint: migrated from .eslintrc.cjs to flat config (eslint.config.js)
  • Removed: postcss, autoprefixer, prettier-plugin-tailwind (no longer needed)
  • Added: prettier-plugin-tailwindcss, @tailwindcss/vite

Code Quality

  • Improved type safety: explicit return types for hooks, better interface definitions
  • Better error handling: consistent error message extraction from backend responses
  • Removed unused variables: cleaned up destructuring in hook calls
  • Fixed Tailwind v4 compatibility: updated CSS imports and class syntax (e.g., bg-black/50 instead of bg-opacity-50)
  • Added JSDoc comments for complex functions and API behaviors

UI/UX Improvements

  • Settings screen: added onSave callback to EditableField, improved validation logic
  • Model submission: added regex validation for type and filename per backend rules
  • Password validation: updated regex to match backend's PasswordValidator (8-255 chars, special chars from @#$%^&*()-+=)
  • Avatar uploads: added AVATAR_MAX_BYTES constant (5 MB limit)
  • Inference details: added result parsing and formatted timestamps

File Structure

  • New files: src/apis/config.ts, src/apis/errors.ts, src/apis/auth.ts, src/apis/download.ts, src/apis/inference.ts, eslint.config.js, .env.example
  • Removed files: .eslintrc.cjs, tailwind.config.js, postcss.config.js
  • Updated: src/index.css (Tailwind v4 syntax), vite.config.ts (tailwind plugin)

Notable Implementation Details

  • Axios interceptor automatically attaches JWT token to requests that don't already have an Authorization header
  • Backend now uses Content-Disposition header for file downloads (with fallback filename support)
  • Inference results are parsed from raw JSON strings returned by ML service
  • Settings screen now properly handles user profile updates with optimistic UI feedback
  • Model/dataset deletion uses proper HTTP methods and error handling

Dependencies - react/react-dom 18.2 -> 19.3, @types/react(-dom) 19 - react-router-dom 6.21 -> react-router 8.5 (imports switched) - vite 5 -> 8.3, @vitejs/plugin-react 4 -> 6.2 - tailwindcss 3.4 -> 4.3 via @tailwindcss/vite (postcss/autoprefixer and tailwind.config.js removed; theme moved to CSS @theme) - eslint 8 -> 10 with flat config, typescript-eslint 8, react-hooks 7, react-refresh 0.5 - typescript 5.3 -> 6.0 (pinned ~6.0 for typescript-eslint support) - prettier 2 -> 3 with prettier-plugin-tailwindcss - axios 1.6 -> 1.21, @tanstack/react-table 8.11 -> 8.21, heroicons 2.2, react-responsive 10 - removed unused framer-motion, react-cookie, js-cookie, @types/axios - minimatch override clears the remaining dev-tool advisory (npm audit: 31 vulnerabilities -> 0) Code - Tailwind v4 class renames from the official codemod (rounded-sm, shadow-xs, outline-hidden, grow, trailing !), bg/ring-opacity -> /NN, plus base-layer compat for v3 border, placeholder, button cursor and file-input defaults - backend base URLs read from VITE_SECURITY_API_URL / VITE_USER_API_URL with the previous localhost defaults; avatar <img> URLs use them too - type fixes for React 19 / TS 6 (JSX import, RefObject, timeout type, context setter types); unused bindings removed without removing any hook call, so every request still fires - hooks no longer called after early returns in model/inference detail - response logging (which included auth headers) limited to dev builds - fix stray quotes in table pagination class names No request method, URL, header, body or timing was changed. `npm run build` and `npm run lint` now pass (previously both failed). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VtVHBcLppxfoN9CQGxJWH9
Auth - Attach the stored JWT to every dashboard-user request (axios interceptor) and sign out on 401 (tokens now live 1 h). - After POST /jwt, load GET /users/profile to get the user id and role, since the token is encrypted and cannot be decoded client-side. - Register: password rule matches the backend policy; 409 -> "Username already exists". Requests - Stop sending user_id on create/update/ML calls (caller comes from JWT). - POST /models/create: name/type/description as multipart form fields; client-side checks for the type and model file name patterns. - POST /resources/create, /files/upload-avatar, model-inference-MPAP: real FormData; avatar limited to PNG/JPEG <= 5 MiB. - model-train-eval-MPAP is POST; ML calls wait up to 330 s; pca_dim is optional for inference. - Users admin: PUT /users/update with a partial userDetail only, roles via PUT /users/{id}/roles; deletes expect 204. - Settings: profile fields, password change (PUT /users/update-password with JSON body) and account deletion are wired to the API. - Ratings: body {stars, comment}; on 409 the rating is updated with PUT /ratings/update. - Downloads use blob responses with the stored file name. - Inference details use GET /inferences/{id}; trailing-slash and malformed URLs fixed. Responses - Updates expect 200 (not 202); error messages come from the backend body (plain text or {field: message}); stars may be null; inference results parsed defensively. - Home counters show the user's model and rating counts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VtVHBcwD3R4UUkNZ18vgBP
CopilotAI lite review requested due to automatic review settings November 5, 2026 08:41
@dangdd2003
dangdd2003 merged commit a502329 into mainNov 5, 2026
1 check passed

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The change has unresolved critical build and lint configuration errors, along with an incorrect upload filename validation that blocks valid files and permits oversized names.

4 open issues
What changed in this PR

This pull request migrates the dashboard UI to the dashboard-user v2.0 API while modernizing React, React Router, Tailwind CSS, Vite, TypeScript, and ESLint tooling. It also centralizes authentication, error handling, downloads, and inference-result parsing.

Changes:

  • Updated API requests, authentication, profile/settings workflows, uploads, downloads, ratings, and inference handling for v2.0.
  • Added shared configuration, token, error, download, and inference utilities.
  • Improved validation, error handling, styling, and dependency/tooling configuration.

This pull request requires changes. The review identified build-blocking ESLint and TypeScript import issues, along with runtime and API correctness issues affecting upload validation, authentication headers, save feedback, request refetching, edit success state, and profile access.

FileDescription
vite.config.tsAdds the Tailwind Vite plugin and updates path aliasing.
tsconfig.node.jsonUpdates Node-side TypeScript configuration for Vite.
tailwind.config.jsRemoves the obsolete Tailwind v3 configuration.
src/​vite-env.d.tsDeclares Vite backend URL environment variables.
src/​screens/​users/​user-profile/​index.tsxUpdates profile API access, avatar URLs, and profile routing behavior.
src/​screens/​test/​index.tsxUpdates training and inference requests and result handling.
src/​screens/​signout/​index.tsxUpdates Tailwind button styling.
src/​screens/​settings/​index.tsxAdds profile, password, avatar, and account deletion handling.
src/​screens/​models/​model-list/​index.tsxUpdates model CRUD operations, sorting, downloads, and error handling.
src/​screens/​models/​model-details/​index.tsxUpdates model details, ratings, inference display, and error handling.
src/​screens/​inferences/​inference-details/​index.tsxAdds v2 inference retrieval and parsed result presentation.
src/​screens/​home/​index.tsxLoads profile data and calculates model and rating counts.
src/​screens/​home/​HomeData.tsRenames the home statistic from posts to ratings.
src/​screens/​explorer/​index.tsxUpdates model sorting, routing, and Tailwind classes.
src/​providers/​TestIdProvider.tsxShares the test ID state type and supports partial state.
src/​providers/​AuthProvider.tsxShares the auth state type and supports partial authentication state.
src/​main.tsxMigrates BrowserRouter to the new router package.
src/​interfaces/​IUser.tsxRemoves the password field from user data.
src/​interfaces/​IModel.tsxAllows unrated models to have nullable star averages.
src/​interfaces/​IInference.tsxAllows nullable inference resource IDs.
src/​index.cssMigrates global styles to Tailwind CSS v4 syntax.
src/​hooks/​useAxiosFunction.tsxAdds typed requests, timeout handling, cancellation, and centralized errors.
src/​hooks/​useAxios.tsxAdds typed requests, timeout handling, cancellation, refetching, and centralized errors.
src/​contexts/​TestIdContext.tsDefines shared test ID state and setter types.
src/​contexts/​AuthContext.tsDefines shared auth state and setter types.
src/​components/​table/​users/​index.tsxUpdates user deletion, profile editing, role management, and refresh behavior.
src/​components/​table/​inferences/​index.tsxParses inference results and updates deletion behavior.
src/​components/​table/​datasets/​index.tsxUpdates resource listing, deletion, and binary downloads.
src/​components/​submissionbox/​model/​index.tsxAdds model validation and multipart v2 submission.
src/​components/​submissionbox/​dataset/​index.tsxUpdates dataset multipart submission.
src/​components/​ratings/​index.tsxUpdates avatar URLs and routing imports.
src/​components/​notification/​confirm/​index.tsxUpdates modal overlay styling for Tailwind v4.
src/​components/​navigation/​sidebar/​index.tsxUses configurable avatar URLs and updated routing imports.
src/​components/​navigation/​searchbar/​index.tsxUpdates Tailwind focus and outline styling.
src/​components/​navigation/​navbar/​index.tsxUpdates router types, timeout behavior, and styling.
src/​components/​models/​model/​index.tsxHandles nullable ratings and updated routing.
src/​components/​models/​model-card-small/​index.tsxDisplays nullable ratings safely.
src/​components/​models/​model-card-large/​index.tsxDisplays nullable ratings and updates card styling.
src/​components/​models/​inference/​index.tsxUses centralized inference-result parsing.
src/​components/​editbox/​user/​index.tsxAdds role selection and updates modal styling.
src/​components/​editbox/​rating/​index.tsxUpdates rating modal styling.
src/​components/​editbox/​model/​index.tsxUpdates model editor styling.
src/​components/​authenticate/​register/​index.tsxAligns password validation and registration feedback with v2.0.
src/​components/​authenticate/​login/​index.tsxLoads profile data after authentication and improves login errors.
src/​App.tsxMigrates application routes to the new router package.
src/​apis/​UserDashboardAI.tsAdds configurable API access and JWT request/response interceptors.
src/​apis/​SecurityDashboardAI.tsUses configurable security API URLs.
src/​apis/​inference.tsAdds safe inference-result parsing utilities.
src/​apis/​errors.tsAdds centralized API error-message and status extraction.
src/​apis/​download.tsAdds reusable binary file-download support.
src/​apis/​config.tsAdds environment-configurable backend URLs.
src/​apis/​auth.tsAdds persisted authentication token helpers.
README.mdDocuments backend v2.0 requirements and environment configuration.
prettier.config.jsSwitches to the Tailwind CSS Prettier plugin.
postcss.config.jsRemoves the obsolete PostCSS configuration.
package.jsonUpdates application and development dependencies and scripts.
eslint.config.jsAdds the ESLint flat configuration.
.gitignoreIgnores local environment override files.
.eslintrc.cjsRemoves the legacy ESLint configuration.
.env.exampleDocuments configurable backend and security API URLs.

Review effort: Lite

Comment threadeslint.config.js
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import { reactRefresh } from "eslint-plugin-react-refresh";
Comment threadtsconfig.node.json
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
"types": ["node"]
Comment threadvite.config.ts
import react from "@vitejs/plugin-react";
import path from "path";
import tailwindcss from "@tailwindcss/vite";
import path from "node:path";
Comment on lines +47 to +49
const isValidType = TYPE_REGEX.test(fileType);
const fileBaseName = file ? file.name.replace(/\.[^.]*$/, "") : "";
const isValidFileName = !file || MODEL_FILE_REGEX.test(fileBaseName);
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dangdd2003@claude