Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
5737e4c1
Commit
5737e4c1
authored
Jun 24, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix cluster default select
parent
b3b3a1a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
11 deletions
+22
-11
cluster.html
apollo-portal/src/main/resources/static/cluster.html
+8
-3
ClusterController.js
.../resources/static/scripts/controller/ClusterController.js
+10
-2
directive.js
apollo-portal/src/main/resources/static/scripts/directive.js
+4
-6
No files found.
apollo-portal/src/main/resources/static/cluster.html
View file @
5737e4c1
...
...
@@ -33,7 +33,7 @@
</header>
<div
class=
"panel-body"
>
<form
class=
"form-horizontal"
ng-submit=
"create()"
>
<form
class=
"form-horizontal"
ng-s
how=
"step == 1"
ng-s
ubmit=
"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>
...
...
apollo-portal/src/main/resources/static/scripts/controller/ClusterController.js
View file @
5737e4c1
...
...
@@ -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
(
"请选择环境"
);
...
...
apollo-portal/src/main/resources/static/scripts/directive.js
View file @
5737e4c1
...
...
@@ -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
);
}
}
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment