feat(master/manager/device): Enhance device management with new detail view, API updates, and improved request handling

This commit is contained in:
Tran Anh Tuan
2026-01-27 12:18:28 +07:00
parent a11e2c2991
commit 6d1c085ff7
20 changed files with 516 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ import {
} from '@/components/shared/ThingShared';
import TreeGroup from '@/components/shared/TreeGroup';
import { DEFAULT_PAGE_SIZE } from '@/constants';
import { ROUTE_MANAGER_DEVICES } from '@/constants/routes';
import { apiSearchThings } from '@/services/master/ThingController';
import {
ActionType,
@@ -12,12 +13,12 @@ import {
ProColumns,
ProTable,
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import { FormattedMessage, history, useIntl } from '@umijs/max';
import { Flex, Grid, theme, Typography } from 'antd';
import moment from 'moment';
import React, { useRef, useState } from 'react';
import { TagStateCallbackPayload } from '../../SGW/Map/type';
const { Text } = Typography;
const { Text, Link } = Typography;
const SpoleHome: React.FC = () => {
const { useBreakpoint } = Grid;
const intl = useIntl();
@@ -39,9 +40,6 @@ const SpoleHome: React.FC = () => {
{
key: 'name',
ellipsis: true,
title: (
<FormattedMessage id="master.devices.name" defaultMessage="Name" />
),
tip: intl.formatMessage({
id: 'master.devices.name.tip',
defaultMessage: 'The device name',
@@ -49,6 +47,20 @@ const SpoleHome: React.FC = () => {
dataIndex: 'name',
hideInSearch: true,
copyable: true,
render: (_, row) => {
return (
<Link
copyable
onClick={() => history.push(`${ROUTE_MANAGER_DEVICES}/${row.id}`)}
>
{row.name ||
intl.formatMessage({
id: 'common.undefined',
defaultMessage: 'Undefined',
})}
</Link>
);
},
},
{
key: 'connected',