mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-02 21:43:39 +01:00
Allow specify object fit for mjpeg widget
This commit is contained in:
parent
ba19f77b8f
commit
f8c382c480
@ -297,6 +297,7 @@ export function cleanServiceGroups(groups) {
|
|||||||
repositoryId,
|
repositoryId,
|
||||||
metric, // glances
|
metric, // glances
|
||||||
stream, // mjpeg
|
stream, // mjpeg
|
||||||
|
fit,
|
||||||
} = cleanedService.widget;
|
} = cleanedService.widget;
|
||||||
|
|
||||||
let fieldsList = fields;
|
let fieldsList = fields;
|
||||||
@ -365,6 +366,7 @@ export function cleanServiceGroups(groups) {
|
|||||||
}
|
}
|
||||||
if (type === "mjpeg") {
|
if (type === "mjpeg") {
|
||||||
if (stream) cleanedService.widget.stream = stream;
|
if (stream) cleanedService.widget.stream = stream;
|
||||||
|
if (fit) cleanedService.widget.fit = fit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,13 +2,13 @@ import Image from "next/image";
|
|||||||
|
|
||||||
export default function Component({ service }) {
|
export default function Component({ service }) {
|
||||||
const { widget } = service;
|
const { widget } = service;
|
||||||
const { stream } = widget;
|
const { stream, fit = "contain" } = widget;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="absolute top-0 bottom-0 right-0 left-0">
|
<div className="absolute top-0 bottom-0 right-0 left-0">
|
||||||
<Image layout="fill" objectFit="fill" className="blur-md" src={stream} alt="stream" />
|
<Image layout="fill" objectFit="fill" className="blur-md" src={stream} alt="stream" />
|
||||||
<Image layout="fill" objectFit="contain" className="drop-shadow-2xl" src={stream} alt="stream" />
|
<Image layout="fill" objectFit={fit} className="drop-shadow-2xl" src={stream} alt="stream" />
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute top-0 right-0 bottom-0 left-0 overflow-clip shadow-[inset_0_0_200px_#000] shadow-theme-700/10 dark:shadow-theme-900/10" />
|
<div className="absolute top-0 right-0 bottom-0 left-0 overflow-clip shadow-[inset_0_0_200px_#000] shadow-theme-700/10 dark:shadow-theme-900/10" />
|
||||||
<div className="h-[68px] overflow-clip" />
|
<div className="h-[68px] overflow-clip" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user