Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wrr-cat
apollo
提交
9f15c41d
apollo
项目概览
wrr-cat
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
9f15c41d
编写于
7月 14, 2016
作者:
J
Jason Song
提交者:
GitHub
7月 14, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #327 from lepdou/history
刷新页面维持nav选择 & 发布历史兼容文本类型的NS
上级
299049ab
71b725af
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
53 addition
and
21 deletion
+53
-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
+30
-17
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+6
-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
浏览文件 @
9f15c41d
...
...
@@ -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
浏览文件 @
9f15c41d
...
...
@@ -5,10 +5,14 @@ application_module.controller("ConfigBaseInfoController",
AppUtil
)
{
var
appId
=
AppUtil
.
parseParams
(
$location
.
$$url
).
appid
;
//load session storage to recovery scene
var
scene
=
JSON
.
parse
(
sessionStorage
.
getItem
(
appId
));
var
pageContext
=
{
appId
:
appId
,
env
:
''
,
clusterName
:
'
default
'
env
:
scene
?
scene
.
env
:
''
,
clusterName
:
scene
?
scene
.
cluster
:
'
default
'
};
$rootScope
.
pageContext
=
pageContext
;
...
...
@@ -19,12 +23,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 +38,31 @@ 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
==
env
.
env
&&
pageContext
.
clusterName
==
cluster
.
name
)
{
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 +87,19 @@ 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
;
}
//storage scene
sessionStorage
.
setItem
(
$rootScope
.
pageContext
.
appId
,
JSON
.
stringify
({
env
:
$rootScope
.
pageContext
.
env
,
cluster
:
$rootScope
.
pageContext
.
clusterName
}));
$rootScope
.
refreshNamespaces
();
}
});
...
...
@@ -135,15 +148,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
浏览文件 @
9f15c41d
...
...
@@ -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,13 @@ release_history_module.controller("ReleaseHistoryController",
$scope
.
hasLoadAll
=
true
;
return
;
}
var
hasParseNamepaceType
=
false
;
result
.
forEach
(
function
(
release
)
{
if
(
!
hasParseNamepaceType
){
$scope
.
isTextFile
=
/
\.(
json|yaml|yml|xml
)
$/gi
.
test
(
release
.
baseInfo
.
namespaceName
);
hasParseNamepaceType
=
true
;
}
$scope
.
releases
.
push
(
release
);
})
},
function
(
result
)
{
...
...
apollo-portal/src/main/resources/static/styles/common-style.css
浏览文件 @
9f15c41d
...
...
@@ -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
浏览文件 @
9f15c41d
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录