Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add log file detail page

Vasek Mlejnsky3e5f6163b892
diff --git a/components/AgentLogsList.tsx b/components/AgentLogsList.tsx
index 2f8f4e72b..8ad9f8ea1 100644
--- a/components/AgentLogsList.tsx
+++ b/components/AgentLogsList.tsx
@@ -3,6 +3,7 @@ import {
} from 'react'
import {
File,
+ Upload,
} from 'lucide-react'
import Link from 'next/link'
import clsx from 'clsx'
@@ -35,39 +36,57 @@ function AgentLogsList({
return (
<main className="overflow-hidden flex flex-col max-h-full">
<header className="flex items-center justify-between p-4 sm:p-6 lg:px-8">
- <h1 className="text-2xl font-semibold leading-7 text-white">Log Files</h1>
+ <h1 className="text-2xl font-semibold text-white">Log Files</h1>
+ <button className="p-2 rounded-md bg-[#6366F1] flex items-center space-x-2">
+ <Upload size={14} />
+ <span className="text-sm font-medium">Upload log file</span>
+ </button>
</header>
- <div className="flex flex-col space-y-4 p-4 sm:p-6 lg:px-8">
- {logFiles.map((logFile, i) => (
- <Link
- key={logFile.id}
- href={`/log/${logFile.id}`}
+ {logFiles.length === 0 && (
+ <div className="flex flex-col space-y-4 p-4 sm:p-6 lg:px-8">
+ <button
+ type="button"
+ className="w-full flex flex-col items-center justify-center rounded-lg border-2 border-dashed border-gray-500 p-12 text-center hover:border-gray-400 transition-all focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
- <div
- className={clsx(
- 'flex items-center space-x-2 p-2 cursor-pointer hover:bg-gray-700 transition-all rounded-md',
- selectedLogFileID === logFile.id && 'bg-gray-700',
- selectedLogFileID !== logFile.id && 'bg-gray-800',
- )}
- onClick={() => toggleSelectedLogFileID(logFile.id)}
+ <Upload size={48} className="text-gray-500" strokeWidth={1.5} />
+ <span className="mt-2 block text-sm font-semibold text-gray-300">Upload log file</span>
+ </button>
+ </div>
+ )}
+
+ {logFiles.length > 0 && (
+ <div className="flex flex-col space-y-4 p-4 sm:p-6 lg:px-8">
+ {logFiles.map((logFile, i) => (
+ <Link
+ key={logFile.id}
+ href={`/log/${logFile.id}`}
>
- <File size={14} className="text-gray-500" />
- <span
+ <div
className={clsx(
- 'text-sm',
- 'cursor-pointer',
- 'font-semibold',
- selectedLogFileID === logFile.id && 'font-semibold',
+ 'flex items-center space-x-2 p-2 cursor-pointer hover:bg-gray-700 transition-all rounded-md',
+ selectedLogFileID === logFile.id && 'bg-gray-700',
+ selectedLogFileID !== logFile.id && 'bg-gray-800',
)}
onClick={() => toggleSelectedLogFileID(logFile.id)}
>
- {logFile.name}.json
- </span>
- </div>
- </Link>
- ))}
- </div>
+ <File size={14} className="text-gray-500" />
+ <span
+ className={clsx(
+ 'text-sm',
+ 'cursor-pointer',
+ 'font-semibold',
+ selectedLogFileID === logFile.id && 'font-semibold',
+ )}
+ onClick={() => toggleSelectedLogFileID(logFile.id)}
+ >
+ {logFile.name}
+ </span>
+ </div>
+ </Link>
+ ))}
+ </div>
+ )}
</main >
)
}
diff --git a/pages/log/[logFileID].tsx b/pages/log/[logFileID].tsx
new file mode 100644
index 000000000..6ff617375
--- /dev/null
+++ b/pages/log/[logFileID].tsx
@@ -0,0 +1,9 @@
+function LogFile() {
+ return (
+ <div>
+ Log file detail
+ </div>
+ )
+}
+
+export default LogFile