0.11.0-4 lw

This commit is contained in:
2026-03-17 20:28:38 +00:00
parent 654a77b8ba
commit 38fc1778f7
11 changed files with 156 additions and 11 deletions
+27
View File
@@ -9,6 +9,7 @@ const wsService = require('../services/websocketService');
const hardwareMonitorService = require('../services/hardwareMonitorService');
const userPresetService = require('../services/userPresetService');
const activationBytesService = require('../services/activationBytesService');
const diskDetectionService = require('../services/diskDetectionService');
const logger = require('../services/logger').child('SETTINGS_ROUTE');
const { getDb } = require('../db/database');
@@ -402,6 +403,32 @@ router.post(
})
);
// ── Optical drive scan ────────────────────────────────────────────────────────
router.get(
'/drives',
asyncHandler(async (req, res) => {
logger.debug('get:settings:drives', { reqId: req.reqId });
const devices = await diskDetectionService.getBlockDeviceInfo();
const drives = devices
.filter((d) => d.type === 'rom')
.map((d) => {
const name = String(d.name || '');
const devicePath = d.path || (name ? `/dev/${name}` : null);
const match = name.match(/sr(\d+)$/);
const discIndex = match ? Number(match[1]) : null;
return {
path: devicePath,
name,
model: d.model || null,
discIndex,
discArg: discIndex != null ? `disc:${discIndex}` : null
};
})
.filter((d) => d.path);
res.json({ drives });
})
);
// User preferences (UI state, persisted per-installation)
router.get(
'/prefs/:key',