Compare commits

..
3 Commits
8 changed files with 63 additions and 39 deletions

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
## 0.12.5
- Исправлено неверное поведение показа меню
- Добавлена страница NotFoundPage
## 0.12.4
- Уменьшен размер бандла
## 0.12.3
+2 -2
View File
@@ -1,5 +1,5 @@
server {
listen 80;
listen 8001;
server_name localhost;
root /opt/msp/isp-admin-ui/;
@@ -10,7 +10,7 @@ server {
location /api {
client_max_body_size 10M;
proxy_pass http://10.2.4.241:9003;
proxy_pass http://isp-gate-service:9003;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
+4 -4
View File
@@ -1,12 +1,12 @@
{
"name": "isp-admin-ui",
"version": "0.12.3",
"version": "0.12.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "isp-admin-ui",
"version": "0.12.3",
"version": "0.12.5",
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6",
"@codemirror/lang-json": "^6.0.1",
@@ -7981,8 +7981,8 @@
}
},
"node_modules/isp-ui-kit": {
"version": "0.6.0",
"resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#5f48f91bdb9b342bc7b14c3a40ea061c3474ae81",
"version": "0.7.1",
"resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#657a9c1b62fb757938e12091faba6f5f53c7d7e9",
"license": "ISC",
"dependencies": {
"@codemirror/lang-javascript": "^6.2.1",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "isp-admin-ui",
"private": true,
"version": "0.12.4",
"version": "0.12.5",
"type": "module",
"scripts": {
"start": "vite",
+10 -8
View File
@@ -32,7 +32,10 @@ import { routePaths } from '@routes/routePaths.ts'
import { PermissionKeysType } from '@type/roles.type.ts'
import './layout.scss'
import './layout.scss';
const { Content, Sider } = Layout
@@ -138,17 +141,16 @@ const LayoutComponent = () => {
useEffect(() => {
const menuKey = location.pathname.split('/')[1] as MenuItemKeysType
const selectedKey = selectedMenuKeys[0] || ''
const menuItem = menuKeys[menuKey]
if (menuItem) {
if (menuItem && menuKey !== selectedKey) {
setSelectedMenuKeys([menuItem.key])
setOpenKeys(menuItem.parent)
} else {
setSelectedMenuKeys([])
setOpenKeys([])
if (selectedKey) {
setOpenKeys(menuItem.parent)
}
}
}, [location])
}, [location.pathname])
const handlerOnClickMenu: MenuProps['onClick'] = ({ key }): void => {
switch (key) {
+21
View File
@@ -0,0 +1,21 @@
import { Button } from 'antd'
import { Layout } from 'isp-ui-kit'
import { useNavigate } from 'react-router-dom'
import { routePaths } from '@routes/routePaths.ts'
const { NotFoundPage } = Layout
const NotFound = () => {
const navigate = useNavigate()
return (
<NotFoundPage>
<Button type="primary" onClick={() => navigate(routePaths.modules)}>
На главную
</Button>
</NotFoundPage>
)
}
export default NotFound
+20 -9
View File
@@ -4,6 +4,7 @@ import { lazy, Suspense } from 'react'
import { Navigate, Route, Routes } from 'react-router-dom'
import LayoutComponent from '@components/Layout'
// Составная часть основной страницы, поэтому без lazy
import Configurations from '@pages/ConfigurationsPage'
import Connections from '@pages/ConnectionsPage'
@@ -26,7 +27,9 @@ const ModulesPage = lazy(() => import('@pages/ModulesPage'))
const ApplicationsPage = lazy(() => import('@pages/ApplicationsPage'))
const AllVersionsPage = lazy(() => import('@pages/AllVersionsPage'))
const ConfigurationEditorPage = lazy(
() => import('@pages/ConfigurationEditorPage'))
() => import('@pages/ConfigurationEditorPage')
)
const NotFound = lazy(() => import('@pages/NotFound'))
const Routers = () => {
return (
@@ -151,14 +154,14 @@ const Routers = () => {
}
/>
</Route>
<Route path={`:moduleId/${routePaths.configEditor}/:id`}
element={
<Suspense fallback={<Spin />}>
<ConfigurationEditorPage />
</Suspense>
}>
</Route>
<Route
path={`:moduleId/${routePaths.configEditor}/:id`}
element={
<Suspense fallback={<Spin />}>
<ConfigurationEditorPage />
</Suspense>
}
></Route>
<Route
path={routePaths.modules}
element={
@@ -213,6 +216,14 @@ const Routers = () => {
</Suspense>
}
/>
<Route
path={routePaths.notFound}
element={
<Suspense fallback={<Spin />}>
<NotFound />
</Suspense>
}
/>
</Routes>
)
}
+2 -15
View File
@@ -17,23 +17,10 @@ export default defineConfig(({ mode }) => {
},
build: {
minify: 'esbuild',
sourcemap: false,
sourcemap: true,
outDir: 'build',
chunkSizeWarningLimit: 1600,
commonjsOptions: { transformMixedEsModules: true },
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString()
}
}
}
}
},
server: {
watch: {
@@ -41,7 +28,7 @@ export default defineConfig(({ mode }) => {
},
host: true,
strictPort: true,
port: 8000,
port: 8001,
proxy: {
'/api': env.PROXY_URL
}