forked from BLC/AyposWeb
fixed build issues
This commit is contained in:
@@ -42,9 +42,10 @@ import ErrorIcon from '@mui/icons-material/Error';
|
|||||||
import AutoFixHighIcon from '@mui/icons-material/AutoFixHigh';
|
import AutoFixHighIcon from '@mui/icons-material/AutoFixHigh';
|
||||||
import HandymanIcon from '@mui/icons-material/Handyman';
|
import HandymanIcon from '@mui/icons-material/Handyman';
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
import EditIcon from '@mui/icons-material/Edit';
|
||||||
import { monitoringService, MonitoringStatus } from '../services/monitoringService';
|
import { monitoringService } from '../services/monitoringService';
|
||||||
import DebugConsole from '../components/DebugConsole';
|
import DebugConsole from '../components/DebugConsole';
|
||||||
import MonitoringSystem from './MonitoringSystem';
|
import MonitoringSystem from './MonitoringSystem';
|
||||||
|
import { Weights, AlertState, MonitoringStatus } from '../types/monitoring';
|
||||||
|
|
||||||
// Professional, consistent card style (no animation)
|
// Professional, consistent card style (no animation)
|
||||||
const StyledCard = styled(Paper)(({ theme }) => ({
|
const StyledCard = styled(Paper)(({ theme }) => ({
|
||||||
@@ -890,10 +891,19 @@ const Home = () => {
|
|||||||
const config = {
|
const config = {
|
||||||
migration: {
|
migration: {
|
||||||
script_time_unit: migrationTime,
|
script_time_unit: migrationTime,
|
||||||
|
virtual_machine_estimation: {
|
||||||
estimation_method: estimationMethod,
|
estimation_method: estimationMethod,
|
||||||
model_type: migrationModel,
|
model_type: migrationModel
|
||||||
|
},
|
||||||
|
migration_advices: {
|
||||||
migration_method: migrationMethod === 'mathematical' ? 'migration_advices_la' : 'migration_advices_llm',
|
migration_method: migrationMethod === 'mathematical' ? 'migration_advices_la' : 'migration_advices_llm',
|
||||||
operation_mode: migrationMode,
|
migration_weights: {
|
||||||
|
power: weights.energy.toString(),
|
||||||
|
balance: weights.balance.toString(),
|
||||||
|
overload: weights.overload.toString(),
|
||||||
|
allocation: weights.allocation.toString()
|
||||||
|
}
|
||||||
|
},
|
||||||
block_list: blockList
|
block_list: blockList
|
||||||
},
|
},
|
||||||
environmental: {
|
environmental: {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useEffect, useCallback } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Paper,
|
Paper,
|
||||||
@@ -11,19 +11,8 @@ import {
|
|||||||
CircularProgress,
|
CircularProgress,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Collapse,
|
Collapse,
|
||||||
Grid,
|
|
||||||
useTheme,
|
|
||||||
styled,
|
|
||||||
Chip,
|
|
||||||
FormControl,
|
|
||||||
InputLabel,
|
|
||||||
Select,
|
|
||||||
MenuItem,
|
|
||||||
FormControlLabel,
|
|
||||||
Alert,
|
Alert,
|
||||||
Snackbar,
|
Snackbar,
|
||||||
Tabs,
|
|
||||||
Tab,
|
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
||||||
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
||||||
@@ -34,8 +23,6 @@ import ComputerIcon from '@mui/icons-material/Computer';
|
|||||||
import MemoryIcon from '@mui/icons-material/Memory';
|
import MemoryIcon from '@mui/icons-material/Memory';
|
||||||
import RefreshIcon from '@mui/icons-material/Refresh';
|
import RefreshIcon from '@mui/icons-material/Refresh';
|
||||||
import SaveIcon from '@mui/icons-material/Save';
|
import SaveIcon from '@mui/icons-material/Save';
|
||||||
import SpeedIcon from '@mui/icons-material/Speed';
|
|
||||||
import { stressService } from '../services/stressService';
|
|
||||||
|
|
||||||
// Define the structure of our tree nodes
|
// Define the structure of our tree nodes
|
||||||
interface TreeNode {
|
interface TreeNode {
|
||||||
@@ -93,27 +80,6 @@ const areAllChildrenSelected = (node: TreeNode, selectedNodes: string[]): boolea
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add new styled components for stress testing
|
|
||||||
const StressTestingCard = styled(Paper)(({ theme }) => ({
|
|
||||||
padding: theme.spacing(3),
|
|
||||||
borderRadius: theme.spacing(2),
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
|
||||||
marginBottom: theme.spacing(3),
|
|
||||||
}));
|
|
||||||
|
|
||||||
const StressLevelChip = styled(Chip)<{ level: 'low' | 'medium' | 'high' }>(({ theme, level }) => ({
|
|
||||||
borderRadius: theme.spacing(1),
|
|
||||||
fontWeight: 500,
|
|
||||||
backgroundColor:
|
|
||||||
level === 'low' ? theme.palette.success.light :
|
|
||||||
level === 'medium' ? theme.palette.warning.light :
|
|
||||||
theme.palette.error.light,
|
|
||||||
color:
|
|
||||||
level === 'low' ? theme.palette.success.dark :
|
|
||||||
level === 'medium' ? theme.palette.warning.dark :
|
|
||||||
theme.palette.error.dark,
|
|
||||||
}));
|
|
||||||
|
|
||||||
interface MonitoringSystemProps {
|
interface MonitoringSystemProps {
|
||||||
onSave?: (unselectedVMs: string[], selectedVMs: string[]) => void;
|
onSave?: (unselectedVMs: string[], selectedVMs: string[]) => void;
|
||||||
isDialog?: boolean;
|
isDialog?: boolean;
|
||||||
@@ -132,8 +98,6 @@ const MonitoringSystem: React.FC<MonitoringSystemProps> = ({
|
|||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [treeData, setTreeData] = useState<TreeNode[]>([]);
|
const [treeData, setTreeData] = useState<TreeNode[]>([]);
|
||||||
const [isViewMode, setIsViewMode] = useState(false);
|
const [isViewMode, setIsViewMode] = useState(false);
|
||||||
const [selectedVMs, setSelectedVMs] = useState<string[]>(initialSelectedVMs);
|
|
||||||
const [activeTab, setActiveTab] = useState(0);
|
|
||||||
const [alert, setAlert] = useState<{ open: boolean; message: string; severity: 'success' | 'error' | 'info' }>({
|
const [alert, setAlert] = useState<{ open: boolean; message: string; severity: 'success' | 'error' | 'info' }>({
|
||||||
open: false,
|
open: false,
|
||||||
message: '',
|
message: '',
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ import SpeedIcon from '@mui/icons-material/Speed';
|
|||||||
import ComputerIcon from '@mui/icons-material/Computer';
|
import ComputerIcon from '@mui/icons-material/Computer';
|
||||||
import { stressService } from '../services/stressService';
|
import { stressService } from '../services/stressService';
|
||||||
|
|
||||||
const StyledPaper = styled(Paper)(({ theme }) => ({
|
|
||||||
padding: theme.spacing(3),
|
|
||||||
borderRadius: theme.spacing(2),
|
|
||||||
height: '100%',
|
|
||||||
}));
|
|
||||||
|
|
||||||
const PageTitle = styled(Typography)(({ theme }) => ({
|
const PageTitle = styled(Typography)(({ theme }) => ({
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|||||||
47
src/types/monitoring.ts
Normal file
47
src/types/monitoring.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
export interface Weights {
|
||||||
|
energy: number;
|
||||||
|
balance: number;
|
||||||
|
overload: number;
|
||||||
|
allocation: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AlertState {
|
||||||
|
open: boolean;
|
||||||
|
message: string;
|
||||||
|
severity: 'error' | 'warning' | 'info' | 'success';
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MonitoringStatus {
|
||||||
|
statuses: {
|
||||||
|
migration: {
|
||||||
|
is_running: boolean;
|
||||||
|
};
|
||||||
|
environmental: {
|
||||||
|
is_running: boolean;
|
||||||
|
};
|
||||||
|
preventive: {
|
||||||
|
is_running: boolean;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MonitoringConfig {
|
||||||
|
migration: {
|
||||||
|
script_time_unit: string;
|
||||||
|
estimation_method: 'direct' | 'indirect';
|
||||||
|
model_type: string;
|
||||||
|
migration_method: string;
|
||||||
|
operation_mode: 'auto' | 'semiauto';
|
||||||
|
block_list: string[];
|
||||||
|
};
|
||||||
|
environmental: {
|
||||||
|
number_of_steps: string;
|
||||||
|
script_time_unit: string;
|
||||||
|
model_type: string;
|
||||||
|
};
|
||||||
|
preventive: {
|
||||||
|
number_of_steps: string;
|
||||||
|
script_time_unit: string;
|
||||||
|
model_type: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user