Edit Panel UI

This commit is contained in:
jasinco 2025-06-10 18:34:35 +08:00
parent bc2fecc50d
commit 7f70ff1c0c

View file

@ -36,7 +36,7 @@ const Panel = () => {
if ((val.status == 401 || val.status == 400) && await val.text() == "missing or malformvald JWT") {
window.location.href = "/admin/login"
} else if (val.status == 200) {
setPosts((await val.json() as Array<Object>).map(post => POST.parse(post)))
setPosts((await val.json() as Array<Object>).map(post => POST.parse(post)).filter(e => posts.findIndex(x => x.id == e.id) != -1))
}
}).finally(() => { setLoading(false) })
}
@ -87,7 +87,7 @@ const Panel = () => {
</div>
<div className="h-full w-full flex flex-col md:flex-row px-10 pt-20">
<Button onClick={load} disabled={loading}>Load</Button>
<Button onClick={Send}>Load</Button>
<Button onClick={Send}>Send</Button>
<div className="grid grid-cols-1 md:grid-cols-3 border-3 border-stone-400 rounded w-[80dvw] text-white gap-3 overflow-scroll">
{posts.length > 0 ? posts.map(post => {
return (<div key={post.id} className="border rounded h-fit">