fix(style): API info access url overflow
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
|||||||
ScrollerModal
|
ScrollerModal
|
||||||
} from '@gpustack/core-ui';
|
} from '@gpustack/core-ui';
|
||||||
import { useIntl, useNavigate } from '@umijs/max';
|
import { useIntl, useNavigate } from '@umijs/max';
|
||||||
import { Button, Tag } from 'antd';
|
import { Button, Flex, Tag } from 'antd';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { useEffect, useMemo } from 'react';
|
import { useEffect, useMemo } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
@@ -79,6 +79,7 @@ const Tips = styled.div`
|
|||||||
const APITAG = styled(Tag)`
|
const APITAG = styled(Tag)`
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
width: fit-content;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
{intl.formatMessage({ id: 'models.table.button.apiAccessInfo' })}
|
{intl.formatMessage({ id: 'models.table.button.apiAccessInfo' })}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
width={600}
|
width={660}
|
||||||
destroyOnHidden
|
destroyOnHidden
|
||||||
closable={true}
|
closable={true}
|
||||||
mask={{
|
mask={{
|
||||||
@@ -164,10 +165,15 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
<span className="label">
|
<span className="label">
|
||||||
{intl.formatMessage({ id: 'models.table.apiAccessInfo.endpoint' })}
|
{intl.formatMessage({ id: 'models.table.apiAccessInfo.endpoint' })}
|
||||||
</span>
|
</span>
|
||||||
<span className="value">
|
<Flex align="center" wrap>
|
||||||
<AutoTooltip ghost maxWidth={data.generic_proxy ? 400 : 240}>
|
<span
|
||||||
{endPoint}
|
className="value"
|
||||||
</AutoTooltip>
|
style={{ display: 'flex', flex: 1, minWidth: 0 }}
|
||||||
|
>
|
||||||
|
<AutoTooltip ghost maxWidth={'100%'}>
|
||||||
|
{endPoint}
|
||||||
|
</AutoTooltip>
|
||||||
|
</span>
|
||||||
{!data.generic_proxy && (
|
{!data.generic_proxy && (
|
||||||
<>
|
<>
|
||||||
<APITAG color="geekblue">
|
<APITAG color="geekblue">
|
||||||
@@ -188,7 +194,7 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</span>
|
</Flex>
|
||||||
<span className="copy-btn">
|
<span className="copy-btn">
|
||||||
<CopyButton text={endPoint} type="link" size="small"></CopyButton>
|
<CopyButton text={endPoint} type="link" size="small"></CopyButton>
|
||||||
</span>
|
</span>
|
||||||
@@ -197,32 +203,36 @@ const ApiAccessInfo = ({ open, data, onClose }: ApiAccessInfoProps) => {
|
|||||||
id: 'models.table.apiAccessInfo.modelName'
|
id: 'models.table.apiAccessInfo.modelName'
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
<span className="value">
|
<Flex align="center">
|
||||||
<AutoTooltip ghost maxWidth={300}>
|
<span className="value">
|
||||||
{data.name}
|
<AutoTooltip ghost maxWidth={300}>
|
||||||
</AutoTooltip>
|
{data.name}
|
||||||
</span>
|
</AutoTooltip>
|
||||||
|
</span>
|
||||||
|
</Flex>
|
||||||
<span className="copy-btn">
|
<span className="copy-btn">
|
||||||
<CopyButton text={data.name} type="link" size="small"></CopyButton>
|
<CopyButton text={data.name} type="link" size="small"></CopyButton>
|
||||||
</span>
|
</span>
|
||||||
<span className="label">
|
<span className="label">
|
||||||
{intl.formatMessage({ id: 'models.table.apiAccessInfo.apikey' })}
|
{intl.formatMessage({ id: 'models.table.apiAccessInfo.apikey' })}
|
||||||
</span>
|
</span>
|
||||||
<span className="value">
|
<Flex align="center">
|
||||||
<CreateButton
|
<span className="value">
|
||||||
type="link"
|
<CreateButton
|
||||||
size="small"
|
type="link"
|
||||||
onClick={() => navigate('/access-control/api-keys')}
|
size="small"
|
||||||
>
|
onClick={() => navigate('/access-control/api-keys')}
|
||||||
{intl.formatMessage({
|
>
|
||||||
id: 'models.table.apiAccessInfo.gotoCreate'
|
{intl.formatMessage({
|
||||||
})}
|
id: 'models.table.apiAccessInfo.gotoCreate'
|
||||||
<IconFont
|
})}
|
||||||
type="icon-external-link"
|
<IconFont
|
||||||
className="font-size-14"
|
type="icon-external-link"
|
||||||
></IconFont>
|
className="font-size-14"
|
||||||
</CreateButton>
|
></IconFont>
|
||||||
</span>
|
</CreateButton>
|
||||||
|
</span>
|
||||||
|
</Flex>
|
||||||
</ApiAccessInfoWrapper>
|
</ApiAccessInfoWrapper>
|
||||||
{data.generic_proxy && (
|
{data.generic_proxy && (
|
||||||
<div style={{ marginTop: 12 }}>{GenericProxyCommandCode}</div>
|
<div style={{ marginTop: 12 }}>{GenericProxyCommandCode}</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user