This commit is contained in:
2026-03-05 19:34:01 +00:00
parent c3d1df42b0
commit 6836892907
22 changed files with 1869 additions and 302 deletions

View File

@@ -2,6 +2,7 @@ const express = require('express');
const asyncHandler = require('../middleware/asyncHandler');
const pipelineService = require('../services/pipelineService');
const diskDetectionService = require('../services/diskDetectionService');
const hardwareMonitorService = require('../services/hardwareMonitorService');
const logger = require('../services/logger').child('PIPELINE_ROUTE');
const router = express.Router();
@@ -10,7 +11,10 @@ router.get(
'/state',
asyncHandler(async (req, res) => {
logger.debug('get:state', { reqId: req.reqId });
res.json({ pipeline: pipelineService.getSnapshot() });
res.json({
pipeline: pipelineService.getSnapshot(),
hardwareMonitoring: hardwareMonitorService.getSnapshot()
});
})
);

View File

@@ -5,6 +5,7 @@ const scriptService = require('../services/scriptService');
const notificationService = require('../services/notificationService');
const pipelineService = require('../services/pipelineService');
const wsService = require('../services/websocketService');
const hardwareMonitorService = require('../services/hardwareMonitorService');
const logger = require('../services/logger').child('SETTINGS_ROUTE');
const router = express.Router();
@@ -140,6 +141,18 @@ router.put(
message: error?.message || 'unknown'
};
}
try {
await hardwareMonitorService.handleSettingsChanged([key]);
} catch (error) {
logger.warn('put:setting:hardware-monitor-refresh-failed', {
reqId: req.reqId,
key,
error: {
name: error?.name,
message: error?.message
}
});
}
wsService.broadcast('SETTINGS_UPDATED', updated);
res.json({ setting: updated, reviewRefresh });
@@ -182,6 +195,17 @@ router.put(
message: error?.message || 'unknown'
};
}
try {
await hardwareMonitorService.handleSettingsChanged(changes.map((item) => item.key));
} catch (error) {
logger.warn('put:settings:bulk:hardware-monitor-refresh-failed', {
reqId: req.reqId,
error: {
name: error?.name,
message: error?.message
}
});
}
wsService.broadcast('SETTINGS_BULK_UPDATED', { count: changes.length, keys: changes.map((item) => item.key) });
res.json({ changes, reviewRefresh });