Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0dbf4b0b07 | ||
|
|
096c2d401d | ||
|
|
2d08128cb7 | ||
|
|
a7906026d5 |
No files matched your search
@@ -1,3 +1,10 @@
|
||||
## 0.12.6
|
||||
- Добавлены кропки "удалить/добавть" в JsonView
|
||||
- Добавлен скролл к JsonView
|
||||
- Добавлена обработка ошибок к изменению конфига
|
||||
## 0.12.5
|
||||
- Исправлено неверное поведение показа меню
|
||||
- Добавлена страница NotFoundPage
|
||||
## 0.12.4
|
||||
- Уменьшен размер бандла
|
||||
## 0.12.3
|
||||
|
||||
@@ -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;
|
||||
|
||||
Generated
+4
-4
@@ -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
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "isp-admin-ui",
|
||||
"private": true,
|
||||
"version": "0.12.4",
|
||||
"version": "0.12.6",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
|
||||
@@ -4,26 +4,30 @@ import { ReactJsonView } from 'isp-ui-kit'
|
||||
import {Spin} from 'antd'
|
||||
import { cleanEmptyParamsObject } from '@utils/objectUtils.ts'
|
||||
|
||||
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading, JsonSchema}) => {
|
||||
const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig = {}, setBufConfig, isCurrentConfigLoading}) => {
|
||||
if (isCurrentConfigLoading) {
|
||||
return <Spin className="spin" />
|
||||
}
|
||||
|
||||
const handleEdit = (updated_src: any) => {
|
||||
const newData = {
|
||||
...bufConfig,
|
||||
data: { ...updated_src }
|
||||
}
|
||||
setBufConfig(cleanEmptyParamsObject(newData))
|
||||
}
|
||||
|
||||
return (
|
||||
<ReactJsonView
|
||||
onAdd={true}
|
||||
onDelete={({updated_src}: any) => handleEdit(updated_src)}
|
||||
|
||||
displayDataTypes={false}
|
||||
displayObjectSize={false}
|
||||
name={null}
|
||||
enableClipboard={true}
|
||||
iconStyle="square"
|
||||
onEdit={({updated_src}: any) => {
|
||||
const newData = {
|
||||
...bufConfig,
|
||||
data: { ...updated_src }
|
||||
}
|
||||
setBufConfig(cleanEmptyParamsObject(newData))
|
||||
}
|
||||
}
|
||||
onEdit={({updated_src}: any) => handleEdit(updated_src)}
|
||||
src={bufConfig.data}
|
||||
sortKeys={true}
|
||||
collapsed={1}
|
||||
@@ -31,4 +35,4 @@ const ConfigurationEditorJson: FC<ConfigurationEditorPropsType> = ({ bufConfig =
|
||||
)
|
||||
}
|
||||
|
||||
export default ConfigurationEditorJson
|
||||
export default ConfigurationEditorJson
|
||||
@@ -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) {
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: white;
|
||||
height: 100%;
|
||||
-ms-overflow-style: none; /* IE и Edge */
|
||||
scrollbar-width: none;
|
||||
border-left: 1px solid $border-color;
|
||||
height: 100vh;
|
||||
overflow: scroll;
|
||||
padding-bottom: 80px;
|
||||
&::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
@@ -17,6 +19,7 @@
|
||||
&__header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: $basic-padding *2 $basic-padding;
|
||||
border-bottom: 1px solid $border-color;
|
||||
}
|
||||
|
||||
@@ -92,8 +92,8 @@ const ConfigurationEditorPage: FC = () => {
|
||||
createUpdateConfig(cleanEmptyParamsObject(newData))
|
||||
.unwrap()
|
||||
.then(({ id }) => {
|
||||
message.success('Конфигурация успешно сохранена')
|
||||
isNew && navigate(`/${moduleId}/configEditor/${id}`)
|
||||
message.success('Конфигурация успешно сохранена')
|
||||
})
|
||||
.catch((e) => {
|
||||
if (e.data.errorCode === 2004) {
|
||||
@@ -105,6 +105,7 @@ const ConfigurationEditorPage: FC = () => {
|
||||
if (e.data.errorCode === 400) {
|
||||
message.error('Невалидный JSON объект')
|
||||
}
|
||||
message.error('Ошибка обновления элемента')
|
||||
})
|
||||
}
|
||||
|
||||
@@ -152,6 +153,7 @@ const ConfigurationEditorPage: FC = () => {
|
||||
<RollbackOutlined />
|
||||
Назад
|
||||
</Button>
|
||||
<h1>{bufConfig?.name}</h1>
|
||||
<div className="configuration-editor-page__controll">
|
||||
<Button
|
||||
disabled={!JsonSchema}
|
||||
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user