config.html 19.2 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

lepdou committed
19
<div id="config-info" class="container-fluid apollo-container app">
20
    <!--具体配置信息-->
lepdou committed
21
    <div class="config-info-container row">
22

23 24 25 26 27 28 29 30 31 32
        <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>

lepdou committed
33
            <div class="J_appFound hidden col-md-2 col-xs-2 col-sm-2" ng-show="!notFoundApp">
34 35 36 37 38 39 40 41 42 43 44 45
                <section class="panel">
                    <header class="panel-heading">
                        <img src="img/env.png" class="i-20">&nbsp;环境列表
                        <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>


46 47 48
                <!--app info-->
                <section class="panel">
                    <header class="panel-heading">
49 50 51 52 53 54 55 56 57 58
                        <img src="img/info.png" class="i-25-20"/> 项目信息
                            <span class="pull-right cursor-pointer">
                                <a ng-if="!favoriteId" ng-click="addFavorite()"
                                   data-tooltip="tooltip" data-placement="bottom" title="收藏">
                                    <img src="img/unlike.png" class="i-20"/>
                                </a>
                                <a ng-if="favoriteId" ng-click="deleteFavorite()"
                                   data-tooltip="tooltip" data-placement="bottom" title="取消收藏">
                                    <img src="img/like.png" class="i-20"/>
                                </a>
lepdou committed
59
                            </span>
60 61 62 63 64 65 66 67 68 69
                    </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
70 71 72
                                <td>
                                    <small ng-bind="appBaseInfo.name"></small>
                                </td>
73 74 75 76 77 78 79 80 81 82
                            </tr>
                            <tr>
                                <th>部门:</th>
                                <td ng-bind="appBaseInfo.orgInfo"></td>
                            </tr>
                            <tr>
                                <th>负责人:</th>
                                <td ng-bind="appBaseInfo.ownerName"></td>
                            </tr>
                            <tr>
lepdou committed
83 84 85 86
                                <th>Email:</th>
                                <td>
                                    <small ng-bind="appBaseInfo.ownerEmail"></small>
                                </td>
87 88 89 90
                            </tr>
                            <tr ng-show="missEnvs.length > 0">
                                <th>缺失的环境:</th>
                                <td>
lepdou committed
91 92
                                <span ng-repeat="env in missEnvs" ng-bind="env">
                                </span>
93 94 95 96
                                </td>
                            </tr>
                            </tbody>
                        </table>
lepdou committed
97

98 99 100 101 102 103 104 105
                    </div>
                </section>

                <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>
lepdou committed
106

107 108 109
                <apolloentrance apollo-title="'添加集群'" apollo-img-src="'plus-orange'"
                                apollo-href="'cluster.html?#/appid=' + pageContext.appId"
                                ng-show="hasCreateClusterPermission"></apolloentrance>
zhangle committed
110 111 112 113 114 115
            <span 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>
            </span>
lepdou committed
116

117 118 119
                <apolloentrance apollo-title="'添加Namespace'" apollo-img-src="'plus-orange'"
                                apollo-href="'namespace.html?#/appid=' + pageContext.appId"
                                ng-show="hasCreateNamespacePermission"></apolloentrance>
zhangle committed
120 121 122 123 124 125
            <span 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>
            </span>
lepdou committed
126

127 128 129 130
                <apolloentrance apollo-title="'项目权限'" apollo-img-src="'user-manage'"
                                apollo-href="'/app/role.html?#/appid=' + pageContext.appId"
                                ng-show="hasAssignUserPermission"></apolloentrance>
                </section>
131 132


133
            </div>
134
        </div>
lepdou committed
135

lepdou committed
136

137
        <!--namespaces-->
lepdou committed
138 139
        <div class="col-md-10 col-xs-10 col-sm-10 config-item-container hide"
             ng-controller="ConfigNamespaceController">
zhangle committed
140 141 142 143 144 145 146 147 148 149 150
            <div class="alert alert-warning 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>
zhangle committed
151
                    集群的实例会使用default集群(当前页面)的配置,属于
zhangle committed
152
                    <span ng-bind="envMapClusters[pageContext.env]"></span>
zhangle committed
153
                    的实例会使用对应集群的配置!
zhangle committed
154 155 156 157 158 159 160 161 162 163 164 165 166 167
                </div>

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

            </div>


lepdou committed
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
            <apollonspanel ng-repeat="namespace in namespaces"
                           namespace="namespace"
                           app-id="pageContext.appId"
                           env="pageContext.env"
                           lock-check="lockCheck"
                           cluster="pageContext.clusterName"
                           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>

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

            </rulesmodal>


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

lepdou committed
215

lepdou committed
216
            <apolloconfirmdialog apollo-dialog-id="'deleteConfirmDialog'" apollo-title="'删除配置'"
lepdou committed
217 218
                                 apollo-detail="'确定要删除配置吗?'"
                                 apollo-show-cancel-btn="true" apollo-confirm="deleteItem"></apolloconfirmdialog>
lepdou committed
219 220

            <apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'发布'"
zhangle committed
221 222 223 224 225 226 227 228
                                 apollo-detail="'您没有发布权限哦~ 请找项目管理员 ' + masterUsers + ' 分配发布权限'"
                                 apollo-show-cancel-btn="false"></apolloconfirmdialog>

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

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

233
            <apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'编辑受限'"
lepdou committed
234
                                 apollo-detail="'当前namespace正在被 ' + lockOwner + ' 编辑,一次发布只能被一个人修改.'"
235 236 237
                                 apollo-show-cancel-btn="false"></apolloconfirmdialog>

            <apolloconfirmdialog apollo-dialog-id="'releaseDenyDialog'" apollo-title="'发布受限'"
lepdou committed
238
                                 apollo-detail="'您不能发布哟~ ' + pageContext.env + '环境配置的编辑和发布必须为不同的人,请找另一个具有当前namespace发布权的人操作发布~'"
239
                                 apollo-show-cancel-btn="false"></apolloconfirmdialog>
lepdou committed
240

lepdou committed
241 242 243
            <apolloconfirmdialog apollo-dialog-id="'rollbackAlertDialog'" apollo-title="'回滚'"
                                 apollo-detail="'确定要回滚吗?'"
                                 apollo-show-cancel-btn="true" apollo-confirm="rollback"></apolloconfirmdialog>
lepdou committed
244

lepdou committed
245 246 247
            <apolloconfirmdialog apollo-dialog-id="'deleteBranchDialog'" apollo-title="'删除灰度'"
                                 apollo-detail="'删除灰度会丢失灰度的配置,确定要删除吗?'"
                                 apollo-show-cancel-btn="true" apollo-confirm="deleteBranch"></apolloconfirmdialog>
248

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

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

lepdou committed
255 256 257
            <apolloconfirmdialog apollo-dialog-id="'grayReleaseWithoutRulesTips'" apollo-title="'缺失灰度规则提示'"
                                 apollo-detail="'灰度版本还没有配置任何灰度规则,请配置灰度规则'">
            </apolloconfirmdialog>
zhangle committed
258

lepdou committed
259

lepdou committed
260
            <div class="modal fade" id="createBranchTips" tabindex="-1" role="dialog">
261 262 263
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header panel-primary">
zhangle committed
264
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
265
                                    aria-hidden="true">&times;</span></button>
lepdou committed
266
                            <h4 class="modal-title">创建灰度须知</h4>
lepdou committed
267 268
                        </div>
                        <div class="modal-body">
lepdou committed
269 270 271 272 273 274 275 276 277 278 279
                            通过创建灰度版本,您可以对某些配置做灰度测试<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>
lepdou committed
280 281 282
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
lepdou committed
283 284 285
                            <button type="button" class="btn btn-primary" data-dismiss="modal"
                                    ng-click="createBranch()">
                                确定
lepdou committed
286 287 288 289
                            </button>
                        </div>
                    </div>
                </div>
lepdou committed
290
            </div>
lepdou committed
291
        </div>
292
    </div>
lepdou committed
293 294
</div>

lepdou committed
295

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

lepdou committed
298

lepdou committed
299
<!-- jquery.js -->
300
<script src="vendor/jquery.min.js" type="text/javascript"></script>
lepdou committed
301

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

lepdou committed
304
<!--lodash.js-->
lepdou committed
305
<script src="vendor/lodash.min.js" type="text/javascript"></script>
lepdou committed
306

307
<!--nicescroll-->
lepdou committed
308
<script src="vendor/jquery.nicescroll.min.js"></script>
309

310
<!--angular-->
lepdou committed
311 312 313 314
<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>
315 316

<!-- bootstrap.js -->
lepdou committed
317 318
<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>
319

320 321
<script src="vendor/diff.min.js" type="text/javascript"></script>

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

324

lepdou committed
325 326 327 328
<!--valdr-->
<script src="vendor/valdr/valdr.min.js" type="text/javascript"></script>
<script src="vendor/valdr/valdr-message.min.js" type="text/javascript"></script>

329
<!--biz script-->
lepdou committed
330
<script type="application/javascript" src="scripts/app.js"></script>
lepdou committed
331 332

<!--service-->
lepdou committed
333
<script type="application/javascript" src="scripts/services/AppService.js"></script>
lepdou committed
334
<script type="application/javascript" src="scripts/services/EnvService.js"></script>
lepdou committed
335
<script type="application/javascript" src="scripts/services/UserService.js"></script>
lepdou committed
336
<script type="application/javascript" src="scripts/services/ConfigService.js"></script>
337
<script type="application/javascript" src="scripts/services/ReleaseService.js"></script>
lepdou committed
338
<script type="application/javascript" src="scripts/services/PermissionService.js"></script>
339
<script type="application/javascript" src="scripts/services/CommitService.js"></script>
340
<script type="application/javascript" src="scripts/services/NamespaceLockService.js"></script>
zhangle committed
341
<script type="application/javascript" src="scripts/services/InstanceService.js"></script>
342
<script type="application/javascript" src="scripts/services/FavoriteService.js"></script>
lepdou committed
343 344
<script type="application/javascript" src="scripts/services/NamespaceBranchService.js"></script>
<script type="application/javascript" src="scripts/services/EventManager.js"></script>
lepdou committed
345 346


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

lepdou committed
349
<!--directive-->
lepdou committed
350 351
<script type="application/javascript" src="scripts/directive/directive.js"></script>
<script type="application/javascript" src="scripts/directive/namespace-panel-directive.js"></script>
352
<script type="application/javascript" src="scripts/directive/diff-directive.js"></script>
lepdou committed
353 354 355 356 357 358
<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
359

lepdou committed
360
<!--controller-->
361 362
<script type="application/javascript" src="scripts/controller/config/ConfigNamespaceController.js"></script>
<script type="application/javascript" src="scripts/controller/config/ConfigBaseInfoController.js"></script>
363

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

lepdou committed
366
<script src="scripts/valdr.js" type="text/javascript"></script>
367 368
</body>
</html>