history.html 15 KB
Newer Older
1 2 3 4
<!doctype html >
<html ng-app="release_history">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
zhangle committed
5
    <link rel="icon" href="../img/config.png">
6 7 8 9 10 11 12 13 14 15 16 17
    <!-- styles -->
    <link rel="stylesheet" type="text/css" href="../vendor/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../vendor/angular/angular-toastr-1.4.1.min.css">
    <link rel="stylesheet" type="text/css" media='all' href="../vendor/angular/loading-bar.min.css">
    <link rel="stylesheet" type="text/css" href="../styles/common-style.css">
    <title>发布历史</title>
</head>

<body>

<apollonav></apollonav>

lepdou committed
18 19
<div class="container-fluid apollo-container" ng-controller="ReleaseHistoryController">
    <section class="release-history panel col-md-12 no-radius hidden">
20
        <div class="panel-heading row">
lepdou committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

            <div class="operation-caption-container col-md-3">
                <div class="operation-caption release-operation-normal text-center"
                     style="left:0;">
                    <small>主版本发布</small>
                </div>
                <div class="operation-caption release-operation-rollback text-center"
                     style="left: 80px;">
                    <small>主版本回滚</small>
                </div>
                <div class="operation-caption release-operation-gray text-center"
                     style="left: 160px;">
                    <small>灰度操作</small>
                </div>
            </div>

            <div class="col-md-6 text-center">
38
                <h4>发布历史</h4>
lepdou committed
39 40 41
                <small>(AppId:{{pageContext.appId}}, ENV:{{pageContext.env}}, Cluster:{{pageContext.clusterName}},
                    Namespace:{{pageContext.namespaceName}})
                </small>
42
            </div>
lepdou committed
43 44

            <div class="pull-right back-btn">
45 46 47 48 49
                <a type="button" class="btn btn-info" href="/config.html?#/appid={{pageContext.appId}}">返回到项目首页
                </a>
            </div>

        </div>
lepdou committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

        <div class="release-history-container panel-body row" ng-show="releaseHistories && releaseHistories.length > 0">
            <div class="release-history-list col-md-3">

                <div class="media hover" ng-class="{'active': releaseHistory.id == selectedReleaseHistory}"
                     ng-repeat="releaseHistory in releaseHistories"
                     ng-click="showReleaseHistoryDetail(releaseHistory)">
                    <div class="release-operation"
                         ng-class="{'release-operation-normal': releaseHistory.operation == 0  || releaseHistory.operation == 5,
                               'release-operation-gray': releaseHistory.operation == 2 || releaseHistory.operation == 3 ||
                               releaseHistory.operation == 4 || releaseHistory.operation == 7 || releaseHistory.operation == 8,
                               'release-operation-rollback': releaseHistory.operation == 1 || releaseHistory.operation == 6}">
                    </div>
                    <h4 class="media-left text-center" ng-bind="releaseHistory.operator">
                    </h4>
                    <div class="media-body">

                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 0">普通发布</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 1">回滚</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 2">灰度发布</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 3">更新灰度规则</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 4">灰度全量发布</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 5">灰度发布(主版本发布)</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 6">灰度发布(主版本回滚)</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 7">放弃灰度</h5>
                        <h5 class="col-md-7 word-break" ng-show="releaseHistory.operation == 8">删除灰度(全量发布)</h5>

                        <h6 class="col-md-5 text-right" ng-bind="releaseHistory.releaseTimeFormatted"></h6>
lepdou committed
78 79
                        <span class="label label-warning no-radius emergency-publish"
                              ng-if="releaseHistory.operationContext.isEmergencyPublish">紧急发布</span>
lepdou committed
80
                    </div>
lepdou committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
                </div>

                <div class="load-more media panel-heading text-center hover"
                     ng-show="!hasLoadAll"
                     ng-click="findReleaseHistory()">
                    加载更多
                </div>

            </div>

            <!--properties mode info-->
            <div class="release-info col-md-9 panel panel-default no-radius"
                 ng-show="!isTextNamespace">
                <div class="panel-heading">

                    <span ng-bind="history.releaseTitle"></span>
                    <span class="pull-right" ng-bind="history.releaseTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>

                    <div class="row" style="padding-top: 10px;">
                        <div class="col-md-5">
                            <small ng-show="history.releaseComment" ng-bind="history.releaseComment"></small>
102
                        </div>
lepdou committed
103 104 105 106 107 108 109 110 111 112 113 114 115
                        <div class="col-md-7 text-right">
                            <div class="btn-group">
                                <button type="button" class="btn btn-default btn-sm"
                                        ng-class="{'active':history.viewType == 'diff'}"
                                        data-tooltip="tooltip" data-placement="bottom" title="查看此次发布与上次版本的变更"
                                        ng-click="switchConfigViewType(history, 'diff')">变更的配置
                                </button>
                                <button type="button" class="btn btn-default btn-sm"
                                        ng-class="{'active':history.viewType == 'all'}"
                                        data-tooltip="tooltip" data-placement="bottom" title="查看此次发布的所有配置信息"
                                        ng-click="switchConfigViewType(history, 'all')">全部配置
                                </button>
                            </div>
116
                        </div>
zhangle committed
117

lepdou committed
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
                    </div>
                </div>

                <div class="panel-body config">
                    <section ng-show="history.viewType=='diff'">
                        <h4 class="section-title">变更的配置</h4>
                        <div ng-show="history.changes && history.changes.length > 0">
                            <table class="no-margin table table-striped table-hover table-bordered">
                                <thead>
                                <tr>
                                    <th>Type</th>
                                    <th>Key</th>
                                    <th>Old Value</th>
                                    <th>New Value</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="change in history.changes">
                                    <td width="10%">
                                        <span ng-show="change.type == 'ADDED'">新增</span>
                                        <span ng-show="change.type == 'MODIFIED'">修改</span>
                                        <span ng-show="change.type == 'DELETED'">删除</span>
                                    </td>
                                    <td class="cursor-pointer" width="20%"
                                        ng-click="showText(change.entity.firstEntity.key)">
                                        <span ng-bind="change.entity.firstEntity.key | limitTo: 250"></span>
                                        <span ng-bind="change.entity.firstEntity.key.length > 250 ? '...' :''"></span>
                                    </td>
                                    <td class="cursor-pointer" width="35%"
                                        ng-click="showText(change.entity.firstEntity.value)">
                                        <span ng-bind="change.entity.firstEntity.value | limitTo: 250"></span>
                                        <span ng-bind="change.entity.firstEntity.value.length > 250 ? '...' :''"></span>
                                    </td>
                                    <td class="cursor-pointer" width="35%"
                                        ng-click="showText(change.entity.secondEntity.value)">
                                        <span ng-bind="change.entity.secondEntity.value | limitTo: 250"></span>
                                        <span ng-bind="change.entity.secondEntity.value.length > 250 ? '...' :''"></span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
159
                        </div>
lepdou committed
160 161 162
                        <div class="text-center empty-container"
                             ng-show="!history.changes || history.changes.length == 0">
                            <h5>无配置更改</h5>
163
                        </div>
lepdou committed
164
                    </section>
165 166


lepdou committed
167 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
                    <section ng-show="history.viewType=='all'">
                        <h4 class="section-title">全部配置</h4>
                        <table class="no-margin table table-striped table-hover table-bordered"
                               ng-show="history.configuration && history.configuration.length > 0">
                            <thead>
                            <tr>
                                <th>Key</th>
                                <th>Value</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in history.configuration">
                                <td class="cursor-pointer" width="30%" ng-click="showText(item.firstEntity)">
                                    <span ng-bind="item.firstEntity | limitTo: 250"></span>
                                    <span ng-bind="item.firstEntity.length > 250 ? '...' :''"></span>
                                </td>
                                <td class="cursor-pointer" width="70%" ng-click="showText(item.secondEntity)">
                                    <span ng-bind="item.secondEntity | limitTo: 250"></span>
                                    <span ng-bind="item.secondEntity.length > 250 ? '...' :''"></span>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div class="text-center empty-container"
                             ng-show="history.viewType=='all' && (!history.configuration || history.configuration.length == 0)">
                            <h5>无配置</h5>
                        </div>
                    </section>

196

lepdou committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
                    <section ng-show="history.branchName != history.clusterName && history.operation != 8 && history.operation != 7">
                        <hr>
                        <h4 class="section-title">灰度规则</h4>
                        <table class="no-margin table table-striped table-hover table-bordered"
                               ng-show="history.operationContext.rules">
                            <thead>
                            <tr>
                                <th>灰度的AppId</th>
                                <th>灰度的IP</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="rule in history.operationContext.rules">
                                <td width="20%" ng-bind="rule.clientAppId"></td>
                                <td width="80%" ng-bind="rule.clientIpList.join(', ')"></td>
                            </tr>
                            </tbody>
                        </table>
                        <h5 class="text-center empty-container" ng-show="!history.operationContext.rules">
                            无灰度规则
                        </h5>
                    </section>
219

220 221
                </div>
            </div>
lepdou committed
222 223 224 225 226 227 228 229 230

            <!--text mode-->
            <div class="release-info col-md-9"
                 ng-show="isTextNamespace && history.changes && history.changes.length > 0">
                <apollodiff ng-repeat="change in history.changes"
                            old-str="change.entity.firstEntity.value"
                            new-str="change.entity.secondEntity.value"
                            apollo-id="'releaseStrDiff'">
                </apollodiff>
231
            </div>
lepdou committed
232 233 234 235 236

        </div>

        <div class="panel-body" ng-show="!releaseHistories || releaseHistories.length == 0">
            <h4 class="text-center empty-container">无发布历史信息</h4>
237 238 239
        </div>
    </section>

lepdou committed
240
    <showtextmodal text="text"></showtextmodal>
241 242
</div>

lepdou committed
243

244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
<div ng-include="'../views/common/footer.html'"></div>

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

<!--angular-->
<script src="../vendor/angular/angular.min.js"></script>
<script src="../vendor/angular/angular-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>


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

<!--nicescroll-->
<script src="../vendor/jquery.nicescroll.min.js"></script>

lepdou committed
262 263
<script src="../vendor/diff.min.js" type="text/javascript"></script>

264 265 266 267 268 269
<!--biz-->
<script type="application/javascript" src="../scripts/app.js"></script>
<script type="application/javascript" src="../scripts/services/AppService.js"></script>
<script type="application/javascript" src="../scripts/services/EnvService.js"></script>
<script type="application/javascript" src="../scripts/services/ReleaseService.js"></script>
<script type="application/javascript" src="../scripts/services/UserService.js"></script>
lepdou committed
270 271 272
<script type="application/javascript" src="../scripts/services/ReleaseHistoryService.js"></script>
<script type="application/javascript" src="../scripts/services/ConfigService.js"></script>

273 274 275 276 277
<script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/controller/config/ReleaseHistoryController.js"></script>

<script type="application/javascript" src="../scripts/PageCommon.js"></script>
<script type="application/javascript" src="../scripts/directive/directive.js"></script>
lepdou committed
278 279
<script type="application/javascript" src="../scripts/directive/show-text-modal-directive.js"></script>
<script type="application/javascript" src="../scripts/directive/diff-directive.js"></script>
280 281
</body>
</html>