mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-11 17:36:04 +00:00
fix(frontend): unused parameters
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
import cors from "cors";
|
import cors from "cors";
|
||||||
import express from "express";
|
import express from "express";
|
||||||
import { createProxyMiddleware } from "http-proxy-middleware";
|
import { createProxyMiddleware } from "http-proxy-middleware";
|
||||||
import path from "path";
|
|
||||||
import { fileURLToPath } from "url";
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
@@ -26,11 +26,11 @@ app.use(
|
|||||||
target: BACKEND_URL,
|
target: BACKEND_URL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
logLevel: "info",
|
logLevel: "info",
|
||||||
onError: (err, req, res) => {
|
onError: (err, _req, res) => {
|
||||||
console.error("Proxy error:", err.message);
|
console.error("Proxy error:", err.message);
|
||||||
res.status(500).json({ error: "Backend service unavailable" });
|
res.status(500).json({ error: "Backend service unavailable" });
|
||||||
},
|
},
|
||||||
onProxyReq: (proxyReq, req, res) => {
|
onProxyReq: (_proxyReq, req, _res) => {
|
||||||
console.log(`Proxying ${req.method} ${req.path} to ${BACKEND_URL}`);
|
console.log(`Proxying ${req.method} ${req.path} to ${BACKEND_URL}`);
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@@ -40,7 +40,7 @@ app.use(
|
|||||||
app.use(express.static(path.join(__dirname, "dist")));
|
app.use(express.static(path.join(__dirname, "dist")));
|
||||||
|
|
||||||
// Handle SPA routing - serve index.html for all routes
|
// Handle SPA routing - serve index.html for all routes
|
||||||
app.get("*", (req, res) => {
|
app.get("*", (_req, res) => {
|
||||||
res.sendFile(path.join(__dirname, "dist", "index.html"));
|
res.sendFile(path.join(__dirname, "dist", "index.html"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -529,7 +529,10 @@ const Settings = () => {
|
|||||||
type="number"
|
type="number"
|
||||||
value={formData.serverPort}
|
value={formData.serverPort}
|
||||||
onChange={(e) =>
|
onChange={(e) =>
|
||||||
handleInputChange("serverPort", parseInt(e.target.value, 10))
|
handleInputChange(
|
||||||
|
"serverPort",
|
||||||
|
parseInt(e.target.value, 10),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
className={`w-full border rounded-md shadow-sm focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-secondary-700 text-secondary-900 dark:text-white ${
|
className={`w-full border rounded-md shadow-sm focus:ring-primary-500 focus:border-primary-500 bg-white dark:bg-secondary-700 text-secondary-900 dark:text-white ${
|
||||||
errors.serverPort
|
errors.serverPort
|
||||||
|
|||||||
@@ -16,18 +16,18 @@ export default defineConfig({
|
|||||||
secure: false,
|
secure: false,
|
||||||
configure:
|
configure:
|
||||||
process.env.VITE_ENABLE_LOGGING === "true"
|
process.env.VITE_ENABLE_LOGGING === "true"
|
||||||
? (proxy, options) => {
|
? (proxy, _options) => {
|
||||||
proxy.on("error", (err, req, res) => {
|
proxy.on("error", (err, _req, _res) => {
|
||||||
console.log("proxy error", err);
|
console.log("proxy error", err);
|
||||||
});
|
});
|
||||||
proxy.on("proxyReq", (proxyReq, req, res) => {
|
proxy.on("proxyReq", (_proxyReq, req, _res) => {
|
||||||
console.log(
|
console.log(
|
||||||
"Sending Request to the Target:",
|
"Sending Request to the Target:",
|
||||||
req.method,
|
req.method,
|
||||||
req.url,
|
req.url,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
proxy.on("proxyRes", (proxyRes, req, res) => {
|
proxy.on("proxyRes", (proxyRes, req, _res) => {
|
||||||
console.log(
|
console.log(
|
||||||
"Received Response from the Target:",
|
"Received Response from the Target:",
|
||||||
proxyRes.statusCode,
|
proxyRes.statusCode,
|
||||||
|
|||||||
Reference in New Issue
Block a user