Complete main UI #37
@@ -11,11 +11,11 @@ export const URL_SYS_GROUP = '/system/group'
|
|||||||
export const URL_SYS_GROUP_LIST = '/system/group/list'
|
export const URL_SYS_GROUP_LIST = '/system/group/list'
|
||||||
export const URL_SYS_SETTINGS = '/system/settings'
|
export const URL_SYS_SETTINGS = '/system/settings'
|
||||||
export const URL_SYS_SETTINGS_MAIL = `${URL_SYS_SETTINGS}/mail`
|
export const URL_SYS_SETTINGS_MAIL = `${URL_SYS_SETTINGS}/mail`
|
||||||
export const URL_SYS_STATISTICS = '/system/statistics'
|
export const URL_SYS_STATISTIC = '/system/statistic'
|
||||||
export const URL_SYS_STATISTICS_SOFTWARE = `${URL_SYS_STATISTICS}/software`
|
export const URL_SYS_STATISTIC_SOFTWARE = `${URL_SYS_STATISTIC}/software`
|
||||||
export const URL_SYS_STATISTICS_HARDWARE = `${URL_SYS_STATISTICS}/hardware`
|
export const URL_SYS_STATISTIC_HARDWARE = `${URL_SYS_STATISTIC}/hardware`
|
||||||
export const URL_SYS_STATISTICS_CPU = `${URL_SYS_STATISTICS}/cpu`
|
export const URL_SYS_STATISTIC_CPU = `${URL_SYS_STATISTIC}/cpu`
|
||||||
export const URL_SYS_STATISTICS_STORAGE = `${URL_SYS_STATISTICS}/storage`
|
export const URL_SYS_STATISTIC_STORAGE = `${URL_SYS_STATISTIC}/storage`
|
||||||
|
|
||||||
export const URL_API_V1 = '/api/v1'
|
export const URL_API_V1 = '/api/v1'
|
||||||
export const URL_API_V1_AVATAR_RANDOM_BASE64 = `${URL_API_V1}/avatar/base64`
|
export const URL_API_V1_AVATAR_RANDOM_BASE64 = `${URL_API_V1}/avatar/base64`
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import { useUpdatedEffect } from '@/util/hooks'
|
|||||||
import { formatByteSize } from '@/util/common'
|
import { formatByteSize } from '@/util/common'
|
||||||
import { utcToLocalTime } from '@/util/datetime'
|
import { utcToLocalTime } from '@/util/datetime'
|
||||||
import {
|
import {
|
||||||
r_sys_statistics_cpu,
|
r_sys_statistic_cpu,
|
||||||
r_sys_statistics_hardware,
|
r_sys_statistic_hardware,
|
||||||
r_sys_statistics_software,
|
r_sys_statistic_software,
|
||||||
r_sys_statistics_storage
|
r_sys_statistic_storage
|
||||||
} from '@/services/system'
|
} from '@/services/system'
|
||||||
import Card from '@/components/common/Card'
|
import Card from '@/components/common/Card'
|
||||||
import FlexBox from '@/components/common/FlexBox'
|
import FlexBox from '@/components/common/FlexBox'
|
||||||
@@ -101,7 +101,7 @@ const SoftwareInfo: React.FC = () => {
|
|||||||
const [softwareInfoData, setSoftwareInfoData] = useState<SoftwareInfoVo>()
|
const [softwareInfoData, setSoftwareInfoData] = useState<SoftwareInfoVo>()
|
||||||
|
|
||||||
useUpdatedEffect(() => {
|
useUpdatedEffect(() => {
|
||||||
void r_sys_statistics_software().then((res) => {
|
void r_sys_statistic_software().then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
response.data && setSoftwareInfoData(response.data)
|
response.data && setSoftwareInfoData(response.data)
|
||||||
@@ -163,7 +163,7 @@ const HardwareInfo: React.FC = () => {
|
|||||||
const [hardwareInfoData, setHardwareInfoData] = useState<HardwareInfoVo>()
|
const [hardwareInfoData, setHardwareInfoData] = useState<HardwareInfoVo>()
|
||||||
|
|
||||||
useUpdatedEffect(() => {
|
useUpdatedEffect(() => {
|
||||||
void r_sys_statistics_hardware().then((res) => {
|
void r_sys_statistic_hardware().then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
response.data && setHardwareInfoData(response.data)
|
response.data && setHardwareInfoData(response.data)
|
||||||
@@ -254,7 +254,7 @@ const CPUInfo: React.FC = () => {
|
|||||||
}, [refreshInterval])
|
}, [refreshInterval])
|
||||||
|
|
||||||
const getCpuInfo = () => {
|
const getCpuInfo = () => {
|
||||||
void r_sys_statistics_cpu().then((res) => {
|
void r_sys_statistic_cpu().then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
@@ -420,7 +420,7 @@ const StorageInfo: React.FC = () => {
|
|||||||
}, [refreshInterval])
|
}, [refreshInterval])
|
||||||
|
|
||||||
const getStorageInfo = () => {
|
const getStorageInfo = () => {
|
||||||
void r_sys_statistics_storage().then((res) => {
|
void r_sys_statistic_storage().then((res) => {
|
||||||
const response = res.data
|
const response = res.data
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ import {
|
|||||||
URL_SYS_GROUP_LIST,
|
URL_SYS_GROUP_LIST,
|
||||||
URL_SYS_LOG,
|
URL_SYS_LOG,
|
||||||
URL_SYS_SETTINGS_MAIL,
|
URL_SYS_SETTINGS_MAIL,
|
||||||
URL_SYS_STATISTICS_SOFTWARE,
|
URL_SYS_STATISTIC_SOFTWARE,
|
||||||
URL_SYS_STATISTICS_HARDWARE,
|
URL_SYS_STATISTIC_HARDWARE,
|
||||||
URL_SYS_STATISTICS_CPU,
|
URL_SYS_STATISTIC_CPU,
|
||||||
URL_SYS_STATISTICS_STORAGE
|
URL_SYS_STATISTIC_STORAGE
|
||||||
} from '@/constants/urls.constants'
|
} from '@/constants/urls.constants'
|
||||||
import request from '@/services/index'
|
import request from '@/services/index'
|
||||||
|
|
||||||
@@ -77,12 +77,12 @@ export const r_sys_settings_mail_update = (param: MailSettingsParam) =>
|
|||||||
export const r_sys_settings_mail_send = (param: MailSendParam) =>
|
export const r_sys_settings_mail_send = (param: MailSendParam) =>
|
||||||
request.post(URL_SYS_SETTINGS_MAIL, param)
|
request.post(URL_SYS_SETTINGS_MAIL, param)
|
||||||
|
|
||||||
export const r_sys_statistics_software = () =>
|
export const r_sys_statistic_software = () =>
|
||||||
request.get<SoftwareInfoVo>(URL_SYS_STATISTICS_SOFTWARE)
|
request.get<SoftwareInfoVo>(URL_SYS_STATISTIC_SOFTWARE)
|
||||||
|
|
||||||
export const r_sys_statistics_hardware = () =>
|
export const r_sys_statistic_hardware = () =>
|
||||||
request.get<HardwareInfoVo>(URL_SYS_STATISTICS_HARDWARE)
|
request.get<HardwareInfoVo>(URL_SYS_STATISTIC_HARDWARE)
|
||||||
|
|
||||||
export const r_sys_statistics_cpu = () => request.get<CpuInfoVo>(URL_SYS_STATISTICS_CPU)
|
export const r_sys_statistic_cpu = () => request.get<CpuInfoVo>(URL_SYS_STATISTIC_CPU)
|
||||||
|
|
||||||
export const r_sys_statistics_storage = () => request.get<StorageInfoVo>(URL_SYS_STATISTICS_STORAGE)
|
export const r_sys_statistic_storage = () => request.get<StorageInfoVo>(URL_SYS_STATISTIC_STORAGE)
|
||||||
|
|||||||
Reference in New Issue
Block a user