Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/client/pages/common/TaskList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { TaskItemDeleteButton } from './components/TaskItemDeleteButton'
import { TaskItemDownloadButton } from './components/TaskItemDownloadButton'
import { TaskItemTags } from './components/TaskItemTags'
import { TaskListHeader } from './TaskListHeader'

import { useState } from 'react'
const client = hc<AppType>('/')

Expand All @@ -30,6 +29,7 @@ export function TaskList() {
{ defaultValue: [] },
)


const handleRetry = async (task: Task) => {
await client.api.gptImage.generate.$post({
json: {
Expand Down Expand Up @@ -137,15 +137,15 @@ export function TaskList() {

<div className="flex items-center justify-end">
<div className="flex items-center gap-1">
{task.rawTemplate && (
{task.rawTemplate && task.taskType !== 'edit' && (
<Tooltip title="重新填入">
<Button type="text" icon={<VerticalAlignTopOutlined />} onClick={() => { useGlobalStore.getState().setFillTemplateData(task.rawTemplate); message.success('已重新填入表单') }} />
</Tooltip>
)}
{task.outputUrls && task.outputUrls.length > 0 && (
<TaskItemDownloadButton outputUrls={task.outputUrls} fileName={task.rawTemplate?.title || task.rawTemplate?.prompt || `task_${task.id}`} onDownloaded={() => { if (!downloadedIds?.includes(task.id)) { setDownloadedIds([...(downloadedIds || []), task.id]) } }} />
)}
{task.rawTemplate?.title !== TRIAL_TEMPLATE_TITLE && (
{task.taskType !== 'edit' && task.rawTemplate?.title !== TRIAL_TEMPLATE_TITLE && (
<Tooltip title="重试">
<Button type="text" icon={<RedoOutlined />} onClick={() => handleRetry(task)} />
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const TemplateItemGenerateButtons: React.FC<{
const { gptImageSettings } = useLocalSetting()
const gptImageApiKey = useGlobalStore((state) => state.gptImageApiKey)


const doGenerate = async (templateId: string, size: GptImageSize) => {
try {
const res = await client.api.gptImage.generate.$post({
Expand Down Expand Up @@ -78,6 +79,7 @@ export const TemplateItemGenerateButtons: React.FC<{
</Tooltip>
),
)}

</>
)
}
Expand Down
9 changes: 6 additions & 3 deletions src/client/pages/common/components/Gallery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function GalleryModal({ visible, onClose, onSelect }: GalleryModalProps) {
const [images, setImages] = useState<ImageItem[]>([])
const [loading, setLoading] = useState(false)
const [selectedUrls, setSelectedUrls] = useState<string[]>([])

const { recentImages } = useRecentImages()
const { data: templates = [], loading: templatesLoading } = useTemplates()
const { data: tasks = [], loading: tasksLoading } = useTasks()
Expand Down Expand Up @@ -219,7 +220,7 @@ function GalleryModal({ visible, onClose, onSelect }: GalleryModalProps) {
return (
<div
key={`${url}-${i}`}
className={`relative aspect-square cursor-pointer overflow-hidden rounded-lg border-2 bg-slate-100 transition-all ${
className={`group relative aspect-square cursor-pointer overflow-hidden rounded-lg border-2 bg-slate-100 transition-all ${
selected
? 'border-blue-500 shadow-[0_0_0_2px_rgba(59,130,246,0.15)]'
: 'border-transparent hover:border-blue-500'
Expand All @@ -234,11 +235,13 @@ function GalleryModal({ visible, onClose, onSelect }: GalleryModalProps) {
/>
{referencesReady &&
imageByUrl.get(url)?.isReferenced === false && (
<div className="absolute top-1 left-1 z-10 rounded bg-red-500 px-2 py-0.5 text-xs text-white shadow-sm">
<div className="absolute left-1 top-1 z-10 rounded bg-red-500 px-2 py-0.5 text-xs text-white shadow-sm">
无引用
</div>
)}
{/* Edit button — appears on hover */}
<div

className={`absolute inset-0 flex items-center justify-center transition-colors ${
selected ? 'bg-blue-500/45' : 'bg-black/0 hover:bg-black/5'
}`}
Expand Down Expand Up @@ -275,7 +278,7 @@ function GalleryModal({ visible, onClose, onSelect }: GalleryModalProps) {
) : null
}
width={800}
destroyOnClose
destroyOnHidden
>
<Tabs
activeKey={activeKey}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const CharacterModal = forwardRef<
open={isModalOpen}
onCancel={handleCloseModal}
footer={null}
destroyOnClose
destroyOnHidden
>
<Form form={form} layout="vertical">
<Form.Item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const DialogueModal = forwardRef<DialogueModalRef, DialogueModalProps>(
open={isModalOpen}
onCancel={handleCloseModal}
onOk={handleSave}
destroyOnClose
destroyOnHidden
width={600}
>
<Form form={form} layout="vertical">
Expand Down
2 changes: 1 addition & 1 deletion src/client/pages/module/GeminiTTS/ProjectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ProjectModal = ({
open={open}
onCancel={onClose}
onOk={() => form.submit()}
destroyOnClose
destroyOnHidden
>
<Form
form={form}
Expand Down
Loading