Add Dozzle logs button to service card footer

Adds a scroll-text icon button between the web link and Coolify link
that opens Dozzle for viewing container logs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-04 01:01:19 +01:00
parent af49497923
commit 68649b0073
3 changed files with 29 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
'use client';
import { useState, useCallback } from 'react';
import { Service, DiscoveredService, getCoolifyUrl } from '@/lib/services';
import { Service, DiscoveredService, getCoolifyUrl, getDozzleUrl } from '@/lib/services';
const dozzleUrl = getDozzleUrl();
import { HealthStatus } from '@/lib/PortalContext';
import { Icon } from './Icons';
@@ -170,6 +172,19 @@ export function ServiceCard({ service, status }: ServiceCardProps) {
<Icon name="external-link" size={14} />
</a>
{/* View logs in Dozzle */}
{discovered && (
<a
href={dozzleUrl}
target="_blank"
rel="noopener noreferrer"
title="View logs"
className="p-1.5 rounded-md text-slate-400 dark:text-stone-500 hover:text-amber-500 dark:hover:text-amber-400 hover:bg-amber-50 dark:hover:bg-amber-900/20 transition-colors"
>
<Icon name="scroll-text" size={14} />
</a>
)}
{/* Manage in Coolify */}
{discovered && (
<a

View File

@@ -15,5 +15,7 @@ export const clientConfig = {
nucHost: process.env.NEXT_PUBLIC_NUC_HOST || '192.168.1.3',
coolifyUrl: process.env.NEXT_PUBLIC_COOLIFY_URL || 'http://192.168.1.3:8000',
coolifyProjectUuid: process.env.NEXT_PUBLIC_COOLIFY_PROJECT_UUID || 'a8484ggc88c40w4g4k004ow0',
coolifyEnvUuid: process.env.NEXT_PUBLIC_COOLIFY_ENV_UUID || 'dckc0w4ko8s888c4gk84skoo',
grafanaUrl: process.env.NEXT_PUBLIC_GRAFANA_URL || 'http://192.168.1.3:3333',
dozzleUrl: process.env.NEXT_PUBLIC_DOZZLE_URL || 'http://192.168.1.3:9999',
};

View File

@@ -19,6 +19,17 @@ export interface DiscoveredService extends Service {
coolifyStatus: string;
}
export function getCoolifyUrl(service: DiscoveredService): string {
const base = process.env.NEXT_PUBLIC_COOLIFY_URL || 'http://192.168.1.3:8000';
const project = process.env.NEXT_PUBLIC_COOLIFY_PROJECT_UUID || 'a8484ggc88c40w4g4k004ow0';
const env = process.env.NEXT_PUBLIC_COOLIFY_ENV_UUID || 'dckc0w4ko8s888c4gk84skoo';
return `${base}/project/${project}/environment/${env}/${service.resourceType}/${service.uuid}`;
}
export function getDozzleUrl(): string {
return process.env.NEXT_PUBLIC_DOZZLE_URL || 'http://192.168.1.3:9999';
}
export interface Bookmark {
name: string;
url: string;