feat(webterm): 配置测速时长上限
This commit is contained in:
@@ -79,7 +79,7 @@ interface WebtermTarget {
|
||||
privileged: boolean;
|
||||
pid: "host" | "container";
|
||||
sourceMounts: Array<{ source: string; target: string; readOnly: boolean }>;
|
||||
networkSpeedTest: { enabled: boolean; containerName: string; hostPort: number; containerPort: number; publicUrl: string; downloadBytes: number; uploadBytes: number } | null;
|
||||
networkSpeedTest: { enabled: boolean; containerName: string; hostPort: number; containerPort: number; publicUrl: string; downloadBytes: number; uploadBytes: number; maxDurationMs: number } | null;
|
||||
autoStartSessions: Array<{ title: string; cwd: string; command: string; cols: number; rows: number; resumePrompt: boolean; fallbackShell: boolean }>;
|
||||
sessionStartModes: SessionStartModes;
|
||||
autoResumePrompt: AutoResumePrompt;
|
||||
@@ -361,6 +361,7 @@ function parseTarget(
|
||||
publicUrl: stringField(speedRaw, "publicUrl", `${path}.runtime.networkSpeedTest`),
|
||||
downloadBytes: integerField(speedRaw, "downloadBytes", `${path}.runtime.networkSpeedTest`),
|
||||
uploadBytes: integerField(speedRaw, "uploadBytes", `${path}.runtime.networkSpeedTest`),
|
||||
maxDurationMs: integerField(speedRaw, "maxDurationMs", `${path}.runtime.networkSpeedTest`),
|
||||
};
|
||||
const target: WebtermTarget = {
|
||||
id: stringField(record, "id", path),
|
||||
@@ -437,6 +438,7 @@ function renderCompose(target: WebtermTarget): string {
|
||||
NETWORK_SPEED_TEST_PUBLIC_URL: target.runtime.networkSpeedTest.publicUrl,
|
||||
NETWORK_SPEED_TEST_DOWNLOAD_BYTES: String(target.runtime.networkSpeedTest.downloadBytes),
|
||||
NETWORK_SPEED_TEST_UPLOAD_BYTES: String(target.runtime.networkSpeedTest.uploadBytes),
|
||||
NETWORK_SPEED_TEST_MAX_DURATION_MS: String(target.runtime.networkSpeedTest.maxDurationMs),
|
||||
} : {}),
|
||||
};
|
||||
const envLines = Object.entries(environment)
|
||||
|
||||
Reference in New Issue
Block a user