From 4e0ca7c2bad4ecbac68086fe2497b42f0d9cfd00 Mon Sep 17 00:00:00 2001 From: henrygd Date: Mon, 15 Sep 2025 18:04:13 -0400 Subject: [PATCH] formatting (biome) --- agent/deltatracker/deltatracker.go | 31 --- internal/site/src/components/add-system.tsx | 28 +- .../src/components/alerts-history-columns.tsx | 16 +- .../src/components/alerts/alert-button.tsx | 10 +- .../src/components/alerts/alerts-sheet.tsx | 27 +- .../site/src/components/command-palette.tsx | 13 +- .../site/src/components/copy-to-clipboard.tsx | 4 +- .../site/src/components/install-dropdowns.tsx | 6 +- internal/site/src/components/lang-toggle.tsx | 5 +- .../site/src/components/login/auth-form.tsx | 26 +- .../src/components/login/forgot-pass-form.tsx | 13 +- internal/site/src/components/login/login.tsx | 16 +- .../site/src/components/login/otp-forms.tsx | 12 +- internal/site/src/components/mode-toggle.tsx | 3 +- internal/site/src/components/navbar.tsx | 24 +- internal/site/src/components/router.tsx | 2 +- .../routes/settings/tokens-fingerprints.tsx | 2 +- internal/site/src/components/spinner.tsx | 2 +- .../systems-table/systems-table-columns.tsx | 56 ++-- .../systems-table/systems-table.tsx | 250 +++++++++--------- internal/site/src/lib/utils.ts | 2 +- 21 files changed, 253 insertions(+), 295 deletions(-) diff --git a/agent/deltatracker/deltatracker.go b/agent/deltatracker/deltatracker.go index 99098d32..70ae83ec 100644 --- a/agent/deltatracker/deltatracker.go +++ b/agent/deltatracker/deltatracker.go @@ -78,34 +78,3 @@ func (t *DeltaTracker[K, V]) Cycle() { t.previous = t.current t.current = make(map[K]V) } - -// // --- Example 1: Integer values (unchanged) --- -// fmt.Println("--- 🚀 Example with int64 values (PIDs) ---") -// pidTracker := NewDeltaTracker[int, int64]() -// pidTracker.Set(101, 20000) -// pidTracker.Cycle() -// pidTracker.Set(101, 22500) -// fmt.Println("PID Deltas:", pidTracker.Deltas()) -// fmt.Println("----------------------------------------") - -// // --- Example 2: Float values (New!) --- -// fmt.Println("\n--- 🚀 Example with float64 values (CPU Load) ---") -// // Track the 1-minute load average for different servers. -// loadTracker := NewDeltaTracker[string, float64]() - -// // Minute 1 -// loadTracker.Set("server-alpha", 0.74) -// loadTracker.Set("server-beta", 1.15) -// fmt.Println("Minute 1 Loads:", loadTracker.Deltas()) -// loadTracker.Cycle() - -// // Minute 2 -// loadTracker.Set("server-alpha", 0.68) // Load decreased -// loadTracker.Set("server-beta", 1.55) // Load increased -// loadTracker.Set("server-gamma", 0.25) // New server - -// minute2Deltas := loadTracker.Deltas() -// fmt.Println("Minute 2 Load Deltas:", minute2Deltas) -// fmt.Printf("Change in alpha's load: %.2f\n", minute2Deltas["server-alpha"]) -// fmt.Printf("Change in beta's load: %.2f\n", minute2Deltas["server-beta"]) -// fmt.Println("----------------------------------------") diff --git a/internal/site/src/components/add-system.tsx b/internal/site/src/components/add-system.tsx index 9f1e3dc7..02241b72 100644 --- a/internal/site/src/components/add-system.tsx +++ b/internal/site/src/components/add-system.tsx @@ -1,5 +1,9 @@ -import { Trans } from "@lingui/react/macro" import { t } from "@lingui/core/macro" +import { Trans } from "@lingui/react/macro" +import { useStore } from "@nanostores/react" +import { getPagePath } from "@nanostores/router" +import { ChevronDownIcon, ExternalLinkIcon, PlusIcon } from "lucide-react" +import { memo, useEffect, useRef, useState } from "react" import { Button } from "@/components/ui/button" import { Dialog, @@ -10,34 +14,30 @@ import { DialogTitle, DialogTrigger, } from "@/components/ui/dialog" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { isReadOnlyUser, pb } from "@/lib/api" +import { SystemStatus } from "@/lib/enums" import { $publicKey } from "@/lib/stores" import { cn, generateToken, tokenMap, useBrowserStorage } from "@/lib/utils" -import { pb, isReadOnlyUser } from "@/lib/api" -import { useStore } from "@nanostores/react" -import { ChevronDownIcon, ExternalLinkIcon, PlusIcon } from "lucide-react" -import { memo, useEffect, useRef, useState } from "react" -import { $router, basePath, Link, navigate } from "./router" -import { SystemRecord } from "@/types" -import { SystemStatus } from "@/lib/enums" -import { AppleIcon, DockerIcon, FreeBsdIcon, TuxIcon, WindowsIcon } from "./ui/icons" -import { InputCopy } from "./ui/input-copy" -import { getPagePath } from "@nanostores/router" +import type { SystemRecord } from "@/types" import { copyDockerCompose, copyDockerRun, copyLinuxCommand, copyWindowsCommand, - DropdownItem, + type DropdownItem, InstallDropdown, } from "./install-dropdowns" +import { $router, basePath, Link, navigate } from "./router" import { DropdownMenu, DropdownMenuTrigger } from "./ui/dropdown-menu" +import { AppleIcon, DockerIcon, FreeBsdIcon, TuxIcon, WindowsIcon } from "./ui/icons" +import { InputCopy } from "./ui/input-copy" export function AddSystemButton({ className }: { className?: string }) { const [open, setOpen] = useState(false) - let opened = useRef(false) + const opened = useRef(false) if (open) { opened.current = true } diff --git a/internal/site/src/components/alerts-history-columns.tsx b/internal/site/src/components/alerts-history-columns.tsx index 390bd5cd..b3162e23 100644 --- a/internal/site/src/components/alerts-history-columns.tsx +++ b/internal/site/src/components/alerts-history-columns.tsx @@ -1,11 +1,11 @@ -import { ColumnDef } from "@tanstack/react-table" -import { AlertsHistoryRecord } from "@/types" -import { Button } from "@/components/ui/button" -import { Badge } from "@/components/ui/badge" -import { formatShortDate, toFixedFloat, formatDuration, cn } from "@/lib/utils" -import { alertInfo } from "@/lib/alerts" -import { Trans } from "@lingui/react/macro" import { t } from "@lingui/core/macro" +import { Trans } from "@lingui/react/macro" +import type { ColumnDef } from "@tanstack/react-table" +import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { alertInfo } from "@/lib/alerts" +import { cn, formatDuration, formatShortDate, toFixedFloat } from "@/lib/utils" +import type { AlertsHistoryRecord } from "@/types" export const alertsHistoryColumns: ColumnDef[] = [ { @@ -38,7 +38,7 @@ export const alertsHistoryColumns: ColumnDef[] = [ ), cell: ({ getValue, row }) => { - let name = getValue() as string + const name = getValue() as string const info = alertInfo[row.original.name] const Icon = info?.icon diff --git a/internal/site/src/components/alerts/alert-button.tsx b/internal/site/src/components/alerts/alert-button.tsx index 6c3ddfe1..446e516f 100644 --- a/internal/site/src/components/alerts/alert-button.tsx +++ b/internal/site/src/components/alerts/alert-button.tsx @@ -1,13 +1,13 @@ import { t } from "@lingui/core/macro" -import { memo, useMemo, useState } from "react" import { useStore } from "@nanostores/react" -import { $alerts } from "@/lib/stores" import { BellIcon } from "lucide-react" -import { cn } from "@/lib/utils" +import { memo, useMemo, useState } from "react" import { Button } from "@/components/ui/button" -import { SystemRecord } from "@/types" -import { AlertDialogContent } from "./alerts-sheet" import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet" +import { $alerts } from "@/lib/stores" +import { cn } from "@/lib/utils" +import type { SystemRecord } from "@/types" +import { AlertDialogContent } from "./alerts-sheet" export default memo(function AlertsButton({ system }: { system: SystemRecord }) { const [opened, setOpened] = useState(false) diff --git a/internal/site/src/components/alerts/alerts-sheet.tsx b/internal/site/src/components/alerts/alerts-sheet.tsx index 561985ce..80aa18bd 100644 --- a/internal/site/src/components/alerts/alerts-sheet.tsx +++ b/internal/site/src/components/alerts/alerts-sheet.tsx @@ -1,21 +1,20 @@ import { t } from "@lingui/core/macro" -import { Trans, Plural } from "@lingui/react/macro" -import { $alerts, $systems } from "@/lib/stores" -import { cn, debounce } from "@/lib/utils" -import { alertInfo } from "@/lib/alerts" -import { Switch } from "@/components/ui/switch" -import { AlertInfo, AlertRecord, SystemRecord } from "@/types" -import { lazy, memo, Suspense, useMemo, useState } from "react" -import { toast } from "@/components/ui/use-toast" +import { Plural, Trans } from "@lingui/react/macro" import { useStore } from "@nanostores/react" import { getPagePath } from "@nanostores/router" -import { Checkbox } from "@/components/ui/checkbox" -import { DialogTitle, DialogDescription } from "@/components/ui/dialog" -import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs" -import { ServerIcon, GlobeIcon } from "lucide-react" +import { GlobeIcon, ServerIcon } from "lucide-react" +import { lazy, memo, Suspense, useMemo, useState } from "react" import { $router, Link } from "@/components/router" -import { DialogHeader } from "@/components/ui/dialog" +import { Checkbox } from "@/components/ui/checkbox" +import { DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog" +import { Switch } from "@/components/ui/switch" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { toast } from "@/components/ui/use-toast" +import { alertInfo } from "@/lib/alerts" import { pb } from "@/lib/api" +import { $alerts, $systems } from "@/lib/stores" +import { cn, debounce } from "@/lib/utils" +import type { AlertInfo, AlertRecord, SystemRecord } from "@/types" const Slider = lazy(() => import("@/components/ui/slider")) @@ -172,7 +171,7 @@ export function AlertContent({ const [checked, setChecked] = useState(global ? false : !!alert) const [min, setMin] = useState(alert?.min || 10) - const [value, setValue] = useState(alert?.value || (singleDescription ? 0 : alertData.start ?? 80)) + const [value, setValue] = useState(alert?.value || (singleDescription ? 0 : (alertData.start ?? 80))) const Icon = alertData.icon diff --git a/internal/site/src/components/command-palette.tsx b/internal/site/src/components/command-palette.tsx index 0d419d5d..7da02bec 100644 --- a/internal/site/src/components/command-palette.tsx +++ b/internal/site/src/components/command-palette.tsx @@ -1,3 +1,7 @@ +import { t } from "@lingui/core/macro" +import { Trans } from "@lingui/react/macro" +import { getPagePath } from "@nanostores/router" +import { DialogDescription } from "@radix-ui/react-dialog" import { AlertOctagonIcon, BookIcon, @@ -10,7 +14,7 @@ import { SettingsIcon, UsersIcon, } from "lucide-react" - +import { memo, useEffect, useMemo } from "react" import { CommandDialog, CommandEmpty, @@ -21,15 +25,10 @@ import { CommandSeparator, CommandShortcut, } from "@/components/ui/command" -import { memo, useEffect, useMemo } from "react" +import { isAdmin } from "@/lib/api" import { $systems } from "@/lib/stores" import { getHostDisplayValue, listen } from "@/lib/utils" import { $router, basePath, navigate, prependBasePath } from "./router" -import { Trans } from "@lingui/react/macro" -import { t } from "@lingui/core/macro" -import { getPagePath } from "@nanostores/router" -import { DialogDescription } from "@radix-ui/react-dialog" -import { isAdmin } from "@/lib/api" export default memo(function CommandPalette({ open, setOpen }: { open: boolean; setOpen: (open: boolean) => void }) { useEffect(() => { diff --git a/internal/site/src/components/copy-to-clipboard.tsx b/internal/site/src/components/copy-to-clipboard.tsx index 98aba977..403a4b8c 100644 --- a/internal/site/src/components/copy-to-clipboard.tsx +++ b/internal/site/src/components/copy-to-clipboard.tsx @@ -1,8 +1,8 @@ -import { Trans } from "@lingui/react/macro"; +import { Trans } from "@lingui/react/macro" import { useEffect, useMemo, useRef } from "react" +import { $copyContent } from "@/lib/stores" import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./ui/dialog" import { Textarea } from "./ui/textarea" -import { $copyContent } from "@/lib/stores" export default function CopyToClipboard({ content }: { content: string }) { return ( diff --git a/internal/site/src/components/install-dropdowns.tsx b/internal/site/src/components/install-dropdowns.tsx index c9cfe0c5..3d573144 100644 --- a/internal/site/src/components/install-dropdowns.tsx +++ b/internal/site/src/components/install-dropdowns.tsx @@ -1,7 +1,7 @@ -import { memo } from "react" -import { DropdownMenuContent, DropdownMenuItem } from "./ui/dropdown-menu" -import { copyToClipboard, getHubURL } from "@/lib/utils" import { i18n } from "@lingui/core" +import { memo } from "react" +import { copyToClipboard, getHubURL } from "@/lib/utils" +import { DropdownMenuContent, DropdownMenuItem } from "./ui/dropdown-menu" // const isbeta = beszel.hub_version.includes("beta") // const imagetag = isbeta ? ":edge" : "" diff --git a/internal/site/src/components/lang-toggle.tsx b/internal/site/src/components/lang-toggle.tsx index 2441aab9..49c337e3 100644 --- a/internal/site/src/components/lang-toggle.tsx +++ b/internal/site/src/components/lang-toggle.tsx @@ -1,11 +1,10 @@ +import { useLingui } from "@lingui/react/macro" import { LanguagesIcon } from "lucide-react" - import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu" +import { dynamicActivate } from "@/lib/i18n" import languages from "@/lib/languages" import { cn } from "@/lib/utils" -import { useLingui } from "@lingui/react/macro" -import { dynamicActivate } from "@/lib/i18n" export function LangToggle() { const { i18n } = useLingui() diff --git a/internal/site/src/components/login/auth-form.tsx b/internal/site/src/components/login/auth-form.tsx index 49709b94..ad2ab91f 100644 --- a/internal/site/src/components/login/auth-form.tsx +++ b/internal/site/src/components/login/auth-form.tsx @@ -1,19 +1,19 @@ import { t } from "@lingui/core/macro" import { Trans } from "@lingui/react/macro" -import { cn } from "@/lib/utils" +import { getPagePath } from "@nanostores/router" +import { KeyIcon, LoaderCircle, LockIcon, LogInIcon, MailIcon } from "lucide-react" +import type { AuthMethodsList, AuthProviderInfo, OAuth2AuthConfig } from "pocketbase" +import { useCallback, useEffect, useState } from "react" +import * as v from "valibot" import { buttonVariants } from "@/components/ui/button" +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" -import { KeyIcon, LoaderCircle, LockIcon, LogInIcon, MailIcon } from "lucide-react" -import { $authenticated } from "@/lib/stores" -import * as v from "valibot" -import { toast } from "../ui/use-toast" -import { Dialog, DialogContent, DialogTrigger, DialogHeader, DialogTitle } from "@/components/ui/dialog" -import { useCallback, useEffect, useState } from "react" -import { AuthMethodsList, AuthProviderInfo, OAuth2AuthConfig } from "pocketbase" -import { $router, Link, prependBasePath } from "../router" -import { getPagePath } from "@nanostores/router" import { pb } from "@/lib/api" +import { $authenticated } from "@/lib/stores" +import { cn } from "@/lib/utils" +import { $router, Link, prependBasePath } from "../router" +import { toast } from "../ui/use-toast" import { OtpInputForm } from "./otp-forms" const honeypot = v.literal("") @@ -83,9 +83,9 @@ export function UserAuthForm({ const result = v.safeParse(Schema, data) if (!result.success) { console.log(result) - let errors = {} + const errors = {} for (const issue of result.issues) { - // @ts-ignore + // @ts-expect-error errors[issue.path[0].key] = issue.message } setErrors(errors) @@ -96,7 +96,7 @@ export function UserAuthForm({ if (isFirstRun) { // check that passwords match if (password !== passwordConfirm) { - let msg = "Passwords do not match" + const msg = "Passwords do not match" setErrors({ passwordConfirm: msg }) return } diff --git a/internal/site/src/components/login/forgot-pass-form.tsx b/internal/site/src/components/login/forgot-pass-form.tsx index 8f928d79..42a2bd81 100644 --- a/internal/site/src/components/login/forgot-pass-form.tsx +++ b/internal/site/src/components/login/forgot-pass-form.tsx @@ -1,15 +1,14 @@ -import { Trans } from "@lingui/react/macro" import { t } from "@lingui/core/macro" +import { Trans } from "@lingui/react/macro" import { LoaderCircle, MailIcon, SendHorizonalIcon } from "lucide-react" +import { useCallback, useState } from "react" +import { pb } from "@/lib/api" +import { cn } from "@/lib/utils" +import { buttonVariants } from "../ui/button" +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "../ui/dialog" import { Input } from "../ui/input" import { Label } from "../ui/label" -import { useCallback, useState } from "react" import { toast } from "../ui/use-toast" -import { buttonVariants } from "../ui/button" -import { cn } from "@/lib/utils" -import { Dialog, DialogHeader } from "../ui/dialog" -import { DialogContent, DialogTrigger, DialogTitle } from "../ui/dialog" -import { pb } from "@/lib/api" const showLoginFaliedToast = () => { toast({ diff --git a/internal/site/src/components/login/login.tsx b/internal/site/src/components/login/login.tsx index 30ae6cf0..b03284f7 100644 --- a/internal/site/src/components/login/login.tsx +++ b/internal/site/src/components/login/login.tsx @@ -1,14 +1,14 @@ import { t } from "@lingui/core/macro" -import { UserAuthForm } from "@/components/login/auth-form" -import { Logo } from "../logo" -import { useEffect, useMemo, useState } from "react" import { useStore } from "@nanostores/react" -import ForgotPassword from "./forgot-pass-form" -import { $router } from "../router" -import { AuthMethodsList } from "pocketbase" -import { useTheme } from "../theme-provider" +import type { AuthMethodsList } from "pocketbase" +import { useEffect, useMemo, useState } from "react" +import { UserAuthForm } from "@/components/login/auth-form" import { pb } from "@/lib/api" +import { Logo } from "../logo" import { ModeToggle } from "../mode-toggle" +import { $router } from "../router" +import { useTheme } from "../theme-provider" +import ForgotPassword from "./forgot-pass-form" import { OtpRequestForm } from "./otp-forms" export default function () { @@ -53,7 +53,7 @@ export default function () {
diff --git a/internal/site/src/components/login/otp-forms.tsx b/internal/site/src/components/login/otp-forms.tsx index e6f01b21..d5314cd4 100644 --- a/internal/site/src/components/login/otp-forms.tsx +++ b/internal/site/src/components/login/otp-forms.tsx @@ -1,15 +1,15 @@ +import { Trans } from "@lingui/react/macro" +import { LoaderCircle, MailIcon, SendHorizonalIcon } from "lucide-react" import { useCallback, useState } from "react" +import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/otp" import { pb } from "@/lib/api" import { $authenticated } from "@/lib/stores" -import { InputOTP, InputOTPGroup, InputOTPSlot } from "@/components/ui/otp" -import { Trans } from "@lingui/react/macro" -import { showLoginFaliedToast } from "./auth-form" import { cn } from "@/lib/utils" -import { MailIcon, LoaderCircle, SendHorizonalIcon } from "lucide-react" -import { Label } from "../ui/label" +import { $router } from "../router" import { buttonVariants } from "../ui/button" import { Input } from "../ui/input" -import { $router } from "../router" +import { Label } from "../ui/label" +import { showLoginFaliedToast } from "./auth-form" export function OtpInputForm({ otpId, mfaId }: { otpId: string; mfaId: string }) { const [value, setValue] = useState("") diff --git a/internal/site/src/components/mode-toggle.tsx b/internal/site/src/components/mode-toggle.tsx index 4ee4e3b6..acde0d4b 100644 --- a/internal/site/src/components/mode-toggle.tsx +++ b/internal/site/src/components/mode-toggle.tsx @@ -1,8 +1,7 @@ import { t } from "@lingui/core/macro" import { MoonStarIcon, SunIcon } from "lucide-react" - -import { Button } from "@/components/ui/button" import { useTheme } from "@/components/theme-provider" +import { Button } from "@/components/ui/button" export function ModeToggle() { const { theme, setTheme } = useTheme() diff --git a/internal/site/src/components/navbar.tsx b/internal/site/src/components/navbar.tsx index 0b2e81a1..4c72385c 100644 --- a/internal/site/src/components/navbar.tsx +++ b/internal/site/src/components/navbar.tsx @@ -1,6 +1,5 @@ import { Trans } from "@lingui/react/macro" -import { useState, lazy, Suspense } from "react" -import { Button, buttonVariants } from "@/components/ui/button" +import { getPagePath } from "@nanostores/router" import { DatabaseBackupIcon, LogOutIcon, @@ -11,23 +10,24 @@ import { UserIcon, UsersIcon, } from "lucide-react" -import { $router, basePath, Link, prependBasePath } from "./router" -import { LangToggle } from "./lang-toggle" -import { ModeToggle } from "./mode-toggle" -import { Logo } from "./logo" -import { cn, runOnce } from "@/lib/utils" -import { isReadOnlyUser, isAdmin, logOut, pb } from "@/lib/api" +import { lazy, Suspense, useState } from "react" +import { Button, buttonVariants } from "@/components/ui/button" import { DropdownMenu, - DropdownMenuTrigger, DropdownMenuContent, - DropdownMenuLabel, - DropdownMenuSeparator, DropdownMenuGroup, DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" +import { isAdmin, isReadOnlyUser, logOut, pb } from "@/lib/api" +import { cn, runOnce } from "@/lib/utils" import { AddSystemButton } from "./add-system" -import { getPagePath } from "@nanostores/router" +import { LangToggle } from "./lang-toggle" +import { Logo } from "./logo" +import { ModeToggle } from "./mode-toggle" +import { $router, basePath, Link, prependBasePath } from "./router" const CommandPalette = lazy(() => import("./command-palette")) diff --git a/internal/site/src/components/router.tsx b/internal/site/src/components/router.tsx index 8c822296..51bea27f 100644 --- a/internal/site/src/components/router.tsx +++ b/internal/site/src/components/router.tsx @@ -23,7 +23,7 @@ export const prependBasePath = (path: string) => (basePath + path).replaceAll("/ // prepend base path to routes for (const route in routes) { - // @ts-ignore need as const above to get nanostores to parse types properly + // @ts-expect-error need as const above to get nanostores to parse types properly routes[route] = prependBasePath(routes[route]) } diff --git a/internal/site/src/components/routes/settings/tokens-fingerprints.tsx b/internal/site/src/components/routes/settings/tokens-fingerprints.tsx index 7a988942..0c23c35e 100644 --- a/internal/site/src/components/routes/settings/tokens-fingerprints.tsx +++ b/internal/site/src/components/routes/settings/tokens-fingerprints.tsx @@ -3,13 +3,13 @@ import { Trans, useLingui } from "@lingui/react/macro" import { redirectPage } from "@nanostores/router" import { CopyIcon, + ExternalLinkIcon, FingerprintIcon, KeyIcon, MoreHorizontalIcon, RotateCwIcon, ServerIcon, Trash2Icon, - ExternalLinkIcon, } from "lucide-react" import { memo, useEffect, useMemo, useState } from "react" import { diff --git a/internal/site/src/components/spinner.tsx b/internal/site/src/components/spinner.tsx index 59f6b219..14179f4f 100644 --- a/internal/site/src/components/spinner.tsx +++ b/internal/site/src/components/spinner.tsx @@ -1,5 +1,5 @@ -import { cn } from "@/lib/utils" import { LoaderCircleIcon } from "lucide-react" +import { cn } from "@/lib/utils" export default function ({ msg, className }: { msg?: string; className?: string }) { return ( diff --git a/internal/site/src/components/systems-table/systems-table-columns.tsx b/internal/site/src/components/systems-table/systems-table-columns.tsx index 6388af65..3797f70c 100644 --- a/internal/site/src/components/systems-table/systems-table-columns.tsx +++ b/internal/site/src/components/systems-table/systems-table-columns.tsx @@ -1,6 +1,9 @@ -import { SystemRecord } from "@/types" -import { CellContext, ColumnDef, HeaderContext } from "@tanstack/react-table" -import { ClassValue } from "clsx" +import { t } from "@lingui/core/macro" +import { Trans, useLingui } from "@lingui/react/macro" +import { useStore } from "@nanostores/react" +import { getPagePath } from "@nanostores/router" +import type { CellContext, ColumnDef, HeaderContext } from "@tanstack/react-table" +import type { ClassValue } from "clsx" import { ArrowUpDownIcon, CopyIcon, @@ -15,7 +18,10 @@ import { Trash2Icon, WifiIcon, } from "lucide-react" -import { Button } from "../ui/button" +import { memo, useMemo, useRef, useState } from "react" +import { isReadOnlyUser, pb } from "@/lib/api" +import { MeterState, SystemStatus } from "@/lib/enums" +import { $longestSystemNameLen, $userSettings } from "@/lib/stores" import { cn, copyToClipboard, @@ -25,24 +31,12 @@ import { getMeterState, parseSemVer, } from "@/lib/utils" -import { EthernetIcon, GpuIcon, HourglassIcon, ThermometerIcon } from "../ui/icons" -import { useStore } from "@nanostores/react" -import { $longestSystemNameLen, $userSettings } from "@/lib/stores" -import { Trans, useLingui } from "@lingui/react/macro" -import { useMemo, useRef, useState } from "react" -import { memo } from "react" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "../ui/dropdown-menu" -import AlertButton from "../alerts/alert-button" -import { Dialog } from "../ui/dialog" +import type { SystemRecord } from "@/types" import { SystemDialog } from "../add-system" -import { AlertDialog } from "../ui/alert-dialog" +import AlertButton from "../alerts/alert-button" +import { $router, Link } from "../router" import { + AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, @@ -51,12 +45,16 @@ import { AlertDialogHeader, AlertDialogTitle, } from "../ui/alert-dialog" -import { buttonVariants } from "../ui/button" -import { t } from "@lingui/core/macro" -import { MeterState, SystemStatus } from "@/lib/enums" -import { $router, Link } from "../router" -import { getPagePath } from "@nanostores/router" -import { isReadOnlyUser, pb } from "@/lib/api" +import { Button, buttonVariants } from "../ui/button" +import { Dialog } from "../ui/dialog" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "../ui/dropdown-menu" +import { EthernetIcon, GpuIcon, HourglassIcon, ThermometerIcon } from "../ui/icons" const STATUS_COLORS = { [SystemStatus.Up]: "bg-green-500", @@ -290,7 +288,7 @@ export default function SystemsTableColumns(viewMode: "table" | "grid"): ColumnD }, { id: "actions", - // @ts-ignore + // @ts-expect-error name: () => t({ message: "Actions", comment: "Table column" }), size: 50, cell: ({ row }) => ( @@ -305,7 +303,7 @@ export default function SystemsTableColumns(viewMode: "table" | "grid"): ColumnD function sortableHeader(context: HeaderContext) { const { column } = context - // @ts-ignore + // @ts-expect-error const { Icon, hideSort, name }: { Icon: React.ElementType; name: () => string; hideSort: boolean } = column.columnDef return (