Просмотр исходного кода

🔧 refactor(LogsTable, render): remove undefined parameters for improved clarity and consistency in function signatures

CaIon 6 месяцев назад
Родитель
Сommit
e455f06851

+ 0 - 1
web/src/components/table/LogsTable.js

@@ -963,7 +963,6 @@ const LogsTable = () => {
                 other?.user_group_ratio,
                 false,
                 1.0,
-                undefined,
                 other.web_search || false,
                 other.web_search_call_count || 0,
                 other.file_search || false,

+ 0 - 1
web/src/helpers/render.js

@@ -1122,7 +1122,6 @@ export function renderLogContent(
   user_group_ratio,
   image = false,
   imageRatio = 1.0,
-  useUserGroupRatio = undefined,
   webSearch = false,
   webSearchCallCount = 0,
   fileSearch = false,

+ 9 - 0
web/src/pages/Setting/Operation/GroupRatioSettings.js

@@ -100,6 +100,9 @@ export default function GroupRatioSettings(props) {
               <Form.TextArea
                 label={t('分组倍率')}
                 placeholder={t('为一个 JSON 文本,键为分组名称,值为倍率')}
+                extraText={t(
+                  '分组倍率设置,可以在此处新增分组或修改现有分组的倍率,格式为 JSON 字符串,例如:{"vip": 0.5, "test": 1},表示 vip 分组的倍率为 0.5,test 分组的倍率为 1',
+                )}
                 field={'GroupRatio'}
                 autosize={{ minRows: 6, maxRows: 12 }}
                 trigger='blur'
@@ -121,6 +124,9 @@ export default function GroupRatioSettings(props) {
               <Form.TextArea
                 label={t('用户可选分组')}
                 placeholder={t('为一个 JSON 文本,键为分组名称,值为分组描述')}
+                extraText={t(
+                  '用户新建令牌时可选的分组,格式为 JSON 字符串,例如:{"vip": "VIP 用户", "test": "测试"},表示用户可以选择 vip 分组和 test 分组',
+                )}
                 field={'UserUsableGroups'}
                 autosize={{ minRows: 6, maxRows: 12 }}
                 trigger='blur'
@@ -142,6 +148,9 @@ export default function GroupRatioSettings(props) {
               <Form.TextArea
                 label={t('分组特殊倍率')}
                 placeholder={t('为一个 JSON 文本')}
+                extraText={t(
+                  '键为分组名称,值为另一个 JSON 对象,键为分组名称,值为该分组的用户的特殊分组倍率,例如:{"vip": {"default": 0.5, "test": 1}},表示 vip 分组的用户在使用default分组的令牌时倍率为0.5,使用test分组时倍率为1',
+                )}
                 field={'GroupGroupRatio'}
                 autosize={{ minRows: 6, maxRows: 12 }}
                 trigger='blur'