Merge branch 'main' of github.com:QuantumNous/new-api
This commit is contained in:
@@ -888,9 +888,13 @@ const ChannelsTable = () => {
|
||||
const localIdSort = localStorage.getItem('id-sort') === 'true';
|
||||
const localPageSize =
|
||||
parseInt(localStorage.getItem('page-size')) || ITEMS_PER_PAGE;
|
||||
const localEnableTagMode = localStorage.getItem('enable-tag-mode') === 'true';
|
||||
const localEnableBatchDelete = localStorage.getItem('enable-batch-delete') === 'true';
|
||||
setIdSort(localIdSort);
|
||||
setPageSize(localPageSize);
|
||||
loadChannels(0, localPageSize, localIdSort, enableTagMode)
|
||||
setEnableTagMode(localEnableTagMode);
|
||||
setEnableBatchDelete(localEnableBatchDelete);
|
||||
loadChannels(0, localPageSize, localIdSort, localEnableTagMode)
|
||||
.then()
|
||||
.catch((reason) => {
|
||||
showError(reason);
|
||||
@@ -1486,10 +1490,12 @@ const ChannelsTable = () => {
|
||||
{t('开启批量操作')}
|
||||
</Typography.Text>
|
||||
<Switch
|
||||
checked={enableBatchDelete}
|
||||
label={t('开启批量操作')}
|
||||
uncheckedText={t('关')}
|
||||
aria-label={t('是否开启批量操作')}
|
||||
onChange={(v) => {
|
||||
localStorage.setItem('enable-batch-delete', v + '');
|
||||
setEnableBatchDelete(v);
|
||||
}}
|
||||
/>
|
||||
@@ -1553,6 +1559,7 @@ const ChannelsTable = () => {
|
||||
uncheckedText={t('关')}
|
||||
aria-label={t('是否启用标签聚合')}
|
||||
onChange={(v) => {
|
||||
localStorage.setItem('enable-tag-mode', v + '');
|
||||
setEnableTagMode(v);
|
||||
loadChannels(0, pageSize, idSort, v);
|
||||
}}
|
||||
|
||||
@@ -158,7 +158,7 @@ const Home = () => {
|
||||
</p>
|
||||
<p>
|
||||
{t('OIDC 身份验证')}:
|
||||
{statusState?.status?.oidc === true
|
||||
{statusState?.status?.oidc_enabled === true
|
||||
? t('已启用')
|
||||
: t('未启用')}
|
||||
</p>
|
||||
|
||||
@@ -64,8 +64,9 @@ const Playground = () => {
|
||||
},
|
||||
];
|
||||
|
||||
const defaultModel = 'gpt-4o-mini';
|
||||
const [inputs, setInputs] = useState({
|
||||
model: 'gpt-4o-mini',
|
||||
model: defaultModel,
|
||||
group: '',
|
||||
max_tokens: 0,
|
||||
temperature: 0,
|
||||
@@ -108,6 +109,11 @@ const Playground = () => {
|
||||
value: model,
|
||||
}));
|
||||
setModels(localModelOptions);
|
||||
// if default model is not in the list, set the first one as default
|
||||
const hasDefault = localModelOptions.some(option => option.value === defaultModel);
|
||||
if (!hasDefault && localModelOptions.length > 0) {
|
||||
setInputs((inputs) => ({ ...inputs, model: localModelOptions[0].value }));
|
||||
}
|
||||
} else {
|
||||
showError(t(message));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user