Created
December 22, 2014 17:09
-
-
Save cschwede/4eb767eede1d7f1af398 to your computer and use it in GitHub Desktop.
OpenStack Swift AngularJS sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
</head> | |
<body> | |
<div ng-app=""> | |
<div ng-controller="containerController"> | |
<div class="container"> | |
<table class="table table-striped"> | |
<tr><th>Name</th><th>Size</th><th>Last Modified</th></tr> | |
<tr ng-repeat="obj in objs"> | |
<td>{{ obj.name }}</td> | |
<td>{{ obj.bytes }}</td> | |
<td>{{ obj.last_modified | date:'EEEE, dd. MMMM yyyy - HH:mm:ss (Z)' }}</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
</div> | |
<script> | |
// Use a public readable container URL here, for example: | |
var url="http://localhost:8080/v1/AUTH_test/public/"; | |
function containerController($scope,$http) { | |
$http.get(url + "?format=json") | |
.success(function(response, stat) {$scope.objs = | |
response;$scope.stat = stat;}); | |
}; | |
</script> | |
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment