Fix stale LXC entries and improve orphaned script cleanup
- Improved cleanupOrphanedScripts to use pct list for more reliable container verification - Added batch processing by server for better efficiency - Added double-check with config file existence before deletion - Added manual cleanup button in Installed Scripts tab for on-demand cleanup - Improved error handling and logging throughout cleanup process - Fixes issue where deleted containers (like Planka) were still showing in the UI
This commit is contained in:
@@ -935,6 +935,18 @@ export function InstalledScriptsTab() {
|
||||
>
|
||||
{showAutoDetectForm ? 'Cancel Auto-Detect' : '🔍 Auto-Detect LXC Containers (Must contain a tag with "community-script")'}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
cleanupRunRef.current = false; // Allow cleanup to run again
|
||||
void cleanupMutation.mutate();
|
||||
}}
|
||||
disabled={cleanupMutation.isPending}
|
||||
variant="outline"
|
||||
size="default"
|
||||
className="border-warning/30 text-warning hover:bg-warning/10"
|
||||
>
|
||||
{cleanupMutation.isPending ? '🧹 Cleaning up...' : '🧹 Cleanup Orphaned Scripts'}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
// Trigger status check by calling the mutation directly
|
||||
|
||||
Reference in New Issue
Block a user