Compare commits

..
1 Commits
12 changed files with 38 additions and 21 deletions

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
## 0.15.0
- Добавлены placeholder для поиска в первом столбце
- Добавлен заголовок первого столбца на экране Модули
- Изменен интервал поллинга для get_modules на 5 секунд
- Изменена логика работы редиректа после окончания сессии
## 0.14.2 ## 0.14.2
- Исправлено появление экрана после логина - Исправлено появление экрана после логина
- На экране ошибки добавлена кнопка "На главную" - На экране ошибки добавлена кнопка "На главную"
+4 -4
View File
@@ -1,12 +1,12 @@
{ {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"version": "0.14.1", "version": "0.15.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"version": "0.14.1", "version": "0.15.0",
"dependencies": { "dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.6", "@apidevtools/json-schema-ref-parser": "^9.0.6",
"@codemirror/lang-json": "^6.0.1", "@codemirror/lang-json": "^6.0.1",
@@ -7970,8 +7970,8 @@
} }
}, },
"node_modules/isp-ui-kit": { "node_modules/isp-ui-kit": {
"version": "0.7.5", "version": "0.8.0",
"resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#040326c756de20d7a4bfad3411c9fa9feb7c4818", "resolved": "git+ssh://git@github.com/txix-open/isp-ui-kit.git#01a9d57ecddddc7b979ffefd499bad21c5bb8ca9",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@codemirror/lang-javascript": "^6.2.1", "@codemirror/lang-javascript": "^6.2.1",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "isp-admin-ui", "name": "isp-admin-ui",
"private": true, "private": true,
"version": "0.14.2", "version": "0.15.0",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vite", "start": "vite",
+6 -1
View File
@@ -8,6 +8,7 @@ import { darkTheme, lightTheme } from '@constants/theme.ts'
import { Context } from '@stores/index.tsx' import { Context } from '@stores/index.tsx'
import Routers from '@routes/Routers' import Routers from '@routes/Routers'
import { routePaths } from '@routes/routePaths.ts'
import './app.scss' import './app.scss'
@@ -23,7 +24,11 @@ const App = () => {
useEffect(() => { useEffect(() => {
const prevRoute = sessionStorage.getItem('prevRoute') const prevRoute = sessionStorage.getItem('prevRoute')
if (location.pathname !== prevRoute) { if (
location.pathname !== routePaths.error &&
location.pathname !== routePaths.login &&
location.pathname !== prevRoute
) {
sessionStorage.setItem('prevRoute', location.pathname) sessionStorage.setItem('prevRoute', location.pathname)
} }
}, [location]) }, [location])
@@ -171,6 +171,7 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
<section className="applications-content"> <section className="applications-content">
<Column <Column
title="Приложения" title="Приложения"
searchPlaceholder="Введите имя или id"
onUpdateItem={updateApplicationModal} onUpdateItem={updateApplicationModal}
showUpdateBtn={true} showUpdateBtn={true}
onAddItem={addApplicationModal} onAddItem={addApplicationModal}
+1
View File
@@ -82,6 +82,7 @@ const AppAccessPage = () => {
<section className="app-access-page"> <section className="app-access-page">
<Column <Column
title="Приложения" title="Приложения"
searchPlaceholder="Введите имя или id"
showUpdateBtn={false} showUpdateBtn={false}
showAddBtn={false} showAddBtn={false}
showRemoveBtn={false} showRemoveBtn={false}
+1
View File
@@ -163,6 +163,7 @@ const ApplicationsPage = () => {
<main className="applications-page"> <main className="applications-page">
<Column <Column
title="Группы приложений" title="Группы приложений"
searchPlaceholder="Введите имя или id"
onUpdateItem={updateApplicationModal} onUpdateItem={updateApplicationModal}
showUpdateBtn={true} showUpdateBtn={true}
onAddItem={addApplicationModal} onAddItem={addApplicationModal}
+11 -12
View File
@@ -38,7 +38,7 @@ const LoginPage = () => {
} }
const handleError = (err: AxiosError<MSPError>): void => { const handleError = (err: AxiosError<MSPError>): void => {
const { response,status } = err const { response, status } = err
if (response && status === 401) { if (response && status === 401) {
setFormError(response.statusText, messages.loginError) setFormError(response.statusText, messages.loginError)
} else { } else {
@@ -57,9 +57,8 @@ const LoginPage = () => {
LocalStorage.set(localStorageKeys.HEADER_NAME, response.headerName) LocalStorage.set(localStorageKeys.HEADER_NAME, response.headerName)
LocalStorage.set(localStorageKeys.USER_TOKEN, response.token) LocalStorage.set(localStorageKeys.USER_TOKEN, response.token)
const redirectUrl = const redirectUrl =
localStorage.getItem('redirectUrl') || routePaths.home sessionStorage.getItem('prevRoute') || routePaths.home
navigate(redirectUrl, { replace: true }) navigate(redirectUrl, { replace: true })
localStorage.removeItem('redirectUrl')
}) })
.catch((err: AxiosError<MSPError>) => handleError(err)) .catch((err: AxiosError<MSPError>) => handleError(err))
} }
@@ -106,15 +105,15 @@ const LoginPage = () => {
return ( return (
<Layout> <Layout>
<section className="login-page"> <section className="login-page">
<form className="login-page__content"> <form className="login-page__content">
<h1 data-cy="login-title" className="login-page__content__title"> <h1 data-cy="login-title" className="login-page__content__title">
Вход в систему Вход в систему
</h1> </h1>
<Divider /> <Divider />
{renderInternalAuthForm()} {renderInternalAuthForm()}
</form> </form>
</section> </section>
</Layout> </Layout>
) )
} }
+3 -1
View File
@@ -38,7 +38,7 @@ const ModulesPage = () => {
const [searchParams, setSearchParams] = useSearchParams() const [searchParams, setSearchParams] = useSearchParams()
const { data: ModulesList = [], isLoading: isModulesLoading } = const { data: ModulesList = [], isLoading: isModulesLoading } =
modulesServiceApi.useGetModulesQuery('modules', { modulesServiceApi.useGetModulesQuery('modules', {
pollingInterval: 1000, pollingInterval: 5000,
skipPollingIfUnfocused: true skipPollingIfUnfocused: true
}) })
const [removeModule] = modulesServiceApi.useRemoveModuleMutation() const [removeModule] = modulesServiceApi.useRemoveModuleMutation()
@@ -190,6 +190,8 @@ const ModulesPage = () => {
return ( return (
<section className="modules-page"> <section className="modules-page">
<Column <Column
title="Модули"
searchPlaceholder="Введите имя или id"
items={filterFirstColumnItems(ModulesList, searchValue)} items={filterFirstColumnItems(ModulesList, searchValue)}
showAddBtn={false} showAddBtn={false}
showUpdateBtn={false} showUpdateBtn={false}
+1 -1
View File
@@ -11,7 +11,7 @@ const NotFound = () => {
const navigate = useNavigate() const navigate = useNavigate()
return ( return (
<NotFoundPage> <NotFoundPage>
<Button type="primary" onClick={() => navigate(routePaths.modules)}> <Button type="primary" onClick={() => navigate(routePaths.home)}>
На главную На главную
</Button> </Button>
</NotFoundPage> </NotFoundPage>
+2
View File
@@ -192,6 +192,8 @@ const RolesPage = () => {
return ( return (
<section className="roles-page"> <section className="roles-page">
<Column <Column
title="Роли пользователей"
searchPlaceholder="Введите имя или id"
showUpdateBtn={false} showUpdateBtn={false}
items={filterFirstColumnItems(data, searchValue)} items={filterFirstColumnItems(data, searchValue)}
showAddBtn={isAddRolePermissions} showAddBtn={isAddRolePermissions}
+2 -1
View File
@@ -41,8 +41,9 @@ apiService.interceptors.response.use(
console.error(error) console.error(error)
if (error.response && error.response.status === 401) { if (error.response && error.response.status === 401) {
localClear() localClear()
const prevRoute = sessionStorage.getItem('prevRoute') || ''
message.error('Ваша сессия истекла"').then() message.error('Ваша сессия истекла"').then()
LocalStorage.set('redirectUrl', location.pathname) sessionStorage.setItem('prevRoute', prevRoute)
window.location.href = routePaths.login window.location.href = routePaths.login
} }