import { DeesElement, customElement, html, css, cssManager, property, type TemplateResult, } from '@design.estate/dees-element'; import './sz-status-grid-cluster.js'; import './sz-status-grid-services.js'; import './sz-status-grid-network.js'; import './sz-status-grid-infra.js'; import type { IClusterStats } from './sz-status-grid-cluster.js'; import type { IResourceUsage } from './sz-resource-usage-card.js'; import type { IPlatformService } from './sz-platform-services-card.js'; import type { ITrafficData } from './sz-traffic-card.js'; import type { IProxyStatus, ICertificateStatus } from './sz-status-grid-network.js'; import type { IQuickAction } from './sz-quick-actions-card.js'; declare global { interface HTMLElementTagNameMap { 'sz-dashboard-view': SzDashboardView; } } export interface IDashboardData { cluster: IClusterStats; resourceUsage: IResourceUsage; platformServices: IPlatformService[]; traffic: ITrafficData; proxy: IProxyStatus; certificates: ICertificateStatus; dnsConfigured: boolean; acmeConfigured: boolean; quickActions: IQuickAction[]; } @customElement('sz-dashboard-view') export class SzDashboardView extends DeesElement { public static demo = () => html`
`; public static demoGroups = ['Dashboard']; @property({ type: Object }) public accessor data: IDashboardData = { cluster: { totalServices: 0, running: 0, stopped: 0, dockerStatus: 'stopped', }, resourceUsage: { cpu: 0, memoryUsed: '0 MB', memoryTotal: '0 GB', networkIn: '0 KB/s', networkOut: '0 KB/s', topConsumers: [], }, platformServices: [], traffic: { requests: 0, errors: 0, errorPercent: 0, avgResponse: 0, reqPerMin: 0, status2xx: 0, status3xx: 0, status4xx: 0, status5xx: 0, }, proxy: { httpPort: '80', httpsPort: '443', httpActive: false, httpsActive: false, routeCount: '0', }, certificates: { valid: 0, expiring: 0, expired: 0, }, dnsConfigured: false, acmeConfigured: false, quickActions: [], }; public static styles = [ cssManager.defaultStyles, css` :host { display: block; } .dashboard { display: flex; flex-direction: column; gap: 24px; } .section-title { font-size: 18px; font-weight: 600; color: ${cssManager.bdTheme('#18181b', '#fafafa')}; margin-bottom: 12px; } .section { display: flex; flex-direction: column; } `, ]; public render(): TemplateResult { return html`

Cluster Overview

Services & Resources

Network & Traffic

Infrastructure

this.dispatchEvent(new CustomEvent('action-click', { detail: e.detail, bubbles: true, composed: true }))} >
`; } }