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
08454bde
Commit
08454bde
authored
Aug 31, 2016
by
Jason Song
Committed by
GitHub
Aug 31, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #394 from lepdou/search_item
filter item
parents
6153339b
cf54598d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
namespace-panel-directive.js
...ces/static/scripts/directive/namespace-panel-directive.js
+23
-0
namespace-panel.html
...ain/resources/static/views/component/namespace-panel.html
+14
-3
No files found.
apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js
View file @
08454bde
...
@@ -38,6 +38,10 @@ directive_module.directive('apollonspanel',
...
@@ -38,6 +38,10 @@ directive_module.directive('apollonspanel',
scope
.
switchView
=
switchView
;
scope
.
switchView
=
switchView
;
scope
.
toggleItemSearchInput
=
toggleItemSearchInput
;
scope
.
searchItems
=
searchItems
;
scope
.
loadCommitHistory
=
loadCommitHistory
;
scope
.
loadCommitHistory
=
loadCommitHistory
;
scope
.
toggleTextEditStatus
=
toggleTextEditStatus
;
scope
.
toggleTextEditStatus
=
toggleTextEditStatus
;
...
@@ -60,6 +64,8 @@ directive_module.directive('apollonspanel',
...
@@ -60,6 +64,8 @@ directive_module.directive('apollonspanel',
function
initNamespace
(
namespace
,
viewType
)
{
function
initNamespace
(
namespace
,
viewType
)
{
namespace
.
showSearchInput
=
false
;
namespace
.
sourceItems
=
namespace
.
items
;
namespace
.
isPropertiesFormat
=
namespace
.
format
==
'properties'
;
namespace
.
isPropertiesFormat
=
namespace
.
format
==
'properties'
;
namespace
.
isTextEditing
=
false
;
namespace
.
isTextEditing
=
false
;
namespace
.
instanceViewType
=
namespace_instance_view_type
.
LATEST_RELEASE
;
namespace
.
instanceViewType
=
namespace_instance_view_type
.
LATEST_RELEASE
;
...
@@ -384,6 +390,23 @@ directive_module.directive('apollonspanel',
...
@@ -384,6 +390,23 @@ directive_module.directive('apollonspanel',
return
result
;
return
result
;
}
}
function
toggleItemSearchInput
(
namespace
)
{
namespace
.
showSearchInput
=
!
namespace
.
showSearchInput
;
}
function
searchItems
(
namespace
)
{
var
searchKey
=
namespace
.
searchKey
.
toLowerCase
();
var
items
=
[];
namespace
.
sourceItems
.
forEach
(
function
(
item
)
{
var
key
=
item
.
item
.
key
;
if
(
key
&&
key
.
toLowerCase
().
indexOf
(
searchKey
)
>=
0
){
items
.
push
(
item
);
}
});
namespace
.
items
=
items
;
}
function
lockCheck
(
namespace
)
{
function
lockCheck
(
namespace
)
{
if
(
namespace
.
lockOwner
&&
scope
.
currentUser
!=
namespace
.
lockOwner
)
{
if
(
namespace
.
lockOwner
&&
scope
.
currentUser
!=
namespace
.
lockOwner
)
{
scope
.
lockOwner
=
namespace
.
lockOwner
;
scope
.
lockOwner
=
namespace
.
lockOwner
;
...
...
apollo-portal/src/main/resources/static/views/component/namespace-panel.html
View file @
08454bde
...
@@ -113,6 +113,13 @@
...
@@ -113,6 +113,13 @@
<img
src=
"img/submit.png"
class=
"ns_btn"
>
<img
src=
"img/submit.png"
class=
"ns_btn"
>
</a>
</a>
<button
type=
"button"
class=
"btn btn-info btn-sm"
ng-show=
"namespace.viewType == 'table'"
ng-click=
"toggleItemSearchInput(namespace)"
>
<span
class=
"glyphicon glyphicon-filter"
></span>
过滤配置
</button>
<button
type=
"button"
class=
"btn btn-primary btn-sm"
<button
type=
"button"
class=
"btn btn-primary btn-sm"
ng-show=
"namespace.viewType == 'table' && namespace.hasModifyPermission"
ng-show=
"namespace.viewType == 'table' && namespace.hasModifyPermission"
ng-click=
"createItem(namespace)"
>
ng-click=
"createItem(namespace)"
>
...
@@ -120,6 +127,7 @@
...
@@ -120,6 +127,7 @@
新增配置
新增配置
</button>
</button>
</div>
</div>
</div>
</div>
</header>
</header>
...
@@ -138,9 +146,12 @@
...
@@ -138,9 +146,12 @@
</textarea>
</textarea>
<!--table view-->
<!--table view-->
<div
class=
"namespace-view-table"
>
<div
class=
"namespace-view-table"
ng-show=
"namespace.viewType == 'table'"
>
<table
class=
"table table-bordered table-striped text-center table-hover"
ng-show=
"namespace.viewType == 'table' && namespace.items.length > 0"
>
<div
class=
"col-md-8 col-lg-offset-2"
style=
"padding-top: 15px; padding-bottom: 10px"
ng-show=
"namespace.showSearchInput"
>
<input
type=
"text"
class=
"form-control"
placeholder=
"输入key过滤"
ng-model=
"namespace.searchKey"
ng-change=
"searchItems(namespace)"
>
</div>
<table
class=
"table table-bordered table-striped text-center table-hover"
>
<thead>
<thead>
<tr>
<tr>
<th>
<th>
...
...
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