config.html 22.7 KB
Newer Older
1 2 3 4 5
<!DOCTYPE html>
<html data-ng-app="application">

<head>
    <meta charset="UTF-8">
zhangle committed
6
    <title>Apollo配置中心</title>
zhangle committed
7
    <link rel="icon" href="./img/config.png">
lepdou committed
8 9
    <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">
lepdou committed
10
    <link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
lepdou committed
11 12
    <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">
13 14 15 16
</head>

<body>

lepdou committed
17
<apollonav></apollonav>
lepdou committed
18

19 20 21 22 23 24 25 26 27
<div id="config-info" class="apollo-container app">
    <div ng-controller="ConfigBaseInfoController">
        <div class="J_appNotFound hidden row text-center app-not-found" ng-show="notFoundApp">
            <img src="img/404.png">
            <br>
            <p>
                <span ng-bind="pageContext.appId"></span> 不存在,<a href="/app.html">点击创建</a>
            </p>
        </div>
28

29 30 31 32
        <div class="side-bar"
             ng-class="{'position-absolute': viewMode == 1, 'position-fixed': viewMode == 2}">
            <div class="J_appFound hidden"
                 ng-show="!notFoundApp && (viewMode == 1 || (viewMode == 2 && showSideBar))">
33

34
                <!--env list-->
35 36
                <section class="panel">
                    <header class="panel-heading">
37
                        环境列表
38 39 40 41 42 43 44 45 46
                        <span class="pull-right"
                              data-tooltip="tooltip" data-placement="bottom" title="通过切换环境、集群来管理不同环境、集群的配置">
                                    <img src="img/question.png" class="i-20"/>
                            </span>
                    </header>
                    <div id="treeview" class="no-radius"></div>
                </section>


47 48 49
                <!--app info-->
                <section class="panel">
                    <header class="panel-heading">
50 51 52 53 54 55 56
                        项目信息
                            <span class="pull-right">

                                <a href="/app/setting.html?#/appid={{pageContext.appId}}"
                                   style="margin-right: 5px;text-decoration:none;">
                                    <img src="img/edit.png" class="i-20 cursor-pointer"
                                         data-tooltip="tooltip" data-placement="bottom" title="修改项目基本信息"/>
57
                                </a>
58 59 60 61 62 63 64 65

                                <img src="img/unlike.png" class="i-20 cursor-pointer"
                                     ng-if="!favoriteId" ng-click="addFavorite()"
                                     data-tooltip="tooltip" data-placement="bottom" title="收藏"/>

                                <img src="img/like.png" class="i-20 cursor-pointer"
                                     ng-if="favoriteId" ng-click="deleteFavorite()"
                                     data-tooltip="tooltip" data-placement="bottom" title="取消收藏"/>
lepdou committed
66
                            </span>
67 68 69 70 71 72 73 74 75 76
                    </header>
                    <div class="panel-body">
                        <table class="project-info">
                            <tbody class="text-left">
                            <tr>
                                <th>AppId:</th>
                                <td ng-bind="appBaseInfo.appId"></td>
                            </tr>
                            <tr>
                                <th>应用名:</th>
lepdou committed
77 78 79
                                <td>
                                    <small ng-bind="appBaseInfo.name"></small>
                                </td>
80 81 82 83 84 85 86 87 88 89
                            </tr>
                            <tr>
                                <th>部门:</th>
                                <td ng-bind="appBaseInfo.orgInfo"></td>
                            </tr>
                            <tr>
                                <th>负责人:</th>
                                <td ng-bind="appBaseInfo.ownerName"></td>
                            </tr>
                            <tr>
lepdou committed
90
                                <th>邮箱:</th>
lepdou committed
91 92 93
                                <td>
                                    <small ng-bind="appBaseInfo.ownerEmail"></small>
                                </td>
94 95 96 97
                            </tr>
                            <tr ng-show="missEnvs.length > 0">
                                <th>缺失的环境:</th>
                                <td>
lepdou committed
98 99
                                <span ng-repeat="env in missEnvs" ng-bind="env">
                                </span>
100 101 102 103
                                </td>
                            </tr>
                            </tbody>
                        </table>
lepdou committed
104

105 106 107
                    </div>
                </section>

108 109
                <!--operation entrance-->
                <section>
110 111 112
                    <apolloentrance apollo-title="'管理项目'" apollo-img-src="'project-manage'"
                                    apollo-href="'/app/setting.html?#/appid=' + pageContext.appId"></apolloentrance>

113 114 115 116 117
                    <a class="list-group-item" ng-show="missEnvs.length > 0" ng-click="createAppInMissEnv()">
                        <div class="row icon-text icon-plus-orange">
                            <p class="btn-title ng-binding">补缺环境</p>
                        </div>
                    </a>
118

119 120 121
                    <apolloentrance apollo-title="'添加集群'" apollo-img-src="'plus-orange'"
                                    apollo-href="'cluster.html?#/appid=' + pageContext.appId"
                                    ng-show="hasCreateClusterPermission"></apolloentrance>
lepdou committed
122

123 124 125 126 127 128
                    <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()"
                         ng-show="!hasCreateClusterPermission">
                        <div class="row icon-text icon-plus-orange">
                            <p class="btn-title">添加集群</p>
                        </div>
                    </div>
lepdou committed
129

130 131 132
                    <apolloentrance apollo-title="'添加Namespace'" apollo-img-src="'plus-orange'"
                                    apollo-href="'namespace.html?#/appid=' + pageContext.appId"
                                    ng-show="hasCreateNamespacePermission"></apolloentrance>
zhangle committed
133

134 135 136 137 138 139
                    <div class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()"
                         ng-show="!hasCreateNamespacePermission">
                        <div class="row icon-text icon-plus-orange">
                            <p class="btn-title">添加Namespace</p>
                        </div>
                    </div>
zhangle committed
140

141

142
                </section>
zhangle committed
143

144 145 146
            </div>
        </div>
    </div>
zhangle committed
147

148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
    <!--具体配置信息-->
    <!--namespaces-->
    <div class="config-item-container hide"
         ng-class="{'view-mode-1': viewMode == 1, 'view-mode-2': viewMode == 2}"
         ng-controller="ConfigNamespaceController">

        <h4 class="text-center" ng-show="viewMode == 2">
            当前操作环境:{{pageContext.env}}, 集群:{{pageContext.clusterName}}
        </h4>
        <div class="alert alert-info alert-dismissible" role="alert"
             ng-show="(!hideTip || !hideTip[pageContext.appId][pageContext.clusterName]) && envMapClusters[pageContext.env]">

            <button class="btn btn-sm btn-default pull-right" style="margin-top: -7px;margin-right:-15px;"
                    ng-click="closeTip(pageContext.clusterName)">不再提示
            </button>

            <!--default cluster tip -->
            <div ng-show="pageContext.clusterName == 'default'">
                <strong>注意: </strong>所有不属于
                <span ng-bind="envMapClusters[pageContext.env]"></span>
                集群的实例会使用default集群(当前页面)的配置,属于
                <span ng-bind="envMapClusters[pageContext.env]"></span>
                的实例会使用对应集群的配置!
zhangle committed
171 172
            </div>

173 174 175 176 177 178
            <!--custom cluster tip-->
            <div ng-show="pageContext.clusterName != 'default'">
                <strong>注意:</strong>属于
                <span ng-bind="pageContext.clusterName"></span>
                集群的实例只会使用
                <span ng-bind="pageContext.clusterName"></span>
179
                集群(当前页面)的配置,只有当对应namespace在当前集群没有发布过配置时,才会使用default集群的配置。
180
            </div>
zhangle committed
181

182 183 184 185
        </div>

        <div class="alert alert-info"
             ng-if="hasNotPublishNamespace">
186
            <p><b>注意:</b> 以下环境/集群有未发布的配置,客户端获取不到未发布的配置,请及时发布。</p>
187 188 189 190 191 192 193
            <p>
                <mark ng-bind="namespacePublishInfo.join(',')"></mark>
            </p>
        </div>

        <apollonspanel ng-repeat="namespace in namespaces"
                       namespace="namespace"
lepdou committed
194 195
                       app-id="pageContext.appId"
                       env="pageContext.env"
196
                       lock-check="lockCheck"
lepdou committed
197
                       cluster="pageContext.clusterName"
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
                       user="currentUser"
                       pre-release-ns="prepareReleaseNamespace"
                       create-item="createItem" edit-item="editItem"
                       pre-delete-item="preDeleteItem"
                       show-text="showText"
                       show-no-modify-permission-dialog="showNoModifyPermissionDialog"
                       pre-create-branch="preCreateBranch"
                       pre-delete-branch="preDeleteBranch">
        </apollonspanel>

        <releasemodal app-id="pageContext.appId"
                      env="pageContext.env"
                      cluster="pageContext.clusterName">
        </releasemodal>

        <itemmodal to-operation-namespace="toOperationNamespace"
                   app-id="pageContext.appId"
                   env="pageContext.env"
                   cluster="pageContext.clusterName"
                   item="item">
        </itemmodal>

        <showtextmodal text="text"></showtextmodal>

        <rollbackmodal app-id="pageContext.appId"
                       env="pageContext.env"
                       cluster="pageContext.clusterName">
        </rollbackmodal>
lepdou committed
226

227 228 229
        <rulesmodal app-id="pageContext.appId"
                    env="pageContext.env"
                    cluster="pageContext.clusterName">
lepdou committed
230

231
        </rulesmodal>
lepdou committed
232 233


234 235 236 237
        <mergeandpublishmodal app-id="pageContext.appId"
                              env="pageContext.env"
                              cluster="pageContext.clusterName">
        </mergeandpublishmodal>
lepdou committed
238

239
        <publishdenymodal env="pageContext.env"></publishdenymodal>
lepdou committed
240

lepdou committed
241 242
        <deletenamespacemodal env="pageContext.env"></deletenamespacemodal>

243 244 245
        <apolloconfirmdialog apollo-dialog-id="'deleteConfirmDialog'" apollo-title="'删除配置'"
                             apollo-detail="'确定要删除配置吗?'"
                             apollo-show-cancel-btn="true" apollo-confirm="deleteItem"></apolloconfirmdialog>
lepdou committed
246

247 248 249
        <apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'发布'"
                             apollo-detail="'您没有发布权限哦~ 请找项目管理员 ' + masterUsers + ' 分配发布权限'"
                             apollo-show-cancel-btn="false"></apolloconfirmdialog>
zhangle committed
250

251 252 253
        <apolloconfirmdialog apollo-dialog-id="'modifyNoPermissionDialog'" apollo-title="'申请配置权限'"
                             apollo-detail="'请找项目管理员 ' + masterUsers + ' 分配编辑或发布权限'"
                             apollo-show-cancel-btn="false"></apolloconfirmdialog>
zhangle committed
254

255 256
        <apolloconfirmdialog apollo-dialog-id="'masterNoPermissionDialog'" apollo-title="'申请配置权限'"
                             apollo-detail="'您不是项目管理员, 只有项目管理员才有添加集群、namespace的权限。
lepdou committed
257
                                 如需管理员权限,请找项目管理员 ' + masterUsers + ' 分配管理员权限'"
258
                             apollo-show-cancel-btn="false"></apolloconfirmdialog>
259

260 261 262
        <apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'编辑受限'"
                             apollo-detail="'当前namespace正在被 ' + lockOwner + ' 编辑,一次发布只能被一个人修改.'"
                             apollo-show-cancel-btn="false"></apolloconfirmdialog>
263

264 265 266
        <apolloconfirmdialog apollo-dialog-id="'rollbackAlertDialog'" apollo-title="'回滚'"
                             apollo-detail="'确定要回滚吗?'"
                             apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog>
lepdou committed
267

268 269 270 271
        <apolloconfirmdialog apollo-dialog-id="'emergencyPublishAlertDialog'" apollo-title="'紧急发布'"
                             apollo-detail="'确定要紧急发布吗?'"
                             apollo-show-cancel-btn="true" apollo-confirm="emergencyPublish"></apolloconfirmdialog>

272 273 274
        <apolloconfirmdialog apollo-dialog-id="'deleteBranchDialog'" apollo-title="'删除灰度'"
                             apollo-detail="'删除灰度会丢失灰度的配置,确定要删除吗?'"
                             apollo-show-cancel-btn="true" apollo-confirm="deleteBranch"></apolloconfirmdialog>
275

276 277
        <apolloconfirmdialog apollo-dialog-id="'updateRuleTips'" apollo-title="'更新灰度规则提示'"
                             apollo-detail="'灰度规则已生效,但发现灰度版本有未发布的配置,这些配置需要手动灰度发布才会生效'"></apolloconfirmdialog>
zhangle committed
278

279 280
        <apolloconfirmdialog apollo-dialog-id="'mergeAndReleaseDenyDialog'" apollo-title="'全量发布'"
                             apollo-detail="'namespace主版本有未发布的配置,请先发布主版本配置'"></apolloconfirmdialog>
zhangle committed
281

282 283 284
        <apolloconfirmdialog apollo-dialog-id="'grayReleaseWithoutRulesTips'" apollo-title="'缺失灰度规则提示'"
                             apollo-detail="'灰度版本还没有配置任何灰度规则,请配置灰度规则'">
        </apolloconfirmdialog>
zhangle committed
285

lepdou committed
286 287 288 289 290 291
        <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForMasterInstanceDialog'"
                             apollo-title="'删除Namespace警告信息'"
                             apollo-detail="'发现有 <b>' + deleteNamespaceContext.namespace.instancesCount +
                             '</b> 个实例正在使用Namespace(' + deleteNamespaceContext.namespace.baseInfo.namespaceName +
                             '),删除Namespace将导致实例获取不到配置。<br>
                             请到 <ins>“实例列表”</ins> 确认实例信息,如已确认删除Namespace将不会导致实例异常,
292
                             请联系Apollo相关负责人删除Namespace'"
lepdou committed
293 294 295 296 297 298 299 300 301
                             apollo-confirm="continueDeleteNamespace">
        </apolloconfirmdialog>

        <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForBranchInstanceDialog'"
                             apollo-title="'删除Namespace警告信息'"
                             apollo-detail="'发现有 <b>' + deleteNamespaceContext.namespace.branch.latestReleaseInstances.total
                             + '</b> 个实例正在使用Namespace(' + deleteNamespaceContext.namespace.baseInfo.namespaceName +
                             ')灰度版本的配置,删除Namespace将导致实例获取不到配置。<br>
                             请到 <ins>“灰度版本” => “实例列表”</ins> 确认实例信息,如已确认删除Namespace将不会导致实例异常,
302
                             请联系Apollo相关负责人删除Namespace'"
lepdou committed
303 304 305 306 307 308 309 310
                             apollo-confirm="continueDeleteNamespace">
        </apolloconfirmdialog>

        <apolloconfirmdialog apollo-dialog-id="'deleteNamespaceDenyForPublicNamespaceDialog'"
                             apollo-title="'删除Namespace失败提示'"
                             apollo-detail="deleteNamespaceContext.detailReason">
        </apolloconfirmdialog>

lepdou committed
311

312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
        <div class="modal fade" id="createBranchTips" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header panel-primary">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title">创建灰度须知</h4>
                    </div>
                    <div class="modal-body">
                        通过创建灰度版本,您可以对某些配置做灰度测试<br>
                        灰度流程为:<br>
                        &nbsp;&nbsp;1.创建灰度版本 <br>
                        &nbsp;&nbsp;2.配置灰度配置项<br>
                        &nbsp;&nbsp;3.配置灰度规则.如果是私有的namespace可以按照客户端的IP进行灰度,如果是公共的namespace则可以同时按AppId和客户端的IP进行灰度<br>
                        &nbsp;&nbsp;4.灰度发布<br>
                        灰度版本最终有两种结果:<b>全量发布和放弃灰度</b><br>
                        <b>全量发布</b>:灰度的配置合到主版本并发布,所有的客户端都会使用合并后的配置<br>
                        <b>放弃灰度</b>:删除灰度版本,所有的客户端都会使用回主版本的配置<br>
                        注意事项:<br>
                        &nbsp;&nbsp;1.如果灰度版本已经有灰度发布过,那么修改灰度规则后,无需再次灰度发布就立即生效<br>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" data-dismiss="modal"
                                ng-click="createBranch()">
                            确定
                        </button>
lepdou committed
339 340
                    </div>
                </div>
lepdou committed
341
            </div>
lepdou committed
342
        </div>
343
    </div>
lepdou committed
344 345
</div>

lepdou committed
346

lepdou committed
347
<div ng-include="'views/common/footer.html'"></div>
348

lepdou committed
349

lepdou committed
350
<!-- jquery.js -->
351
<script src="vendor/jquery.min.js" type="text/javascript"></script>
lepdou committed
352

lepdou committed
353 354
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>

lepdou committed
355
<!--lodash.js-->
lepdou committed
356
<script src="vendor/lodash.min.js" type="text/javascript"></script>
lepdou committed
357

358
<!--nicescroll-->
lepdou committed
359
<script src="vendor/jquery.nicescroll.min.js"></script>
360

361
<!--angular-->
lepdou committed
362 363 364 365
<script src="vendor/angular/angular.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>
366 367

<!-- bootstrap.js -->
lepdou committed
368 369
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap-treeview.min.js" type="text/javascript"></script>
370

371 372
<script src="vendor/diff.min.js" type="text/javascript"></script>

zhangle committed
373 374
<script src="vendor/clipboard.min.js" type="text/javascript"></script>

375 376 377 378 379 380 381 382 383 384
<script src="vendor/ui-ace/ace.js" type="text/javascript"></script>
<script src="vendor/ui-ace/ui-ace.min.js" type="text/javascript"></script>
<script src="vendor/ui-ace/mode-properties.js" type="text/javascript"></script>
<script src="vendor/ui-ace/mode-xml.js" type="text/javascript"></script>
<script src="vendor/ui-ace/mode-yaml.js" type="text/javascript"></script>
<script src="vendor/ui-ace/mode-json.js" type="text/javascript"></script>
<script src="vendor/ui-ace/worker-json.js" type="text/javascript"></script>
<script src="vendor/ui-ace/worker-xml.js" type="text/javascript"></script>


385

lepdou committed
386 387 388 389
<!--valdr-->
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>

390
<!--biz script-->
lepdou committed
391
<script type="application/javascript" src="scripts/app.js"></script>
lepdou committed
392 393

<!--service-->
lepdou committed
394
<script type="application/javascript" src="scripts/services/AppService.js"></script>
lepdou committed
395
<script type="application/javascript" src="scripts/services/EnvService.js"></script>
lepdou committed
396
<script type="application/javascript" src="scripts/services/UserService.js"></script>
lepdou committed
397
<script type="application/javascript" src="scripts/services/ConfigService.js"></script>
398
<script type="application/javascript" src="scripts/services/ReleaseService.js"></script>
lepdou committed
399
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
400
<script type="application/javascript" src="scripts/services/NamespaceService.js"></script>
401
<script type="application/javascript" src="scripts/services/CommitService.js"></script>
402
<script type="application/javascript" src="scripts/services/CommonService.js"></script>
403
<script type="application/javascript" src="scripts/services/NamespaceLockService.js"></script>
zhangle committed
404
<script type="application/javascript" src="scripts/services/InstanceService.js"></script>
405
<script type="application/javascript" src="scripts/services/FavoriteService.js"></script>
lepdou committed
406 407
<script type="application/javascript" src="scripts/services/NamespaceBranchService.js"></script>
<script type="application/javascript" src="scripts/services/EventManager.js"></script>
lepdou committed
408 409


lepdou committed
410
<script type="application/javascript" src="scripts/AppUtils.js"></script>
lepdou committed
411

lepdou committed
412
<!--directive-->
lepdou committed
413 414
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/directive/namespace-panel-directive.js"></script>
415
<script type="application/javascript" src="scripts/directive/diff-directive.js"></script>
lepdou committed
416 417 418 419 420 421
<script type="application/javascript" src="scripts/directive/release-modal-directive.js"></script>
<script type="application/javascript" src="scripts/directive/item-modal-directive.js"></script>
<script type="application/javascript" src="scripts/directive/show-text-modal-directive.js"></script>
<script type="application/javascript" src="scripts/directive/rollback-modal-directive.js"></script>
<script type="application/javascript" src="scripts/directive/gray-release-rules-modal-directive.js"></script>
<script type="application/javascript" src="scripts/directive/merge-and-publish-modal-directive.js"></script>
lepdou committed
422
<script type="application/javascript" src="scripts/directive/publish-deny-modal-directive.js"></script>
lepdou committed
423
<script type="application/javascript" src="scripts/directive/delete-namespace-modal-directive.js"></script>
lepdou committed
424

lepdou committed
425
<!--controller-->
426 427
<script type="application/javascript" src="scripts/controller/config/ConfigNamespaceController.js"></script>
<script type="application/javascript" src="scripts/controller/config/ConfigBaseInfoController.js"></script>
428

lepdou committed
429
<script type="application/javascript" src="scripts/PageCommon.js"></script>
430

lepdou committed
431
<script src="scripts/valdr.js" type="text/javascript"></script>
432 433
</body>
</html>