diff --git a/package.json b/package.json index 8c3fa88..b7873e5 100755 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "@mui/material": "^6.4.7", "@mui/icons-material": "^6.4.8", "reactflow": "^11.11.4", - "vite-plugin-svgr": "^4.3.0" + "vite-plugin-svgr": "^4.3.0", + "react-scripts": "^5.0.1" }, "devDependencies": { "@eslint/js": "^9.17.0", diff --git a/src/Charts/PrometheusChart.jsx b/src/Charts/PrometheusChart.jsx index d06db8e..c8a06ab 100755 --- a/src/Charts/PrometheusChart.jsx +++ b/src/Charts/PrometheusChart.jsx @@ -92,15 +92,15 @@ const PrometheusChart = ({ metricName }) => { else if (range <= 86400) step = 120; else step = 300; - const response = await axios.get('http://192.168.2.39:3000/metrics', { - params: { metric: metricName, start, end, step }, + const response = await axios.get(`${import.meta.env.VITE_BACK_URL}/metrics`, { + params: { + metric: metricName, + start, + end, + step + } }); - - /* - const response = await axios.get(`${process.env.REACT_APP_BACK_URL}/metrics`, { - params: { metric: metricName, start, end, step }, - }); */ - + const result = response.data; let metrics = Array.isArray(result) ? result : result.data || []; diff --git a/src/Components/UI/LoginModal.jsx b/src/Components/UI/LoginModal.jsx index 846f9db..ada6823 100755 --- a/src/Components/UI/LoginModal.jsx +++ b/src/Components/UI/LoginModal.jsx @@ -17,8 +17,7 @@ const LoginModal = ({ onLogin, onClose }) => { try { // Отправляем данные на бэкенд - console.log("Отправляем данные:", { username, password }); - const response = await fetch('http://192.168.2.43:3000/auth/login', { + const response = await fetch(`${import.meta.env.VITE_BACK_URL}/auth/login`, { method: 'POST', headers: { 'Content-Type': 'application/json',