Update nodes for v1beta3 api

This commit is contained in:
BC Broussard
2015-05-21 00:04:33 -07:00
parent 0721377646
commit 69160f3464
7 changed files with 1086 additions and 993 deletions

View File

@@ -6,7 +6,7 @@
app.controller('ListMinionsCtrl', [
'$scope',
'$routeParams',
'k8sApi',
'k8sv1Beta3Api',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
@@ -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: '',
@@ -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);
@@ -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);

View File

@@ -7,7 +7,7 @@ app.controller('NodeCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sApi',
'k8sv1Beta3Api',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';

View File

@@ -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>
@@ -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>
@@ -58,4 +87,3 @@
</div>
</div>
<div dashboard-footer></div>