| @@ -14,35 +14,43 @@ | |||||
| } | } | ||||
| &__name { | &__name { | ||||
| position: relative; | |||||
| display: inline-block; | |||||
| height: 24px; | |||||
| margin: 0 10px 0 0 !important; | |||||
| margin-right: 10px; | |||||
| margin-bottom: 0 !important; | |||||
| color: @text-color; | color: @text-color; | ||||
| font-size: 16px; | font-size: 16px; | ||||
| } | } | ||||
| &__tag { | &__tag { | ||||
| padding: 4px; | |||||
| color: @primary-color; | |||||
| padding: 2px 11px; | |||||
| font-size: 12px; | font-size: 12px; | ||||
| background-color: .addAlpha(@primary-color, 0.1) []; | |||||
| border-radius: 4px; | |||||
| border-radius: 1000px; | |||||
| &--public { | |||||
| color: @primary-color; | |||||
| background-color: .addAlpha(@primary-color, 0.08) []; | |||||
| border-color: .addAlpha(@primary-color, 0.5) []; | |||||
| } | |||||
| &--private { | |||||
| color: @warning-color; | |||||
| background-color: .addAlpha(@warning-color, 0.08) []; | |||||
| border-color: .addAlpha(@warning-color, 0.5) []; | |||||
| } | |||||
| } | } | ||||
| &__url { | &__url { | ||||
| margin-bottom: 10px; | |||||
| color: @text-color-secondary; | color: @text-color-secondary; | ||||
| font-size: 14px; | font-size: 14px; | ||||
| } | } | ||||
| &__description { | |||||
| height: 44px; | |||||
| &__branch { | |||||
| margin-bottom: 20px; | margin-bottom: 20px; | ||||
| color: @text-color-secondary; | |||||
| color: @text-color-tertiary; | |||||
| font-size: 14px; | font-size: 14px; | ||||
| .multiLine(2); | |||||
| } | } | ||||
| &__user, | |||||
| &__time { | &__time { | ||||
| display: flex; | display: flex; | ||||
| flex: 0 1 content; | flex: 0 1 content; | ||||
| @@ -55,21 +63,9 @@ | |||||
| &:hover { | &:hover { | ||||
| border-color: @primary-color; | border-color: @primary-color; | ||||
| box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1); | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1); | ||||
| .resource-item__name { | |||||
| color: @primary-color; | |||||
| } | |||||
| } | } | ||||
| } | |||||
| .resource-item__name { | |||||
| &::after { | |||||
| position: absolute; | |||||
| top: 14px; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: 6px; | |||||
| background: linear-gradient(to right, rgba(22, 100, 255, 0.3) 0, rgba(22, 100, 255, 0) 100%); | |||||
| content: ''; | |||||
| &:hover &__name { | |||||
| color: @primary-color; | |||||
| } | } | ||||
| } | } | ||||
| @@ -5,6 +5,7 @@ import { AvailableRange } from '@/enums'; | |||||
| import { type CodeConfigData } from '@/pages/CodeConfig/List'; | import { type CodeConfigData } from '@/pages/CodeConfig/List'; | ||||
| import { formatDate } from '@/utils/date'; | import { formatDate } from '@/utils/date'; | ||||
| import { Button, Flex, Typography } from 'antd'; | import { Button, Flex, Typography } from 'antd'; | ||||
| import classNames from 'classnames'; | |||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| type CodeConfigItemProps = { | type CodeConfigItemProps = { | ||||
| @@ -24,10 +25,16 @@ function CodeConfigItem({ item, onClick, onEdit, onRemove }: CodeConfigItemProps | |||||
| > | > | ||||
| {item.code_repo_name} | {item.code_repo_name} | ||||
| </Typography.Paragraph> | </Typography.Paragraph> | ||||
| <div className={styles['code-config-item__tag']}> | |||||
| <div | |||||
| className={classNames( | |||||
| styles['code-config-item__tag'], | |||||
| item.code_repo_vis === AvailableRange.Public | |||||
| ? styles['code-config-item__tag--public'] | |||||
| : styles['code-config-item__tag--private'], | |||||
| )} | |||||
| > | |||||
| {item.code_repo_vis === AvailableRange.Public ? '公开' : '私有'} | {item.code_repo_vis === AvailableRange.Public ? '公开' : '私有'} | ||||
| </div> | </div> | ||||
| <Button | <Button | ||||
| type="text" | type="text" | ||||
| shape="circle" | shape="circle" | ||||
| @@ -54,15 +61,12 @@ function CodeConfigItem({ item, onClick, onEdit, onRemove }: CodeConfigItemProps | |||||
| <Typography.Paragraph | <Typography.Paragraph | ||||
| className={styles['code-config-item__url']} | className={styles['code-config-item__url']} | ||||
| ellipsis={{ tooltip: item.git_url }} | ellipsis={{ tooltip: item.git_url }} | ||||
| style={{ marginBottom: '8px' }} | |||||
| > | > | ||||
| {item.git_url} | {item.git_url} | ||||
| </Typography.Paragraph> | </Typography.Paragraph> | ||||
| <div className={styles['code-config-item__url']} style={{ marginBottom: '20px' }}> | |||||
| {item.git_branch} | |||||
| </div> | |||||
| <div className={styles['code-config-item__branch']}>{item.git_branch}</div> | |||||
| <Flex justify="space-between"> | <Flex justify="space-between"> | ||||
| <div className={styles['code-config-item__time']}> | |||||
| <div className={styles['code-config-item__user']}> | |||||
| <img | <img | ||||
| style={{ width: '17px', marginRight: '6px' }} | style={{ width: '17px', marginRight: '6px' }} | ||||
| src={creatByImg} | src={creatByImg} | ||||
| @@ -10,6 +10,7 @@ import { | |||||
| import { to } from '@/utils/promise'; | import { to } from '@/utils/promise'; | ||||
| import { InfoCircleOutlined } from '@ant-design/icons'; | import { InfoCircleOutlined } from '@ant-design/icons'; | ||||
| import { Form, Input, ModalProps, Select } from 'antd'; | import { Form, Input, ModalProps, Select } from 'antd'; | ||||
| import { pick } from 'lodash'; | |||||
| import { useEffect, useState } from 'react'; | import { useEffect, useState } from 'react'; | ||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| @@ -85,7 +86,11 @@ function ExportModelModal({ path, onOk, ...rest }: ExportModelModalProps) { | |||||
| // 获取模型版本列表 | // 获取模型版本列表 | ||||
| const getModelVersions = async (id: number) => { | const getModelVersions = async (id: number) => { | ||||
| const [res] = await to(getModelVersionList(id)); | |||||
| const model = models.find((item) => item.id === id); | |||||
| if (!model) { | |||||
| return; | |||||
| } | |||||
| const [res] = await to(getModelVersionList(pick(model, ['identifier', 'owner']))); | |||||
| if (res && res.data) { | if (res && res.data) { | ||||
| setVersions(res.data); | setVersions(res.data); | ||||
| } | } | ||||
| @@ -1,68 +1,56 @@ | |||||
| .code-config-item { | .code-config-item { | ||||
| position: relative; | position: relative; | ||||
| padding: 20px; | |||||
| background: white; | |||||
| border: 1px solid #eaeaea; | |||||
| width: calc(25% - 7.5px); | |||||
| padding: 15px; | |||||
| background-color: .addAlpha(@primary-color, 0.04) []; | |||||
| border: 1px solid transparent; | |||||
| border-radius: 4px; | border-radius: 4px; | ||||
| cursor: pointer; | cursor: pointer; | ||||
| &__name { | &__name { | ||||
| position: relative; | |||||
| display: inline-block; | |||||
| height: 24px; | |||||
| margin: 0 10px 0 0 !important; | |||||
| margin-right: 8px; | |||||
| margin-bottom: 0 !important; | |||||
| color: @text-color; | color: @text-color; | ||||
| font-size: 16px; | |||||
| font-size: 14px; | |||||
| } | } | ||||
| &__tag { | &__tag { | ||||
| padding: 4px; | |||||
| color: @primary-color; | |||||
| flex: none; | |||||
| padding: 2px 11px; | |||||
| font-size: 12px; | font-size: 12px; | ||||
| background-color: .addAlpha(@primary-color, 0.1) []; | |||||
| border-radius: 4px; | |||||
| } | |||||
| border-radius: 1000px; | |||||
| &__url { | |||||
| color: @text-color-secondary; | |||||
| font-size: 14px; | |||||
| &--public { | |||||
| color: @primary-color; | |||||
| background-color: .addAlpha(@primary-color, 0.08) []; | |||||
| border-color: .addAlpha(@primary-color, 0.5) []; | |||||
| } | |||||
| &--private { | |||||
| color: @warning-color; | |||||
| background-color: .addAlpha(@warning-color, 0.08) []; | |||||
| border-color: .addAlpha(@warning-color, 0.5) []; | |||||
| } | |||||
| } | } | ||||
| &__description { | |||||
| height: 44px; | |||||
| margin-bottom: 20px; | |||||
| &__url { | |||||
| height: 40px; | |||||
| margin-bottom: 10px !important; | |||||
| color: @text-color-secondary; | color: @text-color-secondary; | ||||
| font-size: 14px; | |||||
| .multiLine(2); | |||||
| font-size: 13px; | |||||
| } | } | ||||
| &__time { | |||||
| display: flex; | |||||
| flex: 0 1 content; | |||||
| align-items: center; | |||||
| width: 100%; | |||||
| color: #808080; | |||||
| font-size: 13px; | |||||
| &__branch { | |||||
| color: @text-color-tertiary; | |||||
| font-size: 12px; | |||||
| } | } | ||||
| &:hover { | &:hover { | ||||
| border-color: @primary-color; | border-color: @primary-color; | ||||
| box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1); | box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1); | ||||
| .resource-item__name { | |||||
| color: @primary-color; | |||||
| } | |||||
| } | } | ||||
| } | |||||
| .resource-item__name { | |||||
| &::after { | |||||
| position: absolute; | |||||
| top: 14px; | |||||
| left: 0; | |||||
| width: 100%; | |||||
| height: 6px; | |||||
| background: linear-gradient(to right, rgba(22, 100, 255, 0.3) 0, rgba(22, 100, 255, 0) 100%); | |||||
| content: ''; | |||||
| &:hover &__name { | |||||
| color: @primary-color; | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,6 +1,7 @@ | |||||
| import { AvailableRange } from '@/enums'; | import { AvailableRange } from '@/enums'; | ||||
| import { type CodeConfigData } from '@/pages/CodeConfig/List'; | import { type CodeConfigData } from '@/pages/CodeConfig/List'; | ||||
| import { Flex, Typography } from 'antd'; | import { Flex, Typography } from 'antd'; | ||||
| import classNames from 'classnames'; | |||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| type CodeConfigItemProps = { | type CodeConfigItemProps = { | ||||
| @@ -11,27 +12,31 @@ type CodeConfigItemProps = { | |||||
| function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { | function CodeConfigItem({ item, onClick }: CodeConfigItemProps) { | ||||
| return ( | return ( | ||||
| <div className={styles['code-config-item']} onClick={() => onClick?.(item)}> | <div className={styles['code-config-item']} onClick={() => onClick?.(item)}> | ||||
| <Flex justify="space-between" align="center" style={{ marginBottom: '20px', height: '32px' }}> | |||||
| <Flex justify="space-between" align="center" style={{ marginBottom: '15px' }}> | |||||
| <Typography.Paragraph | <Typography.Paragraph | ||||
| className={styles['code-config-item__name']} | className={styles['code-config-item__name']} | ||||
| ellipsis={{ tooltip: item.code_repo_name }} | ellipsis={{ tooltip: item.code_repo_name }} | ||||
| > | > | ||||
| {item.code_repo_name} | {item.code_repo_name} | ||||
| </Typography.Paragraph> | </Typography.Paragraph> | ||||
| <div className={styles['code-config-item__tag']}> | |||||
| <div | |||||
| className={classNames( | |||||
| styles['code-config-item__tag'], | |||||
| item.code_repo_vis === AvailableRange.Public | |||||
| ? styles['code-config-item__tag--public'] | |||||
| : styles['code-config-item__tag--private'], | |||||
| )} | |||||
| > | |||||
| {item.code_repo_vis === AvailableRange.Public ? '公开' : '私有'} | {item.code_repo_vis === AvailableRange.Public ? '公开' : '私有'} | ||||
| </div> | </div> | ||||
| </Flex> | </Flex> | ||||
| <Typography.Paragraph | <Typography.Paragraph | ||||
| className={styles['code-config-item__url']} | className={styles['code-config-item__url']} | ||||
| ellipsis={{ tooltip: item.git_url }} | |||||
| style={{ marginBottom: '8px' }} | |||||
| ellipsis={{ rows: 2, tooltip: item.git_url }} | |||||
| > | > | ||||
| {item.git_url} | {item.git_url} | ||||
| </Typography.Paragraph> | </Typography.Paragraph> | ||||
| <div className={styles['code-config-item__url']} style={{ marginBottom: '20px' }}> | |||||
| {item.git_branch} | |||||
| </div> | |||||
| <div className={styles['code-config-item__branch']}>{item.git_branch}</div> | |||||
| </div> | </div> | ||||
| ); | ); | ||||
| } | } | ||||
| @@ -2,28 +2,53 @@ | |||||
| width: 100%; | width: 100%; | ||||
| height: 100%; | height: 100%; | ||||
| &__search { | |||||
| width: 100%; | |||||
| } | |||||
| :global { | :global { | ||||
| .ant-input-affix-wrapper .ant-input-prefix { | |||||
| margin-inline-end: 12px; | |||||
| .ant-input-affix-wrapper { | |||||
| border-radius: 23px !important; | |||||
| .ant-input-prefix { | |||||
| margin-inline-end: 12px; | |||||
| } | |||||
| .ant-input-suffix { | |||||
| margin-inline-end: 12px; | |||||
| } | |||||
| .ant-input-clear-icon { | |||||
| font-size: 16px; | |||||
| } | |||||
| } | } | ||||
| .ant-pagination { | .ant-pagination { | ||||
| text-align: right; | |||||
| text-align: center; | |||||
| } | } | ||||
| .ant-input-group-addon { | .ant-input-group-addon { | ||||
| display: none; | display: none; | ||||
| } | } | ||||
| .ant-pagination { | |||||
| .ant-select-single { | |||||
| height: 32px !important; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| &__content { | &__content { | ||||
| display: grid; | |||||
| grid-template-columns: repeat(3, minmax(0, 1fr)); | |||||
| gap: 20px; | |||||
| display: flex; | |||||
| flex-direction: row; | |||||
| flex-wrap: wrap; | |||||
| gap: 10px; | |||||
| width: 100%; | width: 100%; | ||||
| margin-top: 30px; | |||||
| max-height: 50vh; | |||||
| margin-top: 24px; | |||||
| margin-bottom: 30px; | margin-bottom: 30px; | ||||
| overflow-x: hidden; | overflow-x: hidden; | ||||
| overflow-y: auto; | overflow-y: auto; | ||||
| } | } | ||||
| &__empty { | |||||
| padding-top: 40px; | |||||
| } | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ import KFModal from '@/components/KFModal'; | |||||
| import { type CodeConfigData } from '@/pages/CodeConfig/List'; | import { type CodeConfigData } from '@/pages/CodeConfig/List'; | ||||
| import { getCodeConfigListReq } from '@/services/codeConfig'; | import { getCodeConfigListReq } from '@/services/codeConfig'; | ||||
| import { to } from '@/utils/promise'; | import { to } from '@/utils/promise'; | ||||
| import { Icon } from '@umijs/max'; | |||||
| import type { ModalProps, PaginationProps } from 'antd'; | import type { ModalProps, PaginationProps } from 'antd'; | ||||
| import { Empty, Input, Pagination } from 'antd'; | import { Empty, Input, Pagination } from 'antd'; | ||||
| import { useEffect, useState } from 'react'; | import { useEffect, useState } from 'react'; | ||||
| @@ -74,15 +75,17 @@ function CodeSelectorModal({ onOk, ...rest }: CodeSelectorModalProps) { | |||||
| > | > | ||||
| <div className={styles['code-selector']}> | <div className={styles['code-selector']}> | ||||
| <Input.Search | <Input.Search | ||||
| className={styles['code-selector__search']} | |||||
| placeholder="按代码仓库名称筛选" | placeholder="按代码仓库名称筛选" | ||||
| allowClear | allowClear | ||||
| onSearch={handleSearch} | onSearch={handleSearch} | ||||
| style={{ | |||||
| width: '100%', | |||||
| }} | |||||
| size="large" | |||||
| onChange={(e) => setInputText(e.target.value)} | onChange={(e) => setInputText(e.target.value)} | ||||
| suffix={null} | suffix={null} | ||||
| value={inputText} | value={inputText} | ||||
| prefix={ | |||||
| <Icon icon="local:magnifying-glass" style={{ marginLeft: '10px', marginTop: '2px' }} /> | |||||
| } | |||||
| /> | /> | ||||
| {dataList?.length !== 0 ? ( | {dataList?.length !== 0 ? ( | ||||
| <> | <> | ||||
| @@ -103,7 +106,7 @@ function CodeSelectorModal({ onOk, ...rest }: CodeSelectorModalProps) { | |||||
| </> | </> | ||||
| ) : ( | ) : ( | ||||
| <div className={styles['code-selector__empty']}> | <div className={styles['code-selector__empty']}> | ||||
| <Empty></Empty> | |||||
| <Empty image={Empty.PRESENTED_IMAGE_SIMPLE}></Empty> | |||||
| </div> | </div> | ||||
| )} | )} | ||||
| </div> | </div> | ||||
| @@ -50,10 +50,12 @@ | |||||
| border-radius: 8px; | border-radius: 8px; | ||||
| &__title { | &__title { | ||||
| height: 46px; | |||||
| margin-bottom: 15px; | margin-bottom: 15px; | ||||
| padding: 3px 0 6px; | padding: 3px 0 6px; | ||||
| color: @text-color; | color: @text-color; | ||||
| font-size: @font-size; | font-size: @font-size; | ||||
| line-height: 46px; | |||||
| border-bottom: 1px solid @border-color-secondary; | border-bottom: 1px solid @border-color-secondary; | ||||
| } | } | ||||
| &__files { | &__files { | ||||
| @@ -48,7 +48,7 @@ | |||||
| &__count { | &__count { | ||||
| width: 24px; | width: 24px; | ||||
| height: 24px; | height: 24px; | ||||
| color: #8a8a8a; | |||||
| color: @text-color-tertiary; | |||||
| font-size: 12px; | font-size: 12px; | ||||
| line-height: 24px; | line-height: 24px; | ||||
| text-align: center; | text-align: center; | ||||
| @@ -11,6 +11,7 @@ | |||||
| @background-color: #f9fafb; // 页面背景颜色 | @background-color: #f9fafb; // 页面背景颜色 | ||||
| @text-color: #1d1d20; | @text-color: #1d1d20; | ||||
| @text-color-secondary: #575757; | @text-color-secondary: #575757; | ||||
| @text-color-tertiary: #8a8a8a; | |||||
| @success-color: #6ac21d; | @success-color: #6ac21d; | ||||
| @error-color: #c73131; | @error-color: #c73131; | ||||
| @warning-color: #f98e1b; | @warning-color: #f98e1b; | ||||
| @@ -18,6 +19,7 @@ | |||||
| @pending-color: #ecb934; | @pending-color: #ecb934; | ||||
| @underline-color: #5d93ff; | @underline-color: #5d93ff; | ||||
| @border-color-base: #eaeaea; | |||||
| @border-color: rgba(22, 100, 255, 0.3); | @border-color: rgba(22, 100, 255, 0.3); | ||||
| @border-color-secondary: rgba(22, 100, 255, 0.1); | @border-color-secondary: rgba(22, 100, 255, 0.1); | ||||
| @background-color-primary: rgba(22, 100, 255, 0.03); | @background-color-primary: rgba(22, 100, 255, 0.03); | ||||
| @@ -25,7 +27,7 @@ | |||||
| @heading-color: rgba(0, 0, 0, 0.85); | @heading-color: rgba(0, 0, 0, 0.85); | ||||
| @input-icon-hover-color: rgba(0, 0, 0, 0.85); | @input-icon-hover-color: rgba(0, 0, 0, 0.85); | ||||
| @border-color-base: #d9d9d9; | |||||
| @link-hover-color: #69b1ff; | @link-hover-color: #69b1ff; | ||||
| @sider-background-color: #f2f5f7; | @sider-background-color: #f2f5f7; | ||||
| @@ -74,6 +76,7 @@ | |||||
| warningColor: @warning-color; | warningColor: @warning-color; | ||||
| textColor: @text-color; | textColor: @text-color; | ||||
| textColorSecondary: @text-color-secondary; | textColorSecondary: @text-color-secondary; | ||||
| textColorTertiary: @text-color-tertiary; | |||||
| fontSize: @font-size; | fontSize: @font-size; | ||||
| fontSizeTitle: @font-size-title; | fontSizeTitle: @font-size-title; | ||||
| fontSizeContent: @font-size-content; | fontSizeContent: @font-size-content; | ||||