fix video size
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
DocumentText,
|
||||
DocumentDownload,
|
||||
Refresh,
|
||||
Activity,
|
||||
InfoCircle
|
||||
@@ -26,7 +25,6 @@ const AccessLogsList: React.FC = () => {
|
||||
filters,
|
||||
updateFilters,
|
||||
resetFilters,
|
||||
exportLogs,
|
||||
refetch,
|
||||
} = useAccessLogs();
|
||||
|
||||
@@ -51,14 +49,6 @@ const AccessLogsList: React.FC = () => {
|
||||
updateFilters({ page });
|
||||
};
|
||||
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
await exportLogs();
|
||||
} catch (error) {
|
||||
console.error("خطا در خروجی گرفتن:", error);
|
||||
}
|
||||
};
|
||||
|
||||
if (error) {
|
||||
return (
|
||||
<div className="p-6">
|
||||
@@ -98,15 +88,6 @@ const AccessLogsList: React.FC = () => {
|
||||
<Refresh size={16} className={loading ? "animate-spin" : ""} />
|
||||
بروزرسانی
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
onClick={handleExport}
|
||||
disabled={loading || !logs || logs.length === 0}
|
||||
className="flex items-center gap-2 border border-gray-300 bg-white text-gray-700 hover:bg-gray-50"
|
||||
>
|
||||
<DocumentDownload size={16} />
|
||||
خروجی CSV
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -8,10 +8,8 @@ import {
|
||||
AccessLogQuery,
|
||||
OperationType,
|
||||
UserType,
|
||||
HttpMethod,
|
||||
OperationTypeLabels,
|
||||
UserTypeLabels,
|
||||
HttpMethodLabels,
|
||||
} from "../types/AccessLogTypes";
|
||||
|
||||
interface FilterPanelProps {
|
||||
@@ -37,11 +35,6 @@ const FilterPanel: React.FC<FilterPanelProps> = ({
|
||||
label: UserTypeLabels[type],
|
||||
}));
|
||||
|
||||
const httpMethodOptions = Object.values(HttpMethod).map((method) => ({
|
||||
value: method,
|
||||
label: HttpMethodLabels[method],
|
||||
}));
|
||||
|
||||
const statusCodeOptions = [
|
||||
{ value: "200", label: "200 - موفق" },
|
||||
{ value: "201", label: "201 - ایجاد شده" },
|
||||
@@ -138,18 +131,7 @@ const FilterPanel: React.FC<FilterPanelProps> = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* HTTP Method */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
متد HTTP
|
||||
</label>
|
||||
<Select
|
||||
items={[{ value: "", label: "همه" }, ...httpMethodOptions]}
|
||||
value={filters.httpMethod || ""}
|
||||
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => onFiltersChange({ httpMethod: e.target.value as HttpMethod })}
|
||||
disabled={loading}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
{/* Status Code */}
|
||||
<div>
|
||||
@@ -164,18 +146,7 @@ const FilterPanel: React.FC<FilterPanelProps> = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* IP Address */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
آدرس IP
|
||||
</label>
|
||||
<Input
|
||||
placeholder="192.168.1.1"
|
||||
value={filters.ipAddress || ""}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onFiltersChange({ ipAddress: e.target.value })}
|
||||
disabled={loading}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
{/* User ID */}
|
||||
<div>
|
||||
@@ -214,37 +185,6 @@ const FilterPanel: React.FC<FilterPanelProps> = ({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Min Execution Time */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
حداقل زمان اجرا (ms)
|
||||
</label>
|
||||
<Input
|
||||
type="number"
|
||||
placeholder="0"
|
||||
value={filters.minExecutionTime?.toString() || ""}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onFiltersChange({
|
||||
minExecutionTime: e.target.value ? parseInt(e.target.value) : undefined
|
||||
})}
|
||||
disabled={loading}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Max Execution Time */}
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-1">
|
||||
حداکثر زمان اجرا (ms)
|
||||
</label>
|
||||
<Input
|
||||
type="number"
|
||||
placeholder="1000"
|
||||
value={filters.maxExecutionTime?.toString() || ""}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => onFiltersChange({
|
||||
maxExecutionTime: e.target.value ? parseInt(e.target.value) : undefined
|
||||
})}
|
||||
disabled={loading}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user