mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-18 16:07:10 +00:00
Auto generate Icon URL
This commit is contained in:
parent
75ca05454d
commit
5d352c2d1f
@ -24,6 +24,7 @@ import {
|
|||||||
LayoutGrid,
|
LayoutGrid,
|
||||||
List,
|
List,
|
||||||
Pencil,
|
Pencil,
|
||||||
|
Zap,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@ -241,6 +242,13 @@ export default function Dashboard() {
|
|||||||
return () => clearTimeout(delayDebounce);
|
return () => clearTimeout(delayDebounce);
|
||||||
}, [searchTerm]);
|
}, [searchTerm]);
|
||||||
|
|
||||||
|
const generateIconURL = async () => {
|
||||||
|
setIcon("https://cdn.jsdelivr.net/gh/selfhst/icons/png/" + name.toLowerCase() + ".png")
|
||||||
|
}
|
||||||
|
|
||||||
|
const generateEditIconURL = async () => {
|
||||||
|
setEditIcon("https://cdn.jsdelivr.net/gh/selfhst/icons/png/" + editName.toLowerCase() + ".png")
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarProvider>
|
<SidebarProvider>
|
||||||
@ -344,10 +352,16 @@ export default function Dashboard() {
|
|||||||
Icon URL{" "}
|
Icon URL{" "}
|
||||||
<span className="text-stone-600">(optional)</span>
|
<span className="text-stone-600">(optional)</span>
|
||||||
</Label>
|
</Label>
|
||||||
|
<div className="flex gap-2">
|
||||||
<Input
|
<Input
|
||||||
|
value={icon}
|
||||||
placeholder="https://example.com/icon.png"
|
placeholder="https://example.com/icon.png"
|
||||||
onChange={(e) => setIcon(e.target.value)}
|
onChange={(e) => setIcon(e.target.value)}
|
||||||
/>
|
/>
|
||||||
|
<Button variant="outline" size="icon" onClick={generateIconURL}>
|
||||||
|
<Zap />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid w-full items-center gap-1.5">
|
<div className="grid w-full items-center gap-1.5">
|
||||||
<Label>Public URL</Label>
|
<Label>Public URL</Label>
|
||||||
@ -560,6 +574,7 @@ export default function Dashboard() {
|
|||||||
(optional)
|
(optional)
|
||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
|
<div className="flex gap-2">
|
||||||
<Input
|
<Input
|
||||||
placeholder="https://example.com/icon.png"
|
placeholder="https://example.com/icon.png"
|
||||||
value={editIcon}
|
value={editIcon}
|
||||||
@ -567,6 +582,10 @@ export default function Dashboard() {
|
|||||||
setEditIcon(e.target.value)
|
setEditIcon(e.target.value)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
<Button variant="outline" size="icon" onClick={generateEditIconURL}>
|
||||||
|
<Zap />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid w-full items-center gap-1.5">
|
<div className="grid w-full items-center gap-1.5">
|
||||||
<Label>Public URL</Label>
|
<Label>Public URL</Label>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user