提交 605847dd 编写于 作者: L lepdou

Merge pull request #172 from lepdou/lepdou_master

隐藏没有完成的功能的入口 & 样式优化
...@@ -4,7 +4,6 @@ application_module.controller("AppConfigController", ...@@ -4,7 +4,6 @@ application_module.controller("AppConfigController",
var appId = AppUtil.parseParams($location.$$url).appid; var appId = AppUtil.parseParams($location.$$url).appid;
var currentUser = 'test_user';
var pageContext = { var pageContext = {
appId: appId, appId: appId,
env: '', env: '',
...@@ -140,8 +139,7 @@ application_module.controller("AppConfigController", ...@@ -140,8 +139,7 @@ application_module.controller("AppConfigController",
itemCnt ++; itemCnt ++;
}); });
itemCnt > 30 ? 30 : itemCnt; itemCnt = itemCnt > 30 ? 30 : itemCnt;
itemCnt < 9 ? 8 : itemCnt;
namespace.itemCnt = itemCnt + 3; namespace.itemCnt = itemCnt + 3;
return result; return result;
} }
......
...@@ -61,8 +61,15 @@ sync_item_module.controller("SyncItemController", ...@@ -61,8 +61,15 @@ sync_item_module.controller("SyncItemController",
}; };
$scope.diff = function () { $scope.diff = function () {
$scope.hasDiff = false;
ConfigService.diff($scope.pageContext.namespaceName, parseSyncSourceData()).then(function (result) { ConfigService.diff($scope.pageContext.namespaceName, parseSyncSourceData()).then(function (result) {
$scope.diffs = result; $scope.diffs = result;
result.forEach(function (diff) {
if (!$scope.hasDiff) {
$scope.hasDiff = diff.diffs.createItems.length + diff.diffs.updateItems.length > 0;
}
});
$scope.syncItemNextStep(1); $scope.syncItemNextStep(1);
}, function (result) { }, function (result) {
toastr.error(AppUtil.errorMsg(result)); toastr.error(AppUtil.errorMsg(result));
......
...@@ -43,7 +43,6 @@ a { ...@@ -43,7 +43,6 @@ a {
.footer { .footer {
width: 100%; width: 100%;
height: 75px; height: 75px;
margin-top: -75px;
padding-top: 25px; padding-top: 25px;
} }
......
...@@ -75,24 +75,24 @@ ...@@ -75,24 +75,24 @@
</div> </div>
</a> </a>
<a class="list-group-item" target="_blank" href="/views/app.html?#/appid={{app.appId}}"> <!--<a class="list-group-item" target="_blank" href="/views/app.html?#/appid={{app.appId}}">-->
<div class="row"> <!--<div class="row">-->
<div class="col-md-2"><img src="../img/plus.png" class="i-20"></div> <!--<div class="col-md-2"><img src="../img/plus.png" class="i-20"></div>-->
<div class="col-md-7 hidden-xs"> <!--<div class="col-md-7 hidden-xs">-->
<p class="apps-description">添加集群</p> <!--<p class="apps-description">添加集群</p>-->
</div> <!--</div>-->
</div> <!--</div>-->
</a> <!--</a>-->
<a class="list-group-item" target="_blank" href="/views/app.html?#/appid={{app.appId}}"> <!--<a class="list-group-item" target="_blank" href="/views/app.html?#/appid={{app.appId}}">-->
<div class="row"> <!--<div class="row">-->
<div class="col-md-2"><img src="../img/plus.png" class="i-20"></div> <!--<div class="col-md-2"><img src="../img/plus.png" class="i-20"></div>-->
<div class="col-md-7 hidden-xs"> <!--<div class="col-md-7 hidden-xs">-->
<p class="apps-description">添加Namespace</p> <!--<p class="apps-description">添加Namespace</p>-->
</div> <!--</div>-->
</div> <!--</div>-->
</a> <!--</a>-->
</section> </section>
</div> </div>
...@@ -114,19 +114,19 @@ ...@@ -114,19 +114,19 @@
ng-disabled="namespace.isTextEditing" ng-disabled="namespace.isTextEditing"
ng-click="prepareReleaseNamespace(namespace)">发布 ng-click="prepareReleaseNamespace(namespace)">发布
</button> </button>
<button type="button" <!--<button type="button"-->
class="btn btn-default btn-sm J_tableview_btn">回滚 <!--class="btn btn-default btn-sm J_tableview_btn">回滚-->
</button> <!--</button>-->
<button type="button" <!--<button type="button"-->
class="btn btn-default btn-sm J_historyview_btn"> <!--class="btn btn-default btn-sm J_historyview_btn">-->
查看历史版本 <!--查看历史版本-->
</button> <!--</button>-->
</div> </div>
<div class="btn-group" role="group" aria-label="..."> <div class="btn-group" role="group" aria-label="...">
<div class="btn-group" role="group"> <div class="btn-group" role="group">
<button type="button" <!--<button type="button"-->
class="btn btn-default btn-sm J_tableview_btn">授权 <!--class="btn btn-default btn-sm J_tableview_btn">授权-->
</button> <!--</button>-->
<a type="button" target="_blank" <a type="button" target="_blank"
href="sync.html?#/appid={{pageContext.appId}}&env={{pageContext.env}}&clusterName={{pageContext.clusterName}}&namespaceName={{namespace.namespace.namespaceName}}" href="sync.html?#/appid={{pageContext.appId}}&env={{pageContext.env}}&clusterName={{pageContext.clusterName}}&namespaceName={{namespace.namespace.namespaceName}}"
class="btn btn-default btn-sm J_tableview_btn">同步 class="btn btn-default btn-sm J_tableview_btn">同步
...@@ -142,11 +142,11 @@ ...@@ -142,11 +142,11 @@
class="btn btn-default btn-sm J_tableview_btn" class="btn btn-default btn-sm J_tableview_btn"
ng-click="switchView(namespace, 'table')">表格 ng-click="switchView(namespace, 'table')">表格
</button> </button>
<button type="button" <!--<button type="button"-->
class="btn btn-default btn-sm J_historyview_btn" <!--class="btn btn-default btn-sm J_historyview_btn"-->
ng-click="switchView(namespace, 'history')"> <!--ng-click="switchView(namespace, 'history')">-->
更改日志 <!--更改日志-->
</button> <!--</button>-->
</div> </div>
</div> </div>
</div> </div>
...@@ -202,16 +202,21 @@ ...@@ -202,16 +202,21 @@
</thead> </thead>
<tbody> <tbody>
<tr title="点击查看" data-toggle="modal" data-target="#oldValueModal" ng-repeat="config in namespace.items" ng-class="{warning:config.modified}" <tr title="点击查看" data-toggle="modal" data-target="#oldValueModal"
ng-if="config.item.key" ng-click="watchItem(config.item.key, config.item.value, config.oldValue)"> ng-repeat="config in namespace.items" ng-class="{warning:config.modified}"
ng-if="config.item.key"
ng-click="watchItem(config.item.key, config.item.value, config.oldValue)">
<td width="25%"> <td width="25%">
{{config.item.key | limitTo: 20}} {{config.item.key.length > 20 ? '...' : ''}} {{config.item.key | limitTo: 20}} {{config.item.key.length > 20 ? '...' :
''}}
</td> </td>
<td width="30%"> <td width="30%">
{{config.item.value | limitTo: 20}} {{config.item.value.length > 20 ? '...' : ''}} {{config.item.value | limitTo: 20}} {{config.item.value.length > 20 ? '...'
: ''}}
</td> </td>
<td width="20%"> <td width="20%">
{{config.item.comment | limitTo: 20}} {{config.item.comment.length > 20 ? '...' : ''}} {{config.item.comment | limitTo: 20}} {{config.item.comment.length > 20 ?
'...' : ''}}
</td> </td>
<td width="10%"> <td width="10%">
{{config.item.lastModifiedBy}} {{config.item.lastModifiedBy}}
...@@ -334,7 +339,8 @@ ...@@ -334,7 +339,8 @@
<h4 class="modal-title">发布</h4> <h4 class="modal-title">发布</h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<input type="text" class="form-control" placeholder="input release title" ng-model="releaseTitle" required="required"> <input type="text" class="form-control" placeholder="input release title"
ng-model="releaseTitle" required="required">
<textarea rows="4" class="form-control" style="margin-top: 15px;" ng-model="releaseComment" <textarea rows="4" class="form-control" style="margin-top: 15px;" ng-model="releaseComment"
placeholder="input release log...."></textarea> placeholder="input release log...."></textarea>
</div> </div>
...@@ -377,9 +383,7 @@ ...@@ -377,9 +383,7 @@
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
......
...@@ -10,28 +10,28 @@ ...@@ -10,28 +10,28 @@
<title>同步配置</title> <title>同步配置</title>
</head> </head>
<body ng-controller="SyncItemController"> <body>
<div ng-include="'common/nav.html'"></div> <div ng-include="'common/nav.html'"></div>
<div class="container-fluid apollo-container"> <div class="container-fluid apollo-container" ng-controller="SyncItemController">
<section class="panel col-md-offset-1 col-md-10"> <section class="panel col-md-offset-1 col-md-10">
<header class="panel-heading"> <header class="panel-heading">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-7">
<h4 class="modal-title">同步配置 <h4 class="modal-title">同步配置
<small ng-show="syncItemStep == 1">(第一步:选择同步信息)</small> <small ng-show="syncItemStep == 1">(第一步:选择同步信息)</small>
<small ng-show="syncItemStep == 2">(第二步:检查Diff)</small> <small ng-show="syncItemStep == 2">(第二步:检查Diff)</small>
</h4> </h4>
</div> </div>
<div class="col-md-9 text-right"> <div class="col-md-5 text-right">
<button type="button" class="btn btn-primary" ng-show="syncItemStep > 1 && syncItemStep < 3" <button type="button" class="btn btn-primary" ng-show="syncItemStep > 1 && syncItemStep < 3"
ng-click="syncItemNextStep(-1)">上一步 ng-click="syncItemNextStep(-1)">上一步
</button> </button>
<button type="button" class="btn btn-primary" ng-show="syncItemStep < 2" <button type="button" class="btn btn-primary" ng-show="syncItemStep < 2"
ng-click="diff()">下一步 ng-click="diff()">下一步
</button> </button>
<button type="button" class="btn btn-success" ng-show="syncItemStep == 2" ng-click="syncItems()">同步 <button type="button" class="btn btn-success" ng-show="syncItemStep == 2 && hasDiff" ng-click="syncItems()">同步
</button> </button>
<button type="button" class="btn btn-primary" data-dismiss="modal" ng-show="syncItemStep == 3" <button type="button" class="btn btn-primary" data-dismiss="modal" ng-show="syncItemStep == 3"
ng-click="backToAppHomePage()">返回 ng-click="backToAppHomePage()">返回
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
<tr ng-repeat="item in sourceItems"> <tr ng-repeat="item in sourceItems">
<td width="10%"><input type="checkbox" ng-checked="item.checked" <td width="10%"><input type="checkbox" ng-checked="item.checked"
ng-click="switchSelect(item)"></td> ng-click="switchSelect(item)"></td>
<td width="20%">{{item.key}}</td> <td width="20%">{{item.key | limitTo: 30}} {{item.key.length > 30 ? '...' : ''}}</td>
<td width="50%">{{item.value | limitTo: 36}} {{item.value.length > 36 ? '...' : ''}} <td width="50%">{{item.value | limitTo: 45}} {{item.value.length > 45 ? '...' : ''}}
</td> </td>
<td width="20%">{{item.comment | limitTo: 15}}{{item.comment.length > 15 ? '...' : <td width="20%">{{item.comment | limitTo: 15}}{{item.comment.length > 15 ? '...' :
''}} ''}}
...@@ -105,11 +105,11 @@ ...@@ -105,11 +105,11 @@
<!--step 2--> <!--step 2-->
<div class="row" ng-show="syncItemStep == 2" ng-repeat="diff in diffs"> <div class="row" ng-show="syncItemStep == 2" ng-repeat="diff in diffs">
<h4 class="text-center">环境:{{diff.namespace.env}} 集群:{{diff.namespace.clusterName}}</h4> <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>
<hr> <hr>
<div class="row text-center" style="margin-top: 10px;" ng-show="diff.diffs.createItems.length == 0 && diff.diffs.updateItems.length == 0">
<h5>无更新的配置</h5>
</div>
<div class="row" style="margin-top: 10px;" ng-show="diff.diffs.createItems.length > 0"> <div class="row" style="margin-top: 10px;" ng-show="diff.diffs.createItems.length > 0">
<div class="form-horizontal"> <div class="form-horizontal">
<label class="col-sm-2 control-label">新增的配置</label> <label class="col-sm-2 control-label">新增的配置</label>
...@@ -164,11 +164,11 @@ ...@@ -164,11 +164,11 @@
<!--step 3--> <!--step 3-->
<div class="row text-center" ng-show="syncItemStep == 3 && syncSuccess"> <div class="row text-center" ng-show="syncItemStep == 3 && syncSuccess">
<img src="../img/sync-succ.png" style="height: 100px; width: 100px"> <img src="../img/sync-succ.png" style="height: 100px; width: 100px">
<h3 >同步成功!</h3> <h3>同步成功!</h3>
</div> </div>
<div class="row text-center" ng-show="syncItemStep == 3 && !syncSuccess"> <div class="row text-center" ng-show="syncItemStep == 3 && !syncSuccess">
<img src="../img/sync-error.png" style="height: 100px; width: 100px"> <img src="../img/sync-error.png" style="height: 100px; width: 100px">
<h3 >同步失败!</h3> <h3>同步失败!</h3>
</div> </div>
</div> </div>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册