release-modal.html 15.1 KB
Newer Older
lepdou committed
1 2 3 4 5 6 7
<form id="releaseModal" class="modal fade form-horizontal" name="releaseForm" valdr-type="Release"
      ng-submit="release()">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header panel-primary">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
lepdou committed
8 9 10
                <h4 class="modal-title" ng-show="!toReleaseNamespace.isBranch">发布
                    <small>(只有发布过的配置才会被客户端获取到,此次发布只会作用于当前环境:{{env}})</small>
                </h4>
lepdou committed
11
                <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && !toReleaseNamespace.mergeAndPublish">
lepdou committed
12 13 14
                    灰度发布
                    <small>(灰度发布的配置只会作用于在灰度规则中配置的实例)</small>
                </h4>
lepdou committed
15
                <h4 class="modal-title" ng-show="toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish">
lepdou committed
16 17 18 19
                    全量发布
                    <small>(全量发布的配置会作用于全部的实例)</small>
                </h4>

lepdou committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 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 163 164 165 166 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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
            </div>

            <div class="release modal-body">

                <div class="form-group">
                    <div class="col-sm-2 control-label" ng-if="!toReleaseNamespace.isPropertiesFormat">
                        <div class="row">
                            <div class="btn-group btn-group-xs" style="padding-right: 10px" role="group">
                                <button type="button" class="btn btn-default"
                                        ng-class="{active:releaseChangeViewType=='change'}"
                                        ng-click="switchReleaseChangeViewType('change')">查看变更
                                </button>
                                <button type="button" class="btn btn-default"
                                        ng-class="{active:releaseChangeViewType=='release'}"
                                        ng-click="switchReleaseChangeViewType('release')">发布的值
                                </button>
                            </div>
                        </div>
                    </div>
                    <label class="col-sm-2 control-label" ng-if="toReleaseNamespace.isPropertiesFormat">Changes</label>

                    <div class="col-sm-10"
                         ng-if="(!toReleaseNamespace.isBranch && toReleaseNamespace.itemModifiedCnt)
                                    || (toReleaseNamespace.isBranch && toReleaseNamespace.itemModifiedCnt)
                                    || (toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish && toReleaseNamespace.branchItems.length)"
                         valdr-form-group>

                        <!--properties format-->
                        <!--normal release-->
                        <table class="table table-bordered table-striped text-center table-hover"
                               ng-if="toReleaseNamespace.isPropertiesFormat && !toReleaseNamespace.isBranch">
                            <thead>
                            <tr>
                                <th>
                                    Key
                                </th>
                                <th>
                                    发布的值
                                </th>
                                <th>
                                    未发布的值
                                </th>
                                <th>
                                    修改人
                                </th>
                                <th>
                                    修改时间
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="config in toReleaseNamespace.items"
                                ng-if="config.item.key && config.isModified">
                                <td width="20%" title="{{config.item.key}}">
                                    <span ng-bind="config.item.key"></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="25%" title="{{config.oldValue}}">
                                    <span ng-bind="config.oldValue"></span>
                                </td>
                                <td width="25%" title="{{config.newValue}}">
                                    <span ng-bind="config.newValue"></span>
                                </td>
                                <td width="15%" ng-bind="config.item.dataChangeLastModifiedBy">
                                </td>
                                <td width="15%"
                                    ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <!--branch gray release-->
                        <table class="table table-bordered table-striped text-center table-hover"
                               ng-if="toReleaseNamespace.isPropertiesFormat &&
                               toReleaseNamespace.isBranch && !toReleaseNamespace.mergeAndPublish">
                            <thead>
                            <tr>
                                <th>
                                    Key
                                </th>
                                <th>
                                    主版本值
                                </th>
                                <th>
                                    灰度版本发布的值
                                </th>
                                <th>
                                    灰度版本未发布的值
                                </th>
                                <th>
                                    修改人
                                </th>
                                <th>
                                    修改时间
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="config in toReleaseNamespace.branchItems"
                                ng-if="config.isModified || config.isDeleted">
                                <td width="15%" title="{{config.item.key}}">
                                    <span ng-bind="config.item.key"></span>
                                        <span class="label label-danger"
                                              ng-show="config.isDeleted"></span>
                                </td>
                                <td width="20%" title="{{config.masterReleaseValue}}">
                                    <span ng-bind="config.masterReleaseValue"></span>
                                </td>
                                <td width="20%" title="{{config.oldValue}}">
                                    <span ng-bind="config.oldValue"></span>
                                </td>
                                <td width="20%" title="{{config.newValue}}">
                                    <span ng-bind="config.newValue"></span>
                                </td>
                                <td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
                                </td>
                                <td width="15%"
                                    ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <!--branch updateAndPublish and publish-->
                        <table class="table table-bordered table-striped text-center table-hover"
                               ng-if="toReleaseNamespace.isPropertiesFormat &&
                               toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish">
                            <thead>
                            <tr>
                                <th>
                                    Key
                                </th>
                                <th ng-if="toReleaseNamespace.isBranch">
                                    主版本值
                                </th>
                                <th ng-if="toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish">
                                    灰度版本的值
                                </th>
                                <th ng-if="!toReleaseNamespace.isBranch || !toReleaseNamespace.mergeAndPublish">
                                    发布的值
                                </th>
                                <th ng-if="!toReleaseNamespace.isBranch || !toReleaseNamespace.mergeAndPublish">
                                    未发布的值
                                </th>
                                <th>
                                    修改人
                                </th>
                                <th>
                                    修改时间
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="config in toReleaseNamespace.branchItems"
                                ng-if="!config.isDeleted">
                                <td width="20%" title="{{config.item.key}}">
                                    <span ng-bind="config.item.key"></span>
                                </td>
                                <td width="25%" title="{{config.masterReleaseValue}}">
                                    <span ng-bind="config.masterReleaseValue"></span>
                                </td>
                                <td width="25%" title="{{config.item.value}}">
                                    <span ng-bind="config.item.value"></span>
                                </td>
                                <td width="15%" ng-bind="config.item.dataChangeLastModifiedBy">
                                </td>
                                <td width="15%"
                                    ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
                                </td>
                            </tr>
                            </tbody>
                        </table>

                        <!--file format -->
                        <div ng-repeat="item in toReleaseNamespace.items"
                             ng-if="!toReleaseNamespace.isPropertiesFormat"
                             ng-show="releaseChangeViewType=='change'">
                            <apollodiff old-str="item.oldValue" new-str="item.newValue"
                                        apollo-id="'releaseStrDiff'"></apollodiff>
                        </div>
                        <div ng-repeat="item in toReleaseNamespace.items"
                             ng-if="!toReleaseNamespace.isPropertiesFormat"
                             ng-show="releaseChangeViewType=='release'">
                                        <textarea class="form-control no-radius" rows="20"
                                                  ng-disabled="true" ng-show="item.newValue" ng-bind="item.newValue">
                                        </textarea>
                        </div>

                    </div>
                    <div class="col-sm-5"
                         ng-show="(!toReleaseNamespace.isBranch && !toReleaseNamespace.itemModifiedCnt)"
                         valdr-form-group>
                        <label class="form-control-static">
                            配置没有变化
                        </label>
                    </div>
                    <div class="col-sm-5"
                         ng-show="(toReleaseNamespace.isBranch && !toReleaseNamespace.mergeAndPublish && !toReleaseNamespace.itemModifiedCnt)"
                         valdr-form-group>
                        <label class="form-control-static">
                            灰度配置没有变化
                        </label>
                    </div>
                    <div class="col-sm-5"
                         ng-show="(toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish && toReleaseNamespace.branchItems.length == 0)"
                         valdr-form-group>
                        <label class="form-control-static">
                            没有灰度的配置项
                        </label>
                    </div>

                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">
                        <apollorequiredfield></apollorequiredfield>
                        Release Name</label>
                    <div class="col-sm-5" valdr-form-group>
                        <input type="text" name="releaseName" class="form-control"
                               placeholder="input release name"
                               ng-model="toReleaseNamespace.releaseTitle" ng-required="true">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">Comment</label>
                    <div class="col-sm-10" valdr-form-group>
                                            <textarea rows="4" name="comment" class="form-control"
                                                      style="margin-top: 15px;"
                                                      ng-model="releaseComment"
                                                      placeholder="Add an optional extended description..."></textarea>
                    </div>
                </div>


            </div>

            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="submit" class="btn btn-primary"
                        ng-disabled="releaseForm.$invalid || releaseBtnDisabled
                        || (toReleaseNamespace.isBranch && toReleaseNamespace.mergeAndPublish && toReleaseNamespace.branchItems.length == 0)">
                    发布
                </button>
            </div>
        </div>
    </div>
</form>