namespace-panel.html 63.3 KB
Newer Older
L
abtest  
lepdou 已提交
1 2 3 4
<section class="panel namespace-panel">

    <!--public or link label-->
    <header class="row namespace-attribute-panel">
L
update  
lepdou 已提交
5
        <div class="text-center namespace-attribute-public">
L
abtest  
lepdou 已提交
6 7 8
            <span data-tooltip="tooltip" data-placement="bottom"
                  title="私有namespace({{namespace.baseInfo.namespaceName}})的配置只能被AppId为{{appId}}的客户端读取到"
                  ng-show="!namespace.isPublic">私有</span>
L
lepdou 已提交
9

L
abtest  
lepdou 已提交
10 11 12
            <span data-tooltip="tooltip" data-placement="top"
                  title="namespace({{namespace.baseInfo.namespaceName}})的配置能被任何客户端读取到"
                  ng-show="namespace.isPublic && namespace.parentAppId == namespace.baseInfo.appId">公共</span>
L
lepdou 已提交
13

L
abtest  
lepdou 已提交
14 15 16 17
            <span data-tooltip="tooltip" data-placement="top"
                  title="namespace({{namespace.baseInfo.namespaceName}})的配置将会覆盖公共namespace的配置, 且合并之后的配置只能被AppId为{{appId}}的客户端读取到"
                  ng-show="namespace.isPublic && namespace.isLinkedNamespace"
                  ng-click="goToParentAppConfigPage(namespace)">关联</span>
L
lepdou 已提交
18 19 20
        </div>
    </header>

L
abtest  
lepdou 已提交
21 22
    <!--branch nav-->
    <header class="panel-heading second-panel-heading" ng-show="namespace.hasBranch">
L
lepdou 已提交
23
        <div class="row">
Z
update  
zhangle 已提交
24
            <div class="col-md-8 pull-left">
L
lepdou 已提交
25
                <ul class="nav nav-tabs">
L
abtest  
lepdou 已提交
26 27 28 29 30
                    <li role="presentation">
                        <a ng-class="{'node_active': namespace.currentOperateBranch == 'master'}"
                           ng-click="switchBranch('master')">
                            <img src="img/branch.png">
                            主版本
L
lepdou 已提交
31 32
                        </a>
                    </li>
L
abtest  
lepdou 已提交
33 34 35 36 37
                    <li role="presentation">
                        <a ng-class="{'node_active': namespace.currentOperateBranch != 'master'}"
                           ng-click="switchBranch(namespace.branchName)">
                            <img src="img/branch.png">
                            灰度版本
Z
zhangle 已提交
38 39
                        </a>
                    </li>
L
abtest  
lepdou 已提交
40

L
lepdou 已提交
41 42
                </ul>
            </div>
L
abtest  
lepdou 已提交
43 44
        </div>
    </header>
Z
zhangle 已提交
45

L
abtest  
lepdou 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    <!--master panel body-->
    <section class="master-panel-body"
             ng-if="namespace.hasBranch && namespace.currentOperateBranch == 'master' || !namespace.hasBranch">
        <!--main header-->
        <header class="panel-heading">
            <div class="row">
                <div class="col-md-6 header-namespace">
                    <b class="namespace-name" ng-bind="namespace.viewName"
                       data-tooltip="tooltip" data-placement="bottom" title="{{namespace.comment}}"></b>
                    <span class="label label-info no-radius namespace-label" ng-bind="namespace.format"></span>
                <span class="label label-warning no-radius namespace-label" ng-show="namespace.itemModifiedCnt > 0">有修改
                    <span class="badge label badge-white namespace-label" ng-bind="namespace.itemModifiedCnt"></span>
                </span>
                <span class="label label-primary no-radius namespace-label"
                      ng-show="namespace.lockOwner">当前修改者:{{namespace.lockOwner}}</span>
                </div>
L
lepdou 已提交
62

L
abtest  
lepdou 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
                <div class="col-md-6 text-right header-buttons">
                    <button type="button" class="btn btn-success btn-sm"
                            data-tooltip="tooltip" data-placement="bottom" title="发布配置"
                            ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
                            ng-disabled="namespace.isTextEditing"
                            ng-click="publish(namespace)">
                        <img src="img/release.png">
                        发布
                    </button>
                    <button type="button" class="btn btn-default btn-sm"
                            data-tooltip="tooltip" data-placement="bottom" title="回滚已发布配置"
                            ng-show="namespace.hasReleasePermission"
                            ng-click="rollback(namespace)">
                        <img src="img/rollback.png">
                        回滚
                    </button>
                    <a type="button" class="btn btn-default btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="查看发布历史"
                       href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}">
                        <img src="img/release-history.png">
                        发布历史
                    </a>
                    <a type="button" class="btn btn-default btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="配置修改、发布权限"
                       href="/namespace/role.html?#/appid={{appId}}&namespaceName={{namespace.baseInfo.namespaceName}}"
                       ng-show="hasAssignUserPermission">
                        <img src="img/assign.png">
                        授权
                    </a>
Z
zhangle 已提交
92

L
abtest  
lepdou 已提交
93 94 95 96 97 98 99 100 101 102 103 104 105 106
                    <a type="button" class="btn btn-default btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="创建测试版本"
                       ng-show="!namespace.hasBranch && namespace.isPropertiesFormat && namespace.hasModifyPermission"
                       ng-click="preCreateBranch(namespace)">
                        <img src="img/test.png">
                        创建灰度
                    </a>
                    <a type="button" class="btn btn-default btn-sm J_tableview_btn"
                       data-tooltip="tooltip" data-placement="bottom" title="您没有任何配置权限,请申请"
                       ng-click="showNoModifyPermissionDialog()"
                       ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
                        申请配置权限
                    </a>
                </div>
L
lepdou 已提交
107
            </div>
L
abtest  
lepdou 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
        </header>

        <!--second header-->
        <header class="panel-heading second-panel-heading">
            <div class="row">
                <div class="col-md-8 pull-left">
                    <!--master branch nav tabs-->
                    <ul class="nav nav-tabs">
                        <li role="presentation" ng-click="switchView(namespace, 'table')"
                            ng-show="namespace.isPropertiesFormat">
                            <a ng-class="{node_active:namespace.viewType == 'table'}">
                                <img src="img/table.png">
                                表格
                            </a>
                        </li>
                        <li role="presentation"
                            ng-click="switchView(namespace, 'text')">
                            <a ng-class="{node_active:namespace.viewType == 'text'}">
                                <img src="img/text.png">
                                文本
                            </a>
                        </li>
                        <li role="presentation" ng-click="switchView(namespace, 'history')">
                            <a ng-class="{node_active:namespace.viewType == 'history'}">
                                <img src="img/change.png">
                                更改历史
                            </a>
                        </li>
                        <li role="presentation" ng-click="switchView(namespace, 'instance')">
                            <a ng-class="{node_active:namespace.viewType == 'instance'}">
                                <img src="img/machine.png">
                                实例列表
                                <span class="badge badge-grey" ng-bind="namespace.instancesCount"></span>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="col-md-4 text-right">
                    <a class="clipboard"
                       data-clipboard-text="{{namespace.text}}"
                       data-tooltip="tooltip" data-placement="bottom" title="复制文本"
                       ng-show="!namespace.isTextEditing && namespace.viewType == 'text' && namespace.hasModifyPermission">
                        <img src="img/copy.png" class="ns_btn">
                    </a>
                    &nbsp;
                    <a data-tooltip="tooltip" data-placement="bottom" title="取消修改"
                       ng-show="namespace.isTextEditing && namespace.viewType == 'text'"
                       ng-click="toggleTextEditStatus(namespace)">
                        <img src="img/cancel.png" class="ns_btn">
                    </a>
                    <a data-tooltip="tooltip" data-placement="bottom" title="修改配置"
                       ng-show="!namespace.isTextEditing && namespace.viewType == 'text' && namespace.hasModifyPermission"
                       ng-click="toggleTextEditStatus(namespace)">
                        <img src="img/edit.png" class="ns_btn">
                    </a>
L
lepdou 已提交
163

L
abtest  
lepdou 已提交
164 165 166 167 168 169 170
                    &nbsp;
                    <a data-tooltip="tooltip" data-placement="bottom" title="提交修改"
                       data-toggle="modal" data-target="#commitModal"
                       ng-show="namespace.isTextEditing && namespace.viewType == 'text'"
                       ng-click="modifyByText(namespace)">
                        <img src="img/submit.png" class="ns_btn">
                    </a>
Z
zhangle 已提交
171

L
abtest  
lepdou 已提交
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
                    <button type="button" class="btn btn-default btn-sm"
                            data-tooltip="tooltip" data-placement="bottom" title="按Key过滤配置"
                            ng-show="namespace.viewType == 'table' && namespace.currentOperateBranch == 'master'"
                            ng-click="toggleItemSearchInput(namespace)">
                        <span class="glyphicon glyphicon-filter"></span>
                        过滤配置
                    </button>

                    <button type="button" class="btn btn-default btn-sm J_tableview_btn"
                            data-tooltip="tooltip" data-placement="bottom" title="同步各环境间配置"
                            ng-click="goToSyncPage(namespace)"
                            ng-show="namespace.viewType == 'table' && namespace.currentOperateBranch == 'master'
                             && namespace.hasModifyPermission && namespace.isPropertiesFormat">
                        <img src="img/sync.png">
                        同步配置
                    </button>

                    <button type="button" class="btn btn-primary btn-sm"
                            ng-show="namespace.viewType == 'table' && namespace.currentOperateBranch == 'master'
                             && namespace.hasModifyPermission"
                            ng-click="createItem(namespace)">
                        <img src="img/plus.png">
                        新增配置
                    </button>
L
lepdou 已提交
196
                </div>
L
abtest  
lepdou 已提交
197 198
            </div>
        </header>
L
lepdou 已提交
199

L
abtest  
lepdou 已提交
200 201 202
        <section>
            <!--table view-->
            <div class="namespace-view-table" ng-show="namespace.viewType == 'table'">
L
lepdou 已提交
203

L
abtest  
lepdou 已提交
204 205 206 207 208 209
                <div class="col-md-8 col-lg-offset-2 search-input" ng-show="namespace.showSearchInput">
                    <input type="text" class="form-control" placeholder="输入key过滤"
                           ng-model="namespace.searchKey"
                           ng-change="searchItems(namespace)">
                </div>
                <table class="table table-bordered table-striped table-hover">
L
lepdou 已提交
210 211
                    <thead>
                    <tr>
L
abtest  
lepdou 已提交
212 213 214 215 216 217
                        <th>发布状态</th>
                        <th class="hover" title="排序"
                            ng-click="col='item.key';desc=!desc;">
                            Key&nbsp;
                            <span class="glyphicon glyphicon-sort"></span>

L
lepdou 已提交
218 219
                        </th>
                        <th>
L
abtest  
lepdou 已提交
220
                            Value
L
lepdou 已提交
221 222
                        </th>
                        <th>
L
abtest  
lepdou 已提交
223
                            备注
L
lepdou 已提交
224
                        </th>
L
abtest  
lepdou 已提交
225 226 227 228 229 230 231 232 233 234
                        <th class="hover" title="排序"
                            ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
                            最后修改人
                            <span class="glyphicon glyphicon-sort"></span>

                        </th>
                        <th class="hover" title="排序"
                            ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
                            最后修改时间
                            <span class="glyphicon glyphicon-sort"></span>
L
lepdou 已提交
235
                        </th>
L
abtest  
lepdou 已提交
236

L
lepdou 已提交
237
                        <th>
L
abtest  
lepdou 已提交
238
                            操作
L
lepdou 已提交
239 240 241 242
                        </th>
                    </tr>
                    </thead>
                    <tbody>
L
abtest  
lepdou 已提交
243 244 245 246 247 248 249 250 251
                    <tr ng-repeat="config in namespace.viewItems |orderBy:col:desc"
                        ng-if="config.item.key">
                        <td width="8%" class="text-center">
                            <span class="label label-warning no-radius cursor-pointer" ng-if="config.isModified"
                                  data-tooltip="tooltip" data-placement="bottom" title="点击查看已发布的值"
                                  ng-click="showText(config.oldValue?config.oldValue:'新增的配置,无发布的值')">未发布</span>
                            <span class="label label-default-light no-radius"
                                  data-tooltip="tooltip" data-placement="bottom" title="已生效的配置"
                                  ng-if="!config.isModified">已发布</span>
L
lepdou 已提交
252
                        </td>
L
abtest  
lepdou 已提交
253 254 255 256 257 258 259 260 261 262 263 264 265
                        <td width="15%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.key)">
                            <span ng-bind="config.item.key | limitTo: 250"></span>
                            <span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
                            <span class="label label-default cursor-pointer" ng-if="config.hasBranchValue"
                                  data-tooltip="tooltip" data-placement="bottom" title="该配置有灰度配置,点击查看灰度的值"
                                  ng-click="namespace.currentOperateBranch=namespace.branchName;namespace.branch.viewType='table'"></span>
                            <span class="label label-success" ng-if="config.isModified && !config.oldValue"
                                  data-tooltip="tooltip" data-placement="bottom" title="新增的配置"></span>
                            <span class="label label-info"
                                  ng-if="config.isModified && config.oldValue && !config.isDeleted"
                                  data-tooltip="tooltip" data-placement="bottom" title="修改的配置"></span>
                            <span class="label label-danger" ng-if="config.isDeleted"
                                  data-tooltip="tooltip" data-placement="bottom" title="删除的配置"></span>
L
lepdou 已提交
266
                        </td>
L
abtest  
lepdou 已提交
267 268 269
                        <td width="33%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.value)">
                            <span ng-bind="config.item.value | limitTo: 250"></span>
                            <span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
L
lepdou 已提交
270
                        </td>
L
abtest  
lepdou 已提交
271 272 273
                        <td width="15%" title="{{config.item.comment}}">
                            <span ng-bind="config.item.comment | limitTo: 250"></span>
                            <span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
L
lepdou 已提交
274
                        </td>
L
abtest  
lepdou 已提交
275
                        <td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
L
lepdou 已提交
276
                        </td>
L
abtest  
lepdou 已提交
277 278
                        <td width="11%"
                            ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
L
lepdou 已提交
279
                        </td>
L
abtest  
lepdou 已提交
280 281 282 283 284 285 286 287 288

                        <td width="8%" class="text-center" ng-if="!config.isDeleted">
                            <img src="img/edit.png" data-tooltip="tooltip" data-placement="bottom" title="修改"
                                 ng-click="editItem(namespace, config.item)"
                                 ng-show="namespace.hasModifyPermission">
                            <img style="margin-left: 5px;" src="img/cancel.png"
                                 data-tooltip="tooltip" data-placement="bottom" title="删除"
                                 ng-click="preDeleteItem(namespace, config.item.id)"
                                 ng-show="namespace.hasModifyPermission">
L
lepdou 已提交
289
                        </td>
L
abtest  
lepdou 已提交
290
                        <td width="6%" class="text-center" ng-if="config.isDeleted">
L
lepdou 已提交
291
                        </td>
L
abtest  
lepdou 已提交
292

L
lepdou 已提交
293 294 295
                    </tr>
                    </tbody>
                </table>
L
abtest  
lepdou 已提交
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 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 339 340 341 342 343 344 345
            </div>
            <!--text view-->
            <!--只读模式下的文本内容,不替换换行符-->
        <textarea class="form-control no-radius" rows="{{namespace.itemCnt}}"
                  ng-show="namespace.viewType == 'text' && !namespace.isTextEditing"
                  ng-disabled="!namespace.isTextEditing"
                  ng-bind="namespace.text">
            </textarea>
            <!--编辑状态下的文本内容,会过滤掉换行符-->
        <textarea class="form-control" rows="{{namespace.itemCnt}}" style="border-radius: 0px"
                  ng-show="namespace.viewType == 'text' && namespace.isTextEditing"
                  ng-disabled="!namespace.isTextEditing" ng-model="namespace.editText">
            </textarea>
            <!--history view-->
            <div class="J_historyview history-view" ng-show="namespace.viewType == 'history'">
                <div class="media" ng-repeat="commits in namespace.commits">
                    <div class="media-body">
                        <div class="row">
                            <div class="col-md-6"><h3 class="media-heading" ng-bind="commits.dataChangeCreatedBy"></h3>
                            </div>
                            <div class="col-md-6 text-right"><h5 class="media-heading"
                                                                 ng-bind="commits.dataChangeCreatedTime  | date: 'yyyy-MM-dd HH:mm:ss'"></h5>
                            </div>
                        </div>


                        <!--properties format-->
                        <table class="table table-bordered table-striped text-center table-hover"
                               style="margin-top: 5px;"
                               ng-if="namespace.isPropertiesFormat">
                            <thead>
                            <tr>
                                <th>
                                    Type
                                </th>
                                <th>
                                    Key
                                </th>
                                <th>
                                    Old Value
                                </th>
                                <th>
                                    New Value
                                </th>
                                <th>
                                    Comment
                                </th>
                            </tr>
                            </thead>
                            <tbody>
L
lepdou 已提交
346

L
abtest  
lepdou 已提交
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418
                            <!--兼容老数据,不显示item类型为空行和注释的item-->
                            <tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
                                <td width="2%">
                                    新增
                                </td>
                                <td width="20%" title="{{item.key}}">

                                    <span ng-bind="item.key | limitTo: 250"></span>
                                    <span ng-bind="item.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%">
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.value}}"
                                    ng-click="showText(item.value)">
                                    <span ng-bind="item.value | limitTo: 250"></span>
                                    <span ng-bind="item.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="18%" title="{{item.comment}}">
                                    <span ng-bind="item.comment | limitTo: 250"></span>
                                    <span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            <tr ng-repeat="item in commits.changeSets.updateItems">
                                <td width="2%">
                                    更新
                                </td>
                                <td width="20%" title="{{item.newItem.key}}">
                                    <span ng-bind="item.newItem.key | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.oldItem.value}}"
                                    ng-click="showText(item.oldItem.value)">
                                    <span ng-bind="item.oldItem.value | limitTo: 250"></span>
                                    <span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.newItem.value}}"
                                    ng-click="showText(item.newItem.value)">
                                    <span ng-bind="item.newItem.value | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="18%" title="{{item.newItem.comment}}">
                                    <span ng-bind="item.newItem.comment | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            <tr ng-repeat="item in commits.changeSets.deleteItems"
                                ng-show="item.key || item.comment">
                                <td width="2%">
                                    删除
                                </td>
                                <td width="20%" title="{{item.key}}">
                                    <span ng-bind="item.key | limitTo: 250"></span>
                                    <span ng-bind="item.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%" title="{{item.value}}">
                                    <span ng-bind="item.value | limitTo: 250"></span>
                                    <span ng-bind="item.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="30%">
                                </td>
                                <td width="18%" title="{{item.comment}}">
                                    <span ng-bind="item.comment | limitTo: 250"></span>
                                    <span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <!--not properties format-->
                        <div ng-if="!namespace.isPropertiesFormat">
                            <div ng-repeat="item in commits.changeSets.createItems">
                    <textarea class="form-control no-radius" rows="20"
L
lepdou 已提交
419 420
                              ng-disabled="true" ng-bind="item.value">
                                </textarea>
L
abtest  
lepdou 已提交
421
                            </div>
L
lepdou 已提交
422

L
abtest  
lepdou 已提交
423 424
                            <div ng-repeat="item in commits.changeSets.updateItems">
                    <textarea class="form-control no-radius" rows="20"
L
lepdou 已提交
425 426
                              ng-disabled="true" ng-bind="item.newItem.value">
                                </textarea>
L
abtest  
lepdou 已提交
427 428
                            </div>
                        </div>
L
lepdou 已提交
429 430


L
abtest  
lepdou 已提交
431 432 433 434 435 436 437 438
                    </div>
                    <hr>
                </div>
                <div class="text-center">
                    <button type="button" class="btn btn-default" ng-show="!namespace.hasLoadAllCommit"
                            ng-click="loadCommitHistory(namespace)">加载更多
                        <span class="glyphicon glyphicon-menu-down"></span></button>
                </div>
L
lepdou 已提交
439
            </div>
L
abtest  
lepdou 已提交
440 441 442 443 444 445 446 447 448 449 450 451 452 453
            <!--instance view-->
            <div class="panel panel-default instance-view" ng-show="namespace.viewType == 'instance'">
                <div class="panel-heading">
                    <div class="row text-right" style="padding-right: 15px;">

                        <div class="btn-group btn-group-sm" role="group">
                            <button type="button" class="btn btn-default"
                                    ng-class="{'btn-primary':namespace.instanceViewType == 'latest_release'}"
                                    ng-click="switchInstanceViewType(namespace, 'latest_release')"> 使用最新配置的实例
                                <span class="badge" ng-bind="namespace.latestReleaseInstances.total"></span>
                            </button>
                            <button type="button" class="btn btn-default"
                                    ng-class="{'btn-primary':namespace.instanceViewType == 'not_latest_release'}"
                                    ng-click="switchInstanceViewType(namespace, 'not_latest_release')">使用非最新配置的实例
Z
zhangle 已提交
454 455
                        <span class="badge"
                              ng-bind="namespace.instancesCount - namespace.latestReleaseInstances.total"></span>
L
abtest  
lepdou 已提交
456 457 458 459 460 461 462 463 464 465 466 467 468
                            </button>
                            <button type="button" class="btn btn-default"
                                    ng-class="{'btn-primary':namespace.instanceViewType == 'all'}"
                                    ng-click="switchInstanceViewType(namespace, 'all')">所有实例
                                <span class="badge" ng-bind="namespace.instancesCount"></span>
                            </button>
                        </div>
                        <button class="btn btn-default btn-sm"
                                data-tooltip="tooltip" data-placement="bottom" title="刷新列表"
                                ng-click="refreshInstancesInfo(namespace)">
                            <img src="../../img/refresh.png"/>
                        </button>
                    </div>
Z
zhangle 已提交
469 470
                </div>

L
abtest  
lepdou 已提交
471 472
                <!--latest release instances-->
                <div class="panel-body" ng-show="namespace.instanceViewType == 'latest_release'">
Z
zhangle 已提交
473

L
abtest  
lepdou 已提交
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512
                    <div class="panel-default" ng-if="namespace.latestReleaseInstances.total > 0">
                        <div class="panel-heading">
                            <a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置"
                               href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.latestRelease.id}}">
                                {{namespace.latestRelease.name}}
                            </a>
                        </div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <td>App ID</td>
                                <td>Cluster Name</td>
                                <td>Data Center</td>
                                <td>IP</td>
                                <td>配置获取时间</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="instance in namespace.latestReleaseInstances.content">
                                <td width="20%" ng-bind="instance.appId"></td>
                                <td width="20%" ng-bind="instance.clusterName"></td>
                                <td width="20%" ng-bind="instance.dataCenter"></td>
                                <td width="20%" ng-bind="instance.ip"></td>
                                <td width="20%">{{instance.configs && instance.configs.length ?
                                    (instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="row text-center"
                             ng-show="namespace.latestReleaseInstances.content.length < namespace.latestReleaseInstances.total">
                            <button class="btn btn-default" ng-click="loadInstanceInfo(namespace)">加载更多</button>

                        </div>
                    </div>

                    <div class="text-center" ng-if="namespace.latestReleaseInstances.total == 0">
                        无实例信息
                    </div>
Z
zhangle 已提交
513 514
                </div>

L
abtest  
lepdou 已提交
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
                <!--not latest release instances-->
                <div class="panel-body" ng-show="namespace.instanceViewType == 'not_latest_release'">
                    <div class="panel-default"
                         ng-if="namespace.instancesCount - namespace.latestReleaseInstances.total > 0"
                         ng-repeat="release in namespace.notLatestReleases">
                        <div class="panel-heading">
                            <a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置"
                               href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{cluster}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{release.id}}">
                                {{release.name}}
                            </a>

                        </div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <td>App ID</td>
                                <td>Cluster Name</td>
                                <td>Data Center</td>
                                <td>IP</td>
                                <td>配置获取时间</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="instance in namespace.notLatestReleaseInstances[release.id]">
                                <td width="20%" ng-bind="instance.appId"></td>
                                <td width="20%" ng-bind="instance.clusterName"></td>
                                <td width="20%" ng-bind="instance.dataCenter"></td>
                                <td width="20%" ng-bind="instance.ip"></td>
                                <td width="20%">{{instance.configs && instance.configs.length ?
                                    (instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="text-center"
                         ng-if="namespace.instancesCount - namespace.latestReleaseInstances.total == 0">
                        无实例信息
                    </div>
Z
zhangle 已提交
554 555
                </div>

L
abtest  
lepdou 已提交
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
                <!--all instances-->
                <div class="panel-body" ng-show="namespace.instanceViewType == 'all'">
                    <div class="panel-default" ng-if="namespace.instancesCount > 0">
                        <table class="table table-bordered table-striped" ng-if="namespace.allInstances">
                            <thead>
                            <tr>
                                <td>App ID</td>
                                <td>Cluster Name</td>
                                <td>Data Center</td>
                                <td>IP</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="instance in namespace.allInstances">
                                <td width="25%" ng-bind="instance.appId"></td>
                                <td width="25%" ng-bind="instance.clusterName"></td>
                                <td width="25%" ng-bind="instance.dataCenter"></td>
                                <td width="25%" ng-bind="instance.ip"></td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="row text-center" ng-show="namespace.allInstances.length < namespace.instancesCount">
                            <button class="btn btn-default" ng-click="loadInstanceInfo(namespace)">加载更多</button>
                        </div>
                    </div>
                    <div class="text-center" ng-if="namespace.instancesCount == 0">
                        无实例信息
                    </div>
                </div>


Z
zhangle 已提交
587
            </div>
L
abtest  
lepdou 已提交
588 589
        </section>
    </section>
Z
zhangle 已提交
590

L
abtest  
lepdou 已提交
591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631
    <!--branch panel body-->
    <section class="branch-panel-body" ng-if="namespace.hasBranch && namespace.currentOperateBranch != 'master'">
        <!--main header-->
        <header class="panel-heading">

            <div class="row">
                <div class="col-md-6 header-namespace">
                    <b class="namespace-name" ng-bind="namespace.viewName" data-tooltip="tooltip"
                       data-placement="bottom"
                       title="{{namespace.comment}}"></b>
                    <span class="label label-info no-radius namespace-label" ng-bind="namespace.format"></span>
                    <span class="label label-warning no-radius namespace-label"
                          ng-show="namespace.branch.itemModifiedCnt > 0">有修改
                    <span class="badge label badge-white namespace-label"
                          ng-bind="namespace.branch.itemModifiedCnt"></span>
                </span>
                    <span class="label label-primary no-radius namespace-label"
                          ng-show="namespace.branch.lockOwner">当前修改者:
                            <span ng-bind="namespace.branch.lockOwner"></span>
                    </span>
                </div>

                <div class="col-md-6 text-right header-buttons">
                    <a type="button" class="btn btn-success btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="继续灰度发布"
                       ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
                       ng-click="publish(namespace.branch)">
                        灰度发布
                    </a>
                    <a type="button" class="btn btn-primary btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="合并到主版本并发布主版本配置"
                       ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
                       ng-click="mergeAndPublish(namespace.branch)">
                        全量发布
                    </a>
                    <a type="button" class="btn btn-warning btn-sm"
                       data-tooltip="tooltip" data-placement="bottom" title="废弃灰度版本"
                       ng-show="(namespace.hasReleasePermission
                       || (!namespace.branch.latestRelease && namespace.hasModifyPermission))"
                       ng-click="preDeleteBranch(namespace.branch)">
                        放弃灰度
Z
zhangle 已提交
632
                    </a>
L
abtest  
lepdou 已提交
633 634
                </div>
            </div>
Z
zhangle 已提交
635

L
abtest  
lepdou 已提交
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
        </header>

        <!--second header-->
        <header class="panel-heading second-panel-heading">
            <div class="row">
                <div class="col-md-8 pull-left">
                    <ul class="nav nav-tabs">
                        <li role="presentation" ng-click="switchView(namespace.branch, 'table')"
                            ng-show="namespace.isPropertiesFormat">
                            <a ng-class="{node_active:namespace.branch.viewType == 'table'}">
                                <img src="img/table.png">
                                配置
                            </a>
                        </li>
                        <li role="presentation" ng-click="switchView(namespace.branch, 'rule')">
                            <a ng-class="{node_active:namespace.branch.viewType == 'rule'}">
                                <img src="img/rule.png">
                                灰度规则
                                <span class="badge badge-grey"
                                      ng-bind="namespace.branch.grayIps.length + namespace.branch.grayApps.length"></span>
                            </a>
                        </li>
                        <li role="presentation" ng-click="switchView(namespace.branch, 'instance')">
                            <a ng-class="{node_active:namespace.branch.viewType == 'instance'}">
                                <img src="img/machine.png">
                                灰度实例列表
                                <span class="badge badge-grey"
                                      ng-bind="namespace.branch.latestReleaseInstances.total"></span>
                            </a>
                        </li>
                        <li role="presentation" ng-click="switchView(namespace.branch, 'history')">
                            <a ng-class="{node_active:namespace.branch.viewType == 'history'}">
                                <img src="img/change.png">
                                更改历史
                            </a>
                        </li>
                    </ul>
Z
zhangle 已提交
673 674
                </div>
            </div>
L
abtest  
lepdou 已提交
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873
        </header>

        <section>
            <!--items-->
            <div class="namespace-view-table" ng-show="namespace.branch.viewType == 'table'">

                <div class="panel panel-default" ng-if="namespace.hasBranch">
                    <div class="panel-heading">
                        灰度的配置
                        <button type="button" class="btn btn-primary btn-sm pull-right" style="margin-top: -4px;"
                                ng-show="namespace.hasModifyPermission"
                                ng-click="createItem(namespace.branch)">
                            <img src="img/plus.png">
                            新增灰度配置
                        </button>
                    </div>
                    <table class="table table-bordered table-striped table-hover">
                        <thead>
                        <tr>
                            <th>发布状态</th>
                            <th class="hover" title="排序"
                                ng-click="col='item.key';desc=!desc;">
                                Key&nbsp;
                                <span class="glyphicon glyphicon-sort"></span>

                            </th>
                            <th>
                                主版本的值
                            </th>
                            <th>
                                灰度的值
                            </th>
                            <th>
                                备注
                            </th>
                            <th class="hover" title="排序"
                                ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
                                最后修改人
                                <span class="glyphicon glyphicon-sort"></span>

                            </th>
                            <th class="hover" title="排序"
                                ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
                                最后修改时间
                                <span class="glyphicon glyphicon-sort"></span>
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr ng-repeat="config in namespace.branch.branchItems |orderBy:col:desc"
                            ng-if="config.item.key">
                            <td width="7%" class="text-center">
                                <span class="label label-warning no-radius cursor-pointer"
                                      data-tooltip="tooltip" data-placement="bottom" title="点击查看已发布的值"
                                      ng-if="config.isModified || config.isDeleted"
                                      ng-click="showText(config.oldValue)">未发布</span>
                                <span class="label label-default-light no-radius"
                                      data-tooltip="tooltip" data-placement="bottom" title="已生效的配置"
                                      ng-if="!config.isModified">已发布</span>
                            </td>
                            <td width="15%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.key)">
                                <span ng-bind="config.item.key | limitTo: 250"></span>
                                <span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
                                <span class="label label-danger" ng-if="config.isDeleted"
                                      data-tooltip="tooltip" data-placement="bottom" title="删除的配置"></span>
                                <span class="label label-info" ng-if="!config.isDeleted && config.masterReleaseValue"
                                      data-tooltip="tooltip" data-placement="bottom" title="修改主版本的配置"></span>
                                <span class="label label-success"
                                      ng-if="!config.isDeleted && !config.masterReleaseValue"
                                      data-tooltip="tooltip" data-placement="bottom" title="灰度版本特有的配置"></span>
                            </td>
                            <td width="20%" class="cursor-pointer" title="点击查看"
                                ng-click="showText(config.masterReleaseValue)">
                                <span ng-bind="config.masterReleaseValue | limitTo: 250"></span>
                                <span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
                            </td>
                            <td width="20%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.value)">
                                <span ng-bind="config.item.value | limitTo: 250"></span>
                                <span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
                            </td>
                            <td width="10%" title="{{config.item.comment}}">
                                <span ng-bind="config.item.comment | limitTo: 250"></span>
                                <span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
                            </td>
                            <td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
                            </td>
                            <td width="10%"
                                ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
                            </td>

                            <td width="9%" class="text-center">
                                <img src="img/edit.png"
                                     data-tooltip="tooltip" data-placement="bottom" title="修改"
                                     ng-if="!config.isDeleted"
                                     ng-click="editItem(namespace.branch, config.item)"
                                     ng-show="namespace.hasModifyPermission">
                                <img style="margin-left: 5px;" src="img/cancel.png"
                                     data-tooltip="tooltip" data-placement="bottom" title="删除"
                                     ng-if="!config.isDeleted"
                                     ng-click="preDeleteItem(namespace.branch, config.item.id)"
                                     ng-show="namespace.hasModifyPermission">
                            </td>

                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="panel panel-default"
                     ng-if="namespace.branch.masterItems && namespace.branch.masterItems.length > 0">
                    <div class="panel-heading">
                        主版本的配置
                    </div>
                    <table class="table table-bordered table-striped table-hover">
                        <thead>
                        <tr>
                            <th>发布状态</th>
                            <th class="hover" title="排序"
                                ng-click="col='item.key';desc=!desc;">
                                Key&nbsp;
                                <span class="glyphicon glyphicon-sort"></span>

                            </th>
                            <th>
                                Value
                            </th>
                            <th>
                                备注
                            </th>
                            <th class="hover" title="排序"
                                ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
                                最后修改人
                                <span class="glyphicon glyphicon-sort"></span>

                            </th>
                            <th class="hover" title="排序"
                                ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
                                最后修改时间
                                <span class="glyphicon glyphicon-sort"></span>
                            </th>
                            <th>
                                操作
                            </th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr ng-repeat="config in namespace.branch.masterItems |orderBy:col:desc"
                            ng-if="config.item.key">
                            <td width="8%" class="text-center">
                                <span class="label label-warning no-radius cursor-pointer"
                                      data-tooltip="tooltip" data-placement="bottom" title="点击查看已发布的值"
                                      ng-if="config.isModified || config.isDeleted"
                                      ng-click="showText(config.oldValue)">未发布</span>
                                <span class="label label-default-light no-radius"
                                      data-tooltip="tooltip" data-placement="bottom" title="已生效的配置"
                                      ng-if="!config.isModified">已发布</span>
                            </td>
                            <td width="15%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.key)">
                                <span ng-bind="config.item.key | limitTo: 250"></span>
                                <span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
                                <span class="label label-success" ng-if="config.isModified && !config.oldValue"
                                      data-tooltip="tooltip" data-placement="bottom" title="新增的配置"></span>
                            <span class="label label-info"
                                  ng-if="config.isModified && config.oldValue && !config.isDeleted"
                                  data-tooltip="tooltip" data-placement="bottom" title="修改的配置"></span>
                            <span class="label label-danger" ng-if="config.isDeleted"
                                  data-tooltip="tooltip" data-placement="bottom" title="删除的配置"></span>
                            </td>
                            <td width="35%" class="cursor-pointer" title="点击查看" ng-click="showText(config.item.value)">
                                <span ng-bind="config.item.value | limitTo: 250"></span>
                                <span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
                            </td>
                            <td width="15%" title="{{config.item.comment}}">
                                <span ng-bind="config.item.comment | limitTo: 250"></span>
                                <span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
                            </td>
                            <td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
                            </td>
                            <td width="12%"
                                ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
                            </td>

                            <td width="5%" class="text-center">
                                <img src="img/gray.png"
                                     data-tooltip="tooltip" data-placement="bottom" title="对此配置灰度"
                                     ng-if="!config.isDeleted"
                                     ng-click="editItem(namespace.branch, config.item)"
                                     ng-show="namespace.hasModifyPermission">
                            </td>

                        </tr>
                        </tbody>
                    </table>
                </div>
Z
zhangle 已提交
874
            </div>
L
abtest  
lepdou 已提交
875 876
            <!--gray rules-->
            <div class="rules-manage-view row" ng-show="namespace.branch.viewType == 'rule'">
Z
zhangle 已提交
877

878 879 880 881 882
                <div class="alert alert-warning no-radius" ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
                    <strong>Tips:</strong>
                    您没有权限编辑灰度规则, 具有namespace修改权或者发布权的人员才可以编辑灰度规则. 如需要编辑灰度规则,请找项目管理员申请权限.
                </div>

L
abtest  
lepdou 已提交
883
                <table class="table table-bordered table-hover">
Z
zhangle 已提交
884 885
                    <thead>
                    <tr>
L
abtest  
lepdou 已提交
886 887 888
                        <th>灰度的AppId</th>
                        <th>灰度的IP列表</th>
                        <th>操作</th>
Z
zhangle 已提交
889 890 891
                    </tr>
                    </thead>
                    <tbody>
L
abtest  
lepdou 已提交
892 893 894 895 896 897 898 899
                    <tr ng-repeat="ruleItem in namespace.branch.rules.ruleItems">
                        <td width="20%" ng-bind="ruleItem.clientAppId"></td>
                        <td width="70%" ng-show="!ruleItem.ApplyToAllInstances"
                            ng-bind="ruleItem.clientIpList.join(', ')"></td>
                        <td width="70%" ng-show="ruleItem.ApplyToAllInstances">ALL</td>
                        <td class="text-center" width="10%">
                            <img src="img/edit.png" class="i-20 hover"
                                 data-tooltip="tooltip" data-placement="bottom" title="修改"
900
                                 ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
L
abtest  
lepdou 已提交
901 902 903
                                 ng-click="editRuleItem(namespace.branch, ruleItem)">
                            <img src="img/cancel.png" class="i-20 hover" style="margin-left: 5px;"
                                 data-tooltip="tooltip" data-placement="bottom" title="删除"
904
                                 ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
L
abtest  
lepdou 已提交
905 906
                                 ng-click="deleteRuleItem(namespace.branch, ruleItem)">
                        </td>
Z
zhangle 已提交
907
                    </tr>
L
abtest  
lepdou 已提交
908

Z
zhangle 已提交
909 910
                    </tbody>
                </table>
L
abtest  
lepdou 已提交
911
                <button class="btn btn-primary"
912
                        ng-if="namespace.hasModifyPermission || namespace.hasReleasePermission"
L
abtest  
lepdou 已提交
913 914 915 916 917 918 919
                        ng-show="(namespace.isPublic && !namespace.isLinkedNamespace) ||
                        ((!namespace.isPublic || namespace.isLinkedNamespace)
                        && (!namespace.branch.rules
                            || !namespace.branch.rules.ruleItems
                            || !namespace.branch.rules.ruleItems.length))"
                        ng-click="addRuleItem(namespace.branch)">新增规则
                </button>
920 921


Z
zhangle 已提交
922
            </div>
923 924


L
abtest  
lepdou 已提交
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975
            <!--instances -->
            <div class="panel panel-default" ng-show="namespace.branch.viewType == 'instance'">
                <div class="panel-heading text-right">
                    <button class="btn btn-default btn-sm"
                            data-tooltip="tooltip" data-placement="bottom" title="刷新列表"
                            ng-click="refreshInstancesInfo(namespace.branch)">
                        <img src="../../img/refresh.png"/>
                    </button>
                </div>
                <div class="panel-body">
                    <div class="panel-default" ng-if="namespace.branch.latestReleaseInstances.total > 0">
                        <div class="panel-heading">
                            <a target="_blank" data-tooltip="tooltip" data-placement="bottom" title="查看配置"
                               href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{namespace.baseInfo.clusterName}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.branch.latestRelease.id}}">
                                {{namespace.branch.latestRelease.name}}
                            </a>
                        </div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <td>App ID</td>
                                <td>Cluster Name</td>
                                <td>Data Center</td>
                                <td>IP</td>
                                <td>配置获取时间</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="instance in namespace.branch.latestReleaseInstances.content">
                                <td width="20%" ng-bind="instance.appId"></td>
                                <td width="20%" ng-bind="instance.clusterName"></td>
                                <td width="20%" ng-bind="instance.dataCenter"></td>
                                <td width="20%" ng-bind="instance.ip"></td>
                                <td width="20%">{{instance.configs && instance.configs.length ?
                                    (instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="row text-center"
                             ng-show="namespace.branch.latestReleaseInstances.content.length < namespace.branch.latestReleaseInstances.total">
                            <button class="btn btn-default" ng-click="loadInstanceInfo(namespace.branch)">加载更多</button>

                        </div>
                    </div>
                    <div class="text-center" ng-if="namespace.branch.latestReleaseInstances.total == 0">
                        无实例信息
                    </div>
                </div>


Z
zhangle 已提交
976
            </div>
L
abtest  
lepdou 已提交
977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022
            <!--history view-->
            <div class="J_historyview history-view" ng-show="namespace.branch.viewType == 'history'">
                <div class="media" ng-repeat="commits in namespace.branch.commits">
                    <div class="media-body">
                        <div class="row">
                            <div class="col-md-6"><h3 class="media-heading"
                                                      ng-bind="commits.dataChangeCreatedBy"></h3>
                            </div>
                            <div class="col-md-6 text-right">
                                <h5 class="media-heading"
                                    ng-bind="commits.dataChangeCreatedTime  | date: 'yyyy-MM-dd HH:mm:ss'"></h5>
                            </div>
                        </div>


                        <!--properties format-->
                        <table class="table table-bordered table-striped text-center table-hover"
                               style="margin-top: 5px;"
                               ng-if="namespace.isPropertiesFormat">
                            <thead>
                            <tr>
                                <th>
                                    Type
                                </th>
                                <th>
                                    Key
                                </th>
                                <th>
                                    Old Value
                                </th>
                                <th>
                                    New Value
                                </th>
                                <th>
                                    Comment
                                </th>
                            </tr>
                            </thead>
                            <tbody>

                            <!--兼容老数据,不显示item类型为空行和注释的item-->
                            <tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
                                <td width="2%">
                                    新增
                                </td>
                                <td width="20%" title="{{item.key}}">
Z
zhangle 已提交
1023

L
abtest  
lepdou 已提交
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
                                    <span ng-bind="item.key | limitTo: 250"></span>
                                    <span ng-bind="item.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%">
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.value}}"
                                    ng-click="showText(item.value)">
                                    <span ng-bind="item.value | limitTo: 250"></span>
                                    <span ng-bind="item.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="18%" title="{{item.comment}}">
                                    <span ng-bind="item.comment | limitTo: 250"></span>
                                    <span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            <tr ng-repeat="item in commits.changeSets.updateItems">
                                <td width="2%">
                                    更新
                                </td>
                                <td width="20%" title="{{item.newItem.key}}">
                                    <span ng-bind="item.newItem.key | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.oldItem.value}}"
                                    ng-click="showText(item.oldItem.value)">
                                    <span ng-bind="item.oldItem.value | limitTo: 250"></span>
                                    <span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="30%" class="cursor-pointer" title="{{item.newItem.value}}"
                                    ng-click="showText(item.newItem.value)">
                                    <span ng-bind="item.newItem.value | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="18%" title="{{item.newItem.comment}}">
                                    <span ng-bind="item.newItem.comment | limitTo: 250"></span>
                                    <span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            <tr ng-repeat="item in commits.changeSets.deleteItems"
                                ng-show="item.key || item.comment">
                                <td width="2%">
                                    删除
                                </td>
                                <td width="20%" title="{{item.key}}">
                                    <span ng-bind="item.key | limitTo: 250"></span>
                                    <span ng-bind="item.key.length > 250 ? '...' :''"></span>
                                </td>
                                <td width="30%" title="{{item.value}}">
                                    <span ng-bind="item.value | limitTo: 250"></span>
                                    <span ng-bind="item.value.length > 250 ? '...': ''"></span>
                                </td>
                                <td width="30%">
                                </td>
                                <td width="18%" title="{{item.comment}}">
                                    <span ng-bind="item.comment | limitTo: 250"></span>
                                    <span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <!--not properties format-->
                        <div ng-if="!namespace.isPropertiesFormat">
                            <div ng-repeat="item in commits.changeSets.createItems">
                                <textarea class="form-control no-radius" rows="20"
                                          ng-disabled="true" ng-bind="item.value">
                                </textarea>
                            </div>

                            <div ng-repeat="item in commits.changeSets.updateItems">
                                <textarea class="form-control no-radius" rows="20"
                                          ng-disabled="true" ng-bind="item.newItem.value">
                                </textarea>
                            </div>
                        </div>


                    </div>
                    <hr>
                </div>
                <div class="text-center">
                    <button type="button" class="btn btn-default" ng-show="!namespace.branch.hasLoadAllCommit"
                            ng-click="loadCommitHistory(namespace.branch)">加载更多
                        <span class="glyphicon glyphicon-menu-down"></span></button>
                </div>
            </div>
        </section>
    </section>
Z
zhangle 已提交
1112

L
abtest  
lepdou 已提交
1113
</section>