mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-05 03:32:16 +00:00
feat: add support for viewing docker logs in swarm mode
This commit is contained in:
@@ -12,6 +12,7 @@ import { type LogLine, getLogType, parseLogs } from "./utils";
|
||||
interface Props {
|
||||
containerId: string;
|
||||
serverId?: string | null;
|
||||
runType: "swarm" | "native";
|
||||
}
|
||||
|
||||
export const priorities = [
|
||||
@@ -37,7 +38,11 @@ export const priorities = [
|
||||
},
|
||||
];
|
||||
|
||||
export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
|
||||
export const DockerLogsId: React.FC<Props> = ({
|
||||
containerId,
|
||||
serverId,
|
||||
runType,
|
||||
}) => {
|
||||
const { data } = api.docker.getConfig.useQuery(
|
||||
{
|
||||
containerId,
|
||||
@@ -104,6 +109,7 @@ export const DockerLogsId: React.FC<Props> = ({ containerId, serverId }) => {
|
||||
tail: lines.toString(),
|
||||
since,
|
||||
search,
|
||||
runType,
|
||||
});
|
||||
|
||||
if (serverId) {
|
||||
|
||||
@@ -46,7 +46,11 @@ export const ShowDockerModalLogs = ({
|
||||
<DialogDescription>View the logs for {containerId}</DialogDescription>
|
||||
</DialogHeader>
|
||||
<div className="flex flex-col gap-4 pt-2.5">
|
||||
<DockerLogsId containerId={containerId || ""} serverId={serverId} />
|
||||
<DockerLogsId
|
||||
containerId={containerId || ""}
|
||||
serverId={serverId}
|
||||
runType="native"
|
||||
/>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user