feat: แก้ frontend logi npages
This commit is contained in:
@@ -21,15 +21,15 @@ services:
|
||||
image: mariadb:10.11
|
||||
container_name: dms_mariadb
|
||||
stdin_open: true
|
||||
tty: true
|
||||
tty: true
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
cpus: "2.0"
|
||||
memory: 4G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 1G
|
||||
cpus: "0.5"
|
||||
memory: 1G
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: "Center#2025"
|
||||
MYSQL_DATABASE: "dms"
|
||||
@@ -45,7 +45,8 @@ services:
|
||||
- "/share/Container/dms/mariadb/init:/docker-entrypoint-initdb.d:ro"
|
||||
- "/share/dms-data/mariadb/backup:/backup"
|
||||
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
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@@ -56,16 +57,16 @@ services:
|
||||
container_name: dms_backend
|
||||
stdin_open: true
|
||||
tty: true
|
||||
user: "node"
|
||||
user: "node"
|
||||
# user: "1000:1000"
|
||||
working_dir: /app
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
cpus: "2.0"
|
||||
memory: 1G
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
cpus: "0.25"
|
||||
memory: 256M
|
||||
environment:
|
||||
TZ: "Asia/Bangkok"
|
||||
@@ -120,15 +121,15 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
cpus: "1.0"
|
||||
memory: 1G
|
||||
environment:
|
||||
TZ: "Asia/Bangkok"
|
||||
NODE_ENV: "development"
|
||||
NEXT_PUBLIC_API_BASE: "/api"
|
||||
# NEXT_PUBLIC_API_BASE: "/api"
|
||||
CHOKIDAR_USEPOLLING: "1"
|
||||
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"
|
||||
expose:
|
||||
- "3000"
|
||||
@@ -157,7 +158,7 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.25'
|
||||
cpus: "0.25"
|
||||
memory: 256M
|
||||
environment:
|
||||
TZ: "Asia/Bangkok"
|
||||
@@ -192,10 +193,10 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
cpus: "1.0"
|
||||
memory: 2G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
cpus: "0.5"
|
||||
memory: 1G
|
||||
environment:
|
||||
POSTGRES_DB: "n8n"
|
||||
@@ -218,7 +219,7 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.25'
|
||||
cpus: "0.25"
|
||||
memory: 256M
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: "center.pslcp3@gmail.com"
|
||||
@@ -246,10 +247,10 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.5'
|
||||
cpus: "1.5"
|
||||
memory: 2G
|
||||
reservations:
|
||||
cpus: '0.25'
|
||||
cpus: "0.25"
|
||||
memory: 512M
|
||||
environment:
|
||||
TZ: "Asia/Bangkok"
|
||||
@@ -300,12 +301,12 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0' # 50% CPU
|
||||
cpus: "1.0" # 50% CPU
|
||||
memory: 512M
|
||||
ports:
|
||||
- "80:80" # HTTP
|
||||
- "443:443" # HTTPS
|
||||
- "81:81" # NPM Admin UI
|
||||
- "80:80" # HTTP
|
||||
- "443:443" # HTTPS
|
||||
- "81:81" # NPM Admin UI
|
||||
environment:
|
||||
TZ: "Asia/Bangkok"
|
||||
networks:
|
||||
@@ -314,7 +315,7 @@ services:
|
||||
volumes:
|
||||
- "/share/Container/dms/npm/data:/data"
|
||||
- "/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"
|
||||
depends_on:
|
||||
backend:
|
||||
@@ -336,7 +337,7 @@ services:
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50' # 50% CPU
|
||||
cpus: "0.50" # 50% CPU
|
||||
memory: 128M
|
||||
networks: [dmsnet]
|
||||
volumes:
|
||||
@@ -346,4 +347,4 @@ networks:
|
||||
giteanet:
|
||||
external: true
|
||||
name: gitnet
|
||||
# docker network connect git_gitea_net dms_npm
|
||||
# docker network connect git_gitea_net dms_npm
|
||||
|
||||
@@ -13,7 +13,7 @@ export default function LoginPage() {
|
||||
setErr("");
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const res = await fetch(`${API_BASE}/api/auth/login`, {
|
||||
const res = await fetch(`${API_BASE}/auth/login`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ username, password }),
|
||||
@@ -45,15 +45,25 @@ export default function LoginPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="grid min-h-screen place-items-center" 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>
|
||||
<div
|
||||
className="grid min-h-screen place-items-center"
|
||||
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
|
||||
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"
|
||||
placeholder="ชื่อผู้ใช้"
|
||||
value={username}
|
||||
onChange={e=>setUsername(e.target.value)}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
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"
|
||||
placeholder="รหัสผ่าน"
|
||||
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
|
||||
type="submit"
|
||||
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"
|
||||
>
|
||||
{isLoading ? 'กำลังเข้าสู่ระบบ...' : 'เข้าสู่ระบบ'}
|
||||
{isLoading ? "กำลังเข้าสู่ระบบ..." : "เข้าสู่ระบบ"}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -59,6 +59,10 @@ DROP TABLE IF EXISTS global_default_roles;
|
||||
CREATE TABLE users (
|
||||
user_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
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,
|
||||
email VARCHAR(255) NULL UNIQUE,
|
||||
line_id VARCHAR(255) NULL,
|
||||
|
||||
Reference in New Issue
Block a user