⚽style: change the border radius of most components from full to lg size
This commit is contained in:
@@ -457,7 +457,6 @@ const EditChannel = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme="solid"
|
||||
className="!rounded-full"
|
||||
onClick={submit}
|
||||
icon={<IconSave />}
|
||||
>
|
||||
@@ -465,7 +464,6 @@ const EditChannel = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme="light"
|
||||
className="!rounded-full"
|
||||
type="primary"
|
||||
onClick={handleCancel}
|
||||
icon={<IconClose />}
|
||||
@@ -479,7 +477,7 @@ const EditChannel = (props) => {
|
||||
onCancel={() => handleCancel()}
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
<div className="p-6">
|
||||
<div className="p-2">
|
||||
<Card className="!rounded-2xl shadow-sm border-0 mb-6">
|
||||
{/* Header: Basic Info */}
|
||||
<div className="flex items-center mb-2">
|
||||
@@ -505,7 +503,6 @@ const EditChannel = (props) => {
|
||||
filter
|
||||
searchPosition='dropdown'
|
||||
placeholder={t('请选择渠道类型')}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -520,7 +517,6 @@ const EditChannel = (props) => {
|
||||
}}
|
||||
value={inputs.name}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -537,7 +533,6 @@ const EditChannel = (props) => {
|
||||
value={inputs.key}
|
||||
autosize={{ minRows: 6, maxRows: 6 }}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
@@ -566,7 +561,6 @@ const EditChannel = (props) => {
|
||||
autosize={{ minRows: 10 }}
|
||||
value={inputs.key}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
) : (
|
||||
<Input
|
||||
@@ -578,7 +572,6 @@ const EditChannel = (props) => {
|
||||
}}
|
||||
value={inputs.key}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
@@ -627,7 +620,6 @@ const EditChannel = (props) => {
|
||||
</Text>
|
||||
</div>
|
||||
}
|
||||
className='!rounded-lg'
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -646,7 +638,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('base_url', value)}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -657,7 +648,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -678,7 +668,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('base_url', value)}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
@@ -701,7 +690,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('base_url', value)}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
<Text type="tertiary" className="mt-1 text-xs">
|
||||
{t('对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写')}
|
||||
@@ -718,7 +706,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('base_url', value)}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -734,7 +721,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('base_url', value)}
|
||||
value={inputs.base_url}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -769,7 +755,6 @@ const EditChannel = (props) => {
|
||||
value={inputs.models}
|
||||
autoComplete='new-password'
|
||||
optionList={modelOptions}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -777,14 +762,12 @@ const EditChannel = (props) => {
|
||||
<Button
|
||||
type='primary'
|
||||
onClick={() => handleInputChange('models', basicModels)}
|
||||
className="!rounded-lg"
|
||||
>
|
||||
{t('填入相关模型')}
|
||||
</Button>
|
||||
<Button
|
||||
type='secondary'
|
||||
onClick={() => handleInputChange('models', fullModels)}
|
||||
className="!rounded-lg"
|
||||
>
|
||||
{t('填入所有模型')}
|
||||
</Button>
|
||||
@@ -792,7 +775,6 @@ const EditChannel = (props) => {
|
||||
<Button
|
||||
type='tertiary'
|
||||
onClick={() => fetchUpstreamModelList('models')}
|
||||
className="!rounded-lg"
|
||||
>
|
||||
{t('获取模型列表')}
|
||||
</Button>
|
||||
@@ -800,7 +782,6 @@ const EditChannel = (props) => {
|
||||
<Button
|
||||
type='warning'
|
||||
onClick={() => handleInputChange('models', [])}
|
||||
className="!rounded-lg"
|
||||
>
|
||||
{t('清除所有模型')}
|
||||
</Button>
|
||||
@@ -818,7 +799,6 @@ const EditChannel = (props) => {
|
||||
showError(t('复制失败'));
|
||||
}
|
||||
}}
|
||||
className="!rounded-lg"
|
||||
>
|
||||
{t('复制所有模型')}
|
||||
</Button>
|
||||
@@ -842,7 +822,6 @@ const EditChannel = (props) => {
|
||||
placeholder={t('输入自定义模型名称')}
|
||||
value={customModel}
|
||||
onChange={(value) => setCustomModel(value.trim())}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -858,7 +837,6 @@ const EditChannel = (props) => {
|
||||
autosize
|
||||
value={inputs.model_mapping}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
<Text
|
||||
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
||||
@@ -875,7 +853,6 @@ const EditChannel = (props) => {
|
||||
placeholder={t('不填则为模型列表第一个')}
|
||||
onChange={(value) => handleInputChange('test_model', value)}
|
||||
value={inputs.test_model}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -909,7 +886,6 @@ const EditChannel = (props) => {
|
||||
value={inputs.groups}
|
||||
autoComplete='new-password'
|
||||
optionList={groupOptions}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -922,7 +898,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -943,7 +918,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
<Text
|
||||
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
||||
@@ -963,7 +937,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -977,7 +950,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -991,7 +963,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('other', value)}
|
||||
value={inputs.other}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -1004,7 +975,6 @@ const EditChannel = (props) => {
|
||||
onChange={(value) => handleInputChange('tag', value)}
|
||||
value={inputs.tag}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1023,7 +993,6 @@ const EditChannel = (props) => {
|
||||
}}
|
||||
value={inputs.priority}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1042,7 +1011,6 @@ const EditChannel = (props) => {
|
||||
}}
|
||||
value={inputs.weight}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1058,7 +1026,6 @@ const EditChannel = (props) => {
|
||||
autosize
|
||||
value={inputs.setting}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
<div className="flex gap-2 mt-1">
|
||||
<Text
|
||||
@@ -1097,7 +1064,6 @@ const EditChannel = (props) => {
|
||||
autosize
|
||||
value={inputs.param_override}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -1109,7 +1075,6 @@ const EditChannel = (props) => {
|
||||
placeholder={t('请输入组织org-xxx')}
|
||||
onChange={(value) => handleInputChange('openai_organization', value)}
|
||||
value={inputs.openai_organization}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
<Text type="tertiary" className="mt-1 text-xs">
|
||||
{t('组织,可选,不填则为默认组织')}
|
||||
@@ -1142,7 +1107,6 @@ const EditChannel = (props) => {
|
||||
autosize
|
||||
value={inputs.status_code_mapping}
|
||||
autoComplete='new-password'
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
<Text
|
||||
className="!text-semi-color-primary cursor-pointer mt-1 block"
|
||||
|
||||
@@ -283,7 +283,6 @@ const EditTagModal = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme="solid"
|
||||
className="!rounded-full"
|
||||
onClick={handleSave}
|
||||
loading={loading}
|
||||
icon={<IconSave />}
|
||||
@@ -292,7 +291,6 @@ const EditTagModal = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme="light"
|
||||
className="!rounded-full"
|
||||
type="primary"
|
||||
onClick={handleClose}
|
||||
icon={<IconClose />}
|
||||
@@ -305,7 +303,7 @@ const EditTagModal = (props) => {
|
||||
closeIcon={null}
|
||||
>
|
||||
<Spin spinning={loading}>
|
||||
<div className="p-6">
|
||||
<div className="p-2">
|
||||
<Card className="!rounded-2xl shadow-sm border-0 mb-6">
|
||||
{/* Header: Tag Info */}
|
||||
<div className="flex items-center mb-2">
|
||||
@@ -331,7 +329,6 @@ const EditTagModal = (props) => {
|
||||
value={inputs.new_tag}
|
||||
onChange={(value) => setInputs({ ...inputs, new_tag: value })}
|
||||
placeholder={t('请输入新标签,留空则解散标签')}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -366,7 +363,6 @@ const EditTagModal = (props) => {
|
||||
onChange={(value) => handleInputChange('models', value)}
|
||||
value={inputs.models}
|
||||
optionList={modelOptions}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -380,7 +376,6 @@ const EditTagModal = (props) => {
|
||||
placeholder={t('输入自定义模型名称')}
|
||||
value={customModel}
|
||||
onChange={(value) => setCustomModel(value.trim())}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -392,7 +387,6 @@ const EditTagModal = (props) => {
|
||||
onChange={(value) => handleInputChange('model_mapping', value)}
|
||||
autosize
|
||||
value={inputs.model_mapping}
|
||||
className="!rounded-lg font-mono"
|
||||
/>
|
||||
<Space className="mt-2">
|
||||
<Text
|
||||
@@ -442,7 +436,6 @@ const EditTagModal = (props) => {
|
||||
onChange={(value) => handleInputChange('groups', value)}
|
||||
value={inputs.groups}
|
||||
optionList={groupOptions}
|
||||
className="!rounded-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -149,6 +149,7 @@ const Home = () => {
|
||||
type="primary"
|
||||
onClick={handleCopyBaseURL}
|
||||
icon={<IconCopy />}
|
||||
className="!rounded-full"
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -162,7 +162,6 @@ const EditRedemption = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme="solid"
|
||||
className="!rounded-full"
|
||||
onClick={() => formApiRef.current?.submitForm()}
|
||||
icon={<IconSave />}
|
||||
loading={loading}
|
||||
@@ -171,7 +170,6 @@ const EditRedemption = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme="light"
|
||||
className="!rounded-full"
|
||||
type="primary"
|
||||
onClick={handleCancel}
|
||||
icon={<IconClose />}
|
||||
@@ -191,7 +189,7 @@ const EditRedemption = (props) => {
|
||||
onSubmit={submit}
|
||||
>
|
||||
{({ values }) => (
|
||||
<div className="p-6 space-y-6">
|
||||
<div className="p-2">
|
||||
<Card className="!rounded-2xl shadow-sm border-0 mb-6">
|
||||
{/* Header: Basic Info */}
|
||||
<div className="flex items-center mb-2">
|
||||
|
||||
@@ -230,7 +230,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
render: (text, record) => (
|
||||
<Tag
|
||||
color={record.color}
|
||||
className="!rounded-full"
|
||||
shape='circle'
|
||||
style={{ maxWidth: '280px' }}
|
||||
>
|
||||
{text}
|
||||
@@ -277,7 +277,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleEditApi(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
@@ -287,7 +286,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
type='danger'
|
||||
theme='light'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleDeleteApi(record)}
|
||||
>
|
||||
{t('删除')}
|
||||
@@ -327,7 +325,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<Plus size={14} />}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
onClick={handleAddApi}
|
||||
>
|
||||
{t('添加API')}
|
||||
@@ -338,7 +336,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
onClick={handleBatchDelete}
|
||||
disabled={selectedRowKeys.length === 0}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
|
||||
</Button>
|
||||
@@ -348,7 +346,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
loading={loading}
|
||||
disabled={!hasChanges}
|
||||
type='secondary'
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('保存设置')}
|
||||
</Button>
|
||||
@@ -430,7 +428,7 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
}
|
||||
className="rounded-xl overflow-hidden"
|
||||
className="overflow-hidden"
|
||||
/>
|
||||
</Form.Section>
|
||||
|
||||
@@ -441,7 +439,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
onCancel={() => setShowApiModal(false)}
|
||||
okText={t('保存')}
|
||||
cancelText={t('取消')}
|
||||
className="rounded-xl"
|
||||
confirmLoading={modalLoading}
|
||||
>
|
||||
<Form layout='vertical' initValues={apiForm} key={editingApi ? editingApi.id : 'new'}>
|
||||
@@ -495,7 +492,6 @@ const SettingsAPIInfo = ({ options, refresh }) => {
|
||||
okText={t('确认删除')}
|
||||
cancelText={t('取消')}
|
||||
type="warning"
|
||||
className="rounded-xl"
|
||||
okButtonProps={{
|
||||
type: 'danger',
|
||||
theme: 'solid'
|
||||
|
||||
@@ -155,7 +155,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleEditAnnouncement(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
@@ -165,7 +164,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
type='danger'
|
||||
theme='light'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleDeleteAnnouncement(record)}
|
||||
>
|
||||
{t('删除')}
|
||||
@@ -365,7 +363,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<Plus size={14} />}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
onClick={handleAddAnnouncement}
|
||||
>
|
||||
{t('添加公告')}
|
||||
@@ -376,7 +374,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
onClick={handleBatchDelete}
|
||||
disabled={selectedRowKeys.length === 0}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
|
||||
</Button>
|
||||
@@ -386,7 +384,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
loading={loading}
|
||||
disabled={!hasChanges}
|
||||
type='secondary'
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('保存设置')}
|
||||
</Button>
|
||||
@@ -471,7 +469,7 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
}
|
||||
className="rounded-xl overflow-hidden"
|
||||
className="overflow-hidden"
|
||||
/>
|
||||
</Form.Section>
|
||||
|
||||
@@ -482,7 +480,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
onCancel={() => setShowAnnouncementModal(false)}
|
||||
okText={t('保存')}
|
||||
cancelText={t('取消')}
|
||||
className="rounded-xl"
|
||||
confirmLoading={modalLoading}
|
||||
>
|
||||
<Form
|
||||
@@ -543,7 +540,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
okText={t('确认删除')}
|
||||
cancelText={t('取消')}
|
||||
type="warning"
|
||||
className="rounded-xl"
|
||||
okButtonProps={{
|
||||
type: 'danger',
|
||||
theme: 'solid'
|
||||
@@ -566,7 +562,6 @@ const SettingsAnnouncements = ({ options, refresh }) => {
|
||||
onCancel={() => setShowContentModal(false)}
|
||||
okText={t('确定')}
|
||||
cancelText={t('取消')}
|
||||
className="rounded-xl"
|
||||
width={800}
|
||||
>
|
||||
<TextArea
|
||||
|
||||
@@ -98,7 +98,6 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleEditFaq(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
@@ -108,7 +107,6 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
type='danger'
|
||||
theme='light'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleDeleteFaq(record)}
|
||||
>
|
||||
{t('删除')}
|
||||
@@ -297,7 +295,7 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<Plus size={14} />}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
onClick={handleAddFaq}
|
||||
>
|
||||
{t('添加问答')}
|
||||
@@ -308,7 +306,7 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
onClick={handleBatchDelete}
|
||||
disabled={selectedRowKeys.length === 0}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
|
||||
</Button>
|
||||
@@ -318,7 +316,7 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
loading={loading}
|
||||
disabled={!hasChanges}
|
||||
type='secondary'
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('保存设置')}
|
||||
</Button>
|
||||
@@ -397,7 +395,7 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
}
|
||||
className="rounded-xl overflow-hidden"
|
||||
className="overflow-hidden"
|
||||
/>
|
||||
</Form.Section>
|
||||
|
||||
@@ -408,7 +406,6 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
onCancel={() => setShowFaqModal(false)}
|
||||
okText={t('保存')}
|
||||
cancelText={t('取消')}
|
||||
className="rounded-xl"
|
||||
confirmLoading={modalLoading}
|
||||
width={800}
|
||||
>
|
||||
@@ -444,7 +441,6 @@ const SettingsFAQ = ({ options, refresh }) => {
|
||||
okText={t('确认删除')}
|
||||
cancelText={t('取消')}
|
||||
type="warning"
|
||||
className="rounded-xl"
|
||||
okButtonProps={{
|
||||
type: 'danger',
|
||||
theme: 'solid'
|
||||
|
||||
@@ -101,7 +101,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleEditGroup(record)}
|
||||
>
|
||||
{t('编辑')}
|
||||
@@ -111,7 +110,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
type='danger'
|
||||
theme='light'
|
||||
size='small'
|
||||
className="!rounded-full"
|
||||
onClick={() => handleDeleteGroup(record)}
|
||||
>
|
||||
{t('删除')}
|
||||
@@ -314,7 +312,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
type='primary'
|
||||
icon={<Plus size={14} />}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
onClick={handleAddGroup}
|
||||
>
|
||||
{t('添加分类')}
|
||||
@@ -325,7 +323,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
theme='light'
|
||||
onClick={handleBatchDelete}
|
||||
disabled={selectedRowKeys.length === 0}
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('批量删除')} {selectedRowKeys.length > 0 && `(${selectedRowKeys.length})`}
|
||||
</Button>
|
||||
@@ -335,7 +333,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
loading={loading}
|
||||
disabled={!hasChanges}
|
||||
type='secondary'
|
||||
className="!rounded-full w-full md:w-auto"
|
||||
className="w-full md:w-auto"
|
||||
>
|
||||
{t('保存设置')}
|
||||
</Button>
|
||||
@@ -413,7 +411,7 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
style={{ padding: 30 }}
|
||||
/>
|
||||
}
|
||||
className="rounded-xl overflow-hidden"
|
||||
className="overflow-hidden"
|
||||
/>
|
||||
</Form.Section>
|
||||
|
||||
@@ -424,7 +422,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
onCancel={() => setShowUptimeModal(false)}
|
||||
okText={t('保存')}
|
||||
cancelText={t('取消')}
|
||||
className="rounded-xl"
|
||||
confirmLoading={modalLoading}
|
||||
width={600}
|
||||
>
|
||||
@@ -467,7 +464,6 @@ const SettingsUptimeKuma = ({ options, refresh }) => {
|
||||
okText={t('确认删除')}
|
||||
cancelText={t('取消')}
|
||||
type="warning"
|
||||
className="rounded-xl"
|
||||
okButtonProps={{
|
||||
type: 'danger',
|
||||
theme: 'solid'
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
renderQuotaWithPrompt,
|
||||
} from '../../helpers';
|
||||
import {
|
||||
Banner,
|
||||
Button,
|
||||
SideSheet,
|
||||
Space,
|
||||
@@ -27,7 +26,7 @@ import {
|
||||
IconLink,
|
||||
IconSave,
|
||||
IconClose,
|
||||
IconPlusCircle,
|
||||
IconKey,
|
||||
} from '@douyinfe/semi-icons';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
@@ -37,11 +36,11 @@ const { Text, Title } = Typography;
|
||||
const EditToken = (props) => {
|
||||
const { t } = useTranslation();
|
||||
const [statusState, statusDispatch] = useContext(StatusContext);
|
||||
const [isEdit, setIsEdit] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const formApiRef = useRef(null);
|
||||
const [models, setModels] = useState([]);
|
||||
const [groups, setGroups] = useState([]);
|
||||
const isEdit = props.editingToken.id !== undefined;
|
||||
|
||||
const getInitValues = () => ({
|
||||
name: '',
|
||||
@@ -136,10 +135,6 @@ const EditToken = (props) => {
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setIsEdit(props.editingToken.id !== undefined);
|
||||
}, [props.editingToken.id]);
|
||||
|
||||
useEffect(() => {
|
||||
if (formApiRef.current) {
|
||||
if (!isEdit) {
|
||||
@@ -150,7 +145,7 @@ const EditToken = (props) => {
|
||||
}
|
||||
loadModels();
|
||||
loadGroups();
|
||||
}, [isEdit]);
|
||||
}, [props.editingToken.id]);
|
||||
|
||||
const generateRandomSuffix = () => {
|
||||
const characters =
|
||||
@@ -262,7 +257,7 @@ const EditToken = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme='solid'
|
||||
className='!rounded-full'
|
||||
className='!rounded-lg'
|
||||
onClick={() => formApiRef.current?.submitForm()}
|
||||
icon={<IconSave />}
|
||||
loading={loading}
|
||||
@@ -271,7 +266,7 @@ const EditToken = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme='light'
|
||||
className='!rounded-full'
|
||||
className='!rounded-lg'
|
||||
type='primary'
|
||||
onClick={handleCancel}
|
||||
icon={<IconClose />}
|
||||
@@ -292,12 +287,12 @@ const EditToken = (props) => {
|
||||
onSubmit={submit}
|
||||
>
|
||||
{({ values }) => (
|
||||
<div className='p-6 space-y-6'>
|
||||
<div className='p-2'>
|
||||
{/* 基本信息 */}
|
||||
<Card className='!rounded-2xl shadow-sm border-0'>
|
||||
<div className='flex items-center mb-2'>
|
||||
<Avatar size='small' color='blue' className='mr-2 shadow-md'>
|
||||
<IconPlusCircle size={16} />
|
||||
<IconKey size={16} />
|
||||
</Avatar>
|
||||
<div>
|
||||
<Text className='text-lg font-medium'>{t('基本信息')}</Text>
|
||||
@@ -322,33 +317,36 @@ const EditToken = (props) => {
|
||||
placeholder={t('令牌分组,默认为用户的分组')}
|
||||
optionList={groups}
|
||||
renderOptionItem={renderGroupOption}
|
||||
showClear
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
) : (
|
||||
<Form.Select
|
||||
placeholder={t('管理员未设置用户可选分组')}
|
||||
disabled
|
||||
label={t('令牌分组')}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
)}
|
||||
</Col>
|
||||
<Col span={10}>
|
||||
<Col xs={24} sm={24} md={24} lg={10} xl={10}>
|
||||
<Form.DatePicker
|
||||
field='expired_time'
|
||||
label={t('过期时间')}
|
||||
type='dateTime'
|
||||
placeholder={t('请选择过期时间')}
|
||||
style={{ width: '100%' }}
|
||||
rules={[{ required: true, message: t('请选择过期时间') }]}
|
||||
showClear
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={14} className='flex flex-col justify-end'>
|
||||
<Form.Slot label={t('快捷设置')}>
|
||||
<Col xs={24} sm={24} md={24} lg={14} xl={14}>
|
||||
<Form.Slot label={t('过期时间快捷设置')}>
|
||||
<Space wrap>
|
||||
<Button
|
||||
theme='light'
|
||||
type='primary'
|
||||
onClick={() => setExpiredTime(0, 0, 0, 0)}
|
||||
className='!rounded-full'
|
||||
>
|
||||
{t('永不过期')}
|
||||
</Button>
|
||||
@@ -356,7 +354,6 @@ const EditToken = (props) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
onClick={() => setExpiredTime(1, 0, 0, 0)}
|
||||
className='!rounded-full'
|
||||
>
|
||||
{t('一个月')}
|
||||
</Button>
|
||||
@@ -364,7 +361,6 @@ const EditToken = (props) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
onClick={() => setExpiredTime(0, 1, 0, 0)}
|
||||
className='!rounded-full'
|
||||
>
|
||||
{t('一天')}
|
||||
</Button>
|
||||
@@ -372,7 +368,6 @@ const EditToken = (props) => {
|
||||
theme='light'
|
||||
type='tertiary'
|
||||
onClick={() => setExpiredTime(0, 0, 1, 0)}
|
||||
className='!rounded-full'
|
||||
>
|
||||
{t('一小时')}
|
||||
</Button>
|
||||
@@ -387,6 +382,7 @@ const EditToken = (props) => {
|
||||
min={1}
|
||||
extraText={t('批量创建时会在名称后自动添加随机后缀')}
|
||||
rules={[{ required: true, message: t('请输入新建数量') }]}
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</Col>
|
||||
)}
|
||||
@@ -405,7 +401,7 @@ const EditToken = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
<Row gutter={12}>
|
||||
<Col span={10}>
|
||||
<Col span={24}>
|
||||
<Form.AutoComplete
|
||||
field='remain_quota'
|
||||
label={t('额度')}
|
||||
@@ -424,15 +420,15 @@ const EditToken = (props) => {
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={14} className='flex justify-end'>
|
||||
<Form.Switch field='unlimited_quota' label={t('无限额度')} size='large' />
|
||||
<Col span={24}>
|
||||
<Form.Switch
|
||||
field='unlimited_quota'
|
||||
label={t('无限额度')}
|
||||
size='large'
|
||||
extraText={t('令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制')}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Banner
|
||||
type='warning'
|
||||
description={t('注意,令牌的额度仅用于限制令牌本身的最大额度使用量,实际的使用受到账户的剩余额度限制。')}
|
||||
className='mb-4 !rounded-lg'
|
||||
/>
|
||||
</Card>
|
||||
|
||||
{/* 访问限制 */}
|
||||
@@ -452,8 +448,11 @@ const EditToken = (props) => {
|
||||
field='allow_ips'
|
||||
label={t('IP白名单')}
|
||||
placeholder={t('允许的IP,一行一个,不填写则不限制')}
|
||||
rows={4}
|
||||
autosize
|
||||
rows={1}
|
||||
extraText={t('请勿过度信任此功能,IP可能被伪造')}
|
||||
showClear
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
@@ -465,6 +464,8 @@ const EditToken = (props) => {
|
||||
optionList={models}
|
||||
maxTagCount={3}
|
||||
extraText={t('非必要,不建议启用模型限制')}
|
||||
showClear
|
||||
style={{ width: '100%' }}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
@@ -73,7 +73,6 @@ const AddUser = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme="solid"
|
||||
className="!rounded-full"
|
||||
onClick={() => formApiRef.current?.submitForm()}
|
||||
icon={<IconSave />}
|
||||
loading={loading}
|
||||
@@ -82,7 +81,6 @@ const AddUser = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme="light"
|
||||
className="!rounded-full"
|
||||
type="primary"
|
||||
onClick={handleCancel}
|
||||
icon={<IconClose />}
|
||||
@@ -106,7 +104,7 @@ const AddUser = (props) => {
|
||||
formApiRef.current?.scrollToError();
|
||||
}}
|
||||
>
|
||||
<div className="p-6 space-y-6">
|
||||
<div className="p-2">
|
||||
<Card className="!rounded-2xl shadow-sm border-0">
|
||||
<div className="flex items-center mb-2">
|
||||
<Avatar size="small" color="blue" className="mr-2 shadow-md">
|
||||
@@ -124,13 +122,17 @@ const AddUser = (props) => {
|
||||
field='username'
|
||||
label={t('用户名')}
|
||||
placeholder={t('请输入用户名')}
|
||||
rules={[{ required: true, message: t('请输入用户名') }]} />
|
||||
rules={[{ required: true, message: t('请输入用户名') }]}
|
||||
showClear
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Input
|
||||
field='display_name'
|
||||
label={t('显示名称')}
|
||||
placeholder={t('请输入显示名称')} />
|
||||
placeholder={t('请输入显示名称')}
|
||||
showClear
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Input
|
||||
@@ -138,13 +140,17 @@ const AddUser = (props) => {
|
||||
label={t('密码')}
|
||||
type='password'
|
||||
placeholder={t('请输入密码')}
|
||||
rules={[{ required: true, message: t('请输入密码') }]} />
|
||||
rules={[{ required: true, message: t('请输入密码') }]}
|
||||
showClear
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Input
|
||||
field='remark'
|
||||
label={t('备注')}
|
||||
placeholder={t('请输入备注(仅管理员可见)')} />
|
||||
placeholder={t('请输入备注(仅管理员可见)')}
|
||||
showClear
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
@@ -142,7 +142,6 @@ const EditUser = (props) => {
|
||||
<Space>
|
||||
<Button
|
||||
theme='solid'
|
||||
className='!rounded-full'
|
||||
onClick={() => formApiRef.current?.submitForm()}
|
||||
icon={<IconSave />}
|
||||
loading={loading}
|
||||
@@ -151,7 +150,6 @@ const EditUser = (props) => {
|
||||
</Button>
|
||||
<Button
|
||||
theme='light'
|
||||
className='!rounded-full'
|
||||
type='primary'
|
||||
onClick={handleCancel}
|
||||
icon={<IconClose />}
|
||||
@@ -171,7 +169,7 @@ const EditUser = (props) => {
|
||||
onSubmit={submit}
|
||||
>
|
||||
{({ values }) => (
|
||||
<div className='p-6 space-y-6'>
|
||||
<div className='p-2'>
|
||||
{/* 基本信息 */}
|
||||
<Card className='!rounded-2xl shadow-sm border-0'>
|
||||
<div className='flex items-center mb-2'>
|
||||
|
||||
Reference in New Issue
Block a user