lobsterboard 0.1.2 → 0.1.3
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/README.md +2 -0
- package/dist/lobsterboard.css +1 -1
- package/dist/lobsterboard.esm.js +1 -1
- package/dist/lobsterboard.esm.min.js +1 -1
- package/dist/lobsterboard.umd.js +1 -1
- package/dist/lobsterboard.umd.min.js +1 -1
- package/js/builder.js +1 -1
- package/js/widgets.js +11 -8
- package/package.json +1 -1
- package/server.cjs +2 -1
package/README.md
CHANGED
package/dist/lobsterboard.css
CHANGED
package/dist/lobsterboard.esm.js
CHANGED
package/dist/lobsterboard.umd.js
CHANGED
package/js/builder.js
CHANGED
|
@@ -433,7 +433,7 @@ function createWidget(type, x, y) {
|
|
|
433
433
|
y: Math.max(0, Math.round(y - template.defaultHeight / 2)),
|
|
434
434
|
width: template.defaultWidth,
|
|
435
435
|
height: template.defaultHeight,
|
|
436
|
-
properties:
|
|
436
|
+
properties: JSON.parse(JSON.stringify(template.properties))
|
|
437
437
|
};
|
|
438
438
|
|
|
439
439
|
// Snap to grid (20px)
|
package/js/widgets.js
CHANGED
|
@@ -550,8 +550,7 @@ const WIDGETS = {
|
|
|
550
550
|
description: 'Lists scheduled cron jobs from OpenClaw /api/cron endpoint.',
|
|
551
551
|
defaultWidth: 400,
|
|
552
552
|
defaultHeight: 250,
|
|
553
|
-
hasApiKey:
|
|
554
|
-
apiKeyName: 'OPENCLAW_API',
|
|
553
|
+
hasApiKey: false,
|
|
555
554
|
properties: {
|
|
556
555
|
title: 'Cron',
|
|
557
556
|
endpoint: '/api/cron',
|
|
@@ -625,8 +624,7 @@ const WIDGETS = {
|
|
|
625
624
|
description: 'Shows recent system logs from OpenClaw /api/system-log endpoint.',
|
|
626
625
|
defaultWidth: 500,
|
|
627
626
|
defaultHeight: 400,
|
|
628
|
-
hasApiKey:
|
|
629
|
-
apiKeyName: 'OPENCLAW_API',
|
|
627
|
+
hasApiKey: false,
|
|
630
628
|
properties: {
|
|
631
629
|
title: 'System Log',
|
|
632
630
|
endpoint: '/api/system-log',
|
|
@@ -663,7 +661,7 @@ const WIDGETS = {
|
|
|
663
661
|
}
|
|
664
662
|
async function update_${props.id.replace(/-/g, '_')}() {
|
|
665
663
|
try {
|
|
666
|
-
const res = await fetch('${props.endpoint || '/api/system-log'}');
|
|
664
|
+
const res = await fetch('${props.endpoint || '/api/system-log'}?max=${props.maxLines || 50}');
|
|
667
665
|
const json = await res.json();
|
|
668
666
|
// Handle both new format (json.entries) and old format (json.lines)
|
|
669
667
|
let entries = json.entries || [];
|
|
@@ -2384,6 +2382,7 @@ const WIDGETS = {
|
|
|
2384
2382
|
hasApiKey: false,
|
|
2385
2383
|
properties: {
|
|
2386
2384
|
title: 'Quick Links',
|
|
2385
|
+
columns: 1,
|
|
2387
2386
|
links: []
|
|
2388
2387
|
},
|
|
2389
2388
|
preview: `<div style="padding:4px;font-size:11px;">
|
|
@@ -2413,12 +2412,16 @@ const WIDGETS = {
|
|
|
2413
2412
|
return;
|
|
2414
2413
|
}
|
|
2415
2414
|
|
|
2415
|
+
const cols = ${props.columns || 1};
|
|
2416
|
+
container.style.display = 'grid';
|
|
2417
|
+
container.style.gridTemplateColumns = 'repeat(' + cols + ', 1fr)';
|
|
2418
|
+
container.style.gap = '4px';
|
|
2416
2419
|
container.innerHTML = links.map(link => {
|
|
2417
2420
|
const domain = new URL(link.url).hostname;
|
|
2418
2421
|
const favicon = 'https://www.google.com/s2/favicons?sz=32&domain=' + domain;
|
|
2419
|
-
return '<a href="' + link.url + '" class="quick-link" target="_blank" style="display:flex;align-items:center;gap:8px;padding:
|
|
2420
|
-
'<img src="' + favicon + '" style="width:16px;height:16px;" onerror="this.style.display=\\'none\\'">' +
|
|
2421
|
-
'<span>' + link.name + '</span>' +
|
|
2422
|
+
return '<a href="' + link.url + '" class="quick-link" target="_blank" style="display:flex;align-items:center;gap:8px;padding:6px 4px;text-decoration:none;color:var(--text-primary);border-bottom:1px solid var(--border);overflow:hidden;">' +
|
|
2423
|
+
'<img src="' + favicon + '" style="width:16px;height:16px;flex-shrink:0;" onerror="this.style.display=\\'none\\'">' +
|
|
2424
|
+
'<span style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + link.name + '</span>' +
|
|
2422
2425
|
'</a>';
|
|
2423
2426
|
}).join('');
|
|
2424
2427
|
})();
|
package/package.json
CHANGED
package/server.cjs
CHANGED
|
@@ -327,8 +327,9 @@ const server = http.createServer((req, res) => {
|
|
|
327
327
|
return;
|
|
328
328
|
}
|
|
329
329
|
const content = fs.readFileSync(logPath, 'utf8');
|
|
330
|
+
const maxLines = Math.min(Math.max(parseInt(parsedUrl.searchParams.get('max')) || 50, 1), 200);
|
|
330
331
|
const lines = content.split('\n').filter(l => l.trim());
|
|
331
|
-
const entries = lines.slice(-
|
|
332
|
+
const entries = lines.slice(-maxLines).reverse().map(line => {
|
|
332
333
|
let level = 'INFO';
|
|
333
334
|
let category = 'system';
|
|
334
335
|
if (/\b(error|fatal)\b/i.test(line)) level = 'ERROR';
|