import {
DeesElement,
customElement,
html,
css,
cssManager,
property,
type TemplateResult,
} from '@design.estate/dees-element';
declare global {
interface HTMLElementTagNameMap {
'sz-reverse-proxy-card': SzReverseProxyCard;
}
}
@customElement('sz-reverse-proxy-card')
export class SzReverseProxyCard extends DeesElement {
public static demo = () => html`
`;
public static demoGroups = ['Network'];
@property({ type: String })
public accessor httpPort: string = '80';
@property({ type: String })
public accessor httpsPort: string = '443';
@property({ type: Boolean })
public accessor httpActive: boolean = false;
@property({ type: Boolean })
public accessor httpsActive: boolean = false;
@property({ type: String })
public accessor routeCount: string = '0';
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
height: 100%;
}
.card {
background: ${cssManager.bdTheme('#ffffff', '#09090b')};
border: 1px solid ${cssManager.bdTheme('#e4e4e7', '#27272a')};
border-radius: 8px;
padding: 20px;
height: 100%;
box-sizing: border-box;
}
.header {
margin-bottom: 16px;
}
.title {
font-size: 16px;
font-weight: 600;
color: ${cssManager.bdTheme('#18181b', '#fafafa')};
}
.subtitle {
font-size: 13px;
color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
margin-top: 2px;
}
.items {
display: flex;
flex-direction: column;
gap: 10px;
}
.item {
display: flex;
justify-content: space-between;
align-items: center;
}
.item-label {
font-size: 14px;
color: ${cssManager.bdTheme('#18181b', '#fafafa')};
}
.item-value {
font-size: 14px;
color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
}
.badge {
display: inline-flex;
align-items: center;
padding: 2px 10px;
border-radius: 9999px;
font-size: 12px;
font-weight: 500;
}
.badge.active {
background: ${cssManager.bdTheme('#dcfce7', 'rgba(34, 197, 94, 0.2)')};
color: ${cssManager.bdTheme('#16a34a', '#22c55e')};
}
.badge.inactive {
background: ${cssManager.bdTheme('#fee2e2', 'rgba(239, 68, 68, 0.2)')};
color: ${cssManager.bdTheme('#dc2626', '#ef4444')};
}
`,
];
public render(): TemplateResult {
return html`
HTTP (${this.httpPort})
${this.httpActive ? 'Active' : 'Inactive'}
HTTPS (${this.httpsPort})
${this.httpsActive ? 'Active' : 'Inactive'}
Routes
${this.routeCount}
`;
}
}