diff --git a/frontend/app/(protected)/layout.jsx b/frontend/app/(protected)/layout.jsx index 3b7fedba..c6b9b269 100755 --- a/frontend/app/(protected)/layout.jsx +++ b/frontend/app/(protected)/layout.jsx @@ -9,9 +9,10 @@ export const metadata = { title: "DMS | Protected" }; const API_BASE = (process.env.NEXT_PUBLIC_API_BASE || "").replace(/\/$/, ""); async function fetchSessionFromAPI() { - const cookieStore = await cookies(); // ✅ ต้อง await + const cookieStore = await cookies(); // ✅ ต้อง await const cookieHeader = cookieStore.toString(); - const hdrs = await headers(); // ✅ ต้อง await + + const hdrs = await headers(); // ✅ ต้อง await const hostHdr = hdrs.get("host"); const protoHdr = hdrs.get("x-forwarded-proto") || "https"; @@ -46,10 +47,7 @@ export default async function ProtectedLayout({ children }) {
- {/* System / Quick Actions */}
-
- Document Management System — LCBP3 Phase 3 -
- +
Document Management System — LCBP3 Phase 3
{can(user, "admin:view") && Admin} {can(user, "users:manage") && ผู้ใช้/บทบาท} {can(user, "health:view") && Health} diff --git a/frontend/app/layout.jsx b/frontend/app/layout.jsx index 353df1dc..d491c3e7 100755 --- a/frontend/app/layout.jsx +++ b/frontend/app/layout.jsx @@ -1,18 +1,18 @@ -// File: frontend/app/(protected)/layout.jsx +// File: frontend/app/layout.jsx import Link from "next/link"; import { redirect } from "next/navigation"; import { cookies, headers } from "next/headers"; -// ถ้ามี lib rbac เดิมอยู่ให้ใช้ต่อได้ +// ถ้ามี lib rbac เดิมอยู่ให้ใช้ต่อได้ import { can } from "@/lib/rbac"; -// แก้ title ให้ถูกสะกด +// แก้ title ให้ถูกสะกด export const metadata = { title: "DMS | Protected" }; const API_BASE = (process.env.NEXT_PUBLIC_API_BASE || "").replace(/\/$/, ""); async function fetchSessionFromAPI() { - // ดึงคุกกี้จริงจากฝั่งเซิร์ฟเวอร์ แล้วส่งต่อให้ backend - const cookieHeader = cookies().toString(); // serialize ทั้งชุด + // ดึงคุกกี้จริงจากฝั่งเซิร์ฟเวอร์ แล้วส่งต่อให้ backend + const cookieHeader = cookies().toString(); // serialize ทั้งชุด const hostHdr = headers().get("host"); const protoHdr = headers().get("x-forwarded-proto") || "https"; @@ -20,12 +20,12 @@ async function fetchSessionFromAPI() { method: "GET", headers: { Cookie: cookieHeader, - // เผื่อ backend ตรวจ origin/proto/host + // เผื่อ backend ตรวจ origin/proto/host "X-Forwarded-Host": hostHdr || "", "X-Forwarded-Proto": protoHdr, Accept: "application/json", }, - // server component ไม่ต้องใช้ credentials + // server component ไม่ต้องใช้ credentials cache: "no-store", }); @@ -41,7 +41,7 @@ async function fetchSessionFromAPI() { export default async function ProtectedLayout({ children }) { const session = await fetchSessionFromAPI(); if (!session) { - // พยายามส่ง next path กลับไปที่ /login + // พยายามส่ง next path กลับไปที่ /login redirect("/login?next=/dashboard"); } const { user } = session; @@ -53,7 +53,7 @@ export default async function ProtectedLayout({ children }) {
RBAC: {user.role}
@@ -77,13 +77,13 @@ export default async function ProtectedLayout({ children }) {
{/* System / Quick Actions */}
-
Document Management System — LCBP3 Phase 3
+
Document Management System — LCBP3 Phase 3
{can(user, "admin:view") && ( Admin )} {can(user, "users:manage") && ( - ผู้ใช้/บทบาท + ผู้ใช้/บทบาท )} {can(user, "health:view") && ( Health @@ -101,7 +101,7 @@ export default async function ProtectedLayout({ children }) { + Transmittal )} {can(user, "correspondence:create") && ( - + หนังสือสื่อสาร + + หนังสือสื่อสาร )}
@@ -109,4 +109,4 @@ export default async function ProtectedLayout({ children }) {
); -} +} \ No newline at end of file diff --git a/mariadb/data/aria_log.00000001 b/mariadb/data/aria_log.00000001 index d9756d4c..c1a5112d 100644 Binary files a/mariadb/data/aria_log.00000001 and b/mariadb/data/aria_log.00000001 differ diff --git a/mariadb/data/aria_log_control b/mariadb/data/aria_log_control index 1f027e59..39cd7eb9 100644 Binary files a/mariadb/data/aria_log_control and b/mariadb/data/aria_log_control differ diff --git a/n8n-postgres/base/16384/1247 b/n8n-postgres/base/16384/1247 index 1dedcceb..0de08dd7 100755 Binary files a/n8n-postgres/base/16384/1247 and b/n8n-postgres/base/16384/1247 differ diff --git a/n8n-postgres/base/16384/1247_vm b/n8n-postgres/base/16384/1247_vm index a66201a3..187b5db7 100755 Binary files a/n8n-postgres/base/16384/1247_vm and b/n8n-postgres/base/16384/1247_vm differ diff --git a/n8n-postgres/base/16384/1249 b/n8n-postgres/base/16384/1249 index 697e5657..309a67f8 100755 Binary files a/n8n-postgres/base/16384/1249 and b/n8n-postgres/base/16384/1249 differ diff --git a/n8n-postgres/base/16384/1249_vm b/n8n-postgres/base/16384/1249_vm index b116a347..279dd620 100755 Binary files a/n8n-postgres/base/16384/1249_vm and b/n8n-postgres/base/16384/1249_vm differ diff --git a/n8n-postgres/base/16384/1259 b/n8n-postgres/base/16384/1259 index 64a970aa..bc1b65b4 100755 Binary files a/n8n-postgres/base/16384/1259 and b/n8n-postgres/base/16384/1259 differ diff --git a/n8n-postgres/base/16384/2608 b/n8n-postgres/base/16384/2608 index f26e7262..dffdff2a 100755 Binary files a/n8n-postgres/base/16384/2608 and b/n8n-postgres/base/16384/2608 differ diff --git a/n8n-postgres/base/16384/2658 b/n8n-postgres/base/16384/2658 index c5276e45..144768e3 100755 Binary files a/n8n-postgres/base/16384/2658 and b/n8n-postgres/base/16384/2658 differ diff --git a/n8n-postgres/base/16384/2659 b/n8n-postgres/base/16384/2659 index df72abc4..7500683b 100755 Binary files a/n8n-postgres/base/16384/2659 and b/n8n-postgres/base/16384/2659 differ diff --git a/n8n-postgres/base/16384/2662 b/n8n-postgres/base/16384/2662 index 07e8897b..4c264896 100755 Binary files a/n8n-postgres/base/16384/2662 and b/n8n-postgres/base/16384/2662 differ diff --git a/n8n-postgres/base/16384/2663 b/n8n-postgres/base/16384/2663 index 7bc3e5b4..eb0c53d6 100755 Binary files a/n8n-postgres/base/16384/2663 and b/n8n-postgres/base/16384/2663 differ diff --git a/n8n-postgres/base/16384/2673 b/n8n-postgres/base/16384/2673 index 302d91fc..8634ecd7 100755 Binary files a/n8n-postgres/base/16384/2673 and b/n8n-postgres/base/16384/2673 differ diff --git a/n8n-postgres/base/16384/2674 b/n8n-postgres/base/16384/2674 index a759e4d1..cdbf6c8c 100755 Binary files a/n8n-postgres/base/16384/2674 and b/n8n-postgres/base/16384/2674 differ diff --git a/n8n-postgres/base/16384/2703 b/n8n-postgres/base/16384/2703 index 5947db96..9325e957 100755 Binary files a/n8n-postgres/base/16384/2703 and b/n8n-postgres/base/16384/2703 differ diff --git a/n8n-postgres/base/16384/2704 b/n8n-postgres/base/16384/2704 index 90d821b0..ca1a1f2f 100755 Binary files a/n8n-postgres/base/16384/2704 and b/n8n-postgres/base/16384/2704 differ diff --git a/n8n-postgres/base/16384/3455 b/n8n-postgres/base/16384/3455 index 3a396ae7..2245f2f1 100755 Binary files a/n8n-postgres/base/16384/3455 and b/n8n-postgres/base/16384/3455 differ diff --git a/n8n-postgres/base/16384/pg_internal.init b/n8n-postgres/base/16384/pg_internal.init index 73c3794a..adfa2430 100644 Binary files a/n8n-postgres/base/16384/pg_internal.init and b/n8n-postgres/base/16384/pg_internal.init differ diff --git a/n8n-postgres/global/pg_control b/n8n-postgres/global/pg_control index a06487a7..c7e88782 100755 Binary files a/n8n-postgres/global/pg_control and b/n8n-postgres/global/pg_control differ diff --git a/n8n-postgres/global/pg_internal.init b/n8n-postgres/global/pg_internal.init index d6b816b9..e873d625 100644 Binary files a/n8n-postgres/global/pg_internal.init and b/n8n-postgres/global/pg_internal.init differ diff --git a/n8n-postgres/pg_wal/000000010000000000000003 b/n8n-postgres/pg_wal/000000010000000000000003 index 69cdd357..33fcaf71 100755 Binary files a/n8n-postgres/pg_wal/000000010000000000000003 and b/n8n-postgres/pg_wal/000000010000000000000003 differ diff --git a/n8n-postgres/pg_xact/0000 b/n8n-postgres/pg_xact/0000 index 19330986..37548c42 100755 Binary files a/n8n-postgres/pg_xact/0000 and b/n8n-postgres/pg_xact/0000 differ diff --git a/n8n-postgres/postmaster.pid b/n8n-postgres/postmaster.pid index 9757b315..a16f1033 100644 --- a/n8n-postgres/postmaster.pid +++ b/n8n-postgres/postmaster.pid @@ -1,6 +1,6 @@ 1 /var/lib/postgresql/data -1759295885 +1759310848 5432 /var/run/postgresql * diff --git a/npm/data/database.sqlite b/npm/data/database.sqlite index c6bdb3d4..0e2e863d 100644 Binary files a/npm/data/database.sqlite and b/npm/data/database.sqlite differ diff --git a/npm/data/nginx/proxy_host/3.conf b/npm/data/nginx/proxy_host/3.conf index 8ce9ed43..314ce25b 100644 --- a/npm/data/nginx/proxy_host/3.conf +++ b/npm/data/nginx/proxy_host/3.conf @@ -272,4 +272,3 @@ if ($request_method = OPTIONS) { # Custom include /data/nginx/custom/server_proxy[.]conf; } - diff --git a/pgadmin/sessions/0d9fc6f2-168c-4752-a656-00dd643c6b3b b/pgadmin/sessions/0d9fc6f2-168c-4752-a656-00dd643c6b3b deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/0dcc691b-e392-476c-b332-e92e128a9895 b/pgadmin/sessions/0dcc691b-e392-476c-b332-e92e128a9895 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/2463c2d1-43a8-472a-b83c-ff5c4f95cc2a b/pgadmin/sessions/2463c2d1-43a8-472a-b83c-ff5c4f95cc2a deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/2e6be15e-5eef-4bb0-98be-aebd50dfda0a b/pgadmin/sessions/2e6be15e-5eef-4bb0-98be-aebd50dfda0a deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/56ea3d97-400e-4a6b-af5c-bcb55d0d0256 b/pgadmin/sessions/56ea3d97-400e-4a6b-af5c-bcb55d0d0256 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/0207baac-b05c-434b-8d63-f66e8b85f79f b/pgadmin/sessions/5ebfa0a5-f54b-4eb2-91b1-517d3914ce25 similarity index 100% rename from pgadmin/sessions/0207baac-b05c-434b-8d63-f66e8b85f79f rename to pgadmin/sessions/5ebfa0a5-f54b-4eb2-91b1-517d3914ce25 diff --git a/pgadmin/sessions/03681368-5502-4e53-af74-2da169acd6d2 b/pgadmin/sessions/5f9cee35-030a-4578-8e5c-df1e08829e94 similarity index 100% rename from pgadmin/sessions/03681368-5502-4e53-af74-2da169acd6d2 rename to pgadmin/sessions/5f9cee35-030a-4578-8e5c-df1e08829e94 diff --git a/pgadmin/sessions/6e752208-4f43-4be6-b868-80d7a217c26e b/pgadmin/sessions/6e752208-4f43-4be6-b868-80d7a217c26e deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/6ecebed9-3081-4752-9828-ffd10ab58b6e b/pgadmin/sessions/6ecebed9-3081-4752-9828-ffd10ab58b6e deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/8285d306-6b9d-4601-accc-c9d143bd8e41 b/pgadmin/sessions/8285d306-6b9d-4601-accc-c9d143bd8e41 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/8858bdc7-4d67-4dbf-8850-dd7641ca0306 b/pgadmin/sessions/8858bdc7-4d67-4dbf-8850-dd7641ca0306 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/abeb1dd6-9b64-45e6-8227-63aa5357ee6c b/pgadmin/sessions/abeb1dd6-9b64-45e6-8227-63aa5357ee6c deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/06cbb1a3-4ba1-4959-a8b3-4ff068a78032 b/pgadmin/sessions/ad449f0a-8a01-466d-9ae5-b2cd329db389 similarity index 100% rename from pgadmin/sessions/06cbb1a3-4ba1-4959-a8b3-4ff068a78032 rename to pgadmin/sessions/ad449f0a-8a01-466d-9ae5-b2cd329db389 diff --git a/pgadmin/sessions/c8fe876a-9dc9-4671-869f-933152188034 b/pgadmin/sessions/c8fe876a-9dc9-4671-869f-933152188034 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/ccca0374-d8ed-4f38-8285-82e817619c86 b/pgadmin/sessions/ccca0374-d8ed-4f38-8285-82e817619c86 deleted file mode 100644 index e69de29b..00000000 diff --git a/pgadmin/sessions/08a40fa5-1ad1-4d18-86ed-6cb814fe2512 b/pgadmin/sessions/fe15c489-c832-4dc3-b06e-1506d169a4eb similarity index 100% rename from pgadmin/sessions/08a40fa5-1ad1-4d18-86ed-6cb814fe2512 rename to pgadmin/sessions/fe15c489-c832-4dc3-b06e-1506d169a4eb