style: fallback ui
This commit is contained in:
@@ -4,7 +4,7 @@ import IconFont from '@/components/icon-font';
|
|||||||
import RowChildren from '@/components/seal-table/components/row-children';
|
import RowChildren from '@/components/seal-table/components/row-children';
|
||||||
import StatusTag from '@/components/status-tag';
|
import StatusTag from '@/components/status-tag';
|
||||||
import { DeleteOutlined } from '@ant-design/icons';
|
import { DeleteOutlined } from '@ant-design/icons';
|
||||||
import { Col, Row } from 'antd';
|
import { Col, Row, Tag } from 'antd';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
@@ -67,10 +67,22 @@ const AccessItem: React.FC<AccessItemProps> = ({ onSelect, data }) => {
|
|||||||
<CellContent style={{ paddingLeft: 44 }}>
|
<CellContent style={{ paddingLeft: 44 }}>
|
||||||
<AutoTooltip ghost>Weight: 20</AutoTooltip>
|
<AutoTooltip ghost>Weight: 20</AutoTooltip>
|
||||||
{data.is_fallback && (
|
{data.is_fallback && (
|
||||||
<IconFont
|
<Tag
|
||||||
type="icon-shield-filled"
|
variant="outlined"
|
||||||
style={{ color: 'var(--ant-color-warning)', marginLeft: 8 }}
|
color="gray"
|
||||||
/>
|
style={{
|
||||||
|
color: 'var(--ant-color-text-tertiary)',
|
||||||
|
marginLeft: 8,
|
||||||
|
fontSize: 12,
|
||||||
|
height: 18,
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
borderRadius: 10,
|
||||||
|
borderColor: 'var(--ant-color-border)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Fallback
|
||||||
|
</Tag>
|
||||||
)}
|
)}
|
||||||
</CellContent>
|
</CellContent>
|
||||||
</Col>
|
</Col>
|
||||||
|
|||||||
@@ -87,6 +87,25 @@ const Endpoints = () => {
|
|||||||
setDataList(newDataList);
|
setDataList(newDataList);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleFallbackChange = (e: any, index: number) => {
|
||||||
|
const checked = e.target.checked;
|
||||||
|
const newDataList = dataList.map((item, i) => {
|
||||||
|
if (i === index) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
is_fallback: checked
|
||||||
|
};
|
||||||
|
} else if (checked) {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
is_fallback: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
setDataList(newDataList);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<LabelSelectorContext.Provider
|
<LabelSelectorContext.Provider
|
||||||
@@ -163,6 +182,8 @@ const Endpoints = () => {
|
|||||||
></SealInput.Number>
|
></SealInput.Number>
|
||||||
<Tooltip title="fallback">
|
<Tooltip title="fallback">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
|
checked={item.is_fallback}
|
||||||
|
onChange={(e) => handleFallbackChange(e, index)}
|
||||||
style={{ marginLeft: 12, marginRight: 4 }}
|
style={{ marginLeft: 12, marginRight: 4 }}
|
||||||
></Checkbox>
|
></Checkbox>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
Reference in New Issue
Block a user