2024-06-06 13:58:58: merge [main:94936000280c72ce43ef30f2a36a36333115dd62];
This commit is contained in:
1 parent
e8dfc2e552
commit
031a92db3f
17 files changed
+171
-97
No files matched your search
@@ -36,10 +36,6 @@
|
||||
tr {
|
||||
background: $blue-light;
|
||||
}
|
||||
|
||||
.ant-table-cell-row-hover {
|
||||
background: $blue-color-2 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&__buttons {
|
||||
|
||||
@@ -207,6 +207,7 @@ const ActiveConfigurationsTable: FC<ActiveConfigurationsTablePropsType> =
|
||||
</CanEdit>}
|
||||
</div>
|
||||
<Table
|
||||
rowHoverable={false}
|
||||
className={className}
|
||||
rowKey={(record) => record.id}
|
||||
pagination={false}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LinkOutlined } from '@ant-design/icons'
|
||||
import { FileProtectOutlined } from '@ant-design/icons'
|
||||
import { List, message, Spin, Tooltip } from 'antd'
|
||||
import { Layout } from 'isp-ui-kit'
|
||||
import { ColumnItem } from 'isp-ui-kit/dist/Layout/Column/column.type'
|
||||
@@ -120,12 +120,14 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
|
||||
|
||||
createApplicationService(newApplicationApp)
|
||||
.unwrap()
|
||||
.then(() => message.success('Элемент сохранен'))
|
||||
.catch(() => message.error('Ошибка добавления элемента')).finally(()=> setShowApplicationsModal({
|
||||
...showApplicationsModal,
|
||||
addModal: false
|
||||
}))
|
||||
|
||||
.then(() => {
|
||||
message.success('Элемент сохранен')
|
||||
setShowApplicationsModal({
|
||||
...showApplicationsModal,
|
||||
addModal: false
|
||||
})
|
||||
})
|
||||
.catch(() => message.error('Ошибка добавления элемента'))
|
||||
}
|
||||
const handleRemoveApplicationApp = (id: number) =>
|
||||
removeApplicationsService([id])
|
||||
@@ -139,8 +141,8 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
|
||||
const renderColumnItems = (item: ColumnItem<any>) => {
|
||||
return (
|
||||
<List.Item>
|
||||
<Tooltip mouseEnterDelay={1} title={item.name}>
|
||||
<List.Item.Meta title={item.name} />
|
||||
<Tooltip mouseEnterDelay={1.3} title={item.name}>
|
||||
<List.Item.Meta title={item.name} description={item.description} />
|
||||
<div
|
||||
className="link-btn"
|
||||
onClick={(e) => {
|
||||
@@ -148,7 +150,9 @@ const ApplicationsContent: FC<ApplicationsContentPropTypes> = ({
|
||||
navigate(`/appAccess/${item.id}`)
|
||||
}}
|
||||
>
|
||||
<LinkOutlined />
|
||||
<Tooltip title="Доступы приложений">
|
||||
<FileProtectOutlined />
|
||||
</Tooltip>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</List.Item>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
AppstoreAddOutlined,
|
||||
LockOutlined,
|
||||
FileProtectOutlined,
|
||||
ProductOutlined,
|
||||
ProfileOutlined
|
||||
} from '@ant-design/icons'
|
||||
@@ -81,7 +81,7 @@ const LayoutComponent = () => {
|
||||
label: 'Доступы приложений',
|
||||
key: 'appAccess',
|
||||
className: hideItem([PermissionKeysType.read]),
|
||||
icon: <LockOutlined />
|
||||
icon: <FileProtectOutlined />
|
||||
},
|
||||
{
|
||||
label: 'Модули',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Divider, Table, message } from 'antd'
|
||||
import { Divider, message, Table } from 'antd'
|
||||
import { ColumnsType } from 'antd/es/table'
|
||||
import { FormComponents } from 'isp-ui-kit'
|
||||
import { useEffect, useState } from 'react'
|
||||
@@ -19,6 +19,7 @@ import { PermissionKeysType, RoleType } from '@type/roles.type.ts'
|
||||
|
||||
import './roles-content.scss'
|
||||
|
||||
|
||||
const newRole: Partial<RoleType> = {
|
||||
externalGroup: '',
|
||||
name: '',
|
||||
@@ -46,6 +47,7 @@ const RolesContent = ({
|
||||
const {
|
||||
control,
|
||||
formState: { isDirty },
|
||||
setError,
|
||||
getValues,
|
||||
reset
|
||||
} = useForm<RoleType>({
|
||||
@@ -79,7 +81,7 @@ const RolesContent = ({
|
||||
}
|
||||
const formValue = getValues()
|
||||
formValue.changeMessage = changeMessage
|
||||
saveRole(formValue)
|
||||
saveRole(formValue, setError)
|
||||
setOpenModal(false)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { UseFormSetError } from 'react-hook-form'
|
||||
|
||||
import { NewRoleType, PermissionType, RoleType } from '@type/roles.type.ts'
|
||||
|
||||
export interface RolesContentPropsType {
|
||||
@@ -5,5 +7,8 @@ export interface RolesContentPropsType {
|
||||
title?: string
|
||||
immutable?: boolean
|
||||
permissions: PermissionType[]
|
||||
saveRole: (formValue: RoleType | NewRoleType) => void
|
||||
saveRole: (
|
||||
formValue: RoleType | NewRoleType,
|
||||
setError: UseFormSetError<RoleType | NewRoleType>
|
||||
) => void
|
||||
}
|
||||
@@ -113,11 +113,6 @@ const TokenContent = ({ id }: TokenPropTypes) => {
|
||||
}
|
||||
|
||||
const columns: ColumnsType<ApplicationTokenType> = [
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'appId',
|
||||
key: 'appId'
|
||||
},
|
||||
{
|
||||
title: 'Токен',
|
||||
dataIndex: 'token',
|
||||
@@ -135,28 +130,24 @@ const TokenContent = ({ id }: TokenPropTypes) => {
|
||||
return <div>{formatTime}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Срок действия',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
render: (value) => {
|
||||
const time = dayjs.duration(value).humanize()
|
||||
if (value > 0) {
|
||||
return <div>{time}</div>
|
||||
}
|
||||
return <div>Отсутствует</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Истекает',
|
||||
dataIndex: 'expireTime',
|
||||
key: 'expireTime',
|
||||
render: (value, record) => {
|
||||
const formatTime = dayjs(record.createdAt)
|
||||
.add(record.expireTime)
|
||||
.format(dateFormats.fullFormat)
|
||||
|
||||
return value > 0 ? <span>{formatTime}</span> : <span> Никогда </span>
|
||||
if (value === -1) {
|
||||
return <span>Никогда</span>
|
||||
}
|
||||
|
||||
const dateNow = dayjs()
|
||||
const expireTime = dayjs(record.createdAt).add(value)
|
||||
if (expireTime.isBefore(dateNow)) {
|
||||
return <span>Просрочен</span>
|
||||
}
|
||||
|
||||
const formatTime = expireTime.format(dateFormats.fullFormat)
|
||||
return <span>{formatTime}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -10,13 +10,20 @@
|
||||
}
|
||||
|
||||
&__wrap {
|
||||
padding: $basic-padding*2 $basic-padding*3;
|
||||
min-width: 700px;
|
||||
padding: $basic-padding*1.25 $basic-padding*3;
|
||||
}
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
h3 {
|
||||
font-size: 19px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
margin:0;
|
||||
padding:0;
|
||||
box-sizing: border-box;
|
||||
font-family: PT Sans, sans-serif;
|
||||
}
|
||||
|
||||
.app{
|
||||
|
||||
Reference in new issue
Block a user