mirror of
https://github.com/barthuijgen/factorio-sites.git
synced 2024-11-21 18:16:33 +02:00
Use storage url directly for render, instead of api
This commit is contained in:
parent
0f325bb2fd
commit
d409d5e7df
@ -153,6 +153,7 @@ export const BlueprintSubPage: React.FC<BlueprintProps> = ({
|
||||
string={string}
|
||||
label={blueprint.label || ""}
|
||||
blueprint_hash={blueprint.blueprint_hash}
|
||||
image_hash={blueprint.image_hash}
|
||||
onSetRenderer={setRenderer}
|
||||
/>
|
||||
)}
|
||||
|
@ -226,6 +226,7 @@ export const BlueprintBookSubPage: React.FC<BlueprintBookSubPageProps> = ({
|
||||
string={selectedBlueprintString}
|
||||
label={selected.data.label || ""}
|
||||
blueprint_hash={selected.data.blueprint_hash}
|
||||
image_hash={selected.type === "blueprint" ? selected.data.image_hash : undefined}
|
||||
onSetRenderer={setRenderer}
|
||||
/>
|
||||
)}
|
||||
|
@ -9,6 +9,7 @@ export type RENDERERS = "fbe" | "fbsr";
|
||||
interface BlueprintImageProps {
|
||||
string: string;
|
||||
blueprint_hash: string;
|
||||
image_hash?: string;
|
||||
label: string;
|
||||
onSetRenderer?: (renderer: RENDERERS) => void;
|
||||
}
|
||||
@ -16,6 +17,7 @@ interface BlueprintImageProps {
|
||||
export const BlueprintImage: React.FC<BlueprintImageProps> = ({
|
||||
string,
|
||||
blueprint_hash,
|
||||
image_hash,
|
||||
label,
|
||||
onSetRenderer,
|
||||
}) => {
|
||||
@ -37,11 +39,12 @@ export const BlueprintImage: React.FC<BlueprintImageProps> = ({
|
||||
|
||||
return renderer === "fbe" ? (
|
||||
<ImageEditor string={string} onError={() => setRenderer("fbsr")}></ImageEditor>
|
||||
) : (
|
||||
) : image_hash ? (
|
||||
<FullscreenImage
|
||||
// src={`https://fbsr.factorio.workers.dev/${blueprint_hash}?size=1000`}
|
||||
src={`https://render.factorio.tools/render?url=https://factorioblueprints.tech/api/string/${blueprint_hash}`}
|
||||
// src={`https://render.factorio.tools/render?url=https://factorioblueprints.tech/api/string/${blueprint_hash}`}
|
||||
src={`https://storage.factorio.tools/factorio-blueprint-images/render/${image_hash}.webp`}
|
||||
alt={label}
|
||||
/>
|
||||
);
|
||||
) : null;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user