fix(spa): fallback font-serif to Prompt for Thai characters

This commit is contained in:
Your Name committed 2026-06-14 09:28:42 -04:00
1 parent eac45dd4a7
commit e77ac4befa
4 files changed
+51 -2

No files matched your search

+30 -1
View File
@@ -7,7 +7,7 @@ import {
import axios from "axios";
import * as FormData from "form-data";
const BACKEND_URL = "http://localhost:3051/api";
let BACKEND_URL = "http://localhost:3051/api";
const ADMIN_USERNAME = process.env.ADMIN_USERNAME || "admin";
const ADMIN_PASSWORD = process.env.ADMIN_PASSWORD || "homaroma123"; // เปลี่ยนรหัสผ่านตรงนี้ให้ตรงกับ Production ด้วยนะครับ
@@ -58,6 +58,17 @@ const server = new Server(
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: [
{
name: "set_target_environment",
description: "Switch the target environment for the MCP server (local or production)",
inputSchema: {
type: "object",
properties: {
env: { type: "string", enum: ["local", "production"] }
},
required: ["env"]
}
},
{
name: "ping_backend",
description: "Ping the backend to verify connection and authentication",
@@ -433,6 +444,24 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
try {
switch (request.params.name) {
case "set_target_environment": {
const env = params.env;
if (env === "production") {
BACKEND_URL = "https://api.homaroma.shop/api";
} else {
BACKEND_URL = "http://localhost:3051/api";
}
api.defaults.baseURL = BACKEND_URL;
authToken = ""; // reset token so it logs in again on next request
return {
content: [
{
type: "text",
text: `✅ MCP Server target environment switched to [${env}]. Base URL is now: ${BACKEND_URL}`
}
]
};
}
case "ping_backend": {
const res = await api.get("/products?limit=1");
return { content: [{ type: "text", text: `Connection successful!` }] };