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:
@@ -1,7 +1,9 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { useState, useCallback } from 'react';
|
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 { HealthStatus } from '@/lib/PortalContext';
|
||||||
import { Icon } from './Icons';
|
import { Icon } from './Icons';
|
||||||
|
|
||||||
@@ -170,6 +172,19 @@ export function ServiceCard({ service, status }: ServiceCardProps) {
|
|||||||
<Icon name="external-link" size={14} />
|
<Icon name="external-link" size={14} />
|
||||||
</a>
|
</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 */}
|
{/* Manage in Coolify */}
|
||||||
{discovered && (
|
{discovered && (
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -15,5 +15,7 @@ export const clientConfig = {
|
|||||||
nucHost: process.env.NEXT_PUBLIC_NUC_HOST || '192.168.1.3',
|
nucHost: process.env.NEXT_PUBLIC_NUC_HOST || '192.168.1.3',
|
||||||
coolifyUrl: process.env.NEXT_PUBLIC_COOLIFY_URL || 'http://192.168.1.3:8000',
|
coolifyUrl: process.env.NEXT_PUBLIC_COOLIFY_URL || 'http://192.168.1.3:8000',
|
||||||
coolifyProjectUuid: process.env.NEXT_PUBLIC_COOLIFY_PROJECT_UUID || 'a8484ggc88c40w4g4k004ow0',
|
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',
|
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',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,17 @@ export interface DiscoveredService extends Service {
|
|||||||
coolifyStatus: string;
|
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 {
|
export interface Bookmark {
|
||||||
name: string;
|
name: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user