diff --git a/web/.eslintrc.cjs b/web/.eslintrc.cjs index deba5f544..883537d0f 100644 --- a/web/.eslintrc.cjs +++ b/web/.eslintrc.cjs @@ -44,6 +44,12 @@ module.exports = { { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, ], "no-console": "error", + "prettier/prettier": [ + "warn", + { + plugins: ["prettier-plugin-tailwindcss"], + }, + ], }, overrides: [ { diff --git a/web/.prettierrc b/web/.prettierrc new file mode 100644 index 000000000..b4bfed357 --- /dev/null +++ b/web/.prettierrc @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-tailwindcss"] +} diff --git a/web/package-lock.json b/web/package-lock.json index 1a680777a..77db8051e 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -96,9 +96,10 @@ "fake-indexeddb": "^5.0.2", "jest-websocket-mock": "^2.5.0", "jsdom": "^24.0.0", - "msw": "^2.2.14", + "msw": "^2.3.0", "postcss": "^8.4.38", "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.14", "tailwindcss": "^3.4.3", "typescript": "^5.4.5", "vite": "^5.2.11", @@ -848,9 +849,9 @@ } }, "node_modules/@mswjs/interceptors": { - "version": "0.26.15", - "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.26.15.tgz", - "integrity": "sha512-HM47Lu1YFmnYHKMBynFfjCp0U/yRskHj/8QEJW0CBEPOlw8Gkmjfll+S9b8M7V5CNDw2/ciRxjjnWeaCiblSIQ==", + "version": "0.29.1", + "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.29.1.tgz", + "integrity": "sha512-3rDakgJZ77+RiQUuSK69t1F0m8BQKA8Vh5DCS5V0DWvNY67zob2JhhQrhCO0AKLGINTRSFd1tBaHcJTkhefoSw==", "dev": true, "dependencies": { "@open-draft/deferred-promise": "^2.2.0", @@ -5595,9 +5596,9 @@ "dev": true }, "node_modules/msw": { - "version": "2.2.14", - "resolved": "https://registry.npmjs.org/msw/-/msw-2.2.14.tgz", - "integrity": "sha512-64i8rNCa1xzDK8ZYsTrVMli05D687jty8+Th+PU5VTbJ2/4P7fkQFVyDQ6ZFT5FrNR8z2BHhbY47fKNvfHrumA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.3.0.tgz", + "integrity": "sha512-cDr1q/QTMzaWhY8n9lpGhceY209k29UZtdTgJ3P8Bzne3TSMchX2EM/ldvn4ATLOktpCefCU2gcEgzHc31GTPw==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -5605,7 +5606,7 @@ "@bundled-es-modules/statuses": "^1.0.1", "@inquirer/confirm": "^3.0.0", "@mswjs/cookies": "^1.1.0", - "@mswjs/interceptors": "^0.26.14", + "@mswjs/interceptors": "^0.29.0", "@open-draft/until": "^2.1.0", "@types/cookie": "^0.6.0", "@types/statuses": "^2.0.4", @@ -6181,6 +6182,80 @@ "node": ">=6.0.0" } }, + "node_modules/prettier-plugin-tailwindcss": { + "version": "0.5.14", + "resolved": "https://registry.npmjs.org/prettier-plugin-tailwindcss/-/prettier-plugin-tailwindcss-0.5.14.tgz", + "integrity": "sha512-Puaz+wPUAhFp8Lo9HuciYKM2Y2XExESjeT+9NQoVFXZsPPnc9VYss2SpxdQ6vbatmt8/4+SN0oe0I1cPDABg9Q==", + "dev": true, + "engines": { + "node": ">=14.21.3" + }, + "peerDependencies": { + "@ianvs/prettier-plugin-sort-imports": "*", + "@prettier/plugin-pug": "*", + "@shopify/prettier-plugin-liquid": "*", + "@trivago/prettier-plugin-sort-imports": "*", + "@zackad/prettier-plugin-twig-melody": "*", + "prettier": "^3.0", + "prettier-plugin-astro": "*", + "prettier-plugin-css-order": "*", + "prettier-plugin-import-sort": "*", + "prettier-plugin-jsdoc": "*", + "prettier-plugin-marko": "*", + "prettier-plugin-organize-attributes": "*", + "prettier-plugin-organize-imports": "*", + "prettier-plugin-sort-imports": "*", + "prettier-plugin-style-order": "*", + "prettier-plugin-svelte": "*" + }, + "peerDependenciesMeta": { + "@ianvs/prettier-plugin-sort-imports": { + "optional": true + }, + "@prettier/plugin-pug": { + "optional": true + }, + "@shopify/prettier-plugin-liquid": { + "optional": true + }, + "@trivago/prettier-plugin-sort-imports": { + "optional": true + }, + "@zackad/prettier-plugin-twig-melody": { + "optional": true + }, + "prettier-plugin-astro": { + "optional": true + }, + "prettier-plugin-css-order": { + "optional": true + }, + "prettier-plugin-import-sort": { + "optional": true + }, + "prettier-plugin-jsdoc": { + "optional": true + }, + "prettier-plugin-marko": { + "optional": true + }, + "prettier-plugin-organize-attributes": { + "optional": true + }, + "prettier-plugin-organize-imports": { + "optional": true + }, + "prettier-plugin-sort-imports": { + "optional": true + }, + "prettier-plugin-style-order": { + "optional": true + }, + "prettier-plugin-svelte": { + "optional": true + } + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", diff --git a/web/package.json b/web/package.json index 4638572a6..d41c9ea75 100644 --- a/web/package.json +++ b/web/package.json @@ -104,6 +104,7 @@ "msw": "^2.3.0", "postcss": "^8.4.38", "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.14", "tailwindcss": "^3.4.3", "typescript": "^5.4.5", "vite": "^5.2.11", diff --git a/web/src/App.tsx b/web/src/App.tsx index a86e79491..eb81bc812 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -31,7 +31,7 @@ function App() { {isMobile && }
diff --git a/web/src/components/Statusbar.tsx b/web/src/components/Statusbar.tsx index c2e81cf90..9fb45ba42 100644 --- a/web/src/components/Statusbar.tsx +++ b/web/src/components/Statusbar.tsx @@ -55,11 +55,11 @@ export default function Statusbar() { }, [potentialProblems, addMessage, clearMessages]); return ( -
-
+
+
{cpuPercent && ( -
+
-
+
{Object.entries(messages).length === 0 ? ( -
+
System is healthy
) : ( Object.entries(messages).map(([key, messageArray]) => ( -
+
{messageArray.map(({ id, text, color, link }: StatusMessage) => { const message = (
{ - return
{children}
; + return
{children}
; }; export default Wrapper; diff --git a/web/src/components/bar/TimelineBar.tsx b/web/src/components/bar/TimelineBar.tsx index cd168f3cd..fe05b876f 100644 --- a/web/src/components/bar/TimelineBar.tsx +++ b/web/src/components/bar/TimelineBar.tsx @@ -27,11 +27,11 @@ export default function TimelineBar({ return (
{graphData != undefined && ( -
+
{getHourBlocks().map((idx) => { return (
); })} -
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:00" : "%I:00%P", @@ -56,8 +56,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:05" : "%I:05%P", @@ -66,8 +66,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:10" : "%I:10%P", @@ -76,8 +76,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:15" : "%I:15%P", @@ -86,8 +86,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:20" : "%I:20%P", @@ -96,8 +96,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:25" : "%I:25%P", @@ -106,8 +106,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:30" : "%I:30%P", @@ -116,8 +116,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:35" : "%I:35%P", @@ -126,8 +126,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:40" : "%I:40%P", @@ -136,8 +136,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:45" : "%I:45%P", @@ -146,8 +146,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:50" : "%I:50%P", @@ -156,8 +156,8 @@ export default function TimelineBar({ })}
-
-
+
+
{formatUnixTimestampToDateTime(startTime, { strftime_fmt: config?.ui.time_format == "24hour" ? "%H:55" : "%I:55%P", diff --git a/web/src/components/camera/CameraImage.tsx b/web/src/components/camera/CameraImage.tsx index b4fb707bc..b2bf33dfd 100644 --- a/web/src/components/camera/CameraImage.tsx +++ b/web/src/components/camera/CameraImage.tsx @@ -45,7 +45,7 @@ export default function CameraImage({ {enabled ? ( { setHasLoaded(true); @@ -62,12 +62,12 @@ export default function CameraImage({ }} /> ) : ( -
+
Camera is disabled in config, no stream or snapshot available!
)} {!hasLoaded && enabled ? ( -
+
) : null} diff --git a/web/src/components/camera/DebugCameraImage.tsx b/web/src/components/camera/DebugCameraImage.tsx index af8f3bf72..62c7c13cc 100644 --- a/web/src/components/camera/DebugCameraImage.tsx +++ b/web/src/components/camera/DebugCameraImage.tsx @@ -56,7 +56,7 @@ export default function DebugCameraImage({ cameraClasses="relative w-full h-full flex justify-center" />
diff --git a/web/src/components/filter/CameraGroupSelector.tsx b/web/src/components/filter/CameraGroupSelector.tsx index b80a4f939..098d2f419 100644 --- a/web/src/components/filter/CameraGroupSelector.tsx +++ b/web/src/components/filter/CameraGroupSelector.tsx @@ -125,8 +125,8 @@ export function CameraGroupSelector({ className }: CameraGroupSelectorProps) { ); const content = ( @@ -33,7 +33,7 @@ export function LogLevelFilterButton({ return ( {trigger} - + {content} @@ -59,9 +59,9 @@ export function GeneralFilterContent({ return ( <>
-
+