<!-- content start -->
<div class="admin-content" id="index">
    <div class="admin-content-body" *ngIf="userService.userInfo&&userService.userInfo.role=='user'">
        <div>
            <div><strong class="part-title">首页</strong></div>
        </div>
        <h2 style="text-align: center;">
            Welcome {{userService.userInfo.displayName}}!
        </h2>

        <nz-card class="card">
            <ul class="dashboardUl">
                <li style="width: 50%">
                    <div><i nz-icon nzType="login" nzTheme="outline"></i></div>
                    <p>上次登录</p>
                    <p>{{userService.userInfo.recentlyLandedDate}}</p>
                </li>
                <li style="width: 50%">
                    <div><i nz-icon nzType="environment" nzTheme="outline"></i></div>
                    <p>您的ip和位置</p>
                    <p>
                        ip:{{ip}}
                        <br>
                        位置:{{location}}
                    </p>
                </li>
            </ul>
        </nz-card>
    </div>

    <!--  administrator page  -->
    <div *ngIf="userService.userInfo&&userService.userInfo.role=='admin'">
        <nz-card>
            <ul class="dashboardUl">
                <li>
                    <div><i nz-icon nzType="ie" nzTheme="outline"></i></div>
                    <p>总访问量</p>
                    <p>{{visitorService.totalVisitCount}}</p>
                </li>
                <li>
                    <div><i nz-icon nzType="chrome" nzTheme="outline"></i></div>
                    <p>今日访问量</p>
                    <p>{{visitorService.dayVisit}}</p>
                </li>
                <li>
                    <div><i nz-icon nzType="login" nzTheme="outline"></i></div>
                    <p>上次登录</p>
                    <p>{{userService.userInfo.recentlyLandedDate}}</p>
                </li>
                <li>
                    <div><i nz-icon nzType="arrow-up" nzTheme="outline"></i></div>
                    <p>上次更新</p>
                    <p>{{webUpdateService.lastestUpdateTime}}</p>
                </li>
            </ul>
        </nz-card>

        <div style="position: relative">
            <button nz-button nzType="danger" nzShape="circle" class="reloadLog" (click)="readLog()">
                <i nz-icon nzType="reload" nzTheme="outline"></i>
            </button>
            <nz-spin [nzSpinning]="Loading">
                <pre class="log">
                    {{this.logService.logText}}
                </pre>
            </nz-spin>
        </div>
    </div>

</div>
<!-- content end -->
