-
Активные устройства ({activeDevices.length})
+
Активные узлы ({activeDevices.length})
{activeDevices.map((device, index) => (
{/* Колонка неактивных устройств */}
-
Неактивные устройства ({inactiveDevices.length})
+ Неактивные узлы ({inactiveDevices.length})
{inactiveDevices.map((device, index) => (
) : scanInitiated ? (
- Устройства не найдены
+ Узлы не найдены
) : null}
>
);
diff --git a/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/modules/TableUsers.tsx b/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/modules/TableUsers.tsx
index cd2e9c4..77e064c 100644
--- a/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/modules/TableUsers.tsx
+++ b/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/modules/TableUsers.tsx
@@ -30,13 +30,13 @@ const ListUsers = ({loading, handleScan, devices, scanInitiated}: ListUsersProps
return (
<>
- {devices.length > 0 ? 'Обновить список' : 'Сканировать узлы подсети'}
+ {devices.length > 0 ? 'Обновить список' : 'Сканировать узлы'}
{devices.length > 0 ? (
) : scanInitiated ? (
- Устройства не найдены
+ Узлы не найдены
) : null}
>
);
diff --git a/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/userScanner.tsx b/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/userScanner.tsx
index dd3f035..19ca497 100644
--- a/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/userScanner.tsx
+++ b/FRONT/DEV/src/components/workSpace/modules/appModules/usersScanner/userScanner.tsx
@@ -77,7 +77,7 @@ const UserLocate = styled.div<{ loading: boolean, scanInitiated: boolean }>`
span {
position: absolute;
display: inline-block;
- background: ${(props) => props.theme.accent};
+ background: ${(props) => props.theme.scannerColor};
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@@ -163,7 +163,7 @@ export default function UserScanner() {
return (
- {(!scanInitiated || loading) && (Сканирование узлов в подсети)}
+ {(!scanInitiated || loading) && (Сканирование узлов подсети)}
@@ -177,7 +177,7 @@ export default function UserScanner() {
{loading ? (
- Сканирование узлов в подсети
+ Сканирование узлов
) : selectedView.value == 1 ? (
diff --git a/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/WifiScanner.tsx b/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/WifiScanner.tsx
index 9cabdd7..25000eb 100644
--- a/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/WifiScanner.tsx
+++ b/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/WifiScanner.tsx
@@ -136,7 +136,8 @@ const ScanBtn = styled.button<{scanInitiated: boolean}>`
`
export function WifiScanner() {
- const { ipAddress } = useIpStore();
+ //const { ipAddress } = useIpStore();
+ const ipAddress = '192.168.1.147'
const [loading, setLoading] = useState(false);
const [scanInitiated, setScanInitiated] = useState(false);
const { wifiNetworks, setWifiNetworks } = useNetworkStore();
@@ -161,17 +162,19 @@ export function WifiScanner() {
return (
- Сканирование точек доступа Wi-Fi
+ Сканирование точек доступа Wi-Fi сети
- {wifiNetworks.map((network) => (
+ {wifiNetworks.map((network, index) => (
))}
diff --git a/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/modules/WifiDot.tsx b/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/modules/WifiDot.tsx
index eccd601..54fee2b 100644
--- a/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/modules/WifiDot.tsx
+++ b/FRONT/DEV/src/components/workSpace/modules/appModules/wifiScanner/modules/WifiDot.tsx
@@ -31,43 +31,45 @@ const Dot = styled.div<{ top: string; left: string }>`
}
`;
-const WifiDot = ({ network, onSelect }: { network: WifiNetworkScanner, onSelect: (n: WifiNetworkScanner) => void }) => {
- const getPositionInRing = (bssid: string, ringSize: number) => {
- const hash = bssid.split('').reduce((acc, char) => acc + char.charCodeAt(0), 0);
- const randomAngle = (hash % 360) * (Math.PI / 180);
- const innerRadius = ringSize * 0.4;
- const outerRadius = ringSize * 0.5;
- const randomValue = (hash % 1000) / 1000;
- const randomRadius = Math.sqrt(innerRadius * innerRadius + randomValue * (outerRadius * outerRadius - innerRadius * innerRadius));
+const getPositionInRing = (index: number, total: number, ringSize: number) => {
+ const angle = (index * (2 * Math.PI / total)) + (Math.PI / total * (index % 2));
+ const innerRadius = ringSize * 0.4;
+ const outerRadius = ringSize * 0.5;
+ const radius = innerRadius + (outerRadius - innerRadius) * (0.3 + 0.7 * (index % 10) / 10);
- return {
- x: Math.cos(randomAngle) * randomRadius,
- y: Math.sin(randomAngle) * randomRadius
- };
+ return {
+ x: Math.cos(angle) * radius,
+ y: Math.sin(angle) * radius
};
+};
- const getPosition = (signal: number, bssid: string) => {
+const WifiDot = ({ network, index, total, onSelect }: {
+ network: WifiNetworkScanner,
+ index: number,
+ total: number,
+ onSelect: (n: WifiNetworkScanner) => void
+}) => {
+ const getPosition = (signal: number, index: number, total: number) => {
let strength: 1 | 2 | 3;
if (signal >= -50) {
strength = 3;
} else if (signal >= -70) {
strength = 2;
- } else if (signal >= -90) {
- strength = 1;
} else {
strength = 1;
}
+
const ringSizes = { 1: 550, 2: 400, 3: 250 };
const ringSize = ringSizes[strength];
- const offset = getPositionInRing(bssid, ringSize);
+ const offset = getPositionInRing(index, total, ringSize);
return {
- top: `calc(50% - ${offset.y}px)`,
- left: `calc(50% - ${offset.x}px)`
+ top: `calc(50% + ${offset.y}px)`,
+ left: `calc(50% + ${offset.x}px)`
};
};
- const position = getPosition(network.signal, network.bssid);
+ const position = getPosition(network.signal, index, total);
return (
onSelect(network)}>
diff --git a/FRONT/DEV/src/components/workSpace/modules/workModules/networkInterfaces.tsx b/FRONT/DEV/src/components/workSpace/modules/workModules/networkInterfaces.tsx
index 1996ddd..d0325ef 100644
--- a/FRONT/DEV/src/components/workSpace/modules/workModules/networkInterfaces.tsx
+++ b/FRONT/DEV/src/components/workSpace/modules/workModules/networkInterfaces.tsx
@@ -76,7 +76,7 @@ export const NetworkInterfaces = ({ startConnection, ws }: Props) => {
setHasInited(false)
initializationAttempt.current = 0;
- const newSocket = new WebSocket(`wss://${ws}:8001/api/v1`);
+ const newSocket = new WebSocket(`ws://${ws}:8001/api/v1`);
let connectionTimeout;
setSocket(newSocket);
diff --git a/FRONT/DEV/src/components/workSpace/sideBar/toolSpace/devicesBar.tsx b/FRONT/DEV/src/components/workSpace/sideBar/toolSpace/devicesBar.tsx
index 8b919f4..dd5ca2b 100644
--- a/FRONT/DEV/src/components/workSpace/sideBar/toolSpace/devicesBar.tsx
+++ b/FRONT/DEV/src/components/workSpace/sideBar/toolSpace/devicesBar.tsx
@@ -115,7 +115,7 @@ export const DevicesBar = () => {
const checkWebSocketAvailability = async (ip: string): Promise => {
return new Promise((resolve) => {
- const testSocket = new WebSocket(`wss://${ip}:8001/api/v1`);
+ const testSocket = new WebSocket(`ws://${ip}:8001/api/v1`);
const timeout = setTimeout(() => {
testSocket.close();
resolve(false);
diff --git a/FRONT/DEV/src/const/buttons/icons.tsx b/FRONT/DEV/src/const/buttons/icons.tsx
index 301b1d6..9cab629 100644
--- a/FRONT/DEV/src/const/buttons/icons.tsx
+++ b/FRONT/DEV/src/const/buttons/icons.tsx
@@ -9,6 +9,7 @@ import settings from '@iconify/icons-ic/baseline-settings';
import info from '@iconify/icons-ic/baseline-info';
import arrowDown from '@iconify/icons-ic/baseline-keyboard-arrow-down';
import arrowRight from '@iconify/icons-ic/baseline-keyboard-arrow-right';
+import arrowLeft from '@iconify/icons-ic/baseline-keyboard-arrow-left';
import edit from '@iconify/icons-ic/baseline-edit';
import checkCircle from '@iconify/icons-ic/round-check-circle';
import cancel from '@iconify/icons-ic/baseline-cancel';
@@ -37,6 +38,7 @@ export const ICONS = {
[buttonNames[14]]: userSearch,
[buttonNames[15]]: wifiFind,
[buttonNames[16]]: noteEdit,
+ [buttonNames[17]]: arrowLeft,
} as const;
type IconName = keyof typeof ICONS;
diff --git a/FRONT/DEV/src/const/buttons/names.ts b/FRONT/DEV/src/const/buttons/names.ts
index 54c1d40..052321e 100644
--- a/FRONT/DEV/src/const/buttons/names.ts
+++ b/FRONT/DEV/src/const/buttons/names.ts
@@ -16,5 +16,6 @@ export const buttonNames: names ={
13: 'noAdmin',
14: 'userSearch',
15: 'wifiFind',
- 16: 'noteEdit'
+ 16: 'noteEdit',
+ 17: 'arrowLeft',
}
\ No newline at end of file
diff --git a/FRONT/DEV/src/const/menus/sideBar/icons.tsx b/FRONT/DEV/src/const/menus/sideBar/icons.tsx
index 1d80d6b..b5560ce 100644
--- a/FRONT/DEV/src/const/menus/sideBar/icons.tsx
+++ b/FRONT/DEV/src/const/menus/sideBar/icons.tsx
@@ -3,7 +3,7 @@ import { toolBarNames } from "./names"
import { useTheme } from "styled-components"
import { Icon } from '@iconify/react';
-import desktop from '@iconify/icons-ic/round-desktop-windows';
+import desktop from '@iconify/icons-ic/baseline-menu';
export const ICONS = {
[toolBarNames[1]]: desktop,
diff --git a/FRONT/DEV/src/const/theme/theme.ts b/FRONT/DEV/src/const/theme/theme.ts
index aab3658..dbf1cb3 100644
--- a/FRONT/DEV/src/const/theme/theme.ts
+++ b/FRONT/DEV/src/const/theme/theme.ts
@@ -24,7 +24,7 @@ export const dark = {
background: '#3A3A3A',
textColor: '#FFFFFF',
borderColor: '#b6b6b6',
- scannerColor: '#0E9C9D',
+ scannerColor: '#00E5FF',
offlineColor: '#656565',
hoverBtn: '#4a4a4a',
};
\ No newline at end of file