Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.16.0 #1006

Merged
merged 118 commits into from
Dec 27, 2024
Merged

v0.16.0 #1006

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
a439286
feat: add UI selection
DJKnaeckebrot Dec 13, 2024
4dc7d9e
feat: add params to mutation
DJKnaeckebrot Dec 13, 2024
8779c67
refactor: change import names
DJKnaeckebrot Dec 13, 2024
3decbd5
feat: add new form validator
DJKnaeckebrot Dec 13, 2024
92c2a83
feat: add filter to delete volumes is wanted
DJKnaeckebrot Dec 13, 2024
ef89d05
Merge branch 'canary' into feature/delete-docker-volumes
DJKnaeckebrot Dec 14, 2024
7725b3c
Merge branch 'Dokploy:canary' into feature/delete-docker-volumes
DJKnaeckebrot Dec 15, 2024
8e5b098
fix: fixed/improved handling of app names in api
acgonzales Dec 16, 2024
b592a02
feat: add swarm router and related Docker service functions
DJKnaeckebrot Dec 17, 2024
04d3eb9
feat: add swarm tab and dashboard page for managing Docker swarm
DJKnaeckebrot Dec 17, 2024
5716954
feat: add components for displaying swarm node details and applications
DJKnaeckebrot Dec 17, 2024
813da8f
refactor: clean up code formatting and improve readability in swarm d…
DJKnaeckebrot Dec 17, 2024
3fc5bfc
feat: implement fetching of Docker service applications and their det…
DJKnaeckebrot Dec 17, 2024
763219e
refactor: streamline imports and improve code formatting in ShowSwarm…
DJKnaeckebrot Dec 17, 2024
8505236
feat: mongo replica sets
thewilloftheshadow Dec 17, 2024
f98f18b
feat: add monitoring card
DJKnaeckebrot Dec 17, 2024
e3ee891
chore: remove tables and add new cards
DJKnaeckebrot Dec 17, 2024
3080926
feat: add new items
DJKnaeckebrot Dec 17, 2024
be237ae
chore: comment out refresh for now
DJKnaeckebrot Dec 17, 2024
577b126
feat: make bg transparent
DJKnaeckebrot Dec 17, 2024
752c9f2
style: remove bg and border
DJKnaeckebrot Dec 17, 2024
9d49714
feat: add latest cards
DJKnaeckebrot Dec 18, 2024
d4d74d3
refactor: remove not needed import, move to better folder structure
DJKnaeckebrot Dec 18, 2024
b52f57c
chore: remove imports
DJKnaeckebrot Dec 18, 2024
8642d82
chore: add seperator and make tittles big
DJKnaeckebrot Dec 18, 2024
6211a19
feat: add support for viewing docker logs in swarm mode
faytranevozter Dec 18, 2024
63c0912
xMerge branch 'canary' into feature/delete-docker-volumes
DJKnaeckebrot Dec 18, 2024
8ea453f
feat: add application handling
DJKnaeckebrot Dec 18, 2024
06b8c82
feat: add a toggle for replica sets to be used or not
thewilloftheshadow Dec 18, 2024
3858205
style: better preview deployment card
190km Dec 18, 2024
3a95474
chore: lint
190km Dec 19, 2024
9d1cf37
chore: lint
190km Dec 19, 2024
0abf62d
refactor: prevent update appName in services
Siumauricio Dec 21, 2024
29ce890
refactor: remove all the props except id, serverid, isloading, and de…
190km Dec 21, 2024
8c06296
feat: add decoration column to discord notification
joaotonaco Dec 22, 2024
055b59e
feat: discord decoration switch
joaotonaco Dec 22, 2024
870e074
feat: implement decoration to embeds
joaotonaco Dec 22, 2024
21b2cce
fix: send decoration prop to notification tester
joaotonaco Dec 22, 2024
6e262cd
fix: update discord notification decoration
joaotonaco Dec 22, 2024
80bd80b
refactor: make decoration prop optional at discord tester schema
joaotonaco Dec 22, 2024
a710728
feat: add support for custom command
Siumauricio Dec 22, 2024
c0e9670
refactor: delete log
Siumauricio Dec 22, 2024
f7c8324
Merge pull request #963 from Dokploy/540-need-more-control-over-docke…
Siumauricio Dec 22, 2024
5c5066b
chore: remove server from swarms page
DJKnaeckebrot Dec 22, 2024
5a302d3
feat(logs): use fancy-ansi for ansi colors
drudge Dec 22, 2024
7a5b9e3
refactor: deleted separate component, and add it to show preview build
190km Dec 23, 2024
65ddc22
refactor: removed useless export
190km Dec 23, 2024
eb495b7
style: fixed white style
190km Dec 23, 2024
a32e934
Merge pull request #967 from 190km/white-theme-notifications
Siumauricio Dec 23, 2024
49616e5
fix: prevent Esc key from closing terminal modals
devin-ai-integration[bot] Dec 23, 2024
1d023ac
Merge pull request #965 from drudge/fancy-ansi
Siumauricio Dec 23, 2024
6afd443
feat: add swarm overview for servers
Siumauricio Dec 23, 2024
3133615
Merge pull request #968 from drudge/fix-esc-vi
Siumauricio Dec 23, 2024
d2b662f
Merge pull request #904 from acgonzales/fix/api-appname
Siumauricio Dec 23, 2024
869843d
Merge pull request #921 from DJKnaeckebrot/feature/swarm-overview
Siumauricio Dec 23, 2024
455cae6
Merge pull request #938 from 190km/preview-deployment-view
Siumauricio Dec 23, 2024
43a493b
Merge branch 'canary' into feature/delete-docker-volumes
DJKnaeckebrot Dec 23, 2024
3b4214e
Merge remote-tracking branch 'origin/feature/delete-docker-volumes' i…
DJKnaeckebrot Dec 23, 2024
be2e70a
chore: only make this apply to compose files
DJKnaeckebrot Dec 23, 2024
375dece
chore: remove application delete volume
DJKnaeckebrot Dec 23, 2024
fa710d4
format: fix formatting
DJKnaeckebrot Dec 23, 2024
c6892ba
format: fix formatting
DJKnaeckebrot Dec 23, 2024
ed543e5
refactor: lint
Siumauricio Dec 23, 2024
8bfe163
refactor: remove delete volumes
Siumauricio Dec 23, 2024
353effd
refactor: delete log
Siumauricio Dec 23, 2024
96cdffb
Merge pull request #886 from DJKnaeckebrot/feature/delete-docker-volumes
Siumauricio Dec 23, 2024
1d35d21
Merge branch 'canary' into feat/discord-emoji-toggle
joaotonaco Dec 23, 2024
0ee5a6f
fix(certificates): ensure certificates are accessible by traefik
drudge Dec 23, 2024
9c5a61e
fix(certificates): show proper placeholder for private key format
drudge Dec 23, 2024
e7beb5c
fix(setup): use traefik port/version from env
drudge Dec 23, 2024
56cfd35
feat(certificates): clarify you are selecting the cert provider
drudge Dec 23, 2024
8410d94
feat(preview-deployments): new UI
drudge Dec 23, 2024
0db98c0
feat(traefik/ports): improved UI
drudge Dec 24, 2024
364d04f
fix: show error message when compose builder throws
drudge Dec 24, 2024
ce71fa4
Merge pull request #962 from joaotonaco/feat/discord-emoji-toggle
Siumauricio Dec 24, 2024
e1dd666
Merge pull request #972 from drudge/traefik-port
Siumauricio Dec 24, 2024
0535d78
refactor: add missing running state
Siumauricio Dec 24, 2024
28a2ab9
Merge pull request #974 from drudge/preview-deployments
Siumauricio Dec 24, 2024
ce19a42
refactor: use react hook form
Siumauricio Dec 24, 2024
e3f1518
Merge pull request #977 from drudge/ports-ui
Siumauricio Dec 24, 2024
b8580d6
feat: add hide extra logs
Siumauricio Dec 24, 2024
830a254
Merge pull request #979 from drudge/compose-builder-error
Siumauricio Dec 24, 2024
36a1daa
Merge pull request #984 from Dokploy/feat/add-hide-extra-logs
Siumauricio Dec 24, 2024
e035062
Merge pull request #971 from drudge/cert-enhancements
Siumauricio Dec 24, 2024
4065ad4
Update apps/dokploy/components/dashboard/project/add-database.tsx
Siumauricio Dec 24, 2024
d8dbdb2
fix: turn off `autoComplete` for some inputs
Barsnes Dec 25, 2024
ce34fe3
Merge pull request #985 from Barsnes/chore/autocomplete-off
Siumauricio Dec 25, 2024
f672c42
Merge branch 'canary' into feature/node-cluster-logs
Siumauricio Dec 25, 2024
da858e2
refactor: add toggle for normal containers & stack
Siumauricio Dec 25, 2024
566d9e0
Merge pull request #931 from faytranevozter/feature/node-cluster-logs
Siumauricio Dec 25, 2024
8f76d52
feat: add replica sets migration
Siumauricio Dec 25, 2024
0affeea
remove
Siumauricio Dec 25, 2024
5ce6172
Merge branch 'canary' into feat/mongo-replica-sets
Siumauricio Dec 25, 2024
b4fcdc4
feat: add migration
Siumauricio Dec 25, 2024
e65e6d2
refactor: add no trunc
Siumauricio Dec 25, 2024
64a449a
refactor: add swarm improvements
Siumauricio Dec 25, 2024
5c1993a
refactor: exclude dokploy services
Siumauricio Dec 25, 2024
229a9a3
Merge pull request #989 from Dokploy/refactor/add-no-trunc
Siumauricio Dec 25, 2024
d4a3c5c
fix: omit macos files and create folders every time
Siumauricio Dec 25, 2024
364c2e1
fix: adjust types
Siumauricio Dec 25, 2024
a325b29
Merge pull request #990 from Dokploy/986-error-to-save-the-deployment
Siumauricio Dec 25, 2024
a172aba
feat(i18n): add Spanish language support
jmsx Dec 25, 2024
379ea2a
Merge pull request #994 from jmsx/canary
Siumauricio Dec 25, 2024
8c8ffe0
Merge pull request #926 from thewilloftheshadow/feat/mongo-replica-sets
Siumauricio Dec 26, 2024
f6e4ae7
feat(i18n): add Norwegian language support
Barsnes Dec 26, 2024
766279f
fix: add norwegian common.json file
Barsnes Dec 26, 2024
cbfdda1
fix: typo Logssss > Logs
190km Dec 26, 2024
6df66c3
fix: correct typo in logs title
faytranevozter Dec 26, 2024
20a7995
fix: update docker logs command to conditionally include raw flag for…
faytranevozter Dec 26, 2024
f69fb76
fix: normalize state string to lowercase and update filter quotes in …
faytranevozter Dec 26, 2024
27252cf
feat: add badge component to display container state with color coding
faytranevozter Dec 26, 2024
f349492
Merge pull request #997 from Barsnes/feat/norwegian-lang
Siumauricio Dec 26, 2024
87ef889
Merge pull request #999 from 190km/logs-typo
Siumauricio Dec 26, 2024
985b8bc
refactor: extract badgeStateColor function for reuse across log compo…
faytranevozter Dec 27, 2024
f9e4a71
fix: remove unused parsed
Siumauricio Dec 27, 2024
d3663eb
Merge pull request #1005 from Dokploy/fix/swarm-overview
Siumauricio Dec 27, 2024
c22f744
Merge pull request #1000 from faytranevozter/feat/simplify-node-logs
Siumauricio Dec 27, 2024
4533b19
chore: bump version
Siumauricio Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { Badge } from "@/components/ui/badge";
import { Checkbox } from "@/components/ui/checkbox";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import { Loader2 } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { TerminalLine } from "../../docker/logs/terminal-line";
import { LogLine, parseLogs } from "../../docker/logs/utils";
import { Badge } from "@/components/ui/badge";
import { Loader2 } from "lucide-react";
import { type LogLine, parseLogs } from "../../docker/logs/utils";

interface Props {
logPath: string | null;
Expand All @@ -19,26 +20,26 @@ interface Props {
}
export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
const [data, setData] = useState("");
const [showExtraLogs, setShowExtraLogs] = useState(false);
const [filteredLogs, setFilteredLogs] = useState<LogLine[]>([]);
const wsRef = useRef<WebSocket | null>(null); // Ref to hold WebSocket instance
const [autoScroll, setAutoScroll] = useState(true);
const scrollRef = useRef<HTMLDivElement>(null);


const scrollToBottom = () => {
if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
};
};

const handleScroll = () => {
if (!scrollRef.current) return;

const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) < 10;
setAutoScroll(isAtBottom);
};
};

useEffect(() => {
if (!open || !logPath) return;

Expand Down Expand Up @@ -69,20 +70,34 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
};
}, [logPath, open]);


useEffect(() => {
const logs = parseLogs(data);
setFilteredLogs(logs);
}, [data]);
let filteredLogsResult = logs;
if (serverId) {
let hideSubsequentLogs = false;
filteredLogsResult = logs.filter((log) => {
if (
log.message.includes(
"===================================EXTRA LOGS============================================",
)
) {
hideSubsequentLogs = true;
return showExtraLogs;
}
return showExtraLogs ? true : !hideSubsequentLogs;
});
}

setFilteredLogs(filteredLogsResult);
}, [data, showExtraLogs]);

useEffect(() => {
scrollToBottom();

if (autoScroll && scrollRef.current) {
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
}
}, [filteredLogs, autoScroll]);

}, [filteredLogs, autoScroll]);

return (
<Dialog
Expand All @@ -103,28 +118,49 @@ export const ShowDeployment = ({ logPath, open, onClose, serverId }: Props) => {
<DialogContent className={"sm:max-w-5xl overflow-y-auto max-h-screen"}>
<DialogHeader>
<DialogTitle>Deployment</DialogTitle>
<DialogDescription>
See all the details of this deployment | <Badge variant="blank" className="text-xs">{filteredLogs.length} lines</Badge>
<DialogDescription className="flex items-center gap-2">
<span>
See all the details of this deployment |{" "}
<Badge variant="blank" className="text-xs">
{filteredLogs.length} lines
</Badge>
</span>

{serverId && (
<div className="flex items-center space-x-2">
<Checkbox
id="show-extra-logs"
checked={showExtraLogs}
onCheckedChange={(checked) =>
setShowExtraLogs(checked as boolean)
}
/>
<label
htmlFor="show-extra-logs"
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
>
Show Extra Logs
</label>
</div>
)}
</DialogDescription>
</DialogHeader>

<div
<div
ref={scrollRef}
onScroll={handleScroll}
className="h-[720px] overflow-y-auto space-y-0 border p-4 bg-[#fafafa] dark:bg-[#050506] rounded custom-logs-scrollbar"
> {
filteredLogs.length > 0 ? filteredLogs.map((log: LogLine, index: number) => (
<TerminalLine
key={index}
log={log}
noTimestamp
/>
)) :
(
<div className="flex justify-center items-center h-full text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin" />
</div>
)}
>
{" "}
{filteredLogs.length > 0 ? (
filteredLogs.map((log: LogLine, index: number) => (
<TerminalLine key={index} log={log} noTimestamp />
))
) : (
<div className="flex justify-center items-center h-full text-muted-foreground">
<Loader2 className="h-6 w-6 animate-spin" />
</div>
)}
</div>
</DialogContent>
</Dialog>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,21 @@ export const AddDomain = ({
name="certificateType"
render={({ field }) => (
<FormItem className="col-span-2">
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>

<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>
Expand Down
123 changes: 101 additions & 22 deletions apps/dokploy/components/dashboard/application/logs/show.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
Expand All @@ -15,6 +16,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Switch } from "@/components/ui/switch";
import { api } from "@/utils/api";
import { Loader2 } from "lucide-react";
import dynamic from "next/dynamic";
Expand All @@ -29,28 +31,67 @@ export const DockerLogs = dynamic(
},
);

export const badgeStateColor = (state: string) => {
switch (state) {
case "running":
return "green";
case "exited":
case "shutdown":
return "red";
case "accepted":
case "created":
return "blue";
default:
return "default";
}
};

interface Props {
appName: string;
serverId?: string;
}

export const ShowDockerLogs = ({ appName, serverId }: Props) => {
const { data, isLoading } = api.docker.getContainersByAppNameMatch.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName,
},
);
const [containerId, setContainerId] = useState<string | undefined>();
const [option, setOption] = useState<"swarm" | "native">("native");

const { data: services, isLoading: servicesLoading } =
api.docker.getServiceContainersByAppName.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName && option === "swarm",
},
);

const { data: containers, isLoading: containersLoading } =
api.docker.getContainersByAppNameMatch.useQuery(
{
appName,
serverId,
},
{
enabled: !!appName && option === "native",
},
);

useEffect(() => {
if (data && data?.length > 0) {
setContainerId(data[0]?.containerId);
if (option === "native") {
if (containers && containers?.length > 0) {
setContainerId(containers[0]?.containerId);
}
} else {
if (services && services?.length > 0) {
setContainerId(services[0]?.containerId);
}
}
}, [data]);
}, [option, services, containers]);

const isLoading = option === "native" ? containersLoading : servicesLoading;
const containersLenght =
option === "native" ? containers?.length : services?.length;

return (
<Card className="bg-background">
Expand All @@ -62,7 +103,21 @@ export const ShowDockerLogs = ({ appName, serverId }: Props) => {
</CardHeader>

<CardContent className="flex flex-col gap-4">
<Label>Select a container to view logs</Label>
<div className="flex flex-row justify-between items-center gap-2">
<Label>Select a container to view logs</Label>
<div className="flex flex-row gap-2 items-center">
<span className="text-sm text-muted-foreground">
{option === "native" ? "Native" : "Swarm"}
</span>
<Switch
checked={option === "native"}
onCheckedChange={(checked) => {
setOption(checked ? "native" : "swarm");
}}
/>
</div>
</div>

<Select onValueChange={setContainerId} value={containerId}>
<SelectTrigger>
{isLoading ? (
Expand All @@ -76,21 +131,45 @@ export const ShowDockerLogs = ({ appName, serverId }: Props) => {
</SelectTrigger>
<SelectContent>
<SelectGroup>
{data?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}) {container.state}
</SelectItem>
))}
<SelectLabel>Containers ({data?.length})</SelectLabel>
{option === "native" ? (
<div>
{containers?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}){" "}
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</div>
) : (
<>
{services?.map((container) => (
<SelectItem
key={container.containerId}
value={container.containerId}
>
{container.name} ({container.containerId}@{container.node}
)
<Badge variant={badgeStateColor(container.state)}>
{container.state}
</Badge>
</SelectItem>
))}
</>
)}

<SelectLabel>Containers ({containersLenght})</SelectLabel>
</SelectGroup>
</SelectContent>
</Select>
<DockerLogs
serverId={serverId || ""}
containerId={containerId || "select-a-container"}
runType={option}
/>
</CardContent>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,21 @@ export const AddPreviewDomain = ({
name="certificateType"
render={({ field }) => (
<FormItem className="col-span-2">
<FormLabel>Certificate</FormLabel>
<FormLabel>Certificate Provider</FormLabel>
<Select
onValueChange={field.onChange}
defaultValue={field.value || ""}
>
<FormControl>
<SelectTrigger>
<SelectValue placeholder="Select a certificate" />
<SelectValue placeholder="Select a certificate provider" />
</SelectTrigger>
</FormControl>

<SelectContent>
<SelectItem value="none">None</SelectItem>
<SelectItem value={"letsencrypt"}>
Letsencrypt (Default)
Let's Encrypt
</SelectItem>
</SelectContent>
</Select>
Expand Down
Loading
Loading