From 112757d5a601e4ce9fb3c780e333528348df0f6f Mon Sep 17 00:00:00 2001 From: The-Coding-Kiddo Date: Tue, 1 Jul 2025 16:17:03 +0300 Subject: [PATCH] changed ip for testing --- README.md | 2 +- src/components/Layout/Sidebar.tsx | 9 ++++- src/components/Migration/SummaryStats.tsx | 2 +- src/components/Migration/hooks.ts | 2 +- src/pages/Home.tsx | 49 +++++++++++------------ src/pages/Maintenance.tsx | 2 +- src/pages/Migration.tsx | 6 +-- src/pages/MonitoringSystem.tsx | 2 +- src/pages/Temperature.tsx | 4 +- src/pages/Test.tsx | 2 +- src/services/monitoringService.ts | 2 +- src/services/stressService.ts | 2 +- 12 files changed, 45 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 5848cdb..b63287c 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ npm run preview ## API Configuration -The application connects to an API server at `http://141.196.83.136:8003`. Make sure this endpoint is accessible from your network. +The application connects to an API server at `http://10.150.1.167:8003`. Make sure this endpoint is accessible from your network. ## Environment Variables diff --git a/src/components/Layout/Sidebar.tsx b/src/components/Layout/Sidebar.tsx index a874732..2a1073c 100644 --- a/src/components/Layout/Sidebar.tsx +++ b/src/components/Layout/Sidebar.tsx @@ -53,12 +53,15 @@ const StyledListItemButton = styled(ListItemButton)(({ theme }) => ({ fontSize: '0.9rem', color: theme.palette.text.secondary, transition: 'all 0.2s ease', - '&.Mui-selected': { background: '#028a4a', color: '#ffffff', + '& .MuiListItemIcon-root': { + color: '#ffffff', + }, '& .MuiListItemIcon-root svg': { stroke: '#ffffff', + color: '#ffffff', }, '& .MuiListItemText-primary': { color: '#ffffff', @@ -67,8 +70,12 @@ const StyledListItemButton = styled(ListItemButton)(({ theme }) => ({ '&:hover': { backgroundColor: '#f8f8f8', color: '#028a4a', + '& .MuiListItemIcon-root': { + color: '#028a4a', + }, '& .MuiListItemIcon-root svg': { stroke: '#028a4a', + color: '#028a4a', }, '& .MuiListItemText-primary': { color: '#028a4a', diff --git a/src/components/Migration/SummaryStats.tsx b/src/components/Migration/SummaryStats.tsx index abab3b0..e0bbc4c 100644 --- a/src/components/Migration/SummaryStats.tsx +++ b/src/components/Migration/SummaryStats.tsx @@ -21,7 +21,7 @@ interface VMPlacementData { }>; } -const ENDPOINT = 'http://141.196.83.136:8003/prom/get_chart_data/vm_placement'; +const ENDPOINT = 'http://10.150.1.167:8003/prom/get_chart_data/vm_placement'; const REFRESH_INTERVAL = 30000; // 30 seconds const SummaryStats: React.FC = () => { diff --git a/src/components/Migration/hooks.ts b/src/components/Migration/hooks.ts index cd29966..ee23aad 100644 --- a/src/components/Migration/hooks.ts +++ b/src/components/Migration/hooks.ts @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { VMDetails, GainBeforeData, MigrationAdviceData } from './types'; -const API_BASE_URL = 'http://141.196.83.136:8003'; +const API_BASE_URL = 'http://10.150.1.167:8003'; const REFRESH_INTERVAL = 30000; // 30 seconds interface GainAfterData { diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 5cd154f..390f4ac 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -46,19 +46,16 @@ import { monitoringService, MonitoringStatus } from '../services/monitoringServi import DebugConsole from '../components/DebugConsole'; import MonitoringSystem from './MonitoringSystem'; +// Professional, consistent card style (no animation) const StyledCard = styled(Paper)(({ theme }) => ({ - borderRadius: '0.357rem', + borderRadius: '0.6rem', padding: theme.spacing(3), - height: '100%', + minHeight: 260, + backgroundColor: theme.palette.background.paper, + boxShadow: theme.shadows[2], display: 'flex', flexDirection: 'column', - backgroundColor: theme.palette.background.paper, - transition: 'transform 0.2s, box-shadow 0.2s', - boxShadow: theme.shadows[3], - '&:hover': { - transform: 'translateY(-4px)', - boxShadow: theme.shadows[8], - }, + justifyContent: 'flex-start', })); const StyledSelect = styled(Select)(({ theme }) => ({ @@ -71,14 +68,16 @@ const StyledSelect = styled(Select)(({ theme }) => ({ }, })); +// Professional header style const SectionTitle = styled(Typography)(({ theme }) => ({ display: 'flex', alignItems: 'center', gap: theme.spacing(1), marginBottom: theme.spacing(3), - color: theme.palette.text.secondary, + color: theme.palette.text.primary, fontWeight: 700, - fontFamily: theme.typography.fontFamily, + fontFamily: 'Montserrat, Helvetica, Arial, serif', + fontSize: theme.typography.h6.fontSize, // Use theme's h6 size (usually 1.125rem) })); const IconWrapper = styled(Box)(({ theme }) => ({ @@ -503,12 +502,12 @@ const Home = () => { View Optimization Selection - + {/* Environmental Temperature Section */} - - - - + + + + Environmental Temperature @@ -569,9 +568,9 @@ const Home = () => { {/* Preventive Maintenance Section */} - - - + + + Preventive Maintenance @@ -633,9 +632,9 @@ const Home = () => { {/* Migration Advice Section */} - - - + + + Migration Advice @@ -746,10 +745,10 @@ const Home = () => { {/* Weight Configuration Section */} - - + + - + Weight Of Sustainability Criteria diff --git a/src/pages/Maintenance.tsx b/src/pages/Maintenance.tsx index 991ec38..6f8f48c 100644 --- a/src/pages/Maintenance.tsx +++ b/src/pages/Maintenance.tsx @@ -24,7 +24,7 @@ const Maintenance = () => { useEffect(() => { const fetchData = async () => { try { - const response = await fetch('http://141.196.83.136:8003/prom/get_chart_data/maintenance/20'); + const response = await fetch('http://10.150.1.167:8003/prom/get_chart_data/maintenance/20'); const result = await response.json(); if (result.data && result.data.length > 0) { diff --git a/src/pages/Migration.tsx b/src/pages/Migration.tsx index f0475ea..9b6ee5e 100644 --- a/src/pages/Migration.tsx +++ b/src/pages/Migration.tsx @@ -31,7 +31,7 @@ import VerifiedMigration from '../components/Migration/VerifiedMigration'; import { useMigrationData, useGainAfterData } from '../components/Migration/hooks'; // Constants -const API_BASE_URL = 'http://141.196.83.136:8003'; +const API_BASE_URL = 'http://10.150.1.167:8003'; const REFRESH_INTERVAL = 30000; // 30 seconds interface VMPlacementData { @@ -413,7 +413,7 @@ const Migration = () => { setHasProgress(true); // First, send the POST request for migration approval - const approvalResponse = await fetch('http://141.196.83.136:8003/prom/migration/decisions4?run_migration=true', { + const approvalResponse = await fetch('http://10.150.1.167:8003/prom/migration/decisions4?run_migration=true', { method: 'POST', headers: { 'accept': 'application/json' @@ -455,7 +455,7 @@ const Migration = () => { try { setIsProcessing(true); - const response = await fetch('http://141.196.83.136:8003/prom/migration/decisions4?run_migration=false', { + const response = await fetch('http://10.150.1.167:8003/prom/migration/decisions4?run_migration=false', { method: 'POST', headers: { 'accept': 'application/json' diff --git a/src/pages/MonitoringSystem.tsx b/src/pages/MonitoringSystem.tsx index 42c9f3c..0273799 100644 --- a/src/pages/MonitoringSystem.tsx +++ b/src/pages/MonitoringSystem.tsx @@ -144,7 +144,7 @@ const MonitoringSystem: React.FC = ({ const fetchData = async () => { setLoading(true); try { - const response = await fetch('http://141.196.83.136:8003/prom/monitoring'); + const response = await fetch('http://10.150.1.167:8003/prom/monitoring'); const result: ApiResponse = await response.json(); // Create hierarchical structure diff --git a/src/pages/Temperature.tsx b/src/pages/Temperature.tsx index 7fa2926..e890362 100644 --- a/src/pages/Temperature.tsx +++ b/src/pages/Temperature.tsx @@ -52,7 +52,7 @@ const Temperature = () => { setRefreshing(true); } - const response = await fetch('http://141.196.83.136:8003/prom/get_chart_data/temperature/20'); + const response = await fetch('http://10.150.1.167:8003/prom/get_chart_data/temperature/20'); const result = await response.json(); if (result.data && result.data.length > 0) { @@ -337,7 +337,7 @@ const Temperature = () => { const handleTemperatureDecision = async (approval: boolean) => { try { setDecisionLoading(true); - const response = await fetch('http://141.196.83.136:8003/prom/temperature/decisions?approval=' + approval, { + const response = await fetch('http://10.150.1.167:8003/prom/temperature/decisions?approval=' + approval, { method: 'POST', headers: { 'accept': 'application/json', diff --git a/src/pages/Test.tsx b/src/pages/Test.tsx index 5911f7a..f656616 100644 --- a/src/pages/Test.tsx +++ b/src/pages/Test.tsx @@ -112,7 +112,7 @@ const Test = () => { const fetchVMs = async () => { setIsLoadingVMs(true); try { - const response = await fetch('http://141.196.83.136:8003/prom/monitoring'); + const response = await fetch('http://10.150.1.167:8003/prom/monitoring'); const data: MonitoringResponse = await response.json(); // Extract VMs from the optimization space diff --git a/src/services/monitoringService.ts b/src/services/monitoringService.ts index 032c7a4..a1e4de8 100644 --- a/src/services/monitoringService.ts +++ b/src/services/monitoringService.ts @@ -1,6 +1,6 @@ import axios from 'axios'; -const BASE_URL = 'http://141.196.83.136:8003'; +const BASE_URL = 'http://10.150.1.167:8003'; export interface MonitoringConfig { migration: { diff --git a/src/services/stressService.ts b/src/services/stressService.ts index e707bbc..e8b4409 100644 --- a/src/services/stressService.ts +++ b/src/services/stressService.ts @@ -1,6 +1,6 @@ import axios from 'axios'; -const BASE_URL = 'http://141.196.83.136:8003'; +const BASE_URL = 'http://10.150.1.167:8003'; export interface StressConfig { vms: string[];