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
88e2987d
Commit
88e2987d
authored
Jul 14, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
刷新页面维持nav选择 & 发布历史兼容文本类型的NS
parent
13ce22ab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
21 deletions
+60
-21
history.html
apollo-portal/src/main/resources/static/config/history.html
+8
-2
ConfigBaseInfoController.js
...tic/scripts/controller/config/ConfigBaseInfoController.js
+34
-17
ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+9
-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 @
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
View file @
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
View file @
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
View file @
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
View file @
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"
>
...
...
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