diff --git a/web/static/cluster-tasks.mjs b/web/static/cluster-tasks.mjs index e45b93084..6d9b81919 100644 --- a/web/static/cluster-tasks.mjs +++ b/web/static/cluster-tasks.mjs @@ -1,33 +1,48 @@ -import { LitElement, html, css } from 'https://cdn.jsdelivr.net/gh/lit/dist@3/all/lit-all.min.js'; +import {LitElement, html, css} from 'https://cdn.jsdelivr.net/gh/lit/dist@3/all/lit-all.min.js'; import RPCCall from '/lib/jsonrpc.mjs'; -customElements.define('cluster-tasks', class ClusterTasks extends LitElement { - static get properties() { - return { - data: { type: Array }, - showBackgroundTasks: { type: Boolean }, - }; - } +class ClusterTasks extends LitElement { + static get properties() { + return { + data: { type: Array }, + showBackgroundTasks: { type: Boolean }, + }; + } - constructor() { - super(); - this.data = []; - this.showBackgroundTasks = false; - this.loadData(); - } + static get styles() { + return css` + th, td { + &:nth-child(1) { width: 8ch; } + &:nth-child(2) { width: 16ch; } + &:nth-child(3) { width: 10ch; } + &:nth-child(4) { width: 10ch; } + &:nth-child(5) { min-width: 20ch; } + + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + ` + } - async loadData() { - this.data = (await RPCCall('ClusterTaskSummary')) || []; - setTimeout(() => this.loadData(), 1000); - this.requestUpdate(); - } + constructor() { + super(); + this.data = []; + this.showBackgroundTasks = false; + this.loadData(); + } - toggleShowBackgroundTasks(e) { - this.showBackgroundTasks = e.target.checked; - } + async loadData() { + this.data = (await RPCCall('ClusterTaskSummary')) || []; + setTimeout(() => this.loadData(), 1000); + this.requestUpdate(); + } - render() { - return html` + toggleShowBackgroundTasks(e) { + this.showBackgroundTasks = e.target.checked; + } + + render() { + return html` - - - -
SpID | Task | @@ -62,10 +77,7 @@ customElements.define('cluster-tasks', class ClusterTasks extends LitElement {
---|---|
${entry.SincePostedStr} | ${entry.OwnerID - ? html`${entry.Owner}` + ? html`${entry.Owner}` : ''} |