From f8c382c480c67b5549d10936981c393f6d395234 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 6 Aug 2023 07:33:08 -0700 Subject: [PATCH] Allow specify object fit for mjpeg widget --- src/utils/config/service-helpers.js | 2 ++ src/widgets/mjpeg/component.jsx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/config/service-helpers.js b/src/utils/config/service-helpers.js index 901ae5f62..83b4b07bc 100644 --- a/src/utils/config/service-helpers.js +++ b/src/utils/config/service-helpers.js @@ -297,6 +297,7 @@ export function cleanServiceGroups(groups) { repositoryId, metric, // glances stream, // mjpeg + fit, } = cleanedService.widget; let fieldsList = fields; @@ -365,6 +366,7 @@ export function cleanServiceGroups(groups) { } if (type === "mjpeg") { if (stream) cleanedService.widget.stream = stream; + if (fit) cleanedService.widget.fit = fit; } } diff --git a/src/widgets/mjpeg/component.jsx b/src/widgets/mjpeg/component.jsx index dd29f0a5d..30907c311 100644 --- a/src/widgets/mjpeg/component.jsx +++ b/src/widgets/mjpeg/component.jsx @@ -2,13 +2,13 @@ import Image from "next/image"; export default function Component({ service }) { const { widget } = service; - const { stream } = widget; + const { stream, fit = "contain" } = widget; return (
stream - stream + stream