Fixed problems Javascript:

- Declared js scripts in the head for faster loading
- Replaced absolute paths "/#/..." by "#/..." to keep work in a sub-url (http://www.exemple.com/dockerui/#/...)
- Fixed "ContainerController.hasContent" filter: a filter applies to individual elements, not to the array
pull/2/head
FURGEROT Julien 10 years ago
parent 5075995129
commit 56b009155c

@ -18,38 +18,19 @@
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]--> <![endif]-->
<!-- Fav and touch icons --> <script src="assets/js/jquery.js"></script>
<link rel="shortcut icon" href="../assets/ico/favicon.ico"> <script src="assets/js/bootstrap-transition.js"></script>
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png"> <script src="assets/js/bootstrap-alert.js"></script>
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png"> <script src="assets/js/bootstrap-modal.js"></script>
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png"> <script src="assets/js/bootstrap-dropdown.js"></script>
<link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png"> <script src="assets/js/bootstrap-scrollspy.js"></script>
</head> <script src="assets/js/bootstrap-tab.js"></script>
<script src="assets/js/bootstrap-tooltip.js"></script>
<body> <script src="assets/js/bootstrap-popover.js"></script>
<script src="assets/js/bootstrap-button.js"></script>
<div class="container"> <script src="assets/js/bootstrap-collapse.js"></script>
<div ng-include="template" ng-controller="MastheadController"></div> <script src="assets/js/bootstrap-carousel.js"></script>
<script src="assets/js/bootstrap-typeahead.js"></script>
<div id="view" ng-view></div>
<div class="container-bottom"></div>
<div ng-include="template" ng-controller="StatusBarController"></div>
</div>
<script src="../assets/js/jquery.js"></script>
<script src="../assets/js/bootstrap-transition.js"></script>
<script src="../assets/js/bootstrap-alert.js"></script>
<script src="../assets/js/bootstrap-modal.js"></script>
<script src="../assets/js/bootstrap-dropdown.js"></script>
<script src="../assets/js/bootstrap-scrollspy.js"></script>
<script src="../assets/js/bootstrap-tab.js"></script>
<script src="../assets/js/bootstrap-tooltip.js"></script>
<script src="../assets/js/bootstrap-popover.js"></script>
<script src="../assets/js/bootstrap-button.js"></script>
<script src="../assets/js/bootstrap-collapse.js"></script>
<script src="../assets/js/bootstrap-carousel.js"></script>
<script src="../assets/js/bootstrap-typeahead.js"></script>
<script src="lib/spin.js" type="text/javascript" charset="utf-8"></script> <script src="lib/spin.js" type="text/javascript" charset="utf-8"></script>
@ -67,5 +48,25 @@
<script src="js/controllers.js"></script> <script src="js/controllers.js"></script>
<script src="js/viewmodel.js"></script> <script src="js/viewmodel.js"></script>
<!-- Fav and touch icons -->
<link rel="shortcut icon" href="assets/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="assets/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<div class="container">
<div ng-include="template" ng-controller="MastheadController"></div>
<div id="view" ng-view></div>
<div class="container-bottom"></div>
<div ng-include="template" ng-controller="StatusBarController"></div>
</div>
</body> </body>
</html> </html>

@ -188,7 +188,7 @@ function ContainerController($scope, $routeParams, $location, Container, Message
}; };
$scope.hasContent = function(data) { $scope.hasContent = function(data) {
return data !== null && data !== undefined && data.length > 1; return data !== null && data !== undefined;
}; };
$scope.getChanges = function() { $scope.getChanges = function() {
@ -435,7 +435,7 @@ function StartContainerController($scope, $routeParams, $location, Container, Me
} }
function BuilderController($scope, Dockerfile, Messages) { function BuilderController($scope, Dockerfile, Messages) {
$scope.template = '/partials/builder.html'; $scope.template = 'partials/builder.html';
} }
function failedRequestHandler(e, Messages) { function failedRequestHandler(e, Messages) {

@ -68,7 +68,7 @@
</tr> </tr>
<tr> <tr>
<td>Image:</td> <td>Image:</td>
<td><a href="/#/images/{{ container.Image }}/">{{ container.Image }}</a></td> <td><a href="#/images/{{ container.Image }}/">{{ container.Image }}</a></td>
</tr> </tr>
<tr> <tr>
<td>State:</td> <td>State:</td>

@ -33,8 +33,8 @@
<tbody> <tbody>
<tr ng-repeat="container in containers|orderBy:predicate"> <tr ng-repeat="container in containers|orderBy:predicate">
<td><input type="checkbox" ng-model="container.Checked" /></td> <td><input type="checkbox" ng-model="container.Checked" /></td>
<td><a href="/#/containers/{{ container.Id }}/">{{ container|containername}}</a></td> <td><a href="#/containers/{{ container.Id }}/">{{ container|containername}}</a></td>
<td><a href="/#/images/{{ container.Image }}/">{{ container.Image }}</a></td> <td><a href="#/images/{{ container.Image }}/">{{ container.Image }}</a></td>
<td>{{ container.Command|truncate:40 }}</td> <td>{{ container.Command|truncate:40 }}</td>
<td>{{ container.Created|getdate }}</td> <td>{{ container.Created|getdate }}</td>
<td><span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span></td> <td><span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span></td>

@ -16,7 +16,7 @@
<h3>Running Containers</h3> <h3>Running Containers</h3>
<ul> <ul>
<li ng-repeat="container in containers|orderBy:predicate"> <li ng-repeat="container in containers|orderBy:predicate">
<a href="/#/containers/{{ container.Id }}/">{{ container|containername }}</a> <a href="#/containers/{{ container.Id }}/">{{ container|containername }}</a>
<span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span> <span class="label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span>
</li> </li>
</ul> </ul>

@ -27,7 +27,7 @@
</tr> </tr>
<tr> <tr>
<td>Parent:</td> <td>Parent:</td>
<td><a href="/#/images/{{ image.parent }}/">{{ image.parent }}</a></td> <td><a href="#/images/{{ image.parent }}/">{{ image.parent }}</a></td>
</tr> </tr>
<tr> <tr>
<td>Size:</td> <td>Size:</td>

@ -23,7 +23,7 @@
<tbody> <tbody>
<tr ng-repeat="image in images | orderBy:predicate"> <tr ng-repeat="image in images | orderBy:predicate">
<td><input type="checkbox" ng-model="image.Checked" /></td> <td><input type="checkbox" ng-model="image.Checked" /></td>
<td><a href="/#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td> <td><a href="#/images/{{ image.Id }}/?tag={{ image|repotag }}">{{ image.Id|truncate:20}}</a></td>
<td>{{ image|repotag }}</td> <td>{{ image|repotag }}</td>
<td>{{ image.Created|getdate }}</td> <td>{{ image.Created|getdate }}</td>
</tr> </tr>

@ -5,9 +5,9 @@
<div class="container"> <div class="container">
<ul class="nav"> <ul class="nav">
<li><a href="#">Dashboard</a></li> <li><a href="#">Dashboard</a></li>
<li><a href="/#/containers/">Containers</a></li> <li><a href="#/containers/">Containers</a></li>
<li><a href="/#/images/">Images</a></li> <li><a href="#/images/">Images</a></li>
<li><a href="/#/settings/">Settings</a></li> <li><a href="#/settings/">Settings</a></li>
</ul> </ul>
</div> </div>
</div> </div>

@ -4,7 +4,7 @@
<strong>Endpoint: </strong>{{ endpoint }} <strong>Endpoint: </strong>{{ endpoint }}
<ul> <ul>
<li ng-repeat="container in containers"> <li ng-repeat="container in containers">
<a href="/#/containers/{{ container.Id }}/">{{ container.Id|truncate:20 }}</a> <a href="#/containers/{{ container.Id }}/">{{ container.Id|truncate:20 }}</a>
<span class="pull-right label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span> <span class="pull-right label label-{{ container.Status|statusbadge }}">{{ container.Status }}</span>
</li> </li>
</ul> </ul>

Loading…
Cancel
Save