fix: adjust border raduis
This commit is contained in:
@@ -30,7 +30,7 @@ const useStyles = createStyles(({ token, css }) => {
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding-left: 32px;
|
padding-left: 32px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
border-radius: ${token.borderRadius}px;
|
border-radius: ${token.borderRadiusLG}px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
.ant-typography {
|
.ant-typography {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const Wrapper = styled.div`
|
const Wrapper = styled.div`
|
||||||
border-radius: var(--border-radius-small);
|
border-radius: var(--border-radius-lg);
|
||||||
background-color: var(--ant-color-bg-container);
|
background-color: var(--ant-color-bg-container);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
|
|||||||
// import './iconfont/iconfont.js';
|
// import './iconfont/iconfont.js';
|
||||||
|
|
||||||
const IconFont = createFromIconfontCN({
|
const IconFont = createFromIconfontCN({
|
||||||
scriptUrl: '//at.alicdn.com/t/c/font_4613488_110n9b7vcjv.js'
|
scriptUrl: '//at.alicdn.com/t/c/font_4613488_jctdntmi5mf.js'
|
||||||
});
|
});
|
||||||
|
|
||||||
export default IconFont;
|
export default IconFont;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const Container = styled.div`
|
|||||||
padding: 14px;
|
padding: 14px;
|
||||||
padding-top: 34px;
|
padding-top: 34px;
|
||||||
border: 1px solid var(--ant-color-border);
|
border: 1px solid var(--ant-color-border);
|
||||||
border-radius: var(--border-radius-base);
|
border-radius: var(--ant-border-radius-lg);
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -71,7 +71,13 @@ const Wrapper: React.FC<WrapperProps> = ({
|
|||||||
{!disabled && (
|
{!disabled && (
|
||||||
<ButtonWrapper>
|
<ButtonWrapper>
|
||||||
{button || (
|
{button || (
|
||||||
<Button variant="filled" color="default" block onClick={onAdd}>
|
<Button
|
||||||
|
variant="filled"
|
||||||
|
color="default"
|
||||||
|
block
|
||||||
|
onClick={onAdd}
|
||||||
|
style={{ borderRadius: 'var(--border-radius-base)' }}
|
||||||
|
>
|
||||||
<PlusOutlined className="font-size-14" />
|
<PlusOutlined className="font-size-14" />
|
||||||
{btnText ||
|
{btnText ||
|
||||||
intl.formatMessage({
|
intl.formatMessage({
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ const RenderProgress = memo(
|
|||||||
return (
|
return (
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
|
fontSize: 12,
|
||||||
color: 'var(--color-progress-text)'
|
color: 'var(--color-progress-text)'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ const SealPassword: React.FC<InputProps & SealFormItemProps & PasswordProps> = (
|
|||||||
>
|
>
|
||||||
<Input.Password
|
<Input.Password
|
||||||
{...rest}
|
{...rest}
|
||||||
autoComplete={rest.autoComplete || 'off'}
|
autoComplete={rest.autoComplete || 'new-password'}
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
className="seal-input-password"
|
className="seal-input-password"
|
||||||
onFocus={handleOnFocus}
|
onFocus={handleOnFocus}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ const WrapperBox = styled.div`
|
|||||||
border-width: var(--ant-line-width);
|
border-width: var(--ant-line-width);
|
||||||
border-style: var(--ant-line-type);
|
border-style: var(--ant-line-type);
|
||||||
border-color: var(--ant-color-border);
|
border-color: var(--ant-color-border);
|
||||||
border-radius: var(--border-radius-base);
|
border-radius: var(--border-radius-lg);
|
||||||
background-color: var(--ant-color-bg-container);
|
background-color: var(--ant-color-bg-container);
|
||||||
&.borderless {
|
&.borderless {
|
||||||
border: none;
|
border: none;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ const CellWrapper = styled.div`
|
|||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
min-width: 20px;
|
min-width: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
|
||||||
&.left {
|
&.left {
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
padding-inline: var(--ant-table-cell-padding-inline);
|
padding-inline: var(--ant-table-cell-padding-inline);
|
||||||
|
color: var(--color-text-table-header);
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -23,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-cell {
|
&-cell {
|
||||||
font-weight: var(--font-weight-medium);
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-left {
|
&-left {
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
min-width: 76px;
|
min-width: 76px;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
line-height: 22px;
|
font-size: 12px;
|
||||||
font-size: var(--font-size-small);
|
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const CardWrapper = styled.div.attrs({
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border: 1px solid var(--ant-color-border);
|
border: 1px solid var(--ant-color-border);
|
||||||
border-radius: var(--border-radius-base);
|
border-radius: var(--ant-border-radius-lg);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
&.clickable:hover:not(.disabled) {
|
&.clickable:hover:not(.disabled) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export const HEADER_HEIGHT = 48;
|
export const HEADER_HEIGHT = 0;
|
||||||
|
|
||||||
export const DEFAULT_ENTER_PAGE = {
|
export const DEFAULT_ENTER_PAGE = {
|
||||||
adminForNormal: '/dashboard',
|
adminForNormal: '/dashboard',
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default {
|
|||||||
iconSizeSM: 20
|
iconSizeSM: 20
|
||||||
},
|
},
|
||||||
Table: {
|
Table: {
|
||||||
headerBorderRadius: 4,
|
headerBorderRadius: 6,
|
||||||
cellPaddingInline: 16,
|
cellPaddingInline: 16,
|
||||||
cellPaddingBlock: 6,
|
cellPaddingBlock: 6,
|
||||||
cellFontSize: 14,
|
cellFontSize: 14,
|
||||||
@@ -57,7 +57,7 @@ export default {
|
|||||||
itemActiveBg: 'rgb(24 25 27)'
|
itemActiveBg: 'rgb(24 25 27)'
|
||||||
},
|
},
|
||||||
Progress: {
|
Progress: {
|
||||||
lineBorderRadius: 2
|
lineBorderRadius: 4
|
||||||
},
|
},
|
||||||
Select: {
|
Select: {
|
||||||
optionSelectedBg: '#333',
|
optionSelectedBg: '#333',
|
||||||
@@ -97,8 +97,10 @@ export default {
|
|||||||
colorPrimary: COLOR_PRIMARY,
|
colorPrimary: COLOR_PRIMARY,
|
||||||
colorSuccess: '#48A77E',
|
colorSuccess: '#48A77E',
|
||||||
colorBorder: '#3a3a3a',
|
colorBorder: '#3a3a3a',
|
||||||
|
borderRadiusOuter: 6,
|
||||||
|
borderRadiusLG: 6,
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
borderRadiusSM: 2,
|
borderRadiusSM: 3,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
motion: true,
|
motion: true,
|
||||||
colorFill: '#0A0A0A',
|
colorFill: '#0A0A0A',
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default {
|
|||||||
iconSizeSM: 20
|
iconSizeSM: 20
|
||||||
},
|
},
|
||||||
Table: {
|
Table: {
|
||||||
headerBorderRadius: 4,
|
headerBorderRadius: 6,
|
||||||
cellPaddingInline: 16,
|
cellPaddingInline: 16,
|
||||||
cellPaddingBlock: 6,
|
cellPaddingBlock: 6,
|
||||||
cellFontSize: 14,
|
cellFontSize: 14,
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
itemActiveBg: 'rgba(0,0,0,0.04)'
|
itemActiveBg: 'rgba(0,0,0,0.04)'
|
||||||
},
|
},
|
||||||
Progress: {
|
Progress: {
|
||||||
lineBorderRadius: 2
|
lineBorderRadius: 3
|
||||||
},
|
},
|
||||||
Select: {
|
Select: {
|
||||||
optionSelectedBg: 'rgba(230, 230, 230, 88%)',
|
optionSelectedBg: 'rgba(230, 230, 230, 88%)',
|
||||||
@@ -96,11 +96,19 @@ export default {
|
|||||||
fontFamily:
|
fontFamily:
|
||||||
"Helvetica Neue, -apple-system, BlinkMacSystemFont, Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
|
"Helvetica Neue, -apple-system, BlinkMacSystemFont, Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
|
||||||
colorText: '#1F1F1F',
|
colorText: '#1F1F1F',
|
||||||
|
// colorTextSecondary: '#484848',
|
||||||
|
// colorTextTertiary: '#757576',
|
||||||
|
// colorTextQuaternary: '#A6A6A7',
|
||||||
|
colorFillSecondary: '#eaebec',
|
||||||
|
colorFillTertiary: '#f1f2f3',
|
||||||
|
colorFillQuaternary: '#f7f8fa',
|
||||||
colorPrimary: COLOR_PRIMARY,
|
colorPrimary: COLOR_PRIMARY,
|
||||||
colorSuccess: '#54cc98',
|
colorSuccess: '#54cc98',
|
||||||
colorBorder: '#d3d0d9',
|
colorBorder: '#d3d8de',
|
||||||
|
borderRadiusOuter: 6,
|
||||||
|
borderRadiusLG: 6,
|
||||||
borderRadius: 4,
|
borderRadius: 4,
|
||||||
borderRadiusSM: 2,
|
borderRadiusSM: 3,
|
||||||
colorBgContainer: '#fff',
|
colorBgContainer: '#fff',
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
motion: true
|
motion: true
|
||||||
|
|||||||
+14
-9
@@ -28,12 +28,11 @@ html {
|
|||||||
--layout-content-inlinepadding: 24px;
|
--layout-content-inlinepadding: 24px;
|
||||||
--layout-content-header-inlinepadding: 40px;
|
--layout-content-header-inlinepadding: 40px;
|
||||||
--border-radius-modal: 12px;
|
--border-radius-modal: 12px;
|
||||||
--menu-border-radius-base: 4px;
|
--menu-border-radius-base: 6px;
|
||||||
|
--border-radius-lg: 6px;
|
||||||
--border-radius-base: 4px;
|
--border-radius-base: 4px;
|
||||||
--border-radius-middle: 20px;
|
--border-radius-small: 3px;
|
||||||
--border-radius-small: 4px;
|
--border-radius-mini: 2px;
|
||||||
--border-radius-mdium: 4px;
|
|
||||||
--border-radius-mini: 4px;
|
|
||||||
--border-radius-2px: 2px;
|
--border-radius-2px: 2px;
|
||||||
--color-white-1: rgba(255, 255, 255, 100%);
|
--color-white-1: rgba(255, 255, 255, 100%);
|
||||||
--font-weight-500: 500;
|
--font-weight-500: 500;
|
||||||
@@ -59,8 +58,8 @@ html {
|
|||||||
--font-size-base: 14px;
|
--font-size-base: 14px;
|
||||||
--font-size-large: 16px;
|
--font-size-large: 16px;
|
||||||
--font-size-middle: 14px;
|
--font-size-middle: 14px;
|
||||||
--table-td-radius: 4px;
|
--table-td-radius: 6px;
|
||||||
--checkbox-border-radius: 2px;
|
--checkbox-border-radius: 4px;
|
||||||
--ant-color-success-bg: #f0fff6;
|
--ant-color-success-bg: #f0fff6;
|
||||||
--ant-color-success: #54cc98;
|
--ant-color-success: #54cc98;
|
||||||
--ant-color-error-bg: #fff2f0;
|
--ant-color-error-bg: #fff2f0;
|
||||||
@@ -82,7 +81,7 @@ html {
|
|||||||
--color-spotlight-bg: rgba(255, 255, 255, 100%);
|
--color-spotlight-bg: rgba(255, 255, 255, 100%);
|
||||||
// ======== input ============
|
// ======== input ============
|
||||||
--box-shadow-base: 0 4px 6px rgba(227, 232, 240, 70%);
|
--box-shadow-base: 0 4px 6px rgba(227, 232, 240, 70%);
|
||||||
--ant-border-radius-lg: 4px;
|
--ant-border-radius-lg: 6px;
|
||||||
--color-selected-bg: rgba(230, 230, 230, 88%);
|
--color-selected-bg: rgba(230, 230, 230, 88%);
|
||||||
--ant-color-border: #d9d9d9;
|
--ant-color-border: #d9d9d9;
|
||||||
--ant-line-type: solid;
|
--ant-line-type: solid;
|
||||||
@@ -90,6 +89,7 @@ html {
|
|||||||
--color-esc-hint-bg: rgba(0, 0, 0, 75%);
|
--color-esc-hint-bg: rgba(0, 0, 0, 75%);
|
||||||
// ======== container ============
|
// ======== container ============
|
||||||
--color-border-container: #ededed;
|
--color-border-container: #ededed;
|
||||||
|
--color-text-table-header: #71717a;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-theme='realDark'] {
|
html[data-theme='realDark'] {
|
||||||
@@ -107,6 +107,7 @@ html[data-theme='realDark'] {
|
|||||||
--color-spotlight-bg: #3e3e3e;
|
--color-spotlight-bg: #3e3e3e;
|
||||||
--color-esc-hint-bg: rgba(150, 150, 150, 75%);
|
--color-esc-hint-bg: rgba(150, 150, 150, 75%);
|
||||||
--color-border-container: #3a3a3a;
|
--color-border-container: #3a3a3a;
|
||||||
|
--color-text-table-header: rgba(255, 255, 255, 30%);
|
||||||
|
|
||||||
background: #141414;
|
background: #141414;
|
||||||
|
|
||||||
@@ -126,7 +127,7 @@ html[data-theme='light'] {
|
|||||||
transition: none !important;
|
transition: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
background-color: #f5f5f5;
|
background-color: #f4f5f6;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -160,6 +161,7 @@ body {
|
|||||||
.ant-table-wrapper {
|
.ant-table-wrapper {
|
||||||
.ant-table {
|
.ant-table {
|
||||||
background: transparent !important;
|
background: transparent !important;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-table-selection-column {
|
.ant-table-selection-column {
|
||||||
@@ -197,6 +199,8 @@ body {
|
|||||||
padding-block: 0;
|
padding-block: 0;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
color: var(--color-text-table-header);
|
||||||
|
font-weight: 500;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
transition: none !important;
|
transition: none !important;
|
||||||
@@ -829,4 +833,5 @@ body {
|
|||||||
|
|
||||||
.ant-pro-grid-content {
|
.ant-pro-grid-content {
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
|
padding-block: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import Exception from './Exception';
|
|||||||
import './Layout.css';
|
import './Layout.css';
|
||||||
import { LogoIcon, SLogoIcon } from './Logo';
|
import { LogoIcon, SLogoIcon } from './Logo';
|
||||||
import ErrorBoundary from './error-boundary';
|
import ErrorBoundary from './error-boundary';
|
||||||
import { ExtraContent } from './extraRender';
|
|
||||||
import { patchRoutes } from './runtime';
|
import { patchRoutes } from './runtime';
|
||||||
import SiderMenu from './sider-menu';
|
import SiderMenu from './sider-menu';
|
||||||
|
|
||||||
@@ -385,13 +384,6 @@ export default (props: any) => {
|
|||||||
menuContentRender={menuContentRender}
|
menuContentRender={menuContentRender}
|
||||||
{...runtimeConfig}
|
{...runtimeConfig}
|
||||||
ErrorBoundary={ErrorBoundary}
|
ErrorBoundary={ErrorBoundary}
|
||||||
// @ts-ignore
|
|
||||||
extra={[
|
|
||||||
<ExtraContent
|
|
||||||
key="extra-content"
|
|
||||||
isDarkTheme={userSettings.isDarkTheme}
|
|
||||||
/>
|
|
||||||
]}
|
|
||||||
>
|
>
|
||||||
<Exception
|
<Exception
|
||||||
route={matchedRoute}
|
route={matchedRoute}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const useStyles = createStyles(({ css, token }) => {
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
height: ${Menu.itemHeight}px;
|
height: ${Menu.itemHeight}px;
|
||||||
line-height: ${Menu.itemHeight}px;
|
line-height: ${Menu.itemHeight}px;
|
||||||
color: var(--ant-color-text-secondary);
|
color: var(--ant-color-text-tertiary);
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: ${Menu.itemHoverBg};
|
background-color: ${Menu.itemHoverBg};
|
||||||
color: ${Menu.itemHoverColor};
|
color: ${Menu.itemHoverColor};
|
||||||
|
|||||||
@@ -36,11 +36,12 @@ const Title = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const LabelWrapper = styled.span`
|
const LabelWrapper = styled.span`
|
||||||
color: var(--color-text-secondary);
|
color: var(--ant-color-text-secondary);
|
||||||
> span {
|
> span {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
.sub-title {
|
.sub-title {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
|
import IconFont from '@/components/icon-font';
|
||||||
import OverlayScroller from '@/components/overlay-scroller';
|
import OverlayScroller from '@/components/overlay-scroller';
|
||||||
import { CloseCircleFilled, FilterOutlined } from '@ant-design/icons';
|
import { CloseCircleFilled } from '@ant-design/icons';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Badge, Button, Form, Popover } from 'antd';
|
import { Button, Divider, Form, Popover } from 'antd';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
padding: 8px;
|
padding: 12px 8px;
|
||||||
padding-right: 0px;
|
|
||||||
.title {
|
.title {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
@@ -26,25 +26,34 @@ const Container = styled.div`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
const Filters = styled.span`
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
.count {
|
||||||
|
display: flex;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 50%;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
background-color: var(--ant-color-bg-text-active);
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const ButtonWrapper = styled.div`
|
const ButtonWrapper = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
.badge {
|
|
||||||
position: absolute;
|
|
||||||
top: 4px;
|
|
||||||
right: 4px;
|
|
||||||
}
|
|
||||||
.close-btn {
|
.close-btn {
|
||||||
position: absolute;
|
|
||||||
display: none;
|
|
||||||
top: -4px;
|
|
||||||
right: -4px;
|
|
||||||
font-size: 12px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
color: var(--ant-color-text-quaternary);
|
color: var(--ant-color-text-quaternary);
|
||||||
background-color: var(--ant-color-bg-container);
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: var(--ant-color-text-tertiary);
|
color: var(--ant-color-text-tertiary);
|
||||||
}
|
}
|
||||||
@@ -62,6 +71,7 @@ const FilterForm: React.FC<
|
|||||||
contentHeight?: number;
|
contentHeight?: number;
|
||||||
initialValues?: any;
|
initialValues?: any;
|
||||||
hasFilters?: boolean;
|
hasFilters?: boolean;
|
||||||
|
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
onValuesChange?: (ChangeValues: any, allValues: any) => void;
|
onValuesChange?: (ChangeValues: any, allValues: any) => void;
|
||||||
}
|
}
|
||||||
@@ -70,6 +80,7 @@ const FilterForm: React.FC<
|
|||||||
width = 300,
|
width = 300,
|
||||||
contentHeight = 400,
|
contentHeight = 400,
|
||||||
initialValues = {},
|
initialValues = {},
|
||||||
|
placement = 'bottomLeft',
|
||||||
onClose,
|
onClose,
|
||||||
onValuesChange
|
onValuesChange
|
||||||
}) => {
|
}) => {
|
||||||
@@ -88,9 +99,10 @@ const FilterForm: React.FC<
|
|||||||
|
|
||||||
const handleOnReset = () => {
|
const handleOnReset = () => {
|
||||||
form.resetFields(Object.keys(initialValues));
|
form.resetFields(Object.keys(initialValues));
|
||||||
onValuesChange?.({}, initialValues);
|
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
setHasFilters(false);
|
setHasFilters(false);
|
||||||
|
form.resetFields();
|
||||||
|
onValuesChange?.({}, form.getFieldsValue());
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnClose = () => {
|
const handleOnClose = () => {
|
||||||
@@ -106,19 +118,42 @@ const FilterForm: React.FC<
|
|||||||
setHasFilters(hasActiveFilters);
|
setHasFilters(hasActiveFilters);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleOnClear = () => {
|
||||||
|
handleOnReset();
|
||||||
|
};
|
||||||
|
|
||||||
|
const filtersCount = Object.values(form.getFieldsValue()).filter(
|
||||||
|
(value) => value !== undefined && value !== null && value !== ''
|
||||||
|
).length;
|
||||||
|
|
||||||
|
const renderFooter = () => {
|
||||||
|
return (
|
||||||
|
<div className="btn-wrapper">
|
||||||
|
<Button size="middle" onClick={handleOnReset}>
|
||||||
|
{intl.formatMessage({ id: 'common.button.reset' })}
|
||||||
|
</Button>
|
||||||
|
<div className="buttons">
|
||||||
|
<Button size="middle" type="primary" onClick={handleOnClose}>
|
||||||
|
{intl.formatMessage({ id: 'common.button.close' })}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover
|
<Popover
|
||||||
open={open}
|
open={open}
|
||||||
trigger={'click'}
|
trigger={['click', 'hover']}
|
||||||
arrow={false}
|
arrow={false}
|
||||||
placement="bottomRight"
|
placement={placement}
|
||||||
content={
|
content={
|
||||||
<Container>
|
<Container>
|
||||||
<OverlayScroller
|
<OverlayScroller
|
||||||
maxHeight={contentHeight}
|
maxHeight={contentHeight}
|
||||||
styles={{
|
styles={{
|
||||||
wrapper: {
|
wrapper: {
|
||||||
paddingInlineStart: 0
|
paddingInline: 8
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -126,26 +161,29 @@ const FilterForm: React.FC<
|
|||||||
onValuesChange={handleOnValuesChange}
|
onValuesChange={handleOnValuesChange}
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
form={form}
|
form={form}
|
||||||
|
layout="vertical"
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
lineHeight: 1,
|
||||||
|
height: 'auto',
|
||||||
|
marginBottom: 8,
|
||||||
|
fontWeight: 500
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
minHeight: 0
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</Form>
|
</Form>
|
||||||
</OverlayScroller>
|
</OverlayScroller>
|
||||||
<div className="btn-wrapper">
|
|
||||||
<Button size="middle" onClick={handleOnReset}>
|
|
||||||
{intl.formatMessage({ id: 'common.button.reset' })}
|
|
||||||
</Button>
|
|
||||||
<div className="buttons">
|
|
||||||
<Button size="middle" type="primary" onClick={handleOnClose}>
|
|
||||||
{intl.formatMessage({ id: 'common.button.close' })}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Container>
|
</Container>
|
||||||
}
|
}
|
||||||
onOpenChange={handleOpenChange}
|
onOpenChange={handleOpenChange}
|
||||||
styles={{
|
styles={{
|
||||||
container: {
|
container: {
|
||||||
padding: 8
|
padding: 8,
|
||||||
|
border: '1px solid var(--ant-color-split)'
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
width: width
|
width: width
|
||||||
@@ -153,25 +191,45 @@ const FilterForm: React.FC<
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ButtonWrapper>
|
<ButtonWrapper>
|
||||||
<Button icon={<FilterOutlined />} onClick={handleToggle}></Button>
|
<Divider orientation="vertical" style={{ height: 16 }} />
|
||||||
{hasFilters && (
|
<Button
|
||||||
<Badge
|
size="small"
|
||||||
dot
|
type="text"
|
||||||
color={'var(--ant-color-primary-text-hover)'}
|
variant="filled"
|
||||||
className="badge"
|
color="default"
|
||||||
/>
|
shape="round"
|
||||||
)}
|
>
|
||||||
{hasFilters && (
|
<Filters>
|
||||||
<span className="close-btn">
|
<span
|
||||||
<CloseCircleFilled
|
style={{
|
||||||
style={{ fontSize: 12 }}
|
fontSize: 12,
|
||||||
onClick={(e) => {
|
color: 'var(--ant-color-text-secondary)',
|
||||||
e.stopPropagation();
|
fontWeight: 400
|
||||||
handleOnReset();
|
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
</span>
|
More Filters
|
||||||
)}
|
</span>
|
||||||
|
{filtersCount > 0 ? (
|
||||||
|
<>
|
||||||
|
<span className="count">{filtersCount}</span>
|
||||||
|
<span className="close-btn">
|
||||||
|
<CloseCircleFilled
|
||||||
|
style={{ fontSize: 16 }}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
handleOnClear();
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<IconFont
|
||||||
|
type="icon-filter-list"
|
||||||
|
style={{ fontSize: 14 }}
|
||||||
|
></IconFont>
|
||||||
|
)}
|
||||||
|
</Filters>
|
||||||
|
</Button>
|
||||||
</ButtonWrapper>
|
</ButtonWrapper>
|
||||||
</Popover>
|
</Popover>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
import useOverlayScroller from '@/hooks/use-overlay-scroller';
|
||||||
|
import { ExtraContent } from '@/layouts/extraRender';
|
||||||
import {
|
import {
|
||||||
PageContainer,
|
PageContainer,
|
||||||
RouteContext,
|
RouteContext,
|
||||||
type PageContainerProps
|
type PageContainerProps
|
||||||
} from '@ant-design/pro-components';
|
} from '@ant-design/pro-components';
|
||||||
|
import { Divider } from 'antd';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useContext, useEffect, useRef } from 'react';
|
import { useContext, useEffect, useRef } from 'react';
|
||||||
import pageBoxCss from './styles/page-box.less';
|
import pageBoxCss from './styles/page-box.less';
|
||||||
@@ -38,6 +40,7 @@ export const PageContainerInner: React.FC<
|
|||||||
{...rest}
|
{...rest}
|
||||||
fixedHeader={false}
|
fixedHeader={false}
|
||||||
title={false}
|
title={false}
|
||||||
|
pageHeaderRender={false}
|
||||||
style={{
|
style={{
|
||||||
flex: 1
|
flex: 1
|
||||||
}}
|
}}
|
||||||
@@ -49,9 +52,15 @@ export const PageContainerInner: React.FC<
|
|||||||
<div className={pageBoxCss.left}>
|
<div className={pageBoxCss.left}>
|
||||||
{leftContent || pageContext.title}
|
{leftContent || pageContext.title}
|
||||||
</div>
|
</div>
|
||||||
{rightContent && (
|
<div className={pageBoxCss.right}>
|
||||||
<div className={pageBoxCss.right}>{rightContent}</div>
|
{rightContent && (
|
||||||
)}
|
<div>
|
||||||
|
{rightContent}
|
||||||
|
<Divider orientation="vertical" style={{ margin: '0 16px' }} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<ExtraContent />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={classNames(pageBoxCss.contentWrapper)}
|
className={classNames(pageBoxCss.contentWrapper)}
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import AutoTooltip from '@/components/auto-tooltip';
|
||||||
|
import React from 'react';
|
||||||
|
import pillButtonCss from './styles.less';
|
||||||
|
|
||||||
|
type Option = {
|
||||||
|
label: string;
|
||||||
|
value: string | number;
|
||||||
|
icon?: React.ReactNode;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
value?: string | number;
|
||||||
|
onChange?: (value: string | number | undefined) => void;
|
||||||
|
options: Option[];
|
||||||
|
disabled?: boolean;
|
||||||
|
variant?: 'filled' | 'outlined' | 'solid';
|
||||||
|
};
|
||||||
|
|
||||||
|
const PillButtonGroup: React.FC<Props> = ({
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
options,
|
||||||
|
disabled,
|
||||||
|
variant = 'outlined'
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<div className={pillButtonCss['wrapper']}>
|
||||||
|
{options.map((item) => {
|
||||||
|
const active = value === item.value;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AutoTooltip
|
||||||
|
ghost
|
||||||
|
title={item.label}
|
||||||
|
key={item.value}
|
||||||
|
maxWidth={'100%'}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className={`${pillButtonCss['pill-item']} ${active ? pillButtonCss['active'] : ''}`}
|
||||||
|
key={item.value}
|
||||||
|
color="default"
|
||||||
|
onClick={() => {
|
||||||
|
if (item.value !== value) {
|
||||||
|
onChange?.(item.value);
|
||||||
|
}
|
||||||
|
if (item.value === value) {
|
||||||
|
onChange?.(undefined);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{item.icon}
|
||||||
|
{item.label}
|
||||||
|
</span>
|
||||||
|
</AutoTooltip>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PillButtonGroup;
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
.pill-item {
|
||||||
|
height: 28px;
|
||||||
|
line-height: 28px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: var(--ant-border-radius);
|
||||||
|
background-color: var(--ant-color-fill-tertiary);
|
||||||
|
color: var(--ant-color-text-secondary);
|
||||||
|
padding: 0 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: var(--ant-color-fill);
|
||||||
|
color: var(--ant-color-text);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.active):hover {
|
||||||
|
background-color: var(--ant-color-fill-secondary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.wrapper {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
gap: 8px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ant-pro-page-container-children-container {
|
.ant-pro-page-container-children-container {
|
||||||
height: calc(100vh - 56px);
|
height: calc(100vh - 16px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border: 1px solid var(--color-border-container);
|
border: 1px solid var(--color-border-container);
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ const APIKeys: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const StyledCard = styled(Card)`
|
|||||||
&:hover {
|
&:hover {
|
||||||
.operations {
|
.operations {
|
||||||
background-color: var(--ant-color-fill-tertiary);
|
background-color: var(--ant-color-fill-tertiary);
|
||||||
border-radius: var(--ant-border-radius);
|
border-radius: var(--ant-border-radius-lg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -40,7 +40,7 @@ const TagInner = styled(Tag)<{ height?: number }>`
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
height: ${({ height }) => (height ? `${height}px` : '28px')};
|
height: ${({ height }) => (height ? `${height}px` : '28px')};
|
||||||
width: ${({ height }) => (height ? `${height}px` : '28px')};
|
width: ${({ height }) => (height ? `${height}px` : '28px')};
|
||||||
border-radius: 6px;
|
border-radius: var(--ant-border-radius-lg);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const ItemWrapper = styled.div`
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid var(--ant-color-border);
|
border: 1px solid var(--ant-color-border);
|
||||||
border-radius: var(--ant-border-radius);
|
border-radius: var(--ant-border-radius-lg);
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: var(--ant-color-fill-tertiary);
|
background-color: var(--ant-color-fill-tertiary);
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ const useBenchmarkColumns = (params: {
|
|||||||
...columns,
|
...columns,
|
||||||
{
|
{
|
||||||
title: (
|
title: (
|
||||||
<Typography.Text ellipsis={{ tooltip: true }}>
|
<Typography.Text
|
||||||
|
ellipsis={{ tooltip: true }}
|
||||||
|
style={{ color: 'var(--color-text-table-header)' }}
|
||||||
|
>
|
||||||
{intl.formatMessage({ id: 'common.table.operation' })}
|
{intl.formatMessage({ id: 'common.table.operation' })}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -358,7 +358,10 @@ const useColumnSettings = (options: {
|
|||||||
const metadataColumns = [
|
const metadataColumns = [
|
||||||
{
|
{
|
||||||
title: (
|
title: (
|
||||||
<Typography.Text ellipsis={{ tooltip: true }}>
|
<Typography.Text
|
||||||
|
ellipsis={{ tooltip: true }}
|
||||||
|
style={{ color: 'var(--color-text-table-header)' }}
|
||||||
|
>
|
||||||
{intl.formatMessage({ id: 'clusters.title' })}
|
{intl.formatMessage({ id: 'clusters.title' })}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
),
|
),
|
||||||
@@ -371,7 +374,10 @@ const useColumnSettings = (options: {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: (
|
title: (
|
||||||
<Typography.Text ellipsis={{ tooltip: true }}>
|
<Typography.Text
|
||||||
|
ellipsis={{ tooltip: true }}
|
||||||
|
style={{ color: 'var(--color-text-table-header)' }}
|
||||||
|
>
|
||||||
{intl.formatMessage({ id: 'benchmark.detail.modelName' })}
|
{intl.formatMessage({ id: 'benchmark.detail.modelName' })}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
),
|
),
|
||||||
@@ -385,7 +391,10 @@ const useColumnSettings = (options: {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: (
|
title: (
|
||||||
<Typography.Text ellipsis={{ tooltip: true }}>
|
<Typography.Text
|
||||||
|
ellipsis={{ tooltip: true }}
|
||||||
|
style={{ color: 'var(--color-text-table-header)' }}
|
||||||
|
>
|
||||||
{intl.formatMessage({ id: 'benchmark.form.profile' })}
|
{intl.formatMessage({ id: 'benchmark.form.profile' })}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ const Benchmark: React.FC = () => {
|
|||||||
scroll={{ x: 1200 }}
|
scroll={{ x: 1200 }}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -396,6 +396,7 @@ const Clusters: React.FC = () => {
|
|||||||
></NoResult>
|
></NoResult>
|
||||||
}
|
}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -6,24 +6,12 @@ import FormDrawer from '@/pages/_components/form-drawer';
|
|||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Form } from 'antd';
|
import { Form } from 'antd';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import styled from 'styled-components';
|
|
||||||
import { ProviderType, ProviderValueMap } from '../config';
|
import { ProviderType, ProviderValueMap } from '../config';
|
||||||
import {
|
import {
|
||||||
CredentialFormData as FormData,
|
CredentialFormData as FormData,
|
||||||
CredentialListItem as ListItem
|
CredentialListItem as ListItem
|
||||||
} from '../config/types';
|
} from '../config/types';
|
||||||
|
|
||||||
const ExtraContent = styled.div`
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 6px;
|
|
||||||
right: 32px;
|
|
||||||
z-index: 1;
|
|
||||||
background: var(--ant-color-bg-container);
|
|
||||||
padding-inline: 8px;
|
|
||||||
`;
|
|
||||||
type AddModalProps = {
|
type AddModalProps = {
|
||||||
title: string;
|
title: string;
|
||||||
action: PageActionType;
|
action: PageActionType;
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ const WorkerPools = () => {
|
|||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ const Credentials: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ const useClusterColumns = (
|
|||||||
span: 3,
|
span: 3,
|
||||||
render: (text: string, record: ClusterListItem) => (
|
render: (text: string, record: ClusterListItem) => (
|
||||||
<>
|
<>
|
||||||
<AutoTooltip ghost>{record.name}</AutoTooltip>
|
<AutoTooltip ghost>
|
||||||
|
<span className="text-primary">{record.name}</span>
|
||||||
|
</AutoTooltip>
|
||||||
{record.is_default && (
|
{record.is_default && (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
title={intl.formatMessage({
|
title={intl.formatMessage({
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const useCredentialColumns = (
|
|||||||
sorter: tableSorter(1),
|
sorter: tableSorter(1),
|
||||||
render: (text: string) => (
|
render: (text: string) => (
|
||||||
<AutoTooltip ghost minWidth={20}>
|
<AutoTooltip ghost minWidth={20}>
|
||||||
{text}
|
<span className="text-primary">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const ActiveTable = () => {
|
|||||||
render: (text: any, record: any) => {
|
render: (text: any, record: any) => {
|
||||||
return (
|
return (
|
||||||
<AutoTooltip ghost>
|
<AutoTooltip ghost>
|
||||||
<span>
|
<span className="text-primary">
|
||||||
{record.provider_name ? `${record.provider_name}/${text}` : text}
|
{record.provider_name ? `${record.provider_name}/${text}` : text}
|
||||||
</span>
|
</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ const UsageInner: FC<{ maxWidth: number }> = ({ maxWidth }) => {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={24} sm={24} md={24} lg={24} xl={8} style={{ margin: 0 }}>
|
<Col xs={24} sm={24} md={24} lg={24} xl={8} style={{ margin: 0 }}>
|
||||||
<div
|
<div
|
||||||
style={{ margin: maxWidth < breakpoints.xl ? '26px 0' : '32px 0' }}
|
style={{ margin: maxWidth < breakpoints.xl ? '26px 0' : '29px 0' }}
|
||||||
>
|
>
|
||||||
<div className={FilterBarCss.usageTitleText}>
|
<div className={FilterBarCss.usageTitleText}>
|
||||||
{intl.formatMessage({ id: 'dashboard.topusers' })}
|
{intl.formatMessage({ id: 'dashboard.topusers' })}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ export interface NameCellProps {
|
|||||||
modelData: any;
|
modelData: any;
|
||||||
defaultOpenId?: string;
|
defaultOpenId?: string;
|
||||||
showWorkerInfo?: boolean;
|
showWorkerInfo?: boolean;
|
||||||
|
styles?: {
|
||||||
|
label?: React.CSSProperties;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const calcTotalVram = (vram: Record<string, number>) => {
|
const calcTotalVram = (vram: Record<string, number>) => {
|
||||||
@@ -110,12 +113,15 @@ const NameCell: React.FC<NameCellProps> = ({
|
|||||||
record,
|
record,
|
||||||
modelData,
|
modelData,
|
||||||
defaultOpenId,
|
defaultOpenId,
|
||||||
showWorkerInfo = true
|
showWorkerInfo = true,
|
||||||
|
styles
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<span className="flex-center instance-name">
|
<span className="flex-center instance-name">
|
||||||
<AutoTooltip title={record.name} ghost>
|
<AutoTooltip title={record.name} ghost>
|
||||||
<span className="m-r-5">{record.name}</span>
|
<span className="m-r-5" style={styles?.label}>
|
||||||
|
{record.name}
|
||||||
|
</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
{!!record.worker_id && showWorkerInfo && (
|
{!!record.worker_id && showWorkerInfo && (
|
||||||
<WorkerInfo
|
<WorkerInfo
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div style={{ borderRadius: 'var(--ant-table-header-border-radius)' }}>
|
<div style={{ borderRadius: 'var(--ant-table-header-border-radius)' }}>
|
||||||
<RowChildren>
|
<RowChildren>
|
||||||
<Row style={{ width: '100%' }} align="middle">
|
<Row
|
||||||
|
style={{ width: '100%', color: 'var(--ant-color-text-secondary)' }}
|
||||||
|
align="middle"
|
||||||
|
>
|
||||||
<Col
|
<Col
|
||||||
span={6}
|
span={6}
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import BaseSelect from '@/components/seal-form/base/select';
|
|
||||||
import { SearchOutlined, SyncOutlined } from '@ant-design/icons';
|
import { SearchOutlined, SyncOutlined } from '@ant-design/icons';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Button, Input, Space } from 'antd';
|
import { Button, Input, Space } from 'antd';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { modelCategories } from '../config';
|
import Filters from '../filters';
|
||||||
import useFilterStatus from '../hooks/use-filter-status';
|
import useFilterStatus from '../hooks/use-filter-status';
|
||||||
|
|
||||||
interface LeftFiltersProps {
|
interface LeftFiltersProps {
|
||||||
@@ -12,6 +11,7 @@ interface LeftFiltersProps {
|
|||||||
handleStatusChange: (value: string) => void;
|
handleStatusChange: (value: string) => void;
|
||||||
handleSearch: () => void;
|
handleSearch: () => void;
|
||||||
handleCategoryChange: (value: string) => void;
|
handleCategoryChange: (value: string) => void;
|
||||||
|
onFilterChange: (allValues: any) => void;
|
||||||
clusterList: Global.BaseOption<number>[];
|
clusterList: Global.BaseOption<number>[];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,6 +22,7 @@ const LeftFilters: React.FC<LeftFiltersProps> = (props) => {
|
|||||||
handleStatusChange,
|
handleStatusChange,
|
||||||
handleSearch,
|
handleSearch,
|
||||||
handleCategoryChange,
|
handleCategoryChange,
|
||||||
|
onFilterChange,
|
||||||
clusterList
|
clusterList
|
||||||
} = props;
|
} = props;
|
||||||
const { labelRender, optionRender, statusOptions } = useFilterStatus();
|
const { labelRender, optionRender, statusOptions } = useFilterStatus();
|
||||||
@@ -36,12 +37,19 @@ const LeftFilters: React.FC<LeftFiltersProps> = (props) => {
|
|||||||
></SearchOutlined>
|
></SearchOutlined>
|
||||||
}
|
}
|
||||||
placeholder={intl.formatMessage({ id: 'common.filter.name' })}
|
placeholder={intl.formatMessage({ id: 'common.filter.name' })}
|
||||||
style={{ width: 200 }}
|
style={{ width: 400 }}
|
||||||
size="large"
|
size="large"
|
||||||
allowClear
|
allowClear
|
||||||
|
suffix={
|
||||||
|
<Filters
|
||||||
|
clusterList={clusterList}
|
||||||
|
onValuesChange={onFilterChange}
|
||||||
|
></Filters>
|
||||||
|
}
|
||||||
onChange={handleNameChange}
|
onChange={handleNameChange}
|
||||||
></Input>
|
></Input>
|
||||||
<BaseSelect
|
|
||||||
|
{/* <BaseSelect
|
||||||
allowClear
|
allowClear
|
||||||
showSearch={false}
|
showSearch={false}
|
||||||
placeholder={intl.formatMessage({
|
placeholder={intl.formatMessage({
|
||||||
@@ -76,7 +84,7 @@ const LeftFilters: React.FC<LeftFiltersProps> = (props) => {
|
|||||||
labelRender={labelRender}
|
labelRender={labelRender}
|
||||||
options={statusOptions}
|
options={statusOptions}
|
||||||
onChange={handleStatusChange}
|
onChange={handleStatusChange}
|
||||||
></BaseSelect>
|
></BaseSelect> */}
|
||||||
<Button
|
<Button
|
||||||
type="text"
|
type="text"
|
||||||
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
style={{ color: 'var(--ant-color-text-tertiary)' }}
|
||||||
|
|||||||
@@ -564,6 +564,7 @@ const Models: React.FC<ModelsProps> = ({
|
|||||||
handleCategoryChange={handleCategoryChange}
|
handleCategoryChange={handleCategoryChange}
|
||||||
handleStatusChange={onStatusChange}
|
handleStatusChange={onStatusChange}
|
||||||
handleSearch={handleSearch}
|
handleSearch={handleSearch}
|
||||||
|
onFilterChange={onFilterChange}
|
||||||
clusterList={clusterList}
|
clusterList={clusterList}
|
||||||
></LeftFilters>
|
></LeftFilters>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import BaseSelect from '@/components/seal-form/base/select';
|
import BaseSelect from '@/components/seal-form/base/select';
|
||||||
import FilterForm from '@/pages/_components/filter-form';
|
import FilterForm from '@/pages/_components/filter-form';
|
||||||
|
import PillButtonGroup from '@/pages/_components/pill-button-group';
|
||||||
import { useIntl } from '@umijs/max';
|
import { useIntl } from '@umijs/max';
|
||||||
import { Form } from 'antd';
|
import { Form } from 'antd';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
@@ -9,7 +10,14 @@ import useFilterStatus from '../hooks/use-filter-status';
|
|||||||
const Content = styled.div`
|
const Content = styled.div`
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 12px;
|
// gap: 16px;
|
||||||
|
`;
|
||||||
|
const Label = styled.span`
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-block: 16px;
|
||||||
|
color: var(--ant-color-text-tertiary);
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface FilterFormContentProps {
|
interface FilterFormContentProps {
|
||||||
@@ -32,23 +40,23 @@ const FilterFormContent: React.FC<FilterFormContentProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<FilterForm
|
<FilterForm
|
||||||
|
width={430}
|
||||||
onValuesChange={handleOnValuesChange}
|
onValuesChange={handleOnValuesChange}
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
>
|
>
|
||||||
<Content>
|
<Content>
|
||||||
<Form.Item name="categories" noStyle>
|
<Label style={{ marginTop: 0 }}>
|
||||||
<BaseSelect
|
{intl.formatMessage({
|
||||||
allowClear
|
id: 'clusters.filterBy.cluster'
|
||||||
showSearch={false}
|
})}
|
||||||
placeholder={intl.formatMessage({
|
</Label>
|
||||||
id: 'models.filter.category'
|
<Form.Item
|
||||||
})}
|
noStyle
|
||||||
size="large"
|
name="cluster_id"
|
||||||
maxTagCount={1}
|
label={intl.formatMessage({
|
||||||
options={modelCategories.filter((item) => item.value)}
|
id: 'clusters.filterBy.cluster'
|
||||||
></BaseSelect>
|
})}
|
||||||
</Form.Item>
|
>
|
||||||
<Form.Item name="cluster_id" noStyle>
|
|
||||||
<BaseSelect
|
<BaseSelect
|
||||||
allowClear
|
allowClear
|
||||||
showSearch={false}
|
showSearch={false}
|
||||||
@@ -60,8 +68,44 @@ const FilterFormContent: React.FC<FilterFormContentProps> = ({
|
|||||||
options={clusterList}
|
options={clusterList}
|
||||||
></BaseSelect>
|
></BaseSelect>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="state" noStyle>
|
<Label>
|
||||||
<BaseSelect
|
{intl.formatMessage({
|
||||||
|
id: 'models.filter.category'
|
||||||
|
})}
|
||||||
|
</Label>
|
||||||
|
<Form.Item
|
||||||
|
noStyle
|
||||||
|
name="categories"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'models.filter.category'
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<PillButtonGroup
|
||||||
|
allowClear
|
||||||
|
showSearch={false}
|
||||||
|
placeholder={intl.formatMessage({
|
||||||
|
id: 'models.filter.category'
|
||||||
|
})}
|
||||||
|
size="large"
|
||||||
|
maxTagCount={1}
|
||||||
|
variant="filled"
|
||||||
|
options={modelCategories.filter((item) => item.value)}
|
||||||
|
></PillButtonGroup>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Label>
|
||||||
|
{intl.formatMessage({
|
||||||
|
id: 'common.filter.status'
|
||||||
|
})}
|
||||||
|
</Label>
|
||||||
|
<Form.Item
|
||||||
|
noStyle
|
||||||
|
name="state"
|
||||||
|
label={intl.formatMessage({
|
||||||
|
id: 'common.filter.status'
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
<PillButtonGroup
|
||||||
allowClear
|
allowClear
|
||||||
showSearch={false}
|
showSearch={false}
|
||||||
placeholder={intl.formatMessage({
|
placeholder={intl.formatMessage({
|
||||||
@@ -72,7 +116,7 @@ const FilterFormContent: React.FC<FilterFormContentProps> = ({
|
|||||||
optionRender={optionRender}
|
optionRender={optionRender}
|
||||||
labelRender={labelRender}
|
labelRender={labelRender}
|
||||||
options={statusOptions}
|
options={statusOptions}
|
||||||
></BaseSelect>
|
></PillButtonGroup>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Content>
|
</Content>
|
||||||
</FilterForm>
|
</FilterForm>
|
||||||
|
|||||||
@@ -26,13 +26,15 @@ const useFilterStatus = (options?: {
|
|||||||
{
|
{
|
||||||
value: MyModelsStatusValueMap.Active,
|
value: MyModelsStatusValueMap.Active,
|
||||||
color: 'var(--ant-color-success)',
|
color: 'var(--ant-color-success)',
|
||||||
|
icon: <Dot color="var(--ant-color-success)"></Dot>,
|
||||||
label: intl.formatMessage({
|
label: intl.formatMessage({
|
||||||
id: 'models.mymodels.status.active'
|
id: 'models.mymodels.status.active'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: MyModelsStatusValueMap.Inactive,
|
value: MyModelsStatusValueMap.Inactive,
|
||||||
color: 'var(--ant-color-fill)',
|
color: 'var(--ant-color-fill-secondary)',
|
||||||
|
icon: <Dot color="var(--ant-color-fill-secondary)"></Dot>,
|
||||||
label: intl.formatMessage({
|
label: intl.formatMessage({
|
||||||
id: 'models.mymodels.status.inactive'
|
id: 'models.mymodels.status.inactive'
|
||||||
})
|
})
|
||||||
@@ -40,6 +42,7 @@ const useFilterStatus = (options?: {
|
|||||||
{
|
{
|
||||||
value: MyModelsStatusValueMap.Degrade,
|
value: MyModelsStatusValueMap.Degrade,
|
||||||
color: 'var(--ant-color-warning)',
|
color: 'var(--ant-color-warning)',
|
||||||
|
icon: <Dot color="var(--ant-color-warning)"></Dot>,
|
||||||
label: intl.formatMessage({
|
label: intl.formatMessage({
|
||||||
id: 'models.mymodels.status.degrade'
|
id: 'models.mymodels.status.degrade'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -28,6 +28,20 @@ interface ActionItem {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Dot = ({ color }: { color: string }) => {
|
||||||
|
return (
|
||||||
|
<span
|
||||||
|
style={{
|
||||||
|
backgroundColor: color,
|
||||||
|
borderRadius: '50%',
|
||||||
|
height: 8,
|
||||||
|
width: 8,
|
||||||
|
display: 'flex'
|
||||||
|
}}
|
||||||
|
></span>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const ActionList: ActionItem[] = [
|
const ActionList: ActionItem[] = [
|
||||||
{
|
{
|
||||||
label: 'common.button.edit',
|
label: 'common.button.edit',
|
||||||
@@ -119,6 +133,21 @@ const useModelsColumns = ({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getColor = (record: ListItem) => {
|
||||||
|
if (!record.replicas && !record.ready_replicas) {
|
||||||
|
return 'var(--ant-color-fill-secondary)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (record.replicas > 0 && !record.ready_replicas) {
|
||||||
|
return 'var(--ant-color-warning)';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (record.ready_replicas > 0 && record.replicas > 0) {
|
||||||
|
return 'var(--ant-color-success)';
|
||||||
|
}
|
||||||
|
return 'var(--ant-color-warning)';
|
||||||
|
};
|
||||||
|
|
||||||
return useMemo(() => {
|
return useMemo(() => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -130,7 +159,7 @@ const useModelsColumns = ({
|
|||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
||||||
<AutoTooltip ghost>
|
<AutoTooltip ghost>
|
||||||
<span>{text}</span>
|
<span className="text-primary font-400">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
<ModelTag categoryKey={record.categories?.[0] || ''} />
|
<ModelTag categoryKey={record.categories?.[0] || ''} />
|
||||||
</span>
|
</span>
|
||||||
@@ -171,9 +200,7 @@ const useModelsColumns = ({
|
|||||||
{ api: `${window.location.origin}/${OPENAI_COMPATIBLE}` }
|
{ api: `${window.location.origin}/${OPENAI_COMPATIBLE}` }
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<span style={{ fontWeight: 'var(--font-weight-medium)' }}>
|
<span>{intl.formatMessage({ id: 'models.form.replicas' })}</span>
|
||||||
{intl.formatMessage({ id: 'models.form.replicas' })}
|
|
||||||
</span>
|
|
||||||
<QuestionCircleOutlined className="m-l-5" />
|
<QuestionCircleOutlined className="m-l-5" />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
),
|
),
|
||||||
@@ -187,7 +214,16 @@ const useModelsColumns = ({
|
|||||||
title: intl.formatMessage({ id: 'models.table.replicas.edit' })
|
title: intl.formatMessage({ id: 'models.table.replicas.edit' })
|
||||||
},
|
},
|
||||||
render: (text: number, record: ListItem) => (
|
render: (text: number, record: ListItem) => (
|
||||||
<span style={{ minWidth: '23px' }}>
|
<span
|
||||||
|
style={{
|
||||||
|
minWidth: '23px',
|
||||||
|
display: 'inline-flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: 8,
|
||||||
|
color: 'var(--ant-color-text)'
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Dot color={getColor(record)}></Dot>
|
||||||
{record.ready_replicas} / {record.replicas}
|
{record.ready_replicas} / {record.replicas}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ const InstanceView = forwardRef((props, ref) => {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
scroll={{ x: 900 }}
|
scroll={{ x: 900 }}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const WorkerInfoContent: React.FC<NameCellProps> = ({ record, modelData }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const useProviderColumns = (options: {
|
const useInstancesColumns = (options: {
|
||||||
workerList: workerListItem[];
|
workerList: workerListItem[];
|
||||||
clusterList: Global.BaseOption<
|
clusterList: Global.BaseOption<
|
||||||
number,
|
number,
|
||||||
@@ -112,6 +112,11 @@ const useProviderColumns = (options: {
|
|||||||
backend: record.backend,
|
backend: record.backend,
|
||||||
backend_version: record.backend_version
|
backend_version: record.backend_version
|
||||||
}}
|
}}
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: 'var(--ant-color-text)'
|
||||||
|
}
|
||||||
|
}}
|
||||||
></NameCell>
|
></NameCell>
|
||||||
<div className="flex-center">
|
<div className="flex-center">
|
||||||
<ThunderboltFilled
|
<ThunderboltFilled
|
||||||
@@ -213,4 +218,4 @@ const useProviderColumns = (options: {
|
|||||||
}, [handleSelect, onCellClick, workerList, clusterList]);
|
}, [handleSelect, onCellClick, workerList, clusterList]);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default useProviderColumns;
|
export default useInstancesColumns;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
border: 1px solid var(--ant-color-border);
|
border: 1px solid var(--ant-color-border);
|
||||||
border-radius: var(--border-radius-base);
|
border-radius: var(--ant-border-radius-lg);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ const useProviderColumns = (
|
|||||||
render: (text: string, record: MaasProviderItem) => (
|
render: (text: string, record: MaasProviderItem) => (
|
||||||
<>
|
<>
|
||||||
<AutoTooltip ghost title={text}>
|
<AutoTooltip ghost title={text}>
|
||||||
{text}
|
<span className="text-primary">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
{record.builtin && (
|
{record.builtin && (
|
||||||
<Tag color="blue" style={{ marginLeft: 8 }}>
|
<Tag color="blue" style={{ marginLeft: 8 }}>
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ const MaasProvider: React.FC = () => {
|
|||||||
columns={columns}
|
columns={columns}
|
||||||
scroll={{ x: 900 }}
|
scroll={{ x: 900 }}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -75,7 +75,10 @@ const RouteItem: React.FC<TargetItemProps> = ({
|
|||||||
return (
|
return (
|
||||||
<div style={{ borderRadius: 'var(--ant-table-header-border-radius)' }}>
|
<div style={{ borderRadius: 'var(--ant-table-header-border-radius)' }}>
|
||||||
<RowChildren>
|
<RowChildren>
|
||||||
<Row gutter={16} style={{ width: '100%' }}>
|
<Row
|
||||||
|
gutter={16}
|
||||||
|
style={{ width: '100%', color: 'var(--ant-color-text-secondary)' }}
|
||||||
|
>
|
||||||
<Col span={5}>
|
<Col span={5}>
|
||||||
<CellContent
|
<CellContent
|
||||||
style={{
|
style={{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const useAccessColumns = (
|
|||||||
render: (text: string, record: RouteItem) => (
|
render: (text: string, record: RouteItem) => (
|
||||||
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
<span className="flex-center" style={{ maxWidth: '100%' }}>
|
||||||
<AutoTooltip ghost title={text}>
|
<AutoTooltip ghost title={text}>
|
||||||
<span className="m-r-5">{text}</span>
|
<span className="m-r-5 text-primary">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
<ModelTag categoryKey={record.categories?.[0]}></ModelTag>
|
<ModelTag categoryKey={record.categories?.[0]}></ModelTag>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -333,6 +333,7 @@ const ModelRoutes: React.FC = () => {
|
|||||||
></NoResult>
|
></NoResult>
|
||||||
}
|
}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ const Playground: React.FC = () => {
|
|||||||
key="view-code-buttons"
|
key="view-code-buttons"
|
||||||
></ViewCodeButtons>
|
></ViewCodeButtons>
|
||||||
}
|
}
|
||||||
|
styles={{ containerWrapper: { padding: 0 } }}
|
||||||
className={classNames('playground-container', {
|
className={classNames('playground-container', {
|
||||||
compare: activeKey === 'compare',
|
compare: activeKey === 'compare',
|
||||||
chat: activeKey !== 'compare'
|
chat: activeKey !== 'compare'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@HEADER_HEIGHT: 56px;
|
@HEADER_HEIGHT: 0px;
|
||||||
|
|
||||||
.ground-left-wrapper {
|
.ground-left-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
height: calc(
|
height: calc(
|
||||||
100vh - @HEADER_HEIGHT - var(--page-content-padding) -
|
100vh - @HEADER_HEIGHT - var(--page-content-padding) -
|
||||||
var(--page-header-height)
|
var(--page-content-padding) - var(--page-header-height)
|
||||||
);
|
);
|
||||||
width: calc(100% - 390px);
|
width: calc(100% - 390px);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@HEADER_HEIGHT: 56px;
|
@HEADER_HEIGHT: 0px;
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
width: 390px;
|
width: 390px;
|
||||||
padding-inline: 24px;
|
padding-inline: 24px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.collapsed {
|
&.collapsed {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@HEADER_HEIGHT: 48px;
|
@HEADER_HEIGHT: 0px;
|
||||||
|
|
||||||
.play-ground {
|
.play-ground {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -337,7 +337,8 @@ const ModelFiles = () => {
|
|||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
total: dataSource.total,
|
total: dataSource.total,
|
||||||
hideOnSinglePage: queryParams.perPage === 10,
|
hideOnSinglePage: queryParams.perPage === 10,
|
||||||
onChange: handlePageChange
|
onChange: handlePageChange,
|
||||||
|
size: 'middle'
|
||||||
}}
|
}}
|
||||||
></Table>
|
></Table>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ const WorkerDetailContent: React.FC<{ worker_id: number | undefined }> = ({
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ const Workers = () => {
|
|||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
rowSelection={rowSelection}
|
rowSelection={rowSelection}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
@@ -237,7 +237,9 @@ const ResolvedPathColumn = (props: { record: ListItem }) => {
|
|||||||
<TooltipTitle path={record.resolved_paths?.[0]}></TooltipTitle>
|
<TooltipTitle path={record.resolved_paths?.[0]}></TooltipTitle>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<span>{getResolvedPath(record.resolved_paths)}</span>
|
<span className="text-primary">
|
||||||
|
{getResolvedPath(record.resolved_paths)}
|
||||||
|
</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
</TextWrapper>
|
</TextWrapper>
|
||||||
<RenderParts record={record}></RenderParts>
|
<RenderParts record={record}></RenderParts>
|
||||||
@@ -273,7 +275,11 @@ const useFilesColumns = (props: {
|
|||||||
const modelInfo = getModelInfo(record);
|
const modelInfo = getModelInfo(record);
|
||||||
const { source } = modelInfo;
|
const { source } = modelInfo;
|
||||||
return (
|
return (
|
||||||
<TextWrapper style={{ paddingRight: 8 }}>
|
<TextWrapper
|
||||||
|
style={{
|
||||||
|
paddingRight: 8
|
||||||
|
}}
|
||||||
|
>
|
||||||
<AutoTooltip ghost title={source}>
|
<AutoTooltip ghost title={source}>
|
||||||
{source}
|
{source}
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const useGPUColumns = (props: {
|
|||||||
sorter: tableSorter(1),
|
sorter: tableSorter(1),
|
||||||
render: (text: string, record: GPUDeviceItem) => (
|
render: (text: string, record: GPUDeviceItem) => (
|
||||||
<AutoTooltip ghost maxWidth={240}>
|
<AutoTooltip ghost maxWidth={240}>
|
||||||
{text}
|
<span className="text-primary">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ const useWorkerColumns = ({
|
|||||||
|
|
||||||
const renderIP = (text: string, record: ListItem) => {
|
const renderIP = (text: string, record: ListItem) => {
|
||||||
if (record.advertise_address === record.ip) {
|
if (record.advertise_address === record.ip) {
|
||||||
return record.ip;
|
return <span className="text-primary">{record.ip}</span>;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -262,15 +262,19 @@ const useWorkerColumns = ({
|
|||||||
return (
|
return (
|
||||||
<span className={workerCss.ipWrapper}>
|
<span className={workerCss.ipWrapper}>
|
||||||
<span className="item">
|
<span className="item">
|
||||||
<span>{record.ip}</span>
|
<span className="text-primary">{record.ip}</span>
|
||||||
<span className="label">{`(${intl.formatMessage({ id: 'clusters.table.ip.internal' })})`}</span>
|
<span className="label">{`(${intl.formatMessage({ id: 'clusters.table.ip.internal' })})`}</span>
|
||||||
<span> {record.advertise_address}</span>
|
<span className="text-primary">{record.advertise_address}</span>
|
||||||
<span className="label">{`(${intl.formatMessage({ id: 'clusters.table.ip.external' })})`}</span>
|
<span className="label">{`(${intl.formatMessage({ id: 'clusters.table.ip.external' })})`}</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return record.ip || record.advertise_address || '';
|
return (
|
||||||
|
<span className="text-primary">
|
||||||
|
{record.ip || record.advertise_address || ''}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const setActions = (row: ListItem) => {
|
const setActions = (row: ListItem) => {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const useUsersColumns = ({
|
|||||||
sorter: tableSorter(1),
|
sorter: tableSorter(1),
|
||||||
render: (text: string, record: ListItem) => (
|
render: (text: string, record: ListItem) => (
|
||||||
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
<AutoTooltip ghost style={{ maxWidth: 400 }}>
|
||||||
{text}
|
<span className="text-primary">{text}</span>
|
||||||
</AutoTooltip>
|
</AutoTooltip>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -199,6 +199,7 @@ const Users: React.FC = () => {
|
|||||||
rowKey="id"
|
rowKey="id"
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{
|
pagination={{
|
||||||
|
size: 'middle',
|
||||||
showSizeChanger: true,
|
showSizeChanger: true,
|
||||||
pageSize: queryParams.perPage,
|
pageSize: queryParams.perPage,
|
||||||
current: queryParams.page,
|
current: queryParams.page,
|
||||||
|
|||||||
Reference in New Issue
Block a user