添加全能创作功能
This commit is contained in:
@@ -31,6 +31,9 @@ import {
|
||||
Dashboard,
|
||||
FreeCreatePage,
|
||||
QuickCreatePage,
|
||||
OmniCreatePage,
|
||||
OmniHistoryPage,
|
||||
OmniSessionPage,
|
||||
VideoRemixPage,
|
||||
VideoReplacePage,
|
||||
ImageWorkbenchPage,
|
||||
@@ -544,7 +547,8 @@ export function App() {
|
||||
if (options.projectId !== undefined) setActiveProjectId(options.projectId);
|
||||
const hash = options.hash?.replace(/^#/, "");
|
||||
const currentPath = `${window.location.pathname}${window.location.hash}`;
|
||||
const path = `${pathForPage(next, { productId, projectId })}${hash ? `#${hash}` : ""}`;
|
||||
const conversationId = options.conversationId ?? route.conversationId;
|
||||
const path = `${pathForPage(next, { productId, projectId, conversationId })}${hash ? `#${hash}` : ""}`;
|
||||
const prevState = readNavState(window.history.state);
|
||||
const leaving: NavHistoryState = {
|
||||
airshelf: 1,
|
||||
@@ -555,7 +559,10 @@ export function App() {
|
||||
if (!options.replace) {
|
||||
window.history.replaceState(leaving, "", currentPath);
|
||||
}
|
||||
setRoute({ page: next, authMode, productId, projectId, hash, tab: options.tab });
|
||||
setRoute({
|
||||
page: next, authMode, productId, projectId, conversationId, hash,
|
||||
tab: options.tab, firstMessage: options.firstMessage, firstRefs: options.firstRefs,
|
||||
});
|
||||
const arriving: NavHistoryState = {
|
||||
airshelf: 1,
|
||||
scrollY: 0,
|
||||
@@ -1065,6 +1072,22 @@ export function App() {
|
||||
navigate={navigate}
|
||||
/>
|
||||
);
|
||||
case "omniCreate":
|
||||
return <OmniCreatePage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />;
|
||||
case "omniHistory":
|
||||
return <OmniHistoryPage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />;
|
||||
case "omniSession":
|
||||
return route.conversationId ? (
|
||||
<OmniSessionPage
|
||||
conversationId={route.conversationId}
|
||||
firstMessage={route.firstMessage}
|
||||
firstRefs={route.firstRefs}
|
||||
navigate={navigate}
|
||||
onNotify={(type, text) => setNotice({ type, text })}
|
||||
/>
|
||||
) : (
|
||||
<OmniHistoryPage navigate={navigate} onNotify={(type, text) => setNotice({ type, text })} />
|
||||
);
|
||||
case "assetFactory":
|
||||
return <AssetFactoryPage navigate={navigate} />;
|
||||
case "freeCreate":
|
||||
@@ -1252,13 +1275,19 @@ export function App() {
|
||||
<div className="app">
|
||||
<Sidebar page={page} navigate={navigate} user={currentUser} team={currentTeam} canManageBilling={isOwner} products={products} projects={projects} productTotal={productTotal} projectTotal={projectTotal} aiUnread={aiUnread} onOpenAdmin={() => navigateAdmin("")} accountOpen={accountAnchor !== null} onOpenAccount={(rect) => setAccountAnchor((prev) => (prev ? null : rect))} />
|
||||
<header className="topbar">
|
||||
<ModeTabs active={topModule} navigate={navigate} />
|
||||
{page === "omniSession" ? (
|
||||
<div id="omni-session-topbar-slot" className="omni-session-topbar-slot" />
|
||||
) : (
|
||||
<ModeTabs active={topModule} navigate={navigate} />
|
||||
)}
|
||||
<div className="right">
|
||||
{page !== "omniSession" && (
|
||||
<button className="top-search" type="button" onClick={() => openCommandPalette()} aria-label="搜索">
|
||||
<IconKitSvg name="search" />
|
||||
<span>搜索</span>
|
||||
<span className="kbd">{searchKbd}</span>
|
||||
</button>
|
||||
)}
|
||||
<span className="balance-chip" onClick={() => navigate("account")}>
|
||||
<IconKitSvg name="creditCard" />
|
||||
余额 <strong>{money(billing?.account.balance)}</strong>
|
||||
|
||||
Reference in New Issue
Block a user