class QuantumProcess extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
0%
CPU
0MB
Memory
00:00
Uptime
`;
}
connectedCallback() {
this.shadowRoot.querySelector('.terminate').addEventListener('click', () => {
this.dispatchEvent(new CustomEvent('terminate', {
bubbles: true,
composed: true,
detail: { pid: this.getAttribute('data-pid') }
}));
});
}
}
customElements.define('quantum-process', QuantumProcess);