feat: add demo site configuration flag

- Introduce `DemoSiteEnabled` variable in operation settings
- Provide a configurable flag to enable/disable demo site functionality
This commit is contained in:
1808837298@qq.com
2025-02-04 14:15:01 +08:00
parent 187c336121
commit a0fe527047
5 changed files with 26 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ const OperationSetting = () => {
DefaultCollapseSidebar: false, // 默认折叠侧边栏
RetryTimes: 0,
Chats: "[]",
DemoSiteEnabled: false,
});
let [loading, setLoading] = useState(false);

View File

@@ -21,6 +21,7 @@ export default function GeneralSettings(props) {
DisplayInCurrencyEnabled: false,
DisplayTokenStatEnabled: false,
DefaultCollapseSidebar: false,
DemoSiteEnabled: false,
});
const refForm = useRef();
const [inputsRow, setInputsRow] = useState(inputs);
@@ -188,6 +189,23 @@ export default function GeneralSettings(props) {
/>
</Col>
</Row>
<Row>
<Col span={8}>
<Form.Switch
field={'DemoSiteEnabled'}
label={t('演示站点模式')}
size='default'
checkedText=''
uncheckedText=''
onChange={(value) =>
setInputs({
...inputs,
DemoSiteEnabled: value
})
}
/>
</Col>
</Row>
<Row>
<Button size='default' onClick={onSubmit}>
{t('保存通用设置')}