style: modal style gap

This commit is contained in:
jialin
2024-08-16 12:03:48 +08:00
parent 1d92571d09
commit 7ff21e0d68
12 changed files with 58 additions and 21 deletions
@@ -78,7 +78,7 @@
position: relative; position: relative;
color: var(--ant-color-text-quaternary); color: var(--ant-color-text-quaternary);
font-size: 14px; font-size: 14px;
padding-right: calc(var(--ant-padding-sm) - 1px); // padding-right: calc(var(--ant-padding-sm) - 1px);
} }
} }
+1
View File
@@ -2,6 +2,7 @@ export default {
'apikeys.title': 'API Keys', 'apikeys.title': 'API Keys',
'apikeys.table.apikeys': 'keys', 'apikeys.table.apikeys': 'keys',
'apikeys.button.create': 'New API Key', 'apikeys.button.create': 'New API Key',
'apikeys.title.save': 'Save API Key',
'apikeys.form.expiretime': 'Expiration', 'apikeys.form.expiretime': 'Expiration',
'apikeys.form.apikey': 'API Key', 'apikeys.form.apikey': 'API Key',
'apikeys.table.name': 'Key Name', 'apikeys.table.name': 'Key Name',
+1
View File
@@ -2,6 +2,7 @@ export default {
'apikeys.title': 'API 密钥', 'apikeys.title': 'API 密钥',
'apikeys.table.apikeys': '密钥', 'apikeys.table.apikeys': '密钥',
'apikeys.button.create': '新建 API 密钥', 'apikeys.button.create': '新建 API 密钥',
'apikeys.title.save': '保存 API 密钥',
'apikeys.form.expiretime': '过期时间', 'apikeys.form.expiretime': '过期时间',
'apikeys.form.apikey': 'API 密钥', 'apikeys.form.apikey': 'API 密钥',
'apikeys.table.name': '密钥名称', 'apikeys.table.name': '密钥名称',
+12 -7
View File
@@ -93,7 +93,9 @@ const AddModal: React.FC<AddModalProps> = ({
return ( return (
<Modal <Modal
title={title} title={
!showKey ? title : intl.formatMessage({ id: 'apikeys.title.save' })
}
open={open} open={open}
centered={true} centered={true}
onOk={handleSumit} onOk={handleSumit}
@@ -180,13 +182,15 @@ const AddModal: React.FC<AddModalProps> = ({
</Form.Item> </Form.Item>
</> </>
) : ( ) : (
<Form.Item <Form.Item>
extra={ <div>
<Tag color="error" style={{ padding: '6px 8px', marginTop: 10 }}> <Tag
color="error"
style={{ padding: '6px 8px', marginBottom: 16 }}
>
{intl.formatMessage({ id: 'apikeys.table.save.tips' })} {intl.formatMessage({ id: 'apikeys.table.save.tips' })}
</Tag> </Tag>
} </div>
>
<SealInput.Input <SealInput.Input
label={intl.formatMessage({ id: 'apikeys.form.apikey' })} label={intl.formatMessage({ id: 'apikeys.form.apikey' })}
value={apikeyValue} value={apikeyValue}
@@ -194,7 +198,8 @@ const AddModal: React.FC<AddModalProps> = ({
<CopyButton <CopyButton
text={apikeyValue} text={apikeyValue}
shape="default" shape="default"
size="small" size="middle"
type="text"
></CopyButton> ></CopyButton>
} }
></SealInput.Input> ></SealInput.Input>
@@ -339,7 +339,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
onCancel={onCancel} onCancel={onCancel}
onOk={handleSumit} onOk={handleSumit}
style={{ style={{
padding: '16px 20px', padding: '16px 24px',
display: 'flex', display: 'flex',
justifyContent: 'flex-end' justifyContent: 'flex-end'
}} }}
@@ -352,7 +352,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
form={form} form={form}
onFinish={onOk} onFinish={onOk}
preserve={false} preserve={false}
style={{ padding: '16px 20px' }} style={{ padding: '16px 24px' }}
> >
<Form.Item<FormData> <Form.Item<FormData>
name="name" name="name"
@@ -1,7 +1,7 @@
import { convertFileSize } from '@/utils'; import { convertFileSize } from '@/utils';
import { SearchOutlined } from '@ant-design/icons'; import { SearchOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
import { Col, Empty, Row, Space, Spin } from 'antd'; import { Col, Empty, Row, Space, Spin, Tag } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import _ from 'lodash'; import _ from 'lodash';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
@@ -58,7 +58,7 @@ const HFModelFile: React.FC<HFModelFileProps> = (props) => {
} }
console.log('quanType', quanType, FileType[quanType]); console.log('quanType', quanType, FileType[quanType]);
if (FileType[quanType] !== undefined) { if (FileType[quanType] !== undefined) {
return <span className="tag-item">{quanType}</span>; return <Tag className="tag-item">{quanType}</Tag>;
} }
return null; return null;
}; };
@@ -78,7 +78,7 @@ const HFModelFile: React.FC<HFModelFileProps> = (props) => {
<TitleWrapper> <TitleWrapper>
<span>Available Files ({dataSource.fileList.length || 0})</span> <span>Available Files ({dataSource.fileList.length || 0})</span>
</TitleWrapper> </TitleWrapper>
<div style={{ padding: '16px 20px' }}> <div style={{ padding: '16px 24px' }}>
<Spin spinning={dataSource.loading} style={{ minHeight: 100 }}> <Spin spinning={dataSource.loading} style={{ minHeight: 100 }}>
{dataSource.fileList.length ? ( {dataSource.fileList.length ? (
<Row gutter={[16, 24]}> <Row gutter={[16, 24]}>
@@ -95,9 +95,20 @@ const HFModelFile: React.FC<HFModelFileProps> = (props) => {
> >
<div className="title">{item.path}</div> <div className="title">{item.path}</div>
<Space className="tags"> <Space className="tags">
<span className="tag-item"> {/* <span className="tag-item">
{convertFileSize(item.size)} {convertFileSize(item.size)}
</span> </span> */}
<Tag
className="tag-item"
color="geekblue"
style={{
marginRight: 0
}}
>
<span style={{ opacity: 0.65 }}>
{convertFileSize(item.size)}
</span>
</Tag>
{getModelQuantizationType(item)} {getModelQuantizationType(item)}
</Space> </Space>
<div className="btn"> <div className="btn">
@@ -42,6 +42,7 @@ const HFModelItem: React.FC<HFModelItemProps> = (props) => {
<Space size={16}> <Space size={16}>
{props.task && ( {props.task && (
<Tag <Tag
className="tag-item"
color="geekblue" color="geekblue"
style={{ style={{
marginRight: 0 marginRight: 0
@@ -32,7 +32,7 @@ const SearchResult: React.FC<SearchResultProps> = (props) => {
<Spin spinning={props.loading}> <Spin spinning={props.loading}>
<div style={{ minHeight: 200 }}> <div style={{ minHeight: 200 }}>
{resultList.length ? ( {resultList.length ? (
<Row gutter={[16, 16]}> <Row gutter={[16, 24]}>
{resultList.map((item, index) => ( {resultList.map((item, index) => (
<Col span={24} key={item.name}> <Col span={24} key={item.name}>
<div <div
+4 -2
View File
@@ -1,3 +1,5 @@
@padding: 24px;
.hf-model-file { .hf-model-file {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -24,7 +26,7 @@
padding: 2px 4px; padding: 2px 4px;
border-radius: 4px; border-radius: 4px;
font-size: 12px; font-size: 12px;
height: 20px; height: 22px;
border: 1px solid var(--ant-color-border); border: 1px solid var(--ant-color-border);
color: var(--ant-color-text-secondary); color: var(--ant-color-text-secondary);
} }
@@ -36,5 +38,5 @@
} }
.wrapper { .wrapper {
padding: 16px 20px; padding: 16px @padding;
} }
@@ -22,5 +22,17 @@
.info { .info {
color: var(--ant-color-text-tertiary); color: var(--ant-color-text-tertiary);
.tag-item {
display: flex;
align-items: center;
justify-content: center;
padding: 2px 4px;
border-radius: 4px;
font-size: 12px;
height: 22px;
border: 1px solid var(--ant-color-border);
color: var(--ant-color-text-secondary);
}
} }
} }
+4 -2
View File
@@ -1,6 +1,8 @@
@padding: 24px;
.search-result-wrap { .search-result-wrap {
background-color: rgba(255, 255, 255, 100%); background-color: rgba(255, 255, 255, 100%);
padding: 16px 20px; padding: 16px @padding;
border-radius: 0 0 var(--border-radius-base) var(--border-radius-base); border-radius: 0 0 var(--border-radius-base) var(--border-radius-base);
overflow-y: auto; overflow-y: auto;
height: calc(100vh - 194px); height: calc(100vh - 194px);
@@ -22,7 +24,7 @@
.search-bar { .search-bar {
left: 0; left: 0;
right: 0; right: 0;
padding-inline: 20px; padding-inline: @padding;
background: var(--color-white-1); background: var(--color-white-1);
border-bottom: 1px solid var(--ant-color-split); border-bottom: 1px solid var(--ant-color-split);
padding-bottom: 16px; padding-bottom: 16px;
+3 -1
View File
@@ -1,3 +1,5 @@
@padding: 16px 24px;
.h3 { .h3 {
position: sticky; position: sticky;
top: 0; top: 0;
@@ -5,7 +7,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 14px; font-size: 14px;
padding: 16px 20px; padding: @padding;
padding-top: 0; padding-top: 0;
margin-bottom: 0; margin-bottom: 0;
background-color: var(--color-white-1); background-color: var(--color-white-1);