<div class="block card w-full">
    <div class="block">
        <p-card class="m-5">
            <div class="flex mb-3" *ngIf="retryCount == 0 && setupService.WebOnlyStartup != 'NONE'">
                <p-message severity="warn" [styleClass]="'font-bold'"
                    text="{{ 'settings.main.webonly.'+ setupService.WebOnlyStartup | translate }}"></p-message>
            </div>
            <div class="flex mb-3" *ngIf="retryCount == 0">
                <p-message *ngIf="setupService.schedulingEnabled; else mustrestart" severity="warn"
                    [styleClass]="'font-bold'" text="{{ 'settings.main.mustenable' | translate }}">
                </p-message>
                <ng-template #mustrestart>
                    <p-message severity="warn" [styleClass]="'font-bold'"
                        text="{{ 'settings.main.mustrestart' | translate }}">
                    </p-message>
                </ng-template>
            </div>
            <div class="block" *ngIf="setupService.schedulingEnabled && retryCount == 0">
                <div class="flex align-items-center">
                    <p-button class="pr-5 pb-1 pt-0 m-0" label="{{ 'settings.main.enableupdates_label' | translate }}"
                        icon="pi pi-save" iconPos="left" (onClick)="disableSched();"></p-button>
                </div>
                <!-- <div class="flex align-items-center"> -->
                <small class="block">{{ 'settings.main.enableupdates_desc' | translate }}<br>&nbsp;</small>
                <!-- </div> -->
            </div>
            <!-- <div class="flex" *ngIf="!setupService.schedulingEnabled && retryCount == 0"> -->
            <div class="block" *ngIf="retryCount <= 0 && setupService.WebOnlyStartup != 'WEBONLYPARM'">
                <div class="flex align-items-center">
                    <p-button class="pr-5 pb-1 pt-0 m-0" label="{{ 'settings.main.restart_webonly_label' | translate }}"
                        icon="pi pi-save" iconPos="left" (onClick)="restart(true);"></p-button>
                </div>
                <small class="block">{{ 'settings.main.restart_webonly_desc' | translate }}<br>&nbsp;</small>
            </div>
            <div class="block" *ngIf="retryCount <= 0">
                <div class="flex align-items-center" *ngIf="retryCount <= 0">
                    <p-button class="pr-5 pb-1 pt-0 m-0" label="{{ 'settings.main.restart_label' | translate }}"
                        icon="pi pi-save" iconPos="left" (onClick)="restart(false);"></p-button>
                </div>
                <small class="block">{{ 'settings.main.restart_desc' | translate }}<br>&nbsp;</small>
            </div>
            <div class="flex align-items-center" *ngIf="!masterServerName || !hostName || masterServerName == hostName">
                <div class="text-pink-500" *ngIf="!setupService.schedulingEnabled && retryCount == 0">{{
                    'settings.main.disabled' | translate }}</div>
            </div>
            <div class="flex align-items-center" *ngIf="masterServerName && hostName && masterServerName != hostName">
                {{ 'settings.main.slave_enabled' | translate }}</div>
            <!-- </div> -->
            <div>
                <small *ngIf="upComing.length > 0" class="pb-0 m-0">
                    {{ 'settings.main.upcomingrec' |
                    translate: { Title: upComing[0].Title, StartTime: recStartTime, Status: recStatusDesc } }}
                </small>
            </div>
            <div *ngIf="masterServerName && hostName && masterServerName != hostName && retryCount == 0">
                <p>{{ 'settings.main.slave_instructions' | translate }}
                </p>
                <p>{{ 'settings.main.slave_warning' | translate }}
                </p>
            </div>
            <div>
                <p-progressSpinner *ngIf="retryCount > 0"></p-progressSpinner>
                <p-message *ngIf="retryCount > 0" severity="info"
                    text="{{ 'settings.main.restarting' | translate }}"></p-message>
                <p>
                    <p-message *ngIf="!setupService.isDatabaseIgnored && this.errorCount > 0 && retryCount == 0"
                        severity="error" text="{{ 'common.networkfail' | translate }}"></p-message>
                </p>
            </div>
        </p-card>
    </div>