* don't fetch trigger status if no triggers defined

* settings sidebar tweaks

* padding tweaks

* fix
This commit is contained in:
Josh Hawkins 2025-10-08 16:02:38 -05:00 committed by GitHub
parent 6df950bb78
commit 7181f3db5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 22 additions and 18 deletions

View File

@ -448,9 +448,9 @@ export default function Settings() {
</div> </div>
)} )}
</div> </div>
<SidebarProvider className="md:h-dvh md:pb-24"> <SidebarProvider>
<Sidebar variant="inset" className="relative mb-8 pt-0"> <Sidebar variant="inset" className="relative mb-8 pl-0 pt-0">
<SidebarContent className="border-r-[1px] border-secondary bg-background pt-2"> <SidebarContent className="scrollbar-container mb-20 overflow-y-auto border-r-[1px] border-secondary bg-background py-2">
<SidebarMenu> <SidebarMenu>
{settingsGroups.map((group) => { {settingsGroups.map((group) => {
const filteredItems = group.items.filter((item) => const filteredItems = group.items.filter((item) =>
@ -463,7 +463,7 @@ export default function Settings() {
<SidebarMenu> <SidebarMenu>
<SidebarMenuItem> <SidebarMenuItem>
<SidebarMenuButton <SidebarMenuButton
className="ml-0 pl-0" className="ml-0"
isActive={pageToggle === filteredItems[0].key} isActive={pageToggle === filteredItems[0].key}
onClick={() => { onClick={() => {
if ( if (
@ -490,7 +490,7 @@ export default function Settings() {
<> <>
<SidebarGroupLabel <SidebarGroupLabel
className={cn( className={cn(
"ml-0 cursor-default pl-0 text-sm", "ml-2 cursor-default pl-0 text-sm",
filteredItems.some( filteredItems.some(
(item) => pageToggle === item.key, (item) => pageToggle === item.key,
) )
@ -500,7 +500,7 @@ export default function Settings() {
> >
{group.label} {group.label}
</SidebarGroupLabel> </SidebarGroupLabel>
<SidebarMenuSub className="mx-1 border-0"> <SidebarMenuSub className="mx-2 border-0">
{filteredItems.map((item) => ( {filteredItems.map((item) => (
<SidebarMenuSubItem key={item.key}> <SidebarMenuSubItem key={item.key}>
<SidebarMenuSubButton <SidebarMenuSubButton

View File

@ -405,7 +405,7 @@ export default function AuthenticationView({
// Users section // Users section
const UsersSection = ( const UsersSection = (
<> <>
<div className="mb-5 flex flex-row items-center justify-between gap-2 md:pr-2"> <div className="mb-5 flex flex-row items-center justify-between gap-2 md:mr-3">
<div className="flex flex-col items-start"> <div className="flex flex-col items-start">
<Heading as="h4" className="mb-2"> <Heading as="h4" className="mb-2">
{t("users.management.title")} {t("users.management.title")}
@ -425,7 +425,7 @@ export default function AuthenticationView({
</Button> </Button>
</div> </div>
<div className="mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"> <div className="mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
<div className="scrollbar-container flex-1 overflow-hidden rounded-lg border border-border bg-background_alt md:mr-2"> <div className="scrollbar-container flex-1 overflow-hidden rounded-lg border border-border bg-background_alt md:mr-3">
<div className="h-full overflow-auto"> <div className="h-full overflow-auto">
<Table> <Table>
<TableHeader className="sticky top-0 bg-muted/50"> <TableHeader className="sticky top-0 bg-muted/50">
@ -594,7 +594,7 @@ export default function AuthenticationView({
// Roles section // Roles section
const RolesSection = ( const RolesSection = (
<> <>
<div className="mb-5 flex flex-row items-center justify-between gap-2 md:pr-2"> <div className="mb-5 flex flex-row items-center justify-between gap-2 md:mr-3">
<div className="flex flex-col items-start"> <div className="flex flex-col items-start">
<Heading as="h4" className="mb-2"> <Heading as="h4" className="mb-2">
{t("roles.management.title")} {t("roles.management.title")}
@ -614,7 +614,7 @@ export default function AuthenticationView({
</Button> </Button>
</div> </div>
<div className="mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"> <div className="mb-6 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
<div className="scrollbar-container flex-1 overflow-hidden rounded-lg border border-border bg-background_alt md:mr-2"> <div className="scrollbar-container flex-1 overflow-hidden rounded-lg border border-border bg-background_alt md:mr-3">
<div className="h-full overflow-auto"> <div className="h-full overflow-auto">
<Table> <Table>
<TableHeader className="sticky top-0 bg-muted/50"> <TableHeader className="sticky top-0 bg-muted/50">
@ -784,7 +784,7 @@ export default function AuthenticationView({
return ( return (
<div className="flex size-full flex-col"> <div className="flex size-full flex-col">
<Toaster position="top-center" closeButton={true} /> <Toaster position="top-center" closeButton={true} />
<div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto pb-2 md:order-none md:mr-2 md:mt-0"> <div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto pb-2 md:order-none md:mr-3 md:mt-0">
{section === "users" && UsersSection} {section === "users" && UsersSection}
{section === "roles" && RolesSection} {section === "roles" && RolesSection}
{!section && ( {!section && (

View File

@ -433,7 +433,7 @@ export default function MasksAndZonesView({
{cameraConfig && editingPolygons && ( {cameraConfig && editingPolygons && (
<div className="flex size-full flex-col md:flex-row"> <div className="flex size-full flex-col md:flex-row">
<Toaster position="top-center" closeButton={true} /> <Toaster position="top-center" closeButton={true} />
<div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto rounded-lg border-[1px] border-secondary-foreground bg-background_alt p-2 md:order-none md:mr-2 md:mt-0 md:w-3/12"> <div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto rounded-lg border-[1px] border-secondary-foreground bg-background_alt p-2 md:order-none md:mr-3 md:mt-0 md:w-3/12">
{editPane == "zone" && ( {editPane == "zone" && (
<ZoneEditPane <ZoneEditPane
polygons={editingPolygons} polygons={editingPolygons}
@ -696,7 +696,7 @@ export default function MasksAndZonesView({
</div> </div>
<div <div
ref={containerRef} ref={containerRef}
className="flex max-h-[50%] md:h-dvh md:max-h-full md:w-7/12 md:grow" className="flex max-h-[50%] md:mr-3 md:h-dvh md:max-h-full md:w-7/12 md:grow"
> >
<div className="mx-auto flex size-full flex-row justify-center"> <div className="mx-auto flex size-full flex-row justify-center">
{cameraConfig && {cameraConfig &&

View File

@ -191,7 +191,7 @@ export default function MotionTunerView({
return ( return (
<div className="flex size-full flex-col md:flex-row"> <div className="flex size-full flex-col md:flex-row">
<Toaster position="top-center" closeButton={true} /> <Toaster position="top-center" closeButton={true} />
<div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto rounded-lg border-[1px] border-secondary-foreground bg-background_alt p-2 md:order-none md:mr-2 md:mt-0 md:w-3/12"> <div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto rounded-lg border-[1px] border-secondary-foreground bg-background_alt p-2 md:order-none md:mr-3 md:mt-0 md:w-3/12">
<Heading as="h4" className="mb-2"> <Heading as="h4" className="mb-2">
{t("motionDetectionTuner.title")} {t("motionDetectionTuner.title")}
</Heading> </Heading>
@ -325,7 +325,7 @@ export default function MotionTunerView({
</div> </div>
{cameraConfig ? ( {cameraConfig ? (
<div className="flex max-h-[70%] md:h-dvh md:max-h-full md:w-7/12 md:grow"> <div className="flex max-h-[70%] md:mr-3 md:h-dvh md:max-h-full md:w-7/12 md:grow">
<div className="size-full min-h-10"> <div className="size-full min-h-10">
<AutoUpdatingCameraImage <AutoUpdatingCameraImage
camera={cameraConfig.name} camera={cameraConfig.name}

View File

@ -385,7 +385,7 @@ export default function NotificationView({
<> <>
<div className="flex size-full flex-col md:flex-row"> <div className="flex size-full flex-col md:flex-row">
<Toaster position="top-center" closeButton={true} /> <Toaster position="top-center" closeButton={true} />
<div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto p-2 md:order-none"> <div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto px-2 md:order-none">
<div <div
className={cn( className={cn(
isAdmin && "grid w-full grid-cols-1 gap-4 md:grid-cols-2", isAdmin && "grid w-full grid-cols-1 gap-4 md:grid-cols-2",

View File

@ -78,7 +78,11 @@ export default function TriggerView({
const { data: config, mutate: updateConfig } = const { data: config, mutate: updateConfig } =
useSWR<FrigateConfig>("config"); useSWR<FrigateConfig>("config");
const { data: trigger_status, mutate } = useSWR( const { data: trigger_status, mutate } = useSWR(
`/triggers/status/${selectedCamera}`, config?.cameras[selectedCamera]?.semantic_search?.triggers &&
Object.keys(config.cameras[selectedCamera].semantic_search.triggers)
.length > 0
? `/triggers/status/${selectedCamera}`
: null,
{ {
revalidateOnFocus: false, revalidateOnFocus: false,
}, },
@ -414,7 +418,7 @@ export default function TriggerView({
return ( return (
<div className="flex size-full flex-col md:flex-row"> <div className="flex size-full flex-col md:flex-row">
<Toaster position="top-center" closeButton={true} /> <Toaster position="top-center" closeButton={true} />
<div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto pb-2 md:order-none"> <div className="scrollbar-container order-last mb-10 mt-2 flex h-full w-full flex-col overflow-y-auto pb-2 md:order-none md:mr-3 md:mt-0">
{!isSemanticSearchEnabled ? ( {!isSemanticSearchEnabled ? (
<div className="mb-5 flex flex-row items-center justify-between gap-2"> <div className="mb-5 flex flex-row items-center justify-between gap-2">
<div className="flex flex-col items-start"> <div className="flex flex-col items-start">