mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	UI tweaks / fixes (#11479)
* Update coloring of logs button * Fix paging after submitting * Fix sorting * Add icon
This commit is contained in:
		
							parent
							
								
									592b645231
								
							
						
					
					
						commit
						c49be0a47f
					
				@ -227,9 +227,9 @@ def events():
 | 
			
		||||
        elif sort == "score_desc":
 | 
			
		||||
            order_by = Event.data["score"].desc()
 | 
			
		||||
        elif sort == "date_asc":
 | 
			
		||||
            Event.start_time.asc()
 | 
			
		||||
            order_by = Event.start_time.asc()
 | 
			
		||||
        elif sort == "date_desc":
 | 
			
		||||
            Event.start_time.desc()
 | 
			
		||||
            order_by = Event.start_time.desc()
 | 
			
		||||
    else:
 | 
			
		||||
        order_by = Event.start_time.desc()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -13,6 +13,7 @@ import { toast } from "sonner";
 | 
			
		||||
import { isDesktop } from "react-device-detect";
 | 
			
		||||
import ActivityIndicator from "@/components/indicators/activity-indicator";
 | 
			
		||||
import { cn } from "@/lib/utils";
 | 
			
		||||
import { MdVerticalAlignBottom } from "react-icons/md";
 | 
			
		||||
 | 
			
		||||
const logTypes = ["frigate", "go2rtc", "nginx"] as const;
 | 
			
		||||
type LogType = (typeof logTypes)[number];
 | 
			
		||||
@ -381,7 +382,7 @@ function Logs() {
 | 
			
		||||
 | 
			
		||||
      {initialScroll && !endVisible && (
 | 
			
		||||
        <Button
 | 
			
		||||
          className="absolute bottom-8 left-[50%] z-20 -translate-x-[50%] rounded-md bg-secondary-foreground p-2 text-primary"
 | 
			
		||||
          className="absolute bottom-8 left-[50%] z-20 flex -translate-x-[50%] items-center gap-1 rounded-md p-2"
 | 
			
		||||
          onClick={() =>
 | 
			
		||||
            contentRef.current?.scrollTo({
 | 
			
		||||
              top: contentRef.current?.scrollHeight,
 | 
			
		||||
@ -389,6 +390,7 @@ function Logs() {
 | 
			
		||||
            })
 | 
			
		||||
          }
 | 
			
		||||
        >
 | 
			
		||||
          <MdVerticalAlignBottom />
 | 
			
		||||
          Jump to Bottom
 | 
			
		||||
        </Button>
 | 
			
		||||
      )}
 | 
			
		||||
 | 
			
		||||
@ -211,6 +211,7 @@ export default function SubmitPlus() {
 | 
			
		||||
            ...data.slice(0, pageIndex),
 | 
			
		||||
            [
 | 
			
		||||
              ...data[pageIndex].slice(0, index),
 | 
			
		||||
              { ...data[pageIndex][index], plus_id: "new_upload" },
 | 
			
		||||
              ...data[pageIndex].slice(index + 1),
 | 
			
		||||
            ],
 | 
			
		||||
            ...data.slice(pageIndex + 1),
 | 
			
		||||
@ -275,17 +276,14 @@ export default function SubmitPlus() {
 | 
			
		||||
            </DialogContent>
 | 
			
		||||
          </Dialog>
 | 
			
		||||
 | 
			
		||||
          {events?.map((event, eIdx) => {
 | 
			
		||||
            if (event.data.type != "object") {
 | 
			
		||||
          {events?.map((event) => {
 | 
			
		||||
            if (event.data.type != "object" || event.plus_id) {
 | 
			
		||||
              return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            const lastRow = eIdx == events.length - 1;
 | 
			
		||||
 | 
			
		||||
            return (
 | 
			
		||||
              <div
 | 
			
		||||
                key={event.id}
 | 
			
		||||
                ref={lastRow ? lastEventRef : null}
 | 
			
		||||
                className="relative flex aspect-video w-full cursor-pointer items-center justify-center rounded-lg bg-black md:rounded-2xl"
 | 
			
		||||
                onClick={() => setUpload(event)}
 | 
			
		||||
              >
 | 
			
		||||
@ -324,7 +322,7 @@ export default function SubmitPlus() {
 | 
			
		||||
              </div>
 | 
			
		||||
            );
 | 
			
		||||
          })}
 | 
			
		||||
 | 
			
		||||
          {!isValidating && !isDone && <div ref={lastEventRef} />}
 | 
			
		||||
          {isValidating && <ActivityIndicator />}
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user