mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-28 14:49:01 +03:00
* docs: add docker compose generator * docs: add more icon support * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Rename heading from 'Generic Hardware Acceleration' to 'Generic Hardware Devices' * Remove port 5000 configuration for security reasons Removed unauthenticated Web UI port 5000 from configuration due to security risks. * docs: remove 5000 port tips * docs: improve NVIDIA GPU count input * docs: add docker compose tabs * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/components/OtherOptions.tsx Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/components/StoragePaths.tsx Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/components/StoragePaths.tsx Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * Update docs/src/components/DockerComposeGenerator/config/config.yaml Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> * docs: Adjust the position of the RTSP password variable option * docs: timezone change to select * docs: add hailo and memryX mx3 driver tips * docs: RTSP password is optional * docs: fix select style --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
123 lines
3.7 KiB
TypeScript
123 lines
3.7 KiB
TypeScript
import React, { useMemo } from "react";
|
|
import CodeInline from "@theme/CodeInline";
|
|
import styles from "../styles.module.css";
|
|
|
|
const AUTO_TIMEZONE_VALUE = "__auto__";
|
|
|
|
function getTimezoneList(): string[] {
|
|
if (typeof Intl !== "undefined") {
|
|
const intl = Intl as typeof Intl & {
|
|
supportedValuesOf?: (key: string) => string[];
|
|
};
|
|
const supported = intl.supportedValuesOf?.("timeZone");
|
|
if (supported && supported.length > 0) {
|
|
return [...supported].sort();
|
|
}
|
|
}
|
|
|
|
const fallback = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
return fallback ? [fallback] : ["UTC"];
|
|
}
|
|
|
|
interface Props {
|
|
rtspPassword: string;
|
|
timezone: string;
|
|
shmSize: string;
|
|
shmSizeError: boolean;
|
|
onRtspPasswordChange: (value: string) => void;
|
|
onTimezoneChange: (value: string) => void;
|
|
onShmSizeChange: (value: string) => void;
|
|
}
|
|
|
|
export default function OtherOptions({
|
|
rtspPassword,
|
|
timezone,
|
|
shmSize,
|
|
shmSizeError,
|
|
onRtspPasswordChange,
|
|
onTimezoneChange,
|
|
onShmSizeChange,
|
|
}: Props) {
|
|
const timezones = useMemo(() => getTimezoneList(), []);
|
|
const systemTimezone =
|
|
Intl.DateTimeFormat().resolvedOptions().timeZone || "Etc/UTC";
|
|
const selectedValue = timezone || AUTO_TIMEZONE_VALUE;
|
|
|
|
return (
|
|
<div className={styles.formSection}>
|
|
<h4>Other Options</h4>
|
|
<div className={styles.formGrid}>
|
|
<div className={styles.formGroup}>
|
|
<label htmlFor="dcg-timezone" className={styles.label}>
|
|
Timezone:
|
|
</label>
|
|
<select
|
|
id="dcg-timezone"
|
|
className={`${styles.input} ${styles.select}`}
|
|
value={selectedValue}
|
|
onChange={(e) =>
|
|
onTimezoneChange(
|
|
e.target.value === AUTO_TIMEZONE_VALUE ? "" : e.target.value
|
|
)
|
|
}
|
|
>
|
|
<option value={AUTO_TIMEZONE_VALUE}>
|
|
Use browser timezone ({systemTimezone})
|
|
</option>
|
|
{timezones.map((tz) => (
|
|
<option key={tz} value={tz}>
|
|
{tz}
|
|
</option>
|
|
))}
|
|
</select>
|
|
</div>
|
|
<div className={styles.formGroup}>
|
|
<label htmlFor="dcg-shm-size" className={styles.label}>
|
|
Shared memory (SHM):
|
|
</label>
|
|
<input
|
|
id="dcg-shm-size"
|
|
type="text"
|
|
className={`${styles.input} ${shmSizeError ? styles.inputError : ""}`}
|
|
value={shmSize}
|
|
placeholder="512mb"
|
|
onChange={(e) => onShmSizeChange(e.target.value)}
|
|
/>
|
|
{shmSizeError ? (
|
|
<p className={styles.helpText}>
|
|
⚠️ Invalid format. Use a number followed by a unit (e.g. 512mb, 1gb)
|
|
</p>
|
|
) : (
|
|
<p className={styles.helpText}>
|
|
See{" "}
|
|
<a href="/frigate/installation#calculating-required-shm-size">
|
|
calculating required SHM size
|
|
</a>{" "}
|
|
for the correct value.
|
|
</p>
|
|
)}
|
|
</div>
|
|
<div className={styles.formGroup}>
|
|
<label htmlFor="dcg-rtsp-password" className={styles.label}>
|
|
RTSP password:
|
|
</label>
|
|
<input
|
|
id="dcg-rtsp-password"
|
|
type="text"
|
|
className={styles.input}
|
|
value={rtspPassword}
|
|
placeholder="password"
|
|
onChange={(e) => onRtspPasswordChange(e.target.value)}
|
|
/>
|
|
<p className={styles.helpText}>
|
|
Optional. You can specify{" "}
|
|
<CodeInline>{"{FRIGATE_RTSP_PASSWORD}"}</CodeInline>{" "}
|
|
in the config file to reference camera stream passwords. This is NOT
|
|
the Frigate login password.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|