🐛 Fix port in Service URL for Docker Module
This commit is contained in:
@@ -24,12 +24,12 @@ export function tryMatchService(container: Dockerode.ContainerInfo | undefined)
|
|||||||
if (container === undefined) return {};
|
if (container === undefined) return {};
|
||||||
const name = container.Names[0].substring(1);
|
const name = container.Names[0].substring(1);
|
||||||
const type = tryMatchType(container.Image);
|
const type = tryMatchType(container.Image);
|
||||||
const port = tryMatchPort(type.toLowerCase());
|
const port = tryMatchPort(type.toLowerCase())?.value ?? container.Ports[0]?.PublicPort;
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
id: container.Id,
|
id: container.Id,
|
||||||
type: tryMatchType(container.Image),
|
type: tryMatchType(container.Image),
|
||||||
url: `localhost${port ? `:${port.value}` : ''}`,
|
url: `localhost${port ? `:${port}` : ''}`,
|
||||||
icon: `https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name
|
icon: `https://cdn.jsdelivr.net/gh/walkxhub/dashboard-icons/png/${name
|
||||||
.replace(/\s+/g, '-')
|
.replace(/\s+/g, '-')
|
||||||
.toLowerCase()}.png`,
|
.toLowerCase()}.png`,
|
||||||
|
|||||||
Reference in New Issue
Block a user