Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
img-manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Lan
img-manager
Commits
a152fff4
Commit
a152fff4
authored
Mar 10, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix images
parent
5c787d05
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
ImageUploadForm.jsx
app/frontend/components/ImageUploadForm.jsx
+1
-0
ComImageCard.jsx
app/frontend/components/images/ComImageCard.jsx
+4
-2
ComTagsIndex.jsx
app/frontend/components/tags/ComTagsIndex.jsx
+1
-1
Layout.jsx
app/frontend/pages/Layout.jsx
+1
-1
Edit.jsx
app/frontend/pages/admin/images/Edit.jsx
+3
-3
No files found.
app/frontend/components/ImageUploadForm.jsx
View file @
a152fff4
...
...
@@ -124,6 +124,7 @@ export default function ImageUploadForm({
id=
"file-upload"
name=
"file"
type=
"file"
accept=
"image/*"
className=
"sr-only"
onChange=
{
handleFileChange
}
/>
...
...
app/frontend/components/images/ComImageCard.jsx
View file @
a152fff4
...
...
@@ -5,7 +5,8 @@ import { forwardRef } from 'react';
// Convert to forwardRef to allow the IntersectionObserver to work
export
const
ComImageCard
=
forwardRef
(({
image
,
path
,
showUserName
=
false
},
ref
)
=>
{
return
(
<
div
<
Link
href=
{
`${path}/${image.id}`
}
ref=
{
ref
}
className=
"bg-white overflow-hidden shadow rounded-lg flex flex-col"
>
...
...
@@ -51,6 +52,6 @@ export const ComImageCard = forwardRef(({ image, path, showUserName = false}, re
</
span
>
</
div
>
</
div
>
</
div
>
</
Link
>
);
});
\ No newline at end of file
app/frontend/components/tags/ComTagsIndex.jsx
View file @
a152fff4
...
...
@@ -359,7 +359,7 @@ export default function ComTagsIndex({
<
button
type=
"submit"
disabled=
{
editProcessing
}
className=
"inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
className=
"inline-flex
mb-2
justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
>
更新
</
button
>
...
...
app/frontend/pages/Layout.jsx
View file @
a152fff4
...
...
@@ -71,7 +71,7 @@ export default function Layout({ children, user, title }) {
</
DropdownMenu
.
Trigger
>
<
DropdownMenu
.
Portal
>
<
DropdownMenu
.
Content
className=
"min-w-[220px] bg-white rounded-md p-1 shadow-lg"
className=
"min-w-[220px] bg-white rounded-md p-1 shadow-lg
z-50
"
sideOffset=
{
5
}
>
<
DropdownMenu
.
Item
className=
"text-sm text-gray-700 px-4 py-2 rounded hover:bg-gray-100"
>
...
...
app/frontend/pages/admin/images/Edit.jsx
View file @
a152fff4
import
{
Head
,
useForm
}
from
'@inertiajs/react'
import
{
Head
,
useForm
,
router
}
from
'@inertiajs/react'
import
Layout
from
'../../Layout'
import
ImageUploadForm
from
'../../../components/ImageUploadForm'
...
...
@@ -8,7 +8,7 @@ export default function AdminImagesEdit({ image, tags, auth }) {
?
image
.
tags
.
map
(
tag
=>
tag
.
id
)
:
[]
const
{
data
,
setData
,
p
atch
,
p
rocessing
,
errors
}
=
useForm
({
const
{
data
,
setData
,
processing
,
errors
}
=
useForm
({
title
:
image
.
title
||
''
,
status
:
image
.
status
,
tag_ids
:
initialTagIds
,
...
...
@@ -16,7 +16,7 @@ export default function AdminImagesEdit({ image, tags, auth }) {
const
handleSubmit
=
(
e
)
=>
{
e
.
preventDefault
()
patch
(
`/admin/images/
${
image
.
id
}
`
)
router
.
patch
(
`/admin/images/
${
image
.
id
}
`
,
{
image
:
data
}
)
}
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment