From d8b8be90efba128544c1008bed7b95e0f849c895 Mon Sep 17 00:00:00 2001 From: JohnMark Sill Date: Thu, 13 Jan 2022 11:32:04 -0600 Subject: [PATCH] fix: added padding back --- web/src/routes/Birdseye.jsx | 6 +- web/src/routes/CameraMap.jsx | 107 ++++++++++++++++---------------- web/src/routes/Debug.jsx | 20 +++--- web/src/routes/Events/index.jsx | 8 +-- web/src/routes/Recording.jsx | 8 +-- web/src/routes/StyleGuide.jsx | 82 ++++++++++++------------ 6 files changed, 114 insertions(+), 117 deletions(-) diff --git a/web/src/routes/Birdseye.jsx b/web/src/routes/Birdseye.jsx index 5222854e9..d813adf82 100644 --- a/web/src/routes/Birdseye.jsx +++ b/web/src/routes/Birdseye.jsx @@ -4,10 +4,10 @@ import Heading from '../components/Heading'; export default function Birdseye() { return ( -
- Birdseye +
+ Birdseye
- +
); diff --git a/web/src/routes/CameraMap.jsx b/web/src/routes/CameraMap.jsx index d6837ba8f..e6c2b14b6 100644 --- a/web/src/routes/CameraMap.jsx +++ b/web/src/routes/CameraMap.jsx @@ -20,10 +20,7 @@ export default function CameraMasks({ camera, url }) { zones, } = cameraConfig; - const { - width, - height, - } = cameraConfig.detect; + const { width, height } = cameraConfig.detect; const [{ width: scaledWidth }] = useResizeObserver(imageRef); const imageScale = scaledWidth / width; @@ -32,8 +29,8 @@ export default function CameraMasks({ camera, url }) { Array.isArray(motionMask) ? motionMask.map((mask) => getPolylinePoints(mask)) : motionMask - ? [getPolylinePoints(motionMask)] - : [] + ? [getPolylinePoints(motionMask)] + : [] ); const [zonePoints, setZonePoints] = useState( @@ -47,8 +44,8 @@ export default function CameraMasks({ camera, url }) { [name]: Array.isArray(objectFilters[name].mask) ? objectFilters[name].mask.map((mask) => getPolylinePoints(mask)) : objectFilters[name].mask - ? [getPolylinePoints(objectFilters[name].mask)] - : [], + ? [getPolylinePoints(objectFilters[name].mask)] + : [], }), {} ) @@ -131,11 +128,11 @@ ${motionMaskPoints.map((mask, i) => ` - ${polylinePointsToPolyline(mask)}`) const handleCopyZones = useCallback(async () => { await window.navigator.clipboard.writeText(` zones: ${Object.keys(zonePoints) - .map( - (zoneName) => ` ${zoneName}: + .map( + (zoneName) => ` ${zoneName}: coordinates: ${polylinePointsToPolyline(zonePoints[zoneName])}` - ) - .join('\n')}`); + ) + .join('\n')}`); }, [zonePoints]); // Object methods @@ -167,14 +164,14 @@ ${Object.keys(zonePoints) await window.navigator.clipboard.writeText(` objects: filters: ${Object.keys(objectMaskPoints) - .map((objectName) => - objectMaskPoints[objectName].length - ? ` ${objectName}: + .map((objectName) => + objectMaskPoints[objectName].length + ? ` ${objectName}: mask: ${polylinePointsToPolyline(objectMaskPoints[objectName])}` - : '' - ) - .filter(Boolean) - .join('\n')}`); + : '' + ) + .filter(Boolean) + .join('\n')}`); }, [objectMaskPoints]); const handleAddToObjectMask = useCallback( @@ -199,22 +196,22 @@ ${Object.keys(objectMaskPoints) ); return ( -
- {camera} mask & zone creator +
+ {camera} mask & zone creator This tool can help you create masks & zones for your {camera} camera. When done, copy each mask - configuration into your config.yml file restart your Frigate instance to + configuration into your config.yml file restart your Frigate instance to save your changes.

} - header="Warning" + header='Warning' /> -
-
+
+
-
- +
+
-
+
{!scaledPoints ? null : scaledPoints.map(([x, y], i) => ( - - ))} -
+ + ))} +
{!scaledPoints ? null : ( - + )} @@ -444,15 +441,15 @@ function MaskValues({ ); return ( -
-
- +
+
+ {title}
-
+      
         {yamlPrefix}
         {Object.keys(points).map((mainkey) => {
           if (isMulti) {
@@ -460,7 +457,7 @@ function MaskValues({
               
{` ${mainkey}:\n mask:\n`} {onAdd && showButtons ? ( - ) : null} @@ -506,13 +503,13 @@ function Item({ mainkey, subkey, editing, handleEdit, points, showButtons, handl editing.key === mainkey && editing.subkey === subkey ? 'text-blue-800 dark:text-blue-600' : '' }`} onClick={handleEdit} - title="Click to edit" + title='Click to edit' > {`${yamlKeyPrefix(points, mainkey, subkey)}${polylinePointsToPolyline(points)}`} {showButtons ? (