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