mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
Fix eslint issues
This commit is contained in:
@@ -116,7 +116,7 @@ function CreateApiKeyDialog({ open, onOpenChange, onKeyCreated }: CreateApiKeyDi
|
|||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Create API Key</DialogTitle>
|
<DialogTitle>Create API Key</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<form onSubmit={handleSubmit} className="space-y-4">
|
<form onSubmit={(e) => void handleSubmit(e)} className="space-y-4">
|
||||||
{error && (
|
{error && (
|
||||||
<Alert variant="destructive">
|
<Alert variant="destructive">
|
||||||
<AlertDescription>{error}</AlertDescription>
|
<AlertDescription>{error}</AlertDescription>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Badge } from "@/components/ui/badge";
|
|||||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||||
import { Trash2, Copy, Check, X, ChevronDown, ChevronRight } from "lucide-react";
|
import { Trash2, Copy, Check, X, ChevronDown, ChevronRight } from "lucide-react";
|
||||||
import { apiKeysApi } from "@/lib/api";
|
import { apiKeysApi } from "@/lib/api";
|
||||||
import { ApiKey, KeyPermissionResponse, PermissionMode } from "@/types/apiKey";
|
import { type ApiKey, type KeyPermissionResponse, PermissionMode } from "@/types/apiKey";
|
||||||
import CreateApiKeyDialog from "@/components/apikeys/CreateApiKeyDialog";
|
import CreateApiKeyDialog from "@/components/apikeys/CreateApiKeyDialog";
|
||||||
import { format, formatDistanceToNow } from "date-fns";
|
import { format, formatDistanceToNow } from "date-fns";
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ function ApiKeysSection() {
|
|||||||
const [loadingPermissions, setLoadingPermissions] = useState<Record<number, boolean>>({});
|
const [loadingPermissions, setLoadingPermissions] = useState<Record<number, boolean>>({});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchKeys();
|
void fetchKeys();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const fetchKeys = async () => {
|
const fetchKeys = async () => {
|
||||||
@@ -52,7 +52,7 @@ function ApiKeysSection() {
|
|||||||
|
|
||||||
const handleKeyCreated = (plainTextKey: string) => {
|
const handleKeyCreated = (plainTextKey: string) => {
|
||||||
setNewKeyPlainText(plainTextKey);
|
setNewKeyPlainText(plainTextKey);
|
||||||
fetchKeys();
|
void fetchKeys();
|
||||||
setCreateDialogOpen(false);
|
setCreateDialogOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ function ApiKeysSection() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await apiKeysApi.delete(id);
|
await apiKeysApi.delete(id);
|
||||||
fetchKeys();
|
void fetchKeys();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
alert(err instanceof Error ? err.message : "Failed to delete API key");
|
alert(err instanceof Error ? err.message : "Failed to delete API key");
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ function ApiKeysSection() {
|
|||||||
} else {
|
} else {
|
||||||
setExpandedRowId(key.id);
|
setExpandedRowId(key.id);
|
||||||
if (key.permission_mode === PermissionMode.PerInstance) {
|
if (key.permission_mode === PermissionMode.PerInstance) {
|
||||||
fetchPermissions(key.id);
|
void fetchPermissions(key.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -136,7 +136,7 @@ function ApiKeysSection() {
|
|||||||
<code className="flex-1 p-3 bg-white dark:bg-gray-900 border border-green-300 dark:border-green-800 rounded font-mono text-sm break-all">
|
<code className="flex-1 p-3 bg-white dark:bg-gray-900 border border-green-300 dark:border-green-800 rounded font-mono text-sm break-all">
|
||||||
{newKeyPlainText}
|
{newKeyPlainText}
|
||||||
</code>
|
</code>
|
||||||
<Button onClick={handleCopyKey} variant="outline" size="sm">
|
<Button onClick={() => void handleCopyKey()} variant="outline" size="sm">
|
||||||
{copiedKey ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
{copiedKey ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -216,7 +216,7 @@ function ApiKeysSection() {
|
|||||||
size="icon"
|
size="icon"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleDeleteKey(key.id, key.name);
|
void handleDeleteKey(key.id, key.name);
|
||||||
}}
|
}}
|
||||||
title="Delete key"
|
title="Delete key"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user