11<template >
22<div >
3+ <b-row >
34 <b-table striped hover :items =" filesystems" >
45 <template v-slot :cell (file_system_id)="data">
56 <div v-if =" data.item.managed === true" >
2425 </div >
2526 </template >
2627 </b-table >
27- <div v-if =" noFileSystemsFound" >
28- <p >No Amazon EFS file systems found.
29- Please create an EFS filesystem in the
30- <a href =" https://console.aws.amazon.com/efs/home/file-systems" >AWS console</a >
31- </p >
32- </div >
28+ </b-row >
29+ <div v-if =" noFileSystemsFound" >
30+ <p >No Amazon EFS file systems found.
31+ Please create an EFS filesystem in the
32+ <a href =" https://console.aws.amazon.com/efs/home/file-systems" >AWS console</a >
33+ </p >
34+ </div >
35+ <div id =" moreFilesystemsBtn" v-if =" paginationToken != null" >
36+ <b-button @click =listFilesystems() >More</b-button >
37+ </div >
3338</div >
3439</template >
3540
@@ -41,22 +46,41 @@ export default {
4146 data () {
4247 return {
4348 filesystems: [],
44- noFileSystemsFound: false
49+ noFileSystemsFound: false ,
50+ paginationToken: null
4551 }
4652 },
4753 mounted : function () {
4854 this .listFilesystems ()
4955 },
5056 methods: {
5157 async listFilesystems () {
52- try {
53- let response = await API .get (' fileManagerApi' , ' /api/filesystems/' )
54- if (response .length == 0 ){
55- this .noFileSystemsFound = true
56- }else {
57- this .filesystems = response
58- }
58+ let apiPath = ' '
59+ if (this .paginationToken == null ) {
60+ apiPath = ' /api/filesystems/'
61+ }
62+ else {
63+ apiPath = ' /api/filesystems/?cursor=' + this .paginationToken
64+ }
65+
66+ try {
67+ let response = await API .get (' fileManagerApi' , apiPath)
68+ let filesystems = response .filesystems
69+ if (filesystems .length == 0 ) {
70+ this .noFileSystemsFound = true
71+ }
72+ else {
73+ filesystems .forEach (filesystem => this .filesystems .push (filesystem))
74+ }
75+
76+ if (" paginationToken" in response) {
77+ this .paginationToken = response .paginationToken
78+ }
79+ else {
80+ this .paginationToken = null
81+ }
5982 }
83+
6084 catch (error) {
6185 alert (' Unable to list filesystems, check api logs' )
6286 console .log (error)
@@ -73,5 +97,9 @@ export default {
7397<!-- Add "scoped" attribute to limit CSS to this component only -->
7498<style scoped>
7599
100+ #moreFilesystemsBtn {
101+ float : right ;
102+
103+ }
76104
77105 </style >
0 commit comments