@page "/gateway/system"
@attribute [Authorize]
@attribute [RolePermission]
@inherits ComponentDefault
@using BootstrapBlazor.Components
@using Microsoft.AspNetCore.Authorization
@using ThingsGateway.Admin.Razor
@using ThingsGateway.Authentication
@using ThingsGateway.Upgrade
@using ThingsGateway.Debug
@using ThingsGateway.Gateway.Application
@using ThingsGateway.Admin.Application
@using ThingsGateway.Razor
@namespace ThingsGateway.Management


<div class="appconfig">
    <Tab class="h-100" @ref=tabComponent IsOnlyRenderActiveTab>

        <TabItem Text=@RedundancyLocalizer[nameof(RedundancyOptions)]>

            <Card class="h-100">

                <HeaderTemplate>

                    <RedundancyOptionsHeader />

                </HeaderTemplate>

                <BodyTemplate>

                    <RedundancyOptionsPage Logger="@RedundancyHostedService.TextLogger" LogPath="@RedundancyHostedService.LogPath" />

                </BodyTemplate>

            </Card>

        </TabItem>

        <TabItem Text=@GatewayLocalizer["CheckUpdate"]>

            <Card class="h-100">

                <BodyTemplate>
                    <UpdateZipFilePage></UpdateZipFilePage>
                </BodyTemplate>

            </Card>

        </TabItem>


        <TabItem Text=@GatewayLocalizer["Restart"]>

            <Card class="h-100">

                <BodyTemplate>

                    <Button OnClick="OnRestart" Text=@GatewayLocalizer["Restart"]></Button>

                </BodyTemplate>

            </Card>

        </TabItem>

        @if (WebsiteOption.Value.ShowAuthorize)
        {
            <TabItem Text=@GatewayLocalizer["Authentication"]>

                <Authentication />

            </TabItem>
        }

    </Tab>

</div>

@code {
    Tab tabComponent;
}