sensivity 2.5.49 → 2.5.51
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/package.json +20 -20
- package/public/js/app.js +1 -84
- package/public/js/config_schema.js +0 -28
- package/sens.node +0 -0
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "sensivity",
|
|
3
|
+
"version": "2.5.51",
|
|
4
|
+
"description": "Sensivity Control Panel",
|
|
5
|
+
"main": "launcher.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"sensivity": "launcher.js",
|
|
8
|
+
"sens": "launcher.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node launcher.js",
|
|
12
|
+
"build": "npm --prefix .. run build:customer"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"express": "^4.21.0",
|
|
16
|
+
"socket.io": "^4.7.0",
|
|
17
|
+
"qrcode": "^1.5.0",
|
|
18
|
+
"qrcode-terminal": "^0.12.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/public/js/app.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
const SOCKET = (typeof io !== 'undefined') ? io() : null;
|
|
2
2
|
let state = {}, currentSection = 0, currentSub = 0;
|
|
3
3
|
let licenseAccepted = false, cheatRunning = false, listeningKeybind = null;
|
|
4
|
-
let resourceList = [];
|
|
5
|
-
let eventLogs = JSON.parse(localStorage.getItem('sensEventLogs') || '[]');
|
|
6
|
-
let eventLogEnabled = false;
|
|
7
4
|
let espSyncTimer = null;
|
|
8
5
|
let startWatchTimer = null, startPending = false;
|
|
9
6
|
|
|
@@ -12,7 +9,7 @@ const SECTION_GROUPS = [
|
|
|
12
9
|
{ label: 'TOOLS', ids: ['misc'] },
|
|
13
10
|
{ label: 'VISUALS', ids: ['visuals'] },
|
|
14
11
|
{ label: 'PLAYERS', ids: ['playerlist', 'vehiclelist'] },
|
|
15
|
-
{ label: 'WORLD', ids: ['world', 'settings'
|
|
12
|
+
{ label: 'WORLD', ids: ['world', 'settings'] }
|
|
16
13
|
];
|
|
17
14
|
|
|
18
15
|
function svgIcon(id, size) {
|
|
@@ -99,12 +96,6 @@ function renderChild(ch) {
|
|
|
99
96
|
const right = controls.slice(3);
|
|
100
97
|
return `<div class="child split-child world-teleport-card"><h3>${ch.label}</h3><div class="split-controls"><div class="split-left">${left.map(ctrl).join('')}</div><div class="split-right">${right.map(ctrl).join('')}</div></div></div>`;
|
|
101
98
|
}
|
|
102
|
-
if (ch.id === 'resCtl') {
|
|
103
|
-
return `<div class="child"><h3>${ch.label}</h3>${controls.map(ctrl).join('')}<div id="resource-list" class="res-list">${renderResources()}</div></div>`;
|
|
104
|
-
}
|
|
105
|
-
if (ch.id === 'evtControls') {
|
|
106
|
-
return `<div class="child"><h3>${ch.label}</h3>${controls.map(ctrl).join('')}<div id="event-log-container" class="evt-log">${renderEventLogs()}</div></div>`;
|
|
107
|
-
}
|
|
108
99
|
return `<div class="child"><h3>${ch.label}</h3>${controls.map(ctrl).join('')}</div>`;
|
|
109
100
|
}
|
|
110
101
|
|
|
@@ -142,7 +133,6 @@ function set(k, t, v) {
|
|
|
142
133
|
state[k] = state[k] || { value: false, color: [1, 1, 1, 1] };
|
|
143
134
|
if (typeof v === 'object') state[k] = v;
|
|
144
135
|
} else state[k] = v;
|
|
145
|
-
if (k === 'Event Logger Enable') eventLogEnabled = !!v;
|
|
146
136
|
if (shouldAutoEnablePlayerEsp(k, t, state[k])) {
|
|
147
137
|
state['Enable ESP'] = true;
|
|
148
138
|
emit('Enable ESP', 'checkbox', true);
|
|
@@ -181,14 +171,6 @@ function runAction(action) {
|
|
|
181
171
|
showPanelDebug('Panel connection unavailable');
|
|
182
172
|
return;
|
|
183
173
|
}
|
|
184
|
-
if (action === 'refreshResources') { refreshResources(); return; }
|
|
185
|
-
if (action === 'eventClearLogs') { clearLogs(); return; }
|
|
186
|
-
if (action === 'eventExportLogs') { exportLogs(); return; }
|
|
187
|
-
if (action === 'resourceStartAll' || action === 'resourceStopAll') {
|
|
188
|
-
SOCKET.emit('performAction', { action });
|
|
189
|
-
setTimeout(() => refreshResources(), 2000);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
174
|
SOCKET.emit('performAction', { action });
|
|
193
175
|
}
|
|
194
176
|
|
|
@@ -510,8 +492,6 @@ if (SOCKET) {
|
|
|
510
492
|
if (startPending) showPanelDebug('Panel connection failed during start');
|
|
511
493
|
});
|
|
512
494
|
SOCKET.on('killed', () => { document.body.innerHTML = '<div style="display:flex;align-items:center;justify-content:center;height:100vh;color:var(--danger);font-size:18px;font-family:var(--font)">Sensivity Terminated</div>'; });
|
|
513
|
-
SOCKET.on('resourceList', (r) => { resourceList = r || []; rerender(); });
|
|
514
|
-
SOCKET.on('eventLog', (e) => { if (eventLogEnabled) { addEventLog(e.event, e.args); rerender(); } });
|
|
515
495
|
SOCKET.on('ytTrigger', (d) => {
|
|
516
496
|
const el = document.getElementById('qr-overlay');
|
|
517
497
|
if (d.active) {
|
|
@@ -553,68 +533,5 @@ function drawQR(url) {
|
|
|
553
533
|
}
|
|
554
534
|
}
|
|
555
535
|
|
|
556
|
-
// ===== RESOURCES =====
|
|
557
|
-
function renderResources() {
|
|
558
|
-
if (!resourceList.length) return '<div class="res-empty">No resources loaded. Press Refresh.</div>';
|
|
559
|
-
return resourceList.map(r => {
|
|
560
|
-
const status = r.running ? 'running' : 'stopped';
|
|
561
|
-
return `<div class="res-item ${status}">
|
|
562
|
-
<span class="res-name" title="${r.name||''}">${r.name||'Unknown'}</span>
|
|
563
|
-
<span class="res-status">${r.running ? 'RUNNING' : 'STOPPED'}</span>
|
|
564
|
-
<button class="key-btn" onclick="resourceAction('start','${r.name}')">Start</button>
|
|
565
|
-
<button class="key-btn res-btn-stop" onclick="resourceAction('stop','${r.name}')">Stop</button>
|
|
566
|
-
</div>`;
|
|
567
|
-
}).join('');
|
|
568
|
-
}
|
|
569
|
-
function resourceAction(type, name) {
|
|
570
|
-
if (!SOCKET || !SOCKET.connected) return;
|
|
571
|
-
SOCKET.emit('performAction', { action: 'resource' + type.charAt(0).toUpperCase() + type.slice(1), data: { name } });
|
|
572
|
-
setTimeout(() => refreshResources(), 1500);
|
|
573
|
-
}
|
|
574
|
-
function refreshResources() {
|
|
575
|
-
if (!SOCKET || !SOCKET.connected) return;
|
|
576
|
-
SOCKET.emit('performAction', { action: 'getResources' });
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// ===== EVENT LOGGER =====
|
|
580
|
-
function renderEventLogs() {
|
|
581
|
-
if (!eventLogs.length) return '<div class="res-empty">No events captured yet.</div>';
|
|
582
|
-
let html = '<div class="evt-header"><span>Time</span><span>Event</span><span>Args</span><span></span></div>';
|
|
583
|
-
eventLogs.slice(-100).reverse().forEach((e, i) => {
|
|
584
|
-
const idx = eventLogs.length - 1 - i;
|
|
585
|
-
html += `<div class="evt-row">
|
|
586
|
-
<span class="evt-time">${new Date(e.time).toLocaleTimeString()}</span>
|
|
587
|
-
<span class="evt-name" title="${e.event||''}">${e.event||'?'}</span>
|
|
588
|
-
<span class="evt-args">${JSON.stringify(e.args||[]).slice(0,40)}</span>
|
|
589
|
-
<span class="evt-actions"><button class="key-btn" onclick="sendEvent(${idx})">Send</button><button class="key-btn" onclick="editEvent(${idx})">Edit</button></span>
|
|
590
|
-
</div>`;
|
|
591
|
-
});
|
|
592
|
-
return html;
|
|
593
|
-
}
|
|
594
|
-
function sendEvent(idx) {
|
|
595
|
-
if (!SOCKET || !SOCKET.connected) return;
|
|
596
|
-
const evt = eventLogs[idx]; if (!evt) return;
|
|
597
|
-
SOCKET.emit('performAction', { action: 'triggerEvent', data: { event: evt.event, args: evt.args || [] } });
|
|
598
|
-
}
|
|
599
|
-
function editEvent(idx) {
|
|
600
|
-
const evt = eventLogs[idx]; if (!evt) return;
|
|
601
|
-
const nev = prompt('Event name:', evt.event); if (!nev) return;
|
|
602
|
-
let na = evt.args;
|
|
603
|
-
try { const a = prompt('Args (JSON):', JSON.stringify(evt.args||[])); if (a) na = JSON.parse(a); } catch(e) {}
|
|
604
|
-
evt.event = nev; evt.args = na || [];
|
|
605
|
-
localStorage.setItem('sensEventLogs', JSON.stringify(eventLogs)); rerender();
|
|
606
|
-
}
|
|
607
|
-
function clearLogs() { eventLogs = []; localStorage.setItem('sensEventLogs', '[]'); rerender(); }
|
|
608
|
-
function addEventLog(event, args) {
|
|
609
|
-
eventLogs.push({ time: Date.now(), event, args: args || [] });
|
|
610
|
-
if (eventLogs.length > 500) eventLogs = eventLogs.slice(-500);
|
|
611
|
-
localStorage.setItem('sensEventLogs', JSON.stringify(eventLogs));
|
|
612
|
-
}
|
|
613
|
-
function exportLogs() {
|
|
614
|
-
const b = new Blob([JSON.stringify(eventLogs,null,2)],{type:'application/json'});
|
|
615
|
-
const u = URL.createObjectURL(b); const a = document.createElement('a'); a.href = u;
|
|
616
|
-
a.download = 'events-'+Date.now()+'.json'; a.click(); URL.revokeObjectURL(u);
|
|
617
|
-
}
|
|
618
|
-
|
|
619
536
|
initState();
|
|
620
537
|
rerender();
|
|
@@ -362,34 +362,6 @@ const SCHEMA = {
|
|
|
362
362
|
{ key: 'Peek Assist Location Z', type: 'slider_float', def: 0, min: -1000, max: 1000, step: 1 },
|
|
363
363
|
]},
|
|
364
364
|
]
|
|
365
|
-
}, {
|
|
366
|
-
id: 'wresources',
|
|
367
|
-
icon: 'zap',
|
|
368
|
-
label: 'Resources',
|
|
369
|
-
children: [
|
|
370
|
-
{ id: 'resCtl', label: 'Controls', controls: [
|
|
371
|
-
{ key: 'Resource Search', type: 'text', def: '' },
|
|
372
|
-
{ key: 'Refresh Resources Action', type: 'action', label: 'Refresh List', action: 'refreshResources', button: 'Refresh' },
|
|
373
|
-
{ key: 'Start All Resources Action', type: 'action', label: 'Start All', action: 'resourceStartAll', button: 'Start All' },
|
|
374
|
-
{ key: 'Stop All Resources Action', type: 'action', label: 'Stop All', action: 'resourceStopAll', button: 'Stop All' },
|
|
375
|
-
]},
|
|
376
|
-
]
|
|
377
|
-
}]
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
id: 'eventlog',
|
|
381
|
-
icon: 'zap',
|
|
382
|
-
label: 'Events',
|
|
383
|
-
subs: [{
|
|
384
|
-
id: 'events',
|
|
385
|
-
label: 'Event Logger',
|
|
386
|
-
children: [
|
|
387
|
-
{ id: 'evtControls', label: 'Controls', controls: [
|
|
388
|
-
{ key: 'Event Logger Enable', type: 'checkbox', def: false, bind: true },
|
|
389
|
-
{ key: 'Clear Logs Action', type: 'action', label: 'Clear All Logs', action: 'eventClearLogs', button: 'Clear' },
|
|
390
|
-
{ key: 'Export Logs Action', type: 'action', label: 'Export Logs', action: 'eventExportLogs', button: 'Export' },
|
|
391
|
-
]},
|
|
392
|
-
]
|
|
393
365
|
}]
|
|
394
366
|
},
|
|
395
367
|
{
|
package/sens.node
CHANGED
|
Binary file
|