Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15de56dbe6 |
@@ -5,6 +5,7 @@ import { requireOwner } from '../cap.js';
|
|||||||
import { validate } from '../validate.js';
|
import { validate } from '../validate.js';
|
||||||
import { grouped, iconSlug } from '../../health/registry.js';
|
import { grouped, iconSlug } from '../../health/registry.js';
|
||||||
import * as services from '../../db/repos/monitored_services.js';
|
import * as services from '../../db/repos/monitored_services.js';
|
||||||
|
import * as devices from '../../db/repos/lan_devices.js';
|
||||||
import * as statusRepo from '../../db/repos/service_status.js';
|
import * as statusRepo from '../../db/repos/service_status.js';
|
||||||
import { enqueue } from '../../jobs/queue.js';
|
import { enqueue } from '../../jobs/queue.js';
|
||||||
|
|
||||||
@@ -29,7 +30,13 @@ router.get('/services', asyncWrap(async (_req, res) => {
|
|||||||
|
|
||||||
// GET /services/discovered — candidates from a LAN scan, awaiting review (owner).
|
// GET /services/discovered — candidates from a LAN scan, awaiting review (owner).
|
||||||
router.get('/services/discovered', requireOwner, asyncWrap(async (_req, res) => {
|
router.get('/services/discovered', requireOwner, asyncWrap(async (_req, res) => {
|
||||||
res.json((await services.listDiscovered()).map(s => ({ ...s, icon: iconSlug(s) })));
|
// Cross-reference each candidate's host IP with the Network Devices band so the
|
||||||
|
// tile can show a known device name instead of a bare IP:port.
|
||||||
|
const byIp = Object.fromEntries(
|
||||||
|
(await devices.listKnown()).filter(d => d.ip).map(d => [d.ip, d.name]));
|
||||||
|
res.json((await services.listDiscovered()).map(s => ({
|
||||||
|
...s, icon: iconSlug(s), device: byIp[s.host] || null
|
||||||
|
})));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const checkCfg = z.object({ type: z.enum(['http', 'tcp']).optional(), path: z.string().max(200).optional() });
|
const checkCfg = z.object({ type: z.enum(['http', 'tcp']).optional(), path: z.string().max(200).optional() });
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "void-server",
|
"name": "void-server",
|
||||||
"version": "2.6.4",
|
"version": "2.6.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "void-server",
|
"name": "void-server",
|
||||||
"version": "2.6.4",
|
"version": "2.6.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.29.0",
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
||||||
"@mozilla/readability": "^0.6.0",
|
"@mozilla/readability": "^0.6.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "void-server",
|
"name": "void-server",
|
||||||
"version": "2.6.4",
|
"version": "2.6.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ async function discoveredSection() {
|
|||||||
el('div', { class: 'tiles' }, cand.map(c =>
|
el('div', { class: 'tiles' }, cand.map(c =>
|
||||||
el('div', { class: 'tile disc' },
|
el('div', { class: 'tile disc' },
|
||||||
el('div', { class: 'tile-main' },
|
el('div', { class: 'tile-main' },
|
||||||
el('div', { class: 'tile-nm' }, c.name),
|
el('div', { class: 'tile-nm' }, c.device || c.name),
|
||||||
el('div', { class: 'tile-host' }, c.url)),
|
el('div', { class: 'tile-host' }, c.device ? `${c.name} · ${c.url}` : c.url)),
|
||||||
el('button', { class: 'disc-add', title: 'Add to the band', onclick: () => promote(c.id) }, '+')))));
|
el('button', { class: 'disc-add', title: 'Add to the band', onclick: () => promote(c.id) }, '+')))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user