feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
import * as plugins from '../plugins.js';
|
|
|
|
|
import * as shared from './shared/index.js';
|
|
|
|
|
import * as appstate from '../appstate.js';
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
DeesElement,
|
|
|
|
|
customElement,
|
|
|
|
|
html,
|
|
|
|
|
state,
|
|
|
|
|
css,
|
|
|
|
|
cssManager,
|
2026-02-03 23:26:51 +00:00
|
|
|
type TemplateResult,
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
} from '@design.estate/dees-element';
|
|
|
|
|
|
|
|
|
|
@customElement('ops-view-config')
|
|
|
|
|
export class OpsViewConfig extends DeesElement {
|
|
|
|
|
@state()
|
2026-02-01 19:21:37 +00:00
|
|
|
accessor configState: appstate.IConfigState = {
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
config: null,
|
|
|
|
|
isLoading: false,
|
|
|
|
|
error: null,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
|
super();
|
|
|
|
|
const subscription = appstate.configStatePart
|
|
|
|
|
.select((stateArg) => stateArg)
|
|
|
|
|
.subscribe((configState) => {
|
|
|
|
|
this.configState = configState;
|
|
|
|
|
});
|
|
|
|
|
this.rxSubscriptions.push(subscription);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static styles = [
|
|
|
|
|
cssManager.defaultStyles,
|
|
|
|
|
shared.viewHostCss,
|
|
|
|
|
css`
|
|
|
|
|
.configSection {
|
2025-06-19 12:14:52 +00:00
|
|
|
background: ${cssManager.bdTheme('#fff', '#222')};
|
|
|
|
|
border: 1px solid ${cssManager.bdTheme('#e9ecef', '#333')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
border-radius: 8px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sectionHeader {
|
2025-06-19 12:14:52 +00:00
|
|
|
background: ${cssManager.bdTheme('#f8f9fa', '#1a1a1a')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
padding: 16px 24px;
|
2025-06-19 12:14:52 +00:00
|
|
|
border-bottom: 1px solid ${cssManager.bdTheme('#e9ecef', '#333')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sectionTitle {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
2025-06-19 12:14:52 +00:00
|
|
|
color: ${cssManager.bdTheme('#333', '#ccc')};
|
2026-02-03 23:26:51 +00:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sectionTitle dees-icon {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
color: ${cssManager.bdTheme('#666', '#888')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sectionContent {
|
|
|
|
|
padding: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.configField {
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
.configField:last-child {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
.fieldLabel {
|
2026-02-03 23:26:51 +00:00
|
|
|
font-size: 13px;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
font-weight: 600;
|
2025-06-19 12:14:52 +00:00
|
|
|
color: ${cssManager.bdTheme('#666', '#999')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
margin-bottom: 8px;
|
|
|
|
|
display: block;
|
2026-02-03 23:26:51 +00:00
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.fieldValue {
|
|
|
|
|
font-family: 'Consolas', 'Monaco', monospace;
|
|
|
|
|
font-size: 14px;
|
2025-06-19 12:14:52 +00:00
|
|
|
color: ${cssManager.bdTheme('#333', '#ccc')};
|
|
|
|
|
background: ${cssManager.bdTheme('#f8f9fa', '#1a1a1a')};
|
2026-02-03 23:26:51 +00:00
|
|
|
padding: 10px 14px;
|
|
|
|
|
border-radius: 6px;
|
2025-06-19 12:14:52 +00:00
|
|
|
border: 1px solid ${cssManager.bdTheme('#e9ecef', '#333')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
.fieldValue.empty {
|
|
|
|
|
color: ${cssManager.bdTheme('#999', '#666')};
|
|
|
|
|
font-style: italic;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.nestedFields {
|
|
|
|
|
margin-left: 16px;
|
|
|
|
|
padding-left: 16px;
|
|
|
|
|
border-left: 2px solid ${cssManager.bdTheme('#e9ecef', '#333')};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Status badge styles */
|
|
|
|
|
.statusBadge {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
padding: 4px 12px;
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.statusBadge.enabled {
|
|
|
|
|
background: ${cssManager.bdTheme('#d4edda', '#1a3d1a')};
|
|
|
|
|
color: ${cssManager.bdTheme('#155724', '#66cc66')};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.statusBadge.disabled {
|
|
|
|
|
background: ${cssManager.bdTheme('#f8d7da', '#3d1a1a')};
|
|
|
|
|
color: ${cssManager.bdTheme('#721c24', '#cc6666')};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.statusBadge dees-icon {
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
/* Array/list display */
|
|
|
|
|
.arrayItems {
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
display: flex;
|
2026-02-03 23:26:51 +00:00
|
|
|
flex-wrap: wrap;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
.arrayItem {
|
|
|
|
|
display: inline-flex;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
align-items: center;
|
2026-02-03 23:26:51 +00:00
|
|
|
background: ${cssManager.bdTheme('#e7f3ff', '#1a2a3d')};
|
|
|
|
|
color: ${cssManager.bdTheme('#0066cc', '#66aaff')};
|
|
|
|
|
padding: 4px 12px;
|
|
|
|
|
border-radius: 16px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
font-family: 'Consolas', 'Monaco', monospace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.arrayCount {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: ${cssManager.bdTheme('#999', '#666')};
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Numeric value formatting */
|
|
|
|
|
.numericValue {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: ${cssManager.bdTheme('#0066cc', '#66aaff')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.errorMessage {
|
2025-06-19 12:14:52 +00:00
|
|
|
background: ${cssManager.bdTheme('#fee', '#4a1f1f')};
|
|
|
|
|
border: 1px solid ${cssManager.bdTheme('#fcc', '#6a2f2f')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
border-radius: 4px;
|
|
|
|
|
padding: 16px;
|
2025-06-19 12:14:52 +00:00
|
|
|
color: ${cssManager.bdTheme('#c00', '#ff6666')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
margin: 16px 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.loadingMessage {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 40px;
|
2025-06-19 12:14:52 +00:00
|
|
|
color: ${cssManager.bdTheme('#666', '#999')};
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
2026-02-03 23:26:51 +00:00
|
|
|
|
|
|
|
|
.infoNote {
|
|
|
|
|
background: ${cssManager.bdTheme('#e7f3ff', '#1a2a3d')};
|
|
|
|
|
border: 1px solid ${cssManager.bdTheme('#b3d7ff', '#2a4a6d')};
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 16px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
color: ${cssManager.bdTheme('#004085', '#88ccff')};
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.infoNote dees-icon {
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
`,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public render() {
|
|
|
|
|
return html`
|
|
|
|
|
<ops-sectionheading>Configuration</ops-sectionheading>
|
2026-02-03 23:26:51 +00:00
|
|
|
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
${this.configState.isLoading ? html`
|
|
|
|
|
<div class="loadingMessage">
|
|
|
|
|
<dees-spinner></dees-spinner>
|
|
|
|
|
<p>Loading configuration...</p>
|
|
|
|
|
</div>
|
|
|
|
|
` : this.configState.error ? html`
|
|
|
|
|
<div class="errorMessage">
|
|
|
|
|
Error loading configuration: ${this.configState.error}
|
|
|
|
|
</div>
|
|
|
|
|
` : this.configState.config ? html`
|
2026-02-03 23:26:51 +00:00
|
|
|
<div class="infoNote">
|
|
|
|
|
<dees-icon icon="lucide:info"></dees-icon>
|
|
|
|
|
<span>This view displays the current running configuration. DcRouter is configured through code or remote management.</span>
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
</div>
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
${this.renderConfigSection('email', 'Email', 'lucide:mail', this.configState.config?.email)}
|
|
|
|
|
${this.renderConfigSection('dns', 'DNS', 'lucide:globe', this.configState.config?.dns)}
|
|
|
|
|
${this.renderConfigSection('proxy', 'Proxy', 'lucide:network', this.configState.config?.proxy)}
|
|
|
|
|
${this.renderConfigSection('security', 'Security', 'lucide:shield', this.configState.config?.security)}
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
` : html`
|
|
|
|
|
<div class="errorMessage">No configuration loaded</div>
|
|
|
|
|
`}
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
private renderConfigSection(key: string, title: string, icon: string, config: any) {
|
|
|
|
|
const isEnabled = config?.enabled ?? false;
|
|
|
|
|
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
return html`
|
|
|
|
|
<div class="configSection">
|
|
|
|
|
<div class="sectionHeader">
|
2026-02-03 23:26:51 +00:00
|
|
|
<h3 class="sectionTitle">
|
|
|
|
|
<dees-icon icon="${icon}"></dees-icon>
|
|
|
|
|
${title}
|
|
|
|
|
</h3>
|
|
|
|
|
${this.renderStatusBadge(isEnabled)}
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
</div>
|
|
|
|
|
<div class="sectionContent">
|
2026-02-03 23:26:51 +00:00
|
|
|
${config ? this.renderConfigFields(config) : html`
|
|
|
|
|
<div class="fieldValue empty">Not configured</div>
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
`}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
private renderStatusBadge(enabled: boolean): TemplateResult {
|
|
|
|
|
return enabled
|
|
|
|
|
? html`<span class="statusBadge enabled"><dees-icon icon="lucide:check"></dees-icon>Enabled</span>`
|
|
|
|
|
: html`<span class="statusBadge disabled"><dees-icon icon="lucide:x"></dees-icon>Disabled</span>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private renderConfigFields(config: any, prefix = ''): TemplateResult | TemplateResult[] {
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
if (!config || typeof config !== 'object') {
|
2026-02-03 23:26:51 +00:00
|
|
|
return html`<div class="fieldValue">${this.formatValue(config)}</div>`;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Object.entries(config).map(([key, value]) => {
|
|
|
|
|
const fieldName = prefix ? `${prefix}.${key}` : key;
|
2026-02-03 23:26:51 +00:00
|
|
|
const displayName = this.formatFieldName(key);
|
|
|
|
|
|
|
|
|
|
// Handle boolean values with badges
|
|
|
|
|
if (typeof value === 'boolean') {
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
return html`
|
|
|
|
|
<div class="configField">
|
2026-02-03 23:26:51 +00:00
|
|
|
<label class="fieldLabel">${displayName}</label>
|
|
|
|
|
${this.renderStatusBadge(value)}
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
2026-02-03 23:26:51 +00:00
|
|
|
|
|
|
|
|
// Handle arrays
|
|
|
|
|
if (Array.isArray(value)) {
|
|
|
|
|
return html`
|
|
|
|
|
<div class="configField">
|
|
|
|
|
<label class="fieldLabel">${displayName}</label>
|
|
|
|
|
${this.renderArrayValue(value, key)}
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle nested objects
|
|
|
|
|
if (typeof value === 'object' && value !== null) {
|
|
|
|
|
return html`
|
|
|
|
|
<div class="configField">
|
|
|
|
|
<label class="fieldLabel">${displayName}</label>
|
|
|
|
|
<div class="nestedFields">
|
|
|
|
|
${this.renderConfigFields(value, fieldName)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle primitive values
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
return html`
|
|
|
|
|
<div class="configField">
|
2026-02-03 23:26:51 +00:00
|
|
|
<label class="fieldLabel">${displayName}</label>
|
|
|
|
|
<div class="fieldValue">${this.formatValue(value, key)}</div>
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
private renderArrayValue(arr: any[], fieldKey: string): TemplateResult {
|
|
|
|
|
if (arr.length === 0) {
|
|
|
|
|
return html`<div class="fieldValue empty">None configured</div>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Determine if we should show as pills/tags
|
|
|
|
|
const showAsPills = arr.every(item => typeof item === 'string' || typeof item === 'number');
|
|
|
|
|
|
|
|
|
|
if (showAsPills) {
|
|
|
|
|
const itemLabel = this.getArrayItemLabel(fieldKey, arr.length);
|
|
|
|
|
return html`
|
|
|
|
|
<div class="arrayCount">${arr.length} ${itemLabel}</div>
|
|
|
|
|
<div class="arrayItems">
|
|
|
|
|
${arr.map(item => html`<span class="arrayItem">${item}</span>`)}
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// For complex arrays, show as JSON
|
|
|
|
|
return html`
|
|
|
|
|
<div class="fieldValue">
|
|
|
|
|
${arr.length} items configured
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private getArrayItemLabel(fieldKey: string, count: number): string {
|
|
|
|
|
const labels: Record<string, [string, string]> = {
|
|
|
|
|
ports: ['port', 'ports'],
|
|
|
|
|
domains: ['domain', 'domains'],
|
|
|
|
|
nameservers: ['nameserver', 'nameservers'],
|
|
|
|
|
blockList: ['IP', 'IPs'],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const label = labels[fieldKey] || ['item', 'items'];
|
|
|
|
|
return count === 1 ? label[0] : label[1];
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
private formatFieldName(key: string): string {
|
|
|
|
|
// Convert camelCase to readable format
|
|
|
|
|
return key
|
|
|
|
|
.replace(/([A-Z])/g, ' $1')
|
|
|
|
|
.replace(/^./, str => str.toUpperCase())
|
|
|
|
|
.trim();
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-03 23:26:51 +00:00
|
|
|
private formatValue(value: any, fieldKey?: string): string | TemplateResult {
|
|
|
|
|
if (value === null || value === undefined) {
|
|
|
|
|
return html`<span class="empty">Not set</span>`;
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
2026-02-03 23:26:51 +00:00
|
|
|
|
|
|
|
|
if (typeof value === 'number') {
|
|
|
|
|
// Format bytes
|
|
|
|
|
if (fieldKey?.toLowerCase().includes('size') || fieldKey?.toLowerCase().includes('bytes')) {
|
|
|
|
|
return html`<span class="numericValue">${this.formatBytes(value)}</span>`;
|
|
|
|
|
}
|
|
|
|
|
// Format time values
|
|
|
|
|
if (fieldKey?.toLowerCase().includes('ttl') || fieldKey?.toLowerCase().includes('timeout')) {
|
|
|
|
|
return html`<span class="numericValue">${value} seconds</span>`;
|
|
|
|
|
}
|
|
|
|
|
// Format port numbers
|
|
|
|
|
if (fieldKey?.toLowerCase().includes('port')) {
|
|
|
|
|
return html`<span class="numericValue">${value}</span>`;
|
|
|
|
|
}
|
|
|
|
|
// Format counts with separators
|
|
|
|
|
return html`<span class="numericValue">${value.toLocaleString()}</span>`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return String(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private formatBytes(bytes: number): string {
|
|
|
|
|
if (bytes === 0) return '0 B';
|
|
|
|
|
const k = 1024;
|
|
|
|
|
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
|
|
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
|
|
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
feat: Add operations view components for logs, overview, security, and stats
- Implemented `ops-view-logs` for displaying and filtering logs with streaming capabilities.
- Created `ops-view-overview` to show server, email, DNS statistics, and charts.
- Developed `ops-view-security` for monitoring security metrics, blocked IPs, and authentication attempts.
- Added `ops-view-stats` to present comprehensive statistics on server, email, DNS, and security metrics.
- Introduced shared styles and components including `ops-sectionheading` for consistent UI.
2025-06-08 12:03:17 +00:00
|
|
|
}
|
2026-02-03 23:26:51 +00:00
|
|
|
}
|