This commit is contained in:
2026-03-19 16:36:41 +07:00
parent 1999395f3c
commit 7eddfb28b0
5 changed files with 14 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ services:
context: ./frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: http://localhost:4000/api
VITE_API_BASE_URL: /api
container_name: pg-control-frontend
restart: unless-stopped
depends_on:

View File

@@ -5,6 +5,15 @@ server {
root /usr/share/nginx/html;
index index.html;
location /api/ {
proxy_pass http://backend:4000/api/;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location / {
try_files $uri $uri/ /index.html;
}

View File

@@ -1,4 +1,4 @@
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "http://localhost:4000/api";
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || "/api";
async function request(path, options = {}) {
const response = await fetch(`${API_BASE_URL}${path}`, {

View File

@@ -43,10 +43,11 @@ create table if not exists table_group_tables (
);
create table if not exists role_permissions (
id uuid primary key default gen_random_uuid(),
role_id uuid not null references roles(id) on delete cascade,
permission_id uuid not null references permissions(id) on delete cascade,
table_group_id uuid references table_groups(id) on delete cascade,
primary key(role_id, permission_id, table_group_id)
unique nulls not distinct (role_id, permission_id, table_group_id)
);
create table if not exists audit_logs (