mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
da1fb02c9d
优化
137 lines
4.9 KiB
TypeScript
137 lines
4.9 KiB
TypeScript
import type { SettingGroup } from './settingsGroupTypes'
|
|
|
|
export const generalSettingsGroup: SettingGroup = {
|
|
key: 'general',
|
|
label: '常规',
|
|
description: '语言 / 转码引擎参数(API 密钥请在管理后台 → 外部API 配置)',
|
|
items: [
|
|
{
|
|
key: 'tmdb.language',
|
|
label: 'TMDb 元数据语言',
|
|
type: 'select',
|
|
options: [
|
|
{ value: 'zh-CN', label: '简体中文' },
|
|
{ value: 'zh-TW', label: '繁体中文' },
|
|
{ value: 'en-US', label: 'English' },
|
|
{ value: 'ja-JP', label: '日本語' },
|
|
],
|
|
},
|
|
{
|
|
key: 'playback.direct_only',
|
|
label: '客户端直连解码(释放宿主机资源)',
|
|
type: 'toggle',
|
|
hint: '默认关闭。开启后宿主机不再进行任何 FFmpeg 转码,所有播放交给第三方客户端(Infuse / VLC / Emby 客户端等)或浏览器本地解码直连(direct play / 302 直链),大幅降低宿主机 CPU 占用。若客户端不支持源编码可能无法播放。',
|
|
defaultValue: 'false',
|
|
},
|
|
{
|
|
key: 'transcode.enabled',
|
|
label: '启用转码',
|
|
type: 'toggle',
|
|
hint: '关闭后所有视频直连播放(「客户端直连解码」开启时本项自动失效)',
|
|
defaultValue: 'true',
|
|
},
|
|
{
|
|
key: 'transcode.hw_accel',
|
|
label: '硬件编码器',
|
|
type: 'select',
|
|
hint: '只有开启下方「启用硬件加速」后才会使用;未开启时强制软件转码',
|
|
defaultValue: 'none',
|
|
options: [
|
|
{ value: 'none', label: '软件转码' },
|
|
{ value: 'nvenc', label: 'NVIDIA NVENC' },
|
|
{ value: 'qsv', label: 'Intel QSV' },
|
|
{ value: 'vaapi', label: 'VAAPI (Linux)' },
|
|
],
|
|
},
|
|
{
|
|
key: 'transcode.hw_enabled',
|
|
label: '启用硬件加速',
|
|
type: 'toggle',
|
|
hint: '关闭时即使选择了 NVENC/QSV/VAAPI,也不会调用硬件编码参数',
|
|
defaultValue: 'false',
|
|
},
|
|
{
|
|
key: 'transcode.max_jobs',
|
|
label: '最大并发转码任务',
|
|
type: 'number',
|
|
hint: 'NAS 建议 1',
|
|
defaultValue: '1',
|
|
},
|
|
{
|
|
key: 'transcode.realtime',
|
|
label: '按播放速度转码',
|
|
type: 'toggle',
|
|
hint: '开启后 ffmpeg 不会抢跑压完整片,可显著降低 CPU 峰值',
|
|
defaultValue: 'true',
|
|
},
|
|
{
|
|
key: 'transcode.threads',
|
|
label: '软件转码线程数',
|
|
type: 'number',
|
|
hint: 'NAS 建议 1-2;仅软件转码生效',
|
|
defaultValue: '2',
|
|
},
|
|
{
|
|
key: 'transcode.idle_timeout_seconds',
|
|
label: '转码空闲停止秒数',
|
|
type: 'number',
|
|
hint: '播放器关闭或停止请求分片后自动结束 ffmpeg',
|
|
defaultValue: '120',
|
|
},
|
|
{
|
|
key: 'ffmpeg.path',
|
|
label: 'FFmpeg 路径',
|
|
type: 'text',
|
|
placeholder: 'ffmpeg',
|
|
},
|
|
{
|
|
key: 'ffprobe.path',
|
|
label: 'FFprobe 路径',
|
|
type: 'text',
|
|
placeholder: 'ffprobe',
|
|
},
|
|
{
|
|
key: 'ffprobe.max_concurrent',
|
|
label: 'FFprobe 最大并发',
|
|
type: 'number',
|
|
hint: 'NAS 建议 1;用于扫描、整理洗版和手动探测,避免同时启动多个 ffprobe 进程',
|
|
defaultValue: '1',
|
|
},
|
|
{
|
|
key: 'https.enabled',
|
|
label: '启用 HTTPS',
|
|
type: 'toggle',
|
|
hint: '开启后服务将仅通过 HTTPS 访问,保存后会自动切换到 https 地址,原 http 地址不再提供服务。必须先在下文配置好 SSL 证书与私钥(内容或路径任选其一,两者需匹配)才能启用;首次切换因浏览器以 origin(协议+域名+端口)隔离登录态,需要重新登录一次。',
|
|
defaultValue: 'false',
|
|
},
|
|
{
|
|
key: 'https.cert',
|
|
label: 'SSL 证书 (PEM)',
|
|
type: 'textarea',
|
|
hint: '将证书内容(-----BEGIN CERTIFICATE----- 至 -----END CERTIFICATE-----)整体粘贴到此处;也可留空,改在下方填写证书路径。',
|
|
placeholder: '-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----',
|
|
},
|
|
{
|
|
key: 'https.key',
|
|
label: 'SSL 私钥 (PEM)',
|
|
type: 'textarea',
|
|
hint: '将私钥内容粘贴到此处(支持 PKCS#8 / RSA / EC 格式);也可留空,改在下方填写私钥路径。私钥必须与证书匹配。',
|
|
placeholder: '-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----',
|
|
},
|
|
{
|
|
key: 'https.cert_path',
|
|
label: 'SSL 证书路径',
|
|
type: 'text',
|
|
hint: '可选。填写证书文件的绝对路径则优先从文件读取(无需粘贴内容);留空则使用上方粘贴的证书内容。文件被替换后无需改设置,最长 30 秒内自动热加载新证书。',
|
|
placeholder: '/etc/ssl/mmtl-cert.pem',
|
|
},
|
|
{
|
|
key: 'https.key_path',
|
|
label: 'SSL 私钥路径',
|
|
type: 'text',
|
|
hint: '可选。填写私钥文件的绝对路径则优先从文件读取;留空则使用上方粘贴的私钥内容。',
|
|
placeholder: '/etc/ssl/mmtl-key.pem',
|
|
},
|
|
],
|
|
}
|