Commit 2f451b88 by Jason Song Committed by GitHub

Merge pull request #293 from lepdou/0620_27

change history type
parents 5410b4e8 5737e4c1
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</header> </header>
<div class="panel-body"> <div class="panel-body">
<form class="form-horizontal" ng-submit="create()"> <form class="form-horizontal" ng-show="step == 1" ng-submit="create()">
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label"> <label class="col-sm-2 control-label">
<apollorequiredfiled></apollorequiredfiled> <apollorequiredfiled></apollorequiredfiled>
...@@ -57,8 +57,9 @@ ...@@ -57,8 +57,9 @@
<div class="col-sm-5"> <div class="col-sm-5">
<table class="table table-hover" style="width: 100px"> <table class="table table-hover" style="width: 100px">
<tbody> <tbody>
<tr style="cursor: pointer" ng-repeat="env in envs"> <tr style="cursor: pointer" ng-repeat="env in envs" ng-click="toggleEnvCheckedStatus(env)">
<td width="10%"><input type="checkbox" ng-click="switchChecked(env)"></td> <td width="10%"><input type="checkbox" ng-checked="env.checked"
ng-click="switchChecked(env, $event)"></td>
<td width="30%" ng-bind="env.name"></td> <td width="30%" ng-bind="env.name"></td>
</tr> </tr>
</tbody> </tbody>
...@@ -73,6 +74,10 @@ ...@@ -73,6 +74,10 @@
</div> </div>
</div> </div>
</form> </form>
<div class="row text-center" ng-show="step == 2">
<img src="img/sync-succ.png" style="height: 100px; width: 100px">
<h3>创建成功!</h3>
</div>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -269,14 +269,6 @@ ...@@ -269,14 +269,6 @@
<!--历史修改视图--> <!--历史修改视图-->
<div class="J_historyview history-view" ng-show="namespace.viewType == 'history'"> <div class="J_historyview history-view" ng-show="namespace.viewType == 'history'">
<div class="text-right">
<span class="label label-primary change-type-mark">&nbsp;</span>
<small>新增&nbsp;</small>
<span class="label label-info change-type-mark">&nbsp;</span>
<small>更新&nbsp;</small>
<span class="label label-danger change-type-mark">&nbsp;</span>
<small>删除&nbsp;</small>
</div>
<div class="media" ng-repeat="commits in namespace.commits"> <div class="media" ng-repeat="commits in namespace.commits">
<div class="media-body"> <div class="media-body">
...@@ -311,8 +303,8 @@ ...@@ -311,8 +303,8 @@
<tr ng-repeat="item in commits.changeSets.createItems" <tr ng-repeat="item in commits.changeSets.createItems"
ng-show="item.key || item.comment"> ng-show="item.key || item.comment">
<td width="2%" title="新增的配置"> <td width="2%">
<span class="label label-primary change-type-mark">&nbsp;</span> 新增
</td> </td>
<td width="20%" title="{{item.key}}"> <td width="20%" title="{{item.key}}">
...@@ -331,8 +323,8 @@ ...@@ -331,8 +323,8 @@
</td> </td>
</tr> </tr>
<tr ng-repeat="item in commits.changeSets.updateItems"> <tr ng-repeat="item in commits.changeSets.updateItems">
<td width="2%" title="更新的配置"> <td width="2%">
<span class="label label-info change-type-mark">&nbsp;</span> 更新
</td> </td>
<td width="20%" title="{{item.newItem.key}}"> <td width="20%" title="{{item.newItem.key}}">
<span ng-bind="item.newItem.key | limitTo: 250"></span> <span ng-bind="item.newItem.key | limitTo: 250"></span>
...@@ -353,8 +345,8 @@ ...@@ -353,8 +345,8 @@
</tr> </tr>
<tr ng-repeat="item in commits.changeSets.deleteItems" <tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment"> ng-show="item.key || item.comment">
<td width="2%" title="删除的配置"> <td width="2%">
<span class="label label-danger change-type-mark">&nbsp;</span> 删除
</td> </td>
<td width="20%" title="{{item.key}}"> <td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span> <span ng-bind="item.key | limitTo: 250"></span>
......
...@@ -7,6 +7,8 @@ cluster_module.controller('ClusterController', ...@@ -7,6 +7,8 @@ cluster_module.controller('ClusterController',
var params = AppUtil.parseParams($location.$$url); var params = AppUtil.parseParams($location.$$url);
$scope.appId = params.appid; $scope.appId = params.appid;
$scope.step = 1;
EnvService.find_all_envs().then(function (result) { EnvService.find_all_envs().then(function (result) {
$scope.envs = []; $scope.envs = [];
result.forEach(function (env) { result.forEach(function (env) {
...@@ -19,7 +21,12 @@ cluster_module.controller('ClusterController', ...@@ -19,7 +21,12 @@ cluster_module.controller('ClusterController',
$scope.clusterName = ''; $scope.clusterName = '';
$scope.switchChecked = function (env) { $scope.switchChecked = function (env, $event) {
env.checked = !env.checked;
$event.stopPropagation();
};
$scope.toggleEnvCheckedStatus = function (env) {
env.checked = !env.checked; env.checked = !env.checked;
}; };
...@@ -34,11 +41,12 @@ cluster_module.controller('ClusterController', ...@@ -34,11 +41,12 @@ cluster_module.controller('ClusterController',
appId: $scope.appId appId: $scope.appId
}).then(function (result) { }).then(function (result) {
toastr.success(env.name, "集群创建成功"); toastr.success(env.name, "集群创建成功");
$scope.step = 2;
}, function (result) { }, function (result) {
toastr.error(AppUtil.errorMsg(result), "集群创建失败"); toastr.error(AppUtil.errorMsg(result), "集群创建失败");
}) })
} }
}) });
if (noEnvChecked){ if (noEnvChecked){
toastr.warning("请选择环境"); toastr.warning("请选择环境");
......
...@@ -131,14 +131,13 @@ directive_module.directive('apolloclusterselector', function ($compile, $window, ...@@ -131,14 +131,13 @@ directive_module.directive('apolloclusterselector', function ($compile, $window,
defaultCheckedCluster: '=apolloDefaultCheckedCluster' defaultCheckedCluster: '=apolloDefaultCheckedCluster'
}, },
link: function (scope, element, attrs) { link: function (scope, element, attrs) {
////// load env //////
scope.$watch("defaultCheckedEnv", refreshClusterList);
scope.$watch("defaultCheckedEnv", function (newValue, oldValue) { scope.$watch("defaultCheckedCluster", refreshClusterList);
refreshClusterList();
});
refreshClusterList(); refreshClusterList();
////// load env //////
function refreshClusterList() { function refreshClusterList() {
AppService.load_nav_tree(scope.appId).then(function (result) { AppService.load_nav_tree(scope.appId).then(function (result) {
scope.clusters = []; scope.clusters = [];
...@@ -246,7 +245,6 @@ directive_module.directive('apolloentrance', function ($compile, $window) { ...@@ -246,7 +245,6 @@ directive_module.directive('apolloentrance', function ($compile, $window) {
href: '=apolloHref' href: '=apolloHref'
}, },
link: function (scope, element, attrs) { link: function (scope, element, attrs) {
console.log(scope.title);
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment