Spaces:
Paused
Paused
Upload 391 files
Browse files- app/components/sd/sd.tsx +23 -18
- app/locales/cn.ts +1 -0
- app/locales/en.ts +1 -0
app/components/sd/sd.tsx
CHANGED
|
@@ -37,6 +37,7 @@ import { SideBar } from "./sd-sidebar";
|
|
| 37 |
import { WindowContent } from "@/app/components/home";
|
| 38 |
import { params } from "./sd-panel";
|
| 39 |
import clsx from "clsx";
|
|
|
|
| 40 |
|
| 41 |
function getSdTaskStatus(item: any) {
|
| 42 |
let s: string;
|
|
@@ -101,7 +102,7 @@ export function Sd() {
|
|
| 101 |
|
| 102 |
useEffect(() => {
|
| 103 |
setSdImages(sdStore.draw);
|
| 104 |
-
}, [sdStore.currentId]);
|
| 105 |
|
| 106 |
return (
|
| 107 |
<>
|
|
@@ -162,23 +163,27 @@ export function Sd() {
|
|
| 162 |
className={styles["sd-img-item"]}
|
| 163 |
>
|
| 164 |
{item.status === "success" ? (
|
| 165 |
-
<img
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
) : item.status === "error" ? (
|
| 183 |
<div className={styles["pre-img"]}>
|
| 184 |
<ErrorIcon />
|
|
|
|
| 37 |
import { WindowContent } from "@/app/components/home";
|
| 38 |
import { params } from "./sd-panel";
|
| 39 |
import clsx from "clsx";
|
| 40 |
+
import Image from "next/image";
|
| 41 |
|
| 42 |
function getSdTaskStatus(item: any) {
|
| 43 |
let s: string;
|
|
|
|
| 102 |
|
| 103 |
useEffect(() => {
|
| 104 |
setSdImages(sdStore.draw);
|
| 105 |
+
}, [sdStore.currentId, sdStore.draw]);
|
| 106 |
|
| 107 |
return (
|
| 108 |
<>
|
|
|
|
| 163 |
className={styles["sd-img-item"]}
|
| 164 |
>
|
| 165 |
{item.status === "success" ? (
|
| 166 |
+
<div style={{ position: 'relative', width: '100%', height: '100%' }} className={styles["img-container"]}>
|
| 167 |
+
<Image
|
| 168 |
+
className={styles["img"]}
|
| 169 |
+
src={item.img_data}
|
| 170 |
+
alt={item.id}
|
| 171 |
+
layout="fill"
|
| 172 |
+
objectFit="contain"
|
| 173 |
+
onClick={(e) =>
|
| 174 |
+
showImageModal(
|
| 175 |
+
item.img_data,
|
| 176 |
+
true,
|
| 177 |
+
isMobileScreen
|
| 178 |
+
? { width: "100%", height: "fit-content" }
|
| 179 |
+
: { maxWidth: "100%", maxHeight: "100%" },
|
| 180 |
+
isMobileScreen
|
| 181 |
+
? { width: "100%", height: "fit-content" }
|
| 182 |
+
: { width: "100%", height: "100%" },
|
| 183 |
+
)
|
| 184 |
+
}
|
| 185 |
+
/>
|
| 186 |
+
</div>
|
| 187 |
) : item.status === "error" ? (
|
| 188 |
<div className={styles["pre-img"]}>
|
| 189 |
<ErrorIcon />
|
app/locales/cn.ts
CHANGED
|
@@ -541,6 +541,7 @@ const cn = {
|
|
| 541 |
Fetch: "θ·ε樑εε葨",
|
| 542 |
Success: "ζεθ·εε葨γ",
|
| 543 |
NoModels: "ζͺζΎε°ζ¨‘εγ",
|
|
|
|
| 544 |
},
|
| 545 |
},
|
| 546 |
|
|
|
|
| 541 |
Fetch: "θ·ε樑εε葨",
|
| 542 |
Success: "ζεθ·εε葨γ",
|
| 543 |
NoModels: "ζͺζΎε°ζ¨‘εγ",
|
| 544 |
+
Failed: "θ·ε樑εε葨倱θ΄₯γ",
|
| 545 |
},
|
| 546 |
},
|
| 547 |
|
app/locales/en.ts
CHANGED
|
@@ -525,6 +525,7 @@ const en: LocaleType = {
|
|
| 525 |
Fetch: "Fetch Models",
|
| 526 |
Success: "Fetched successfully.",
|
| 527 |
NoModels: "No models found.",
|
|
|
|
| 528 |
},
|
| 529 |
Google: {
|
| 530 |
ApiKey: {
|
|
|
|
| 525 |
Fetch: "Fetch Models",
|
| 526 |
Success: "Fetched successfully.",
|
| 527 |
NoModels: "No models found.",
|
| 528 |
+
Failed: "Failed to fetch models.",
|
| 529 |
},
|
| 530 |
Google: {
|
| 531 |
ApiKey: {
|