UI/UX improvements: structured conf page and rename plugin to agent

This commit is contained in:
2026-08-01 02:39:28 -04:00
parent aa17981c15
commit 622317b6da
7 changed files with 191 additions and 52 deletions
+10 -1
View File
@@ -23,7 +23,16 @@ router.get('/', async (req, res) => {
router.post('/', async (req, res, next) => {
try {
await confManager.setVaultConf(req.body);
const existing = await confManager.getVaultConf() || {};
// Deep merge req.body into existing
for (const key of Object.keys(req.body)) {
if (typeof req.body[key] === 'object' && req.body[key] !== null && !Array.isArray(req.body[key])) {
existing[key] = { ...(existing[key] || {}), ...req.body[key] };
} else {
existing[key] = req.body[key];
}
}
await confManager.setVaultConf(existing);
res.json({ success: true });
} catch(err) {
next(err);