Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f74c8e5410 | |||
| abeb8ecda3 |
10
changelog.md
10
changelog.md
@@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-01-12 - 3.39.0 - feat(eco-view-system)
|
||||||
|
add memory usage history, process metrics, and top processes display with loading fallback
|
||||||
|
|
||||||
|
- Add memoryUsageHistory state and update it in setMetrics to track memory usage trend
|
||||||
|
- Introduce process state: processTotal, processRunning, processSleeping, processBlocked, and topProcesses
|
||||||
|
- Extend setProcesses signature to accept blocked and a typed process list and store values in state
|
||||||
|
- Use reactive state values in UI tiles (memory trend, process tiles) instead of hardcoded placeholders
|
||||||
|
- Replace 'Threads' tile with 'Blocked' tile and update its icon and color
|
||||||
|
- Render top processes from state and show a 'Loading...' fallback when the list is empty
|
||||||
|
|
||||||
## 2026-01-12 - 3.38.0 - feat(eco-view-system)
|
## 2026-01-12 - 3.38.0 - feat(eco-view-system)
|
||||||
add extended system metrics and display formatted total network usage in eco system view
|
add extended system metrics and display formatted total network usage in eco system view
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ecobridge.xyz/catalog",
|
"name": "@ecobridge.xyz/catalog",
|
||||||
"version": "3.38.0",
|
"version": "3.39.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@ecobridge.xyz/catalog',
|
name: '@ecobridge.xyz/catalog',
|
||||||
version: '3.38.0',
|
version: '3.39.0',
|
||||||
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -246,6 +246,25 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
@state()
|
@state()
|
||||||
accessor networkOutHistory: number[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
accessor networkOutHistory: number[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
|
@state()
|
||||||
|
accessor memoryUsageHistory: number[] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
|
// Process data
|
||||||
|
@state()
|
||||||
|
accessor processTotal = 0;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
accessor processRunning = 0;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
accessor processSleeping = 0;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
accessor processBlocked = 0;
|
||||||
|
|
||||||
|
@state()
|
||||||
|
accessor topProcesses: Array<{ name: string; pid: number; cpu: number; memory: number; state: string }> = [];
|
||||||
|
|
||||||
// Public method to update metrics from backend
|
// Public method to update metrics from backend
|
||||||
public setMetrics(metrics: {
|
public setMetrics(metrics: {
|
||||||
cpu: { usage: number; cores: number; physicalCores?: number; model: string; speed: number; speedMax?: number; loadAvg: number[]; coreLoads?: number[] };
|
cpu: { usage: number; cores: number; physicalCores?: number; model: string; speed: number; speedMax?: number; loadAvg: number[]; coreLoads?: number[] };
|
||||||
@@ -275,6 +294,9 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
this.swapTotal = metrics.memory.swapTotal || 0;
|
this.swapTotal = metrics.memory.swapTotal || 0;
|
||||||
this.swapUsed = metrics.memory.swapUsed || 0;
|
this.swapUsed = metrics.memory.swapUsed || 0;
|
||||||
|
|
||||||
|
// Update memory usage history for trend chart
|
||||||
|
this.memoryUsageHistory = [...this.memoryUsageHistory.slice(1), metrics.memory.usagePercent];
|
||||||
|
|
||||||
// Disk metrics
|
// Disk metrics
|
||||||
if (metrics.disk) {
|
if (metrics.disk) {
|
||||||
this.diskUsage = metrics.disk.usagePercent;
|
this.diskUsage = metrics.disk.usagePercent;
|
||||||
@@ -308,8 +330,12 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Method to set processes data
|
// Method to set processes data
|
||||||
public setProcesses(data: { total: number; running: number; sleeping: number; list: any[] }): void {
|
public setProcesses(data: { total: number; running: number; sleeping: number; blocked?: number; list: Array<{ name: string; pid: number; cpu: number; memory: number; state: string }> }): void {
|
||||||
// Could store and display process data if needed
|
this.processTotal = data.total;
|
||||||
|
this.processRunning = data.running;
|
||||||
|
this.processSleeping = data.sleeping;
|
||||||
|
this.processBlocked = data.blocked || 0;
|
||||||
|
this.topProcesses = data.list || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper to format bytes
|
// Helper to format bytes
|
||||||
@@ -692,7 +718,7 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
value: `${this.memoryUsage}%`,
|
value: `${this.memoryUsage}%`,
|
||||||
type: 'trend' as const,
|
type: 'trend' as const,
|
||||||
icon: 'lucide:trendingUp',
|
icon: 'lucide:trendingUp',
|
||||||
trendData: [58, 62, 65, 63, 68, 72, 70, 65, this.memoryUsage],
|
trendData: this.memoryUsageHistory,
|
||||||
description: 'Recent usage',
|
description: 'Recent usage',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -853,14 +879,14 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
{
|
{
|
||||||
id: 'total-processes',
|
id: 'total-processes',
|
||||||
title: 'Total Processes',
|
title: 'Total Processes',
|
||||||
value: 247,
|
value: this.processTotal,
|
||||||
type: 'number' as const,
|
type: 'number' as const,
|
||||||
icon: 'lucide:layers',
|
icon: 'lucide:layers',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'running',
|
id: 'running',
|
||||||
title: 'Running',
|
title: 'Running',
|
||||||
value: 12,
|
value: this.processRunning,
|
||||||
type: 'number' as const,
|
type: 'number' as const,
|
||||||
icon: 'lucide:play',
|
icon: 'lucide:play',
|
||||||
color: 'hsl(142 71% 45%)',
|
color: 'hsl(142 71% 45%)',
|
||||||
@@ -868,30 +894,21 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
{
|
{
|
||||||
id: 'sleeping',
|
id: 'sleeping',
|
||||||
title: 'Sleeping',
|
title: 'Sleeping',
|
||||||
value: 235,
|
value: this.processSleeping,
|
||||||
type: 'number' as const,
|
type: 'number' as const,
|
||||||
icon: 'lucide:moon',
|
icon: 'lucide:moon',
|
||||||
color: 'hsl(217 91% 60%)',
|
color: 'hsl(217 91% 60%)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'threads',
|
id: 'blocked',
|
||||||
title: 'Threads',
|
title: 'Blocked',
|
||||||
value: 1842,
|
value: this.processBlocked,
|
||||||
type: 'number' as const,
|
type: 'number' as const,
|
||||||
icon: 'lucide:gitBranch',
|
icon: 'lucide:pauseCircle',
|
||||||
|
color: 'hsl(0 84% 60%)',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const topProcesses = [
|
|
||||||
{ name: 'node', pid: 1234, cpu: 12.5, memory: 8.2 },
|
|
||||||
{ name: 'chrome', pid: 2345, cpu: 8.3, memory: 15.4 },
|
|
||||||
{ name: 'code', pid: 3456, cpu: 5.2, memory: 12.1 },
|
|
||||||
{ name: 'docker', pid: 4567, cpu: 4.8, memory: 6.8 },
|
|
||||||
{ name: 'postgres', pid: 5678, cpu: 3.2, memory: 4.5 },
|
|
||||||
{ name: 'nginx', pid: 6789, cpu: 1.5, memory: 2.1 },
|
|
||||||
{ name: 'redis', pid: 7890, cpu: 0.8, memory: 1.8 },
|
|
||||||
];
|
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<div class="panel-title">Processes</div>
|
<div class="panel-title">Processes</div>
|
||||||
@@ -915,14 +932,14 @@ export class EcoViewSystem extends DeesElement {
|
|||||||
<span>CPU %</span>
|
<span>CPU %</span>
|
||||||
<span>Memory %</span>
|
<span>Memory %</span>
|
||||||
</div>
|
</div>
|
||||||
${topProcesses.map(proc => html`
|
${this.topProcesses.length > 0 ? this.topProcesses.map(proc => html`
|
||||||
<div class="process-row">
|
<div class="process-row">
|
||||||
<span class="process-name">${proc.name}</span>
|
<span class="process-name">${proc.name}</span>
|
||||||
<span class="process-value">${proc.pid}</span>
|
<span class="process-value">${proc.pid}</span>
|
||||||
<span class="process-value ${proc.cpu > 10 ? 'high' : ''}">${proc.cpu}%</span>
|
<span class="process-value ${proc.cpu > 10 ? 'high' : ''}">${proc.cpu}%</span>
|
||||||
<span class="process-value ${proc.memory > 10 ? 'high' : ''}">${proc.memory}%</span>
|
<span class="process-value ${proc.memory > 10 ? 'high' : ''}">${proc.memory}%</span>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`) : html`<div class="process-row"><span class="process-name">Loading...</span></div>`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
Reference in New Issue
Block a user