Complete main UI #37
@@ -11,13 +11,13 @@ export const URL_SYS_GROUP = '/system/group'
|
||||
export const URL_SYS_GROUP_LIST = '/system/group/list'
|
||||
export const URL_SYS_SETTINGS = '/system/settings'
|
||||
export const URL_SYS_SETTINGS_MAIL = `${URL_SYS_SETTINGS}/mail`
|
||||
export const URL_SYS_STATISTIC = '/system/statistic'
|
||||
export const URL_SYS_STATISTIC_SOFTWARE = `${URL_SYS_STATISTIC}/software`
|
||||
export const URL_SYS_STATISTIC_HARDWARE = `${URL_SYS_STATISTIC}/hardware`
|
||||
export const URL_SYS_STATISTIC_CPU = `${URL_SYS_STATISTIC}/cpu`
|
||||
export const URL_SYS_STATISTIC_STORAGE = `${URL_SYS_STATISTIC}/storage`
|
||||
export const URL_SYS_STATISTIC_ONLINE = `${URL_SYS_STATISTIC}/online`
|
||||
export const URL_SYS_STATISTIC_ACTIVE = `${URL_SYS_STATISTIC}/active`
|
||||
export const URL_SYS_STATISTICS = '/system/statistics'
|
||||
export const URL_SYS_STATISTICS_SOFTWARE = `${URL_SYS_STATISTICS}/software`
|
||||
export const URL_SYS_STATISTICS_HARDWARE = `${URL_SYS_STATISTICS}/hardware`
|
||||
export const URL_SYS_STATISTICS_CPU = `${URL_SYS_STATISTICS}/cpu`
|
||||
export const URL_SYS_STATISTICS_STORAGE = `${URL_SYS_STATISTICS}/storage`
|
||||
export const URL_SYS_STATISTICS_ONLINE = `${URL_SYS_STATISTICS}/online`
|
||||
export const URL_SYS_STATISTICS_ACTIVE = `${URL_SYS_STATISTICS}/active`
|
||||
|
||||
export const URL_API_V1 = '/api/v1'
|
||||
export const URL_API_V1_AVATAR_RANDOM_BASE64 = `${URL_API_V1}/avatar/base64`
|
||||
|
||||
@@ -12,7 +12,7 @@ const SystemFramework: React.FC = () => {
|
||||
<>
|
||||
<FitFullScreen className={'flex-horizontal'}>
|
||||
<div className={'left-panel'}>
|
||||
<Sidebar title={'系统设置'}>
|
||||
<Sidebar title={'系统配置'}>
|
||||
<SidebarItemList>
|
||||
{getSystemRouteJson().map((value) => {
|
||||
return value.menu ? (
|
||||
|
||||
@@ -21,7 +21,7 @@ const ToolsFramework: React.FC = () => {
|
||||
<SidebarItem
|
||||
path={'/system'}
|
||||
icon={IconFatwebSetting}
|
||||
text={'系统设置'}
|
||||
text={'系统配置'}
|
||||
/>
|
||||
</SidebarItemList>
|
||||
) : undefined
|
||||
|
||||
@@ -42,7 +42,7 @@ const Log: React.FC = () => {
|
||||
{ text: 'Login', value: 'LOGIN' },
|
||||
{ text: 'Logout', value: 'LOGOUT' },
|
||||
{ text: 'Register', value: 'Register' },
|
||||
{ text: 'Statistic', value: 'STATISTIC' },
|
||||
{ text: 'Statistics', value: 'STATISTICS' },
|
||||
{ text: 'API', value: 'API' },
|
||||
{ text: 'Error', value: 'ERROR' }
|
||||
]
|
||||
|
||||
@@ -15,17 +15,17 @@ import { BarChart, BarSeriesOption, LineChart, LineSeriesOption } from 'echarts/
|
||||
import { UniversalTransition } from 'echarts/features'
|
||||
import { SVGRenderer } from 'echarts/renderers'
|
||||
import { TopLevelFormatterParams } from 'echarts/types/dist/shared'
|
||||
import '@/assets/css/pages/system/statistic.scss'
|
||||
import '@/assets/css/pages/system/statistics.scss'
|
||||
import { useUpdatedEffect } from '@/util/hooks'
|
||||
import { formatByteSize } from '@/util/common'
|
||||
import { getTimesBetweenTwoTimes, utcToLocalTime } from '@/util/datetime'
|
||||
import {
|
||||
r_sys_statistic_active,
|
||||
r_sys_statistic_cpu,
|
||||
r_sys_statistic_hardware,
|
||||
r_sys_statistic_online,
|
||||
r_sys_statistic_software,
|
||||
r_sys_statistic_storage
|
||||
r_sys_statistics_active,
|
||||
r_sys_statistics_cpu,
|
||||
r_sys_statistics_hardware,
|
||||
r_sys_statistics_online,
|
||||
r_sys_statistics_software,
|
||||
r_sys_statistics_storage
|
||||
} from '@/services/system'
|
||||
import Card from '@/components/common/Card'
|
||||
import FlexBox from '@/components/common/FlexBox'
|
||||
@@ -214,7 +214,7 @@ const OnlineInfo: React.FC = () => {
|
||||
|
||||
setIsLoading(true)
|
||||
|
||||
void r_sys_statistic_online({ scope: _scope }).then((res) => {
|
||||
void r_sys_statistics_online({ scope: _scope }).then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
@@ -345,7 +345,7 @@ const ActiveInfo: React.FC = () => {
|
||||
|
||||
setIsLoading(true)
|
||||
|
||||
void r_sys_statistic_active({ scope: _scope }).then((res) => {
|
||||
void r_sys_statistics_active({ scope: _scope }).then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
@@ -465,7 +465,7 @@ const SoftwareInfo: React.FC = () => {
|
||||
const [softwareInfoData, setSoftwareInfoData] = useState<SoftwareInfoVo>()
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
void r_sys_statistic_software().then((res) => {
|
||||
void r_sys_statistics_software().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
response.data && setSoftwareInfoData(response.data)
|
||||
@@ -527,7 +527,7 @@ const HardwareInfo: React.FC = () => {
|
||||
const [hardwareInfoData, setHardwareInfoData] = useState<HardwareInfoVo>()
|
||||
|
||||
useUpdatedEffect(() => {
|
||||
void r_sys_statistic_hardware().then((res) => {
|
||||
void r_sys_statistics_hardware().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
response.data && setHardwareInfoData(response.data)
|
||||
@@ -618,7 +618,7 @@ const CPUInfo: React.FC = () => {
|
||||
}, [refreshInterval])
|
||||
|
||||
const getCpuInfo = () => {
|
||||
void r_sys_statistic_cpu().then((res) => {
|
||||
void r_sys_statistics_cpu().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
@@ -784,7 +784,7 @@ const StorageInfo: React.FC = () => {
|
||||
}, [refreshInterval])
|
||||
|
||||
const getStorageInfo = () => {
|
||||
void r_sys_statistic_storage().then((res) => {
|
||||
void r_sys_statistics_storage().then((res) => {
|
||||
const response = res.data
|
||||
if (response.success) {
|
||||
const data = response.data
|
||||
@@ -935,21 +935,21 @@ const StorageInfo: React.FC = () => {
|
||||
)
|
||||
}
|
||||
|
||||
const Statistic: React.FC = () => {
|
||||
const Statistics: React.FC = () => {
|
||||
return (
|
||||
<>
|
||||
<FitFullScreen>
|
||||
<HideScrollbar isShowVerticalScrollbar autoHideWaitingTime={500}>
|
||||
<FlexBox direction={'horizontal'} className={'root-content'}>
|
||||
<Permission operationCode={'system:statistic:query:usage'}>
|
||||
<Permission operationCode={'system:statistics:query:usage'}>
|
||||
<OnlineInfo />
|
||||
<ActiveInfo />
|
||||
</Permission>
|
||||
<Permission operationCode={'system:statistic:query:base'}>
|
||||
<Permission operationCode={'system:statistics:query:base'}>
|
||||
<SoftwareInfo />
|
||||
<HardwareInfo />
|
||||
</Permission>
|
||||
<Permission operationCode={'system:statistic:query:real'}>
|
||||
<Permission operationCode={'system:statistics:query:real'}>
|
||||
<CPUInfo />
|
||||
<StorageInfo />
|
||||
</Permission>
|
||||
@@ -960,4 +960,4 @@ const Statistic: React.FC = () => {
|
||||
)
|
||||
}
|
||||
|
||||
export default Statistic
|
||||
export default Statistics
|
||||
@@ -12,10 +12,10 @@ const system: RouteJsonObject[] = [
|
||||
menu: true
|
||||
},
|
||||
{
|
||||
path: 'statistic',
|
||||
absolutePath: '/system/statistic',
|
||||
id: 'system-statistic',
|
||||
component: React.lazy(() => import('@/pages/system/Statistic')),
|
||||
path: 'statistics',
|
||||
absolutePath: '/system/statistics',
|
||||
id: 'system-statistics',
|
||||
component: React.lazy(() => import('@/pages/system/Statistics')),
|
||||
name: '系统概况',
|
||||
icon: React.lazy(() => import('~icons/fatweb/chart.jsx')),
|
||||
menu: true,
|
||||
|
||||
@@ -9,12 +9,12 @@ import {
|
||||
URL_SYS_GROUP_LIST,
|
||||
URL_SYS_LOG,
|
||||
URL_SYS_SETTINGS_MAIL,
|
||||
URL_SYS_STATISTIC_SOFTWARE,
|
||||
URL_SYS_STATISTIC_HARDWARE,
|
||||
URL_SYS_STATISTIC_CPU,
|
||||
URL_SYS_STATISTIC_STORAGE,
|
||||
URL_SYS_STATISTIC_ONLINE,
|
||||
URL_SYS_STATISTIC_ACTIVE
|
||||
URL_SYS_STATISTICS_SOFTWARE,
|
||||
URL_SYS_STATISTICS_HARDWARE,
|
||||
URL_SYS_STATISTICS_CPU,
|
||||
URL_SYS_STATISTICS_STORAGE,
|
||||
URL_SYS_STATISTICS_ONLINE,
|
||||
URL_SYS_STATISTICS_ACTIVE
|
||||
} from '@/constants/urls.constants'
|
||||
import request from '@/services/index'
|
||||
|
||||
@@ -79,18 +79,18 @@ export const r_sys_settings_mail_update = (param: MailSettingsParam) =>
|
||||
export const r_sys_settings_mail_send = (param: MailSendParam) =>
|
||||
request.post(URL_SYS_SETTINGS_MAIL, param)
|
||||
|
||||
export const r_sys_statistic_software = () =>
|
||||
request.get<SoftwareInfoVo>(URL_SYS_STATISTIC_SOFTWARE)
|
||||
export const r_sys_statistics_software = () =>
|
||||
request.get<SoftwareInfoVo>(URL_SYS_STATISTICS_SOFTWARE)
|
||||
|
||||
export const r_sys_statistic_hardware = () =>
|
||||
request.get<HardwareInfoVo>(URL_SYS_STATISTIC_HARDWARE)
|
||||
export const r_sys_statistics_hardware = () =>
|
||||
request.get<HardwareInfoVo>(URL_SYS_STATISTICS_HARDWARE)
|
||||
|
||||
export const r_sys_statistic_cpu = () => request.get<CpuInfoVo>(URL_SYS_STATISTIC_CPU)
|
||||
export const r_sys_statistics_cpu = () => request.get<CpuInfoVo>(URL_SYS_STATISTICS_CPU)
|
||||
|
||||
export const r_sys_statistic_storage = () => request.get<StorageInfoVo>(URL_SYS_STATISTIC_STORAGE)
|
||||
export const r_sys_statistics_storage = () => request.get<StorageInfoVo>(URL_SYS_STATISTICS_STORAGE)
|
||||
|
||||
export const r_sys_statistic_online = (param: OnlineInfoGetParam) =>
|
||||
request.get<OnlineInfoVo>(URL_SYS_STATISTIC_ONLINE, param)
|
||||
export const r_sys_statistics_online = (param: OnlineInfoGetParam) =>
|
||||
request.get<OnlineInfoVo>(URL_SYS_STATISTICS_ONLINE, param)
|
||||
|
||||
export const r_sys_statistic_active = (param: ActiveInfoGetParam) =>
|
||||
request.get<ActiveInfoVo>(URL_SYS_STATISTIC_ACTIVE, param)
|
||||
export const r_sys_statistics_active = (param: ActiveInfoGetParam) =>
|
||||
request.get<ActiveInfoVo>(URL_SYS_STATISTICS_ACTIVE, param)
|
||||
|
||||
Reference in New Issue
Block a user