提交 2f451b88 编写于 作者: J Jason Song 提交者: GitHub

Merge pull request #293 from lepdou/0620_27

change history type
......@@ -33,7 +33,7 @@
</header>
<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">
<label class="col-sm-2 control-label">
<apollorequiredfiled></apollorequiredfiled>
......@@ -57,8 +57,9 @@
<div class="col-sm-5">
<table class="table table-hover" style="width: 100px">
<tbody>
<tr style="cursor: pointer" ng-repeat="env in envs">
<td width="10%"><input type="checkbox" ng-click="switchChecked(env)"></td>
<tr style="cursor: pointer" ng-repeat="env in envs" ng-click="toggleEnvCheckedStatus(env)">
<td width="10%"><input type="checkbox" ng-checked="env.checked"
ng-click="switchChecked(env, $event)"></td>
<td width="30%" ng-bind="env.name"></td>
</tr>
</tbody>
......@@ -73,6 +74,10 @@
</div>
</div>
</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>
......
......@@ -269,14 +269,6 @@
<!--历史修改视图-->
<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-body">
......@@ -311,8 +303,8 @@
<tr ng-repeat="item in commits.changeSets.createItems"
ng-show="item.key || item.comment">
<td width="2%" title="新增的配置">
<span class="label label-primary change-type-mark">&nbsp;</span>
<td width="2%">
新增
</td>
<td width="20%" title="{{item.key}}">
......@@ -331,8 +323,8 @@
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="2%" title="更新的配置">
<span class="label label-info change-type-mark">&nbsp;</span>
<td width="2%">
更新
</td>
<td width="20%" title="{{item.newItem.key}}">
<span ng-bind="item.newItem.key | limitTo: 250"></span>
......@@ -353,8 +345,8 @@
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="2%" title="删除的配置">
<span class="label label-danger change-type-mark">&nbsp;</span>
<td width="2%">
删除
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
......
......@@ -7,6 +7,8 @@ cluster_module.controller('ClusterController',
var params = AppUtil.parseParams($location.$$url);
$scope.appId = params.appid;
$scope.step = 1;
EnvService.find_all_envs().then(function (result) {
$scope.envs = [];
result.forEach(function (env) {
......@@ -19,7 +21,12 @@ cluster_module.controller('ClusterController',
$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;
};
......@@ -34,11 +41,12 @@ cluster_module.controller('ClusterController',
appId: $scope.appId
}).then(function (result) {
toastr.success(env.name, "集群创建成功");
$scope.step = 2;
}, function (result) {
toastr.error(AppUtil.errorMsg(result), "集群创建失败");
})
}
})
});
if (noEnvChecked){
toastr.warning("请选择环境");
......
......@@ -131,14 +131,13 @@ directive_module.directive('apolloclusterselector', function ($compile, $window,
defaultCheckedCluster: '=apolloDefaultCheckedCluster'
},
link: function (scope, element, attrs) {
////// load env //////
scope.$watch("defaultCheckedEnv", function (newValue, oldValue) {
refreshClusterList();
});
scope.$watch("defaultCheckedEnv", refreshClusterList);
scope.$watch("defaultCheckedCluster", refreshClusterList);
refreshClusterList();
////// load env //////
function refreshClusterList() {
AppService.load_nav_tree(scope.appId).then(function (result) {
scope.clusters = [];
......@@ -246,7 +245,6 @@ directive_module.directive('apolloentrance', function ($compile, $window) {
href: '=apolloHref'
},
link: function (scope, element, attrs) {
console.log(scope.title);
}
}
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册