Skip to content

Commit

Permalink
Update nodes for v1beta3 api
Browse files Browse the repository at this point in the history
  • Loading branch information
bcbroussard committed May 27, 2015
1 parent 0721377 commit 69160f3
Show file tree
Hide file tree
Showing 7 changed files with 2,259 additions and 2,166 deletions.
2,071 changes: 1,051 additions & 1,020 deletions pkg/ui/datafile.go

Large diffs are not rendered by default.

2,235 changes: 1,119 additions & 1,116 deletions www/app/assets/js/app.js

Large diffs are not rendered by default.

50 changes: 39 additions & 11 deletions www/app/components/dashboard/views/node.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<div class="heading">
<span class="label">Name:</span>
<span>{{node.id}}</span>
<span>{{node.metadata.name}}</span>
</div>


<table>
<table class="align-top">
<tbody>
<tr>
<tr ng-show="node.metadata.labels">
<td class="name">Labels</td>
<td class="value">
<div ng-repeat="(label, value) in node.labels">
<div ng-repeat="(label, value) in node.metadata.labels">
{{label}}: {{value}}
</div>
</td>
Expand All @@ -28,23 +28,52 @@
<tr>
<td class="name">Created</td>
<td class="value">
{{node.creationTimestamp | date:'medium'}}
{{node.metadata.creationTimestamp | date:'medium'}}
</td>
</tr>

<tr>
<td class="name">Host IP</td>
<td class="name">Addresses</td>
<td class="value">
{{node.hostIP}}
<div ng-repeat="a in node.status.addresses">
{{a.address}}
</div>
</td>
</tr>

<tr ng-show="node.status.capacity">
<td class="name">Capacity</td>
<td class="value">
<table>
<tr ng-repeat="(label, value) in node.status.capacity">
<td>{{label}}:</td> <td>{{value}}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="name">System Info</td>
<td class="value">
<div ng-repeat="(label, value) in node.status.nodeInfo">
{{label}}: {{value}}
</div>
<table>
<tr ng-repeat="(label, value) in node.status.nodeInfo">
<td>{{label}}:</td> <td>{{value}}</td>
</tr>
</table>
</td>
</tr>

<tr ng-show="node.spec.podCIDR">
<td class="name">PodCIDR</td>
<td class="value">
{{node.spec.podCIDR}}
</td>
</tr>

<tr ng-show="node.spec.externalID">
<td class="name">ExternalID</td>
<td class="value">
{{node.spec.externalID}}
</td>
</tr>

Expand All @@ -58,4 +87,3 @@
</div>
</div>
<div dashboard-footer></div>

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
app.controller('ListMinionsCtrl', [
'$scope',
'$routeParams',
'k8sApi',
'k8sv1Beta3Api',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
Expand All @@ -17,7 +17,7 @@ app.controller('ListMinionsCtrl', [
$scope.groupedPods = null;
$scope.serverView = false;

$scope.headers = [{name: 'Name', field: 'name'}, {name: 'IP', field: 'ip'}, {name: 'Status', field: 'status'}];
$scope.headers = [{name: 'Name', field: 'name'}, {name: 'Addresses', field: 'addresses'}, {name: 'Status', field: 'status'}];

$scope.custom = {
name: '',
Expand All @@ -28,7 +28,8 @@ app.controller('ListMinionsCtrl', [
$scope.thumbs = 'thumb';
$scope.count = 10;

$scope.go = function(data) { $location.path('/dashboard/nodes/' + data.name); };
$scope.go = function(d) { $location.path('/dashboard/nodes/' + d.name); };


function handleError(data, status, headers, config) {
console.log("Error (" + status + "): " + data);
Expand All @@ -51,15 +52,15 @@ app.controller('ListMinionsCtrl', [
};

data.items.forEach(function(minion) {
var _kind = '';
var _statusType = '';

if (minion.status.conditions) {
Object.keys(minion.status.conditions)
.forEach(function(key) { _kind += minion.status.conditions[key].kind; });
.forEach(function(key) { _statusType += minion.status.conditions[key].type; });
}

$scope.content.push({name: minion.id, ip: minion.hostIP, status: _kind});

$scope.content.push({name: minion.metadata.name, addresses: _.map(minion.status.addresses, function(a) { return a.address }).join(', '), status: _statusType});
});

}).error($scope.handleError);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ app.controller('NodeCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sApi',
'k8sv1Beta3Api',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';
Expand Down
50 changes: 39 additions & 11 deletions www/master/components/dashboard/views/node.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@

<div class="heading">
<span class="label">Name:</span>
<span>{{node.id}}</span>
<span>{{node.metadata.name}}</span>
</div>


<table>
<table class="align-top">
<tbody>
<tr>
<tr ng-show="node.metadata.labels">
<td class="name">Labels</td>
<td class="value">
<div ng-repeat="(label, value) in node.labels">
<div ng-repeat="(label, value) in node.metadata.labels">
{{label}}: {{value}}
</div>
</td>
Expand All @@ -28,23 +28,52 @@
<tr>
<td class="name">Created</td>
<td class="value">
{{node.creationTimestamp | date:'medium'}}
{{node.metadata.creationTimestamp | date:'medium'}}
</td>
</tr>

<tr>
<td class="name">Host IP</td>
<td class="name">Addresses</td>
<td class="value">
{{node.hostIP}}
<div ng-repeat="a in node.status.addresses">
{{a.address}}
</div>
</td>
</tr>

<tr ng-show="node.status.capacity">
<td class="name">Capacity</td>
<td class="value">
<table>
<tr ng-repeat="(label, value) in node.status.capacity">
<td>{{label}}:</td> <td>{{value}}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="name">System Info</td>
<td class="value">
<div ng-repeat="(label, value) in node.status.nodeInfo">
{{label}}: {{value}}
</div>
<table>
<tr ng-repeat="(label, value) in node.status.nodeInfo">
<td>{{label}}:</td> <td>{{value}}</td>
</tr>
</table>
</td>
</tr>

<tr ng-show="node.spec.podCIDR">
<td class="name">PodCIDR</td>
<td class="value">
{{node.spec.podCIDR}}
</td>
</tr>

<tr ng-show="node.spec.externalID">
<td class="name">ExternalID</td>
<td class="value">
{{node.spec.externalID}}
</td>
</tr>

Expand All @@ -58,4 +87,3 @@
</div>
</div>
<div dashboard-footer></div>

4 changes: 3 additions & 1 deletion www/master/shared/js/modules/services/k8sApiService.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ app.provider('k8sv1Beta3Api',

api.getPods = function(query) { return _get($http, api.getUrlBase() + '/pods', query); };

api.getMinions = function(query) { return _get($http, urlBase + '/nodes', query); };
api.getNodes = function(query) { return _get($http, urlBase + '/nodes', query); };

api.getMinions = api.getNodes;

api.getServices = function(query) { return _get($http, api.getUrlBase() + '/services', query); };

Expand Down

0 comments on commit 69160f3

Please sign in to comment.