Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'main' of https://github.com/Dungeon-MASSters/MASSter in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
blazinghorizon committed Oct 14, 2023
2 parents 5b5d62d + a6922af commit c30a743
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion frontend/MASSter-frontend/src/lib/pb-client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PocketBase from "pocketbase";

export const pb = new PocketBase("https://pb.apps.npcode.xyz");
export const pb = new PocketBase("https://pb.apps.npod.space");
// pb.autoCancellation(false);


7 changes: 5 additions & 2 deletions frontend/MASSter-frontend/src/pages/add-prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export function AddAdvancedPromptCard() {
.refine(
(files) => ACCEPTED_VIDEO_TYPES.includes(files.type),
"Пока мы поддерживаем только .mp4 видеоролики :("
),
)
.optional(),
numImages: z.coerce.number().min(1).max(10)
});

Expand All @@ -193,7 +194,9 @@ export function AddAdvancedPromptCard() {
for (let file in data.inputImage) {
formData.append("input_image", file);
}
formData.append("video", data.video);
if (data.video) {
formData.append("video", data.video);
}
formData.append("status", "open");
formData.append("num_images", `${data.numImages}`);
pb.collection("text_generation_mvp")
Expand Down
9 changes: 8 additions & 1 deletion frontend/MASSter-frontend/src/pages/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,21 @@ function GridCard({item}: {item: RecordModel}) {
}
);

let coverMsg = undefined;
if (item.status != "generated") {
coverMsg = <div className="rounded-lg absolute h-full w-full bg-black
bg-opacity-30 flex items-center justify-center text-white">Обработка</div>
}

let elem = <IconLoader3 className="animate-spin"></IconLoader3>;
if (fileQuery.isSuccess) {
if (fileQuery.isSuccess && item.status == "generated") {
elem = <img className="rounded-lg h-52 w-full object-cover"
src={fileQuery.data.length == 0 ? imgPlaceholder : fileQuery.data}></img>
};

return (
<Card className="w-full relative">
{coverMsg}
<CardContent className="p-0">{elem}</CardContent>
<CardFooter className="rounded-lg flex w-full justify-between
absolute bottom-0 bg-gradient-to-b from-transparent to-black pt-8">
Expand Down

0 comments on commit c30a743

Please sign in to comment.