diff --git a/FUNDING.json b/FUNDING.json new file mode 100644 index 000000000..178de491d --- /dev/null +++ b/FUNDING.json @@ -0,0 +1,7 @@ +{ + "drips": { + "filecoin": { + "ownedBy": "0xa36EcC2989E594e246BE46D0020F04F3afe8ADad" + } + } +} diff --git a/lib/fastparamfetch/paramfetch.go b/lib/fastparamfetch/paramfetch.go index 46e7290a3..f552a0784 100644 --- a/lib/fastparamfetch/paramfetch.go +++ b/lib/fastparamfetch/paramfetch.go @@ -26,7 +26,9 @@ import ( var log = logging.Logger("paramfetch") // const gateway = "http://198.211.99.118/ipfs/" -const gateway = "https://proofs.filecoin.io/ipfs/" +// const gateway = "https://proofs.filecoin.io/ipfs/" +const gateway = "https://pub-08ae819c828244bdbe5f615fd8c5e144.r2.dev/ipfs/" + const paramdir = "/var/tmp/filecoin-proof-parameters" const dirEnv = "FIL_PROOFS_PARAMETER_CACHE" const lockFile = "fetch.lock" 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` - - - - - + + + +
+ @@ -62,10 +77,7 @@ customElements.define('cluster-tasks', class ClusterTasks extends LitElement { ${this.data - .filter( - (entry) => - this.showBackgroundTasks || !entry.Name.startsWith('bg:') - ) + .filter((entry) =>this.showBackgroundTasks || !entry.Name.startsWith('bg:')) .map( (entry) => html` @@ -75,9 +87,7 @@ customElements.define('cluster-tasks', class ClusterTasks extends LitElement { @@ -86,5 +96,7 @@ customElements.define('cluster-tasks', class ClusterTasks extends LitElement {
SpID Task
${entry.SincePostedStr} ${entry.OwnerID - ? html`${entry.Owner}` + ? html`${entry.Owner}` : ''}
`; - } -}); + } +} + +customElements.define('cluster-tasks', ClusterTasks); diff --git a/web/static/index.html b/web/static/index.html index f2fbe6e5e..7f4273e84 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -17,21 +17,24 @@ + @@ -109,8 +112,15 @@

24h task counts

-

Cluster Tasks

- +
+

Cluster Tasks

+ +
+ + +

Cluster Tasks

+ +
@@ -120,4 +130,4 @@

Cluster Tasks

- \ No newline at end of file + diff --git a/web/static/ux/components/Drawer.mjs b/web/static/ux/components/Drawer.mjs new file mode 100644 index 000000000..ac00a0a92 --- /dev/null +++ b/web/static/ux/components/Drawer.mjs @@ -0,0 +1,217 @@ +import { html, css } from 'https://cdn.jsdelivr.net/gh/lit/dist@3/all/lit-all.min.js'; +import { StyledLitElement } from '/ux/StyledLitElement.mjs'; + +/** + * A Drawer component that displays content in a scrollable panel. + * + * @element ui-drawer + * + * @property {String} anchor - The side from which the drawer appears. Valid values: `left`, `right`, `top`, `bottom`. Default is `right`. + * @property {Boolean} isOpen - Indicates whether the drawer is open. Default is `true`. + * @property {String} label - The label for the drawer's open button. + * @property {Function} onClose - Callback function invoked when the drawer is closed. + * + * @slot title - Content to be placed in the drawer's heading. + * @slot content - Main content of the drawer. + * + * @example + * + *

Menu

+ *
+ * ... + *
+ *
+ */ +class Drawer extends StyledLitElement { + static properties = { + anchor: { type: String, reflect: true }, + isOpen: { type: Boolean, reflect: true }, + label: { type: String }, + onClose: { type: Function, attribute: false }, + }; + + constructor() { + super(); + this.anchor = 'right'; + this.isOpen = true; + this.label = 'Drawer'; + this.onClose = null; + this.dialog = null; + } + + set anchor(value) { + const validAnchors = ['left', 'right', 'top', 'bottom']; + this._anchor = validAnchors.includes(value) ? value : 'right'; + } + + get anchor() { + return this._anchor; + } + + firstUpdated() { + this.dialog = this.shadowRoot.querySelector('dialog'); + } + + updated(changedProperties) { + if (changedProperties.has('isOpen') && this.dialog) { + if (this.isOpen) { + this.dialog.show(); + } else { + this.dialog.close(); + } + } + } + + handleClose(event) { + const reason = event.type === 'cancel' ? 'escapeKeyDown' : 'backdropClick'; + this.isOpen = false; + + if (this.onClose) { + this.onClose(event, reason); + } + } + + handleToggle() { + this.isOpen = !this.isOpen; + } + + render() { + return html` +
+ + +
+ + +
+
+ +
+
+
+ `; + } +} + +Drawer.styles = [ + css` + :host([isOpen]) .open-btn { + visibility: hidden; + } + + .open-btn { + position: fixed; + top: 0; + right: 0; + transform-origin: bottom right; + transform: rotate(-90deg); + color: var(--color-text-primary); + background-color: var(--color-secondary-light); + border-radius: 8px 8px 0 0; + padding: 0.75rem 1.2rem; + font-size: 0.9rem; + + &:hover, &:active { + cursor: pointer; + background-color: var(--color-secondary-main); + } + } + + dialog { + position: fixed; + padding: 1rem; + border: 0; + background-color: var(--color-fg); + color: var(--color-text-primary); + overflow-y: auto; + + &[anchor="right"] { + top: 0; + bottom: 0; + right: 0; + left: auto; + width: 40rem; + min-height: 100vh; + max-height: 100vh; + box-shadow: -8px 0 20px 4px var(--color-shadow-main); + } + + &[anchor="left"] { + top: 0; + bottom: 0; + right: auto; + left: 0; + width: 40rem; + min-height: 100vh; + max-height: 100vh; + box-shadow: 8px 0 20px 4px var(--color-shadow-main); + } + + &[anchor="top"] { + top: 0; + bottom: auto; + right: 0; + left: 0; + min-width: 100vw; + max-width: 100vw; + min-height: 10rem; + max-height: 50vh; + box-shadow: 0 8px 20px 4px var(--color-shadow-main); + padding: 1rem 2rem; + } + + &[anchor="bottom"] { + top: auto; + bottom: 0; + right: 0; + left: 0; + min-width: 100vw; + max-width: 100vw; + min-height: 10rem; + max-height: 50vh; + box-shadow: 0 -8px 20px 4px var(--color-shadow-main); + padding: 1rem 2rem; + } + + .dialog-heading { + display: flex; + justify-content: space-between; + align-items: baseline; + max-width: inherit; + + ::slotted(*) { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .close-btn { + width: 1.5rem; + height: 1.5rem; + margin-left: 1.5rem; + text-align: center; + background: transparent; + color: var(--color-text-primary); + + &:hover, &:active { + cursor: pointer; + color: var(--color-text-primary); + opacity: 0.8; + } + } + } + } + ` +] + +customElements.define('ui-drawer', Drawer); diff --git a/web/static/ux/css-reset.js b/web/static/ux/css-reset.js index f58e1e057..6e322d9e8 100644 --- a/web/static/ux/css-reset.js +++ b/web/static/ux/css-reset.js @@ -8,6 +8,7 @@ export default css ` * { margin: 0; padding: 0; + font-family: 'JetBrains Mono', monospace; } ul, ol { @@ -18,4 +19,13 @@ export default css ` a { text-decoration: none; } + + button { + all: unset; + display: inline-block; + } + + button:focus { + outline: revert; + } `; diff --git a/web/static/ux/main.css b/web/static/ux/main.css index 2938dbe5f..ca3faaf83 100644 --- a/web/static/ux/main.css +++ b/web/static/ux/main.css @@ -19,6 +19,12 @@ --color-text-primary: #FFF; --color-text-secondary: #171717; + /* Areas */ + --color-fg: #2A2A2E; + --color-bg: #1D1D21; + + --color-shadow-main: #1e1d1f; + /* Forms */ --color-form-default: #808080; /* buttons, field outlines */ --color-form-default-pressed: #A1A1A1;