Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zhangjian1949
apollo
提交
88e2987d
apollo
项目概览
zhangjian1949
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,体验更适合开发者的 AI 搜索 >>
提交
88e2987d
编写于
7月 14, 2016
作者:
L
lepdou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
刷新页面维持nav选择 & 发布历史兼容文本类型的NS
上级
13ce22ab
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
60 addition
and
21 deletion
+60
-21
apollo-portal/src/main/resources/static/config/history.html
apollo-portal/src/main/resources/static/config/history.html
+8
-2
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+34
-17
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+9
-1
apollo-portal/src/main/resources/static/styles/common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+8
-0
apollo-portal/src/main/resources/static/views/component/namespace-panel.html
...ain/resources/static/views/component/namespace-panel.html
+1
-1
未找到文件。
apollo-portal/src/main/resources/static/config/history.html
浏览文件 @
88e2987d
...
...
@@ -53,7 +53,7 @@
</div>
<table
class=
"table table-hover table-bordered table-striped"
>
<table
class=
"table table-hover table-bordered table-striped"
ng-show=
"!isTextFile"
>
<tr
ng-repeat=
"item in release.items"
>
<td
width=
"30%"
ng-bind=
"item.key"
>
...
...
@@ -62,14 +62,20 @@
</td>
</tr>
</table>
<textarea
class=
"form-control no-radius"
rows=
"15"
ng-show=
"isTextFile"
ng-bind=
"release.items[0].value"
disabled
>
</textarea>
</div>
</div>
<div
class=
"text-center"
>
<div
class=
"text-center
load-more
"
>
<button
type=
"button"
class=
"btn btn-default"
ng-show=
"!hasLoadAll"
ng-click=
"loadMore()"
>
加载更多
<span
class=
"glyphicon glyphicon-menu-down"
></span>
</button>
</div>
<div
class=
"text-center"
ng-show=
"!releases.length"
>
<h4>
还没发布过哟~
</h4>
</div>
</div>
</section>
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ConfigBaseInfoController.js
浏览文件 @
88e2987d
...
...
@@ -5,10 +5,15 @@ application_module.controller("ConfigBaseInfoController",
AppUtil
)
{
var
appId
=
AppUtil
.
parseParams
(
$location
.
$$url
).
appid
;
//load session storage to recovery scene
var
env
=
sessionStorage
.
getItem
(
appId
+
"
+env
"
),
clusterName
=
sessionStorage
.
getItem
(
appId
+
"
+cluster
"
);
var
pageContext
=
{
appId
:
appId
,
env
:
''
,
clusterName
:
'
default
'
env
:
env
?
env
:
''
,
clusterName
:
clusterName
?
clusterName
:
'
default
'
};
$rootScope
.
pageContext
=
pageContext
;
...
...
@@ -19,12 +24,14 @@ application_module.controller("ConfigBaseInfoController",
var
navTree
=
[];
var
nodes
=
AppUtil
.
collectData
(
result
);
if
(
!
nodes
||
nodes
.
length
==
0
){
toastr
.
error
(
"
加载
导航
信息出错
"
);
if
(
!
nodes
||
nodes
.
length
==
0
)
{
toastr
.
error
(
"
加载
环境
信息出错
"
);
return
;
}
//默认显示第一个环境的default集群的
pageContext
.
env
=
nodes
[
0
].
env
;
//default first env if session storage is empty
if
(
!
pageContext
.
env
)
{
pageContext
.
env
=
nodes
[
0
].
env
;
}
$rootScope
.
refreshNamespaces
();
nodes
.
forEach
(
function
(
env
,
envIdx
)
{
...
...
@@ -32,33 +39,32 @@ application_module.controller("ConfigBaseInfoController",
return
;
}
var
node
=
{};
//first nav
node
.
text
=
env
.
env
;
// node.icon = 'glyphicon glyphicon-console';
var
clusterNodes
=
[];
//如果env下面只有一个default集群则不显示集群列表
if
(
env
.
clusters
&&
env
.
clusters
.
length
==
1
&&
env
.
clusters
[
0
].
name
==
'
default
'
)
{
if
(
envIdx
==
0
){
==
'
default
'
)
{
if
(
envIdx
==
0
)
{
node
.
state
=
{};
node
.
state
.
selected
=
true
;
}
node
.
selectable
=
true
;
}
else
{
node
.
selectable
=
false
;
//
second nav
//
cluster list
env
.
clusters
.
forEach
(
function
(
cluster
,
clusterIdx
)
{
var
clusterNode
=
{},
parentNode
=
[];
if
(
envIdx
==
0
&&
clusterIdx
==
0
){
//default selection from session storage or first env & first cluster
if
((
pageContext
.
env
&&
pageContext
.
env
==
env
.
env
&&
pageContext
.
clusterName
==
cluster
.
name
)
||
(
!
pageContext
.
env
&&
envIdx
==
0
&&
clusterIdx
==
0
))
{
clusterNode
.
state
=
{};
clusterNode
.
state
.
selected
=
true
;
}
clusterNode
.
text
=
cluster
.
name
;
// clusterNode.icon = 'glyphicon glyphicon-object-align-vertical';
parentNode
.
push
(
node
.
text
);
clusterNode
.
tags
=
[
'
集群
'
];
clusterNode
.
parentNode
=
parentNode
;
...
...
@@ -83,10 +89,21 @@ application_module.controller("ConfigBaseInfoController",
$rootScope
.
pageContext
.
clusterName
=
'
default
'
;
}
else
{
//second cluster node
$rootScope
.
pageContext
.
env
=
data
.
parentNode
[
0
];
$rootScope
.
pageContext
.
env
=
data
.
parentNode
[
0
];
$rootScope
.
pageContext
.
clusterName
=
data
.
text
;
}
//session storage
//appId+env = env
//appId+cluster = cluster
sessionStorage
.
setItem
(
$rootScope
.
pageContext
.
appId
+
"
+env
"
,
$rootScope
.
pageContext
.
env
);
sessionStorage
.
setItem
(
$rootScope
.
pageContext
.
appId
+
"
+cluster
"
,
$rootScope
.
pageContext
.
clusterName
);
$rootScope
.
refreshNamespaces
();
}
});
...
...
@@ -135,15 +152,15 @@ application_module.controller("ConfigBaseInfoController",
PermissionService
.
has_create_namespace_permission
(
appId
).
then
(
function
(
result
)
{
$scope
.
hasCreateNamespacePermission
=
result
.
hasPermission
;
},
function
(
result
)
{
});
PermissionService
.
has_create_cluster_permission
(
appId
).
then
(
function
(
result
)
{
$scope
.
hasCreateClusterPermission
=
result
.
hasPermission
;
},
function
(
result
)
{
});
PermissionService
.
has_assign_user_permission
(
appId
).
then
(
function
(
result
)
{
$scope
.
hasAssignUserPermission
=
result
.
hasPermission
;
},
function
(
result
)
{
...
...
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
浏览文件 @
88e2987d
...
...
@@ -14,7 +14,6 @@ release_history_module.controller("ReleaseHistoryController",
$scope
.
page
=
0
;
$scope
.
releases
=
[];
$scope
.
hasLoadAll
=
false
;
$scope
.
findReleases
=
findReleases
;
$scope
.
loadMore
=
loadMore
;
...
...
@@ -32,7 +31,16 @@ release_history_module.controller("ReleaseHistoryController",
$scope
.
hasLoadAll
=
true
;
return
;
}
var
hasParseNamepaceType
=
false
;
result
.
forEach
(
function
(
release
)
{
if
(
!
hasParseNamepaceType
){
$scope
.
isTextFile
=
release
.
baseInfo
.
namespaceName
.
indexOf
(
"
.xml
"
)
>
0
||
release
.
baseInfo
.
namespaceName
.
indexOf
(
"
.json
"
)
>
0
||
release
.
baseInfo
.
namespaceName
.
indexOf
(
"
.yml
"
)
>
0
||
release
.
baseInfo
.
namespaceName
.
indexOf
(
"
.yaml
"
)
>
0
;
hasParseNamepaceType
=
true
;
}
$scope
.
releases
.
push
(
release
);
})
},
function
(
result
)
{
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
88e2987d
...
...
@@ -395,6 +395,14 @@ table th {
padding-left
:
20px
;
}
.release-history
.panel-body
.load-more
{
margin-top
:
20px
;
}
.release-history
.media-body
textarea
{
margin-top
:
10px
;
}
.release-history
.icon
{
font-size
:
13px
;
}
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel.html
浏览文件 @
88e2987d
...
...
@@ -111,7 +111,7 @@
</header>
<!--text view-->
<!--只读模式下的文本内容,不替换换行符-->
<textarea
class=
"form-control
"
rows=
"{{namespace.itemCnt}}"
style=
"border-radius: 0px
"
<textarea
class=
"form-control
no-radius"
rows=
"{{namespace.itemCnt}}
"
ng-show=
"namespace.viewType == 'text' && !namespace.isTextEditing"
ng-disabled=
"!namespace.isTextEditing"
ng-model=
"namespace.text"
ng-bind=
"namespace.text"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录