Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
svmon-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jie Yuan
svmon-web
Commits
ffea53c0
Commit
ffea53c0
authored
May 31, 2019
by
Jie Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change paging of service table
parent
cef5937a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
1 deletion
+26
-1
src/app/dashboard/fulltable/fulltable.component.html
src/app/dashboard/fulltable/fulltable.component.html
+1
-1
src/app/dashboard/fulltable/fulltable.component.ts
src/app/dashboard/fulltable/fulltable.component.ts
+25
-0
No files found.
src/app/dashboard/fulltable/fulltable.component.html
View file @
ffea53c0
...
...
@@ -143,7 +143,7 @@
</table>
<mat-paginator
[pageSize
Options]=
"[10, 20,40]
"
showFirstLastButtons
></mat-paginator>
<mat-paginator
[pageSize
]=
"20"
[pageSizeOptions]=
"getPageSizeOptions()
"
showFirstLastButtons
></mat-paginator>
</div>
</mat-sidenav-content>
...
...
src/app/dashboard/fulltable/fulltable.component.ts
View file @
ffea53c0
...
...
@@ -36,6 +36,7 @@ export class FulltableComponent implements OnInit , DoCheck, AfterViewInit{
gocdbSiteNames
:
string
[];
dpmtSiteNames
:
string
[];
username
:
string
;
defaultPageSizeOptions
:
number
[]
=
[
10
,
20
,
40
,
80
];
@
ViewChild
(
MatPaginator
)
paginator
:
MatPaginator
;
@
ViewChild
(
MatSort
)
sort
:
MatSort
;
...
...
@@ -373,4 +374,28 @@ export class FulltableComponent implements OnInit , DoCheck, AfterViewInit{
}
getPageSizeOptions
():
number
[]
{
//console.log(this.dataSource.data.length);
const
real_length
=
this
.
dataSource
.
data
.
length
;
var
options
=
[
1
,
2
];
options
=
[];
for
(
var
i
=
0
,
len
=
this
.
defaultPageSizeOptions
.
length
;
i
<
len
;
i
++
){
//console.log(this.defaultPageSizeOptions[i]);
if
(
this
.
defaultPageSizeOptions
[
i
]
<=
real_length
)
{
options
.
push
(
this
.
defaultPageSizeOptions
[
i
]);
}
else
{
options
.
push
(
real_length
);
break
;
}
}
if
(
i
==
this
.
defaultPageSizeOptions
.
length
)
{
options
.
push
(
real_length
);
}
//console.log(options);
return
options
;
}
}
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