Explorar el Código

Created demo site

debrand
Harry Groves hace 1 mes
padre
commit
68d1627fd2
Se han modificado 5 ficheros con 13 adiciones y 40 borrados
  1. +3
    -3
      .env.production
  2. +3
    -16
      src/components/LoginPage/LoginPage.tsx
  3. +2
    -1
      src/components/NavigationContent/NavigationContent.tsx
  4. +0
    -20
      src/components/PoSearch/PoSearch.tsx
  5. +5
    -0
      src/middleware.ts

+ 3
- 3
.env.production Ver fichero

@@ -1,5 +1,5 @@
API_URL=http://10.10.0.81:8090/api
API_URL=http://127.0.0.1:8090/api
NEXTAUTH_SECRET=secret
NEXTAUTH_URL=http://10.10.0.81:3000
NEXT_PUBLIC_API_URL=http://10.10.0.81:8090/api
NEXTAUTH_URL=http://127.0.0.1:3000
NEXT_PUBLIC_API_URL=http://127.0.0.1:8090/api
NEXT_PUBLIC_QC_MEASUREMENT_ENABLED=false

+ 3
- 16
src/components/LoginPage/LoginPage.tsx Ver fichero

@@ -16,24 +16,11 @@ const LoginPage = () => {
lg={6}
sx={{
display: { xs: "none", sm: "block" },
backgroundColor: "#c5e58b",
backgroundImage: "linear-gradient(135deg, rgba(59,130,246,0.15) 0%, #f1f5f9 45%, #f8fafc 100%)",
backgroundColor: "#f8fafc",
minHeight: { xs: 0, sm: "100vh" },
}}
>
<Box
sx={{
width: "100%",
height: "100%",
minHeight: { sm: "100vh" },
backgroundImage: "url('logo/HomepageLogo.png')",
backgroundRepeat: "no-repeat",
backgroundPosition: "center",
backgroundSize: "contain",
maxWidth: 960,
margin: "0 auto",
}}
/>
</Grid>
/>
<Grid
item
xs={12}


+ 2
- 1
src/components/NavigationContent/NavigationContent.tsx Ver fichero

@@ -244,7 +244,7 @@ const NavigationContent: React.FC = () => {
labelKey: "nav.m18Sync",
path: "/m18Syn",
requiredAbility: [AUTH.M18_SYNC, AUTH.ADMIN],
isHidden: false,
isHidden: true,
},
{
id: "nav.chartReports",
@@ -416,6 +416,7 @@ const NavigationContent: React.FC = () => {
icon: <Science />,
labelKey: "nav.settings.importTesting",
path: "/settings/m18ImportTesting",
isHidden: true,
},
{
id: "nav.settings.importExcel",


+ 0
- 20
src/components/PoSearch/PoSearch.tsx Ver fichero

@@ -294,17 +294,6 @@ const PoSearch: React.FC<Props> = ({
if (typeof v === "string" && (v as string).trim() === "") return;
cleanedQuery[k] = String(v);
});
const searchedCodeRaw = (filterArgs as any)?.code;
const searchedCode =
typeof searchedCodeRaw === "string" ? searchedCodeRaw.trim() : "";
const isM18PoCode =
searchedCode.length > 14 &&
(searchedCode.startsWith("PP") || searchedCode.startsWith("PF"));
if (isM18PoCode) {
cleanedQuery.refreshFromM18 = "true";
setIsM18LookupLoading(true);
setAutoSyncStatus("載入中...");
}

try {
const baseListResp = await clientAuthFetch(
@@ -320,17 +309,8 @@ const PoSearch: React.FC<Props> = ({
const records: PoResult[] = res.records ?? [];
setFilteredPo(records);
setTotalCount(res.total ?? 0);
if (isM18PoCode) {
const refreshAction = baseListResp.headers.get("X-M18-Po-Refresh");
if (refreshAction === "synced") {
setAutoSyncStatus(records.length > 0 ? "已從M18同步PO" : "找不到PO");
} else {
setAutoSyncStatus(null);
}
}
} catch (e) {
console.error("PO list fetch error:", e);
if (isM18PoCode) setAutoSyncStatus("找不到PO");
} finally {
setIsM18LookupLoading(false);
autoSyncInProgressRef.current = false;


+ 5
- 0
src/middleware.ts Ver fichero

@@ -26,6 +26,11 @@ export default async function middleware(
req: NextRequestWithAuth,
event: NextFetchEvent,
) {
const blockedDemoPaths = ["/m18Syn", "/settings/m18ImportTesting", "/testing", "/jo/testing"];
if (blockedDemoPaths.some((path) => req.nextUrl.pathname === path || req.nextUrl.pathname.startsWith(`${path}/`))) {
return NextResponse.redirect(new URL("/dashboard", req.url));
}

// Handle language parameters
const langPref = req.nextUrl.searchParams.get(LANG_QUERY_PARAM);
if (langPref) {


Cargando…
Cancelar
Guardar