mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-11-18 11:36:17 +00:00
Update AppImage
This commit is contained in:
@@ -113,6 +113,7 @@ export function SystemLogs() {
|
|||||||
const [dateFilter, setDateFilter] = useState("now")
|
const [dateFilter, setDateFilter] = useState("now")
|
||||||
const [customDays, setCustomDays] = useState("1")
|
const [customDays, setCustomDays] = useState("1")
|
||||||
const [dateRange, setDateRange] = useState<DateRange | undefined>(undefined)
|
const [dateRange, setDateRange] = useState<DateRange | undefined>(undefined)
|
||||||
|
const [isDatePickerOpen, setIsDatePickerOpen] = useState(false)
|
||||||
|
|
||||||
const getApiUrl = (endpoint: string) => {
|
const getApiUrl = (endpoint: string) => {
|
||||||
if (typeof window !== "undefined") {
|
if (typeof window !== "undefined") {
|
||||||
@@ -452,6 +453,14 @@ export function SystemLogs() {
|
|||||||
return twoYearsAgo
|
return twoYearsAgo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleApplyDateRange = async () => {
|
||||||
|
if (dateRange?.from && dateRange?.to) {
|
||||||
|
setIsDatePickerOpen(false)
|
||||||
|
// Fetch logs with the selected date range
|
||||||
|
await fetchSystemLogs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (loading && logs.length === 0) {
|
if (loading && logs.length === 0) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center h-64">
|
<div className="flex items-center justify-center h-64">
|
||||||
@@ -626,7 +635,7 @@ export function SystemLogs() {
|
|||||||
</Select>
|
</Select>
|
||||||
|
|
||||||
{dateFilter === "custom" && (
|
{dateFilter === "custom" && (
|
||||||
<Popover>
|
<Popover open={isDatePickerOpen} onOpenChange={setIsDatePickerOpen}>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -647,15 +656,26 @@ export function SystemLogs() {
|
|||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
<PopoverContent className="w-auto p-0" align="start">
|
<PopoverContent className="w-auto p-0" align="start">
|
||||||
<Calendar
|
<div className="space-y-3">
|
||||||
initialFocus
|
<Calendar
|
||||||
mode="range"
|
initialFocus
|
||||||
defaultMonth={dateRange?.from}
|
mode="range"
|
||||||
selected={dateRange}
|
defaultMonth={dateRange?.from}
|
||||||
onSelect={setDateRange}
|
selected={dateRange}
|
||||||
numberOfMonths={2}
|
onSelect={setDateRange}
|
||||||
disabled={(date) => date > new Date() || date < getMinDate()}
|
numberOfMonths={2}
|
||||||
/>
|
disabled={(date) => date > new Date() || date < getMinDate()}
|
||||||
|
/>
|
||||||
|
<div className="px-3 pb-3 border-t border-border pt-3">
|
||||||
|
<Button
|
||||||
|
onClick={handleApplyDateRange}
|
||||||
|
disabled={!dateRange?.from || !dateRange?.to}
|
||||||
|
className="w-full"
|
||||||
|
>
|
||||||
|
Apply Filter
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -27,19 +27,27 @@ function Calendar({ className, classNames, showOutsideDays = true, ...props }: C
|
|||||||
nav_button_previous: "absolute left-1",
|
nav_button_previous: "absolute left-1",
|
||||||
nav_button_next: "absolute right-1",
|
nav_button_next: "absolute right-1",
|
||||||
table: "w-full border-collapse space-y-1",
|
table: "w-full border-collapse space-y-1",
|
||||||
head_row: "flex",
|
head_row: "grid grid-cols-7 gap-1",
|
||||||
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",
|
head_cell: "text-muted-foreground rounded-md w-9 font-normal text-[0.8rem] flex items-center justify-center",
|
||||||
row: "flex w-full mt-2",
|
row: "grid grid-cols-7 gap-1 mt-2",
|
||||||
cell: "h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",
|
cell: cn(
|
||||||
|
"h-9 w-9 text-center text-sm p-0 relative",
|
||||||
|
"[&:has([aria-selected].day-range-end)]:rounded-r-md",
|
||||||
|
"[&:has([aria-selected].day-range-start)]:rounded-l-md",
|
||||||
|
"[&:has([aria-selected].day-range-middle)]:bg-accent/50",
|
||||||
|
"[&:has([aria-selected])]:bg-accent",
|
||||||
|
"focus-within:relative focus-within:z-20",
|
||||||
|
),
|
||||||
day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
|
day: cn(buttonVariants({ variant: "ghost" }), "h-9 w-9 p-0 font-normal aria-selected:opacity-100"),
|
||||||
day_range_end: "day-range-end",
|
day_range_end: "day-range-end rounded-r-md",
|
||||||
|
day_range_start: "day-range-start rounded-l-md",
|
||||||
day_selected:
|
day_selected:
|
||||||
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",
|
||||||
day_today: "bg-accent text-accent-foreground",
|
day_today: "bg-accent text-accent-foreground font-bold",
|
||||||
day_outside:
|
day_outside:
|
||||||
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",
|
||||||
day_disabled: "text-muted-foreground opacity-50",
|
day_disabled: "text-muted-foreground opacity-50",
|
||||||
day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground",
|
day_range_middle: "aria-selected:bg-accent/50 aria-selected:text-accent-foreground rounded-none",
|
||||||
day_hidden: "invisible",
|
day_hidden: "invisible",
|
||||||
...classNames,
|
...classNames,
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user