{#if activeTask}

{$t.tasks?.task_label || "Task"}

{:else} {#if model.showTaskHistory}
{/if}
{#each [ { step: 1, label: $t.migration?.source_env || "Source" }, { step: 2, label: $t.migration?.select_dashboards_title || "Dashboards" }, { step: 3, label: $t.tasks?.summary_report || "Review" }, { step: 4, label: $t.migration?.start || "Migrate" }, ] as s} {#if s.step < 4}
{/if} {/each}
{#if model.loading}
{:else if model.error}

{model.error}

{/if} {#if model.currentStep === 1}
1

{$t.migration?.source_env || "Source Environment"} → {$t.migration?.target_env || "Target Environment"}

{$t.migration?.source_env || "Source"}

model.selectSourceEnv(id)} />

{$t.migration?.target_env || "Target"}

model.selectTargetEnv(id)} />
{#if model.sourceEnvId && model.targetEnvId && model.sourceEnvId === model.targetEnvId}

{$t.migration?.different_envs || "Source and target environments must be different."}

{/if}
{/if} {#if model.currentStep === 2}
2

{$t.migration?.select_dashboards_title || "Select Dashboards"}

{#if model.sourceEnvId}
{:else}

{$t.dashboard?.select_source || "Select a source environment to view dashboards."}

{/if}

{$t.dashboard?.settings || "Options"}

{#if model.replaceDb}

{$t.migration?.database_mappings || "Database Mappings"}

{#if model.fetchingDbs}
{$t.migration?.loading_dbs || "Loading databases and suggestions..."}
{:else if model.sourceDatabases.length > 0} model.saveMapping(e.detail.sourceUuid, e.detail.targetUuid)} /> {:else if model.sourceEnvId && model.targetEnvId}

{$t.migration?.mapping_hint || "Select environments and click \"Fetch Databases\" to start mapping."}

{/if}
{/if}
{/if} {#if model.currentStep === 3}
3

{$t.tasks?.summary_report || "Review & Validate"}

{#if model.dryRunResult}

{$t.dashboard?.selected_dashboards || "Selected Dashboards"}

{#each model.dryRunResult.selected_dashboard_titles || [] as title} {title} {/each}

{$t.dashboard?.title || "Dashboards"}

Create {model.dryRunResult.summary.dashboards.create}
Update {model.dryRunResult.summary.dashboards.update}
Delete {model.dryRunResult.summary.dashboards.delete}

{$t.dashboard?.charts || "Charts"}

Create {model.dryRunResult.summary.charts.create}
Update {model.dryRunResult.summary.charts.update}
Delete {model.dryRunResult.summary.charts.delete}

{$t.dashboard?.linked_resources || "Datasets"}

Create {model.dryRunResult.summary.datasets.create}
Update {model.dryRunResult.summary.datasets.update}
Delete {model.dryRunResult.summary.datasets.delete}

{$t.tasks?.issues || "Risk Assessment"}

Score:
{model.dryRunResult.risk.score}/100
{model.dryRunResult.risk.level.toUpperCase()}
20 && model.dryRunResult.risk.score <= 50} class:bg-destructive={model.dryRunResult.risk.score > 50} style="width: {model.dryRunResult.risk.score}%" >
{#if model.dryRunResult.risk.items && model.dryRunResult.risk.items.length > 0}
{#each model.dryRunResult.risk.items as item}

{item.message}

{item.object_type}: {item.object_uuid}

{/each}
{:else}

No issues detected.

{/if}
{$t.tasks?.diff_preview || "Diff JSON"}
{JSON.stringify(model.dryRunResult, null, 2)}
{:else}

Run a dry-run to see the migration summary here.

{/if}
{/if} {#if model.currentStep === 4 && !activeTask}

{$t.migration?.starting || "Starting Migration..."}

{$t.common.loading || "Please wait..."}

{/if} {#if !model.currentStep || model.currentStep === 0}

{$t.dashboard?.migrate_modal_title || "Select environments to start"}

{/if} {/if}
model.closeLogViewer()} /> model.resumeMigration(e.detail.passwords)} oncancel={() => model.showPasswordPrompt = false} />