feat: Add VM/LXC cloning functionality
- Add CloneCountInputModal component for specifying clone count - Implement clone handlers and state management in InstalledScriptsTab - Add clone menu item to ScriptInstallationCard - Extend StorageSelectionModal to support clone storage selection (rootdir only) - Add clone terminal support to Terminal component - Implement startSSHCloneExecution in server.js with sequential ID retrieval - Add clone-related API endpoints (getClusterNextId, getContainerType, getCloneStorages, generateCloneHostnames, executeClone, addClonedContainerToDatabase) - Integrate with VM/LXC detection from main branch - Fix storage fetching to use correct serverId parameter - Fix clone execution to pass storage parameter correctly - Remove unused eslint-disable comments
This commit is contained in:
@@ -46,6 +46,7 @@ interface ScriptInstallationCardProps {
|
||||
onCancel: () => void;
|
||||
onUpdate: () => void;
|
||||
onBackup?: () => void;
|
||||
onClone?: () => void;
|
||||
onShell: () => void;
|
||||
onDelete: () => void;
|
||||
isUpdating: boolean;
|
||||
@@ -71,6 +72,7 @@ export function ScriptInstallationCard({
|
||||
onCancel,
|
||||
onUpdate,
|
||||
onBackup,
|
||||
onClone,
|
||||
onShell,
|
||||
onDelete,
|
||||
isUpdating,
|
||||
@@ -319,7 +321,16 @@ export function ScriptInstallationCard({
|
||||
Backup
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
{script.container_id && script.execution_mode === 'ssh' && !script.is_vm && (
|
||||
{script.container_id && script.execution_mode === 'ssh' && onClone && (
|
||||
<DropdownMenuItem
|
||||
onClick={onClone}
|
||||
disabled={containerStatus === 'stopped'}
|
||||
className="text-muted-foreground hover:text-foreground hover:bg-muted/20 focus:bg-muted/20"
|
||||
>
|
||||
Clone
|
||||
</DropdownMenuItem>
|
||||
)}
|
||||
{script.container_id && script.execution_mode === 'ssh' && (
|
||||
<DropdownMenuItem
|
||||
onClick={onShell}
|
||||
disabled={containerStatus === 'stopped'}
|
||||
|
||||
Reference in New Issue
Block a user