feat: Enhance server security and performance by adding helmet for security headers, implementing rate limiting, and centralizing error handling; update frontend API calls to use a dedicated api module for consistency
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 4m37s

This commit is contained in:
2025-08-11 19:11:30 +07:00
parent 087e0eb491
commit 6afd43f9e8
13 changed files with 98 additions and 358 deletions
+4 -4
View File
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import axios from 'axios';
import api from '../lib/api.js';
function LockBanner({ resource, className = '' }) {
const [status, setStatus] = useState({ locked: false });
@@ -15,7 +15,7 @@ function LockBanner({ resource, className = '' }) {
const fetchStatus = async () => {
try {
const res = await axios.get(`/api/locks/${resource}`);
const res = await api.get(`/locks/${resource}`);
setStatus(res.data || { locked: false });
} catch {
// ignore
@@ -31,7 +31,7 @@ function LockBanner({ resource, className = '' }) {
const acquireOrRefresh = async () => {
setLoading(true);
try {
const res = await axios.post(`/api/locks/${resource}`, { owner, ttlSeconds: 180 });
const res = await api.post(`/locks/${resource}`, { owner, ttlSeconds: 180 });
setStatus(res.data || { locked: true, owner, expiresAt: Date.now() + 180_000 });
} catch {
// ignore
@@ -43,7 +43,7 @@ function LockBanner({ resource, className = '' }) {
const release = async () => {
setLoading(true);
try {
await axios.delete(`/api/locks/${resource}`);
await api.delete(`/locks/${resource}`);
setStatus({ locked: false });
} catch {
// ignore