mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
show a message about no matches found
This commit is contained in:
@@ -30,6 +30,7 @@ export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
|
|||||||
const [since, setSince] = React.useState<TimeFilter>("all");
|
const [since, setSince] = React.useState<TimeFilter>("all");
|
||||||
const [typeFilter, setTypeFilter] = React.useState<TypeFilter>("all");
|
const [typeFilter, setTypeFilter] = React.useState<TypeFilter>("all");
|
||||||
const scrollRef = useRef<HTMLDivElement>(null);
|
const scrollRef = useRef<HTMLDivElement>(null);
|
||||||
|
const [errorMessage, setErrorMessage] = React.useState<string | null>(null);
|
||||||
|
|
||||||
const scrollToBottom = () => {
|
const scrollToBottom = () => {
|
||||||
if (autoScroll && scrollRef.current) {
|
if (autoScroll && scrollRef.current) {
|
||||||
@@ -106,12 +107,7 @@ export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
|
|||||||
|
|
||||||
ws.onclose = (e) => {
|
ws.onclose = (e) => {
|
||||||
console.log("WebSocket closed:", e.reason);
|
console.log("WebSocket closed:", e.reason);
|
||||||
setRawLogs(
|
setErrorMessage(`Connection closed!\nReason: ${e.reason || "WebSocket was closed try to refresh"}`);
|
||||||
(prev) =>
|
|
||||||
`${prev}Connection closed!\nReason: ${
|
|
||||||
e.reason || "WebSocket was closed try to refresh"
|
|
||||||
}\n`
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
@@ -242,9 +238,11 @@ export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
|
|||||||
onScroll={handleScroll}
|
onScroll={handleScroll}
|
||||||
className="h-[720px] overflow-y-auto space-y-0 border p-4 bg-[#d4d4d4] dark:bg-[#050506] rounded custom-logs-scrollbar"
|
className="h-[720px] overflow-y-auto space-y-0 border p-4 bg-[#d4d4d4] dark:bg-[#050506] rounded custom-logs-scrollbar"
|
||||||
>
|
>
|
||||||
{filteredLogs.map((filteredLog: LogLine, index: number) => (
|
{
|
||||||
<TerminalLine key={index} log={filteredLog} searchTerm={search} />
|
filteredLogs.length > 0 ? filteredLogs.map((filteredLog: LogLine, index: number) => (
|
||||||
))}
|
<TerminalLine key={index} log={filteredLog} searchTerm={search} />
|
||||||
|
)) : <div className="flex justify-center items-center h-full text-muted-foreground">No logs found</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user