Dateien nach "web_app/src/components" hochladen
This commit is contained in:
parent
d9c0250391
commit
35e2c3dd6c
@ -37,32 +37,15 @@ export default function FileSelect(props: FileSelectProps) {
|
|||||||
<div className="absolute flex w-screen h-screen justify-center items-center pointer-events-none">
|
<div className="absolute flex w-screen h-screen justify-center items-center pointer-events-none">
|
||||||
<label
|
<label
|
||||||
htmlFor={uploadElemId}
|
htmlFor={uploadElemId}
|
||||||
className="grid bg-background border-[2px] border-[dashed] rounded-lg min-w-[600px] hover:bg-primary hover:text-primary-foreground pointer-events-auto"
|
className="grid bg-background border-[2px] border-[dashed] rounded-lg min-w-[600px] pointer-events-auto"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="grid p-16 w-full h-full"
|
className="grid p-16 w-full h-full"
|
||||||
onDragOver={(ev) => {
|
|
||||||
ev.stopPropagation()
|
|
||||||
ev.preventDefault()
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<input
|
|
||||||
className="hidden"
|
|
||||||
id={uploadElemId}
|
|
||||||
name={uploadElemId}
|
|
||||||
type="file"
|
|
||||||
onChange={(ev) => {
|
|
||||||
const file = ev.currentTarget.files?.[0]
|
|
||||||
if (file) {
|
|
||||||
onFileSelected(file)
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
accept="image/png, image/jpeg"
|
|
||||||
/>
|
|
||||||
<p className="text-center">
|
<p className="text-center">
|
||||||
{resolution === "desktop"
|
{resolution === "desktop"
|
||||||
? "Click here or drag an image file"
|
? "Sollte das Bild nicht geladen werden, drücken sie die F5-Taste, oder klicken sie rechts oben auf den Button"
|
||||||
: "Tap here to load your picture"}
|
: "Sollte das Bild nicht geladen werden, drücken sie die F5-Taste, oder klicken sie rechts oben auf den Button"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
@ -12,7 +12,6 @@ import { getMediaBlob, getMediaFile } from "@/lib/api"
|
|||||||
import { useStore } from "@/lib/states"
|
import { useStore } from "@/lib/states"
|
||||||
import SettingsDialog from "./Settings"
|
import SettingsDialog from "./Settings"
|
||||||
import { cn, fileToImage } from "@/lib/utils"
|
import { cn, fileToImage } from "@/lib/utils"
|
||||||
import Coffee from "./Coffee"
|
|
||||||
import { useToast } from "./ui/use-toast"
|
import { useToast } from "./ui/use-toast"
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
@ -93,15 +92,6 @@ const Header = () => {
|
|||||||
<></>
|
<></>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ImageUploadButton
|
|
||||||
disabled={isInpainting}
|
|
||||||
tooltip="Upload image"
|
|
||||||
onFileUpload={(file) => {
|
|
||||||
setFile(file)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Image />
|
|
||||||
</ImageUploadButton>
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={cn([
|
className={cn([
|
||||||
@ -175,25 +165,12 @@ const Header = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{file && !model.need_prompt ? (
|
|
||||||
<IconButton
|
|
||||||
disabled={isInpainting}
|
|
||||||
tooltip="Rerun previous mask"
|
|
||||||
onClick={handleRerunLastMask}
|
|
||||||
onMouseEnter={onRerunMouseEnter}
|
|
||||||
onMouseLeave={onRerunMouseLeave}
|
|
||||||
>
|
|
||||||
<RotateCw />
|
|
||||||
</IconButton>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{model.need_prompt ? <PromptInput /> : <></>}
|
{model.need_prompt ? <PromptInput /> : <></>}
|
||||||
|
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<Coffee />
|
|
||||||
<Shortcuts />
|
<Shortcuts />
|
||||||
{serverConfig.disableModelSwitch ? <></> : <SettingsDialog />}
|
{serverConfig.disableModelSwitch ? <></> : <SettingsDialog />}
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,9 +51,6 @@ export function Shortcuts() {
|
|||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={toggleOpen}>
|
<Dialog open={open} onOpenChange={toggleOpen}>
|
||||||
<DialogTrigger asChild>
|
<DialogTrigger asChild>
|
||||||
<IconButton tooltip="Hotkeys">
|
|
||||||
<Keyboard />
|
|
||||||
</IconButton>
|
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
|
Loading…
Reference in New Issue
Block a user