diff --git a/server/components/contents/bili.jsx b/server/components/contents/bili.jsx index 3ab82e5..eda9dd8 100644 --- a/server/components/contents/bili.jsx +++ b/server/components/contents/bili.jsx @@ -1,6 +1,7 @@ import { useState, useEffect } from 'react'; import { BILI_CDN_SELECT_LIST, BILI_DOWNLOAD_METHOD, BILI_RESOLUTION_LIST } from "../../../constants/constant.js"; import { readYamlConfig, updateYamlConfig } from '../../utils/yamlHelper'; +import Toast from "../toast.jsx"; export default function Bili() { const [config, setConfig] = useState({ @@ -102,11 +103,7 @@ export default function Bili() { return (
{/* 成功提示 */} -
-
- 配置保存成功! -
-
+

Bilibili 配置

diff --git a/server/components/contents/generic.jsx b/server/components/contents/generic.jsx index 5842c1e..e7a2799 100644 --- a/server/components/contents/generic.jsx +++ b/server/components/contents/generic.jsx @@ -1,5 +1,6 @@ import { useState, useEffect } from 'react'; import { readYamlConfig, updateYamlConfig } from '../../utils/yamlHelper'; +import Toast from "../toast.jsx"; export default function Generic() { const [config, setConfig] = useState({ @@ -13,6 +14,7 @@ export default function Generic() { queueConcurrency: 1, videoDownloadConcurrency: 1, autoclearTrashtime: '0 0 8 * * ?', + xiaohongshuCookie: '', deeplApiUrls: '' }); @@ -34,6 +36,7 @@ export default function Generic() { queueConcurrency: yamlConfig.queueConcurrency || 1, videoDownloadConcurrency: yamlConfig.videoDownloadConcurrency || 1, autoclearTrashtime: yamlConfig.autoclearTrashtime || '0 0 8 * * ?', + xiaohongshuCookie: yamlConfig.xiaohongshuCookie || '', deeplApiUrls: yamlConfig.deeplApiUrls || '' }); } @@ -57,6 +60,7 @@ export default function Generic() { queueConcurrency: config.queueConcurrency, videoDownloadConcurrency: config.videoDownloadConcurrency, autoclearTrashtime: config.autoclearTrashtime, + xiaohongshuCookie: config.xiaohongshuCookie, deeplApiUrls: config.deeplApiUrls }); @@ -88,7 +92,8 @@ export default function Generic() { queueConcurrency: yamlConfig.queueConcurrency || 1, videoDownloadConcurrency: yamlConfig.videoDownloadConcurrency || 1, autoclearTrashtime: yamlConfig.autoclearTrashtime || '0 0 8 * * ?', - deeplApiUrls: yamlConfig.deeplApiUrls || '' + xiaohongshuCookie: yamlConfig.xiaohongshuCookie || '', + deeplApiUrls: yamlConfig.deeplApiUrls || '', }); } }; @@ -96,11 +101,7 @@ export default function Generic() { return (
{/* 成功提示 */} -
-
- 配置保存成功! -
-
+

通用配置

@@ -110,7 +111,7 @@ export default function Generic() {

基础配置

- {/* 路径和大小限制配置 */} + {/* 路径和大小限制配置 */ }
setConfig({ ...config, defaultPath: e.target.value })} + value={ config.defaultPath } + onChange={ (e) => setConfig({ ...config, defaultPath: e.target.value }) } placeholder="请输入视频保存路径..." className="input input-bordered" /> @@ -131,14 +132,17 @@ export default function Generic() { setConfig({ ...config, videoSizeLimit: parseInt(e.target.value) })} + value={ config.videoSizeLimit } + onChange={ (e) => setConfig({ + ...config, + videoSizeLimit: parseInt(e.target.value) + }) } className="input input-bordered" />
- {/* 代理配置 */} + {/* 代理配置 */ }
setConfig({ ...config, proxyAddr: e.target.value })} + value={ config.proxyAddr } + onChange={ (e) => setConfig({ ...config, proxyAddr: e.target.value }) } placeholder="请输入代理地址..." className="input input-bordered" /> @@ -158,15 +162,15 @@ export default function Generic() { setConfig({ ...config, proxyPort: e.target.value })} + value={ config.proxyPort } + onChange={ (e) => setConfig({ ...config, proxyPort: e.target.value }) } placeholder="请输入代理端口..." className="input input-bordered" />
- {/* 其他基础配置 */} + {/* 其他基础配置 */ }
setConfig({ ...config, identifyPrefix: e.target.value })} + value={ config.identifyPrefix } + onChange={ (e) => setConfig({ ...config, identifyPrefix: e.target.value }) } placeholder="请输入识别前缀..." className="input input-bordered" /> @@ -186,14 +190,17 @@ export default function Generic() { setConfig({ ...config, streamDuration: parseInt(e.target.value) })} + value={ config.streamDuration } + onChange={ (e) => setConfig({ + ...config, + streamDuration: parseInt(e.target.value) + }) } className="input input-bordered" />
- {/* 并发和定时配置 */} + {/* 并发和定时配置 */ }
setConfig({ ...config, queueConcurrency: parseInt(e.target.value) })} + value={ config.queueConcurrency } + onChange={ (e) => setConfig({ + ...config, + queueConcurrency: parseInt(e.target.value) + }) } className="input input-bordered" />
@@ -213,34 +223,37 @@ export default function Generic() { setConfig({ ...config, videoDownloadConcurrency: parseInt(e.target.value) })} + value={ config.videoDownloadConcurrency } + onChange={ (e) => setConfig({ + ...config, + videoDownloadConcurrency: parseInt(e.target.value) + }) } className="input input-bordered" />
- {/* DeepL API配置 */} + {/* DeepL API配置 */ }