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
10fc385c
Commit
10fc385c
authored
Dec 19, 2016
by
Jason Song
Committed by
GitHub
Dec 19, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #488 from lepdou/bugfix_publicnamespace
UI handle public namespace not exist situation
parents
7e4f6bcc
c8ed6bd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
147 additions
and
135 deletions
+147
-135
namespace-panel-directive.js
...ces/static/scripts/directive/namespace-panel-directive.js
+3
-4
namespace-panel-master-tab.html
...es/static/views/component/namespace-panel-master-tab.html
+144
-131
No files found.
apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js
View file @
10fc385c
...
...
@@ -222,7 +222,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
}
function
initLinkedNamespace
(
namespace
)
{
if
(
!
namespace
.
isPublic
||
!
namespace
.
isLinkedNamespace
)
{
if
(
!
namespace
.
isPublic
||
!
namespace
.
isLinkedNamespace
||
namespace
.
format
!=
'properties'
)
{
return
;
}
//load public namespace
...
...
@@ -237,12 +237,11 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
linkNamespaceItemKeys
.
push
(
key
);
});
publicNamespace
.
viewItems
=
[];
publicNamespace
.
items
.
forEach
(
function
(
item
)
{
var
key
=
item
.
item
.
key
;
if
(
key
){
if
(
key
)
{
publicNamespace
.
viewItems
.
push
(
item
);
}
...
...
@@ -250,7 +249,7 @@ function directive($window, toastr, AppUtil, EventManager, PermissionService, Na
if
(
item
.
isModified
||
item
.
isDeleted
)
{
publicNamespace
.
isModified
=
true
;
}
else
if
(
key
){
}
else
if
(
key
)
{
publicNamespace
.
hasPublishedItem
=
true
;
}
});
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel-master-tab.html
View file @
10fc385c
...
...
@@ -373,53 +373,129 @@
</div>
<!--link namespace's public namespace-->
<div
class=
"panel panel-default"
ng-if=
"namespace.isLinkedNamespace"
>
<div
class=
"panel-heading"
>
<div
class=
"row"
>
<div
class=
"padding-top-5 col-md-4"
>
公共的配置
<a
href=
"/config.html?#/appid={{namespace.publicNamespace.baseInfo.appId}}"
target=
"_blank"
>
<small>
(AppId:{{namespace.publicNamespace.baseInfo.appId}},
Cluster:{{namespace.publicNamespace.baseInfo.clusterName}})
</small>
</a>
</div>
<div
ng-if=
"namespace.isLinkedNamespace"
>
<div
class=
"panel panel-default"
ng-if=
"namespace.publicNamespace"
>
<div
class=
"panel-heading"
>
<div
class=
"row"
>
<div
class=
"padding-top-5 col-md-4"
>
公共的配置
<a
href=
"/config.html?#/appid={{namespace.publicNamespace.baseInfo.appId}}"
target=
"_blank"
>
<small>
(AppId:{{namespace.publicNamespace.baseInfo.appId}},
Cluster:{{namespace.publicNamespace.baseInfo.clusterName}})
</small>
</a>
</div>
<div
class=
"col-md-4 text-center"
>
<div
class=
"btn-group btn-group-sm"
role=
"group"
ng-show=
"namespace.publicNamespace.isModified"
>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{'active':namespace.publicNamespaceViewType == 'RELEASE'
<div
class=
"col-md-4 text-center"
>
<div
class=
"btn-group btn-group-sm"
role=
"group"
ng-show=
"namespace.publicNamespace.isModified"
>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{'active':namespace.publicNamespaceViewType == 'RELEASE'
|| !namespace.publicNamespaceViewType}"
ng-click=
"namespace.publicNamespaceViewType = 'RELEASE'"
>
已发布的配置
</button>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{'active':namespace.publicNamespaceViewType == 'NOT_RELEASE'}"
ng-click=
"namespace.publicNamespaceViewType = 'NOT_RELEASE'"
>
未发布的配置
</button>
ng-click=
"namespace.publicNamespaceViewType = 'RELEASE'"
>
已发布的配置
</button>
<button
type=
"button"
class=
"btn btn-default"
ng-class=
"{'active':namespace.publicNamespaceViewType == 'NOT_RELEASE'}"
ng-click=
"namespace.publicNamespaceViewType = 'NOT_RELEASE'"
>
未发布的配置
</button>
</div>
</div>
</div>
<div
class=
"col-md-2 col-lg-offset-2 text-right"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"filter by key ..."
ng-class=
"{'search-onblur': namespace.publicNamespace.searchStatus == 'OFF'
<div
class=
"col-md-2 col-lg-offset-2 text-right"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"filter by key ..."
ng-class=
"{'search-onblur': namespace.publicNamespace.searchStatus == 'OFF'
|| !namespace.publicNamespace.searchStatus,
'search-focus': namespace.publicNamespace.searchStatus == 'ON'}"
ng-model=
"namespace.publicNamespace.searchKey"
ng-change=
"searchItems(namespace.publicNamespace)"
ng-blur=
"namespace.publicNamespace.searchStatus='OFF'"
ng-focus=
"namespace.publicNamespace.searchStatus='ON'"
/>
ng-model=
"namespace.publicNamespace.searchKey"
ng-change=
"searchItems(namespace.publicNamespace)"
ng-blur=
"namespace.publicNamespace.searchStatus='OFF'"
ng-focus=
"namespace.publicNamespace.searchStatus='ON'"
/>
</div>
</div>
</div>
</div>
<!--published items-->
<div
ng-show=
"!namespace.publicNamespaceViewType || namespace.publicNamespaceViewType == 'RELEASE'"
>
<!--published items-->
<div
ng-show=
"!namespace.publicNamespaceViewType || namespace.publicNamespaceViewType == 'RELEASE'"
>
<table
class=
"table table-bordered table-striped table-hover"
ng-show=
"namespace.publicNamespace.hasPublishedItem"
>
<thead>
<tr>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.key';desc=!desc;"
>
Key
<span
class=
"glyphicon glyphicon-sort"
></span>
</th>
<th>
Value
</th>
<th>
备注
</th>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.dataChangeLastModifiedBy';desc=!desc;"
>
最后修改人
<span
class=
"glyphicon glyphicon-sort"
></span>
</th>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.dataChangeLastModifiedTime';desc=!desc;"
>
最后修改时间
<span
class=
"glyphicon glyphicon-sort"
></span>
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"config in namespace.publicNamespace.viewItems |orderBy:col:desc"
ng-if=
"config.item.key && !config.isModified && !config.isDeleted"
>
<td
width=
"15%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.key)"
>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
</td>
<td
width=
"35%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.value)"
>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
</td>
<td
width=
"15%"
title=
"{{config.item.comment}}"
>
<span
ng-bind=
"config.item.comment | limitTo: 250"
></span>
<span
ng-bind=
"config.item.comment.length > 250 ?'...' : ''"
></span>
</td>
<td
width=
"10%"
ng-bind=
"config.item.dataChangeLastModifiedBy"
>
</td>
<td
width=
"15%"
ng-bind=
"config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</td>
<td
width=
"10%"
class=
"text-center"
ng-if=
"!config.isDeleted"
>
<img
src=
"img/gray.png"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"覆盖此配置"
ng-click=
"editItem(namespace, config.item)"
ng-show=
"namespace.hasModifyPermission && !config.covered"
>
</td>
<td
width=
"6%"
class=
"text-center"
ng-if=
"config.isDeleted"
>
</td>
</tr>
</tbody>
</table>
<div
class=
"text-center no-config-panel"
ng-if=
"namespace.publicNamespace.viewItems
&& namespace.publicNamespace.viewItems.length
&& !namespace.publicNamespace.hasPublishedItem"
>
<h5>
无发布的配置
</h5>
</div>
</div>
<!--not published items-->
<table
class=
"table table-bordered table-striped table-hover"
ng-show=
"namespace.publicNamespace
.hasPublishedItem
"
>
ng-show=
"namespace.publicNamespace
ViewType == 'NOT_RELEASE'
"
>
<thead>
<tr>
<th
class=
"hover"
title=
"排序"
...
...
@@ -429,16 +505,13 @@
</th>
<th>
Value
Old
Value
</th>
<th>
备注
New Value
</th>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.dataChangeLastModifiedBy';desc=!desc;"
>
最后修改人
<span
class=
"glyphicon glyphicon-sort"
></span>
<th>
备注
</th>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.dataChangeLastModifiedTime';desc=!desc;"
>
...
...
@@ -453,120 +526,60 @@
</thead>
<tbody>
<tr
ng-repeat=
"config in namespace.publicNamespace.viewItems |orderBy:col:desc"
ng-if=
"config.item.key &&
!config.isModified && !config.isDeleted
"
>
<td
width=
"
15
%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.key)"
>
ng-if=
"config.item.key &&
(config.isModified || config.isDeleted)
"
>
<td
width=
"
20
%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.key)"
>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
<span
class=
"label label-success"
ng-if=
"config.isModified && !config.oldValue"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"新增的配置"
>
新
</span>
<span
class=
"label label-info"
ng-if=
"config.isModified && config.oldValue && !config.isDeleted"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改的配置"
>
改
</span>
<span
class=
"label label-danger"
ng-if=
"config.isDeleted"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"删除的配置"
>
删
</span>
</td>
<td
width=
"35%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.value)"
>
<td
width=
"25%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.oldValue)"
>
<span
ng-bind=
"config.oldValue | limitTo: 250"
></span>
<span
ng-bind=
"config.oldValue.length > 250 ? '...': ''"
></span>
</td>
<td
width=
"25%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.value)"
>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
</td>
<td
width=
"1
5
%"
title=
"{{config.item.comment}}"
>
<td
width=
"1
0
%"
title=
"{{config.item.comment}}"
>
<span
ng-bind=
"config.item.comment | limitTo: 250"
></span>
<span
ng-bind=
"config.item.comment.length > 250 ?'...' : ''"
></span>
</td>
<td
width=
"10%"
ng-bind=
"config.item.dataChangeLastModifiedBy"
>
</td>
<td
width=
"15%"
ng-bind=
"config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</td>
<td
width=
"
10
%"
class=
"text-center"
ng-if=
"!config.isDeleted"
>
<td
width=
"
5
%"
class=
"text-center"
ng-if=
"!config.isDeleted"
>
<img
src=
"img/gray.png"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"覆盖此配置"
ng-click=
"editItem(namespace, config.item)"
ng-show=
"namespace.hasModifyPermission && !config.covered"
>
</td>
<td
width=
"6%"
class=
"text-center"
ng-if=
"config.isDeleted"
>
</td>
</tr>
</tbody>
</table>
<div
class=
"text-center no-config-panel"
ng-if=
"namespace.publicNamespace.viewItems
&& namespace.publicNamespace.viewItems.length
&& !namespace.publicNamespace.hasPublishedItem"
>
<h5>
无发布的配置
</h5>
ng-if=
"!namespace.publicNamespace.viewItems || !namespace.publicNamespace.viewItems.length"
>
<h5>
无公共的配置
</h5>
</div>
</div>
<!--not published items-->
<table
class=
"table table-bordered table-striped table-hover"
ng-show=
"namespace.publicNamespaceViewType == 'NOT_RELEASE'"
>
<thead>
<tr>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.key';desc=!desc;"
>
Key
<span
class=
"glyphicon glyphicon-sort"
></span>
</th>
<th>
Old Value
</th>
<th>
New Value
</th>
<th>
备注
</th>
<th
class=
"hover"
title=
"排序"
ng-click=
"col='item.dataChangeLastModifiedTime';desc=!desc;"
>
最后修改时间
<span
class=
"glyphicon glyphicon-sort"
></span>
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"config in namespace.publicNamespace.viewItems |orderBy:col:desc"
ng-if=
"config.item.key && (config.isModified || config.isDeleted)"
>
<td
width=
"20%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.key)"
>
<span
ng-bind=
"config.item.key | limitTo: 250"
></span>
<span
ng-bind=
"config.item.key.length > 250 ? '...' :''"
></span>
<span
class=
"label label-success"
ng-if=
"config.isModified && !config.oldValue"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"新增的配置"
>
新
</span>
<span
class=
"label label-info"
ng-if=
"config.isModified && config.oldValue && !config.isDeleted"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"修改的配置"
>
改
</span>
<span
class=
"label label-danger"
ng-if=
"config.isDeleted"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"删除的配置"
>
删
</span>
</td>
<td
width=
"25%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.oldValue)"
>
<span
ng-bind=
"config.oldValue | limitTo: 250"
></span>
<span
ng-bind=
"config.oldValue.length > 250 ? '...': ''"
></span>
</td>
<td
width=
"25%"
class=
"cursor-pointer"
title=
"点击查看"
ng-click=
"showText(config.item.value)"
>
<span
ng-bind=
"config.item.value | limitTo: 250"
></span>
<span
ng-bind=
"config.item.value.length > 250 ? '...': ''"
></span>
</td>
<td
width=
"10%"
title=
"{{config.item.comment}}"
>
<span
ng-bind=
"config.item.comment | limitTo: 250"
></span>
<span
ng-bind=
"config.item.comment.length > 250 ?'...' : ''"
></span>
</td>
<td
width=
"15%"
ng-bind=
"config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'"
>
</td>
<td
width=
"5%"
class=
"text-center"
ng-if=
"!config.isDeleted"
>
<img
src=
"img/gray.png"
data-tooltip=
"tooltip"
data-placement=
"bottom"
title=
"覆盖此配置"
ng-click=
"editItem(namespace, config.item)"
ng-show=
"namespace.hasModifyPermission && !config.covered"
>
</td>
</tr>
</tbody>
</table>
<div
class=
"text-center no-config-panel"
ng-if=
"!namespace.publicNamespace.viewItems || !namespace.publicNamespace.viewItems.length"
>
<h5>
无公共的配置
</h5>
<div
class=
"panel panel-default"
ng-if=
"!namespace.publicNamespace"
>
<div
class=
"panel-heading"
>
公共的配置
</div>
<div
class=
"panel-body text-center"
>
当前公共namespace的所有者
<a
href=
"/config.html?#/appid={{namespace.parentAppId}}"
target=
"_blank"
>
{{namespace.parentAppId}}
</a>
没有关联此namespace,请联系{{namespace.parentAppId}}的所有者在{{namespace.parentAppId}}项目里关联此namespace
</div>
</div>
</div>
</div>
<!--text view-->
...
...
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