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
9934dfd9
Commit
9934dfd9
authored
Sep 06, 2016
by
Jason Song
Committed by
GitHub
Sep 06, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #403 from lepdou/0905
portal bugfix:nav search app & add cluster tips
parents
5935296f
d47273cf
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
21 deletions
+98
-21
config.html
apollo-portal/src/main/resources/static/config.html
+38
-5
ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+28
-5
ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+27
-0
directive.js
.../src/main/resources/static/scripts/directive/directive.js
+3
-6
nav.html
...lo-portal/src/main/resources/static/views/common/nav.html
+1
-4
namespace-panel.html
...ain/resources/static/views/component/namespace-panel.html
+1
-1
No files found.
apollo-portal/src/main/resources/static/config.html
View file @
9934dfd9
...
...
@@ -86,8 +86,37 @@
</div>
<!--namespaces-->
<div
class=
"col-md-9 col-xs-9 col-sm-9 config-item-container hide"
ng-controller=
"ConfigNamespaceController"
>
<div
class=
"alert alert-warning alert-dismissible"
role=
"alert"
ng-show=
"(!hideTip || !hideTip[pageContext.appId][pageContext.clusterName]) && envMapClusters[pageContext.env]"
>
<button
class=
"btn btn-sm btn-default pull-right"
style=
"margin-top: -7px;margin-right:-15px;"
ng-click=
"closeTip(pageContext.clusterName)"
>
不再提示
</button>
<!--default cluster tip -->
<div
ng-show=
"pageContext.clusterName == 'default'"
>
<strong>
注意:
</strong>
所有不属于
<span
ng-bind=
"envMapClusters[pageContext.env]"
></span>
集群的实例会使用default集群(当前页面)的配置,属于
<span
ng-bind=
"envMapClusters[pageContext.env]"
></span>
的实例会使用对应集群的配置!
</div>
<!--custom cluster tip-->
<div
ng-show=
"pageContext.clusterName != 'default'"
>
<strong>
注意:
</strong>
属于
<span
ng-bind=
"pageContext.clusterName"
></span>
集群的实例只会使用
<span
ng-bind=
"pageContext.clusterName"
></span>
集群(当前页面)的配置,只有当对应namespace在当前集群没有发布过配置时,才会使用default集群的配置!
</div>
</div>
<div
ng-repeat=
"namespace in namespaces"
>
<apollonspanel
namespace=
"namespace"
app-id=
"pageContext.appId"
env=
"pageContext.env"
cluster=
"pageContext.clusterName"
...
...
@@ -134,10 +163,12 @@
<div
class=
"col-sm-2 control-label"
ng-if=
"!toReleaseNamespace.isPropertiesFormat"
>
<div
class=
"row"
>
<div
class=
"btn-group btn-group-xs"
style=
"padding-right: 10px"
role=
"group"
>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{active:releaseChangeViewType=='change'}"
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{active:releaseChangeViewType=='change'}"
ng-click=
"switchReleaseChangeViewType('change')"
>
查看变更
</button>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{active:releaseChangeViewType=='release'}"
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{active:releaseChangeViewType=='release'}"
ng-click=
"switchReleaseChangeViewType('release')"
>
发布的值
</button>
</div>
...
...
@@ -198,12 +229,14 @@
<!--file format -->
<div
ng-repeat=
"item in toReleaseNamespace.items"
ng-if=
"!toReleaseNamespace.isPropertiesFormat"
ng-show=
"releaseChangeViewType=='change'"
>
ng-if=
"!toReleaseNamespace.isPropertiesFormat"
ng-show=
"releaseChangeViewType=='change'"
>
<apollodiff
old-str=
"item.oldValue"
new-str=
"item.newValue"
apollo-id=
"'releaseStrDiff'"
></apollodiff>
</div>
<div
ng-repeat=
"item in toReleaseNamespace.items"
ng-if=
"!toReleaseNamespace.isPropertiesFormat"
ng-show=
"releaseChangeViewType=='release'"
>
ng-if=
"!toReleaseNamespace.isPropertiesFormat"
ng-show=
"releaseChangeViewType=='release'"
>
<textarea
class=
"form-control"
rows=
"20"
style=
"border-radius: 0px"
ng-disabled=
"true"
ng-show=
"item.newValue"
ng-bind=
"item.newValue"
>
</textarea>
...
...
@@ -309,7 +342,7 @@
</div>
<div
class=
"modal-footer"
>
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
关闭
</button>
<button
type=
"submit"
class=
"btn btn-primary"
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
View file @
9934dfd9
...
...
@@ -6,21 +6,23 @@ application_module.controller("ConfigBaseInfoController",
var
appId
=
AppUtil
.
parseParams
(
$location
.
$$url
).
appid
;
$rootScope
.
hideTip
=
JSON
.
parse
(
localStorage
.
getItem
(
"hideTip"
));
//save user recent visited apps
var
VISITED_APPS_STORAGE_KEY
=
"VisitedApps"
;
var
visitedApps
=
JSON
.
parse
(
localStorage
.
getItem
(
VISITED_APPS_STORAGE_KEY
));
var
hasSaved
=
false
;
if
(
visitedApps
){
if
(
visitedApps
)
{
visitedApps
.
forEach
(
function
(
app
)
{
if
(
app
==
appId
){
if
(
app
==
appId
)
{
hasSaved
=
true
;
return
;
}
});
}
else
{
}
else
{
visitedApps
=
[];
}
if
(
!
hasSaved
){
if
(
!
hasSaved
)
{
visitedApps
.
push
(
appId
);
localStorage
.
setItem
(
VISITED_APPS_STORAGE_KEY
,
...
...
@@ -78,7 +80,8 @@ application_module.controller("ConfigBaseInfoController",
parentNode
=
[];
//default selection from session storage or first env & first cluster
if
(
pageContext
.
env
==
env
.
env
&&
pageContext
.
clusterName
==
cluster
.
name
)
{
if
(
pageContext
.
env
==
env
.
env
&&
pageContext
.
clusterName
==
cluster
.
name
)
{
clusterNode
.
state
=
{};
clusterNode
.
state
.
selected
=
true
;
}
...
...
@@ -94,6 +97,7 @@ application_module.controller("ConfigBaseInfoController",
navTree
.
push
(
node
);
});
//init treeview
$
(
'#treeview'
).
treeview
({
color
:
"#797979"
,
showBorder
:
true
,
...
...
@@ -125,6 +129,25 @@ application_module.controller("ConfigBaseInfoController",
}
});
var
envMapClusters
=
{};
navTree
.
forEach
(
function
(
node
)
{
if
(
node
.
nodes
&&
node
.
nodes
.
length
>
0
)
{
var
clusterNames
=
[];
node
.
nodes
.
forEach
(
function
(
cluster
)
{
if
(
cluster
.
text
!=
'default'
)
{
clusterNames
.
push
(
cluster
.
text
);
}
});
envMapClusters
[
node
.
text
]
=
clusterNames
.
join
(
","
);
}
});
$rootScope
.
envMapClusters
=
envMapClusters
;
},
function
(
result
)
{
toastr
.
error
(
AppUtil
.
errorMsg
(
result
),
"加载导航出错"
);
});
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
View file @
9934dfd9
...
...
@@ -43,11 +43,16 @@ application_module.controller("ConfigNamespaceController",
$scope
.
doItem
=
doItem
;
$scope
.
closeTip
=
closeTip
;
$scope
.
releaseBtnDisabled
=
false
;
$scope
.
rollbackBtnDisabled
=
false
;
$scope
.
addItemBtnDisabled
=
false
;
$scope
.
commitChangeBtnDisabled
=
false
;
init
();
function
init
()
{
PermissionService
.
get_app_role_users
(
$rootScope
.
pageContext
.
appId
)
.
then
(
function
(
result
)
{
var
masterUsers
=
''
;
...
...
@@ -63,6 +68,10 @@ application_module.controller("ConfigNamespaceController",
$scope
.
currentUser
=
result
.
userId
;
});
}
function
refreshNamespaces
(
viewType
)
{
if
(
$rootScope
.
pageContext
.
env
==
''
)
{
return
;
...
...
@@ -349,6 +358,24 @@ application_module.controller("ConfigNamespaceController",
return
true
;
}
function
closeTip
(
clusterName
)
{
var
hideTip
=
JSON
.
parse
(
localStorage
.
getItem
(
"hideTip"
));
if
(
!
hideTip
){
hideTip
=
{};
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
if
(
!
hideTip
[
$rootScope
.
pageContext
.
appId
]){
hideTip
[
$rootScope
.
pageContext
.
appId
]
=
{};
}
hideTip
[
$rootScope
.
pageContext
.
appId
][
clusterName
]
=
true
;
$rootScope
.
hideTip
=
hideTip
;
localStorage
.
setItem
(
"hideTip"
,
JSON
.
stringify
(
hideTip
));
}
$
(
'.config-item-container'
).
removeClass
(
'hide'
);
}]);
apollo-portal/src/main/resources/static/scripts/directive/directive.js
View file @
9934dfd9
...
...
@@ -43,14 +43,11 @@ directive_module.directive('apollonav', function ($compile, $window, toastr, App
scope
.
jumpToConfigPage
=
function
()
{
if
(
selectedApp
.
appId
)
{
var
needReloadPage
=
false
;
if
(
$window
.
location
.
href
.
indexOf
(
"config.html"
)
>
-
1
)
{
needReloadPage
=
true
;
}
$window
.
location
.
href
=
'/config.html?#appid='
+
selectedApp
.
appId
;
if
(
needReloadPage
)
{
$window
.
location
.
hash
=
"appid="
+
selectedApp
.
appId
;
$window
.
location
.
reload
();
}
else
{
$window
.
location
.
href
=
'/config.html?#appid='
+
selectedApp
.
appId
;
}
}
};
...
...
apollo-portal/src/main/resources/static/views/common/nav.html
View file @
9934dfd9
...
...
@@ -4,15 +4,12 @@
<a
class=
"navbar-brand logo"
href=
"/"
></a>
</div>
<style>
</style>
<div
class=
"collapse navbar-collapse"
id=
"bs-example-navbar-collapse-1"
>
<ul
class=
"nav navbar-nav navbar-right"
>
<li>
<a
href=
"http://conf.ctripcorp.com/display/FRAM/Apollo"
target=
"_blank"
>
<span
class=
"glyphicon glyphicon-question-sign"
></span>
Help
<span
class=
"glyphicon glyphicon-question-sign"
></span>
帮助
</a>
</li>
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel.html
View file @
9934dfd9
...
...
@@ -31,7 +31,7 @@
</button>
<button
type=
"button"
class=
"btn btn-default btn-sm J_tableview_btn"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"回滚配置"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"回滚
已发布
配置"
ng-show=
"namespace.hasReleasePermission"
ng-click=
"preRollback(namespace)"
>
<img
src=
"img/rollback.png"
>
...
...
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