iobroker.eos-admin 7.9.38 → 7.9.39
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/adminWww/assets/index-D2ymscJA.js +1 -1
- package/adminWww/css/eos-branding.css +74 -0
- package/adminWww/index.html +5 -4
- package/adminWww/js/eos-branding.js +1 -1
- package/adminWww/js/eos-objects-state-tools.js +167 -0
- package/adminWww/js/eos-runtime-fixes.js +1 -1
- package/adminWww/js/eos-security-ui.js +1 -1
- package/io-package.json +911 -907
- package/package.json +143 -143
package/adminWww/index.html
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
rel="stylesheet"
|
|
32
32
|
href="css/leaflet.css"
|
|
33
33
|
/>
|
|
34
|
-
<link rel="stylesheet" href="./css/eos-branding.css?v=
|
|
34
|
+
<link rel="stylesheet" href="./css/eos-branding.css?v=39" />
|
|
35
35
|
<link
|
|
36
36
|
rel="manifest"
|
|
37
37
|
href="manifest.json"
|
|
@@ -154,9 +154,10 @@
|
|
|
154
154
|
<script type="module" crossorigin src="./assets/index-CQZugZ1z.js"></script>
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-BDBacUwf.js">
|
|
156
156
|
<link rel="modulepreload" crossorigin href="./assets/iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js">
|
|
157
|
-
<script defer src="./js/eos-branding.js?v=
|
|
158
|
-
<script defer src="./js/eos-security-ui.js?v=
|
|
159
|
-
<script defer src="./js/eos-assistant.js?v=
|
|
157
|
+
<script defer src="./js/eos-branding.js?v=39"></script>
|
|
158
|
+
<script defer src="./js/eos-security-ui.js?v=39"></script>
|
|
159
|
+
<script defer src="./js/eos-assistant.js?v=39"></script>
|
|
160
|
+
<script defer src="./js/eos-objects-state-tools.js?v=39"></script>
|
|
160
161
|
</head>
|
|
161
162
|
<body>
|
|
162
163
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
window.NEXOWATT_EOS_OBJECTS_STATE_TOOLS_VERSION = 'v39-object-state-tools';
|
|
5
|
+
|
|
6
|
+
const ACTIVE_CLASS = 'eos-objects-surface';
|
|
7
|
+
const safe = fn => { try { return fn(); } catch (e) { return undefined; } };
|
|
8
|
+
|
|
9
|
+
const isObjectsRoute = () => {
|
|
10
|
+
const hash = String(window.location.hash || '');
|
|
11
|
+
if (/#tab-objects/.test(hash)) return true;
|
|
12
|
+
const url = String(window.location.href || '');
|
|
13
|
+
if (/[?&]tab=objects/.test(url)) return true;
|
|
14
|
+
return false;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const setSurfaceState = () => {
|
|
18
|
+
const active = isObjectsRoute();
|
|
19
|
+
document.documentElement.classList.toggle(ACTIVE_CLASS, active);
|
|
20
|
+
document.body?.classList.toggle(ACTIVE_CLASS, active);
|
|
21
|
+
return active;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const interactiveSelector = [
|
|
25
|
+
'button',
|
|
26
|
+
'[role="button"]',
|
|
27
|
+
'a[href]',
|
|
28
|
+
'input',
|
|
29
|
+
'select',
|
|
30
|
+
'textarea',
|
|
31
|
+
'.MuiButton-root',
|
|
32
|
+
'.MuiIconButton-root',
|
|
33
|
+
'.MuiCheckbox-root',
|
|
34
|
+
'.MuiSwitch-root',
|
|
35
|
+
'.MuiSwitch-switchBase',
|
|
36
|
+
'.MuiMenuItem-root',
|
|
37
|
+
'.MuiAutocomplete-option',
|
|
38
|
+
'.MuiSelect-select',
|
|
39
|
+
'.admin-button',
|
|
40
|
+
'.copyButton'
|
|
41
|
+
].join(',');
|
|
42
|
+
|
|
43
|
+
const nativeLayerSelector = [
|
|
44
|
+
'.MuiDialog-root',
|
|
45
|
+
'.MuiModal-root',
|
|
46
|
+
'.MuiPopover-root',
|
|
47
|
+
'.MuiPopper-root',
|
|
48
|
+
'.MuiTooltip-popper',
|
|
49
|
+
'[role="dialog"]',
|
|
50
|
+
'[role="listbox"]',
|
|
51
|
+
'[role="menu"]',
|
|
52
|
+
'[role="tooltip"]'
|
|
53
|
+
].join(',');
|
|
54
|
+
|
|
55
|
+
const releaseNativeControls = root => safe(() => {
|
|
56
|
+
if (!setSurfaceState()) return;
|
|
57
|
+
const base = root && root.nodeType ? root : document;
|
|
58
|
+
const nodes = [];
|
|
59
|
+
if (base.nodeType === Node.ELEMENT_NODE && base.matches?.(interactiveSelector)) nodes.push(base);
|
|
60
|
+
nodes.push(...Array.from(base.querySelectorAll?.(interactiveSelector) || []));
|
|
61
|
+
nodes.forEach(el => {
|
|
62
|
+
if (!el || el.closest?.('#eos-assist-root,.eos-assist-root')) return;
|
|
63
|
+
el.classList?.remove('eos-security-hidden-delete', 'eos-protected-delete-control', 'eos-disabled-by-security');
|
|
64
|
+
el.removeAttribute?.('data-eos-security-blocked');
|
|
65
|
+
el.removeAttribute?.('aria-disabled');
|
|
66
|
+
el.style.pointerEvents = 'auto';
|
|
67
|
+
if (el.style.visibility === 'hidden') el.style.visibility = 'visible';
|
|
68
|
+
if (el.style.display === 'none' && !el.classList?.contains('eos-native-logout-hidden')) el.style.display = '';
|
|
69
|
+
});
|
|
70
|
+
const layers = [];
|
|
71
|
+
if (base.nodeType === Node.ELEMENT_NODE && base.matches?.(nativeLayerSelector)) layers.push(base);
|
|
72
|
+
layers.push(...Array.from(base.querySelectorAll?.(nativeLayerSelector) || []));
|
|
73
|
+
layers.forEach(el => {
|
|
74
|
+
if (!el) return;
|
|
75
|
+
el.style.pointerEvents = 'auto';
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const formatAge = ts => {
|
|
80
|
+
const n = Number(ts);
|
|
81
|
+
if (!Number.isFinite(n) || n <= 0) return 'unbekannt';
|
|
82
|
+
try { return new Date(n).toLocaleString(); } catch { return String(n); }
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const annotateValueCells = root => safe(() => {
|
|
86
|
+
if (!setSurfaceState()) return;
|
|
87
|
+
const base = root && root.nodeType ? root : document;
|
|
88
|
+
const cells = [];
|
|
89
|
+
if (base.nodeType === Node.ELEMENT_NODE && base.matches?.('.eos-object-value-cell')) cells.push(base);
|
|
90
|
+
cells.push(...Array.from(base.querySelectorAll?.('.eos-object-value-cell') || []));
|
|
91
|
+
cells.forEach(cell => {
|
|
92
|
+
const id = cell.getAttribute('data-eos-object-value-cell') || '';
|
|
93
|
+
const writable = cell.getAttribute('data-eos-object-writable') === '1';
|
|
94
|
+
const visibleValue = (cell.textContent || '').trim().replace(/\s+/g, ' ') || '(leer)';
|
|
95
|
+
cell.style.pointerEvents = 'auto';
|
|
96
|
+
cell.style.cursor = writable ? 'pointer' : 'default';
|
|
97
|
+
cell.classList.toggle('eos-object-value-writable', writable);
|
|
98
|
+
cell.classList.toggle('eos-object-value-readonly', !writable);
|
|
99
|
+
cell.setAttribute('data-eos-current-visible-value', visibleValue);
|
|
100
|
+
const hint = writable
|
|
101
|
+
? 'Klicken: Wert schreiben / Button sofort testen'
|
|
102
|
+
: 'Nur lesbarer Wert';
|
|
103
|
+
cell.setAttribute('title', [
|
|
104
|
+
id ? `ID: ${id}` : null,
|
|
105
|
+
`Aktueller Wert: ${visibleValue}`,
|
|
106
|
+
`Status: ${writable ? 'beschreibbar' : 'nur lesbar'}`,
|
|
107
|
+
`Letzte Anzeige-Aktualisierung: ${formatAge(Date.now())}`,
|
|
108
|
+
hint,
|
|
109
|
+
'Zusätzliche Statusdetails zeigt der native EOS/ioBroker-Hover an.'
|
|
110
|
+
].filter(Boolean).join('\n'));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const handlePointerAssist = event => {
|
|
115
|
+
if (!setSurfaceState()) return;
|
|
116
|
+
const cell = event.target?.closest?.('.eos-object-value-cell');
|
|
117
|
+
if (!cell) return;
|
|
118
|
+
if (cell.getAttribute('data-eos-object-writable') === '1') {
|
|
119
|
+
cell.classList.add('eos-object-value-hover');
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const handlePointerLeave = event => {
|
|
123
|
+
const cell = event.target?.closest?.('.eos-object-value-cell');
|
|
124
|
+
cell?.classList.remove('eos-object-value-hover');
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const run = root => {
|
|
128
|
+
if (!setSurfaceState()) return;
|
|
129
|
+
releaseNativeControls(root);
|
|
130
|
+
annotateValueCells(root);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
window.addEventListener('hashchange', () => setTimeout(() => run(document), 30));
|
|
134
|
+
window.addEventListener('popstate', () => setTimeout(() => run(document), 30));
|
|
135
|
+
document.addEventListener('mouseover', handlePointerAssist, true);
|
|
136
|
+
document.addEventListener('mouseout', handlePointerLeave, true);
|
|
137
|
+
document.addEventListener('click', event => {
|
|
138
|
+
if (!setSurfaceState()) return;
|
|
139
|
+
const nativeInteractive = event.target?.closest?.(interactiveSelector + ',' + nativeLayerSelector + ',.eos-object-value-cell');
|
|
140
|
+
if (nativeInteractive) {
|
|
141
|
+
// Intentionally do not stop propagation. This keeps the native ObjectBrowser write dialog and button states working.
|
|
142
|
+
releaseNativeControls(nativeInteractive);
|
|
143
|
+
}
|
|
144
|
+
}, false);
|
|
145
|
+
|
|
146
|
+
const observer = new MutationObserver(records => {
|
|
147
|
+
if (!setSurfaceState()) return;
|
|
148
|
+
let roots = [];
|
|
149
|
+
for (const rec of records) {
|
|
150
|
+
rec.addedNodes?.forEach(node => {
|
|
151
|
+
if (node.nodeType === Node.ELEMENT_NODE) roots.push(node);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (!roots.length) roots = [document];
|
|
155
|
+
window.requestAnimationFrame?.(() => roots.forEach(run)) || roots.forEach(run);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const start = () => {
|
|
159
|
+
setSurfaceState();
|
|
160
|
+
run(document);
|
|
161
|
+
observer.observe(document.documentElement, { childList: true, subtree: true });
|
|
162
|
+
window.setInterval(() => run(document), 2500);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });
|
|
166
|
+
else start();
|
|
167
|
+
})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
window.NEXOWATT_EOS_RUNTIME_FIXES_VERSION = '
|
|
4
|
+
window.NEXOWATT_EOS_RUNTIME_FIXES_VERSION = 'v39-object-state-tools';
|
|
5
5
|
|
|
6
6
|
const MOJIBAKE_MAP = new Map(Object.entries({
|
|
7
7
|
'dürfen': 'dürfen', 'Dürfen': 'Dürfen',
|