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