-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove unused backend-ai-agent-list (#2683)
<!-- Please precisely, concisely, and concretely describe what this PR changes, the rationale behind codes, and how it affects the users and other developers. --> **Checklist:** (if applicable) - [ ] Mention to the original issue - [ ] Documentation - [ ] Minium required manager version - [ ] Specific setting for review (eg., KB link, endpoint or how to setup) - [ ] Minimum requirements to check during review - [ ] Test case(s) to demonstrate the difference of before/after
- Loading branch information
Showing
55 changed files
with
1,641 additions
and
253 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
import Flex from './Flex'; | ||
import ResourceGroupSelect from './ResourceGroupSelect'; | ||
import ResourceUnit, { ResourceUnitProps } from './ResourceUnit'; | ||
import { SyncOutlined } from '@ant-design/icons'; | ||
import { | ||
Button, | ||
Card, | ||
CardProps, | ||
ConfigProvider, | ||
Divider, | ||
Switch, | ||
theme, | ||
Typography, | ||
} from 'antd'; | ||
import _ from 'lodash'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface AllocatedResourcesCardProps extends CardProps {} | ||
|
||
const AllocatedResourcesCard: React.FC<AllocatedResourcesCardProps> = ({ | ||
...cardProps | ||
}) => { | ||
const { token } = theme.useToken(); | ||
const { t } = useTranslation(); | ||
|
||
const resourceUnitMockData: Array<ResourceUnitProps> = [ | ||
{ | ||
name: 'CPU', | ||
displayUnit: 'Core', | ||
value: 12, | ||
percentage: (4 / 12) * 100, | ||
}, | ||
{ | ||
name: 'RAM', | ||
displayUnit: 'GiB', | ||
value: 256, | ||
percentage: (8 / 12) * 100, | ||
}, | ||
{ | ||
name: 'FGPU', | ||
displayUnit: 'GiB', | ||
value: 3.5, | ||
percentage: (4 / 12) * 100, | ||
}, | ||
{ | ||
name: 'ATOM', | ||
displayUnit: 'Unit', | ||
value: 2, | ||
percentage: (2 / 12) * 100, | ||
}, | ||
]; | ||
return ( | ||
<ConfigProvider | ||
theme={{ | ||
components: { | ||
Button: { | ||
onlyIconSizeLG: 20, | ||
}, | ||
}, | ||
}} | ||
> | ||
<Card | ||
{...cardProps} | ||
style={{ | ||
width: '100%', | ||
height: 240, | ||
// width: 936, | ||
// height: 192, | ||
}} | ||
> | ||
<Flex justify="between" style={{ marginBottom: 26 }}> | ||
<Flex gap={10}> | ||
<Typography.Title | ||
level={4} | ||
style={{ | ||
margin: 0, | ||
}} | ||
> | ||
Allocated Resources | ||
</Typography.Title> | ||
<Switch defaultChecked /> | ||
</Flex> | ||
<Flex> | ||
<ResourceGroupSelect | ||
placeholder={t('session.ResourceGroup')} | ||
variant="borderless" | ||
style={{ minWidth: 151, fontSize: token.fontSizeLG, padding: 0 }} | ||
dropdownStyle={{ color: '#999999' }} | ||
/> | ||
<Button | ||
type="link" | ||
size="large" | ||
icon={<SyncOutlined />} | ||
style={{ padding: 0, color: '#5DD2AD' }} | ||
/> | ||
</Flex> | ||
</Flex> | ||
<Flex justify="between" style={{ maxWidth: 630 }}> | ||
{_.map( | ||
resourceUnitMockData, | ||
(resourceUnit: ResourceUnitProps, index) => ( | ||
<> | ||
<ResourceUnit | ||
key={index} | ||
name={resourceUnit.name} | ||
displayUnit={resourceUnit.displayUnit} | ||
value={resourceUnit.value} | ||
percentage={resourceUnit.percentage} | ||
/> | ||
{index < resourceUnitMockData.length - 1 && ( | ||
<Divider type="vertical" style={{ height: 70 }} /> | ||
)} | ||
</> | ||
), | ||
)} | ||
</Flex> | ||
</Card> | ||
</ConfigProvider> | ||
); | ||
}; | ||
|
||
export default AllocatedResourcesCard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.