mirror of
https://github.com/D4M13N-D3V/neroshitron.git
synced 2025-03-14 10:05:04 +00:00
fix;admin
This commit is contained in:
parent
168c835a23
commit
e48d3ebafb
0
app/api/galleries/admin/route.ts
Normal file
0
app/api/galleries/admin/route.ts
Normal file
@ -67,30 +67,24 @@ function PageComponent() {
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="w-full h-1/2 text-white flex justify-center items-center animate-in">
|
||||
<div className="w-full h-1/2 text-white lg:flex justify-center items-center animate-in">
|
||||
<div className="w-full lg:w-1/3 rounded-md bg-primary opacity-90 p-12 m-1 mt-32 shadow-lg backdrop-blur">
|
||||
<div className="w-full flex">
|
||||
<input type="text" onChange={(e)=>{setNewTagName(e.target.value)}} className="hover:scale-95 focus:scale-95 mb-8 mr-2 rounded-md bg-secondary p-2 w-1/2 text-white shadow-lg" placeholder="Tag Name" />
|
||||
<input type="text" onChange={(e)=>{setNewTagName(e.target.value)}} className="hover:scale-105 focus:scale-95 mb-8 mr-2 rounded-md bg-info-bright p-2 w-1/2 text-white shadow-lg" placeholder="Tag Name" />
|
||||
<button onClick={createTag} className="hover:scale-95 ml-2 shadow-lg w-1/2 h-10 text-center bg-success hover:bg-success-light text-white font-bold rounded flex items-center justify-center">
|
||||
Create
|
||||
Create New Tag
|
||||
</button>
|
||||
</div>
|
||||
<div className="w-full flex">
|
||||
<input type="text" value={tagSearch} onChange={(e)=>{setTagSearch(e.target.value)}} className="hover:scale-95 focus:scale-95 mb-8 shadow-lg mr-2 rounded-md bg-secondary p-2 w-full text-white" placeholder="Search all tags by name" />
|
||||
<input type="text" value={tagSearch} onChange={(e)=>{setTagSearch(e.target.value)}} className="hover:scale-105 focus:scale-95 mb-8 shadow-lg mr-2 rounded-md bg-info-bright p-2 w-full text-white" placeholder="Search all tags by name" />
|
||||
</div>
|
||||
<div className="w-full h-96 overflow-y-scroll no-scrollbar">
|
||||
<table className="w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="px-4 py-2" style={{ width: '90%' }}></th>
|
||||
<th className="px-4 py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<table className="w-full bg-primary-light rounded">
|
||||
<tbody>
|
||||
{tags.filter((value,index,array)=>{
|
||||
return value.name.toLowerCase().includes(tagSearch.toLowerCase());
|
||||
}).map((item:any) => (
|
||||
<tr key={item.name} className="hover:bg-secondary-dark animate-in">
|
||||
<tr key={item.name} className="hover:bg-secondary-dark animate-in shadow">
|
||||
<td className="px-4 py-2">{item.name}</td>
|
||||
<td className="px-4 py-2">
|
||||
<button onClick={()=>{deleteTag(item.name)}} className="hover:scale-95 bg-error shadow-lg hover:bg-error-light text-white font-bold py-2 px-4 rounded float-right">
|
||||
@ -106,32 +100,25 @@ function PageComponent() {
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div className="w-full lg:w-1/2 rounded-md bg-primary opacity-90 backdrop-blur-lg p-12 m-1 mt-32 shadow-lg">
|
||||
<div className="w-full flex">
|
||||
<div className="w-full lg:w-1/2 h-96 rounded-md bg-primary opacity-90 backdrop-blur-lg p-12 m-1 mt-32 shadow-lg">
|
||||
<div className="w-full flex pb-2">
|
||||
<SearchInput placeholderTags={[
|
||||
{ value: "tags", label: "❗️ click here to add tags to search" }
|
||||
]} nsfwButtonEnabled={true} searchChanged={(search) => { setSearchState(search) }} nsfwChanged={(nsfw) => { setNsfwState(nsfw) }} tagsChanged={(tags) => { setTagsState(tags) }} />
|
||||
|
||||
<a href="/gallery/admin/create" className="hover:scale-95 ml-2 shadow-lg max-h-14 text-center bg-success hover:bg-success-light text-white w-1/6 font-bold rounded flex items-center justify-center">
|
||||
Create
|
||||
<a href="/gallery/admin/create" className="hover:scale-95 ml-2 p-2 shadow-lg h-10 text-center bg-success hover:bg-success-light text-white w-1/6 font-bold rounded flex items-center justify-center">
|
||||
+ Gallery
|
||||
</a>
|
||||
</div>
|
||||
<table className="w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="px-4 py-2" style={{ width: '60%' }}></th>
|
||||
<th className="px-4 py-2" style={{width:"15%"}}></th>
|
||||
<th className="px-4 py-2"></th>
|
||||
<th className="px-4 py-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div className="w-full h-64 overflow-y-scroll no-scrollbar">
|
||||
<table className="w-full mt-8 bg-primary-light rounded">
|
||||
<tbody>
|
||||
{/* Replace this with your data mapping logic */}
|
||||
{galleries.map((item: { name: string, imageCount: number, tier: string }) => (
|
||||
<tr key={item.name} className="hover:bg-secondary-dark animate-in">
|
||||
<td className="px-4 py-2">{item.name}</td>
|
||||
<tr key={item.name} className="hover:bg-secondary-dark shadow animate-in">
|
||||
<td className="px-4 py-2" style={{ width: '65%' }}>{item.name}</td>
|
||||
<td className="px-4 py-2">{item.imageCount}</td>
|
||||
<td className="px-4 py-2">{item.tier.replace("Tier","")}</td>
|
||||
<td className="px-4 py-2">{item.tier}</td>
|
||||
<td className="px-4 py-2">
|
||||
<button className="bg-secondary hover:scale-95 shadow-lg hover:bg-secondary-light text-white font-bold py-2 px-4 rounded float-right">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="size-6">
|
||||
@ -146,6 +133,7 @@ function PageComponent() {
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export default PageComponent;
|
@ -57,18 +57,18 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, []);
|
||||
const [scrollPosition, setScrollPosition] = useState(0);
|
||||
const [color, setColor] = useState('black');
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
}, []);
|
||||
|
||||
const tagOptions = tags.map((tag: { name: string; }) => ({ value: tag.name, label: tag.name }));
|
||||
return (
|
||||
<>
|
||||
<div className={` ${scrollPosition>0 ?? 'opacity-30'} opacity 0 relative w-full flex flex-col items-center justify-center z-10`}>
|
||||
<div className={` opacity 0 relative w-full flex flex-col items-center justify-center z-10`}>
|
||||
<div className="search-box mx-auto my-auto w-full">
|
||||
<div className={`${scrollPosition>0 ?? 'opacity-30'} opacityflex flex-row`}>
|
||||
<div className={`flex flex-row`}>
|
||||
|
||||
{(selectingTags) ? (
|
||||
<>
|
||||
@ -84,6 +84,7 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
||||
)
|
||||
: (
|
||||
<>
|
||||
<div className="absolute w-full top-0">
|
||||
<Select isMultiple isSearchable isClearable searchInputPlaceholder='Start typing to search tags...'
|
||||
options={tagOptions}
|
||||
placeholder="Select tags for your search"
|
||||
@ -99,6 +100,9 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
||||
setSelectedTags([value.value]);
|
||||
setSelectedTagsInput([value])
|
||||
}
|
||||
}}
|
||||
onSearchInputChange={(value) => {
|
||||
|
||||
}}
|
||||
classNames={{
|
||||
|
||||
@ -111,11 +115,8 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
||||
}}
|
||||
|
||||
formatOptionLabel={data => (
|
||||
<li
|
||||
className={`animate-in block transition rounded duration-200 px-2 py-2 cursor-pointer select-none truncate pt-2 ${
|
||||
!data.isSelected
|
||||
? `text-white bg-primary hover:bg-primary-light`
|
||||
: `bg-primary-light text-white`
|
||||
<li id={"tag-" + data.value}
|
||||
className={`animate-in block transition rounded duration-200 px-2 py-2 cursor-pointer select-none truncate pt-2 bg-primarytext-white hover:bg-primary-light
|
||||
}`}
|
||||
>
|
||||
{data.label}
|
||||
@ -123,8 +124,9 @@ const SearchInput = ({ tagsChanged, searchChanged, nsfwChanged, nsfwButtonEnable
|
||||
)}
|
||||
value={selectedTagsInput}
|
||||
primaryColor={"indigo"} />
|
||||
</div>
|
||||
|
||||
{(nsfwButtonEnabled) ?? (
|
||||
{(nsfwButtonEnabled==true) ?? (
|
||||
<span className="flex items-center border-0 font-bold text-grey-100">
|
||||
<button
|
||||
onClick={() => { setNsfw(!nsfw) }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user