mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-02 11:36:01 +01:00
@@ -5,6 +5,9 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|||||||
});
|
});
|
||||||
|
|
||||||
module.exports = withBundleAnalyzer({
|
module.exports = withBundleAnalyzer({
|
||||||
|
images: {
|
||||||
|
domains: ['cdn.jsdelivr.net'],
|
||||||
|
},
|
||||||
reactStrictMode: false,
|
reactStrictMode: false,
|
||||||
experimental: {
|
experimental: {
|
||||||
outputStandalone: true,
|
outputStandalone: true,
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
Anchor,
|
Anchor,
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Image,
|
|
||||||
Center,
|
Center,
|
||||||
createStyles,
|
createStyles,
|
||||||
useMantineColorScheme,
|
useMantineColorScheme,
|
||||||
@@ -12,6 +11,7 @@ import { motion } from 'framer-motion';
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useSortable } from '@dnd-kit/sortable';
|
import { useSortable } from '@dnd-kit/sortable';
|
||||||
import { CSS } from '@dnd-kit/utilities';
|
import { CSS } from '@dnd-kit/utilities';
|
||||||
|
import Image from 'next/image';
|
||||||
import { serviceItem } from '../../tools/types';
|
import { serviceItem } from '../../tools/types';
|
||||||
import PingComponent from '../../modules/ping/PingModule';
|
import PingComponent from '../../modules/ping/PingModule';
|
||||||
import AppShelfMenu from './AppShelfMenu';
|
import AppShelfMenu from './AppShelfMenu';
|
||||||
@@ -121,11 +121,13 @@ export function AppShelfItem(props: any) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
styles={{ root: { cursor: 'pointer' } }}
|
style={{
|
||||||
|
cursor: 'pointer',
|
||||||
|
}}
|
||||||
width={80}
|
width={80}
|
||||||
height={80}
|
height={80}
|
||||||
src={service.icon}
|
src={`/api/imageproxy?url=${service.icon}`}
|
||||||
fit="contain"
|
objectFit="contain"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (service.openedUrl) {
|
if (service.openedUrl) {
|
||||||
window.open(service.openedUrl, service.newTab === false ? '_top' : '_blank');
|
window.open(service.openedUrl, service.newTab === false ? '_top' : '_blank');
|
||||||
|
|||||||
10
src/pages/api/imageproxy.ts
Normal file
10
src/pages/api/imageproxy.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
|
|
||||||
|
export default async (req: NextApiRequest, res: NextApiResponse) => {
|
||||||
|
const url = decodeURIComponent(req.query.url as string);
|
||||||
|
const result = await fetch(url);
|
||||||
|
const body = await result.body;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
body.pipe(res);
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user