Commit e847b2d4 authored by Tim Hockin's avatar Tim Hockin

Merge pull request #8615 from bcbroussard/v1beta3-events

Update events page to v1beta3 in web ui
parents 0bea034e b4ab5edd
...@@ -1311,7 +1311,7 @@ angular.module('kubernetesApp.components.dashboard', []) ...@@ -1311,7 +1311,7 @@ angular.module('kubernetesApp.components.dashboard', [])
app.controller('ListEventsCtrl', [ app.controller('ListEventsCtrl', [
'$scope', '$scope',
'$routeParams', '$routeParams',
'k8sApi', 'k8sv1Beta3Api',
'$location', '$location',
'$filter', '$filter',
function($scope, $routeParams, k8sApi, $location, $filter) { function($scope, $routeParams, k8sApi, $location, $filter) {
...@@ -1324,26 +1324,20 @@ app.controller('ListEventsCtrl', [ ...@@ -1324,26 +1324,20 @@ app.controller('ListEventsCtrl', [
$scope.serverView = false; $scope.serverView = false;
$scope.headers = [ $scope.headers = [
{name: 'Time', field: 'time'}, {name: 'First Seen', field: 'firstSeen'},
{name: 'From', field: 'from'}, {name: 'Last Seen', field: 'lastSeen'},
{name: 'Sub Object Path', field: 'subobject'}, {name: 'Count', field: 'count'},
{name: 'Name', field: 'name'},
{name: 'Kind', field: 'kind'},
{name: 'SubObject', field: 'subObject'},
{name: 'Reason', field: 'reason'}, {name: 'Reason', field: 'reason'},
{name: 'Source', field: 'source'},
{name: 'Message', field: 'message'} {name: 'Message', field: 'message'}
]; ];
$scope.custom = {
time: '',
from: 'grey',
subobject: 'grey',
reason: 'grey',
message: 'grey'
};
$scope.sortable = ['time', 'from', 'subobject'];
$scope.thumbs = 'thumb';
$scope.count = 10;
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
$scope.sortable = ['firstSeen', 'lastSeen', 'count', 'name', 'kind', 'subObject', 'reason', 'source'];
$scope.count = 10;
function handleError(data, status, headers, config) { function handleError(data, status, headers, config) {
console.log("Error (" + status + "): " + data); console.log("Error (" + status + "): " + data);
$scope.loading = false; $scope.loading = false;
...@@ -1365,15 +1359,26 @@ app.controller('ListEventsCtrl', [ ...@@ -1365,15 +1359,26 @@ app.controller('ListEventsCtrl', [
}; };
data.items.forEach(function(event) { data.items.forEach(function(event) {
var _sources = '';
if (event.source) {
_sources = event.source.component + ' ' + event.source.host;
}
$scope.content.push({ $scope.content.push({
time: $filter('date')(event.timestamp, 'medium'), firstSeen: $filter('date')(event.firstTimestamp, 'medium'),
from: event.source, lastSeen: $filter('date')(event.lastTimestamp, 'medium'),
subobject: event.involvedObject.fieldPath, count: event.count,
name: event.involvedObject.name,
kind: event.involvedObject.kind,
subObject: event.involvedObject.fieldPath,
reason: event.reason, reason: event.reason,
source: _sources,
message: event.message message: event.message
}); });
}); });
}).error($scope.handleError); }).error($scope.handleError);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
app.controller('ListEventsCtrl', [ app.controller('ListEventsCtrl', [
'$scope', '$scope',
'$routeParams', '$routeParams',
'k8sApi', 'k8sv1Beta3Api',
'$location', '$location',
'$filter', '$filter',
function($scope, $routeParams, k8sApi, $location, $filter) { function($scope, $routeParams, k8sApi, $location, $filter) {
...@@ -19,26 +19,20 @@ app.controller('ListEventsCtrl', [ ...@@ -19,26 +19,20 @@ app.controller('ListEventsCtrl', [
$scope.serverView = false; $scope.serverView = false;
$scope.headers = [ $scope.headers = [
{name: 'Time', field: 'time'}, {name: 'First Seen', field: 'firstSeen'},
{name: 'From', field: 'from'}, {name: 'Last Seen', field: 'lastSeen'},
{name: 'Sub Object Path', field: 'subobject'}, {name: 'Count', field: 'count'},
{name: 'Name', field: 'name'},
{name: 'Kind', field: 'kind'},
{name: 'SubObject', field: 'subObject'},
{name: 'Reason', field: 'reason'}, {name: 'Reason', field: 'reason'},
{name: 'Source', field: 'source'},
{name: 'Message', field: 'message'} {name: 'Message', field: 'message'}
]; ];
$scope.custom = {
time: '',
from: 'grey',
subobject: 'grey',
reason: 'grey',
message: 'grey'
};
$scope.sortable = ['time', 'from', 'subobject'];
$scope.thumbs = 'thumb';
$scope.count = 10;
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
$scope.sortable = ['firstSeen', 'lastSeen', 'count', 'name', 'kind', 'subObject', 'reason', 'source'];
$scope.count = 10;
function handleError(data, status, headers, config) { function handleError(data, status, headers, config) {
console.log("Error (" + status + "): " + data); console.log("Error (" + status + "): " + data);
$scope.loading = false; $scope.loading = false;
...@@ -60,15 +54,26 @@ app.controller('ListEventsCtrl', [ ...@@ -60,15 +54,26 @@ app.controller('ListEventsCtrl', [
}; };
data.items.forEach(function(event) { data.items.forEach(function(event) {
var _sources = '';
if (event.source) {
_sources = event.source.component + ' ' + event.source.host;
}
$scope.content.push({ $scope.content.push({
time: $filter('date')(event.timestamp, 'medium'), firstSeen: $filter('date')(event.firstTimestamp, 'medium'),
from: event.source, lastSeen: $filter('date')(event.lastTimestamp, 'medium'),
subobject: event.involvedObject.fieldPath, count: event.count,
name: event.involvedObject.name,
kind: event.involvedObject.kind,
subObject: event.involvedObject.fieldPath,
reason: event.reason, reason: event.reason,
source: _sources,
message: event.message message: event.message
}); });
}); });
}).error($scope.handleError); }).error($scope.handleError);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment