timigogo commited on
Commit
0697321
Β·
verified Β·
1 Parent(s): c9f5425

Upload 391 files

Browse files
Files changed (3) hide show
  1. app/components/sd/sd.tsx +23 -18
  2. app/locales/cn.ts +1 -0
  3. 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
- className={styles["img"]}
167
- src={item.img_data}
168
- alt={item.id}
169
- onClick={(e) =>
170
- showImageModal(
171
- item.img_data,
172
- true,
173
- isMobileScreen
174
- ? { width: "100%", height: "fit-content" }
175
- : { maxWidth: "100%", maxHeight: "100%" },
176
- isMobileScreen
177
- ? { width: "100%", height: "fit-content" }
178
- : { width: "100%", height: "100%" },
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: {