Feat(Hint): Support dark mode
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import {
|
||||
@@ -27,7 +28,6 @@ import Card from '@/components/common/Card'
|
||||
|
||||
const Group = () => {
|
||||
const theme = useTheme()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [form] = AntdForm.useForm<GroupAddEditParam>()
|
||||
const formValues = AntdForm.useWatch([], form)
|
||||
const [newFormValues, setNewFormValues] = useState<GroupAddEditParam>()
|
||||
@@ -246,7 +246,7 @@ const Group = () => {
|
||||
centered: true,
|
||||
maskClosable: true,
|
||||
title: '确定删除',
|
||||
content: `确定删除角色 ${value.name} 吗?`
|
||||
content: `确定删除用户组 ${value.name} 吗?`
|
||||
})
|
||||
.then(
|
||||
(confirmed) => {
|
||||
@@ -300,7 +300,7 @@ const Group = () => {
|
||||
getGroup()
|
||||
break
|
||||
case DATABASE_DUPLICATE_KEY:
|
||||
void message.error('已存在相同名称的角色')
|
||||
void message.error('已存在相同名称的用户组')
|
||||
break
|
||||
default:
|
||||
void message.error('更新失败,请稍后重试')
|
||||
@@ -321,7 +321,7 @@ const Group = () => {
|
||||
getGroup()
|
||||
break
|
||||
case DATABASE_DUPLICATE_KEY:
|
||||
void message.error('已存在相同名称的角色')
|
||||
void message.error('已存在相同名称的用户组')
|
||||
break
|
||||
default:
|
||||
void message.error('添加失败,请稍后重试')
|
||||
@@ -563,6 +563,7 @@ const Group = () => {
|
||||
rowKey={(record) => record.id}
|
||||
pagination={tableParams.pagination}
|
||||
loading={isLoading}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleOnTableChange}
|
||||
rowSelection={
|
||||
hasPermission('system:group:delete:multiple')
|
||||
@@ -657,7 +658,6 @@ const Group = () => {
|
||||
>
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
{contextHolder}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { ChangeEvent, KeyboardEvent } from 'react'
|
||||
import { useTheme } from 'antd-style'
|
||||
import dayjs from 'dayjs'
|
||||
import { DATABASE_SELECT_SUCCESS } from '@/constants/common.constants'
|
||||
import { message } from '@/util/common'
|
||||
import { dayjsToUtc, utcToLocalTime } from '@/util/datetime'
|
||||
import { r_sys_log_get } from '@/services/system'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { hasPermission, powerListToPowerTree } from '@/util/auth'
|
||||
import {
|
||||
@@ -27,7 +28,6 @@ import Card from '@/components/common/Card'
|
||||
|
||||
const Role = () => {
|
||||
const theme = useTheme()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [form] = AntdForm.useForm<RoleAddEditParam>()
|
||||
const formValues = AntdForm.useWatch([], form)
|
||||
const [newFormValues, setNewFormValues] = useState<RoleAddEditParam>()
|
||||
@@ -572,6 +572,7 @@ const Role = () => {
|
||||
rowKey={(record) => record.id}
|
||||
pagination={tableParams.pagination}
|
||||
loading={isLoading}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleOnTableChange}
|
||||
rowSelection={
|
||||
hasPermission('system:role:delete:multiple')
|
||||
@@ -664,7 +665,6 @@ const Role = () => {
|
||||
>
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
{contextHolder}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { message } from '@/util/common'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import { r_sys_settings_base_get, r_sys_settings_base_update } from '@/services/system'
|
||||
import SettingsCard from '@/components/system/SettingCard'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import Icon from '@ant-design/icons'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import {
|
||||
r_sys_settings_mail_get,
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
import SettingsCard from '@/components/system/SettingCard'
|
||||
|
||||
const Mail = () => {
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [mailForm] = AntdForm.useForm<MailSettingsParam>()
|
||||
const mailFormValues = AntdForm.useWatch([], mailForm)
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
@@ -114,59 +114,56 @@ const Mail = () => {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsCard
|
||||
icon={IconOxygenEmail}
|
||||
title={'邮件'}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:mail']}
|
||||
expand={
|
||||
<AntdButton onClick={handleOnTest} title={'测试'}>
|
||||
<Icon component={IconOxygenTest} />
|
||||
</AntdButton>
|
||||
}
|
||||
<SettingsCard
|
||||
icon={IconOxygenEmail}
|
||||
title={'邮件'}
|
||||
loading={isLoading}
|
||||
onReset={handleOnReset}
|
||||
onSave={handleOnSave}
|
||||
modifyOperationCode={['system:settings:modify:mail']}
|
||||
expand={
|
||||
<AntdButton onClick={handleOnTest} title={'测试'}>
|
||||
<Icon component={IconOxygenTest} />
|
||||
</AntdButton>
|
||||
}
|
||||
>
|
||||
<AntdForm
|
||||
form={mailForm}
|
||||
labelCol={{ flex: '8em' }}
|
||||
disabled={!hasPermission('system:settings:modify:mail')}
|
||||
>
|
||||
<AntdForm
|
||||
form={mailForm}
|
||||
labelCol={{ flex: '8em' }}
|
||||
disabled={!hasPermission('system:settings:modify:mail')}
|
||||
>
|
||||
<AntdForm.Item label={'SMTP 服务器'} name={'host'}>
|
||||
<AntdInput placeholder={'请输入 SMTP 服务器'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'端口号'} name={'port'}>
|
||||
<AntdInputNumber
|
||||
min={0}
|
||||
max={65535}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={'请输入端口号'}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'安全类型'} name={'securityType'}>
|
||||
<AntdSelect placeholder={'请选择安全类型'}>
|
||||
<AntdSelect.Option key={'None'}>None</AntdSelect.Option>
|
||||
<AntdSelect.Option key={'SSL/TLS'}>SSL/TLS</AntdSelect.Option>
|
||||
<AntdSelect.Option key={'StartTls'}>StartTls</AntdSelect.Option>
|
||||
</AntdSelect>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'用户名'} name={'username'}>
|
||||
<AntdInput placeholder={'请输入用户名'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'密码'} name={'password'}>
|
||||
<AntdInput.Password placeholder={'请输入密码'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'发送者'} name={'from'}>
|
||||
<AntdInput placeholder={'请输入发送者'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'发送者名称'} name={'fromName'}>
|
||||
<AntdInput placeholder={'请输入发送者名称'} />
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
</SettingsCard>
|
||||
{contextHolder}
|
||||
</>
|
||||
<AntdForm.Item label={'SMTP 服务器'} name={'host'}>
|
||||
<AntdInput placeholder={'请输入 SMTP 服务器'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'端口号'} name={'port'}>
|
||||
<AntdInputNumber
|
||||
min={0}
|
||||
max={65535}
|
||||
style={{ width: '100%' }}
|
||||
placeholder={'请输入端口号'}
|
||||
/>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'安全类型'} name={'securityType'}>
|
||||
<AntdSelect placeholder={'请选择安全类型'}>
|
||||
<AntdSelect.Option key={'None'}>None</AntdSelect.Option>
|
||||
<AntdSelect.Option key={'SSL/TLS'}>SSL/TLS</AntdSelect.Option>
|
||||
<AntdSelect.Option key={'StartTls'}>StartTls</AntdSelect.Option>
|
||||
</AntdSelect>
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'用户名'} name={'username'}>
|
||||
<AntdInput placeholder={'请输入用户名'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'密码'} name={'password'}>
|
||||
<AntdInput.Password placeholder={'请输入密码'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'发送者'} name={'from'}>
|
||||
<AntdInput placeholder={'请输入发送者'} />
|
||||
</AntdForm.Item>
|
||||
<AntdForm.Item label={'发送者名称'} name={'fromName'}>
|
||||
<AntdInput placeholder={'请输入发送者名称'} />
|
||||
</AntdForm.Item>
|
||||
</AntdForm>
|
||||
</SettingsCard>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ChangeEvent } from 'react'
|
||||
import Icon from '@ant-design/icons'
|
||||
import { DATABASE_DUPLICATE_KEY, DATABASE_INSERT_SUCCESS } from '@/constants/common.constants'
|
||||
import { message } from '@/util/common'
|
||||
import {
|
||||
r_sys_settings_sensitive_add,
|
||||
r_sys_settings_sensitive_delete,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { message } from '@/util/common'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import { r_sys_settings_two_factor_get, r_sys_settings_two_factor_update } from '@/services/system'
|
||||
import SettingsCard from '@/components/system/SettingCard'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import useStyles from '@/assets/css/pages/system/statistics/common.style'
|
||||
import { message } from '@/util/common'
|
||||
import { r_sys_statistics_hardware } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
import StatisticsCard from '@/components/system/StatisticsCard'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import useStyles from '@/assets/css/pages/system/statistics/common.style'
|
||||
import { message } from '@/util/common'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { r_sys_statistics_software } from '@/services/system'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import editorExtraLibs from '@/util/editorExtraLibs'
|
||||
@@ -43,7 +44,6 @@ const Base = () => {
|
||||
({ currentLocation, nextLocation }) =>
|
||||
currentLocation.pathname !== nextLocation.pathname && Object.keys(hasEdited).length > 0
|
||||
)
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [tableParams, setTableParams] = useState<TableParam>({
|
||||
pagination: {
|
||||
current: 1,
|
||||
@@ -1093,6 +1093,7 @@ const Base = () => {
|
||||
expandedRowRender,
|
||||
onExpand: handleOnExpand
|
||||
}}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleOnTableChange}
|
||||
/>
|
||||
</Card>
|
||||
@@ -1134,7 +1135,6 @@ const Base = () => {
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
</FitFullscreen>
|
||||
{contextHolder}
|
||||
<AntdModal
|
||||
open={blocker.state === 'blocked'}
|
||||
title={'未保存'}
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import {
|
||||
r_sys_tool_category_add,
|
||||
@@ -20,7 +21,6 @@ import HideScrollbar from '@/components/common/HideScrollbar'
|
||||
|
||||
const Category = () => {
|
||||
const theme = useTheme()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [form] = AntdForm.useForm<ToolCategoryAddEditParam>()
|
||||
const formValues = AntdForm.useWatch([], form)
|
||||
const [newFormValues, setNewFormValues] = useState<ToolCategoryAddEditParam>()
|
||||
@@ -298,6 +298,7 @@ const Category = () => {
|
||||
columns={categoryColumns}
|
||||
rowKey={(record) => record.id}
|
||||
loading={isLoading}
|
||||
scroll={{ x: true }}
|
||||
pagination={false}
|
||||
/>
|
||||
</Card>
|
||||
@@ -313,7 +314,6 @@ const Category = () => {
|
||||
>
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
{contextHolder}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import Draggable from 'react-draggable'
|
||||
import Icon from '@ant-design/icons'
|
||||
import useStyles from '@/assets/css/pages/system/tools/code.style'
|
||||
import { DATABASE_NO_RECORD_FOUND, DATABASE_SELECT_SUCCESS } from '@/constants/common.constants'
|
||||
import { checkDesktop } from '@/util/common'
|
||||
import { message, modal, checkDesktop } from '@/util/common'
|
||||
import { navigateToExecute, navigateToRepository } from '@/util/navigation'
|
||||
import editorExtraLibs from '@/util/editorExtraLibs'
|
||||
import { r_sys_tool_get_one } from '@/services/system'
|
||||
@@ -17,7 +17,6 @@ const Code = () => {
|
||||
const { styles } = useStyles()
|
||||
const { isDarkMode } = useContext(AppContext)
|
||||
const navigate = useNavigate()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const { id } = useParams()
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
const [files, setFiles] = useState<IFiles>({})
|
||||
@@ -106,7 +105,6 @@ const Code = () => {
|
||||
</div>
|
||||
</Draggable>
|
||||
</FitFullscreen>
|
||||
{contextHolder}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import useStyles from '@/assets/css/pages/system/tools/execute.style'
|
||||
import { DATABASE_NO_RECORD_FOUND, DATABASE_SELECT_SUCCESS } from '@/constants/common.constants'
|
||||
import { message } from '@/util/common'
|
||||
import { navigateToTools } from '@/util/navigation'
|
||||
import { r_sys_tool_get_one } from '@/services/system'
|
||||
import FitFullscreen from '@/components/common/FitFullscreen'
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { utcToLocalTime } from '@/util/datetime'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import editorExtraLibs from '@/util/editorExtraLibs'
|
||||
@@ -41,7 +42,6 @@ const Template = () => {
|
||||
({ currentLocation, nextLocation }) =>
|
||||
currentLocation.pathname !== nextLocation.pathname && Object.keys(hasEdited).length > 0
|
||||
)
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [tableParams, setTableParams] = useState<TableParam>({
|
||||
pagination: {
|
||||
current: 1,
|
||||
@@ -1078,7 +1078,6 @@ const Template = () => {
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
</FitFullscreen>
|
||||
{contextHolder}
|
||||
<AntdModal
|
||||
open={blocker.state === 'blocked'}
|
||||
title={'未保存'}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
DATABASE_UPDATE_SUCCESS,
|
||||
TOOL_NOT_UNDER_REVIEW
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { navigateToCode } from '@/util/navigation'
|
||||
import {
|
||||
r_sys_tool_delete,
|
||||
@@ -28,7 +29,6 @@ import Permission from '@/components/common/Permission'
|
||||
const Tools = () => {
|
||||
const theme = useTheme()
|
||||
const navigate = useNavigate()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
const [tableParams, setTableParams] = useState<TableParam>({
|
||||
pagination: {
|
||||
current: 1,
|
||||
@@ -572,27 +572,25 @@ const Tools = () => {
|
||||
columns={dataColumns}
|
||||
pagination={tableParams.pagination}
|
||||
loading={isLoading}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleOnTableChange}
|
||||
/>
|
||||
</Card>
|
||||
)
|
||||
|
||||
return (
|
||||
<>
|
||||
<FitFullscreen>
|
||||
<HideScrollbar
|
||||
style={{ padding: 20 }}
|
||||
isShowVerticalScrollbar
|
||||
autoHideWaitingTime={1000}
|
||||
>
|
||||
<FlexBox gap={20}>
|
||||
{toolbar}
|
||||
{table}
|
||||
</FlexBox>
|
||||
</HideScrollbar>
|
||||
</FitFullscreen>
|
||||
{contextHolder}
|
||||
</>
|
||||
<FitFullscreen>
|
||||
<HideScrollbar
|
||||
style={{ padding: 20 }}
|
||||
isShowVerticalScrollbar
|
||||
autoHideWaitingTime={1000}
|
||||
>
|
||||
<FlexBox gap={20}>
|
||||
{toolbar}
|
||||
{table}
|
||||
</FlexBox>
|
||||
</HideScrollbar>
|
||||
</FitFullscreen>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
DATABASE_SELECT_SUCCESS,
|
||||
DATABASE_UPDATE_SUCCESS
|
||||
} from '@/constants/common.constants'
|
||||
import { message, modal } from '@/util/common'
|
||||
import { hasPermission } from '@/util/auth'
|
||||
import { utcToLocalTime, isPastTime, localTimeToUtc, dayjsToUtc, getNowUtc } from '@/util/datetime'
|
||||
import {
|
||||
@@ -35,7 +36,6 @@ interface ChangePasswordFields extends UserUpdatePasswordParam {
|
||||
|
||||
const User = () => {
|
||||
const theme = useTheme()
|
||||
const [modal, contextHolder] = AntdModal.useModal()
|
||||
|
||||
const [isDrawerOpen, setIsDrawerOpen] = useState(false)
|
||||
const [isDrawerEdit, setIsDrawerEdit] = useState(false)
|
||||
@@ -972,6 +972,7 @@ const User = () => {
|
||||
rowKey={(record) => record.id}
|
||||
pagination={tableParams.pagination}
|
||||
loading={isLoadingUserData}
|
||||
scroll={{ x: true }}
|
||||
onChange={handleOnTableChange}
|
||||
rowSelection={
|
||||
hasPermission('system:user:delete:multiple')
|
||||
@@ -1031,7 +1032,6 @@ const User = () => {
|
||||
>
|
||||
{addAndEditForm}
|
||||
</AntdDrawer>
|
||||
{contextHolder}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user