@matter-server/dashboard 0.6.1 → 0.6.2-alpha.0-20260422-4efb179
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.
- package/README.md +19 -0
- package/dist/esm/client/models/descriptions.d.ts +10 -0
- package/dist/esm/client/models/descriptions.d.ts.map +1 -1
- package/dist/esm/client/models/descriptions.js +5684 -1881
- package/dist/esm/client/models/descriptions.js.map +1 -1
- package/dist/esm/components/dialog-box/dialog-box.d.ts.map +1 -1
- package/dist/esm/components/dialog-box/show-dialog-box.d.ts.map +1 -1
- package/dist/esm/components/dialogs/acl/model.d.ts.map +1 -1
- package/dist/esm/components/dialogs/binding/model.d.ts.map +1 -1
- package/dist/esm/components/dialogs/binding/node-binding-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/binding/show-node-binding-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-existing.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-thread.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/commission-node-wifi.d.ts.map +1 -1
- package/dist/esm/components/dialogs/commission-node-dialog/show-commission-node-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.d.ts +34 -0
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.js +187 -0
- package/dist/esm/components/dialogs/dev/attribute-write-dialog.js.map +6 -0
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.d.ts +33 -0
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.js +221 -0
- package/dist/esm/components/dialogs/dev/command-invoke-dialog.js.map +6 -0
- package/dist/esm/components/dialogs/dev/parse-json-payload.d.ts +27 -0
- package/dist/esm/components/dialogs/dev/parse-json-payload.d.ts.map +1 -0
- package/dist/esm/components/dialogs/dev/parse-json-payload.js +25 -0
- package/dist/esm/components/dialogs/dev/parse-json-payload.js.map +6 -0
- package/dist/esm/components/dialogs/dev/show-attribute-write-dialog.d.ts +17 -0
- package/dist/esm/components/dialogs/dev/show-attribute-write-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/dev/show-attribute-write-dialog.js +21 -0
- package/dist/esm/components/dialogs/dev/show-attribute-write-dialog.js.map +6 -0
- package/dist/esm/components/dialogs/dev/show-command-invoke-dialog.d.ts +16 -0
- package/dist/esm/components/dialogs/dev/show-command-invoke-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/dev/show-command-invoke-dialog.js +20 -0
- package/dist/esm/components/dialogs/dev/show-command-invoke-dialog.js.map +6 -0
- package/dist/esm/components/dialogs/settings/log-level-dialog.d.ts +2 -11
- package/dist/esm/components/dialogs/settings/log-level-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/settings/log-level-dialog.js +13 -140
- package/dist/esm/components/dialogs/settings/log-level-dialog.js.map +1 -1
- package/dist/esm/components/dialogs/settings/log-level-section.d.ts +34 -0
- package/dist/esm/components/dialogs/settings/log-level-section.d.ts.map +1 -0
- package/dist/esm/components/dialogs/settings/log-level-section.js +181 -0
- package/dist/esm/components/dialogs/settings/log-level-section.js.map +6 -0
- package/dist/esm/components/dialogs/settings/settings-dialog.d.ts +31 -0
- package/dist/esm/components/dialogs/settings/settings-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/settings/settings-dialog.js +165 -0
- package/dist/esm/components/dialogs/settings/settings-dialog.js.map +6 -0
- package/dist/esm/components/dialogs/settings/show-log-level-dialog.d.ts.map +1 -1
- package/dist/esm/components/dialogs/settings/show-settings-dialog.d.ts +8 -0
- package/dist/esm/components/dialogs/settings/show-settings-dialog.d.ts.map +1 -0
- package/dist/esm/components/dialogs/settings/show-settings-dialog.js +15 -0
- package/dist/esm/components/dialogs/settings/show-settings-dialog.js.map +6 -0
- package/dist/esm/components/ha-svg-icon.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/base-cluster-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/basic-information-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/level-control-commands.d.ts.map +1 -1
- package/dist/esm/pages/cluster-commands/clusters/on-off-commands.d.ts.map +1 -1
- package/dist/esm/pages/components/footer.d.ts.map +1 -1
- package/dist/esm/pages/components/header.d.ts +2 -0
- package/dist/esm/pages/components/header.d.ts.map +1 -1
- package/dist/esm/pages/components/header.js +47 -3
- package/dist/esm/pages/components/header.js.map +1 -1
- package/dist/esm/pages/components/node-details.d.ts.map +1 -1
- package/dist/esm/pages/components/server-details.d.ts.map +1 -1
- package/dist/esm/pages/matter-cluster-view.d.ts +13 -2
- package/dist/esm/pages/matter-cluster-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-cluster-view.js +338 -4
- package/dist/esm/pages/matter-cluster-view.js.map +2 -2
- package/dist/esm/pages/matter-dashboard-app.d.ts.map +1 -1
- package/dist/esm/pages/matter-endpoint-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-network-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-node-view.d.ts.map +1 -1
- package/dist/esm/pages/matter-server-view.d.ts.map +1 -1
- package/dist/esm/pages/network/base-network-graph.d.ts.map +1 -1
- package/dist/esm/pages/network/base-network-graph.js +1 -0
- package/dist/esm/pages/network/base-network-graph.js.map +1 -1
- package/dist/esm/pages/network/device-panel.d.ts.map +1 -1
- package/dist/esm/pages/network/network-details.d.ts.map +1 -1
- package/dist/esm/pages/network/thread-graph.d.ts.map +1 -1
- package/dist/esm/pages/network/update-connections-dialog.d.ts.map +1 -1
- package/dist/esm/pages/network/wifi-graph.d.ts.map +1 -1
- package/dist/esm/util/clone_class.d.ts.map +1 -1
- package/dist/esm/util/dev-mode-service.d.ts +14 -0
- package/dist/esm/util/dev-mode-service.d.ts.map +1 -0
- package/dist/esm/util/dev-mode-service.js +37 -0
- package/dist/esm/util/dev-mode-service.js.map +6 -0
- package/dist/esm/util/fire_event.d.ts.map +1 -1
- package/dist/esm/util/prevent_default.d.ts.map +1 -1
- package/dist/esm/util/theme-service.d.ts.map +1 -1
- package/dist/web/index.html +6 -0
- package/dist/web/js/attribute-write-dialog-BjBvI9Vg.js +166 -0
- package/dist/web/js/command-invoke-dialog-GfZXZjFc.js +192 -0
- package/dist/web/js/{commission-node-dialog-DfwKU9qk.js → commission-node-dialog-BAEMNaRj.js} +4 -4
- package/dist/web/js/{commission-node-existing-C7ITvNfj.js → commission-node-existing-NbcOLhCW.js} +2 -2
- package/dist/web/js/{commission-node-thread-D-icSzto.js → commission-node-thread-CPS6eA4_.js} +2 -2
- package/dist/web/js/{commission-node-wifi-DwUkXlWz.js → commission-node-wifi-DgnCq_XI.js} +2 -2
- package/dist/web/js/{dialog-box-BmpaTrvT.js → dialog-box-CRmSjFmJ.js} +1 -1
- package/dist/web/js/{fire_event-2ZxL-AHZ.js → fire_event-CMN0BnIt.js} +1 -1
- package/dist/web/js/main.js +2 -2
- package/dist/web/js/{matter-dashboard-app-BtHTmAPq.js → matter-dashboard-app-Cne9OvsE.js} +6201 -1897
- package/dist/web/js/{node-binding-dialog-MMx9rkCF.js → node-binding-dialog-C3d1oHJA.js} +1 -1
- package/dist/web/js/parse-json-payload-DU9TWKdu.js +32 -0
- package/dist/web/js/{log-level-dialog-D4hubdib.js → settings-dialog-WGqWo_ox.js} +583 -69
- package/package.json +29 -29
- package/src/client/models/descriptions.ts +5690 -1878
- package/src/components/dialogs/dev/attribute-write-dialog.ts +169 -0
- package/src/components/dialogs/dev/command-invoke-dialog.ts +204 -0
- package/src/components/dialogs/dev/parse-json-payload.ts +37 -0
- package/src/components/dialogs/dev/show-attribute-write-dialog.ts +30 -0
- package/src/components/dialogs/dev/show-command-invoke-dialog.ts +28 -0
- package/src/components/dialogs/settings/log-level-dialog.ts +15 -138
- package/src/components/dialogs/settings/log-level-section.ts +174 -0
- package/src/components/dialogs/settings/settings-dialog.ts +165 -0
- package/src/components/dialogs/settings/show-settings-dialog.ts +14 -0
- package/src/pages/components/header.ts +47 -3
- package/src/pages/matter-cluster-view.ts +366 -4
- package/src/pages/network/base-network-graph.ts +1 -1
- package/src/tsconfig.json +9 -2
- package/src/util/dev-mode-service.ts +44 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e,
|
|
1
|
+
import { e, m as mixinDelegatesAria, a as mixinConstraintValidation, b as mixinFormAssociated, c as mixinElementInternals, i, _ as __decorate, n as n$1, d as e$1, f as isActivationClick, g as dispatchActivationClick, A, h as e$2, j as b, r as redispatchEvent, k as getFormValue, l as getFormState, o as createValidator, C as CheckboxValidator, p as getValidityAnchor, q as i$1, t, N as NavigableKeys, s as o, u as r, v as createAnimationSignal, L as ListController, w as getActiveItem, x as getLastActivatableItem, y as getFirstActivatableItem, z as o$1, E as EASING, V as Validator, D, B as mixinOnReportValidity, F as onReportValidity, G as u, H as i$2, I as fireAndForget, J as showAlertDialog, K as handleAsync, M as DevModeService } from './matter-dashboard-app-Cne9OvsE.js';
|
|
2
2
|
import { p as preventDefault } from './prevent_default-D-ohDGsN.js';
|
|
3
3
|
import './main.js';
|
|
4
4
|
|
|
@@ -23,6 +23,381 @@ function n(n) {
|
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @license
|
|
28
|
+
* Copyright 2023 Google LLC
|
|
29
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* A symbol used to access dispatch hooks on an event.
|
|
33
|
+
*/
|
|
34
|
+
const dispatchHooks = Symbol('dispatchHooks');
|
|
35
|
+
/**
|
|
36
|
+
* Add a hook for an event that is called after the event is dispatched and
|
|
37
|
+
* propagates to other event listeners.
|
|
38
|
+
*
|
|
39
|
+
* This is useful for behaviors that need to check if an event is canceled.
|
|
40
|
+
*
|
|
41
|
+
* The callback is invoked synchronously, which allows for better integration
|
|
42
|
+
* with synchronous platform APIs (like `<form>` or `<label>` clicking).
|
|
43
|
+
*
|
|
44
|
+
* Note: `setupDispatchHooks()` must be called on the element before adding any
|
|
45
|
+
* other event listeners. Call it in the constructor of an element or
|
|
46
|
+
* controller.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* class MyControl extends LitElement {
|
|
51
|
+
* constructor() {
|
|
52
|
+
* super();
|
|
53
|
+
* setupDispatchHooks(this, 'click');
|
|
54
|
+
* this.addEventListener('click', event => {
|
|
55
|
+
* afterDispatch(event, () => {
|
|
56
|
+
* if (event.defaultPrevented) {
|
|
57
|
+
* return
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* // ... perform logic
|
|
61
|
+
* });
|
|
62
|
+
* });
|
|
63
|
+
* }
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* class MyController implements ReactiveController {
|
|
70
|
+
* constructor(host: ReactiveElement) {
|
|
71
|
+
* // setupDispatchHooks() may be called multiple times for the same
|
|
72
|
+
* // element and events, making it safe for multiple controllers to use it.
|
|
73
|
+
* setupDispatchHooks(host, 'click');
|
|
74
|
+
* host.addEventListener('click', event => {
|
|
75
|
+
* afterDispatch(event, () => {
|
|
76
|
+
* if (event.defaultPrevented) {
|
|
77
|
+
* return;
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* // ... perform logic
|
|
81
|
+
* });
|
|
82
|
+
* });
|
|
83
|
+
* }
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @param event The event to add a hook to.
|
|
88
|
+
* @param callback A hook that is called after the event finishes dispatching.
|
|
89
|
+
*/
|
|
90
|
+
function afterDispatch(event, callback) {
|
|
91
|
+
const hooks = event[dispatchHooks];
|
|
92
|
+
if (!hooks) {
|
|
93
|
+
throw new Error(`'${event.type}' event needs setupDispatchHooks().`);
|
|
94
|
+
}
|
|
95
|
+
hooks.addEventListener('after', callback);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A lookup map of elements and event types that have a dispatch hook listener
|
|
99
|
+
* set up. Used to ensure we don't set up multiple hook listeners on the same
|
|
100
|
+
* element for the same event.
|
|
101
|
+
*/
|
|
102
|
+
const ELEMENT_DISPATCH_HOOK_TYPES = new WeakMap();
|
|
103
|
+
/**
|
|
104
|
+
* Sets up an element to add dispatch hooks to given event types. This must be
|
|
105
|
+
* called before adding any event listeners that need to use dispatch hooks
|
|
106
|
+
* like `afterDispatch()`.
|
|
107
|
+
*
|
|
108
|
+
* This function is safe to call multiple times with the same element or event
|
|
109
|
+
* types. Call it in the constructor of elements, mixins, and controllers to
|
|
110
|
+
* ensure it is set up before external listeners.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* class MyControl extends LitElement {
|
|
115
|
+
* constructor() {
|
|
116
|
+
* super();
|
|
117
|
+
* setupDispatchHooks(this, 'click');
|
|
118
|
+
* this.addEventListener('click', this.listenerUsingAfterDispatch);
|
|
119
|
+
* }
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @param element The element to set up event dispatch hooks for.
|
|
124
|
+
* @param eventTypes The event types to add dispatch hooks to.
|
|
125
|
+
*/
|
|
126
|
+
function setupDispatchHooks(element, ...eventTypes) {
|
|
127
|
+
let typesAlreadySetUp = ELEMENT_DISPATCH_HOOK_TYPES.get(element);
|
|
128
|
+
if (!typesAlreadySetUp) {
|
|
129
|
+
typesAlreadySetUp = new Set();
|
|
130
|
+
ELEMENT_DISPATCH_HOOK_TYPES.set(element, typesAlreadySetUp);
|
|
131
|
+
}
|
|
132
|
+
for (const eventType of eventTypes) {
|
|
133
|
+
// Don't register multiple dispatch hook listeners. A second registration
|
|
134
|
+
// would lead to the second listener re-dispatching a re-dispatched event,
|
|
135
|
+
// which can cause an infinite loop inside the other one.
|
|
136
|
+
if (typesAlreadySetUp.has(eventType)) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
// When we re-dispatch the event, it's going to immediately trigger this
|
|
140
|
+
// listener again. Use a flag to ignore it.
|
|
141
|
+
let isRedispatching = false;
|
|
142
|
+
element.addEventListener(eventType, event => {
|
|
143
|
+
if (isRedispatching) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
// Do not let the event propagate to any other listener (not just
|
|
147
|
+
// bubbling listeners with `stopPropagation()`).
|
|
148
|
+
event.stopImmediatePropagation();
|
|
149
|
+
// Make a copy.
|
|
150
|
+
const eventCopy = Reflect.construct(event.constructor, [event.type, event]);
|
|
151
|
+
// Add hooks onto the event.
|
|
152
|
+
const hooks = new EventTarget();
|
|
153
|
+
eventCopy[dispatchHooks] = hooks;
|
|
154
|
+
// Re-dispatch the event. We can't reuse `redispatchEvent()` since we
|
|
155
|
+
// need to add the hooks to the copy before it's dispatched.
|
|
156
|
+
isRedispatching = true;
|
|
157
|
+
const dispatched = element.dispatchEvent(eventCopy);
|
|
158
|
+
isRedispatching = false;
|
|
159
|
+
if (!dispatched) {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
}
|
|
162
|
+
// Synchronously call afterDispatch() hooks.
|
|
163
|
+
hooks.dispatchEvent(new Event('after'));
|
|
164
|
+
}, {
|
|
165
|
+
// Ensure this listener runs before other listeners.
|
|
166
|
+
// `setupDispatchHooks()` should be called in constructors to also
|
|
167
|
+
// ensure they run before any other externally-added capture listeners.
|
|
168
|
+
capture: true
|
|
169
|
+
});
|
|
170
|
+
typesAlreadySetUp.add(eventType);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @license
|
|
176
|
+
* Copyright 2021 Google LLC
|
|
177
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
178
|
+
*/
|
|
179
|
+
// Separate variable needed for closure.
|
|
180
|
+
const switchBaseClass = mixinDelegatesAria(mixinConstraintValidation(mixinFormAssociated(mixinElementInternals(i))));
|
|
181
|
+
/**
|
|
182
|
+
* @fires input {InputEvent} Fired whenever `selected` changes due to user
|
|
183
|
+
* interaction (bubbles and composed).
|
|
184
|
+
* @fires change {Event} Fired whenever `selected` changes due to user
|
|
185
|
+
* interaction (bubbles).
|
|
186
|
+
*/
|
|
187
|
+
class Switch extends switchBaseClass {
|
|
188
|
+
constructor() {
|
|
189
|
+
super();
|
|
190
|
+
/**
|
|
191
|
+
* Puts the switch in the selected state and sets the form submission value to
|
|
192
|
+
* the `value` property.
|
|
193
|
+
*/
|
|
194
|
+
this.selected = false;
|
|
195
|
+
/**
|
|
196
|
+
* Shows both the selected and deselected icons.
|
|
197
|
+
*/
|
|
198
|
+
this.icons = false;
|
|
199
|
+
/**
|
|
200
|
+
* Shows only the selected icon, and not the deselected icon. If `true`,
|
|
201
|
+
* overrides the behavior of the `icons` property.
|
|
202
|
+
*/
|
|
203
|
+
this.showOnlySelectedIcon = false;
|
|
204
|
+
/**
|
|
205
|
+
* When true, require the switch to be selected when participating in
|
|
206
|
+
* form submission.
|
|
207
|
+
*
|
|
208
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation
|
|
209
|
+
*/
|
|
210
|
+
this.required = false;
|
|
211
|
+
/**
|
|
212
|
+
* The value associated with this switch on form submission. `null` is
|
|
213
|
+
* submitted when `selected` is `false`.
|
|
214
|
+
*/
|
|
215
|
+
this.value = 'on';
|
|
216
|
+
// This click listener does not currently need dispatch hooks since it does
|
|
217
|
+
// not check `event.defaultPrevented`.
|
|
218
|
+
this.addEventListener('click', event => {
|
|
219
|
+
if (!isActivationClick(event) || !this.input) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
this.focus();
|
|
223
|
+
dispatchActivationClick(this.input);
|
|
224
|
+
});
|
|
225
|
+
// Add the aria keyboard interaction pattern for switch and the Enter key.
|
|
226
|
+
// See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.
|
|
227
|
+
setupDispatchHooks(this, 'keydown');
|
|
228
|
+
this.addEventListener('keydown', event => {
|
|
229
|
+
afterDispatch(event, () => {
|
|
230
|
+
const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';
|
|
231
|
+
if (ignoreEvent || this.disabled || !this.input) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
this.input.click();
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
render() {
|
|
239
|
+
return b`
|
|
240
|
+
<div class="switch ${e$2(this.getRenderClasses())}">
|
|
241
|
+
<input
|
|
242
|
+
id="switch"
|
|
243
|
+
class="touch"
|
|
244
|
+
type="checkbox"
|
|
245
|
+
role="switch"
|
|
246
|
+
aria-label=${this.ariaLabel || A}
|
|
247
|
+
?checked=${this.selected}
|
|
248
|
+
?disabled=${this.disabled}
|
|
249
|
+
?required=${this.required}
|
|
250
|
+
@input=${this.handleInput}
|
|
251
|
+
@change=${this.handleChange} />
|
|
252
|
+
|
|
253
|
+
<md-focus-ring part="focus-ring" for="switch"></md-focus-ring>
|
|
254
|
+
<span class="track"> ${this.renderHandle()} </span>
|
|
255
|
+
</div>
|
|
256
|
+
`;
|
|
257
|
+
}
|
|
258
|
+
getRenderClasses() {
|
|
259
|
+
return {
|
|
260
|
+
'selected': this.selected,
|
|
261
|
+
'unselected': !this.selected,
|
|
262
|
+
'disabled': this.disabled
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
renderHandle() {
|
|
266
|
+
const classes = {
|
|
267
|
+
'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons
|
|
268
|
+
};
|
|
269
|
+
return b`
|
|
270
|
+
${this.renderTouchTarget()}
|
|
271
|
+
<span class="handle-container">
|
|
272
|
+
<md-ripple for="switch" ?disabled="${this.disabled}"></md-ripple>
|
|
273
|
+
<span class="handle ${e$2(classes)}">
|
|
274
|
+
${this.shouldShowIcons() ? this.renderIcons() : b``}
|
|
275
|
+
</span>
|
|
276
|
+
</span>
|
|
277
|
+
`;
|
|
278
|
+
}
|
|
279
|
+
renderIcons() {
|
|
280
|
+
return b`
|
|
281
|
+
<div class="icons">
|
|
282
|
+
${this.renderOnIcon()}
|
|
283
|
+
${this.showOnlySelectedIcon ? b`` : this.renderOffIcon()}
|
|
284
|
+
</div>
|
|
285
|
+
`;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024
|
|
289
|
+
*/
|
|
290
|
+
renderOnIcon() {
|
|
291
|
+
return b`
|
|
292
|
+
<slot class="icon icon--on" name="on-icon">
|
|
293
|
+
<svg viewBox="0 0 24 24">
|
|
294
|
+
<path
|
|
295
|
+
d="M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z" />
|
|
296
|
+
</svg>
|
|
297
|
+
</slot>
|
|
298
|
+
`;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024
|
|
302
|
+
*/
|
|
303
|
+
renderOffIcon() {
|
|
304
|
+
return b`
|
|
305
|
+
<slot class="icon icon--off" name="off-icon">
|
|
306
|
+
<svg viewBox="0 0 24 24">
|
|
307
|
+
<path
|
|
308
|
+
d="M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z" />
|
|
309
|
+
</svg>
|
|
310
|
+
</slot>
|
|
311
|
+
`;
|
|
312
|
+
}
|
|
313
|
+
renderTouchTarget() {
|
|
314
|
+
return b`<span class="touch"></span>`;
|
|
315
|
+
}
|
|
316
|
+
shouldShowIcons() {
|
|
317
|
+
return this.icons || this.showOnlySelectedIcon;
|
|
318
|
+
}
|
|
319
|
+
handleInput(event) {
|
|
320
|
+
const target = event.target;
|
|
321
|
+
this.selected = target.checked;
|
|
322
|
+
// <input> 'input' event bubbles and is composed, don't re-dispatch it.
|
|
323
|
+
}
|
|
324
|
+
handleChange(event) {
|
|
325
|
+
// <input> 'change' event is not composed, re-dispatch it.
|
|
326
|
+
redispatchEvent(this, event);
|
|
327
|
+
}
|
|
328
|
+
[getFormValue]() {
|
|
329
|
+
return this.selected ? this.value : null;
|
|
330
|
+
}
|
|
331
|
+
[getFormState]() {
|
|
332
|
+
return String(this.selected);
|
|
333
|
+
}
|
|
334
|
+
formResetCallback() {
|
|
335
|
+
// The selected property does not reflect, so the original attribute set by
|
|
336
|
+
// the user is used to determine the default value.
|
|
337
|
+
this.selected = this.hasAttribute('selected');
|
|
338
|
+
}
|
|
339
|
+
formStateRestoreCallback(state) {
|
|
340
|
+
this.selected = state === 'true';
|
|
341
|
+
}
|
|
342
|
+
[createValidator]() {
|
|
343
|
+
return new CheckboxValidator(() => ({
|
|
344
|
+
checked: this.selected,
|
|
345
|
+
required: this.required
|
|
346
|
+
}));
|
|
347
|
+
}
|
|
348
|
+
[getValidityAnchor]() {
|
|
349
|
+
return this.input;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
/** @nocollapse */
|
|
353
|
+
Switch.shadowRootOptions = {
|
|
354
|
+
mode: 'open',
|
|
355
|
+
delegatesFocus: true
|
|
356
|
+
};
|
|
357
|
+
__decorate([n$1({
|
|
358
|
+
type: Boolean
|
|
359
|
+
})], Switch.prototype, "selected", void 0);
|
|
360
|
+
__decorate([n$1({
|
|
361
|
+
type: Boolean
|
|
362
|
+
})], Switch.prototype, "icons", void 0);
|
|
363
|
+
__decorate([n$1({
|
|
364
|
+
type: Boolean,
|
|
365
|
+
attribute: 'show-only-selected-icon'
|
|
366
|
+
})], Switch.prototype, "showOnlySelectedIcon", void 0);
|
|
367
|
+
__decorate([n$1({
|
|
368
|
+
type: Boolean
|
|
369
|
+
})], Switch.prototype, "required", void 0);
|
|
370
|
+
__decorate([n$1()], Switch.prototype, "value", void 0);
|
|
371
|
+
__decorate([e$1('input')], Switch.prototype, "input", void 0);
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @license
|
|
375
|
+
* Copyright 2024 Google LLC
|
|
376
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
377
|
+
*/
|
|
378
|
+
// Generated stylesheet for ./switch/internal/switch-styles.css.
|
|
379
|
+
const styles$4 = i$1`@layer styles, hcm;@layer styles{:host{display:inline-flex;outline:none;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-switch-track-height, 32px))/2) 0px}md-focus-ring{--md-focus-ring-shape-start-start: var(--md-switch-track-shape-start-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-start-end: var(--md-switch-track-shape-start-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-end-end: var(--md-switch-track-shape-end-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-end-start: var(--md-switch-track-shape-end-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)))}.switch{align-items:center;display:inline-flex;flex-shrink:0;position:relative;width:var(--md-switch-track-width, 52px);height:var(--md-switch-track-height, 32px);border-start-start-radius:var(--md-switch-track-shape-start-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--md-switch-track-shape-start-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--md-switch-track-shape-end-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--md-switch-track-shape-end-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)))}input{appearance:none;height:max(100%,var(--md-switch-touch-target-size, 48px));outline:none;margin:0;position:absolute;width:max(100%,var(--md-switch-touch-target-size, 48px));z-index:1;cursor:inherit;top:50%;left:50%;transform:translate(-50%, -50%)}:host([touch-target=none]) input{display:none}}@layer styles{.track{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:inherit;display:flex;justify-content:center;align-items:center}.track::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;transition-property:opacity,background-color;transition-timing-function:linear;transition-duration:67ms}.disabled .track{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.disabled .track::before,.disabled .track::after{transition:none;opacity:var(--md-switch-disabled-track-opacity, 0.12)}.disabled .track::before{background-clip:content-box}.selected .track::before{background-color:var(--md-switch-selected-track-color, var(--md-sys-color-primary, #6750a4))}.selected:hover .track::before{background-color:var(--md-switch-selected-hover-track-color, var(--md-sys-color-primary, #6750a4))}.selected:focus-within .track::before{background-color:var(--md-switch-selected-focus-track-color, var(--md-sys-color-primary, #6750a4))}.selected:active .track::before{background-color:var(--md-switch-selected-pressed-track-color, var(--md-sys-color-primary, #6750a4))}.selected.disabled .track{background-clip:border-box}.selected.disabled .track::before{background-color:var(--md-switch-disabled-selected-track-color, var(--md-sys-color-on-surface, #1d1b20))}.unselected .track::before{background-color:var(--md-switch-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-track-outline-color, var(--md-sys-color-outline, #79747e));border-style:solid;border-width:var(--md-switch-track-outline-width, 2px)}.unselected:hover .track::before{background-color:var(--md-switch-hover-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-hover-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected:focus-visible .track::before{background-color:var(--md-switch-focus-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-focus-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected:active .track::before{background-color:var(--md-switch-pressed-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-pressed-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected.disabled .track::before{background-color:var(--md-switch-disabled-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-disabled-track-outline-color, var(--md-sys-color-on-surface, #1d1b20))}}@layer hcm{@media(forced-colors: active){.selected .track::before{background:ButtonText;border-color:ButtonText}.disabled .track::before{border-color:GrayText;opacity:1}.disabled.selected .track::before{background:GrayText}}}@layer styles{.handle-container{display:flex;place-content:center;place-items:center;position:relative;transition:margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.selected .handle-container{margin-inline-start:calc(var(--md-switch-track-width, 52px) - var(--md-switch-track-height, 32px))}.unselected .handle-container{margin-inline-end:calc(var(--md-switch-track-width, 52px) - var(--md-switch-track-height, 32px))}.disabled .handle-container{transition:none}.handle{border-start-start-radius:var(--md-switch-handle-shape-start-start, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--md-switch-handle-shape-start-end, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--md-switch-handle-shape-end-end, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--md-switch-handle-shape-end-start, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));height:var(--md-switch-handle-height, 16px);width:var(--md-switch-handle-width, 16px);transform-origin:center;transition-property:height,width;transition-duration:250ms,250ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1),cubic-bezier(0.2, 0, 0, 1);z-index:0}.handle::before{content:"";display:flex;inset:0;position:absolute;border-radius:inherit;box-sizing:border-box;transition:background-color 67ms linear}.disabled .handle,.disabled .handle::before{transition:none}.selected .handle{height:var(--md-switch-selected-handle-height, 24px);width:var(--md-switch-selected-handle-width, 24px)}.handle.with-icon{height:var(--md-switch-with-icon-handle-height, 24px);width:var(--md-switch-with-icon-handle-width, 24px)}.selected:not(.disabled):active .handle,.unselected:not(.disabled):active .handle{height:var(--md-switch-pressed-handle-height, 28px);width:var(--md-switch-pressed-handle-width, 28px);transition-timing-function:linear;transition-duration:100ms}.selected .handle::before{background-color:var(--md-switch-selected-handle-color, var(--md-sys-color-on-primary, #fff))}.selected:hover .handle::before{background-color:var(--md-switch-selected-hover-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected:focus-within .handle::before{background-color:var(--md-switch-selected-focus-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected:active .handle::before{background-color:var(--md-switch-selected-pressed-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected.disabled .handle::before{background-color:var(--md-switch-disabled-selected-handle-color, var(--md-sys-color-surface, #fef7ff));opacity:var(--md-switch-disabled-selected-handle-opacity, 1)}.unselected .handle::before{background-color:var(--md-switch-handle-color, var(--md-sys-color-outline, #79747e))}.unselected:hover .handle::before{background-color:var(--md-switch-hover-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected:focus-within .handle::before{background-color:var(--md-switch-focus-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected:active .handle::before{background-color:var(--md-switch-pressed-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected.disabled .handle::before{background-color:var(--md-switch-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-switch-disabled-handle-opacity, 0.38)}md-ripple{border-radius:var(--md-switch-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-switch-state-layer-size, 40px);inset:unset;width:var(--md-switch-state-layer-size, 40px)}.selected md-ripple{--md-ripple-hover-color: var(--md-switch-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-color: var(--md-switch-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-switch-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-opacity: var(--md-switch-selected-pressed-state-layer-opacity, 0.12)}.unselected md-ripple{--md-ripple-hover-color: var(--md-switch-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-color: var(--md-switch-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-switch-hover-state-layer-opacity, 0.08);--md-ripple-pressed-opacity: var(--md-switch-pressed-state-layer-opacity, 0.12)}}@layer hcm{@media(forced-colors: active){.unselected .handle::before{background:ButtonText}.disabled .handle::before{opacity:1}.disabled.unselected .handle::before{background:GrayText}}}@layer styles{.icons{position:relative;height:100%;width:100%}.icon{position:absolute;inset:0;margin:auto;display:flex;align-items:center;justify-content:center;fill:currentColor;transition:fill 67ms linear,opacity 33ms linear,transform 167ms cubic-bezier(0.2, 0, 0, 1);opacity:0}.disabled .icon{transition:none}.selected .icon--on,.unselected .icon--off{opacity:1}.unselected .handle:not(.with-icon) .icon--on{transform:rotate(-45deg)}.icon--off{width:var(--md-switch-icon-size, 16px);height:var(--md-switch-icon-size, 16px);color:var(--md-switch-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:hover .icon--off{color:var(--md-switch-hover-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:focus-within .icon--off{color:var(--md-switch-focus-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:active .icon--off{color:var(--md-switch-pressed-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected.disabled .icon--off{color:var(--md-switch-disabled-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));opacity:var(--md-switch-disabled-icon-opacity, 0.38)}.icon--on{width:var(--md-switch-selected-icon-size, 16px);height:var(--md-switch-selected-icon-size, 16px);color:var(--md-switch-selected-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:hover .icon--on{color:var(--md-switch-selected-hover-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:focus-within .icon--on{color:var(--md-switch-selected-focus-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:active .icon--on{color:var(--md-switch-selected-pressed-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected.disabled .icon--on{color:var(--md-switch-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-switch-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon--off{fill:Canvas}.icon--on{fill:ButtonText}.disabled.unselected .icon--off,.disabled.selected .icon--on{opacity:1}.disabled .icon--on{fill:GrayText}}}
|
|
380
|
+
`;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* @license
|
|
384
|
+
* Copyright 2021 Google LLC
|
|
385
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
386
|
+
*/
|
|
387
|
+
/**
|
|
388
|
+
* @summary Switches toggle the state of a single item on or off.
|
|
389
|
+
*
|
|
390
|
+
* @description
|
|
391
|
+
* There's one type of switch in Material. Use this selection control when the
|
|
392
|
+
* user needs to toggle a single item on or off.
|
|
393
|
+
*
|
|
394
|
+
* @final
|
|
395
|
+
* @suppress {visibility}
|
|
396
|
+
*/
|
|
397
|
+
let MdSwitch = class MdSwitch extends Switch {};
|
|
398
|
+
MdSwitch.styles = [styles$4];
|
|
399
|
+
MdSwitch = __decorate([t('md-switch')], MdSwitch);
|
|
400
|
+
|
|
26
401
|
/**
|
|
27
402
|
* @license
|
|
28
403
|
* Copyright 2023 Google LLC
|
|
@@ -3071,12 +3446,12 @@ let MdSelectOption = class MdSelectOption extends SelectOptionEl {};
|
|
|
3071
3446
|
MdSelectOption.styles = [styles];
|
|
3072
3447
|
MdSelectOption = __decorate([t('md-select-option')], MdSelectOption);
|
|
3073
3448
|
|
|
3074
|
-
var __defProp = Object.defineProperty;
|
|
3075
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3076
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
3077
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
3449
|
+
var __defProp$1 = Object.defineProperty;
|
|
3450
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
3451
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
3452
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
3078
3453
|
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3079
|
-
if (kind && result) __defProp(target, key, result);
|
|
3454
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
3080
3455
|
return result;
|
|
3081
3456
|
};
|
|
3082
3457
|
const LOG_LEVELS = [{
|
|
@@ -3095,7 +3470,7 @@ const LOG_LEVELS = [{
|
|
|
3095
3470
|
value: "debug",
|
|
3096
3471
|
label: "Debug"
|
|
3097
3472
|
}];
|
|
3098
|
-
let
|
|
3473
|
+
let LogLevelSection = class extends i {
|
|
3099
3474
|
constructor() {
|
|
3100
3475
|
super(...arguments);
|
|
3101
3476
|
this._consoleLevel = "info";
|
|
@@ -3127,7 +3502,10 @@ let LogLevelDialog = class extends i {
|
|
|
3127
3502
|
const result = await this.client.setLogLevel(consoleLevel, this._fileLevel !== null ? fileLevel : void 0);
|
|
3128
3503
|
this._consoleLevel = result.console_loglevel;
|
|
3129
3504
|
this._fileLevel = result.file_loglevel;
|
|
3130
|
-
this.
|
|
3505
|
+
this.dispatchEvent(new CustomEvent("log-level-applied", {
|
|
3506
|
+
bubbles: true,
|
|
3507
|
+
composed: true
|
|
3508
|
+
}));
|
|
3131
3509
|
} catch (err) {
|
|
3132
3510
|
console.error("Failed to apply log levels:", err);
|
|
3133
3511
|
showAlertDialog({
|
|
@@ -3138,63 +3516,50 @@ let LogLevelDialog = class extends i {
|
|
|
3138
3516
|
this._applying = false;
|
|
3139
3517
|
}
|
|
3140
3518
|
}
|
|
3141
|
-
_close() {
|
|
3142
|
-
this.shadowRoot.querySelector("md-dialog").close();
|
|
3143
|
-
}
|
|
3144
|
-
_handleClosed() {
|
|
3145
|
-
this.parentNode.removeChild(this);
|
|
3146
|
-
}
|
|
3147
3519
|
render() {
|
|
3520
|
+
if (this._loading) {
|
|
3521
|
+
return b` <p class="loading">Loading...</p> `;
|
|
3522
|
+
}
|
|
3148
3523
|
return b`
|
|
3149
|
-
<
|
|
3150
|
-
|
|
3151
|
-
<
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
</div>
|
|
3181
|
-
` : A}
|
|
3182
|
-
`}
|
|
3183
|
-
</div>
|
|
3184
|
-
<div slot="actions">
|
|
3185
|
-
<md-text-button @click=${this._close}>Cancel</md-text-button>
|
|
3186
|
-
<md-text-button
|
|
3187
|
-
@click=${handleAsync(() => this._apply())}
|
|
3188
|
-
?disabled=${this._loading || this._applying}
|
|
3189
|
-
>
|
|
3190
|
-
${this._applying ? "Applying..." : "Apply"}
|
|
3191
|
-
</md-text-button>
|
|
3192
|
-
</div>
|
|
3193
|
-
</md-dialog>
|
|
3524
|
+
<p class="hint">Changes are temporary and will be reset on the next server restart.</p>
|
|
3525
|
+
<div class="form-field">
|
|
3526
|
+
<label>Console Log Level</label>
|
|
3527
|
+
<md-outlined-select name="console" .value=${this._consoleLevel}>
|
|
3528
|
+
${LOG_LEVELS.map(level => b`
|
|
3529
|
+
<md-select-option value=${level.value} ?selected=${level.value === this._consoleLevel}>
|
|
3530
|
+
<div slot="headline">${level.label}</div>
|
|
3531
|
+
</md-select-option>
|
|
3532
|
+
`)}
|
|
3533
|
+
</md-outlined-select>
|
|
3534
|
+
</div>
|
|
3535
|
+
${this._fileLevel !== null ? b`
|
|
3536
|
+
<div class="form-field">
|
|
3537
|
+
<label>File Log Level</label>
|
|
3538
|
+
<md-outlined-select name="file" .value=${this._fileLevel}>
|
|
3539
|
+
${LOG_LEVELS.map(level => b`
|
|
3540
|
+
<md-select-option
|
|
3541
|
+
value=${level.value}
|
|
3542
|
+
?selected=${level.value === this._fileLevel}
|
|
3543
|
+
>
|
|
3544
|
+
<div slot="headline">${level.label}</div>
|
|
3545
|
+
</md-select-option>
|
|
3546
|
+
`)}
|
|
3547
|
+
</md-outlined-select>
|
|
3548
|
+
</div>
|
|
3549
|
+
` : A}
|
|
3550
|
+
<div class="actions">
|
|
3551
|
+
<md-text-button @click=${handleAsync(() => this._apply())} ?disabled=${this._applying}>
|
|
3552
|
+
${this._applying ? "Applying..." : "Apply"}
|
|
3553
|
+
</md-text-button>
|
|
3554
|
+
</div>
|
|
3194
3555
|
`;
|
|
3195
3556
|
}
|
|
3196
3557
|
};
|
|
3197
|
-
|
|
3558
|
+
LogLevelSection.styles = i$1`
|
|
3559
|
+
:host {
|
|
3560
|
+
display: block;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3198
3563
|
.loading {
|
|
3199
3564
|
text-align: center;
|
|
3200
3565
|
padding: 24px;
|
|
@@ -3222,16 +3587,165 @@ LogLevelDialog.styles = i$1`
|
|
|
3222
3587
|
md-outlined-select {
|
|
3223
3588
|
width: 100%;
|
|
3224
3589
|
}
|
|
3590
|
+
|
|
3591
|
+
.actions {
|
|
3592
|
+
display: flex;
|
|
3593
|
+
justify-content: flex-end;
|
|
3594
|
+
margin-top: 8px;
|
|
3595
|
+
}
|
|
3596
|
+
`;
|
|
3597
|
+
__decorateClass$1([n$1({
|
|
3598
|
+
attribute: false
|
|
3599
|
+
})], LogLevelSection.prototype, "client", 2);
|
|
3600
|
+
__decorateClass$1([r()], LogLevelSection.prototype, "_consoleLevel", 2);
|
|
3601
|
+
__decorateClass$1([r()], LogLevelSection.prototype, "_fileLevel", 2);
|
|
3602
|
+
__decorateClass$1([r()], LogLevelSection.prototype, "_loading", 2);
|
|
3603
|
+
__decorateClass$1([r()], LogLevelSection.prototype, "_applying", 2);
|
|
3604
|
+
__decorateClass$1([e$1("md-outlined-select[name='console']")], LogLevelSection.prototype, "_consoleSelect", 2);
|
|
3605
|
+
__decorateClass$1([e$1("md-outlined-select[name='file']")], LogLevelSection.prototype, "_fileSelect", 2);
|
|
3606
|
+
LogLevelSection = __decorateClass$1([t("log-level-section")], LogLevelSection);
|
|
3607
|
+
|
|
3608
|
+
var __defProp = Object.defineProperty;
|
|
3609
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3610
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
3611
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
3612
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3613
|
+
if (kind && result) __defProp(target, key, result);
|
|
3614
|
+
return result;
|
|
3615
|
+
};
|
|
3616
|
+
let SettingsDialog = class extends i {
|
|
3617
|
+
constructor() {
|
|
3618
|
+
super(...arguments);
|
|
3619
|
+
this._devMode = DevModeService.active;
|
|
3620
|
+
}
|
|
3621
|
+
connectedCallback() {
|
|
3622
|
+
super.connectedCallback();
|
|
3623
|
+
this._unsubscribeDev = DevModeService.subscribe(active => {
|
|
3624
|
+
this._devMode = active;
|
|
3625
|
+
});
|
|
3626
|
+
}
|
|
3627
|
+
disconnectedCallback() {
|
|
3628
|
+
var _this$_unsubscribeDev;
|
|
3629
|
+
super.disconnectedCallback();
|
|
3630
|
+
(_this$_unsubscribeDev = this._unsubscribeDev) === null || _this$_unsubscribeDev === void 0 || _this$_unsubscribeDev.call(this);
|
|
3631
|
+
}
|
|
3632
|
+
_close() {
|
|
3633
|
+
this.shadowRoot.querySelector("md-dialog").close();
|
|
3634
|
+
}
|
|
3635
|
+
_handleClosed() {
|
|
3636
|
+
this.parentNode.removeChild(this);
|
|
3637
|
+
}
|
|
3638
|
+
_onDevToggle(event) {
|
|
3639
|
+
const target = event.target;
|
|
3640
|
+
DevModeService.setActive(target.selected);
|
|
3641
|
+
}
|
|
3642
|
+
_copyDevLink() {
|
|
3643
|
+
var _navigator$clipboard;
|
|
3644
|
+
const url = new URL(window.location.href);
|
|
3645
|
+
url.searchParams.set("dev", "on");
|
|
3646
|
+
(_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 || _navigator$clipboard.writeText(url.toString()).catch(() => {});
|
|
3647
|
+
}
|
|
3648
|
+
render() {
|
|
3649
|
+
return b`
|
|
3650
|
+
<md-dialog open @cancel=${preventDefault} @closed=${this._handleClosed}>
|
|
3651
|
+
<div slot="headline">Settings</div>
|
|
3652
|
+
<div slot="content">
|
|
3653
|
+
<section class="section">
|
|
3654
|
+
<h3 class="section-title">Developer mode</h3>
|
|
3655
|
+
<div class="toggle-row">
|
|
3656
|
+
<label for="dev-switch" class="toggle-label">
|
|
3657
|
+
Enable developer mode
|
|
3658
|
+
<span class="hint">
|
|
3659
|
+
Adds raw read/write buttons and a generic command invoker to cluster views.
|
|
3660
|
+
Activation is reflected in the URL (<code>?dev=on</code>) and does not persist.
|
|
3661
|
+
</span>
|
|
3662
|
+
</label>
|
|
3663
|
+
<md-switch
|
|
3664
|
+
id="dev-switch"
|
|
3665
|
+
?selected=${this._devMode}
|
|
3666
|
+
@change=${this._onDevToggle}
|
|
3667
|
+
></md-switch>
|
|
3668
|
+
</div>
|
|
3669
|
+
<div class="aux-row">
|
|
3670
|
+
<md-text-button @click=${this._copyDevLink}>Copy URL with dev enabled</md-text-button>
|
|
3671
|
+
</div>
|
|
3672
|
+
</section>
|
|
3673
|
+
|
|
3674
|
+
<md-divider></md-divider>
|
|
3675
|
+
|
|
3676
|
+
<section class="section">
|
|
3677
|
+
<h3 class="section-title">Server log levels</h3>
|
|
3678
|
+
<log-level-section .client=${this.client}></log-level-section>
|
|
3679
|
+
</section>
|
|
3680
|
+
</div>
|
|
3681
|
+
<div slot="actions">
|
|
3682
|
+
<md-text-button @click=${this._close}>Close</md-text-button>
|
|
3683
|
+
</div>
|
|
3684
|
+
</md-dialog>
|
|
3685
|
+
`;
|
|
3686
|
+
}
|
|
3687
|
+
};
|
|
3688
|
+
SettingsDialog.styles = i$1`
|
|
3689
|
+
md-dialog {
|
|
3690
|
+
min-width: 480px;
|
|
3691
|
+
max-width: 600px;
|
|
3692
|
+
}
|
|
3693
|
+
|
|
3694
|
+
.section {
|
|
3695
|
+
padding: 8px 0 16px 0;
|
|
3696
|
+
}
|
|
3697
|
+
|
|
3698
|
+
.section-title {
|
|
3699
|
+
margin: 0 0 12px 0;
|
|
3700
|
+
font-size: 0.95rem;
|
|
3701
|
+
font-weight: 500;
|
|
3702
|
+
color: var(--md-sys-color-on-surface);
|
|
3703
|
+
text-transform: uppercase;
|
|
3704
|
+
letter-spacing: 0.08em;
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3707
|
+
.toggle-row {
|
|
3708
|
+
display: flex;
|
|
3709
|
+
align-items: center;
|
|
3710
|
+
gap: 16px;
|
|
3711
|
+
justify-content: space-between;
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3714
|
+
.toggle-label {
|
|
3715
|
+
display: flex;
|
|
3716
|
+
flex-direction: column;
|
|
3717
|
+
gap: 4px;
|
|
3718
|
+
color: var(--md-sys-color-on-surface);
|
|
3719
|
+
font-size: 0.95rem;
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
.hint {
|
|
3723
|
+
font-size: 0.825rem;
|
|
3724
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
3725
|
+
font-weight: 400;
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
.hint code {
|
|
3729
|
+
font-family: var(--monospace-font);
|
|
3730
|
+
background: var(--md-sys-color-surface-container-high);
|
|
3731
|
+
padding: 0 4px;
|
|
3732
|
+
border-radius: 3px;
|
|
3733
|
+
}
|
|
3734
|
+
|
|
3735
|
+
.aux-row {
|
|
3736
|
+
margin-top: 8px;
|
|
3737
|
+
display: flex;
|
|
3738
|
+
justify-content: flex-end;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
md-divider {
|
|
3742
|
+
margin: 12px 0;
|
|
3743
|
+
}
|
|
3225
3744
|
`;
|
|
3226
3745
|
__decorateClass([n$1({
|
|
3227
3746
|
attribute: false
|
|
3228
|
-
})],
|
|
3229
|
-
__decorateClass([r()],
|
|
3230
|
-
__decorateClass([
|
|
3231
|
-
__decorateClass([r()], LogLevelDialog.prototype, "_loading", 2);
|
|
3232
|
-
__decorateClass([r()], LogLevelDialog.prototype, "_applying", 2);
|
|
3233
|
-
__decorateClass([e$1("md-outlined-select[name='console']")], LogLevelDialog.prototype, "_consoleSelect", 2);
|
|
3234
|
-
__decorateClass([e$1("md-outlined-select[name='file']")], LogLevelDialog.prototype, "_fileSelect", 2);
|
|
3235
|
-
LogLevelDialog = __decorateClass([t("log-level-dialog")], LogLevelDialog);
|
|
3747
|
+
})], SettingsDialog.prototype, "client", 2);
|
|
3748
|
+
__decorateClass([r()], SettingsDialog.prototype, "_devMode", 2);
|
|
3749
|
+
SettingsDialog = __decorateClass([t("settings-dialog")], SettingsDialog);
|
|
3236
3750
|
|
|
3237
|
-
export {
|
|
3751
|
+
export { SettingsDialog };
|