@model StubAP.ViewModels.MigrationViewModel

<section class="st_migration">
    @if (!Model.isMigrated)
    {
        <div class="st_migration_head">
            <div class="st_head_left">
                <h1>Profiles migration</h1>
            </div>
            <div class="st_head_right">
                <div class="st_hint_switcher">
                    <div class="st_option">
                        <label>
                            <input type="checkbox" />
                            <span class="st_option_shadow"></span>
                        </label>
                    </div>
                </div>
                <div class="st_hint_note">
                    <span class="st_head">Turn hints off</span>
                    <span class="st_description">Click on light blue block to open the hint</span>
                </div>
            </div>
        </div>
        <div class="st_migration_body">
            <div class="st_migrationbody_line"></div>
            <div class="st_migrationbody_content">
                <div class="st_migrationbody_tool">
                    <div class="st_migration_notice">
                        <div class="notice">
                            <p>
                                The tool will move and transform version of existing data to new version of 2.0.
                                All profiles data with nodes, namespaces and files will be moved to new format and structure.
                            </p>
                            <p>
                                All old files will be removed from hard drive and cannnot be restored after migration.
                                Please be aware and sure, that you want to continue this operation with this function, else, please select an option to save a backup.
                            </p>
                        </div>
                    </div>
                    
                    @using (Html.BeginForm("migratedata", "migration", null, FormMethod.Post, new { id = "migration" }))
                    {
                    <div class="st_fields_set">
                        <div class="st_field_block left-one">
                            <div class="st_fields_backup">
                                <div class="st_backup middle description">Backup old files</div> 
                                <div class="st_backup middle">
                                    <div class="st_option">
                                        <label class="no_padding">
                                            @Html.CheckBoxFor(model => model.DeleteFiles)
                                            <span class="st_option_shadow"></span>
                                        </label>
                                    </div>
                                </div>
                            </div>           
                        </div>
                        <div class="st_field_block right-one">
                            <a class="st_formBtn submit full">Migrate profiles</a>
                        </div>
                    </div>
                    }
                </div>
                <div class="st_migration_report" style="display:none;">
                    <h2>Migration report</h2>
                    <div class="st_report_body">
                        <ul>
                            <li class="notice">[Time: 0.001s] Action: Found folder profiles.js</li>
                            <li>[Time: 0.002s] Action: Get first profile with name "NBSCustomer". Extracting data...</li>
                            <li class="success">[Time: 0.002s] Action: Profile "NBSCustomer" was succesfully moved to new structure. [Context: Name = NBSCustomer, ID = 1]</li>
                            <li>[Time: 0.004s] Action: Deleting profile "NBSCustomer"</li>
                            <li>[Time: 0.005s] Action: Get first profile with name "NBSCustomer". Extracting data...</li>
                            <li class="success">[Time: 0.002s] Action: Profile "NBSCustomer" was succesfully moved to new structure. [Context: Name = FloodRe, ID = 2]</li>
                            <li>[Time: 0.005s] Action: Deleting profile "FloodRe"</li>
                            <li>[Time: 0.006s] Action: Get first profile with name "NBSCustomer". Extracting data...</li>
                            <li class="success">[Time: 0.002s] Action: Profile "NBSCustomer" was succesfully moved to new structure. [Context: Name = Enrichment, ID = 3]</li>
                            <li>[Time: 0.006s] Action: Deleting profile "Enrichment"</li>
                            <li class="error">[Time: 0.007s] Error: Profile cannot be deleted [Context: Name: NBSCustomer]</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    }
    else
    {
        <div class="st_migration_done">
            <div class="notice">The scan is showing that current solution have no data what can be migrated</div>
        </div>
    }
</section>