@model MaintenanceModel

@{
    //page title
    ViewBag.PageTitle = T("Admin.System.Maintenance").Text;
    //active menu item (system name)
    NopHtml.SetActiveMenuItemSystemName("Maintenance");
}

@{
    const string hideDeleteGuestsBlockAttributeName = "MaintenancePage.HideDeleteGuestsBlock";
    var customer = await workContext.GetCurrentCustomerAsync();
    var hideDeleteGuestsBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDeleteGuestsBlockAttributeName);

    const string hideDeleteFilesBlockAttributeName = "MaintenancePage.HideDeleteFilesBlock";
    var hideDeleteFilesBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDeleteFilesBlockAttributeName);

    const string hideDeleteCartsBlockAttributeName = "MaintenancePage.HideDeleteCartsBlock";
    var hideDeleteCartsBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDeleteCartsBlockAttributeName);

    const string hideReindexBlockAttributeName = "MaintenancePage.HideReindexBlock";
    var hideReindexBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideReindexBlockAttributeName);

    const string hideBackupsBlockAttributeName = "MaintenancePage.HideBackupsBlock";
    var hideBackupsBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideBackupsBlockAttributeName);

    const string hideDeleteAlreadySentQueuedEmailsBlockAttributeName = "MaintenancePage.HideDeleteAlreadySentQueuedEmailsBlock";
    var hideDeleteAlreadySentQueuedEmailsBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDeleteAlreadySentQueuedEmailsBlockAttributeName);

    const string hideDeleteMinificationFilesBlockAttributeName = "MaintenancePage.HideDeleteMinificationFilesBlock";
    var hideDeleteMinificationFilesBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDeleteMinificationFilesBlockAttributeName);

}

<div class="content-header clearfix">
    <h1 class="float-left">
        @T("Admin.System.Maintenance")
    </h1>
    <div class="float-right">
        &nbsp;
        @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.MaintenanceButtons, additionalData = Model })
    </div>
</div>

<form asp-controller="Common" asp-action="Maintenance" method="post">
	<input type="hidden" asp-for="BackupSupported" />
    <section class="content">
        <div class="container-fluid">
            <div class="form-horizontal">
                <nop-doc-reference asp-string-resource="@T("Admin.Documentation.Reference.Maintenance", Docs.Maintenance + Utm.OnAdmin)"/>

                <nop-cards id="maintenance-cards">
                    <div class="row">
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-delete-guests" asp-icon="fas fa-trash-alt" asp-title="@T("Admin.System.Maintenance.DeleteGuests")" asp-hide-block-attribute-name="@hideDeleteGuestsBlockAttributeName" asp-hide="@hideDeleteGuestsBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DeleteGuests", Model)</nop-card>
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-delete-files" asp-icon="fas fa-trash-alt" asp-title="@T("Admin.System.Maintenance.DeleteExportedFiles")" asp-hide-block-attribute-name="@hideDeleteFilesBlockAttributeName" asp-hide="@hideDeleteFilesBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DeleteFiles", Model)</nop-card>
                    </div>
                    <div class="row">
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-delete-carts" asp-icon="fas fa-trash-alt" asp-title="@T("Admin.System.Maintenance.DeleteAbandonedCarts")" asp-hide-block-attribute-name="@hideDeleteCartsBlockAttributeName" asp-hide="@hideDeleteCartsBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DeleteAbandonedCarts", Model)</nop-card>
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-reindex" asp-icon="fas fa-database" asp-title="@T("Admin.System.Maintenance.ReIndexTables")" asp-hide-block-attribute-name="@hideReindexBlockAttributeName" asp-hide="@hideReindexBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.ReindexDatabaseTables", Model)</nop-card>
                    </div>
                    <div class="row">
                        @if (Model.BackupSupported)
                        {
                            <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-backups" asp-icon="fas fa-hdd" asp-title="@T("Admin.System.Maintenance.BackupDatabase.DatabaseBackups")" asp-hide-block-attribute-name="@hideBackupsBlockAttributeName" asp-hide="@hideBackupsBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DBBackups", Model)</nop-card>
                        }
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="maintenance-delete-already-sent-queued-emails" asp-icon="fas fa-trash-alt" asp-title="@T("Admin.System.Maintenance.DeleteAlreadySentQueuedEmails")" asp-hide-block-attribute-name="@hideDeleteAlreadySentQueuedEmailsBlockAttributeName" asp-hide="@hideDeleteAlreadySentQueuedEmailsBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DeleteAlreadySentQueuedEmails", Model)</nop-card>
                    </div>
                    <div class="row">
                        <nop-card class="col-md-6 col-xs-12 margin-t-5" asp-name="delete-minification-files" asp-icon="fas fa-trash-alt" asp-title="@T("Admin.System.Maintenance.DeleteMinificationFiles")" asp-hide-block-attribute-name="@hideDeleteMinificationFilesBlockAttributeName" asp-hide="@hideDeleteMinificationFilesBlock" asp-advanced="false">@await Html.PartialAsync("_Maintenance.DeleteMinificationCacheFiles", Model)</nop-card>
                    </div>
                    @await Component.InvokeAsync(typeof(AdminWidgetViewComponent), new { widgetZone = AdminWidgetZones.MaintenanceDetailsBlock, additionalData = Model })
                </nop-cards>
            </div>
        </div>
    </section>
</form>