diff --git a/dashboard/src/pages/components/node-details.ts b/dashboard/src/pages/components/node-details.ts index 0f40ae8a..437c9aeb 100644 --- a/dashboard/src/pages/components/node-details.ts +++ b/dashboard/src/pages/components/node-details.ts @@ -5,7 +5,7 @@ import "@material/web/divider/divider"; import "@material/web/iconbutton/icon-button"; import "@material/web/list/list"; import "@material/web/list/list-item"; -import { mdiChatProcessing, mdiTrashCan, mdiUpdate } from "@mdi/js"; +import { mdiChatProcessing, mdiShareVariant, mdiTrashCan, mdiUpdate } from "@mdi/js"; import { LitElement, css, html, nothing } from "lit"; import { customElement, property, state } from "lit/decorators.js"; import { MatterClient } from "../../client/client"; @@ -85,11 +85,12 @@ export class NodeDetails extends LitElement { } - Interview - ${this.node.updateStateProgress != null || this._updateInitiated ? html` - Update (${this.node.updateStateProgress || 0}%)` + ${this._updateInitiated || (this.node.updateState || 0) > 1 ? html` + Update in progress (${this.node.updateStateProgress || 0}%)` : html`Update`} + + Share Remove @@ -178,6 +179,30 @@ export class NodeDetails extends LitElement { } } + private async _openCommissioningWindow() { + if ( + !(await showPromptDialog({ + title: "Share device", + text: "Do you want to share this device with another Matter controller (open commissioning window)?", + confirmText: "Share", + })) + ) { + return; + } + try { + const shareCode = await this.client.openCommissioningWindow(this.node!.node_id); + showAlertDialog({ + title: "Share device", + text: `Setup code: ${shareCode.setup_manual_code}`, + }); + } catch (err: any) { + showAlertDialog({ + title: "Failed to open commissioning window on node", + text: err.message, + }); + } + } + static styles = css` .btn { --md-outlined-button-container-shape: 0px;