mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 16:05:47 +01:00
fix: transform dash. -> dashdot for icon find
This commit is contained in:
@@ -1,7 +1,21 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon, Anchor, Button, Center,
|
ActionIcon,
|
||||||
Group, Image, LoadingOverlay, Modal, MultiSelect,
|
Anchor,
|
||||||
ScrollArea, Select, Switch, Tabs, Text, TextInput, Title, Tooltip
|
Button,
|
||||||
|
Center,
|
||||||
|
Group,
|
||||||
|
Image,
|
||||||
|
LoadingOverlay,
|
||||||
|
Modal,
|
||||||
|
MultiSelect,
|
||||||
|
ScrollArea,
|
||||||
|
Select,
|
||||||
|
Switch,
|
||||||
|
Tabs,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
Title,
|
||||||
|
Tooltip,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { useForm } from '@mantine/form';
|
import { useForm } from '@mantine/form';
|
||||||
import { useDebouncedValue } from '@mantine/hooks';
|
import { useDebouncedValue } from '@mantine/hooks';
|
||||||
@@ -42,10 +56,13 @@ export function AddItemShelfButton(props: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function MatchIcon(name: string, form: any) {
|
function MatchIcon(name: string, form: any) {
|
||||||
|
console.log(name, name.replace(/^dash\.$/, 'dashdot'));
|
||||||
|
|
||||||
fetch(
|
fetch(
|
||||||
`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name
|
`https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name
|
||||||
.replace(/\s+/g, '-')
|
.replace(/\s+/g, '-')
|
||||||
.toLowerCase()}.png`
|
.toLowerCase()
|
||||||
|
.replace(/^dash\.$/, 'dashdot')}.png`
|
||||||
).then((res) => {
|
).then((res) => {
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
form.setFieldValue('icon', res.url);
|
form.setFieldValue('icon', res.url);
|
||||||
|
|||||||
Reference in New Issue
Block a user