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
9f15c41d
Commit
9f15c41d
authored
Jul 14, 2016
by
Jason Song
Committed by
GitHub
Jul 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #327 from lepdou/history
刷新页面维持nav选择 & 发布历史兼容文本类型的NS
parents
299049ab
71b725af
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
21 deletions
+53
-21
history.html
apollo-portal/src/main/resources/static/config/history.html
+8
-2
ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+30
-17
ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+6
-1
common-style.css
...-portal/src/main/resources/static/styles/common-style.css
+8
-0
namespace-panel.html
...ain/resources/static/views/component/namespace-panel.html
+1
-1
No files found.
apollo-portal/src/main/resources/static/config/history.html
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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"
>
...
...
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