Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f322679d4a | |||
| af5081d382 | |||
| eb095bbe98 |
@@ -0,0 +1,30 @@
|
||||
name: Web Quality
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- "codex/**"
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "24"
|
||||
cache: npm
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Verify
|
||||
run: npm run verify
|
||||
@@ -0,0 +1,10 @@
|
||||
dist
|
||||
node_modules
|
||||
coverage
|
||||
tmp
|
||||
.codex-tmp
|
||||
.codex-logs
|
||||
screenshots
|
||||
*.log
|
||||
*.tmp
|
||||
package-lock.json
|
||||
@@ -0,0 +1,77 @@
|
||||
import js from "@eslint/js";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
ignores: [
|
||||
"dist/**",
|
||||
"node_modules/**",
|
||||
"coverage/**",
|
||||
"tmp/**",
|
||||
".codex-tmp/**",
|
||||
".codex-logs/**",
|
||||
"screenshots/**",
|
||||
"*.log",
|
||||
"*.tmp",
|
||||
"vite-*.log",
|
||||
],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
files: [
|
||||
"src/**/*.{ts,tsx}",
|
||||
"scripts/**/*.mjs",
|
||||
"vite.config.ts",
|
||||
"eslint.config.js",
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
globals: {
|
||||
AbortController: "readonly",
|
||||
AbortSignal: "readonly",
|
||||
Blob: "readonly",
|
||||
clearInterval: "readonly",
|
||||
clearTimeout: "readonly",
|
||||
console: "readonly",
|
||||
crypto: "readonly",
|
||||
document: "readonly",
|
||||
File: "readonly",
|
||||
fetch: "readonly",
|
||||
FormData: "readonly",
|
||||
Headers: "readonly",
|
||||
HTMLTextAreaElement: "readonly",
|
||||
localStorage: "readonly",
|
||||
navigator: "readonly",
|
||||
process: "readonly",
|
||||
React: "readonly",
|
||||
RequestInit: "readonly",
|
||||
Response: "readonly",
|
||||
setInterval: "readonly",
|
||||
setTimeout: "readonly",
|
||||
URL: "readonly",
|
||||
URLSearchParams: "readonly",
|
||||
window: "readonly",
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
},
|
||||
rules: {
|
||||
"react-hooks/rules-of-hooks": "error",
|
||||
"react-hooks/exhaustive-deps": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
||||
],
|
||||
"@typescript-eslint/no-unused-expressions": "warn",
|
||||
"no-empty": ["error", { allowEmptyCatch: true }],
|
||||
"no-undef": "off",
|
||||
"no-useless-escape": "warn",
|
||||
"prefer-const": "warn",
|
||||
},
|
||||
},
|
||||
);
|
||||
Generated
+1367
-102
File diff suppressed because it is too large
Load Diff
+10
-1
@@ -7,7 +7,11 @@
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview --host 127.0.0.1",
|
||||
"test": "node scripts/run-unit-tests.mjs",
|
||||
"type-check": "tsc -p tsconfig.json --noEmit",
|
||||
"lint": "eslint .",
|
||||
"format:check": "prettier --check .github/workflows/web-quality.yml eslint.config.js scripts/run-unit-tests.mjs src/test src/api/generationConcurrency.test.ts src/utils/enterpriseVideoPolicy.test.ts src/utils/taskLifecycle.test.ts",
|
||||
"verify": "npm run test && npm run type-check && npm run lint && npm run format:check && npm run governance:check && npm run style:check && npm run build",
|
||||
"governance:check": "node scripts/check-governance.mjs",
|
||||
"style:check": "node scripts/check-style-governance.mjs",
|
||||
"smoke:generation:mocked": "node scripts/smoke-generation-mocked.mjs"
|
||||
@@ -20,13 +24,18 @@
|
||||
"zustand": "5.0.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/react": "18.2.0",
|
||||
"@types/react-dom": "18.2.0",
|
||||
"@vitejs/plugin-react": "4.2.1",
|
||||
"eslint": "^10.4.1",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"playwright": "1.60.0",
|
||||
"prettier": "^3.8.3",
|
||||
"sharp": "0.34.5",
|
||||
"typescript": "5.3.3",
|
||||
"vite": "5.1.0",
|
||||
"typescript-eslint": "^8.60.1",
|
||||
"vite": "5.4.21",
|
||||
"vite-plugin-compression2": "2.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import process from "node:process";
|
||||
import { createServer } from "vite";
|
||||
|
||||
const repoRoot = process.cwd();
|
||||
|
||||
function normalizePath(value) {
|
||||
return value.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
function findTestFiles(dir) {
|
||||
const result = [];
|
||||
if (!fs.existsSync(dir)) return result;
|
||||
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
||||
if (entry.name === "node_modules" || entry.name === "dist") continue;
|
||||
const fullPath = path.join(dir, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
result.push(...findTestFiles(fullPath));
|
||||
continue;
|
||||
}
|
||||
if (/\.test\.tsx?$/.test(entry.name)) result.push(fullPath);
|
||||
}
|
||||
return result.sort();
|
||||
}
|
||||
|
||||
const server = await createServer({
|
||||
configFile: path.join(repoRoot, "vite.config.ts"),
|
||||
appType: "custom",
|
||||
logLevel: "silent",
|
||||
server: { middlewareMode: true },
|
||||
});
|
||||
|
||||
try {
|
||||
const harness = await server.ssrLoadModule("/src/test/testHarness");
|
||||
const testFiles = findTestFiles(path.join(repoRoot, "src"));
|
||||
|
||||
if (testFiles.length === 0) {
|
||||
console.error("No test files found.");
|
||||
process.exitCode = 1;
|
||||
} else {
|
||||
console.log(`Running ${testFiles.length} test files`);
|
||||
|
||||
for (const file of testFiles) {
|
||||
const modulePath = `/${normalizePath(path.relative(repoRoot, file))}`;
|
||||
await server.ssrLoadModule(modulePath);
|
||||
}
|
||||
|
||||
const result = await harness.runRegisteredTests();
|
||||
console.log(`Unit test result: ${result.passed}/${result.total} passed`);
|
||||
if (result.failed > 0) process.exitCode = 1;
|
||||
}
|
||||
} finally {
|
||||
await server.close();
|
||||
}
|
||||
@@ -3,6 +3,19 @@ import { buildApiUrl, buildAuthHeaders } from "./serverConnection";
|
||||
const TEXT_MODELS = ["qwen-max", "qwen-plus", "qwen-turbo"];
|
||||
const VISION_MODELS = ["qwen3.7-plus", "qwen-vl-plus", "qwen-vl-max"];
|
||||
|
||||
function combineAbortSignals(signal: AbortSignal | undefined, timeoutSignal: AbortSignal): AbortSignal {
|
||||
if (!signal) return timeoutSignal;
|
||||
const controller = new AbortController();
|
||||
const abort = () => controller.abort();
|
||||
if (signal.aborted || timeoutSignal.aborted) {
|
||||
abort();
|
||||
return controller.signal;
|
||||
}
|
||||
signal.addEventListener("abort", abort, { once: true });
|
||||
timeoutSignal.addEventListener("abort", abort, { once: true });
|
||||
return controller.signal;
|
||||
}
|
||||
|
||||
export interface AdVideoUserConfig {
|
||||
platform: string;
|
||||
aspectRatio: string;
|
||||
@@ -162,9 +175,7 @@ async function chat(
|
||||
{ role: "user", content: userContent },
|
||||
];
|
||||
const timeoutSignal = AbortSignal.timeout(CHAT_TIMEOUT_MS);
|
||||
const combinedSignal = options?.signal
|
||||
? AbortSignal.any([options.signal, timeoutSignal])
|
||||
: timeoutSignal;
|
||||
const combinedSignal = combineAbortSignals(options?.signal, timeoutSignal);
|
||||
const res = await fetch(buildApiUrl("ai/chat"), {
|
||||
method: "POST",
|
||||
headers: buildAuthHeaders(),
|
||||
@@ -210,9 +221,7 @@ async function visionChat(
|
||||
let lastError: Error | null = null;
|
||||
for (const model of VISION_MODELS) {
|
||||
const timeoutSignal = AbortSignal.timeout(CHAT_TIMEOUT_MS);
|
||||
const combinedSignal = signal
|
||||
? AbortSignal.any([signal, timeoutSignal])
|
||||
: timeoutSignal;
|
||||
const combinedSignal = combineAbortSignals(signal, timeoutSignal);
|
||||
try {
|
||||
const out = await retryOnTransient(async () => {
|
||||
const res = await fetch(buildApiUrl("ai/chat"), {
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
isRecord,
|
||||
readJsonResponse,
|
||||
serverRequest,
|
||||
isServerRequestError,
|
||||
throwResponseError,
|
||||
} from "./serverConnection";
|
||||
import { isOptionalApiRouteMissing } from "./apiErrorUtils";
|
||||
@@ -247,6 +248,46 @@ let taskHistoryRouteMissing = false;
|
||||
const TASK_SUBMIT_TIMEOUT_MS = 90_000;
|
||||
const TASK_STATUS_TIMEOUT_MS = 20_000;
|
||||
const NON_RETRYING_REQUEST = { maxRetries: 0 };
|
||||
const PENDING_CANCEL_TASKS_KEY = "omniai:pending-task-cancellations";
|
||||
|
||||
function readPendingCancelTaskIds(): string[] {
|
||||
if (typeof window === "undefined") return [];
|
||||
try {
|
||||
const raw = window.localStorage.getItem(PENDING_CANCEL_TASKS_KEY);
|
||||
const parsed = raw ? JSON.parse(raw) : [];
|
||||
return Array.isArray(parsed) ? parsed.filter((id): id is string => typeof id === "string" && id.trim().length > 0) : [];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
function writePendingCancelTaskIds(taskIds: string[]): void {
|
||||
if (typeof window === "undefined") return;
|
||||
try {
|
||||
const uniqueIds = Array.from(new Set(taskIds.filter(Boolean)));
|
||||
if (uniqueIds.length) {
|
||||
window.localStorage.setItem(PENDING_CANCEL_TASKS_KEY, JSON.stringify(uniqueIds));
|
||||
} else {
|
||||
window.localStorage.removeItem(PENDING_CANCEL_TASKS_KEY);
|
||||
}
|
||||
} catch {
|
||||
// Pending cancellation recovery is best-effort.
|
||||
}
|
||||
}
|
||||
|
||||
function markTaskCancelPending(taskId: string): void {
|
||||
writePendingCancelTaskIds([...readPendingCancelTaskIds(), taskId]);
|
||||
}
|
||||
|
||||
function clearPendingTaskCancel(taskId: string): void {
|
||||
writePendingCancelTaskIds(readPendingCancelTaskIds().filter((id) => id !== taskId));
|
||||
}
|
||||
|
||||
function shouldRetryTaskCancel(error: unknown): boolean {
|
||||
if (!isServerRequestError(error)) return true;
|
||||
const status = error.status;
|
||||
return status === 429 || status === undefined || status >= 500;
|
||||
}
|
||||
|
||||
export const aiGenerationClient = {
|
||||
async createImageTask(input: ImageGenInput): Promise<ImageTaskCreateResponse> {
|
||||
@@ -335,18 +376,48 @@ export const aiGenerationClient = {
|
||||
},
|
||||
|
||||
async cancelTask(taskId: string): Promise<void> {
|
||||
markTaskCancelPending(taskId);
|
||||
try {
|
||||
await serverRequest<void>(`ai/tasks/${taskId}/cancel`, {
|
||||
method: "PATCH",
|
||||
maxRetries: NON_RETRYING_REQUEST.maxRetries,
|
||||
fallbackMessage: "Task cancel failed",
|
||||
});
|
||||
clearPendingTaskCancel(taskId);
|
||||
} catch (error) {
|
||||
if (isOptionalApiRouteMissing(error)) return;
|
||||
if (isOptionalApiRouteMissing(error) || !shouldRetryTaskCancel(error)) {
|
||||
clearPendingTaskCancel(taskId);
|
||||
return;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
cancelTaskOnUnload(taskId: string): void {
|
||||
markTaskCancelPending(taskId);
|
||||
const url = buildApiUrl(`ai/tasks/${encodeURIComponent(taskId)}/cancel`);
|
||||
const headers = buildAuthHeaders();
|
||||
const body = JSON.stringify({ reason: "page_unload" });
|
||||
|
||||
try {
|
||||
void fetch(url, {
|
||||
method: "PATCH",
|
||||
headers,
|
||||
body,
|
||||
credentials: "include",
|
||||
keepalive: true,
|
||||
});
|
||||
} catch {
|
||||
// Page unload cancellation is best-effort.
|
||||
}
|
||||
},
|
||||
|
||||
flushPendingTaskCancellations(): void {
|
||||
readPendingCancelTaskIds().forEach((taskId) => {
|
||||
this.cancelTask(taskId).catch(() => {});
|
||||
});
|
||||
},
|
||||
|
||||
async getTaskStatus(taskId: string): Promise<AiTaskStatus> {
|
||||
return serverRequest<AiTaskStatus>(`ai/tasks/${taskId}`, {
|
||||
timeoutMs: TASK_STATUS_TIMEOUT_MS,
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
import { afterEach, describe, expect, it } from "../test/testHarness";
|
||||
|
||||
import {
|
||||
__resetGenerationConcurrencyForTests,
|
||||
claimGenerationSlot,
|
||||
getActiveGenerationTaskCount,
|
||||
getEffectiveGenerationLimit,
|
||||
getGenerationUserKey,
|
||||
releaseGenerationSlot,
|
||||
setUserMaxConcurrency,
|
||||
} from "./generationConcurrency";
|
||||
|
||||
describe("generationConcurrency", () => {
|
||||
afterEach(() => {
|
||||
__resetGenerationConcurrencyForTests();
|
||||
});
|
||||
|
||||
it("uses the default generation limit until the server provides a user-specific limit", () => {
|
||||
expect(getEffectiveGenerationLimit()).toBe(3);
|
||||
|
||||
setUserMaxConcurrency(5);
|
||||
expect(getEffectiveGenerationLimit()).toBe(5);
|
||||
|
||||
setUserMaxConcurrency(0);
|
||||
expect(getEffectiveGenerationLimit()).toBe(3);
|
||||
});
|
||||
|
||||
it("claims and releases local generation slots so the submit button can recover", () => {
|
||||
const userKey = getGenerationUserKey("user-1");
|
||||
|
||||
const releaseFirst = claimGenerationSlot({
|
||||
userKey,
|
||||
kind: "image",
|
||||
id: "slot-1",
|
||||
});
|
||||
claimGenerationSlot({ userKey, kind: "video", id: "slot-2" });
|
||||
|
||||
expect(getActiveGenerationTaskCount(userKey)).toBe(2);
|
||||
|
||||
releaseFirst();
|
||||
expect(getActiveGenerationTaskCount(userKey)).toBe(1);
|
||||
|
||||
releaseGenerationSlot("slot-2");
|
||||
expect(getActiveGenerationTaskCount(userKey)).toBe(0);
|
||||
});
|
||||
|
||||
it("enforces per-user limits without blocking other users", () => {
|
||||
setUserMaxConcurrency(1);
|
||||
|
||||
claimGenerationSlot({ userKey: "alice", kind: "image", id: "alice-slot" });
|
||||
|
||||
expect(() =>
|
||||
claimGenerationSlot({
|
||||
userKey: "alice",
|
||||
kind: "video",
|
||||
id: "alice-slot-2",
|
||||
}),
|
||||
).toThrow("最多生成 1 个图片/视频任务");
|
||||
expect(() =>
|
||||
claimGenerationSlot({ userKey: "bob", kind: "video", id: "bob-slot" }),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -21,6 +21,10 @@ function getEffectiveLimit(): number {
|
||||
return userMaxConcurrency ?? DEFAULT_MAX_ACTIVE_GENERATION_TASKS;
|
||||
}
|
||||
|
||||
export function getEffectiveGenerationLimit(): number {
|
||||
return getEffectiveLimit();
|
||||
}
|
||||
|
||||
export function getGenerationUserKey(userId?: string | number | null): string {
|
||||
return userId === undefined || userId === null || userId === "" ? "anonymous" : String(userId);
|
||||
}
|
||||
@@ -71,3 +75,8 @@ export function releaseGenerationSlot(id: string | undefined | null): void {
|
||||
if (!id) return;
|
||||
activeSlots.delete(id);
|
||||
}
|
||||
|
||||
export function __resetGenerationConcurrencyForTests(): void {
|
||||
activeSlots.clear();
|
||||
userMaxConcurrency = null;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
SearchOutlined,
|
||||
UserOutlined,
|
||||
} from "@ant-design/icons";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState, type ChangeEvent, type DragEvent, type JSX } from "react";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState, type ChangeEvent, type DragEvent, type ReactElement } from "react";
|
||||
import "../../styles/pages/assets.css";
|
||||
import { assetClient, type ServerAssetItem } from "../../api/assetClient";
|
||||
import { aiGenerationClient } from "../../api/aiGenerationClient";
|
||||
@@ -36,7 +36,7 @@ interface AssetsPageProps {
|
||||
onOpenLogin: () => void;
|
||||
}
|
||||
|
||||
const typeTabs: Array<{ key: AssetTypeFilter; label: string; icon: JSX.Element | null }> = [
|
||||
const typeTabs: Array<{ key: AssetTypeFilter; label: string; icon: ReactElement | null }> = [
|
||||
{ key: "all", label: "全部", icon: null },
|
||||
{ key: "character", label: "人物", icon: <UserOutlined /> },
|
||||
{ key: "scene", label: "场景", icon: <FileImageOutlined /> },
|
||||
|
||||
@@ -396,7 +396,6 @@ function CanvasPage({
|
||||
const canvasUploadInputRef = useRef<HTMLInputElement>(null);
|
||||
const imageNodeInputRef = useRef<HTMLInputElement>(null);
|
||||
const canvasRef = useRef<HTMLElement>(null);
|
||||
const videoGenerationInFlightRef = useRef(new Set<string>());
|
||||
const canvasReferenceUploadPromisesRef = useRef(new Map<string, Promise<string | null>>());
|
||||
const canvasDragCounterRef = useRef(0);
|
||||
const [isCanvasDragging, setIsCanvasDragging] = useState(false);
|
||||
@@ -417,7 +416,7 @@ function CanvasPage({
|
||||
const {
|
||||
textGenerationState, imageGenerationState, videoGenerationState,
|
||||
generationToast, setGenerationToast,
|
||||
imageGenerationInFlightRef, textGenerationInFlightRef, textGenerationAbortControllersRef,
|
||||
imageGenerationInFlightRef, videoGenerationInFlightRef, textGenerationInFlightRef, textGenerationAbortControllersRef,
|
||||
canvasGenKeepaliveRestoredRef,
|
||||
setTextGenerationStatus, setImageGenerationStatus, setVideoGenerationStatus,
|
||||
restoreKeepaliveTasks, resetGenerationState,
|
||||
@@ -1887,13 +1886,14 @@ function CanvasPage({
|
||||
setVideoGenerationStatus(nodeId, { status: "submitting", message: "正在提交视频生成", progress: 8 });
|
||||
setGenerationToast("视频正在生成");
|
||||
|
||||
let task: Awaited<ReturnType<typeof onCreateTask>> | null = null;
|
||||
try {
|
||||
const referenceUrls = await resolveConnectedImageReferenceUrls("video", nodeId);
|
||||
if (videoNode.videoMode === "img2video" && referenceUrls.length === 0) {
|
||||
throw new Error("图生视频需要先连接至少一个可用的图片节点");
|
||||
}
|
||||
let requestModel = resolveVideoRequestModel({ model, referenceUrls });
|
||||
const task = await onCreateTask({
|
||||
task = await onCreateTask({
|
||||
title: videoNode.title || "视频节点生成",
|
||||
type: "video",
|
||||
prompt: prompt || "根据参考图片生成视频",
|
||||
@@ -1916,10 +1916,12 @@ function CanvasPage({
|
||||
if (task.status === "completed" && !task.outputUrl) {
|
||||
throw new Error("视频生成任务已完成,但服务器没有返回结果地址,请稍后重试");
|
||||
}
|
||||
const taskId = task.id;
|
||||
addCanvasGenKeepalive(taskId, nodeId, "video", projectId || "");
|
||||
setVideoGenerationStatus(nodeId, { status: "running", message: "视频生成中", progress: Math.max(18, Number(task.progress || 0)) });
|
||||
const outputUrl =
|
||||
task.outputUrl ||
|
||||
(await waitForImageTaskResult(task.id, (status) => {
|
||||
(await waitForVideoTaskResult(taskId, (status) => {
|
||||
const progress = Math.max(18, Math.min(status.status === "completed" ? 100 : 96, Math.trunc(status.progress || 0)));
|
||||
const statusLabel =
|
||||
status.status === "pending"
|
||||
@@ -1932,11 +1934,12 @@ function CanvasPage({
|
||||
setVideoGenerationStatus(nodeId, { status: "running", message: statusLabel, progress });
|
||||
}));
|
||||
setVideoGenerationStatus(nodeId, { status: "success", message: "视频生成完成", progress: 100 });
|
||||
removeCanvasGenKeepalive(taskId);
|
||||
const immediateAssetRef = createCanvasAssetRefFromGeneratedResult({
|
||||
url: outputUrl,
|
||||
mediaType: "video/mp4",
|
||||
resultType: "video",
|
||||
taskId: task.id,
|
||||
taskId,
|
||||
originalUrl: outputUrl,
|
||||
});
|
||||
setVideoNodes((currentNodes) =>
|
||||
@@ -1947,7 +1950,7 @@ function CanvasPage({
|
||||
videoUrl: outputUrl,
|
||||
assetRef: immediateAssetRef,
|
||||
taskRef: {
|
||||
taskId: task.id,
|
||||
taskId,
|
||||
status: "completed",
|
||||
resultUrl: outputUrl,
|
||||
updatedAt: new Date().toISOString(),
|
||||
@@ -1961,7 +1964,7 @@ function CanvasPage({
|
||||
url: outputUrl,
|
||||
mediaType: "video/mp4",
|
||||
resultType: "video",
|
||||
taskId: task.id,
|
||||
taskId,
|
||||
originalUrl: outputUrl,
|
||||
});
|
||||
await delay(420);
|
||||
@@ -1974,7 +1977,7 @@ function CanvasPage({
|
||||
videoUrl: assetRef.url,
|
||||
assetRef,
|
||||
taskRef: {
|
||||
taskId: task.id,
|
||||
taskId,
|
||||
status: "completed",
|
||||
resultUrl: assetRef.url,
|
||||
updatedAt: new Date().toISOString(),
|
||||
@@ -1991,6 +1994,7 @@ function CanvasPage({
|
||||
});
|
||||
} finally {
|
||||
videoGenerationInFlightRef.current.delete(nodeId);
|
||||
if (task?.id) removeCanvasGenKeepalive(task.id);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import type {
|
||||
CanvasVideoGenerationState,
|
||||
CanvasVideoNode,
|
||||
} from "./canvasTypes";
|
||||
import { aiGenerationClient } from "../../api/aiGenerationClient";
|
||||
import { createCanvasAssetRefFromGeneratedResult, persistCanvasGeneratedResultAsset } from "./canvasAssetPersistence";
|
||||
import { waitForImageTaskResult, waitForVideoTaskResult } from "./canvasUtils";
|
||||
|
||||
@@ -41,6 +42,13 @@ export function removeCanvasGenKeepalive(taskId: string): void {
|
||||
saveCanvasGenKeepalive(loadCanvasGenKeepalive().filter((e) => e.taskId !== taskId));
|
||||
}
|
||||
|
||||
export function cancelCanvasGenKeepaliveOnUnload(): void {
|
||||
const entries = loadCanvasGenKeepalive();
|
||||
if (!entries.length) return;
|
||||
entries.forEach((entry) => aiGenerationClient.cancelTaskOnUnload(entry.taskId));
|
||||
saveCanvasGenKeepalive([]);
|
||||
}
|
||||
|
||||
export interface UseCanvasGenerationParams {
|
||||
setImageNodes: Dispatch<SetStateAction<CanvasImageNode[]>>;
|
||||
setVideoNodes: Dispatch<SetStateAction<CanvasVideoNode[]>>;
|
||||
@@ -55,6 +63,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) {
|
||||
const [generationToast, setGenerationToast] = useState<string | null>(null);
|
||||
|
||||
const imageGenerationInFlightRef = useRef(new Set<string>());
|
||||
const videoGenerationInFlightRef = useRef(new Set<string>());
|
||||
const textGenerationInFlightRef = useRef(new Set<string>());
|
||||
const textGenerationAbortControllersRef = useRef(new Map<string, AbortController>());
|
||||
const canvasGenKeepaliveRestoredRef = useRef(false);
|
||||
@@ -125,7 +134,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) {
|
||||
imageGenerationInFlightRef.current.delete(entry.nodeId);
|
||||
});
|
||||
} else if (entry.nodeKind === "video") {
|
||||
imageGenerationInFlightRef.current.add(entry.nodeId);
|
||||
videoGenerationInFlightRef.current.add(entry.nodeId);
|
||||
setVideoGenerationStatus(entry.nodeId, { status: "running", message: "正在恢复视频生成", progress: 20 });
|
||||
void waitForVideoTaskResult(entry.taskId, (status) => {
|
||||
const progress = Math.max(18, Math.min(status.status === "completed" ? 100 : 96, Math.trunc(status.progress || 0)));
|
||||
@@ -154,7 +163,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) {
|
||||
removeCanvasGenKeepalive(entry.taskId);
|
||||
setVideoGenerationStatus(entry.nodeId, { status: "error", message: "视频生成失败" });
|
||||
}).finally(() => {
|
||||
imageGenerationInFlightRef.current.delete(entry.nodeId);
|
||||
videoGenerationInFlightRef.current.delete(entry.nodeId);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -165,11 +174,36 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) {
|
||||
textGenerationAbortControllersRef.current.clear();
|
||||
textGenerationInFlightRef.current.clear();
|
||||
imageGenerationInFlightRef.current.clear();
|
||||
videoGenerationInFlightRef.current.clear();
|
||||
setTextGenerationState({});
|
||||
setImageGenerationState({});
|
||||
setVideoGenerationState({});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const handlePageHide = () => {
|
||||
cancelCanvasGenKeepaliveOnUnload();
|
||||
textGenerationAbortControllersRef.current.forEach((controller) => controller.abort());
|
||||
textGenerationAbortControllersRef.current.clear();
|
||||
textGenerationInFlightRef.current.clear();
|
||||
imageGenerationInFlightRef.current.clear();
|
||||
videoGenerationInFlightRef.current.clear();
|
||||
setTextGenerationState({});
|
||||
setImageGenerationState({});
|
||||
setVideoGenerationState({});
|
||||
};
|
||||
const handleOnline = () => {
|
||||
aiGenerationClient.flushPendingTaskCancellations();
|
||||
};
|
||||
window.addEventListener("pagehide", handlePageHide);
|
||||
window.addEventListener("online", handleOnline);
|
||||
aiGenerationClient.flushPendingTaskCancellations();
|
||||
return () => {
|
||||
window.removeEventListener("pagehide", handlePageHide);
|
||||
window.removeEventListener("online", handleOnline);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return {
|
||||
textGenerationState,
|
||||
imageGenerationState,
|
||||
@@ -177,6 +211,7 @@ export function useCanvasGeneration(params: UseCanvasGenerationParams) {
|
||||
generationToast,
|
||||
setGenerationToast,
|
||||
imageGenerationInFlightRef,
|
||||
videoGenerationInFlightRef,
|
||||
textGenerationInFlightRef,
|
||||
textGenerationAbortControllersRef,
|
||||
canvasGenKeepaliveRestoredRef,
|
||||
|
||||
@@ -7,61 +7,213 @@ interface CompliancePageProps {
|
||||
kind: ComplianceKind;
|
||||
}
|
||||
|
||||
const companyName = "OmniAI";
|
||||
const companyName = "南京万物可爱文化传媒有限公司";
|
||||
const platformName = "Omniai平台";
|
||||
const contactEmail = "system@omniai.net.cn";
|
||||
const contactPhone = "15155073618";
|
||||
const address = "江苏省南京市江北新区扬子江数字视听产业园9栋A楼501";
|
||||
const address = "江苏省南京市江北新区扬子江数字视听产业园9栋A楼9A-501";
|
||||
const icpRecord = "苏ICP备2026021747号-1";
|
||||
const effectiveDate = "2026年06月8日";
|
||||
|
||||
const agreementSections = [
|
||||
{
|
||||
title: "服务范围",
|
||||
body: "平台提供 AI 图片、视频、脚本、数字人及相关创作辅助服务。具体功能、模型能力、消耗规则以页面展示和平台公告为准。",
|
||||
},
|
||||
{
|
||||
title: "账号与使用",
|
||||
body: "用户应保证注册信息真实有效,妥善保管账号与登录凭证,不得出租、转让账号或以自动化方式恶意占用平台资源。",
|
||||
},
|
||||
{
|
||||
title: "内容合规",
|
||||
body: "用户不得上传、生成、发布违法违规、侵权、涉政敏感、暴恐、色情、赌博、诈骗或侵犯他人合法权益的内容。平台有权对违规内容采取删除、限制功能、封禁账号等措施。",
|
||||
},
|
||||
{
|
||||
title: "积分与付费",
|
||||
body: "积分仅限平台内消费,不支持提现、转让或折现。充值、套餐、赠送积分的有效期、消耗顺序和退费规则以充值页面展示为准。",
|
||||
},
|
||||
{
|
||||
title: "责任限制",
|
||||
body: "AI 生成结果可能存在偏差,用户应自行审核输出内容并承担使用后果。因不可抗力、第三方服务异常、网络故障造成的服务中断,平台将在合理范围内修复。",
|
||||
},
|
||||
];
|
||||
const privacyPolicyText = `
|
||||
隐私政策
|
||||
更新日期:2026年06月8日
|
||||
生效日期:2026年06月8日
|
||||
欢迎您使用本平台服务!
|
||||
南京万物可爱文化传媒有限公司(以下简称“我们”或“平台”)是Omniai平台的运营者。我们非常重视用户的隐私和个人信息保护。您在使用我们的产品与/或服务时,我们可能会收集和使用您的相关信息。我们希望通过本《隐私政策》(以下简称“本政策”)向您说明,在您使用我们的产品与/或服务时,我们如何收集、使用、保存、共享和转让您的个人信息,以及您所享有的个人信息权利。
|
||||
本政策与您所使用的我们的产品与/或服务息息相关,请您务必仔细阅读并确认您已经充分理解本政策的内容。一旦您开始使用我们的产品与/或服务,即表示您已充分理解并同意本政策。
|
||||
本政策将帮助您了解以下内容:
|
||||
一、本政策的适用范围
|
||||
二、我们如何收集和使用您的个人信息
|
||||
三、我们如何使用Cookie和同类技术
|
||||
四、我们如何共享、转让、公开披露您的个人信息
|
||||
五、我们如何保护和存储您的个人信息
|
||||
六、您如何管理您的个人信息
|
||||
七、我们如何保护未成年人的个人信息
|
||||
八、本政策如何更新
|
||||
九、其他声明与责任限制
|
||||
十、如何联系我们
|
||||
一、本政策的适用范围
|
||||
1. 本政策适用于您通过我们的网站、客户端应用程序、小程序以及其他技术形态(包括但不限于SDK、API等方式)访问和使用我们的产品与/或服务。
|
||||
2. 本政策不适用于以下情况:
|
||||
(1)我们的产品与/或服务中包含的或链接至第三方提供的信息与/或服务(包括任何第三方应用、网站、产品、服务等)。这些服务由第三方负责运营,您使用该服务适用第三方另行向您说明的个人信息处理规则。
|
||||
(2)其他非我们向您提供的产品与/或服务。
|
||||
(3)特别提示:用户间交易。您通过平台社区与其他用户进行作品、素材、版权等交易时,您主动向交易对方提供的个人信息(如联系方式、交付地址等)不适用本政策。我们建议您在交易过程中谨慎保护您的个人信息,并充分了解交易对方的信用状况。
|
||||
二、我们如何收集和使用您的个人信息
|
||||
我们会遵循合法、正当、必要、诚信的原则,基于本政策所述的目的,收集和使用您的个人信息。如果我们将您的个人信息用于本政策未载明的其他用途,我们将以合理方式另行向您告知并征得您的同意。
|
||||
(一)注册、登录与认证
|
||||
1. 必要信息:当您注册平台账号时,您需要提供您的手机号码及验证码/登录密码。手机号码是履行国家法律法规对网络实名制(真实身份信息认证)要求所需的必要信息,若您不提供,您将无法完成注册,仅能使用浏览、搜索等基本功能。
|
||||
2. 企业用户:如您以企业身份注册,您还需提供企业名称、营业执照、法定代表人/联系人信息等,以便我们核验您的企业身份,为您提供企业级服务。
|
||||
3. 第三方账号登录:您可以使用我们认可的第三方账号(如微信、QQ等)进行登录。我们会收集您在该第三方账号下的唯一标识、昵称、头像等信息,用于创建您在本平台的账号。
|
||||
4. 账号信息完善:您可以选择填写或修改您的昵称、头像、个人简介、所在地区等信息。此类信息非必要,但有助于提升您的社区交互体验。
|
||||
(二)浏览、搜索与内容发布
|
||||
1. 内容浏览:当您浏览平台上的模型、素材、作品、文章等内容时,我们会收集您的设备信息、日志信息,包括IP地址、浏览器类型、操作系统版本、访问时间、点击记录、浏览记录、下载记录等。此类信息用于为您提供内容展示、优化推荐算法以及保障服务安全稳定运行。
|
||||
2. 搜索功能:当您使用搜索服务时,我们会收集您的搜索关键字信息,用于向您展示搜索结果。
|
||||
3. 内容发布与社区交互:当您在平台社区上传模型、发布作品、发表评论、点赞、收藏、分享时,我们会收集您主动发布的内容(包括但不限于文字、图片、视频、模型文件等)。您发布的内容中会展示您的昵称、头像等信息。
|
||||
(三)SaaS软件服务
|
||||
1. 使用SaaS工具:当您使用我们提供的SaaS软件工具(如图片编辑、模型训练、设计工具等)时,您主动上传、输入或导入的内容及指令将被收集,以便为您提供服务。
|
||||
2. 生成内容:您通过SaaS工具生成的内容,其所有权归您所有。我们会保存该生成内容的记录,以便您进行查看、下载、管理或再次编辑。
|
||||
3. 模型优化:在经过安全加密技术处理、严格去标识化且无法重新识别特定个人的前提下,我们可能会将您使用SaaS软件过程中产生的脱敏数据用于模型优化和改进服务。您可以通过平台设置选择是否允许我们将您的内容用于此目的。
|
||||
(四)付费订阅与交易服务
|
||||
1. 会员订阅:当您购买会员服务(软件订阅费)或充值积分时,我们会收集您的订单信息(包括商品/服务名称、金额、交易时间)和支付信息。支付信息(如银行卡号、第三方支付账号)由第三方支付机构直接收集,我们不会获取您完整的支付敏感信息。
|
||||
2. 积分消耗:当您使用积分消耗大模型算力或兑换服务时,我们会记录您的积分变动情况。
|
||||
3. 用户间交易:
|
||||
(1)当您作为卖方(发布作品/素材进行售卖)时,我们需要收集您的实名认证信息(个人或企业)、收款账户信息(银行卡号或第三方支付账号),以便向您结算交易款项。
|
||||
(2)当您作为买方(购买作品/素材)时,我们需要收集您的订单信息,并可能向卖方提供您的平台账号信息,以便卖方完成交付。您的真实联系方式(如手机号、地址)不会直接提供给卖方,除非您主动通过平台沟通工具披露。
|
||||
(五)运营与安全保障
|
||||
为了维护相关产品或服务的正常稳定运行,保护您或其他用户或公众的安全及合法利益,我们会收集如下必要信息:
|
||||
1. 设备信息:包括设备型号、操作系统版本、唯一设备标识符、IP地址、MAC地址、WLAN接入点、蓝牙、基站、软件版本号、网络接入方式/类型/状态等。
|
||||
2. 日志信息:包括您的操作日志、服务日志,例如您对平台功能的点击、使用情况、崩溃数据、异常信息等。
|
||||
3. 应用信息:用于预防恶意程序、保障运营质量,我们会收集安装的应用列表、软件列表或正在运行的进程信息。
|
||||
4. IP归属地:根据相关法律法规要求,我们可能会在您的个人主页、作品发布等页面展示您的IP地址归属地信息。
|
||||
(六)系统权限
|
||||
为实现特定功能,我们可能会向您申请相机/摄像头、相册/存储、麦克风、通知、剪贴板等系统权限。您可以在设备设置中自主选择开启或关闭这些权限。关闭权限将可能导致对应功能无法使用,但不影响其他功能。
|
||||
(七)征得授权同意的例外
|
||||
根据相关法律法规,以下情形中收集您的个人信息无需征得您的授权同意:为订立、履行您作为一方当事人的合同所必需;为履行法定职责或者法定义务所必需;为应对突发公共卫生事件,或者紧急情况下为保护自然人的生命健康和财产安全所必需;为公共利益实施新闻报道、舆论监督等行为,在合理的范围内处理个人信息;依照法律规定在合理的范围内处理您自行公开或者其他已经合法公开的个人信息;法律、行政法规规定的其他情形。
|
||||
三、我们如何使用Cookie和同类技术
|
||||
1. Cookie:为使您获得更轻松的访问体验,我们可能会使用Cookie技术收集和存储您的登录状态、浏览偏好、使用习惯等信息。您可以根据自己的偏好管理或删除Cookie,但请注意,禁用Cookie可能会导致您无法正常使用平台的某些功能。
|
||||
2. 同类技术:我们可能会使用网站信标、像素标签等其他同类技术,用于分析您对我们服务的使用情况、评估广告效果等。
|
||||
四、我们如何共享、转让、公开披露您的个人信息
|
||||
(一)共享
|
||||
我们不会与任何公司、组织和个人共享您的个人信息,但获得您的明确同意、履行法定义务、与授权合作伙伴共享、用户间交易、关联公司共享等情况除外。授权合作伙伴包括支付服务提供商、实名认证服务商、云服务提供商、推送服务提供商、安全与风控服务商等,我们仅共享实现目的所必要的信息。
|
||||
(二)转让
|
||||
我们不会将您的个人信息转让给任何公司、组织和个人,但获得您的明确同意后,或在涉及合并、收购、破产清算等情形时除外。如涉及个人信息转让,我们会要求新的持有您个人信息的公司、组织继续受本政策约束,否则将要求其重新向您征求授权同意。
|
||||
(三)公开披露
|
||||
我们不会公开披露您的个人信息,但获得您的明确同意后、基于法律司法或行政程序要求、对违规账号或侵权行为进行必要公示等情况除外。
|
||||
(四)共享、转让、公开披露的例外
|
||||
在为订立或履行合同所必需、履行法定义务所必需、应对紧急情况、公共利益新闻报道或舆论监督、处理您自行公开或其他已合法公开信息、法律行政法规规定的其他情形中,共享、转让、公开披露您的个人信息无需事先征得您的授权同意。
|
||||
五、我们如何保护和存储您的个人信息
|
||||
1. 存储地点:我们在中华人民共和国境内运营中收集和产生的个人信息,将存储在中华人民共和国境内。我们不会将您的个人信息传输至境外。
|
||||
2. 存储期限:我们仅在为实现本政策所述目的所必需的最短期限内保留您的个人信息,除非法律法规有更强的存留要求。超出存储期限后,我们将对您的个人信息进行删除或匿名化处理。
|
||||
3. 保护措施:我们采用SSL加密、数据脱敏、访问控制、入侵检测等符合行业标准的安全技术措施,保护您的个人信息免遭泄露、篡改、毁损或未经授权的访问。我们建立数据安全管理制度,与员工签署保密协议,定期开展安全审计。一旦发生个人信息安全事件,我们将依法及时告知您,并向监管部门报告。
|
||||
六、您如何管理您的个人信息
|
||||
您可以通过平台账号功能或联系我们,访问、更正、补充、删除您的个人信息,撤回同意或申请注销账号。账号注销后,我们将删除或匿名化处理您的个人信息(法律法规另有规定的除外),您将无法再使用该账号登录平台。对于合理的请求,我们原则上不收取费用;对于无端重复、超出合理限度的请求,我们可能会拒绝或收取合理成本费用。
|
||||
七、我们如何保护未成年人的个人信息
|
||||
1. 平台主要面向成年人。如您为18周岁以下的未成年人,应在您的父母或其他监护人监护、指导下共同阅读并同意本政策。
|
||||
2. 如您为14周岁以下的儿童,请务必在监护人明确同意的前提下使用我们的服务。我们将只会在法律法规允许、监护人明确同意或保护儿童所必要的情况下收集、使用儿童的个人信息。
|
||||
3. 如我们发现未经监护人同意收集了儿童个人信息,我们将尽快删除相关数据。
|
||||
八、本政策如何更新
|
||||
我们可能会根据法律法规变化、产品功能调整或业务发展需要适时修订本政策。本政策更新后,我们会在平台显著位置发布更新版本,并在生效前通过公告、站内信、弹窗等方式通知您。如您继续使用我们的服务,即表示您同意受修订后的本政策约束。
|
||||
九、其他声明与责任限制
|
||||
为提供更好的服务,我们的产品中可能包含第三方SDK。第三方SDK可能会收集您的设备信息、网络信息等,具体请查阅我们在平台公示的《第三方信息共享清单》。本政策适用中华人民共和国大陆地区法律。因本政策引起的任何争议,双方应友好协商解决;协商不成的,任何一方均有权将争议提交至本平台运营主体所在地有管辖权的人民法院诉讼解决。
|
||||
十、如何联系我们
|
||||
如您对本政策有任何疑问、意见或建议,或需要进行投诉、举报,您可以通过以下方式与我们联系:
|
||||
客服邮箱:system@omniai.net.cn
|
||||
客服电话:15155073618
|
||||
邮寄地址:江苏省南京市江北新区扬子江数字视听产业园9栋A楼9A-501
|
||||
我们将在15个工作日内回复您的请求。
|
||||
`.trim();
|
||||
|
||||
const privacySections = [
|
||||
{
|
||||
title: "收集的信息",
|
||||
body: "我们会收集账号信息、登录状态、联系方式、创作输入、生成结果、用量记录、设备与网络日志,用于提供服务、安全审计和问题排查。",
|
||||
},
|
||||
{
|
||||
title: "Cookie 与本地存储",
|
||||
body: "我们使用 Cookie、localStorage 和 sessionStorage 保存登录状态、偏好设置、Cookie 同意状态、创作草稿和断点续传数据。",
|
||||
},
|
||||
{
|
||||
title: "信息使用",
|
||||
body: "信息用于身份验证、生成任务处理、资产管理、积分计费、客服支持、风控合规、服务优化和法律法规要求的备案审计。",
|
||||
},
|
||||
{
|
||||
title: "第三方处理",
|
||||
body: "为完成 AI 生成、对象存储、短信邮件、支付或错误监控,我们可能向必要的第三方服务提供最小范围数据,并要求其按约定保护数据安全。",
|
||||
},
|
||||
{
|
||||
title: "用户权利",
|
||||
body: "你可以通过平台账号功能或联系方式申请访问、更正、删除个人信息,或撤回非必要授权。法律法规另有要求的记录可能需按规定保留。",
|
||||
},
|
||||
];
|
||||
const agreementText = `
|
||||
Omniai平台用户协议
|
||||
更新日期:2026年06月8日
|
||||
生效日期:2026年06月8日
|
||||
欢迎您使用本平台服务。
|
||||
本平台向您提供SaaS软件服务、社区交流、素材及作品交易等相关服务。欢迎您与南京万物可爱文化传媒有限公司(以下简称“我们”或“平台”)共同签署本《用户服务协议》(下称“本协议”),并使用Omniai平台服务!
|
||||
在您注册成为平台用户前,请您务必审慎阅读、充分理解本协议的全部内容,特别是免除或限制责任、法律适用和争议解决条款。如您对本协议内容有任何疑问,可通过平台客服进行咨询。如您未满18周岁,请在法定监护人陪同下仔细阅读并充分理解本协议,并征得监护人的同意后使用本平台服务。
|
||||
当您点击“同意”本协议、完成注册程序,或实际开始使用平台服务时,即表示您已充分阅读、理解并接受本协议的全部内容,并与我们达成一致,本协议即对您产生法律约束力。如您不同意本协议的任何条款,请立即停止注册或使用行为。
|
||||
我们可能不时修改本协议及相关平台规则,并通过网站公告、站内信等方式进行通知。若您在本协议修改后继续使用服务,即视为您已接受修改后的协议。
|
||||
第一章 定义
|
||||
1. 本平台:指由南京万物可爱文化传媒有限公司拥有并运营的,向用户提供SaaS软件工具、社区互动、内容上传、展示、分享、付费下载及交易等功能的网站、客户端应用程序及其他技术服务平台。
|
||||
2. SaaS服务:指我们基于软件即服务模式,向您提供的在线软件工具及相关技术服务,您可能需要支付软件订阅费(会员费)后方可使用全部或部分功能。
|
||||
3. 社区服务:指我们在平台上为用户提供的,用于发布、展示、交流、分享及交易作品、素材、版权等内容的空间与功能。
|
||||
4. 平台规则:指我们已经发布或后续可能发布、修改的与本平台相关的所有协议、政策、活动规则、公告、说明、站内信通知等,以及《隐私政策》等,均构成本协议不可分割的组成部分。
|
||||
5. 用户:指使用本平台服务的任何自然人或组织,包括企业用户与个人用户,合称“您”。
|
||||
6. 内容:指用户通过本平台上传、发布、生成、展示、交易的全部信息,包括但不限于模型、软件、素材、图片、视频、音频、文字、代码、设计图、评论等。
|
||||
第二章 账号的注册、使用与管理
|
||||
1. 账号注册
|
||||
(1)您在使用本平台服务前,需通过实名手机号或我们认可的第三方账号进行注册。企业用户还应提供真实、有效的企业营业执照等信息。您在注册或使用Omniai平台服务时可能需要提供一些必要的信息,为保证您享用的平台服务安全有效且不断优化,您同意授权我们对您的必要个人信息进行验证和合理使用。您须保证所填写及提供的资料真实、准确、完整、合法有效。
|
||||
(2)您注册成功的账号仅限您本人/本企业自身正当使用,禁止以任何形式赠与、借用、出租、转让、售卖或授权他人使用该账号。
|
||||
(3)特别提示:禁止恶意注册。您不得恶意批量注册账号,不得利用多个账号或其他技术手段实施干扰平台运营、规避平台规则、获取不当利益的行为。一经发现,我们有权立即冻结或收回相关账号,并追究您的违约责任。
|
||||
(4)如您提供任何违法、不实或我们认为不适合的资料,或我们有理由怀疑您的行为属于恶意操作,我们有权暂停或终止您的账号。
|
||||
(5)我们及Omniai平台无须对任何用户的任何登记资料承担任何责任,包括但不限于鉴别、核实任何登记资料的真实性、正确性、完整性、适用性及是否为最新资料的责任。
|
||||
2. 账号安全
|
||||
(1)您应对账号及密码/验证码的安全性负完全责任,并对该账号下进行的所有活动承担责任。您应高度重视对账号与验证码的保密,在任何情况下不向他人透露账号及验证码。您的账号遭到未获授权的使用,或者发生其它任何安全问题时,您应立即通知我们。
|
||||
(2)我们发现或合理认为使用者并非账号初始注册人,为保障账号安全,有权立即暂停或终止提供服务,并永久禁用该账号。
|
||||
3. 账号注销与回收
|
||||
(1)您可以按照平台公示的方式申请注销账号。账号注销后,我们将对账号内信息进行删除或匿名化处理,法律法规另有规定的除外。
|
||||
(2)如您的账号连续六个月以上未登录,我们有权冻结、收回或者注销该账号。
|
||||
第三章 平台服务与使用规范
|
||||
1. 服务内容
|
||||
(1)SaaS软件服务:我们向您提供在线SaaS软件工具,您可按需选择免费版或付费版(会员费)。使用部分高级功能或消耗大模型算力时,可能需要消耗积分,积分可通过充值等方式获得。
|
||||
(2)社区服务:平台提供作品、素材、版权的上传、展示、付费下载、互动交流等服务。用户间可通过平台进行相关版权或素材的交易。
|
||||
(3)交易手续费:为维持平台运营,对于用户间通过平台达成的交易,我们可能会向卖方或买方收取一定比例的交易手续费,具体费率以平台页面公示为准。
|
||||
2. 用户行为规范:严禁侵权与违法内容
|
||||
(1)您承诺,您在使用平台SaaS软件创作、或上传、发布、交易的所有内容,均由您原创或已获得合法、完整的授权,不存在侵犯任何第三方知识产权、肖像权、名誉权、隐私权等合法权益的情形。
|
||||
(2)高风险警示:您不得使用本平台创作、上传、发布、传播任何违反中华人民共和国法律法规、社会主义制度、国家利益、社会公序良俗或包含淫秽、色情、暴力、赌博、恐怖、侮辱、诽谤、虚假信息、扰乱社会秩序等任何不良内容的信息或作品。
|
||||
(3)您不得利用本平台进行任何危害网络安全的行为,包括但不限于使用插件、外挂、爬虫、病毒、反向工程、干扰系统正常运行等。
|
||||
(4)您不得利用本平台实施洗钱、套现、诈骗、赌博等违法活动。
|
||||
3. 禁止恶意“薅羊毛”与不正当竞争
|
||||
您不得通过批量注册账号、使用外挂程序、虚构交易、虚假评价、套取平台补贴或奖励等方式,获取不当商业利益或损害平台及其他用户的权益。一经发现,平台有权扣划不当得利、限制或封禁账号、追究违约责任。
|
||||
AI内容生成特别提示:您理解并同意,本平台提供的SaaS软件中可能包含基于人工智能技术的内容生成功能。鉴于AI技术的局限性,生成内容可能存在不确定性或不准确性。您应自行对生成内容进行审核和判断,并对其使用承担全部责任。我们不对生成内容的合法性、准确性、完整性、不侵权性作任何保证。
|
||||
第四章 知识产权
|
||||
1. 平台的知识产权
|
||||
本平台软件、代码、界面设计、商标、标识等知识产权归我们所有,未经书面许可,您不得进行复制、修改、反向编译或用于任何商业目的。
|
||||
2. 您的内容的知识产权
|
||||
(1)权利归属:您通过本平台上传、发布的内容及使用SaaS软件独立创作生成的内容,其知识产权归您或原权利人所有。您对您的内容承担全部责任。
|
||||
(2)授权许可:为了使您的内容能够在平台上进行展示、传播、交易,并为了我们能够持续改进SaaS软件和社区服务,您授予我们一项全球范围内、免费的、非排他性的、可分许可的权利,允许我们在平台及相关业务中使用、复制、修改、改编、分发您公开发布的内容。如果您不希望我们使用您的内容用于模型训练或改进,您可以通过平台设置或联系客服关闭此选项。对于您设置为非公开或仅用于交易的内容,我们将采取更严格的保护措施。
|
||||
(3)交易授权:您通过平台社区进行作品、素材、版权的付费下载或交易,即授予购买方一项按照交易约定范围使用该内容的许可。您作为卖方,应清晰标识授权范围,并对授权内容的真实性和合法性承担全部责任。
|
||||
3. 侵权内容处理
|
||||
我们尊重他人知识产权,并已建立侵权投诉处理机制。任何第三方认为平台上的内容侵犯其合法权益的,可按照平台公示的投诉渠道提交书面通知及初步侵权证据。我们将在收到合格通知后,依法采取删除、屏蔽、断开链接等必要措施,并通知相关用户。对于重复侵权、恶意侵权或情节严重的用户,我们有权直接终止向其提供服务,并永久封禁其账号。
|
||||
第五章 社区交易与责任限制
|
||||
1. 交易主体与责任承担
|
||||
(1)您充分理解并同意,本平台仅为用户提供作品、素材、版权的信息发布、展示、下载、支付结算等交易技术支持服务。平台不是交易合同的任何一方当事人,也并非作品的卖方或买方。
|
||||
(2)核心免责声明:平台对于用户发布、展示、交易的内容的合法性、真实性、准确性、完整性、安全性、质量、是否侵权以及交易的履行等,不承担任何事先审查或担保责任。您与其他用户之间因内容交易产生的任何纠纷,均由交易双方自行协商解决,或通过司法、行政途径解决。
|
||||
(3)如我们收到司法机关或行政机关的有效法律文书,或认为确有必要时,我们可以采取临时性措施以维护各方权益。
|
||||
2. 社区内容的管理权利
|
||||
我们有权依据法律法规、本协议及平台规则,对平台社区内的内容进行主动巡查。如发现或收到举报证明内容涉嫌侵权、违法或违反本协议,我们有权在不事先通知的情况下,直接删除、屏蔽相关内容,并对相关用户采取警示、限制功能、暂停服务或封禁账号等措施。
|
||||
第六章 费用与支付
|
||||
1. 软件订阅费(会员费):您购买会员服务时,应按照平台页面公示的价格和期限支付费用。会员服务为虚拟产品,一经开通,除法律另有规定或平台规则另有说明外,原则上不予退款。
|
||||
2. 积分充值:积分用于消耗平台算力或兑换特定服务。充值后积分有效期以平台公示为准。平台有权根据运营情况调整积分获取或消耗规则,但会提前公告。
|
||||
3. 交易手续费:平台有权就用户间通过平台达成的交易收取手续费,费率在交易前明确告知。平台有权根据市场情况调整手续费率,通过公告方式通知后生效。
|
||||
4. 税费:您使用本平台所获得的收入(如售卖素材所得),根据中国法律规定,您应自行申报并缴纳相关税费。平台按照法律规定履行代扣代缴义务(如适用)。
|
||||
第七章 违约与处理
|
||||
1. 违约认定:发生违反本协议或平台规则、侵犯第三方权益、恶意批量注册、虚假交易、套取利益或其他违反法律法规并造成损害的行为,视为您违约。
|
||||
2. 处理措施:我们有权独立判断并采取警告、拒绝发布、删除内容、限制使用功能、暂停服务、扣划不当得利、冻结或永久封禁账号、追究赔偿等一项或多项措施。
|
||||
3. 赔偿责任:如因您的行为导致我们或第三方遭受任何损失,您应足额赔偿。
|
||||
第八章 免责声明与责任限制
|
||||
1. 服务现状:我们的服务按“现状”和“可得到”的状态提供,我们不作出任何明示或暗示的保证,包括但不限于服务无间断、无错误、安全可靠、适用于特定目的等。
|
||||
2. AI生成内容免责:鉴于人工智能技术的局限性,我们无法保证通过SaaS软件生成内容的真实性、准确性、独创性及不侵权性。您应当对生成内容自行加以判断和验证,并承担使用该等内容所产生的全部风险与责任。
|
||||
3. 不可抗力及第三方原因:因自然灾害、战争、政府行为、电力或通讯故障、第三方攻击等不可抗力或非我们故意或重大过失的原因导致的损失,我们不承担责任。
|
||||
4. 服务中断与变更:我们可能会对平台进行升级、维护或修改,由此导致的服务中断或功能变更,我们将提前通过合理方式通知您。但我们不对因上述必要维护导致的任何损失承担责任,法律另有强制性规定的除外。
|
||||
5. 第三方链接与内容:平台可能包含指向第三方网站或资源的链接。我们不对这些第三方网站或资源的可用性、内容、产品或服务承担任何责任。您访问第三方网站或使用第三方服务所产生的一切风险由您自行承担。
|
||||
6. 责任上限:在法律允许的最大范围内,我们对于您因使用平台服务而遭受的任何间接、附带、特殊、惩罚性损失,即使已被告知可能发生该等损失,也不承担任何责任。我们的全部赔偿责任总额,不超过您在过去十二个月内向平台支付的费用总额。
|
||||
第九章 个人信息保护
|
||||
1. 我们非常重视您的个人信息保护。我们将按照平台公布的《隐私政策》收集、使用、存储、共享和保护您的个人信息。请您务必仔细阅读《隐私政策》。
|
||||
2. 您同意我们根据《隐私政策》以及相关法律法规的要求处理您的个人信息。
|
||||
3. 您知悉并同意,为方便您使用Omniai相关服务,我们有权在遵守法律法规的前提下,以明示的方式获取、使用、储存和分享您的个人信息。我们不会在未经您授权时,公开、编辑或透露您的个人信息及您保存在Omniai的非公开内容。
|
||||
4. 您知悉并同意,我们有权通过cookie等技术收集您的产品或服务使用、行为数据,并在经过数据脱敏使之不再指向或关联到您个人身份信息时,自由使用脱敏后的纯商业数据。
|
||||
第十章 协议的修改与终止
|
||||
1. 协议的修改:我们有权根据法律法规变化或业务需要修改本协议。修改后的协议将在平台公示或以其他方式通知您。如您不接受修改后的协议,您应停止使用平台服务;如您继续使用,则视为同意接受修改后的协议。
|
||||
2. 协议的终止:您可以申请注销账号终止本协议。我们有权在您违约或出现其他法定、约定情形时终止本协议。协议终止后,您仍需对协议终止前的行为承担责任。
|
||||
第十一章 法律适用与争议解决
|
||||
1. 本协议的订立、生效、履行、解释及争议解决,均适用中华人民共和国大陆地区法律。
|
||||
2. 凡因本协议引起的或与本协议有关的任何争议,双方应首先友好协商解决;协商不成的,任何一方均有权将争议提交至本平台运营主体所在地南京市浦口区有管辖权的人民法院通过诉讼解决。
|
||||
第十二章 其他
|
||||
1. 本协议条款标题仅为方便阅读而设,不影响条款含义的解释。
|
||||
2. 本协议任何条款被认定为无效或不可执行,不影响其他条款的效力。
|
||||
3. 如您对本协议有任何疑问、意见或建议,或需要投诉举报,您可以通过system@omniai.net.cn与我们联系。
|
||||
4. 兜底免责声明:在法律法规允许的最大范围内,本协议未明确列明的、或因超出我们合理预见或控制范围所产生的任何直接或间接损失、责任或风险,我们均不承担责任,除非相关法律另有强制性规定。您理解并同意,使用本平台服务的风险由您自行承担,我们仅以普通注意义务对平台进行管理,不对任何未明确约定的商业成果或安全性作出保证。
|
||||
(以下无正文)
|
||||
`.trim();
|
||||
|
||||
function getDocumentLines(text: string) {
|
||||
return text.split(/\n+/).map((line) => line.trim()).filter(Boolean);
|
||||
}
|
||||
|
||||
function getLineClassName(line: string, index: number) {
|
||||
if (index === 0) return "compliance-document__title";
|
||||
if (/^(第[一二三四五六七八九十]+章|[一二三四五六七八九十]+、)/.test(line)) return "compliance-document__heading";
|
||||
if (/^([一二三四五六七八九十]+)/.test(line)) return "compliance-document__subheading";
|
||||
if (/^[0-9]+\./.test(line) || /^([0-9]+)/.test(line) || /^·/.test(line)) return "compliance-document__clause";
|
||||
return "compliance-document__paragraph";
|
||||
}
|
||||
|
||||
export default function CompliancePage({ kind }: CompliancePageProps) {
|
||||
const isPrivacy = kind === "privacy";
|
||||
const sections = isPrivacy ? privacySections : agreementSections;
|
||||
const title = isPrivacy ? "隐私政策" : "用户协议";
|
||||
const Icon = isPrivacy ? SafetyOutlined : FileTextOutlined;
|
||||
const lines = getDocumentLines(isPrivacy ? privacyPolicyText : agreementText);
|
||||
|
||||
return (
|
||||
<section className="compliance-page">
|
||||
@@ -71,27 +223,26 @@ export default function CompliancePage({ kind }: CompliancePageProps) {
|
||||
<div>
|
||||
<span className="compliance-hero__eyebrow">合规文件</span>
|
||||
<h1>{title}</h1>
|
||||
<p>{companyName} 平台服务合规说明。更新日期:2026 年 6 月 3 日。</p>
|
||||
<p>{companyName}({platformName})服务合规说明。生效日期:{effectiveDate}</p>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="compliance-card">
|
||||
{sections.map((section, index) => (
|
||||
<article key={section.title} className="compliance-section">
|
||||
<span>{String(index + 1).padStart(2, "0")}</span>
|
||||
<div>
|
||||
<h2>{section.title}</h2>
|
||||
<p>{section.body}</p>
|
||||
</div>
|
||||
<article className="compliance-card compliance-document">
|
||||
{lines.map((line, index) => {
|
||||
const className = getLineClassName(line, index);
|
||||
if (className === "compliance-document__title") return <h2 key={`${index}-${line}`} className={className}>{line}</h2>;
|
||||
if (className === "compliance-document__heading") return <h3 key={`${index}-${line}`} className={className}>{line}</h3>;
|
||||
if (className === "compliance-document__subheading") return <h4 key={`${index}-${line}`} className={className}>{line}</h4>;
|
||||
return <p key={`${index}-${line}`} className={className}>{line}</p>;
|
||||
})}
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<footer className="compliance-contact">
|
||||
<strong>联系我们</strong>
|
||||
<span>邮箱:{contactEmail}</span>
|
||||
<span>地址:{address}</span>
|
||||
<span>电话:{contactPhone}</span>
|
||||
<span>备案号:苏ICP备2026021747号-1</span>
|
||||
<span>备案号:{icpRecord}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -715,7 +715,7 @@ async function createUploadedImageItems(files: File[], limit: number, prefix: st
|
||||
|
||||
const items = await Promise.all(selectedFiles.map(async (file, index) => {
|
||||
const localPreviewUrl = URL.createObjectURL(file);
|
||||
let dimensions: { width?: number; height?: number } = {};
|
||||
let dimensions: { width?: number; height?: number };
|
||||
try {
|
||||
dimensions = await readImageDimensions(localPreviewUrl);
|
||||
} catch {
|
||||
|
||||
@@ -195,18 +195,10 @@ function getHomeCarouselCardStyle(offset: number): CSSProperties {
|
||||
const depth = Math.abs(offset);
|
||||
const direction = Math.sign(offset);
|
||||
const isActive = depth === 0;
|
||||
const xByDepth = [
|
||||
"0px",
|
||||
"clamp(52px, 13.5vw, 198px)",
|
||||
"clamp(90px, 22.5vw, 334px)",
|
||||
"clamp(122px, 30.5vw, 448px)",
|
||||
"clamp(148px, 37vw, 542px)",
|
||||
"clamp(170px, 42vw, 614px)",
|
||||
];
|
||||
const xByDepth = [0, 190, 320, 430, 520, 590];
|
||||
const yByDepth = [8, -2, -8, -13, -18, -24];
|
||||
const scaleByDepth = [1, 1, 1, 1, 1, 1];
|
||||
const xDistance = xByDepth[depth] ?? xByDepth[xByDepth.length - 1]!;
|
||||
const x = direction < 0 ? `calc(0px - ${xDistance})` : xDistance;
|
||||
const x = direction * (xByDepth[depth] ?? xByDepth[xByDepth.length - 1]!);
|
||||
const y = yByDepth[depth] ?? yByDepth[yByDepth.length - 1]!;
|
||||
const z = isActive ? 90 : 28 - depth;
|
||||
const scale = scaleByDepth[depth] ?? scaleByDepth[scaleByDepth.length - 1]!;
|
||||
@@ -215,7 +207,7 @@ function getHomeCarouselCardStyle(offset: number): CSSProperties {
|
||||
"--apple-card-offset": offset,
|
||||
"--apple-card-depth": depth,
|
||||
"--apple-card-z": 80 - depth,
|
||||
"--apple-card-x": x,
|
||||
"--apple-card-x": `${x}px`,
|
||||
"--apple-card-y": `${y}px`,
|
||||
"--apple-card-z-offset": `${z}px`,
|
||||
"--apple-card-rotate-y": "0deg",
|
||||
@@ -631,24 +623,15 @@ function HomePage({ onOpenGenerate, onStartOnboarding, onOpenCanvas, onOpenEcomm
|
||||
<div className="omni-home__actions" aria-label="首页入口">
|
||||
<button type="button" className="omni-home__entry" onClick={onStartOnboarding || onOpenGenerate}>
|
||||
<PlusOutlined />
|
||||
<span>
|
||||
快速生成
|
||||
<small>新手友好</small>
|
||||
</span>
|
||||
<span>新手</span>
|
||||
</button>
|
||||
<button type="button" className="omni-home__entry omni-home__entry--primary" onClick={onOpenCanvas || onOpenGenerate}>
|
||||
<PlayCircleOutlined />
|
||||
<span>
|
||||
专业创作
|
||||
<small>画布工作流</small>
|
||||
</span>
|
||||
<span>老手</span>
|
||||
</button>
|
||||
<button type="button" className="omni-home__entry" onClick={onOpenEcommerce}>
|
||||
<ShoppingOutlined />
|
||||
<span>
|
||||
电商出图
|
||||
<small>商品视觉</small>
|
||||
</span>
|
||||
<span>电商</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -345,12 +345,11 @@ function MorePage({ onSelectView, onOpenImageTool }: MorePageProps) {
|
||||
key={tool.id}
|
||||
type="button"
|
||||
className={`more-card more-card--featured${getPreviewClassName(tool.id)}`}
|
||||
style={{
|
||||
"--card-gradient": coreToolGradients[tool.id] ?? "linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.04))",
|
||||
} as CSSProperties}
|
||||
style={{ "--card-gradient": coreToolGradients[tool.id] ?? "linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.04))" } as CSSProperties}
|
||||
aria-label={`打开核心工具:${tool.title},${tool.text}`}
|
||||
onClick={() => openTool(tool)}
|
||||
>
|
||||
<span className="more-card__featured-icon">{tool.icon}</span>
|
||||
<div className="more-card__featured-body">
|
||||
<span className="more-card__featured-kicker">{categoryLabels[tool.category]}</span>
|
||||
<strong>{tool.title}</strong>
|
||||
@@ -389,6 +388,7 @@ function MorePage({ onSelectView, onOpenImageTool }: MorePageProps) {
|
||||
onClick={() => openTool(tool)}
|
||||
disabled={!tool.ready}
|
||||
>
|
||||
<span className="more-card__icon">{tool.icon}</span>
|
||||
<span className="more-card__topline">
|
||||
{tool.tags.slice(0, 2).map((tag) => (
|
||||
<span key={tag}>{tag}</span>
|
||||
|
||||
@@ -37,7 +37,7 @@ import {
|
||||
import "../../styles/pages/workbench.css";
|
||||
import type { WebGenerationPreviewTask, WebUserSession } from "../../types";
|
||||
import { aiGenerationClient } from "../../api/aiGenerationClient";
|
||||
import { claimGenerationSlot, getActiveGenerationTaskCount, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency";
|
||||
import { claimGenerationSlot, getActiveGenerationTaskCount, getEffectiveGenerationLimit, getGenerationUserKey, releaseGenerationSlot } from "../../api/generationConcurrency";
|
||||
import { preUploadReference, resolvePreUploadedUrl } from "../../api/referenceUploadService";
|
||||
import { assetClient } from "../../api/assetClient";
|
||||
import { communityClient } from "../../api/communityClient";
|
||||
@@ -1055,6 +1055,54 @@ function WorkbenchPage({
|
||||
persistKeepaliveTasks(rest);
|
||||
};
|
||||
|
||||
const releaseKeepaliveTaskLocally = useCallback((taskId: string, options?: { cancelServer?: boolean }) => {
|
||||
const task = keepaliveTasksRef.current[taskId];
|
||||
taskAbortControllersRef.current.get(taskId)?.abort();
|
||||
taskAbortControllersRef.current.delete(taskId);
|
||||
removeKeepaliveTask(taskId);
|
||||
if (task && options?.cancelServer) {
|
||||
aiGenerationClient.cancelTask(task.taskId).catch(() => {});
|
||||
}
|
||||
syncActiveGenerationUi();
|
||||
}, [syncActiveGenerationUi]);
|
||||
|
||||
const releaseKeepaliveTaskAfterNetworkLoss = useCallback((task: WorkbenchKeepaliveTask, progress: number) => {
|
||||
const latestTask = {
|
||||
...task,
|
||||
progress,
|
||||
statusLabel: "网络中断,已释放提交按钮",
|
||||
};
|
||||
void patchConversationMessage(task.conversationId, task.assistantMessageId, {
|
||||
status: "failed",
|
||||
taskProgress: Math.max(progress, 100),
|
||||
taskStatusLabel: "网络中断",
|
||||
body: "网络中断,当前任务已停止等待并释放提交按钮。请确认网络恢复后重新提交任务。",
|
||||
});
|
||||
upsertKeepaliveTask(latestTask);
|
||||
releaseKeepaliveTaskLocally(task.taskId, { cancelServer: true });
|
||||
if (activeConversationIdRef.current === task.conversationId) {
|
||||
setIsGenerating(false);
|
||||
setGenerationStatus("网络中断,已释放提交按钮");
|
||||
setGenerationProgress(0);
|
||||
}
|
||||
}, [patchConversationMessage, releaseKeepaliveTaskLocally]);
|
||||
|
||||
const cancelActiveKeepaliveTasksOnPageExit = useCallback(() => {
|
||||
const tasks = Object.values(keepaliveTasksRef.current);
|
||||
if (!tasks.length) return;
|
||||
tasks.forEach((task) => {
|
||||
taskAbortControllersRef.current.get(task.taskId)?.abort();
|
||||
taskAbortControllersRef.current.delete(task.taskId);
|
||||
releaseGenerationSlot(task.concurrencySlotId);
|
||||
aiGenerationClient.cancelTaskOnUnload(task.taskId);
|
||||
});
|
||||
keepaliveTasksRef.current = {};
|
||||
persistKeepaliveTasks({});
|
||||
setIsGenerating(false);
|
||||
setGenerationStatus("已释放未完成任务");
|
||||
setGenerationProgress(0);
|
||||
}, []);
|
||||
|
||||
const runKeepalivePoll = useCallback(
|
||||
(task: WorkbenchKeepaliveTask) => {
|
||||
if (taskAbortControllersRef.current.has(task.taskId)) return;
|
||||
@@ -1081,6 +1129,10 @@ function WorkbenchPage({
|
||||
if (abortController.signal.aborted) return;
|
||||
if (attempt > 0) await sleep(3000);
|
||||
if (abortController.signal.aborted) return;
|
||||
if (typeof navigator !== "undefined" && navigator.onLine === false) {
|
||||
releaseKeepaliveTaskAfterNetworkLoss(task, lastKnownProgress);
|
||||
return;
|
||||
}
|
||||
|
||||
let status;
|
||||
try {
|
||||
@@ -1094,7 +1146,8 @@ function WorkbenchPage({
|
||||
taskProgress: 100,
|
||||
taskStatusLabel: "任务异常",
|
||||
});
|
||||
removeKeepaliveTask(task.taskId);
|
||||
releaseKeepaliveTaskLocally(task.taskId, { cancelServer: true });
|
||||
onRefreshUsage?.();
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
@@ -1322,6 +1375,24 @@ function WorkbenchPage({
|
||||
};
|
||||
}, [runKeepalivePoll]);
|
||||
|
||||
useEffect(() => {
|
||||
const handlePageHide = () => {
|
||||
cancelActiveKeepaliveTasksOnPageExit();
|
||||
};
|
||||
const handleOnline = () => {
|
||||
Object.values(keepaliveTasksRef.current).forEach((task) => runKeepalivePoll(task));
|
||||
syncActiveGenerationUi();
|
||||
};
|
||||
|
||||
window.addEventListener("pagehide", handlePageHide);
|
||||
window.addEventListener("online", handleOnline);
|
||||
aiGenerationClient.flushPendingTaskCancellations();
|
||||
return () => {
|
||||
window.removeEventListener("pagehide", handlePageHide);
|
||||
window.removeEventListener("online", handleOnline);
|
||||
};
|
||||
}, [cancelActiveKeepaliveTasksOnPageExit, runKeepalivePoll, syncActiveGenerationUi]);
|
||||
|
||||
useEffect(() => {
|
||||
persistPromptHistory(promptHistory);
|
||||
}, [promptHistory]);
|
||||
@@ -1986,7 +2057,7 @@ function WorkbenchPage({
|
||||
const trimmedPrompt = (promptOverride ?? inputValue).trim();
|
||||
if (!trimmedPrompt) return;
|
||||
const userKey = getGenerationUserKey(session?.user.id);
|
||||
if (activeMode !== "chat" && getActiveGenerationTaskCount(userKey) >= 3) return;
|
||||
if (activeMode !== "chat" && getActiveGenerationTaskCount(userKey) >= getEffectiveGenerationLimit()) return;
|
||||
setReferencePreviewOpen(false);
|
||||
|
||||
let conversationId = activeConversationIdRef.current ?? activeConversationId;
|
||||
@@ -2465,8 +2536,11 @@ function WorkbenchPage({
|
||||
setProjectError("仅支持对视频结果进行超分");
|
||||
return;
|
||||
}
|
||||
if (getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id)) >= 3) {
|
||||
setProjectError(`当前已有 ${getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id))} 个任务进行中(上限3个),请等待任一任务完成后再提交新任务`);
|
||||
const userKey = getGenerationUserKey(session?.user.id);
|
||||
const activeCount = getActiveGenerationTaskCount(userKey);
|
||||
const limit = getEffectiveGenerationLimit();
|
||||
if (activeCount >= limit) {
|
||||
setProjectError(`当前已有 ${activeCount} 个任务进行中(上限${limit}个),请等待任一任务完成后再提交新任务`);
|
||||
return;
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
@@ -2587,8 +2661,11 @@ function WorkbenchPage({
|
||||
setProjectError("仅支持对图片结果进行超分");
|
||||
return;
|
||||
}
|
||||
if (getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id)) >= 3) {
|
||||
setProjectError(`当前已有 ${getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id))} 个任务进行中(上限3个),请等待任一任务完成后再提交新任务`);
|
||||
const userKey = getGenerationUserKey(session?.user.id);
|
||||
const activeCount = getActiveGenerationTaskCount(userKey);
|
||||
const limit = getEffectiveGenerationLimit();
|
||||
if (activeCount >= limit) {
|
||||
setProjectError(`当前已有 ${activeCount} 个任务进行中(上限${limit}个),请等待任一任务完成后再提交新任务`);
|
||||
return;
|
||||
}
|
||||
if (!isAuthenticated) {
|
||||
@@ -2761,13 +2838,14 @@ function WorkbenchPage({
|
||||
};
|
||||
|
||||
const activeGenerationCount = getActiveGenerationTaskCount(getGenerationUserKey(session?.user.id));
|
||||
const generationLimitReached = activeMode !== "chat" && activeGenerationCount >= 3;
|
||||
const activeGenerationLimit = getEffectiveGenerationLimit();
|
||||
const generationLimitReached = activeMode !== "chat" && activeGenerationCount >= activeGenerationLimit;
|
||||
const promptIsEmpty = !inputValue.trim();
|
||||
const sendDisabled = promptIsEmpty || generationLimitReached;
|
||||
const sendButtonTitle = promptIsEmpty
|
||||
? "输入内容后可发送"
|
||||
: generationLimitReached
|
||||
? `当前已有 ${activeGenerationCount} 个任务进行中,请等待任一任务完成`
|
||||
? `当前已有 ${activeGenerationCount} 个任务进行中(上限 ${activeGenerationLimit} 个),请等待任一任务完成`
|
||||
: billingEstimate.title;
|
||||
|
||||
const suggestedPrompts = [
|
||||
|
||||
@@ -788,6 +788,65 @@
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.compliance-document {
|
||||
gap: 0;
|
||||
padding: 30px 34px 34px;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.compliance-document__title,
|
||||
.compliance-document__heading,
|
||||
.compliance-document__subheading,
|
||||
.compliance-document__paragraph,
|
||||
.compliance-document__clause {
|
||||
margin: 0;
|
||||
max-width: 100%;
|
||||
color: var(--fg-body);
|
||||
letter-spacing: 0;
|
||||
overflow-wrap: anywhere;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.compliance-document__title {
|
||||
margin-bottom: 18px;
|
||||
padding-bottom: 16px;
|
||||
border-bottom: 1px solid var(--border-subtle);
|
||||
font-size: clamp(24px, 3vw, 32px);
|
||||
line-height: 1.22;
|
||||
}
|
||||
|
||||
.compliance-document__heading {
|
||||
margin: 26px 0 12px;
|
||||
padding-top: 4px;
|
||||
color: var(--accent);
|
||||
font-size: 20px;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.compliance-document__subheading {
|
||||
margin: 18px 0 8px;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.compliance-document__paragraph,
|
||||
.compliance-document__clause {
|
||||
color: var(--fg-muted);
|
||||
font-size: 14px;
|
||||
line-height: 1.85;
|
||||
}
|
||||
|
||||
.compliance-document__paragraph + .compliance-document__paragraph,
|
||||
.compliance-document__clause + .compliance-document__clause,
|
||||
.compliance-document__paragraph + .compliance-document__clause,
|
||||
.compliance-document__clause + .compliance-document__paragraph {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.compliance-document__clause {
|
||||
padding-left: 12px;
|
||||
}
|
||||
|
||||
.compliance-section {
|
||||
display: grid;
|
||||
grid-template-columns: 52px minmax(0, 1fr);
|
||||
@@ -892,4 +951,12 @@
|
||||
.compliance-section {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.compliance-document {
|
||||
padding: 22px 18px 26px;
|
||||
}
|
||||
|
||||
.compliance-document__clause {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
+15
-533
@@ -402,6 +402,21 @@
|
||||
transform: translateZ(20px) scale(1.02);
|
||||
}
|
||||
|
||||
.omni-home__carousel-card-label {
|
||||
position: absolute;
|
||||
bottom: 12px;
|
||||
left: 14px;
|
||||
z-index: 2;
|
||||
padding: 4px 12px;
|
||||
border-radius: 999px;
|
||||
background: rgba(var(--accent-rgb, 0, 255, 136), 0.16);
|
||||
border: 1px solid rgba(var(--accent-rgb, 0, 255, 136), 0.24);
|
||||
color: var(--fg-body, #f3f5f2);
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.omni-home__carousel-card:hover {
|
||||
box-shadow:
|
||||
0 28px 58px rgb(0 0 0 / 34%),
|
||||
@@ -2464,536 +2479,3 @@
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== Home page product polish and responsive hardening ===== */
|
||||
.web-shell[data-view="home"] .omni-home {
|
||||
--home-card-radius: 14px;
|
||||
--home-panel-radius: 18px;
|
||||
--home-safe-inline: clamp(16px, 4.6vw, 72px);
|
||||
scroll-padding-top: 16px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__scrim {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(5, 8, 13, 0.82), rgba(5, 8, 13, 0.52) 38%, rgba(5, 8, 13, 0.9)),
|
||||
radial-gradient(circle at 50% 24%, rgba(var(--accent-rgb), 0.1), transparent 36%),
|
||||
linear-gradient(90deg, rgba(5, 8, 13, 0.86), rgba(5, 8, 13, 0.48) 48%, rgba(5, 8, 13, 0.86));
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__shell {
|
||||
padding: clamp(28px, 4.4vw, 58px) var(--home-safe-inline) clamp(34px, 4.8vw, 70px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__hero {
|
||||
width: min(100%, 1240px);
|
||||
gap: clamp(16px, 2vw, 24px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__copy {
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__copy h1 {
|
||||
max-width: min(100%, 920px);
|
||||
white-space: normal;
|
||||
text-wrap: balance;
|
||||
font-size: clamp(34px, 4vw, 62px);
|
||||
letter-spacing: 0;
|
||||
text-shadow: 0 18px 54px rgb(0 0 0 / 34%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__copy p {
|
||||
max-width: 680px;
|
||||
color: rgb(235 245 240 / 72%);
|
||||
font-size: clamp(14px, 1.25vw, 18px);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__actions {
|
||||
width: min(100%, 620px);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry {
|
||||
min-height: 64px;
|
||||
border-color: rgb(255 255 255 / 11%);
|
||||
border-radius: 12px;
|
||||
background:
|
||||
linear-gradient(180deg, rgb(255 255 255 / 7%), rgb(255 255 255 / 3%)),
|
||||
rgb(12 16 17 / 78%);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgb(255 255 255 / 8%),
|
||||
0 16px 34px rgb(0 0 0 / 22%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry > span:not(.anticon) {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
justify-items: center;
|
||||
min-width: 0;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry small {
|
||||
color: rgb(235 245 240 / 48%);
|
||||
font-size: 11px;
|
||||
font-weight: 760;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry--primary small {
|
||||
color: rgb(6 16 20 / 62%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry:hover {
|
||||
border-color: rgb(0 255 136 / 34%);
|
||||
background:
|
||||
linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%)),
|
||||
rgb(17 22 22 / 88%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry--primary,
|
||||
.web-shell[data-view="home"] .omni-home__entry--primary:hover {
|
||||
border-color: rgb(0 255 136 / 82%);
|
||||
background:
|
||||
linear-gradient(180deg, rgb(88 255 172 / 100%), rgb(0 255 136 / 100%));
|
||||
box-shadow:
|
||||
0 18px 42px rgb(0 255 136 / 14%),
|
||||
inset 0 1px 0 rgb(255 255 255 / 28%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel {
|
||||
width: min(100%, 1180px);
|
||||
min-height: clamp(380px, 36vw, 560px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage {
|
||||
width: min(100%, 1180px);
|
||||
height: clamp(360px, 34vw, 530px);
|
||||
overflow: hidden;
|
||||
-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
|
||||
mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card {
|
||||
width: clamp(500px, 45vw, 760px);
|
||||
height: clamp(281px, 25.31vw, 428px);
|
||||
border: 1px solid rgb(255 255 255 / 5%);
|
||||
border-radius: var(--home-panel-radius);
|
||||
background:
|
||||
linear-gradient(180deg, rgb(255 255 255 / 4%), rgb(0 0 0 / 5%)),
|
||||
#07100f;
|
||||
box-shadow:
|
||||
0 18px 46px rgb(0 0 0 / 30%),
|
||||
inset 0 1px 0 rgb(255 255 255 / 8%),
|
||||
inset 0 0 0 1px rgb(255 255 255 / 2%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card::before {
|
||||
background:
|
||||
linear-gradient(180deg, rgb(2 12 12 / 18%), transparent 34%, rgb(3 9 10 / 30%)),
|
||||
linear-gradient(90deg, rgb(4 10 12 / 38%), transparent 24%, transparent 76%, rgb(4 10 12 / 38%)),
|
||||
radial-gradient(circle at 50% 58%, rgb(0 255 136 / 8%), transparent 54%);
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 3;
|
||||
border-radius: inherit;
|
||||
box-shadow:
|
||||
inset 0 0 0 1px rgb(255 255 255 / 4%),
|
||||
inset 0 -42px 64px rgb(2 8 9 / 32%),
|
||||
inset 0 34px 56px rgb(255 255 255 / 4%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card.is-active {
|
||||
border-color: rgb(255 255 255 / 7%);
|
||||
box-shadow:
|
||||
0 26px 70px rgb(0 0 0 / 38%),
|
||||
0 0 0 1px rgb(255 255 255 / 4%),
|
||||
0 0 46px rgb(0 0 0 / 18%),
|
||||
inset 0 1px 0 rgb(255 255 255 / 10%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card:not(.is-active) {
|
||||
filter: saturate(0.62) brightness(0.66) contrast(0.96);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage .omni-home__carousel-card img,
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage .omni-home__carousel-card.is-active img {
|
||||
object-fit: contain;
|
||||
transform: translateZ(12px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage .omni-home__carousel-card img {
|
||||
filter:
|
||||
saturate(0.72)
|
||||
contrast(0.98)
|
||||
brightness(0.72)
|
||||
hue-rotate(8deg)
|
||||
drop-shadow(0 18px 18px rgb(0 0 0 / 18%));
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage .omni-home__carousel-card.is-active img {
|
||||
filter:
|
||||
saturate(0.9)
|
||||
contrast(1.03)
|
||||
brightness(0.88)
|
||||
hue-rotate(6deg)
|
||||
drop-shadow(0 22px 22px rgb(0 0 0 / 18%));
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page {
|
||||
padding-inline: var(--home-safe-inline);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page::before {
|
||||
background:
|
||||
linear-gradient(90deg, rgb(5 8 13 / 96%) 0%, rgb(5 8 13 / 80%) 40%, rgb(5 8 13 / 52%) 100%),
|
||||
linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 34%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-visual {
|
||||
border-radius: var(--home-panel-radius);
|
||||
border-color: rgb(255 255 255 / 10%);
|
||||
background:
|
||||
linear-gradient(180deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 2%)),
|
||||
#0d1111;
|
||||
box-shadow:
|
||||
0 24px 68px rgb(0 0 0 / 34%),
|
||||
inset 0 1px 0 rgb(255 255 255 / 8%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-copy h2,
|
||||
.web-shell[data-view="home"] .omni-home__experience-copy h2 {
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-copy p,
|
||||
.web-shell[data-view="home"] .omni-home__experience-copy p {
|
||||
color: rgb(232 238 236 / 74%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-script,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-model,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-ecommerce {
|
||||
padding-inline: clamp(10px, 1.8vw, 28px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-script .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-model .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-ecommerce .omni-home__feature-visual {
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience {
|
||||
background:
|
||||
linear-gradient(112deg, rgb(0 255 136 / 10%) 0 1px, transparent 1px 20%),
|
||||
linear-gradient(68deg, rgb(0 255 136 / 7%) 0 1px, transparent 1px 22%),
|
||||
linear-gradient(180deg, #070b10 0%, #05080d 100%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-route {
|
||||
border-radius: var(--home-card-radius);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] :is(
|
||||
.omni-home__shell,
|
||||
.omni-home__feature-page,
|
||||
.omni-home__toolbox-page,
|
||||
.omni-home__experience
|
||||
) {
|
||||
scroll-margin-top: 64px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent {
|
||||
right: clamp(14px, 2vw, 24px);
|
||||
bottom: 12px;
|
||||
width: min(560px, calc(100vw - 28px));
|
||||
gap: 10px;
|
||||
padding: 10px 12px;
|
||||
border-color: rgb(0 255 136 / 20%);
|
||||
border-radius: 13px;
|
||||
background:
|
||||
linear-gradient(180deg, rgb(255 255 255 / 6%), rgb(255 255 255 / 3%)),
|
||||
rgb(13 17 18 / 92%);
|
||||
box-shadow:
|
||||
0 18px 46px rgb(0 0 0 / 30%),
|
||||
inset 0 1px 0 rgb(255 255 255 / 7%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent strong {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent p {
|
||||
margin-top: 4px;
|
||||
overflow: hidden;
|
||||
font-size: 12px;
|
||||
line-height: 1.32;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent__actions {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent__actions a,
|
||||
.web-shell[data-view="home"] .cookie-consent__actions button {
|
||||
min-height: 32px;
|
||||
padding-inline: 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.web-shell[data-view="home"] .omni-home__carousel {
|
||||
min-height: clamp(340px, 42vw, 500px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage {
|
||||
width: min(100%, 1020px);
|
||||
height: clamp(320px, 39vw, 470px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card {
|
||||
width: clamp(470px, 57vw, 660px);
|
||||
height: clamp(264px, 32.06vw, 371px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.web-shell[data-view="home"] .omni-home {
|
||||
scroll-snap-type: none;
|
||||
overscroll-behavior-y: auto;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__shell {
|
||||
min-height: auto;
|
||||
padding-top: clamp(24px, 4vw, 38px);
|
||||
padding-bottom: clamp(34px, 6vw, 58px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__hero {
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__actions {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry {
|
||||
min-height: 58px;
|
||||
padding-inline: 18px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry small {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel {
|
||||
width: min(100%, 820px);
|
||||
min-height: clamp(290px, 54vw, 430px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage {
|
||||
width: min(100%, 820px);
|
||||
height: clamp(280px, 51vw, 410px);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-deck {
|
||||
transform: scale(0.96);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page,
|
||||
.web-shell[data-view="home"] .omni-home__experience {
|
||||
min-height: auto;
|
||||
padding-block: clamp(44px, 7vw, 72px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-copy h2,
|
||||
.web-shell[data-view="home"] .omni-home__experience-copy h2 {
|
||||
font-size: clamp(34px, 7vw, 58px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-copy p,
|
||||
.web-shell[data-view="home"] .omni-home__experience-copy p {
|
||||
font-size: clamp(15px, 2.4vw, 20px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-script .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-model .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-ecommerce .omni-home__feature-visual {
|
||||
height: auto;
|
||||
min-height: clamp(520px, 78vw, 720px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience {
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-visual {
|
||||
min-height: 260px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.web-shell[data-view="home"] .omni-home__copy h1 {
|
||||
font-size: clamp(30px, 9vw, 44px);
|
||||
line-height: 1.08;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__copy p {
|
||||
max-width: 520px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__actions {
|
||||
grid-template-columns: 1fr;
|
||||
width: min(100%, 420px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry {
|
||||
justify-content: center;
|
||||
min-height: 54px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__entry > span:not(.anticon) {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel {
|
||||
min-height: clamp(260px, 70vw, 360px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage {
|
||||
height: clamp(248px, 66vw, 340px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-deck {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card {
|
||||
width: min(94vw, 520px);
|
||||
height: min(52.88vw, 292px);
|
||||
min-height: 206px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-stats {
|
||||
position: relative;
|
||||
inset: auto;
|
||||
margin-top: 18px;
|
||||
max-width: none;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-routes {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-route {
|
||||
min-height: 84px;
|
||||
padding: 13px 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-route b {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.web-shell[data-view="home"] .omni-home {
|
||||
--home-safe-inline: 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__shell {
|
||||
padding-top: 20px;
|
||||
padding-bottom: 32px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__hero {
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__copy {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel {
|
||||
min-height: clamp(228px, 68vw, 286px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-stage {
|
||||
height: clamp(218px, 64vw, 274px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-deck {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__carousel-card {
|
||||
width: 94vw;
|
||||
height: 52.88vw;
|
||||
min-height: 188px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page,
|
||||
.web-shell[data-view="home"] .omni-home__experience {
|
||||
padding-block: 34px 44px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] :is(
|
||||
.omni-home__shell,
|
||||
.omni-home__feature-page,
|
||||
.omni-home__toolbox-page,
|
||||
.omni-home__experience
|
||||
) {
|
||||
scroll-margin-top: 60px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-script .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-model .omni-home__feature-visual,
|
||||
.web-shell[data-view="home"] .omni-home__feature-page.is-ecommerce .omni-home__feature-visual {
|
||||
min-height: 560px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__experience-routes {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent {
|
||||
right: 10px;
|
||||
bottom: max(10px, env(safe-area-inset-bottom));
|
||||
grid-template-columns: 1fr;
|
||||
width: calc(100vw - 20px);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent p {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
text-overflow: initial;
|
||||
white-space: normal;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent__actions {
|
||||
justify-content: stretch;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .cookie-consent__actions a,
|
||||
.web-shell[data-view="home"] .cookie-consent__actions button {
|
||||
flex: 1 1 0;
|
||||
}
|
||||
}
|
||||
|
||||
+32
-11
@@ -216,10 +216,10 @@
|
||||
|
||||
.more-card--featured {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-columns: 54px minmax(0, 1fr);
|
||||
align-items: start;
|
||||
justify-items: stretch;
|
||||
gap: 12px;
|
||||
gap: 16px;
|
||||
min-height: 336px;
|
||||
padding: 20px;
|
||||
border-color: rgba(var(--accent-rgb), 0.2);
|
||||
@@ -251,6 +251,22 @@
|
||||
box-shadow: var(--more-card-shadow), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
|
||||
}
|
||||
|
||||
.more-card__featured-icon {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 54px;
|
||||
height: 54px;
|
||||
border: 1px solid rgba(var(--accent-rgb), 0.24);
|
||||
border-radius: var(--radius-xs, 8px);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-rgb), 0.08)),
|
||||
var(--bg-inset);
|
||||
color: var(--accent);
|
||||
font-size: 24px;
|
||||
flex-shrink: 0;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.more-card__featured-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -265,12 +281,7 @@
|
||||
.more-card--featured .more-card__preview {
|
||||
width: 100%;
|
||||
min-height: 0;
|
||||
aspect-ratio: 4 / 3;
|
||||
}
|
||||
|
||||
.more-card--featured .more-card__preview-frame img {
|
||||
padding: 8px;
|
||||
object-fit: contain;
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.more-card--featured.more-card--no-preview {
|
||||
@@ -438,7 +449,7 @@
|
||||
}
|
||||
|
||||
.more-card__icon {
|
||||
display: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
@@ -453,7 +464,6 @@
|
||||
}
|
||||
|
||||
.more-card--recent .more-card__icon {
|
||||
display: grid;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
font-size: 14px;
|
||||
@@ -1211,12 +1221,18 @@
|
||||
}
|
||||
|
||||
.more-card--featured {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
grid-template-columns: 44px minmax(0, 1fr);
|
||||
min-height: 0;
|
||||
padding: 16px;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.more-card__featured-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.more-card__featured-body strong {
|
||||
font-size: 16px;
|
||||
}
|
||||
@@ -1296,6 +1312,11 @@
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.more-card__featured-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.more-card {
|
||||
gap: 10px;
|
||||
min-height: 0;
|
||||
|
||||
@@ -684,6 +684,12 @@
|
||||
}
|
||||
|
||||
@container (max-width: 1120px) {
|
||||
.omni-script-review-showcase {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 18px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.srs-left-panel {
|
||||
grid-template-rows: auto auto auto;
|
||||
gap: 16px;
|
||||
@@ -705,32 +711,13 @@
|
||||
}
|
||||
|
||||
.srs-results-panel {
|
||||
grid-template-rows: auto minmax(300px, auto) auto;
|
||||
grid-template-rows: auto minmax(320px, auto) auto;
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 880px) {
|
||||
.srs-brand-section {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.srs-brand-section h1 {
|
||||
max-width: 100%;
|
||||
font-size: clamp(28px, 8cqw, 44px);
|
||||
}
|
||||
|
||||
.srs-brand-section p {
|
||||
font-size: clamp(14px, 3.2cqw, 17px);
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.srs-point-card {
|
||||
min-height: 0;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.srs-results-panel {
|
||||
gap: 14px;
|
||||
@media (max-width: 980px) {
|
||||
.omni-script-review-showcase {
|
||||
padding: 22px;
|
||||
}
|
||||
|
||||
.srs-score-hero {
|
||||
@@ -742,118 +729,33 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.srs-chart-body,
|
||||
.srs-triple-section,
|
||||
.srs-point-list {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.srs-score-summary {
|
||||
font-size: clamp(13px, 3cqw, 16px);
|
||||
line-height: 1.55;
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 720px) {
|
||||
.srs-chart-card {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.srs-chart-title {
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.srs-chart-body {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
|
||||
.srs-chart-col {
|
||||
grid-template-columns: minmax(94px, 0.36fr) minmax(0, 1fr);
|
||||
grid-template-columns: minmax(70px, 92px) minmax(0, 1fr);
|
||||
grid-template-rows: auto;
|
||||
align-items: center;
|
||||
justify-items: stretch;
|
||||
min-height: 46px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.055);
|
||||
border-radius: 10px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.srs-chart-bar-wrap {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
width: 100%;
|
||||
height: 16px;
|
||||
min-height: 16px;
|
||||
}
|
||||
|
||||
.srs-chart-bar-bg,
|
||||
.srs-chart-bar-fill {
|
||||
width: 100%;
|
||||
height: 100% !important;
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.srs-chart-bar-bg {
|
||||
left: 0;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.srs-chart-bar-fill {
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
.srs-chart-col:nth-child(1) .srs-chart-bar-fill { width: 80%; }
|
||||
.srs-chart-col:nth-child(2) .srs-chart-bar-fill { width: 80%; }
|
||||
.srs-chart-col:nth-child(3) .srs-chart-bar-fill { width: 100%; }
|
||||
.srs-chart-col:nth-child(4) .srs-chart-bar-fill { width: 80%; }
|
||||
.srs-chart-col:nth-child(5) .srs-chart-bar-fill { width: 66%; }
|
||||
.srs-chart-col:nth-child(6) .srs-chart-bar-fill { width: 53%; }
|
||||
|
||||
.srs-chart-bar-score {
|
||||
top: 50%;
|
||||
right: 8px;
|
||||
left: auto;
|
||||
font-size: 12px;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.srs-chart-bar-sub,
|
||||
.srs-chart-bar-star {
|
||||
font-size: 10px;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.srs-chart-col-label {
|
||||
grid-column: 1;
|
||||
grid-row: 1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.srs-chart-col-name {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.srs-chart-col-desc {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.srs-triple-section {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.srs-section-card {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.srs-section-item-text {
|
||||
display: block;
|
||||
overflow: visible;
|
||||
-webkit-line-clamp: initial;
|
||||
}
|
||||
}
|
||||
|
||||
@container (max-width: 560px) {
|
||||
@media (max-width: 560px) {
|
||||
.omni-script-review-showcase {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.srs-flow-card {
|
||||
grid-template-columns: 1fr;
|
||||
justify-items: stretch;
|
||||
@@ -867,45 +769,4 @@
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.srs-score-tags {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.srs-score-tag {
|
||||
min-height: 24px;
|
||||
padding-inline: 9px;
|
||||
}
|
||||
|
||||
.srs-chart-col {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.srs-chart-bar-wrap,
|
||||
.srs-chart-col-label {
|
||||
grid-column: 1;
|
||||
grid-row: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1120px) {
|
||||
.omni-script-review-showcase {
|
||||
grid-template-columns: 1fr;
|
||||
gap: clamp(16px, 2.8vw, 24px);
|
||||
overflow-y: visible;
|
||||
padding: clamp(20px, 3vw, 34px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 880px) {
|
||||
.omni-script-review-showcase {
|
||||
padding: clamp(16px, 3.8vw, 24px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 560px) {
|
||||
.omni-script-review-showcase {
|
||||
padding: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -889,252 +889,3 @@
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* ===== Home toolbox polish and responsive hardening ===== */
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-page {
|
||||
--toolbox-radius-card: 16px;
|
||||
--toolbox-radius-inner: 12px;
|
||||
background:
|
||||
linear-gradient(180deg, #070b10 0%, #05080d 100%),
|
||||
radial-gradient(ellipse 70% 48% at 58% 42%, rgba(0, 255, 136, 0.045) 0%, transparent 70%);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-shell {
|
||||
width: min(100%, 1440px);
|
||||
margin-inline: auto;
|
||||
padding: clamp(34px, 5vw, 64px) clamp(18px, 5vw, 72px);
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-left {
|
||||
width: clamp(300px, 28vw, 420px);
|
||||
gap: 14px;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-brand-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 13px;
|
||||
box-shadow: 0 16px 32px rgba(0, 255, 136, 0.12);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-brand-icon .anticon {
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-brand-text {
|
||||
font-size: clamp(24px, 2.3vw, 32px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-title {
|
||||
color: #f7fff9;
|
||||
background: none;
|
||||
-webkit-text-fill-color: currentColor;
|
||||
font-size: clamp(32px, 3.4vw, 46px);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-subtitle {
|
||||
color: rgba(232, 238, 236, 0.68);
|
||||
font-size: clamp(15px, 1.18vw, 17px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item,
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow,
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card {
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028)),
|
||||
rgba(10, 15, 16, 0.78);
|
||||
box-shadow:
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.075),
|
||||
0 18px 42px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item {
|
||||
border-radius: 14px;
|
||||
padding: 14px 16px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item:hover {
|
||||
border-color: rgba(0, 255, 136, 0.24);
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: 11px;
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item-name {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item-desc {
|
||||
font-size: 13px;
|
||||
color: rgba(232, 238, 236, 0.48);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow {
|
||||
margin-top: 4px;
|
||||
border-radius: 14px;
|
||||
padding: 15px 17px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow-label {
|
||||
margin-bottom: 10px;
|
||||
font-size: 12px;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow-steps {
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-grid {
|
||||
gap: 14px;
|
||||
min-height: clamp(500px, 48vw, 680px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card {
|
||||
border-radius: var(--toolbox-radius-card);
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card:hover {
|
||||
transform: translateY(-4px);
|
||||
border-color: rgba(0, 255, 136, 0.24);
|
||||
box-shadow:
|
||||
0 22px 54px rgba(0, 0, 0, 0.28),
|
||||
0 0 0 1px rgba(0, 255, 136, 0.07);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-header {
|
||||
padding: 15px 16px 0;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-content {
|
||||
padding: 10px 16px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-footer {
|
||||
padding: 7px 16px 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] :is(.toolbox-card1-side, .toolbox-card3-side, .toolbox-card4-side),
|
||||
.web-shell[data-view="home"] :is(.toolbox-card1-img, .toolbox-card3-portrait, .toolbox-card4-img),
|
||||
.web-shell[data-view="home"] .toolbox-card2-frame {
|
||||
border-radius: var(--toolbox-radius-inner);
|
||||
}
|
||||
|
||||
@media (max-width: 1160px) {
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-shell {
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-left {
|
||||
width: clamp(280px, 32vw, 360px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-grid {
|
||||
min-height: clamp(460px, 58vw, 620px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-page {
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-shell {
|
||||
min-height: auto;
|
||||
padding-block: clamp(42px, 7vw, 64px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-left {
|
||||
width: min(100%, 760px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card {
|
||||
min-height: clamp(230px, 34vw, 300px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 680px) {
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-shell {
|
||||
padding-inline: 14px;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-brand-icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-brand-text {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-title {
|
||||
font-size: clamp(26px, 7vw, 34px);
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-list,
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-item {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card {
|
||||
min-height: 236px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-header {
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-tag {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow-steps {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-workflow-arrow {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card {
|
||||
min-height: 220px;
|
||||
}
|
||||
|
||||
.web-shell[data-view="home"] .omni-home__toolbox-card-footer {
|
||||
gap: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,10 +144,6 @@
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
@@ -174,15 +170,10 @@
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__panel {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
top: calc(100% + 12px);
|
||||
right: -88px;
|
||||
z-index: 1200;
|
||||
width: min(420px, calc(100vw - 24px));
|
||||
height: auto;
|
||||
max-height: min(460px, calc(100dvh - 84px));
|
||||
max-height: min(560px, calc(100vh - 92px));
|
||||
border: 1px solid var(--dg-line);
|
||||
border-radius: 16px;
|
||||
background: #151719;
|
||||
@@ -240,12 +231,9 @@
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__list {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
max-height: min(386px, calc(100dvh - 158px));
|
||||
max-height: min(486px, calc(100vh - 158px));
|
||||
padding: 8px;
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__item {
|
||||
@@ -10478,21 +10466,6 @@
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__panel {
|
||||
right: clamp(-112px, -24vw, -92px);
|
||||
width: min(360px, calc(100vw - 20px));
|
||||
max-height: min(420px, calc(100dvh - 76px));
|
||||
border-radius: 14px;
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__panel::before {
|
||||
right: clamp(104px, 25vw, 124px);
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] .notification-center__list {
|
||||
max-height: min(344px, calc(100dvh - 150px));
|
||||
}
|
||||
|
||||
.web-shell[data-ui-theme="dark-green"] :is(.creator-button, .member-button) {
|
||||
height: 32px;
|
||||
padding: 0 10px;
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
type TestFn = () => unknown | Promise<unknown>;
|
||||
|
||||
interface TestCase {
|
||||
name: string;
|
||||
run: TestFn;
|
||||
afterEachFns: TestFn[];
|
||||
}
|
||||
|
||||
const tests: TestCase[] = [];
|
||||
const suiteStack: string[] = [];
|
||||
const afterEachStack: TestFn[][] = [[]];
|
||||
|
||||
function formatValue(value: unknown): string {
|
||||
return typeof value === "string" ? `"${value}"` : JSON.stringify(value);
|
||||
}
|
||||
|
||||
function fail(message: string): never {
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
function assertThrows(
|
||||
actual: unknown,
|
||||
expectedMessage?: string,
|
||||
inverted = false,
|
||||
): void {
|
||||
if (typeof actual !== "function") {
|
||||
fail("Expected value to be a function");
|
||||
}
|
||||
|
||||
let thrown: unknown;
|
||||
try {
|
||||
actual();
|
||||
} catch (error) {
|
||||
thrown = error;
|
||||
}
|
||||
|
||||
if (inverted) {
|
||||
if (thrown)
|
||||
fail(
|
||||
`Expected function not to throw, but it threw ${thrown instanceof Error ? thrown.message : String(thrown)}`,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!thrown) fail("Expected function to throw");
|
||||
if (expectedMessage) {
|
||||
const message = thrown instanceof Error ? thrown.message : String(thrown);
|
||||
if (!message.includes(expectedMessage)) {
|
||||
fail(
|
||||
`Expected thrown message to include "${expectedMessage}", got "${message}"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function describe(name: string, run: () => void): void {
|
||||
suiteStack.push(name);
|
||||
afterEachStack.push([]);
|
||||
try {
|
||||
run();
|
||||
} finally {
|
||||
afterEachStack.pop();
|
||||
suiteStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
export function it(name: string, run: TestFn): void {
|
||||
tests.push({
|
||||
name: [...suiteStack, name].join(" > "),
|
||||
run,
|
||||
afterEachFns: afterEachStack.flat(),
|
||||
});
|
||||
}
|
||||
|
||||
export function afterEach(run: TestFn): void {
|
||||
afterEachStack[afterEachStack.length - 1].push(run);
|
||||
}
|
||||
|
||||
export function expect(actual: unknown) {
|
||||
return {
|
||||
toBe(expected: unknown): void {
|
||||
if (!Object.is(actual, expected)) {
|
||||
fail(`Expected ${formatValue(actual)} to be ${formatValue(expected)}`);
|
||||
}
|
||||
},
|
||||
toEqual(expected: unknown): void {
|
||||
const actualJson = JSON.stringify(actual);
|
||||
const expectedJson = JSON.stringify(expected);
|
||||
if (actualJson !== expectedJson) {
|
||||
fail(`Expected ${actualJson} to equal ${expectedJson}`);
|
||||
}
|
||||
},
|
||||
toThrow(expectedMessage?: string): void {
|
||||
assertThrows(actual, expectedMessage);
|
||||
},
|
||||
not: {
|
||||
toThrow(): void {
|
||||
assertThrows(actual, undefined, true);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function runRegisteredTests(): Promise<{
|
||||
passed: number;
|
||||
failed: number;
|
||||
total: number;
|
||||
}> {
|
||||
let passed = 0;
|
||||
let failed = 0;
|
||||
|
||||
for (const test of tests) {
|
||||
let failure: unknown;
|
||||
try {
|
||||
await test.run();
|
||||
} catch (error) {
|
||||
failure = error;
|
||||
}
|
||||
|
||||
for (const hook of [...test.afterEachFns].reverse()) {
|
||||
try {
|
||||
await hook();
|
||||
} catch (error) {
|
||||
failure = failure || error;
|
||||
}
|
||||
}
|
||||
|
||||
if (failure) {
|
||||
failed += 1;
|
||||
console.error(`FAIL ${test.name}`);
|
||||
console.error(
|
||||
failure instanceof Error
|
||||
? ` ${failure.message}`
|
||||
: ` ${String(failure)}`,
|
||||
);
|
||||
} else {
|
||||
passed += 1;
|
||||
console.log(`PASS ${test.name}`);
|
||||
}
|
||||
}
|
||||
|
||||
const total = passed + failed;
|
||||
if (total === 0) {
|
||||
console.error("No unit tests were registered.");
|
||||
return { passed, failed: 1, total };
|
||||
}
|
||||
|
||||
console.log(`\n${passed} passed, ${failed} failed`);
|
||||
return { passed, failed, total };
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export * from "../testHarness";
|
||||
@@ -0,0 +1,48 @@
|
||||
import { describe, expect, it } from "../test/testHarness";
|
||||
|
||||
import {
|
||||
calculateEnterpriseVideoCredits,
|
||||
getEnterpriseVideoCreditRate,
|
||||
normalizeEnterpriseResolution,
|
||||
} from "./enterpriseVideoPolicy";
|
||||
|
||||
describe("enterpriseVideoPolicy", () => {
|
||||
it("keeps video billing at 1 CNY to 100 credits", () => {
|
||||
expect(
|
||||
calculateEnterpriseVideoCredits({
|
||||
model: "happyhorse-1.0",
|
||||
resolution: "1080P",
|
||||
durationSeconds: 5,
|
||||
}),
|
||||
).toBe(640);
|
||||
|
||||
expect(
|
||||
calculateEnterpriseVideoCredits({
|
||||
model: "wan2.7-i2v",
|
||||
resolution: "720P",
|
||||
durationSeconds: 5,
|
||||
}),
|
||||
).toBe(300);
|
||||
});
|
||||
|
||||
it("rounds duration up to the next second before billing", () => {
|
||||
expect(
|
||||
calculateEnterpriseVideoCredits({
|
||||
model: "vidu-q3-turbo",
|
||||
resolution: "1080P",
|
||||
durationSeconds: 5.2,
|
||||
}),
|
||||
).toBe(600);
|
||||
});
|
||||
|
||||
it("normalizes unsupported resolutions to 1080P", () => {
|
||||
expect(normalizeEnterpriseResolution("4K")).toBe("1080P");
|
||||
expect(
|
||||
getEnterpriseVideoCreditRate({
|
||||
model: "pixverse-c1",
|
||||
resolution: "4K",
|
||||
durationSeconds: 5,
|
||||
}),
|
||||
).toBe(1);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,59 @@
|
||||
import { describe, expect, it } from "../test/testHarness";
|
||||
|
||||
import {
|
||||
TEXT_INPUT_CREDITS_PER_MILLION,
|
||||
TEXT_OUTPUT_CREDITS_PER_MILLION,
|
||||
estimateTextTokenCredits,
|
||||
getTaskTimeoutPolicy,
|
||||
isTaskLocallyTimedOut,
|
||||
} from "./taskLifecycle";
|
||||
|
||||
describe("taskLifecycle", () => {
|
||||
it("keeps text token billing at 1 CNY to 100 credits", () => {
|
||||
expect(TEXT_INPUT_CREDITS_PER_MILLION).toBe(200);
|
||||
expect(TEXT_OUTPUT_CREDITS_PER_MILLION).toBe(500);
|
||||
expect(
|
||||
estimateTextTokenCredits({
|
||||
promptTokens: 1_000_000,
|
||||
completionTokens: 1_000_000,
|
||||
}),
|
||||
).toBe(700);
|
||||
});
|
||||
|
||||
it("ignores negative token counts when estimating text billing", () => {
|
||||
expect(
|
||||
estimateTextTokenCredits({
|
||||
promptTokens: -100,
|
||||
completionTokens: 500_000,
|
||||
}),
|
||||
).toBe(250);
|
||||
});
|
||||
|
||||
it("marks unstarted tasks locally timed out after submit timeout", () => {
|
||||
const policy = getTaskTimeoutPolicy({ kind: "image" });
|
||||
|
||||
expect(
|
||||
isTaskLocallyTimedOut({
|
||||
startedAt: 1_000,
|
||||
lastProgressAt: 1_000,
|
||||
now: 1_000 + policy.submitTimeoutMs,
|
||||
policy,
|
||||
progress: 0,
|
||||
}),
|
||||
).toBe("no_progress");
|
||||
});
|
||||
|
||||
it("marks running tasks locally timed out when progress stops", () => {
|
||||
const policy = getTaskTimeoutPolicy({ kind: "video", model: "wan2.7-i2v" });
|
||||
|
||||
expect(
|
||||
isTaskLocallyTimedOut({
|
||||
startedAt: 1_000,
|
||||
lastProgressAt: 2_000,
|
||||
now: 2_000 + policy.noProgressTimeoutMs,
|
||||
policy,
|
||||
progress: 40,
|
||||
}),
|
||||
).toBe("no_progress");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user