Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
d47273cf
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d47273cf
编写于
9月 06, 2016
作者:
Z
zhangle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
default cluster tips
上级
9c0fe442
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
108 addition
and
25 deletion
+108
-25
apollo-portal/src/main/resources/static/config.html
apollo-portal/src/main/resources/static/config.html
+39
-6
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+32
-9
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js
...ic/scripts/controller/config/ConfigNamespaceController.js
+37
-10
未找到文件。
apollo-portal/src/main/resources/static/config.html
浏览文件 @
d47273cf
...
...
@@ -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,14 +229,16 @@
<!--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"
>
ng-disabled=
"true"
ng-show=
"item.newValue"
ng-bind=
"item.newValue"
>
</textarea>
</div>
...
...
@@ -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
浏览文件 @
d47273cf
...
...
@@ -6,23 +6,25 @@ 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
,
JSON
.
stringify
(
visitedApps
));
}
...
...
@@ -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
,
...
...
@@ -117,14 +121,33 @@ application_module.controller("ConfigBaseInfoController",
sessionStorage
.
setItem
(
$rootScope
.
pageContext
.
appId
,
JSON
.
stringify
({
env
:
$rootScope
.
pageContext
.
env
,
cluster
:
$rootScope
.
pageContext
.
clusterName
}));
env
:
$rootScope
.
pageContext
.
env
,
cluster
:
$rootScope
.
pageContext
.
clusterName
}));
$rootScope
.
refreshNamespaces
();
}
});
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
浏览文件 @
d47273cf
...
...
@@ -42,26 +42,35 @@ application_module.controller("ConfigNamespaceController",
$scope
.
createItem
=
createItem
;
$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
=
''
;
result
.
masterUsers
.
forEach
(
function
(
user
)
{
masterUsers
+=
user
.
userId
+
'
,
'
;
});
$scope
.
masterUsers
=
masterUsers
.
substring
(
0
,
masterUsers
.
length
-
1
);
},
function
(
result
)
{
PermissionService
.
get_app_role_users
(
$rootScope
.
pageContext
.
appId
)
.
then
(
function
(
result
)
{
var
masterUsers
=
''
;
result
.
masterUsers
.
forEach
(
function
(
user
)
{
masterUsers
+=
user
.
userId
+
'
,
'
;
});
$scope
.
masterUsers
=
masterUsers
.
substring
(
0
,
masterUsers
.
length
-
1
);
},
function
(
result
)
{
UserService
.
load_user
().
then
(
function
(
result
)
{
$scope
.
currentUser
=
result
.
userId
;
});
}
UserService
.
load_user
().
then
(
function
(
result
)
{
$scope
.
currentUser
=
result
.
userId
;
});
function
refreshNamespaces
(
viewType
)
{
if
(
$rootScope
.
pageContext
.
env
==
''
)
{
...
...
@@ -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
'
);
}]);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录