Compare commits

...

2 Commits

Author SHA1 Message Date
admin
4cb7801fe8 feat: แก้ frontend logi npages 2025-09-26 16:51:36 +07:00
admin
9a9d0955a2 update: vscode config 2025-09-26 08:14:16 +07:00
4 changed files with 59 additions and 39 deletions

View File

@@ -1,8 +1,11 @@
{ {
"folders": [ "folders": [
{ {
"path": "." "path": "."
} },
], {
"settings": {} "path": "S:/Documents"
}
],
"settings": {}
} }

View File

@@ -25,10 +25,10 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '2.0' cpus: "2.0"
memory: 4G memory: 4G
reservations: reservations:
cpus: '0.5' cpus: "0.5"
memory: 1G memory: 1G
environment: environment:
MYSQL_ROOT_PASSWORD: "Center#2025" MYSQL_ROOT_PASSWORD: "Center#2025"
@@ -45,7 +45,8 @@ services:
- "/share/Container/dms/mariadb/init:/docker-entrypoint-initdb.d:ro" - "/share/Container/dms/mariadb/init:/docker-entrypoint-initdb.d:ro"
- "/share/dms-data/mariadb/backup:/backup" - "/share/dms-data/mariadb/backup:/backup"
healthcheck: healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -pCenter#2025 || exit 1"] test:
["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -pCenter#2025 || exit 1"]
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 15 retries: 15
@@ -62,10 +63,10 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '2.0' cpus: "2.0"
memory: 1G memory: 1G
reservations: reservations:
cpus: '0.25' cpus: "0.25"
memory: 256M memory: 256M
environment: environment:
TZ: "Asia/Bangkok" TZ: "Asia/Bangkok"
@@ -120,15 +121,15 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '1.0' cpus: "1.0"
memory: 1G memory: 1G
environment: environment:
TZ: "Asia/Bangkok" TZ: "Asia/Bangkok"
NODE_ENV: "development" NODE_ENV: "development"
NEXT_PUBLIC_API_BASE: "/api" # NEXT_PUBLIC_API_BASE: "/api"
CHOKIDAR_USEPOLLING: "1" CHOKIDAR_USEPOLLING: "1"
WATCHPACK_POLLING: "true" WATCHPACK_POLLING: "true"
NEXT_PUBLIC_API_BASE=https: "//lcbp3.np-dms.work/api" NEXT_PUBLIC_API_BASE: "https://lcbp3.np-dms.work/api"
NEXT_TELEMETRY_DISABLED: "1" NEXT_TELEMETRY_DISABLED: "1"
expose: expose:
- "3000" - "3000"
@@ -157,7 +158,7 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '0.25' cpus: "0.25"
memory: 256M memory: 256M
environment: environment:
TZ: "Asia/Bangkok" TZ: "Asia/Bangkok"
@@ -192,10 +193,10 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '1.0' cpus: "1.0"
memory: 2G memory: 2G
reservations: reservations:
cpus: '0.5' cpus: "0.5"
memory: 1G memory: 1G
environment: environment:
POSTGRES_DB: "n8n" POSTGRES_DB: "n8n"
@@ -218,7 +219,7 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '0.25' cpus: "0.25"
memory: 256M memory: 256M
environment: environment:
PGADMIN_DEFAULT_EMAIL: "center.pslcp3@gmail.com" PGADMIN_DEFAULT_EMAIL: "center.pslcp3@gmail.com"
@@ -246,10 +247,10 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '1.5' cpus: "1.5"
memory: 2G memory: 2G
reservations: reservations:
cpus: '0.25' cpus: "0.25"
memory: 512M memory: 512M
environment: environment:
TZ: "Asia/Bangkok" TZ: "Asia/Bangkok"
@@ -300,12 +301,12 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '1.0' # 50% CPU cpus: "1.0" # 50% CPU
memory: 512M memory: 512M
ports: ports:
- "80:80" # HTTP - "80:80" # HTTP
- "443:443" # HTTPS - "443:443" # HTTPS
- "81:81" # NPM Admin UI - "81:81" # NPM Admin UI
environment: environment:
TZ: "Asia/Bangkok" TZ: "Asia/Bangkok"
networks: networks:
@@ -314,7 +315,7 @@ services:
volumes: volumes:
- "/share/Container/dms/npm/data:/data" - "/share/Container/dms/npm/data:/data"
- "/share/Container/dms/npm/letsencrypt:/etc/letsencrypt" - "/share/Container/dms/npm/letsencrypt:/etc/letsencrypt"
- "/share/Container/dms/npm/custom:/data/nginx/custom" # <-- สำคัญสำหรับ http_top.conf - "/share/Container/dms/npm/custom:/data/nginx/custom" # <-- สำคัญสำหรับ http_top.conf
- "/share/Container/dms/landing:/data/landing:ro" - "/share/Container/dms/landing:/data/landing:ro"
depends_on: depends_on:
backend: backend:
@@ -336,7 +337,7 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '0.50' # 50% CPU cpus: "0.50" # 50% CPU
memory: 128M memory: 128M
networks: [dmsnet] networks: [dmsnet]
volumes: volumes:

View File

@@ -13,7 +13,7 @@ export default function LoginPage() {
setErr(""); setErr("");
setIsLoading(true); setIsLoading(true);
try { try {
const res = await fetch(`${API_BASE}/api/auth/login`, { const res = await fetch(`${API_BASE}/auth/login`, {
method: "POST", method: "POST",
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
body: JSON.stringify({ username, password }), body: JSON.stringify({ username, password }),
@@ -45,15 +45,25 @@ export default function LoginPage() {
} }
return ( return (
<div className="grid min-h-screen place-items-center" style={{background: 'linear-gradient(to bottom right, #00c6ff, #0072ff)'}}> <div
<form onSubmit={onSubmit} className="w-full max-w-sm p-8 space-y-4 shadow-lg bg-white/20 backdrop-blur-md rounded-3xl"> className="grid min-h-screen place-items-center"
<div className="text-2xl font-bold text-center text-white">เขาสระบบ</div> style={{
background: "linear-gradient(to bottom right, #00c6ff, #0072ff)",
}}
>
<form
onSubmit={onSubmit}
className="w-full max-w-sm p-8 space-y-4 shadow-lg bg-white/20 backdrop-blur-md rounded-3xl"
>
<div className="text-2xl font-bold text-center text-white">
เขาสระบบ
</div>
<input <input
disabled={isLoading} disabled={isLoading}
className="w-full p-3 text-white placeholder-gray-200 border bg-white/30 border-white/30 rounded-xl focus:outline-none focus:ring-2 focus:ring-white/50 disabled:opacity-50" className="w-full p-3 text-white placeholder-gray-200 border bg-white/30 border-white/30 rounded-xl focus:outline-none focus:ring-2 focus:ring-white/50 disabled:opacity-50"
placeholder="ชื่อผู้ใช้" placeholder="ชื่อผู้ใช้"
value={username} value={username}
onChange={e=>setUsername(e.target.value)} onChange={(e) => setUsername(e.target.value)}
/> />
<input <input
type="password" type="password"
@@ -61,15 +71,17 @@ export default function LoginPage() {
className="w-full p-3 text-white placeholder-gray-200 border bg-white/30 border-white/30 rounded-xl focus:outline-none focus:ring-2 focus:ring-white/50 disabled:opacity-50" className="w-full p-3 text-white placeholder-gray-200 border bg-white/30 border-white/30 rounded-xl focus:outline-none focus:ring-2 focus:ring-white/50 disabled:opacity-50"
placeholder="รหัสผ่าน" placeholder="รหัสผ่าน"
value={password} value={password}
onChange={e=>setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
/> />
{err && <div className="text-sm text-center text-yellow-300">{err}</div>} {err && (
<div className="text-sm text-center text-yellow-300">{err}</div>
)}
<button <button
type="submit" type="submit"
disabled={isLoading} disabled={isLoading}
className="w-full p-3 font-bold text-white transition-colors duration-300 bg-blue-500 rounded-xl hover:bg-blue-600 disabled:bg-blue-400 disabled:cursor-not-allowed" className="w-full p-3 font-bold text-white transition-colors duration-300 bg-blue-500 rounded-xl hover:bg-blue-600 disabled:bg-blue-400 disabled:cursor-not-allowed"
> >
{isLoading ? 'กำลังเข้าสู่ระบบ...' : 'เข้าสู่ระบบ'} {isLoading ? "กำลังเข้าสู่ระบบ..." : "เข้าสู่ระบบ"}
</button> </button>
</form> </form>
</div> </div>

View File

@@ -59,6 +59,10 @@ DROP TABLE IF EXISTS global_default_roles;
CREATE TABLE users ( CREATE TABLE users (
user_id INT AUTO_INCREMENT PRIMARY KEY, user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100) NOT NULL UNIQUE, username VARCHAR(100) NOT NULL UNIQUE,
first_name VARCHAR(100) NULL DEFAULT NULL,
last_name VARCHAR(100) NULL DEFAULT NULL,
email VARCHAR(255) NULL UNIQUE,
line_id VARCHAR(255) NULL,
password_hash VARCHAR(255) NOT NULL, password_hash VARCHAR(255) NOT NULL,
email VARCHAR(255) NULL UNIQUE, email VARCHAR(255) NULL UNIQUE,
line_id VARCHAR(255) NULL, line_id VARCHAR(255) NULL,