techedstudios commited on
Commit
e43d07f
·
1 Parent(s): 4102720

Feat: Add Clear Logs button to Live Console

Browse files
Files changed (1) hide show
  1. src/App.tsx +14 -8
src/App.tsx CHANGED
@@ -741,7 +741,8 @@ export default function App() {
741
  {activeTab === 'console' && activeServer && (
742
  <ConsoleComponent
743
  server={activeServer}
744
- logs={logs}
 
745
  command={command}
746
  setCommand={setCommand}
747
  onSend={handleSendCommand}
@@ -995,16 +996,21 @@ function DetailRow({ label, value }: { label: string, value: string }) {
995
  );
996
  }
997
 
998
- function ConsoleComponent({ server, logs, command, setCommand, onSend, scrollRef }: any) {
999
  return (
1000
  <div className="flex flex-col h-[calc(100vh-200px)] border border-zinc-800 rounded-2xl bg-black overflow-hidden shadow-2xl">
1001
- <div className="flex items-center gap-2 px-4 py-3 border-b border-zinc-800 bg-zinc-900/50">
1002
- <div className="flex gap-1.5">
1003
- <div className="w-3 h-3 rounded-full bg-rose-500/50" />
1004
- <div className="w-3 h-3 rounded-full bg-amber-500/50" />
1005
- <div className="w-3 h-3 rounded-full bg-emerald-500/50" />
 
 
 
1006
  </div>
1007
- <span className="text-xs font-mono text-zinc-500 ml-4 font-bold tracking-widest uppercase">System Terminal — dev@prismsmp</span>
 
 
1008
  </div>
1009
 
1010
  <div className="bg-emerald-500/10 border-b border-emerald-500/20 px-4 py-3 flex items-center justify-between">
 
741
  {activeTab === 'console' && activeServer && (
742
  <ConsoleComponent
743
  server={activeServer}
744
+ logs={logs}
745
+ onClearLogs={() => setLogs([])}
746
  command={command}
747
  setCommand={setCommand}
748
  onSend={handleSendCommand}
 
996
  );
997
  }
998
 
999
+ function ConsoleComponent({ server, logs, command, setCommand, onSend, scrollRef, onClearLogs }: any) {
1000
  return (
1001
  <div className="flex flex-col h-[calc(100vh-200px)] border border-zinc-800 rounded-2xl bg-black overflow-hidden shadow-2xl">
1002
+ <div className="flex items-center justify-between px-4 py-3 border-b border-zinc-800 bg-zinc-900/50">
1003
+ <div className="flex items-center gap-2">
1004
+ <div className="flex gap-1.5">
1005
+ <div className="w-3 h-3 rounded-full bg-rose-500/50" />
1006
+ <div className="w-3 h-3 rounded-full bg-amber-500/50" />
1007
+ <div className="w-3 h-3 rounded-full bg-emerald-500/50" />
1008
+ </div>
1009
+ <span className="text-xs font-mono text-zinc-500 ml-4 font-bold tracking-widest uppercase">System Terminal — dev@prismsmp</span>
1010
  </div>
1011
+ <button onClick={onClearLogs} className="p-1 hover:bg-zinc-800 rounded text-zinc-500 hover:text-rose-400 transition-colors" title="Clear Logs">
1012
+ <Trash2 className="w-4 h-4" />
1013
+ </button>
1014
  </div>
1015
 
1016
  <div className="bg-emerald-500/10 border-b border-emerald-500/20 px-4 py-3 flex items-center justify-between">