diff --git a/.env.example b/.env.example
new file mode 100644
index 0000000..befe7f5
--- /dev/null
+++ b/.env.example
@@ -0,0 +1,14 @@
+REDIS_HOST=
+REDIS_PORT=
+REDIS_PASSWORD=
+POSTGRES_HOST=
+POSTGRES_DB=
+POSTGRES_USER=
+POSTGRES_PASSWORD=
+POSTGRES_PORT=
+EMS_PORT=
+MONITOR_PORT=
+CLICKHOUSE_DB=
+CLICKHOUSE_USER=
+CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=
+CLICKHOUSE_PASSWORD=
\ No newline at end of file
diff --git a/client/src/App.tsx b/client/src/App.tsx
index d8566c6..a6f6381 100644
--- a/client/src/App.tsx
+++ b/client/src/App.tsx
@@ -15,10 +15,11 @@ import Documents from "./pages/Documents"
import Reports from "./pages/Reports"
import Boilers from "./pages/Boilers"
import Servers from "./pages/Servers"
-import { Api, Assignment, Cloud, Factory, Home, Login, Map, Password, People, Settings as SettingsIcon, Shield, Storage } from "@mui/icons-material"
+import { Api, Assignment, Cloud, Factory, Home, Login, Map, MonitorHeart, Password, People, Settings as SettingsIcon, Shield, Storage } from "@mui/icons-material"
import Settings from "./pages/Settings"
import PasswordReset from "./pages/auth/PasswordReset"
import MapTest from "./pages/MapTest"
+import MonitorPage from "./pages/MonitorPage"
// Определение страниц с путями и компонентом для рендера
export const pages = [
@@ -126,6 +127,14 @@ export const pages = [
drawer: true,
dashboard: true
},
+ {
+ label: "Монитор",
+ path: "/monitor",
+ icon: ,
+ component: ,
+ drawer: true,
+ dashboard: true
+ },
]
function App() {
diff --git a/client/src/components/map/MapComponent.tsx b/client/src/components/map/MapComponent.tsx
index bf81c4a..7b62d69 100644
--- a/client/src/components/map/MapComponent.tsx
+++ b/client/src/components/map/MapComponent.tsx
@@ -4,32 +4,20 @@ import 'ol/ol.css'
import Map from 'ol/Map'
import View from 'ol/View'
import { Draw, Modify, Select, Snap, Translate } from 'ol/interaction'
-import { OSM, Source, Vector as VectorSource, XYZ } from 'ol/source'
+import { OSM, Vector as VectorSource, XYZ } from 'ol/source'
import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer'
-import { get, Projection, transform, transformExtent } from 'ol/proj'
-import { Divider, IconButton, Slider, Stack, Select as MUISelect, MenuItem, Container, Box } from '@mui/material'
-import { Adjust, Api, CircleOutlined, DoubleArrow, FeaturedVideoSharp, Handyman, OpenWith, RectangleOutlined, Timeline, Undo, Warning } from '@mui/icons-material'
+import { Divider, IconButton, Slider, Stack, Select as MUISelect, MenuItem, Box } from '@mui/material'
+import { Adjust, Api, CircleOutlined, OpenWith, RectangleOutlined, Rule, Straighten, Timeline, Undo, Warning } from '@mui/icons-material'
import { Type } from 'ol/geom/Geometry'
-import { altKeyOnly, click, doubleClick, noModifierKeys, platformModifierKey, pointerMove, shiftKeyOnly, singleClick } from 'ol/events/condition'
-import Feature, { FeatureLike } from 'ol/Feature'
-import Style from 'ol/style/Style'
-import Fill from 'ol/style/Fill'
-import Stroke from 'ol/style/Stroke'
-import { FlatStyleLike } from 'ol/style/flat'
+import { click, noModifierKeys, shiftKeyOnly } from 'ol/events/condition'
+import Feature from 'ol/Feature'
import { SatelliteMapsProvider } from '../../interfaces/map'
-import Tile from 'ol/Tile'
-import ImageTile from 'ol/ImageTile'
-import { createXYZ, TileGrid } from 'ol/tilegrid'
-import { TileCoord } from 'ol/tilecoord'
-import { register } from 'ol/proj/proj4'
-import proj4 from 'proj4'
+import { containsExtent } from 'ol/extent'
+import { drawingLayerStyle, regionsLayerStyle, selectStyle } from './MapStyles'
+import { googleMapsSatelliteSource, regionsLayerSource, yandexMapsSatelliteSource } from './MapSources'
+import { mapCenter, mapExtent } from './MapConstants'
const MapComponent = () => {
- proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs')
- register(proj4);
- const yandexProjection = get('EPSG:3395')?.setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]) || 'EPSG:3395'
-
-
const mapElement = useRef(null)
const [currentTool, setCurrentTool] = useState(null)
@@ -37,18 +25,9 @@ const MapComponent = () => {
const [satMapsProvider, setSatMapsProvider] = useState('yandex')
- const gMapsSatSource = useRef(new XYZ({
- //url: `https://khms2.google.com/kh/v=984?x={x}&y={y}&z={z}`,
- url: `http://localhost:5000/tile/google/{z}/{x}/{y}`,
- attributions: 'Map data © Google'
- }))
+ const gMapsSatSource = useRef(googleMapsSatelliteSource)
- const yMapsSatSource = useRef(new XYZ({
- //url: `https://sat0{1-4}.maps.yandex.net/tiles?l=sat&x={x}&y={y}&z={z}&scale=1&lang=ru_RU&client_id=yandex-web-maps`,
- url: `https://core-sat.maps.yandex.net/tiles?l=sat&x={x}&y={y}&z={z}&scale=1&lang=ru_RU`,
- attributions: 'Map data © Yandex',
- projection: yandexProjection,
- }))
+ const yMapsSatSource = useRef(yandexMapsSatelliteSource)
const satLayer = useRef(new TileLayer({
source: gMapsSatSource.current,
@@ -56,60 +35,27 @@ const MapComponent = () => {
const draw = useRef(null)
const snap = useRef(null)
- const selectFeature = useRef