在TreeView结构角度中显示S3对象

时间:2018-11-13 19:08:59

标签: angular amazon-s3 tree treeview

我有一个lambda返回S3 buckets对象及其版本,我试图实现的是在Angular Frontend中以树状结构视图显示响应。以下是我的缩小的JSON响应:

[{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"1234566.pdf","VersionId":"iGNfCHuVhM.3kqr8CBzvhJISdKFxNkWm","IsLatest":true,"LastModified":"2018-11-13T13:48:22.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"1234566.pdf","VersionId":"LrcmgeTGVcTQJa8LXdUwvFXVoZ7gtvfr","IsLatest":false,"LastModified":"2018-11-12T13:48:57.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"1234566.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/","VersionId":"LY58GovVA4mU_5XyFLxpiDXooN_z783X","IsLatest":true,"LastModified":"2018-11-01T14:09:35.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/","VersionId":"MAacf2dY4VIQlY7Z_rdy8lHEMZsqZn1o","IsLatest":true,"LastModified":"2018-11-01T14:10:56.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/","VersionId":"lmeFrpnHwiCbXZlMI.nl8OmjS6pOyOu9","IsLatest":false,"LastModified":"2018-11-01T14:10:40.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"o1HlfoDJCjFdDI6EHLFZbSeOdMqH_FE1","IsLatest":true,"LastModified":"2018-11-09T11:53:59.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"7.xdhugiHQBC4tU45gvoAQBKBX4KRjFx","IsLatest":false,"LastModified":"2018-11-01T14:12:53.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"78cb8d333e131492cb14885ad13c705c\"","Size":58,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"1EwCfE88ViW6JX4ofNO6WIfjomma898z","IsLatest":true,"LastModified":"2018-11-01T14:17:19.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"0f092a304ed6f44f452b173f9e436f86\"","Size":17,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"dZR_pv43mW7CKoGUNLwpF1_snARKVLIk","IsLatest":false,"LastModified":"2018-11-01T14:14:10.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"5pW3uHBR2hfazkJJvm2ctxQ8KKYEePsq","IsLatest":false,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234568.pdf","VersionId":"dcmBQfVNGAmXrPL1kdW7_Xp6QvvJDFUk","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234569.pdf","VersionId":"zzo5GIitOGWyAOtJOZKTVC.6AZDzq80m","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234570.pdf","VersionId":"pQoMLL43bbpUXhvObOYBer5TCaWZGzNu","IsLatest":true,"LastModified":"2018-11-01T14:12:55.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/","VersionId":"MAacf2dY4VIQlY7Z_rdy8lHEMZsqZn1o","IsLatest":true,"LastModified":"2018-11-01T14:10:56.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/","VersionId":"lmeFrpnHwiCbXZlMI.nl8OmjS6pOyOu9","IsLatest":false,"LastModified":"2018-11-01T14:10:40.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"o1HlfoDJCjFdDI6EHLFZbSeOdMqH_FE1","IsLatest":true,"LastModified":"2018-11-09T11:53:59.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"7.xdhugiHQBC4tU45gvoAQBKBX4KRjFx","IsLatest":false,"LastModified":"2018-11-01T14:12:53.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"78cb8d333e131492cb14885ad13c705c\"","Size":58,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"1EwCfE88ViW6JX4ofNO6WIfjomma898z","IsLatest":true,"LastModified":"2018-11-01T14:17:19.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"0f092a304ed6f44f452b173f9e436f86\"","Size":17,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"dZR_pv43mW7CKoGUNLwpF1_snARKVLIk","IsLatest":false,"LastModified":"2018-11-01T14:14:10.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"5pW3uHBR2hfazkJJvm2ctxQ8KKYEePsq","IsLatest":false,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234568.pdf","VersionId":"dcmBQfVNGAmXrPL1kdW7_Xp6QvvJDFUk","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234569.pdf","VersionId":"zzo5GIitOGWyAOtJOZKTVC.6AZDzq80m","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234570.pdf","VersionId":"pQoMLL43bbpUXhvObOYBer5TCaWZGzNu","IsLatest":true,"LastModified":"2018-11-01T14:12:55.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"o1HlfoDJCjFdDI6EHLFZbSeOdMqH_FE1","IsLatest":true,"LastModified":"2018-11-09T11:53:59.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234566.pdf","VersionId":"7.xdhugiHQBC4tU45gvoAQBKBX4KRjFx","IsLatest":false,"LastModified":"2018-11-01T14:12:53.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/1234566.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"78cb8d333e131492cb14885ad13c705c\"","Size":58,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"1EwCfE88ViW6JX4ofNO6WIfjomma898z","IsLatest":true,"LastModified":"2018-11-01T14:17:19.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"0f092a304ed6f44f452b173f9e436f86\"","Size":17,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"dZR_pv43mW7CKoGUNLwpF1_snARKVLIk","IsLatest":false,"LastModified":"2018-11-01T14:14:10.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}},{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234567.pdf","VersionId":"5pW3uHBR2hfazkJJvm2ctxQ8KKYEePsq","IsLatest":false,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/1234567.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234568.pdf","VersionId":"dcmBQfVNGAmXrPL1kdW7_Xp6QvvJDFUk","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/1234568.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234569.pdf","VersionId":"zzo5GIitOGWyAOtJOZKTVC.6AZDzq80m","IsLatest":true,"LastModified":"2018-11-01T14:12:54.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/1234569.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-1/test-proj/1234570.pdf","VersionId":"pQoMLL43bbpUXhvObOYBer5TCaWZGzNu","IsLatest":true,"LastModified":"2018-11-01T14:12:55.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-1/test-proj/1234570.pdf","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-2/","VersionId":"59oeJkOFKUui.pu8TgvbaMwld6wxVzXp","IsLatest":true,"LastModified":"2018-11-01T14:09:51.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-2/","MaxKeys":1000,"CommonPrefixes":[]},{"IsTruncated":false,"KeyMarker":"","VersionIdMarker":"","Versions":[{"ETag":"\"d41d8cd98f00b204e9800998ecf8427e\"","Size":0,"StorageClass":"STANDARD","Key":"project-3/","VersionId":"5Ps6RTq1reD3GiU248s8O3B7qaZF2Z8f","IsLatest":true,"LastModified":"2018-11-01T14:09:59.000Z","Owner":{"DisplayName":"owner","ID":"c5b17efdf611dbe1f7557b8d392bdb68caf7ffd03b3a078f5e19b9652ea7d943"}}],"DeleteMarkers":[],"Name":"mybucket","Prefix":"project-3/","MaxKeys":1000,"CommonPrefixes":[]}]

我的结构如下:

- mybucket/folder1/project1/samplev1.txt
- mybucket/folder1/project1/sampleVer2.txt
- mybucket/folder2/
- mybucket/folder3/

如何在Angular中应用树状视图以显示此数据结构,并在展开时显示每个对象的信息,例如VersionId,LastModified..etc。

0 个答案:

没有答案