@matter-server/dashboard 0.2.7-alpha.0-20260118-993a1c7 → 0.2.7-alpha.0-20260118-45c7af0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/esm/components/dialogs/settings/log-level-dialog.d.ts +33 -0
  2. package/dist/esm/components/dialogs/settings/log-level-dialog.d.ts.map +1 -0
  3. package/dist/esm/components/dialogs/settings/log-level-dialog.js +185 -0
  4. package/dist/esm/components/dialogs/settings/log-level-dialog.js.map +6 -0
  5. package/dist/esm/components/dialogs/settings/show-log-level-dialog.d.ts +8 -0
  6. package/dist/esm/components/dialogs/settings/show-log-level-dialog.d.ts.map +1 -0
  7. package/dist/esm/components/dialogs/settings/show-log-level-dialog.js +15 -0
  8. package/dist/esm/components/dialogs/settings/show-log-level-dialog.js.map +6 -0
  9. package/dist/esm/pages/components/header.d.ts +1 -0
  10. package/dist/esm/pages/components/header.d.ts.map +1 -1
  11. package/dist/esm/pages/components/header.js +13 -1
  12. package/dist/esm/pages/components/header.js.map +1 -1
  13. package/dist/web/js/{commission-node-dialog-DGw5qDgH.js → commission-node-dialog-CoaDIV2Y.js} +5 -5
  14. package/dist/web/js/{commission-node-existing-CHyyeC8y.js → commission-node-existing-DEU_mJjO.js} +5 -4
  15. package/dist/web/js/{commission-node-thread-iRDSlidy.js → commission-node-thread-DZ6DghSs.js} +5 -4
  16. package/dist/web/js/{commission-node-wifi-C4YNR3bG.js → commission-node-wifi-DOyin0q3.js} +5 -4
  17. package/dist/web/js/{dialog-box-ag-xOaYh.js → dialog-box-B5sunUPv.js} +2 -2
  18. package/dist/web/js/{fire_event-BeiEbHcE.js → fire_event-C9Duc1j-.js} +1 -1
  19. package/dist/web/js/log-level-dialog-B7LsZYUL.js +3232 -0
  20. package/dist/web/js/main.js +24 -1
  21. package/dist/web/js/{matter-dashboard-app-BxQ4W_uT.js → matter-dashboard-app-DlHSE_Qh.js} +81 -5
  22. package/dist/web/js/{node-binding-dialog-ClziphM0.js → node-binding-dialog-BifZsigR.js} +4 -3
  23. package/dist/web/js/outlined-text-field-D2BOt1yD.js +968 -0
  24. package/dist/web/js/{prevent_default-Bs2sUnny.js → prevent_default-CuW2EnKR.js} +1 -1
  25. package/dist/web/js/validator-MOJiFndw.js +1122 -0
  26. package/package.json +4 -4
  27. package/src/components/dialogs/settings/log-level-dialog.ts +179 -0
  28. package/src/components/dialogs/settings/show-log-level-dialog.ts +14 -0
  29. package/src/pages/components/header.ts +16 -1
  30. package/dist/web/js/outlined-text-field-B-CiqgEJ.js +0 -2086
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matter-server/dashboard",
3
- "version": "0.2.7-alpha.0-20260118-993a1c7",
3
+ "version": "0.2.7-alpha.0-20260118-45c7af0",
4
4
  "description": "Dashboard for OHF Matter Server",
5
5
  "bugs": {
6
6
  "url": "https://github.com/matter-js/matterjs-server/issues"
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/preset-env": "^7.28.5",
26
- "@matter/main": "0.16.5",
26
+ "@matter/main": "0.16.6-alpha.0-20260118-ceec17415",
27
27
  "@rollup/plugin-babel": "^6.1.0",
28
28
  "@rollup/plugin-commonjs": "^29.0.0",
29
29
  "rollup-plugin-copy": "^3.5.0",
@@ -37,8 +37,8 @@
37
37
  "dependencies": {
38
38
  "@lit/context": "^1.1.6",
39
39
  "@material/web": "^2.4.1",
40
- "@matter-server/ws-client": "0.2.7-alpha.0-20260118-993a1c7",
41
- "@matter-server/custom-clusters": "0.2.7-alpha.0-20260118-993a1c7",
40
+ "@matter-server/ws-client": "0.2.7-alpha.0-20260118-45c7af0",
41
+ "@matter-server/custom-clusters": "0.2.7-alpha.0-20260118-45c7af0",
42
42
  "@mdi/js": "^7.4.47",
43
43
  "lit": "^3.3.1",
44
44
  "tslib": "^2.8.1"
@@ -0,0 +1,179 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025-2026 Open Home Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ import "@material/web/button/text-button";
8
+ import "@material/web/dialog/dialog";
9
+ import type { MdDialog } from "@material/web/dialog/dialog.js";
10
+ import "@material/web/select/outlined-select";
11
+ import type { MdOutlinedSelect } from "@material/web/select/outlined-select.js";
12
+ import "@material/web/select/select-option";
13
+ import { LogLevelString, MatterClient } from "@matter-server/ws-client";
14
+ import { css, html, LitElement, nothing } from "lit";
15
+ import { customElement, property, query, state } from "lit/decorators.js";
16
+ import { preventDefault } from "../../../util/prevent_default.js";
17
+
18
+ const LOG_LEVELS: { value: LogLevelString; label: string }[] = [
19
+ { value: "critical", label: "Critical" },
20
+ { value: "error", label: "Error" },
21
+ { value: "warning", label: "Warning" },
22
+ { value: "info", label: "Info" },
23
+ { value: "debug", label: "Debug" },
24
+ ];
25
+
26
+ @customElement("log-level-dialog")
27
+ export class LogLevelDialog extends LitElement {
28
+ @property({ attribute: false })
29
+ public client!: MatterClient;
30
+
31
+ @state() private _consoleLevel: LogLevelString = "info";
32
+ @state() private _fileLevel: LogLevelString | null = null;
33
+ @state() private _loading = true;
34
+ @state() private _applying = false;
35
+
36
+ @query("md-outlined-select[name='console']")
37
+ private _consoleSelect!: MdOutlinedSelect;
38
+
39
+ @query("md-outlined-select[name='file']")
40
+ private _fileSelect?: MdOutlinedSelect;
41
+
42
+ override connectedCallback() {
43
+ super.connectedCallback();
44
+ void this._loadLogLevels();
45
+ }
46
+
47
+ private async _loadLogLevels() {
48
+ try {
49
+ const result = await this.client.getLogLevel();
50
+ this._consoleLevel = result.console_loglevel;
51
+ this._fileLevel = result.file_loglevel;
52
+ } catch (err) {
53
+ console.error("Failed to load log levels:", err);
54
+ } finally {
55
+ this._loading = false;
56
+ }
57
+ }
58
+
59
+ private async _apply() {
60
+ this._applying = true;
61
+ try {
62
+ const consoleLevel = this._consoleSelect.value as LogLevelString;
63
+ const fileLevel = this._fileSelect?.value as LogLevelString | undefined;
64
+
65
+ const result = await this.client.setLogLevel(
66
+ consoleLevel,
67
+ this._fileLevel !== null ? fileLevel : undefined,
68
+ );
69
+
70
+ this._consoleLevel = result.console_loglevel;
71
+ this._fileLevel = result.file_loglevel;
72
+ this._close();
73
+ } catch (err) {
74
+ console.error("Failed to apply log levels:", err);
75
+ alert("Failed to apply log levels");
76
+ } finally {
77
+ this._applying = false;
78
+ }
79
+ }
80
+
81
+ private _close() {
82
+ this.shadowRoot!.querySelector<MdDialog>("md-dialog")!.close();
83
+ }
84
+
85
+ private _handleClosed() {
86
+ this.parentNode!.removeChild(this);
87
+ }
88
+
89
+ protected override render() {
90
+ return html`
91
+ <md-dialog open @cancel=${preventDefault} @closed=${this._handleClosed}>
92
+ <div slot="headline">Server Log Settings</div>
93
+ <div slot="content">
94
+ ${this._loading
95
+ ? html`<p class="loading">Loading...</p>`
96
+ : html`
97
+ <p class="hint">Changes are temporary and will be reset on the next server restart.</p>
98
+ <div class="form-field">
99
+ <label>Console Log Level</label>
100
+ <md-outlined-select name="console" .value=${this._consoleLevel}>
101
+ ${LOG_LEVELS.map(
102
+ level => html`
103
+ <md-select-option
104
+ value=${level.value}
105
+ ?selected=${level.value === this._consoleLevel}
106
+ >
107
+ <div slot="headline">${level.label}</div>
108
+ </md-select-option>
109
+ `,
110
+ )}
111
+ </md-outlined-select>
112
+ </div>
113
+ ${this._fileLevel !== null
114
+ ? html`
115
+ <div class="form-field">
116
+ <label>File Log Level</label>
117
+ <md-outlined-select name="file" .value=${this._fileLevel}>
118
+ ${LOG_LEVELS.map(
119
+ level => html`
120
+ <md-select-option
121
+ value=${level.value}
122
+ ?selected=${level.value === this._fileLevel}
123
+ >
124
+ <div slot="headline">${level.label}</div>
125
+ </md-select-option>
126
+ `,
127
+ )}
128
+ </md-outlined-select>
129
+ </div>
130
+ `
131
+ : nothing}
132
+ `}
133
+ </div>
134
+ <div slot="actions">
135
+ <md-text-button @click=${this._close}>Cancel</md-text-button>
136
+ <md-text-button @click=${this._apply} ?disabled=${this._loading || this._applying}>
137
+ ${this._applying ? "Applying..." : "Apply"}
138
+ </md-text-button>
139
+ </div>
140
+ </md-dialog>
141
+ `;
142
+ }
143
+
144
+ static override styles = css`
145
+ .loading {
146
+ text-align: center;
147
+ padding: 24px;
148
+ color: var(--md-sys-color-on-surface-variant);
149
+ }
150
+
151
+ .hint {
152
+ font-size: 0.875rem;
153
+ color: var(--md-sys-color-on-surface-variant);
154
+ margin: 0 0 16px 0;
155
+ font-style: italic;
156
+ }
157
+
158
+ .form-field {
159
+ margin-bottom: 16px;
160
+ }
161
+
162
+ .form-field label {
163
+ display: block;
164
+ margin-bottom: 8px;
165
+ font-weight: 500;
166
+ color: var(--md-sys-color-on-surface);
167
+ }
168
+
169
+ md-outlined-select {
170
+ width: 100%;
171
+ }
172
+ `;
173
+ }
174
+
175
+ declare global {
176
+ interface HTMLElementTagNameMap {
177
+ "log-level-dialog": LogLevelDialog;
178
+ }
179
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025-2026 Open Home Foundation
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ import { MatterClient } from "@matter-server/ws-client";
8
+
9
+ export const showLogLevelDialog = async (client: MatterClient) => {
10
+ await import("./log-level-dialog.js");
11
+ const dialog = document.createElement("log-level-dialog");
12
+ dialog.client = client;
13
+ document.querySelector("matter-dashboard-app")?.renderRoot.appendChild(dialog);
14
+ };
@@ -10,9 +10,10 @@ import "@material/web/iconbutton/icon-button";
10
10
  import "@material/web/list/list";
11
11
  import "@material/web/list/list-item";
12
12
  import { MatterClient } from "@matter-server/ws-client";
13
- import { mdiArrowLeft, mdiBrightnessAuto, mdiLogout, mdiWeatherNight, mdiWeatherSunny } from "@mdi/js";
13
+ import { mdiArrowLeft, mdiBrightnessAuto, mdiCog, mdiLogout, mdiWeatherNight, mdiWeatherSunny } from "@mdi/js";
14
14
  import { LitElement, css, html, nothing } from "lit";
15
15
  import { customElement, property, state } from "lit/decorators.js";
16
+ import { showLogLevelDialog } from "../../components/dialogs/settings/show-log-level-dialog.js";
16
17
  import "../../components/ha-svg-icon";
17
18
  import { EffectiveTheme, ThemePreference, ThemeService } from "../../util/theme-service.js";
18
19
 
@@ -51,6 +52,12 @@ export class DashboardHeader extends LitElement {
51
52
  ThemeService.cycleTheme();
52
53
  }
53
54
 
55
+ private _openSettings() {
56
+ if (this.client) {
57
+ showLogLevelDialog(this.client);
58
+ }
59
+ }
60
+
54
61
  private _getThemeIcon(): string {
55
62
  switch (this._themePreference) {
56
63
  case "light":
@@ -95,6 +102,14 @@ export class DashboardHeader extends LitElement {
95
102
  </md-icon-button>
96
103
  `;
97
104
  })}
105
+ <!-- settings button (only when connected) -->
106
+ ${this.client
107
+ ? html`
108
+ <md-icon-button @click=${this._openSettings} title="Server Settings">
109
+ <ha-svg-icon .path=${mdiCog}></ha-svg-icon>
110
+ </md-icon-button>
111
+ `
112
+ : nothing}
98
113
  <!-- theme toggle button -->
99
114
  <md-icon-button @click=${this._cycleTheme} .title=${this._getThemeTooltip()}>
100
115
  <ha-svg-icon .path=${this._getThemeIcon()}></ha-svg-icon>