desky-agent 0.3.10 → 0.3.11
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/firmware/firmware.bin +0 -0
- package/firmware/manifest.json +3 -3
- package/package.json +1 -1
- package/src/board.js +2 -2
- package/src/link.js +2 -0
- package/ui/app.html +12 -3
package/firmware/firmware.bin
CHANGED
|
Binary file
|
package/firmware/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawd-desk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"chip": "esp32s3",
|
|
5
5
|
"board": "waveshare-esp32-s3-zero",
|
|
6
6
|
"flash_size": "4MB",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
{
|
|
27
27
|
"file": "firmware.bin",
|
|
28
28
|
"address": "0x10000",
|
|
29
|
-
"size":
|
|
30
|
-
"sha256": "
|
|
29
|
+
"size": 340496,
|
|
30
|
+
"sha256": "857d6f456af745b32e42e5df3bcd892c5e08083b8d8fa80bc49f169110b8a4fc"
|
|
31
31
|
}
|
|
32
32
|
]
|
|
33
33
|
}
|
package/package.json
CHANGED
package/src/board.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
const PKG_VERSION = require('../package.json').version;
|
|
6
6
|
const PROTO = 3; // the command set this package speaks
|
|
7
7
|
|
|
8
|
-
/** "clawd-desk 3 fw=0.2.0 chip=esp32s3 sn=
|
|
8
|
+
/** "clawd-desk 3 fw=0.2.0 chip=esp32s3 sn=DSK-0007 id=d83bda1a2b3c" -> { proto, fw, chip, sn, id }; null when the line is not Desky's.
|
|
9
9
|
* Protocol 2 boards say only "clawd-desk 2": fw, chip and sn come back null. Unknown fields are kept, order is free. */
|
|
10
10
|
function parseWho(line) {
|
|
11
11
|
const parts = String(line || '').trim().split(/\s+/);
|
|
12
12
|
if (parts[0] !== 'clawd-desk') return null;
|
|
13
13
|
const proto = Number.parseInt(parts[1], 10);
|
|
14
|
-
const info = { proto: Number.isFinite(proto) ? proto : null, fw: null, chip: null, sn: null };
|
|
14
|
+
const info = { proto: Number.isFinite(proto) ? proto : null, fw: null, chip: null, sn: null, id: null }; // id: firmware 0.3.11+
|
|
15
15
|
for (const p of parts.slice(2)) {
|
|
16
16
|
const eq = p.indexOf('=');
|
|
17
17
|
if (eq > 0) info[p.slice(0, eq)] = p.slice(eq + 1);
|
package/src/link.js
CHANGED
|
@@ -186,6 +186,8 @@ class Link {
|
|
|
186
186
|
parser.on('data', ln => {
|
|
187
187
|
ln = String(ln).trim();
|
|
188
188
|
if (ln) {
|
|
189
|
+
const who = parseWho(ln); // a later "who" (after "sn") updates the board's numbers
|
|
190
|
+
if (who && this.port === port) this.info = who;
|
|
189
191
|
try { this.onLine(ln); } catch (e) { /* the daemon's problem, not the port's */ }
|
|
190
192
|
}
|
|
191
193
|
});
|
package/ui/app.html
CHANGED
|
@@ -441,7 +441,7 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
|
|
|
441
441
|
</nav>
|
|
442
442
|
<button type="button" class="wizlink" id="openWiz"><svg viewBox="0 0 24 24"><path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/><path d="M19 16l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7z"/></svg>Майстер налаштування</button>
|
|
443
443
|
<div class="links">
|
|
444
|
-
<
|
|
444
|
+
<button type="button" class="lk btn" id="boardRow" title="плата Desky"><span class="dot" id="dC3"></span><span>Плата</span><span id="sC3">…</span></button>
|
|
445
445
|
<div class="lk" id="rowServo" hidden><span class="dot" id="dServo"></span><span>Серво</span><span id="health">—</span></div>
|
|
446
446
|
<button type="button" class="lk btn" id="verRow" title="версія програми Desky Agent" disabled><span class="dot on" id="dVer"></span><span>Версія</span><span id="sVer" class="mono">—</span></button>
|
|
447
447
|
</div>
|
|
@@ -657,7 +657,11 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
|
|
|
657
657
|
blue: { name: 'Блакитний', body: '#6FA3D8', eye: '#000000', a: ['#3B7BC2', '#2D66A8', '#FFFFFF'], d: ['#6FA7E0', '#8BBAEA', '#0D1824'] },
|
|
658
658
|
graphite: { name: 'Графіт', body: '#3D3B39', eye: '#F2EFEA', a: ['#3D3B39', '#2A2826', '#FFFFFF'], d: ['#BDB7AF', '#D3CDC5', '#1A1917'] },
|
|
659
659
|
};
|
|
660
|
-
let COLOR = 'orange', boardColor = null, boardFw = null, colorAsked = false;
|
|
660
|
+
let COLOR = 'orange', boardColor = null, boardFw = null, colorAsked = false, boardText = '';
|
|
661
|
+
$('boardRow').onclick = async () => {
|
|
662
|
+
if (!boardText) return;
|
|
663
|
+
try { await navigator.clipboard.writeText(boardText); toast('Скопійовано: ' + boardText); } catch (e) {}
|
|
664
|
+
};
|
|
661
665
|
const canColor = () => { const v = String(boardFw || '').split('.').map(Number); return v.length === 3 && (v[0] > 0 || v[1] > 2 || (v[1] === 2 && v[2] >= 4)); };
|
|
662
666
|
let CFG = null;
|
|
663
667
|
|
|
@@ -794,7 +798,12 @@ svg.alive .eye { transform-box: fill-box; transform-origin: center; animation: b
|
|
|
794
798
|
boardFw = connected && st.board ? st.board.fw : null;
|
|
795
799
|
if (connected && canColor() && !colorAsked) { colorAsked = true; send('color', true); }
|
|
796
800
|
$('dC3').className = 'dot ' + (connected ? 'on' : 'bad');
|
|
797
|
-
|
|
801
|
+
const bd = connected && st.board ? st.board : {};
|
|
802
|
+
$('sC3').textContent = connected ? (bd.sn || st.port) : 'немає';
|
|
803
|
+
boardText = connected ? ['Desky ' + (bd.sn || 'без серійного номера'), bd.id && 'ID ' + bd.id, bd.fw && 'прошивка ' + bd.fw, st.port]
|
|
804
|
+
.filter(Boolean).join(' · ') : '';
|
|
805
|
+
$('boardRow').title = connected ? boardText + '\nнатисни, щоб скопіювати (для підтримки)' : 'плату не під\'єднано';
|
|
806
|
+
$('boardRow').disabled = !connected;
|
|
798
807
|
$('nocbox').hidden = connected;
|
|
799
808
|
$('rowServo').hidden = !connected;
|
|
800
809
|
beat = connected && st.heartbeat && st.heartbeat_age < 8 ? st.heartbeat : null;
|