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
a4c3f278
Commit
a4c3f278
authored
Oct 12, 2016
by
Jason Song
Committed by
GitHub
Oct 12, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #428 from lepdou/loadMore
optimize load more logic
parents
40ef0bd1
a32815ad
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
10 deletions
+16
-10
ReleaseHistoryController.js
...tic/scripts/controller/config/ReleaseHistoryController.js
+4
-3
namespace-panel-directive.js
...ces/static/scripts/directive/namespace-panel-directive.js
+6
-3
CommitService.js
...c/main/resources/static/scripts/services/CommitService.js
+3
-2
ReleaseService.js
.../main/resources/static/scripts/services/ReleaseService.js
+3
-2
No files found.
apollo-portal/src/main/resources/static/scripts/controller/config/ReleaseHistoryController.js
View file @
a4c3f278
...
@@ -24,15 +24,16 @@ release_history_module.controller("ReleaseHistoryController",
...
@@ -24,15 +24,16 @@ release_history_module.controller("ReleaseHistoryController",
var
hasFindActiveRelease
=
false
;
var
hasFindActiveRelease
=
false
;
function
findReleases
(
page
)
{
function
findReleases
(
page
)
{
var
size
=
10
;
ReleaseService
.
findAllRelease
(
$scope
.
pageContext
.
appId
,
ReleaseService
.
findAllRelease
(
$scope
.
pageContext
.
appId
,
$scope
.
pageContext
.
env
,
$scope
.
pageContext
.
env
,
$scope
.
pageContext
.
clusterName
,
$scope
.
pageContext
.
clusterName
,
$scope
.
pageContext
.
namespaceName
,
$scope
.
pageContext
.
namespaceName
,
page
)
page
,
size
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
if
(
!
result
||
result
.
length
==
0
)
{
if
(
!
result
||
result
.
length
<
size
)
{
$scope
.
hasLoadAll
=
true
;
$scope
.
hasLoadAll
=
true
;
return
;
}
}
var
hasParseNamespaceType
=
false
;
var
hasParseNamespaceType
=
false
;
...
...
apollo-portal/src/main/resources/static/scripts/directive/namespace-panel-directive.js
View file @
a4c3f278
...
@@ -166,15 +166,19 @@ directive_module.directive('apollonspanel',
...
@@ -166,15 +166,19 @@ directive_module.directive('apollonspanel',
namespace
.
commits
=
[];
namespace
.
commits
=
[];
namespace
.
commitPage
=
0
;
namespace
.
commitPage
=
0
;
}
}
var
size
=
10
;
CommitService
.
find_commits
(
scope
.
appId
,
CommitService
.
find_commits
(
scope
.
appId
,
scope
.
env
,
scope
.
env
,
scope
.
cluster
,
scope
.
cluster
,
namespace
.
baseInfo
.
namespaceName
,
namespace
.
baseInfo
.
namespaceName
,
namespace
.
commitPage
)
namespace
.
commitPage
,
size
)
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
if
(
result
.
length
==
0
)
{
if
(
result
.
length
<
size
)
{
namespace
.
hasLoadAllCommit
=
true
;
namespace
.
hasLoadAllCommit
=
true
;
}
}
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
//to json
//to json
result
[
i
].
changeSets
=
JSON
.
parse
(
result
[
i
].
changeSets
);
result
[
i
].
changeSets
=
JSON
.
parse
(
result
[
i
].
changeSets
);
...
@@ -418,7 +422,6 @@ directive_module.directive('apollonspanel',
...
@@ -418,7 +422,6 @@ directive_module.directive('apollonspanel',
return
true
;
return
true
;
}
}
}
}
}
}
});
});
apollo-portal/src/main/resources/static/scripts/services/CommitService.js
View file @
a4c3f278
...
@@ -7,14 +7,15 @@ appService.service('CommitService', ['$resource', '$q', function ($resource, $q)
...
@@ -7,14 +7,15 @@ appService.service('CommitService', ['$resource', '$q', function ($resource, $q)
}
}
});
});
return
{
return
{
find_commits
:
function
(
appId
,
env
,
clusterName
,
namespaceName
,
page
)
{
find_commits
:
function
(
appId
,
env
,
clusterName
,
namespaceName
,
page
,
size
)
{
var
d
=
$q
.
defer
();
var
d
=
$q
.
defer
();
commit_resource
.
find_commits
({
commit_resource
.
find_commits
({
appId
:
appId
,
appId
:
appId
,
env
:
env
,
env
:
env
,
clusterName
:
clusterName
,
clusterName
:
clusterName
,
namespaceName
:
namespaceName
,
namespaceName
:
namespaceName
,
page
:
page
page
:
page
,
size
:
size
},
},
function
(
result
)
{
function
(
result
)
{
d
.
resolve
(
result
);
d
.
resolve
(
result
);
...
...
apollo-portal/src/main/resources/static/scripts/services/ReleaseService.js
View file @
a4c3f278
...
@@ -42,14 +42,15 @@ appService.service('ReleaseService', ['$resource', '$q', function ($resource, $q
...
@@ -42,14 +42,15 @@ appService.service('ReleaseService', ['$resource', '$q', function ($resource, $q
return
d
.
promise
;
return
d
.
promise
;
}
}
function
findAllReleases
(
appId
,
env
,
clusterName
,
namespaceName
,
page
)
{
function
findAllReleases
(
appId
,
env
,
clusterName
,
namespaceName
,
page
,
size
)
{
var
d
=
$q
.
defer
();
var
d
=
$q
.
defer
();
resource
.
find_all_releases
({
resource
.
find_all_releases
({
appId
:
appId
,
appId
:
appId
,
env
:
env
,
env
:
env
,
clusterName
:
clusterName
,
clusterName
:
clusterName
,
namespaceName
:
namespaceName
,
namespaceName
:
namespaceName
,
page
:
page
page
:
page
,
size
:
size
},
function
(
result
)
{
},
function
(
result
)
{
d
.
resolve
(
result
);
d
.
resolve
(
result
);
},
function
(
result
)
{
},
function
(
result
)
{
...
...
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