sync.html 9.7 KB
Newer Older
L
lepdou 已提交
1 2 3 4 5 6 7 8 9 10 11 12
<!doctype html>
<html ng-app="sync_item">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- 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>

13
<body>
L
lepdou 已提交
14

L
lepdou 已提交
15
<div ng-include="'../views/common/nav.html'"></div>
L
lepdou 已提交
16

17
<div class="container-fluid apollo-container" ng-controller="SyncItemController">
L
lepdou 已提交
18 19 20
    <section class="panel col-md-offset-1 col-md-10">
        <header class="panel-heading">
            <div class="row">
21
                <div class="col-md-7">
L
lepdou 已提交
22 23 24 25 26
                    <h4 class="modal-title">同步配置
                        <small ng-show="syncItemStep == 1">(第一步:选择同步信息)</small>
                        <small ng-show="syncItemStep == 2">(第二步:检查Diff)</small>
                    </h4>
                </div>
27
                <div class="col-md-5 text-right">
L
lepdou 已提交
28 29 30 31
                    <button type="button" class="btn btn-primary" ng-show="syncItemStep > 1 && syncItemStep < 3"
                            ng-click="syncItemNextStep(-1)">上一步
                    </button>
                    <button type="button" class="btn btn-primary" ng-show="syncItemStep < 2"
L
lepdou 已提交
32
                            ng-click="diff()">下一步
L
lepdou 已提交
33
                    </button>
34
                    <button type="button" class="btn btn-success" ng-show="syncItemStep == 2 && hasDiff" ng-click="syncItems()">同步
L
lepdou 已提交
35
                    </button>
L
lepdou 已提交
36
                    <button type="button" class="btn btn-success" data-dismiss="modal" ng-show="syncItemStep == 3"
L
lepdou 已提交
37
                            ng-click="backToAppHomePage()">返回
L
lepdou 已提交
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
                    </button>
                </div>
            </div>
        </header>
        <div class="panel-body">
            <div class="row" ng-show="syncItemStep == 1">
                <div class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">同步到那个集群</label>
                        <div class="col-sm-6">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <td><input type="checkbox" ng-click="toggleEnvsCheckedStatus()"></td>
                                    </td>
                                    <td>环境</td>
                                    <td>集群</td>
                                </tr>
                                </thead>
                                <tbody>
L
lepdou 已提交
58 59 60 61 62
                                <tr ng-repeat="namespaceIdentifer in namespaceIdentifers">
                                    <td width="10%"><input type="checkbox" ng-checked="namespaceIdentifer.checked"
                                                           ng-click="switchSelect(namespaceIdentifer)"></td>
                                    <td width="30%">{{namespaceIdentifer.env}}</td>
                                    <td width="60%">{{namespaceIdentifer.name}}</td>
L
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
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <hr>
            </div>

            <div class="row" ng-show="syncItemStep == 1" style="margin-top: 10px;">
                <div class="form-horizontal">
                    <div class="col-sm-2 text-right">
                        <label class="control-label">需要同步的配置</label>
                    </div>
                    <div class="col-sm-10">
                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                            <tr>
                                <td><input type="checkbox" ng-click="toggleItemsCheckedStatus()"></td>
                                <td>key</td>
                                <td>value</td>
                                <td>comment</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="item in sourceItems">
L
lepdou 已提交
89 90
                                <td width="10%"><input type="checkbox" ng-checked="item.checked"
                                                       ng-click="switchSelect(item)"></td>
91 92
                                <td width="20%">{{item.key | limitTo: 30}} {{item.key.length > 30 ? '...' : ''}}</td>
                                <td width="50%">{{item.value | limitTo: 45}} {{item.value.length > 45 ? '...' : ''}}
L
lepdou 已提交
93 94 95 96
                                </td>
                                <td width="20%">{{item.comment | limitTo: 15}}{{item.comment.length > 15 ? '...' :
                                    ''}}
                                </td>
L
lepdou 已提交
97 98 99 100 101 102 103 104 105 106
                            </tr>
                            </tbody>
                        </table>

                    </div>
                </div>

            </div>

            <!--step 2-->
L
lepdou 已提交
107
            <div class="row" ng-show="syncItemStep == 2" ng-repeat="diff in diffs">
108 109 110
                <h4 class="text-center">环境:{{diff.namespace.env}} 集群:{{diff.namespace.clusterName}}
                    <em ng-show="diff.diffs.createItems.length == 0 && diff.diffs.updateItems.length == 0">没有更新的配置</em>
                </h4>
L
lepdou 已提交
111
                <hr>
112

L
lepdou 已提交
113
                <div class="row" style="margin-top: 10px;" ng-show="diff.diffs.createItems.length > 0">
L
lepdou 已提交
114 115 116
                    <div class="form-horizontal">
                        <label class="col-sm-2 control-label">新增的配置</label>
                        <div class="col-sm-9">
L
lepdou 已提交
117
                            <table class="table table-bordered table-striped table-hover">
L
lepdou 已提交
118 119 120 121
                                <thead>
                                <tr>
                                    <td>key</td>
                                    <td>value</td>
L
lepdou 已提交
122
                                    <td>comment</td>
L
lepdou 已提交
123 124 125
                                </tr>
                                </thead>
                                <tbody>
L
lepdou 已提交
126 127 128 129
                                <tr ng-repeat="createItem in diff.diffs.createItems">
                                    <td width="30%">{{createItem.key}}</td>
                                    <td width="40%">{{createItem.value}}</td>
                                    <td width="30%">{{createItem.comment}}</td>
L
lepdou 已提交
130 131 132 133 134 135 136
                                </tr>
                                </tbody>
                            </table>

                        </div>
                    </div>
                </div>
L
lepdou 已提交
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
                <div class="row" style="margin-top: 10px;" ng-show="diff.diffs.updateItems.length > 0">
                    <div class="form-horizontal">
                        <label class="col-sm-2 control-label">更新的配置</label>
                        <div class="col-sm-9">
                            <table class="table table-bordered table-striped table-hover">
                                <thead>
                                <tr>
                                    <td>key</td>
                                    <td>value</td>
                                    <td>comment</td>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="updateItem in diff.diffs.updateItems">
                                    <td width="30%">{{updateItem.key}}</td>
                                    <td width="40%">{{updateItem.value}}</td>
                                    <td width="30%">{{updateItem.comment}}</td>
                                </tr>
                                </tbody>
                            </table>
L
lepdou 已提交
157 158 159 160 161 162 163 164

                        </div>
                    </div>
                </div>
            </div>


            <!--step 3-->
L
lepdou 已提交
165
            <div class="row text-center" ng-show="syncItemStep == 3 && syncSuccess">
L
lepdou 已提交
166
                <img src="../img/sync-succ.png" style="height: 100px; width: 100px">
167
                <h3>同步成功!</h3>
L
lepdou 已提交
168 169 170
            </div>
            <div class="row text-center" ng-show="syncItemStep == 3 && !syncSuccess">
                <img src="../img/sync-error.png" style="height: 100px; width: 100px">
171
                <h3>同步失败!</h3>
L
lepdou 已提交
172 173 174 175 176 177
            </div>

        </div>
    </section>
</div>

L
lepdou 已提交
178
<div ng-include="'../views/common/footer.html'"></div>
L
lepdou 已提交
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

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

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

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

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

<!--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/ConfigService.js"></script>
<script type="application/javascript" src="../scripts/AppUtils.js"></script>
<script type="application/javascript" src="../scripts/controller/app/SyncConfigController.js"></script>

<script type="application/javascript" src="../scripts/PageCommon.js"></script>
</body>
</html>