переходный вариант
This commit is contained in:
parent
e876b9e05f
commit
581a03e29d
2 changed files with 45 additions and 12 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
import {
|
import {
|
||||||
ApiOutlined,
|
ApiOutlined,
|
||||||
|
ControlOutlined,
|
||||||
|
DatabaseOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
EyeOutlined,
|
EyeOutlined,
|
||||||
|
|
@ -22,6 +24,7 @@ import {
|
||||||
Modal,
|
Modal,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Row,
|
Row,
|
||||||
|
Segmented,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Spin,
|
Spin,
|
||||||
|
|
@ -553,7 +556,20 @@ export function InventoryObjectDetailPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Breadcrumb style={{ marginBottom: 16 }} items={breadcrumbItems} />
|
<Row justify="space-between" align="middle" style={{ marginBottom: 16 }}>
|
||||||
|
<Col><Breadcrumb items={breadcrumbItems} /></Col>
|
||||||
|
<Col>
|
||||||
|
{/* TODO (Вариант В): заменить Segmented на <Tabs> с вкладками Устройства / Задачи / Снапшоты */}
|
||||||
|
<Segmented
|
||||||
|
value="inventory"
|
||||||
|
options={[
|
||||||
|
{ label: 'Инвентарь', value: 'inventory', icon: <DatabaseOutlined /> },
|
||||||
|
{ label: 'Работа', value: 'work', icon: <ControlOutlined /> },
|
||||||
|
]}
|
||||||
|
onChange={(val) => { if (val === 'work') navigate(`/work/objects/${objId}`) }}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
<Row gutter={16} style={{ marginBottom: 16 }}>
|
<Row gutter={16} style={{ marginBottom: 16 }}>
|
||||||
<Col flex="auto">
|
<Col flex="auto">
|
||||||
|
|
@ -569,7 +585,7 @@ export function InventoryObjectDetailPage() {
|
||||||
<Button icon={<ApiOutlined />} loading={discoverMutation.isPending} onClick={handleDiscover}>
|
<Button icon={<ApiOutlined />} loading={discoverMutation.isPending} onClick={handleDiscover}>
|
||||||
SSH Discovery
|
SSH Discovery
|
||||||
</Button>
|
</Button>
|
||||||
/*
|
{/*
|
||||||
<Button icon={<SyncOutlined />} loading={syncMutation.isPending} onClick={handleSync}>
|
<Button icon={<SyncOutlined />} loading={syncMutation.isPending} onClick={handleSync}>
|
||||||
Синхронизировать из БД
|
Синхронизировать из БД
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -579,7 +595,7 @@ export function InventoryObjectDetailPage() {
|
||||||
<Button icon={<GoogleOutlined />} onClick={() => setSheetsModal(true)}>
|
<Button icon={<GoogleOutlined />} onClick={() => setSheetsModal(true)}>
|
||||||
Google Sheets
|
Google Sheets
|
||||||
</Button>
|
</Button>
|
||||||
*/
|
*/}
|
||||||
<Button icon={<PlusOutlined />} type="primary" onClick={openAddDevice}>
|
<Button icon={<PlusOutlined />} type="primary" onClick={openAddDevice}>
|
||||||
Добавить устройство
|
Добавить устройство
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
import {
|
import {
|
||||||
|
ControlOutlined,
|
||||||
|
DatabaseOutlined,
|
||||||
DeleteOutlined,
|
DeleteOutlined,
|
||||||
EditOutlined,
|
EditOutlined,
|
||||||
FileTextOutlined,
|
FileTextOutlined,
|
||||||
|
|
@ -23,6 +25,7 @@ import {
|
||||||
Modal,
|
Modal,
|
||||||
Popconfirm,
|
Popconfirm,
|
||||||
Row,
|
Row,
|
||||||
|
Segmented,
|
||||||
Select,
|
Select,
|
||||||
Space,
|
Space,
|
||||||
Spin,
|
Spin,
|
||||||
|
|
@ -471,13 +474,27 @@ export function ObjectDetailPage() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Breadcrumb
|
<Row justify="space-between" align="middle" style={{ marginBottom: 16 }}>
|
||||||
style={{ marginBottom: 16 }}
|
<Col>
|
||||||
items={[
|
<Breadcrumb
|
||||||
{ title: <a onClick={() => navigate('/objects')}>Объекты</a> },
|
items={[
|
||||||
{ title: obj?.name },
|
{ title: <a onClick={() => navigate('/work/objects')}>Объекты</a> },
|
||||||
]}
|
{ title: obj?.name },
|
||||||
/>
|
]}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
<Col>
|
||||||
|
{/* TODO (Вариант В): заменить Segmented на <Tabs> с вкладками Устройства / Задачи / Снапшоты */}
|
||||||
|
<Segmented
|
||||||
|
value="work"
|
||||||
|
options={[
|
||||||
|
{ label: 'Инвентарь', value: 'inventory', icon: <DatabaseOutlined /> },
|
||||||
|
{ label: 'Работа', value: 'work', icon: <ControlOutlined /> },
|
||||||
|
]}
|
||||||
|
onChange={(val) => { if (val === 'inventory') navigate(`/inventory/objects/${objId}`) }}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
|
||||||
<Row gutter={16} style={{ marginBottom: 16 }}>
|
<Row gutter={16} style={{ marginBottom: 16 }}>
|
||||||
<Col flex="auto">
|
<Col flex="auto">
|
||||||
|
|
@ -489,7 +506,7 @@ export function ObjectDetailPage() {
|
||||||
</Col>
|
</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<Space>
|
<Space>
|
||||||
/*
|
{/*
|
||||||
<Button icon={<SyncOutlined />} loading={syncMutation.isPending} onClick={handleSync}>
|
<Button icon={<SyncOutlined />} loading={syncMutation.isPending} onClick={handleSync}>
|
||||||
Синхронизировать из БД
|
Синхронизировать из БД
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -499,7 +516,7 @@ export function ObjectDetailPage() {
|
||||||
<Button icon={<GoogleOutlined />} onClick={() => setSheetsModal(true)}>
|
<Button icon={<GoogleOutlined />} onClick={() => setSheetsModal(true)}>
|
||||||
Google Sheets
|
Google Sheets
|
||||||
</Button>
|
</Button>
|
||||||
*/
|
*/}
|
||||||
<Button icon={<PlusOutlined />} onClick={openAddDevice}>
|
<Button icon={<PlusOutlined />} onClick={openAddDevice}>
|
||||||
Добавить устройство
|
Добавить устройство
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue