@blueharford/scrypted-spatial-awareness 0.4.0 → 0.4.2
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/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +20 -1
- package/out/main.nodejs.js.map +1 -1
- package/package.json +1 -1
- package/src/main.ts +27 -1
- package/src/ui/editor-html.ts +24 -2
- package/out/plugin.zip +0 -0
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/out/main.nodejs.js
CHANGED
|
@@ -37810,7 +37810,14 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
37810
37810
|
}
|
|
37811
37811
|
// ==================== Settings Implementation ====================
|
|
37812
37812
|
async getSettings() {
|
|
37813
|
-
const
|
|
37813
|
+
const baseSettings = await this.storageSettings.getSettings();
|
|
37814
|
+
// Build settings in desired order
|
|
37815
|
+
const settings = [];
|
|
37816
|
+
// Helper to find and add settings from baseSettings by group
|
|
37817
|
+
const addGroup = (group) => {
|
|
37818
|
+
baseSettings.filter(s => s.group === group).forEach(s => settings.push(s));
|
|
37819
|
+
};
|
|
37820
|
+
// ==================== 1. Getting Started ====================
|
|
37814
37821
|
// Training Mode button that opens mobile-friendly training UI in modal
|
|
37815
37822
|
const trainingOnclickCode = `(function(){var e=document.getElementById('sa-training-modal');if(e)e.remove();var m=document.createElement('div');m.id='sa-training-modal';m.style.cssText='position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.85);z-index:2147483647;display:flex;align-items:center;justify-content:center;';var c=document.createElement('div');c.style.cssText='width:min(420px,95vw);height:92vh;max-height:900px;background:#121212;border-radius:8px;overflow:hidden;position:relative;box-shadow:0 8px 32px rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.1);';var b=document.createElement('button');b.innerHTML='×';b.style.cssText='position:absolute;top:8px;right:8px;z-index:2147483647;background:rgba(255,255,255,0.1);color:white;border:none;width:32px;height:32px;border-radius:4px;font-size:18px;cursor:pointer;line-height:1;';b.onclick=function(){m.remove();};var f=document.createElement('iframe');f.src='/endpoint/@blueharford/scrypted-spatial-awareness/ui/training';f.style.cssText='width:100%;height:100%;border:none;';c.appendChild(b);c.appendChild(f);m.appendChild(c);m.onclick=function(ev){if(ev.target===m)m.remove();};document.body.appendChild(m);})()`;
|
|
37816
37823
|
settings.push({
|
|
@@ -37892,6 +37899,7 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
37892
37899
|
`,
|
|
37893
37900
|
group: 'Getting Started',
|
|
37894
37901
|
});
|
|
37902
|
+
// ==================== 2. Topology ====================
|
|
37895
37903
|
// Topology editor button that opens modal overlay (appended to body for proper z-index)
|
|
37896
37904
|
const onclickCode = `(function(){var e=document.getElementById('sa-topology-modal');if(e)e.remove();var m=document.createElement('div');m.id='sa-topology-modal';m.style.cssText='position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.85);z-index:2147483647;display:flex;align-items:center;justify-content:center;';var c=document.createElement('div');c.style.cssText='width:95vw;height:92vh;max-width:1800px;background:#121212;border-radius:8px;overflow:hidden;position:relative;box-shadow:0 8px 32px rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.1);';var b=document.createElement('button');b.innerHTML='×';b.style.cssText='position:absolute;top:8px;right:8px;z-index:2147483647;background:rgba(255,255,255,0.1);color:white;border:none;width:32px;height:32px;border-radius:4px;font-size:18px;cursor:pointer;line-height:1;';b.onclick=function(){m.remove();};var f=document.createElement('iframe');f.src='/endpoint/@blueharford/scrypted-spatial-awareness/ui/editor';f.style.cssText='width:100%;height:100%;border:none;';c.appendChild(b);c.appendChild(f);m.appendChild(c);m.onclick=function(ev){if(ev.target===m)m.remove();};document.body.appendChild(m);})()`;
|
|
37897
37905
|
settings.push({
|
|
@@ -37941,6 +37949,9 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
37941
37949
|
`,
|
|
37942
37950
|
group: 'Topology',
|
|
37943
37951
|
});
|
|
37952
|
+
// ==================== 3. Cameras ====================
|
|
37953
|
+
addGroup('Cameras');
|
|
37954
|
+
// ==================== 4. Status ====================
|
|
37944
37955
|
// Add status display
|
|
37945
37956
|
const activeCount = this.trackingState.getActiveCount();
|
|
37946
37957
|
const topologyJson = this.storage.getItem('topology');
|
|
@@ -37984,6 +37995,12 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
37984
37995
|
group: 'Status',
|
|
37985
37996
|
});
|
|
37986
37997
|
}
|
|
37998
|
+
// ==================== 5. Tracking ====================
|
|
37999
|
+
addGroup('Tracking');
|
|
38000
|
+
// ==================== 6. AI & Spatial Reasoning ====================
|
|
38001
|
+
addGroup('AI & Spatial Reasoning');
|
|
38002
|
+
// ==================== 7. Alerts ====================
|
|
38003
|
+
addGroup('Alerts');
|
|
37987
38004
|
// Add alert rules configuration UI
|
|
37988
38005
|
const alertRules = this.alertManager.getRules();
|
|
37989
38006
|
const rulesHtml = this.generateAlertRulesHtml(alertRules);
|
|
@@ -37994,6 +38011,8 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
37994
38011
|
value: rulesHtml,
|
|
37995
38012
|
group: 'Alerts',
|
|
37996
38013
|
});
|
|
38014
|
+
// ==================== 8. MQTT Integration ====================
|
|
38015
|
+
addGroup('MQTT Integration');
|
|
37997
38016
|
return settings;
|
|
37998
38017
|
}
|
|
37999
38018
|
generateAlertRulesHtml(rules) {
|