Compare commits
2 Commits
f18f3cc673
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef265dd811 | ||
|
|
19720bd67f |
@@ -1656,8 +1656,8 @@
|
|||||||
"pointRadius": 5,
|
"pointRadius": 5,
|
||||||
"showLegend": true,
|
"showLegend": true,
|
||||||
"bins": 10,
|
"bins": 10,
|
||||||
"width": "12",
|
"width": 12,
|
||||||
"height": "6",
|
"height": 6,
|
||||||
"removeOlder": "0",
|
"removeOlder": "0",
|
||||||
"removeOlderUnit": "1",
|
"removeOlderUnit": "1",
|
||||||
"removeOlderPoints": "",
|
"removeOlderPoints": "",
|
||||||
|
|||||||
@@ -23,12 +23,20 @@ function _gate(source, action, msg) {
|
|||||||
if (!source.isValidActionForMode(action, source.mode)) return false;
|
if (!source.isValidActionForMode(action, source.mode)) return false;
|
||||||
}
|
}
|
||||||
if (typeof source?.isValidSourceForMode === 'function') {
|
if (typeof source?.isValidSourceForMode === 'function') {
|
||||||
const src = (typeof msg?.source === 'string' && msg.source) ? msg.source : 'parent';
|
if (!source.isValidSourceForMode(_origin(msg), source.mode)) return false;
|
||||||
if (!source.isValidSourceForMode(src, source.mode)) return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resolve the command origin (control authority: parent | GUI | fysical).
|
||||||
|
// The shared commandRegistry stamps msg.origin (default 'parent'); legacy flows
|
||||||
|
// carried it as msg.source. Prefer the legacy field when present so existing
|
||||||
|
// flows keep working, otherwise use the registry-stamped msg.origin.
|
||||||
|
function _origin(msg) {
|
||||||
|
if (typeof msg?.source === 'string' && msg.source) return msg.source;
|
||||||
|
return (typeof msg?.origin === 'string' && msg.origin) ? msg.origin : 'parent';
|
||||||
|
}
|
||||||
|
|
||||||
exports.setMode = (source, msg) => {
|
exports.setMode = (source, msg) => {
|
||||||
// set.mode is a status-level operation — allowed in every mode by the
|
// set.mode is a status-level operation — allowed in every mode by the
|
||||||
// default schema (incl. maintenance). The gate still fires so an
|
// default schema (incl. maintenance). The gate still fires so an
|
||||||
|
|||||||
Reference in New Issue
Block a user