diff --git a/web/src/lib/components/custom/password-input.svelte b/web/src/lib/components/custom/password-input.svelte
new file mode 100644
index 0000000..767d68f
--- /dev/null
+++ b/web/src/lib/components/custom/password-input.svelte
@@ -0,0 +1,85 @@
+
+
+
+
+
+
diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts
index 6e975b5..521110e 100644
--- a/web/src/lib/types.ts
+++ b/web/src/lib/types.ts
@@ -221,9 +221,22 @@ export interface DanmakuOption {
time_offset: number;
}
+export interface RateLimit {
+ limit: number;
+ duration: number;
+}
+
+export interface ConcurrentDownloadLimit {
+ enable: boolean;
+ concurrency: number;
+ threshold: number;
+}
+
export interface ConcurrentLimit {
video: number;
page: number;
+ rate_limit?: RateLimit;
+ download: ConcurrentDownloadLimit;
}
export interface Config {
diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte
index 3811a33..b852600 100644
--- a/web/src/routes/+page.svelte
+++ b/web/src/routes/+page.svelte
@@ -191,7 +191,7 @@
- 合集
+ 合集 / 列表
{dashboardData.enabled_collections}
diff --git a/web/src/routes/settings/+page.svelte b/web/src/routes/settings/+page.svelte
index 950ca95..ce291c8 100644
--- a/web/src/routes/settings/+page.svelte
+++ b/web/src/routes/settings/+page.svelte
@@ -7,6 +7,7 @@
import * as Tabs from '$lib/components/ui/tabs/index.js';
import { Separator } from '$lib/components/ui/separator/index.js';
import { Badge } from '$lib/components/ui/badge/index.js';
+ import PasswordInput from '$lib/components/custom/password-input.svelte';
import api from '$lib/api';
import { toast } from 'svelte-sonner';
import { setBreadcrumb } from '$lib/stores/breadcrumb';
@@ -101,12 +102,7 @@
{#if !formData}
{:else}
@@ -199,11 +195,10 @@
-
-
后端 API 认证Token
+
@@ -227,25 +222,23 @@
-
-
-
-
-
-
+
+
-
-
-
+
{
+ if (checked) {
+ formData!.concurrent_limit.rate_limit = { limit: 4, duration: 250 };
+ } else {
+ formData!.concurrent_limit.rate_limit = undefined;
+ }
+ }}
/>
-
- 用于保护后端API的认证令牌,修改后需要重新进行前端认证
-
+
+
+ {#if formData.concurrent_limit.rate_limit}
+
+
+
+
+
请求限制的时间窗口(毫秒)
+
+
+
+
+
每个时间间隔内允许的最大请求数
+
+
+ {/if}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 单文件将分为若干大小相同的块并行下载,所有分块下载完毕后合并
+
+
+
+
+
+
+ 大于该阈值的文件才使用分块下载,文件过小时分块下载的拆分合并成本可能大于带来的增益
+
+
@@ -649,9 +708,6 @@
请先进行前端认证以加载配置
-
{/if}
diff --git a/web/src/routes/video-sources/+page.svelte b/web/src/routes/video-sources/+page.svelte
index 86e4583..abd3363 100644
--- a/web/src/routes/video-sources/+page.svelte
+++ b/web/src/routes/video-sources/+page.svelte
@@ -216,9 +216,8 @@
{#each Object.entries(TAB_CONFIG) as [key, config] (key)}
- {@const sources = getSourcesForTab(key)}
- {config.label}({sources.length})
+ {config.label}
{/each}