mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-11 20:32:12 +00:00
revert frontend changes
This commit is contained in:
1 parent
3b71ee75d4
commit
3b90d80946
8 files changed
+40
-73
No files matched your search
@@ -2,6 +2,3 @@
|
||||
# Get the Client ID from the Google Cloud Console:
|
||||
# https://console.cloud.google.com/apis/credentials
|
||||
VITE_GOOGLE_CLIENT_ID=YOUR_CLIENT_ID.apps.googleusercontent.com
|
||||
|
||||
# API backend host. Defaults to https://api.storyteller.ai if unset.
|
||||
# VITE_API_HOST=http://localhost:12345
|
||||
@@ -17,8 +17,8 @@ import { TaskQueue } from "./task-queue";
|
||||
|
||||
const NAV_ITEMS = [
|
||||
{ name: "Home", href: "/" },
|
||||
{ name: "Image", href: "/create-image" },
|
||||
{ name: "Video", href: "/create-video" },
|
||||
// { name: "Image", href: "/create-image" },
|
||||
// { name: "Video", href: "/create-video" },
|
||||
{ name: "Tutorials", href: "/tutorials" },
|
||||
{ name: "News", href: "/news" },
|
||||
{ name: "FAQ", href: "/faq" },
|
||||
|
||||
@@ -11,16 +11,15 @@ const root = ReactDOM.createRoot(
|
||||
document.getElementById("root") as HTMLElement,
|
||||
);
|
||||
|
||||
// In development, route API through the Vite dev server proxy to avoid CORS,
|
||||
// unless VITE_API_HOST is explicitly set (eg. for an unsafe browser that ignores CORS).
|
||||
//if (import.meta.env.DEV && !import.meta.env.VITE_API_HOST) {
|
||||
// try {
|
||||
// const origin = window.location.origin;
|
||||
// StorytellerApiHostStore.getInstance().setApiSchemeAndHost(origin);
|
||||
// } catch (e) {
|
||||
// console.warn("Failed to set dev API host override", e);
|
||||
// }
|
||||
//}
|
||||
// In development, route API through the Vite dev server origin to avoid CORS
|
||||
if (import.meta.env.DEV) {
|
||||
try {
|
||||
const origin = window.location.origin;
|
||||
StorytellerApiHostStore.getInstance().setApiSchemeAndHost(origin);
|
||||
} catch (e) {
|
||||
console.warn("Failed to set dev API host override", e);
|
||||
}
|
||||
}
|
||||
|
||||
// Cache the referrer immediately — it can change or disappear on navigation.
|
||||
// Only set once so subsequent in-site navigations don't overwrite the original.
|
||||
|
||||
@@ -26,9 +26,7 @@ export class ApiManager {
|
||||
}
|
||||
|
||||
protected getApiSchemeAndHost(): string {
|
||||
const host = StorytellerApiHostStore.getInstance().getApiSchemeAndHost();
|
||||
console.log('getSchemaAndHost()', host);
|
||||
return host;
|
||||
return StorytellerApiHostStore.getInstance().getApiSchemeAndHost();
|
||||
}
|
||||
|
||||
public async fetch<B, T>(
|
||||
|
||||
@@ -176,10 +176,8 @@ export class OmniGenApi extends ApiManager {
|
||||
provider?: string,
|
||||
): Promise<OmniGenImageModelsResponse> {
|
||||
const query = provider ? { provider } : undefined;
|
||||
const host = this.getApiSchemeAndHost();
|
||||
console.log('getImageModels() - host', host);
|
||||
return this.get<OmniGenImageModelsResponse>({
|
||||
endpoint: `${host}/v1/omni_gen/models/image`,
|
||||
endpoint: `${this.getApiSchemeAndHost()}/v1/omni_gen/models/image`,
|
||||
query,
|
||||
});
|
||||
}
|
||||
@@ -219,10 +217,8 @@ export class OmniGenApi extends ApiManager {
|
||||
public async generateImage(
|
||||
body: OmniGenImageRequest,
|
||||
): Promise<OmniGenImageGenerateResponse> {
|
||||
const host = this.getApiSchemeAndHost();
|
||||
console.log('generateImage() - host', host);
|
||||
return this.post<Record<string, unknown>, OmniGenImageGenerateResponse>({
|
||||
endpoint: `${host}/v1/omni_gen/generate/image`,
|
||||
endpoint: `${this.getApiSchemeAndHost()}/v1/omni_gen/generate/image`,
|
||||
body: stripNulls(body),
|
||||
});
|
||||
}
|
||||
@@ -230,10 +226,8 @@ export class OmniGenApi extends ApiManager {
|
||||
public async generateVideo(
|
||||
body: OmniGenVideoRequest,
|
||||
): Promise<OmniGenVideoGenerateResponse> {
|
||||
const host = this.getApiSchemeAndHost();
|
||||
console.log('generateVideo() - host', host);
|
||||
return this.post<Record<string, unknown>, OmniGenVideoGenerateResponse>({
|
||||
endpoint: `${host}/v1/omni_gen/generate/video`,
|
||||
endpoint: `${this.getApiSchemeAndHost()}/v1/omni_gen/generate/video`,
|
||||
body: stripNulls(body),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
// Artcraft / Storyteller API backend
|
||||
// Set VITE_API_HOST=http://localhost:12345 for local dev, or leave unset for production.
|
||||
//const DEFAULT_API_HOST = (import.meta as any).env?.VITE_API_HOST || "https://api.storyteller.ai";
|
||||
|
||||
const DEFAULT_API_HOST = "http://localhost:12345";
|
||||
const DEFAULT_API_HOST = "https://api.storyteller.ai";
|
||||
|
||||
// NB(bt,2025-09-25): 'nx' is creating multiple copies of the library with name
|
||||
// mangling, so the singleton pattern fails to resolve to a single instance.
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "../slider-v2"
|
||||
},
|
||||
{
|
||||
"path": "../button-icon-select"
|
||||
},
|
||||
@@ -17,6 +14,9 @@
|
||||
{
|
||||
"path": "../camera-settings-modal"
|
||||
},
|
||||
{
|
||||
"path": "../toaster"
|
||||
},
|
||||
{
|
||||
"path": "../../tauri-utils"
|
||||
},
|
||||
@@ -26,38 +26,29 @@
|
||||
{
|
||||
"path": "../../model-list"
|
||||
},
|
||||
{
|
||||
"path": "../modal"
|
||||
},
|
||||
{
|
||||
"path": "../popover"
|
||||
},
|
||||
{
|
||||
"path": "../slider-v2"
|
||||
},
|
||||
{
|
||||
"path": "../../common"
|
||||
},
|
||||
{
|
||||
"path": "../tooltip"
|
||||
},
|
||||
{
|
||||
"path": "../action-reminder-modal"
|
||||
},
|
||||
{
|
||||
"path": "../label"
|
||||
},
|
||||
{
|
||||
"path": "../button"
|
||||
},
|
||||
{
|
||||
"path": "../input"
|
||||
"path": "../../api"
|
||||
},
|
||||
{
|
||||
"path": "../gallery-modal"
|
||||
},
|
||||
{
|
||||
"path": "../toaster"
|
||||
"path": "../tooltip"
|
||||
},
|
||||
{
|
||||
"path": "../../api"
|
||||
},
|
||||
{
|
||||
"path": "../modal"
|
||||
"path": "../button"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
|
||||
@@ -43,9 +43,6 @@
|
||||
"src/**/*.tsx"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "../slider-v2/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../button-icon-select/tsconfig.lib.json"
|
||||
},
|
||||
@@ -58,6 +55,9 @@
|
||||
{
|
||||
"path": "../camera-settings-modal/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../toaster/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../tauri-utils/tsconfig.lib.json"
|
||||
},
|
||||
@@ -67,38 +67,29 @@
|
||||
{
|
||||
"path": "../../model-list/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../modal/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../popover/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../slider-v2/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../common/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../tooltip/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../action-reminder-modal/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../label/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../button/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../input/tsconfig.lib.json"
|
||||
"path": "../../api/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../gallery-modal/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../toaster/tsconfig.lib.json"
|
||||
"path": "../tooltip/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../api/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../modal/tsconfig.lib.json"
|
||||
"path": "../button/tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user