mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-30 12:33:01 +00:00
fix(backup): add post-install steps for restored plugins; conditional restart hint
- api_v3: after a successful plugin reinstall during restore, run the same post-install sequence used by the normal /plugins/install flow: invalidate schema cache, discover_plugins()/load_plugin(), and set_plugin_installed() so restored plugins are immediately available - backup_restore.html: only show the "restart the display service" hint when at least one item was restored or at least one plugin was installed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1340,6 +1340,13 @@ def backup_restore():
|
|||||||
try:
|
try:
|
||||||
ok = api_v3.plugin_store_manager.install_plugin(plugin_id)
|
ok = api_v3.plugin_store_manager.install_plugin(plugin_id)
|
||||||
if ok:
|
if ok:
|
||||||
|
if api_v3.schema_manager:
|
||||||
|
api_v3.schema_manager.invalidate_cache(plugin_id)
|
||||||
|
if api_v3.plugin_manager:
|
||||||
|
api_v3.plugin_manager.discover_plugins()
|
||||||
|
api_v3.plugin_manager.load_plugin(plugin_id)
|
||||||
|
if api_v3.plugin_state_manager:
|
||||||
|
api_v3.plugin_state_manager.set_plugin_installed(plugin_id)
|
||||||
result.plugins_installed.append(plugin_id)
|
result.plugins_installed.append(plugin_id)
|
||||||
else:
|
else:
|
||||||
result.plugins_failed.append({'plugin_id': plugin_id, 'error': 'install returned False'})
|
result.plugins_failed.append({'plugin_id': plugin_id, 'error': 'install returned False'})
|
||||||
|
|||||||
@@ -326,7 +326,7 @@
|
|||||||
<div><strong>Plugins installed:</strong> ${(data.plugins_installed || []).map(escapeHtml).join(', ') || 'none'}</div>
|
<div><strong>Plugins installed:</strong> ${(data.plugins_installed || []).map(escapeHtml).join(', ') || 'none'}</div>
|
||||||
<div><strong>Plugins failed:</strong> ${(data.plugins_failed || []).map(p => escapeHtml(p.plugin_id + ' (' + p.error + ')')).join(', ') || 'none'}</div>
|
<div><strong>Plugins failed:</strong> ${(data.plugins_failed || []).map(p => escapeHtml(p.plugin_id + ' (' + p.error + ')')).join(', ') || 'none'}</div>
|
||||||
<div><strong>Errors:</strong> ${(data.errors || []).map(escapeHtml).join('; ') || 'none'}</div>
|
<div><strong>Errors:</strong> ${(data.errors || []).map(escapeHtml).join('; ') || 'none'}</div>
|
||||||
<p class="mt-2">Restart the display service to apply all changes.</p>
|
${((data.restored || []).length || (data.plugins_installed || []).length) ? '<p class="mt-2">Restart the display service to apply all changes.</p>' : ''}
|
||||||
`;
|
`;
|
||||||
notify(hasPartial ? 'Restore complete with warnings' : 'Restore complete', hasPartial ? 'warning' : 'success');
|
notify(hasPartial ? 'Restore complete with warnings' : 'Restore complete', hasPartial ? 'warning' : 'success');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user