mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 17:26:26 +01:00
🌐 Search engine custom button
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "Search engine",
|
"title": "Search engine",
|
||||||
"configurationName": "Search engine configuration",
|
"configurationName": "Search engine configuration",
|
||||||
|
"custom": "Custom",
|
||||||
"tips": {
|
"tips": {
|
||||||
"generalTip": "There are multiple prefixes you can use! Adding these in front of your query will filter the results. !s (Web), !t (Torrents), !y (YouTube), and !m (Media).",
|
"generalTip": "There are multiple prefixes you can use! Adding these in front of your query will filter the results. !s (Web), !t (Torrents), !y (YouTube), and !m (Media).",
|
||||||
"placeholderTip": "%s can be used as a placeholder for the query."
|
"placeholderTip": "%s can be used as a placeholder for the query."
|
||||||
|
|||||||
@@ -35,6 +35,13 @@ export const SearchEngineSelector = ({ searchEngine }: Props) => {
|
|||||||
updateSearchEngineConfig(engine, url);
|
updateSearchEngineConfig(engine, url);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const searchEngineOptions: { label: string; value: EngineType }[] = [
|
||||||
|
{ label: 'Google', value: 'google' },
|
||||||
|
{ label: 'DuckDuckGo', value: 'duckDuckGo' },
|
||||||
|
{ label: 'Bing', value: 'bing' },
|
||||||
|
{ label: t('custom'), value: 'custom' },
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack spacing={0} mt="xs">
|
<Stack spacing={0} mt="xs">
|
||||||
<Title order={5} mb="xs">
|
<Title order={5} mb="xs">
|
||||||
@@ -77,13 +84,6 @@ export const SearchEngineSelector = ({ searchEngine }: Props) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchEngineOptions: { label: string; value: EngineType }[] = [
|
|
||||||
{ label: 'Google', value: 'google' },
|
|
||||||
{ label: 'DuckDuckGo', value: 'duckDuckGo' },
|
|
||||||
{ label: 'Bing', value: 'bing' },
|
|
||||||
{ label: 'Custom', value: 'custom' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export const searchUrls: { [key in CommonSearchEngineCommonSettingsType['type']]: string } = {
|
export const searchUrls: { [key in CommonSearchEngineCommonSettingsType['type']]: string } = {
|
||||||
google: 'https://google.com/search?q=',
|
google: 'https://google.com/search?q=',
|
||||||
duckDuckGo: 'https://duckduckgo.com/?q=',
|
duckDuckGo: 'https://duckduckgo.com/?q=',
|
||||||
|
|||||||
Reference in New Issue
Block a user