<!doctype html>
<html ng-app="system_info">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="icon" href="img/config.png">
    <!-- styles -->
    <link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="vendor/angular/angular-toastr-1.4.1.min.css">
    <link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css">
    <link rel="stylesheet" type="text/css" href="styles/common-style.css">
    <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
    <title>{{'SystemInfo.Title' | translate }}</title>
</head>

<body>

    <apollonav></apollonav>


    <div class="container-fluid" ng-controller="SystemInfoController">
        <div class="col-md-10 col-md-offset-1 panel">

            <section class="panel-body" ng-show="isRootUser">
                <section class="row">
                    <h3>{{'SystemInfo.Title' | translate }}
                    </h3>
                    <h6 ng-show="systemInfo.version">{{'SystemInfo.SystemVersion' | translate }}: {{systemInfo.version}}
                    </h6>
                    <h6 translate="SystemInfo.Tips1" translate-value-server-config-url="server_config.html"
                        translate-value-wiki-url="https://github.com/ctripcorp/apollo/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97">
                    </h6>

                    <h6 translate="SystemInfo.Tips2"
                        translate-value-wiki-url="https://github.com/ctripcorp/apollo/wiki/%E5%88%86%E5%B8%83%E5%BC%8F%E9%83%A8%E7%BD%B2%E6%8C%87%E5%8D%97">
                    </h6>

                    <div ng-repeat="env in systemInfo.environments">
                        <hr>
                        <h4>{{'Common.Environment' | translate }}: {{env.env}}
                        </h4>
                        <h5>{{'SystemInfo.Active' | translate }}: {{env.active}}
                            <span ng-show="env.active == false"
                                style="color: #a94442;">{{'SystemInfo.ActiveTips' | translate }}</span>
                        </h5>
                        <h5>{{'SystemInfo.MetaServerAddress' | translate }}: {{env.metaServerAddress}}</h5>
                        <div ng-show="env.errorMessage" ng-bind="env.errorMessage" class="alert alert-danger"
                            role="alert">
                        </div>
                        <h4 class="text-center">{{'SystemInfo.ConfigServices' | translate }}</h4>
                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th>{{'SystemInfo.ConfigServices.Name' | translate }}</th>
                                    <th>{{'SystemInfo.ConfigServices.InstanceId' | translate }}</th>
                                    <th>{{'SystemInfo.ConfigServices.HomePageUrl' | translate }}</th>
                                    <th>{{'SystemInfo.ConfigServices.CheckHealth' | translate }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="(!env.configServices || env.configServices.length < 1)">
                                    <td colspan="4">{{'SystemInfo.NoConfigServiceTips' | translate }}</td>
                                </tr>
                                <tr ng-show="env.configServices && env.configServices.length > 0"
                                    ng-repeat="service in env.configServices">
                                    <td>{{service.appName}}</td>
                                    <td>{{service.instanceId}}</td>
                                    <td>{{service.homepageUrl}}</td>
                                    <td><a href="javascript:;"
                                            ng-click="check(service.instanceId, service.homepageUrl)">{{'SystemInfo.Check' | translate }}</a>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <h4 class="text-center">{{'SystemInfo.AdminServices' | translate }}</h4>
                        <table class="table table-striped table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th>{{'SystemInfo.AdminServices.Name' | translate }}</th>
                                    <th>{{'SystemInfo.AdminServices.InstanceId' | translate }}</th>
                                    <th>{{'SystemInfo.AdminServices.HomePageUrl' | translate }}</th>
                                    <th>{{'SystemInfo.AdminServices.CheckHealth' | translate }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="(!env.adminServices || env.adminServices.length < 1)">
                                    <td colspan="4">{{'SystemInfo.NoAdminServiceTips' | translate }}</td>
                                </tr>
                                <tr ng-show="env.adminServices && env.adminServices.length > 0"
                                    ng-repeat="service in env.adminServices">
                                    <td>{{service.appName}}</td>
                                    <td>{{service.instanceId}}</td>
                                    <td>{{service.homepageUrl}}</td>
                                    <td><a href="javascript:;"
                                            ng-click="check(service.instanceId, service.homepageUrl)">{{'SystemInfo.Check' | translate }}</a>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                </section>
            </section>

            <section class="panel-body text-center" ng-if="!isRootUser">
                <h4>{{'Common.IsRootUser' | translate }}</h4>
            </section>

        </div>
    </div>

    <div ng-include="'views/common/footer.html'"></div>

    <!-- jquery.js -->
    <script src="vendor/jquery.min.js" type="text/javascript"></script>

    <!--angular-->
    <script src="vendor/angular/angular.min.js"></script>
    <script src="vendor/angular/angular-route.min.js"></script>
    <script src="vendor/angular/angular-resource.min.js"></script>
    <script src="vendor/angular/angular-toastr-1.4.1.tpls.min.js"></script>
    <script src="vendor/angular/loading-bar.min.js"></script>
    <script src="vendor/angular/angular-cookies.min.js"></script>

    <script src="vendor/angular/angular-translate.2.18.1/angular-translate.min.js"></script>
    <script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script>
    <script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>

    <!--valdr-->
    <script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
    <script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>

    <!-- bootstrap.js -->
    <script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

    <script src="vendor/lodash.min.js"></script>

    <script src="vendor/select2/select2.min.js" type="text/javascript"></script>
    <!--biz-->
    <!--must import-->
    <script type="application/javascript" src="scripts/app.js"></script>
    <script type="application/javascript" src="scripts/services/AppService.js"></script>
    <script type="application/javascript" src="scripts/services/EnvService.js"></script>
    <script type="application/javascript" src="scripts/services/UserService.js"></script>
    <script type="application/javascript" src="scripts/services/CommonService.js"></script>
    <script type="application/javascript" src="scripts/services/PermissionService.js"></script>
    <script type="application/javascript" src="scripts/services/ClusterService.js"></script>
    <script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
    <script type="application/javascript" src="scripts/services/SystemInfoService.js"></script>

    <script type="application/javascript" src="scripts/AppUtils.js"></script>

    <script type="application/javascript" src="scripts/PageCommon.js"></script>
    <script type="application/javascript" src="scripts/directive/directive.js"></script>
    <script type="application/javascript" src="scripts/valdr.js"></script>

    <script type="application/javascript" src="scripts/controller/SystemInfoController.js"></script>
</body>

</html>