mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 20:50:24 +00:00
Update events for v1beta3 api
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
app.controller('ListEventsCtrl', [
|
||||
'$scope',
|
||||
'$routeParams',
|
||||
'k8sApi',
|
||||
'k8sv1Beta3Api',
|
||||
'$location',
|
||||
'$filter',
|
||||
function($scope, $routeParams, k8sApi, $location, $filter) {
|
||||
@@ -19,26 +19,20 @@ app.controller('ListEventsCtrl', [
|
||||
$scope.serverView = false;
|
||||
|
||||
$scope.headers = [
|
||||
{name: 'Time', field: 'time'},
|
||||
{name: 'From', field: 'from'},
|
||||
{name: 'Sub Object Path', field: 'subobject'},
|
||||
{name: 'First Seen', field: 'firstSeen'},
|
||||
{name: 'Last Seen', field: 'lastSeen'},
|
||||
{name: 'Count', field: 'count'},
|
||||
{name: 'Name', field: 'name'},
|
||||
{name: 'Kind', field: 'kind'},
|
||||
{name: 'SubObject', field: 'subObject'},
|
||||
{name: 'Reason', field: 'reason'},
|
||||
{name: 'Source', field: 'source'},
|
||||
{name: 'Message', field: 'message'}
|
||||
];
|
||||
|
||||
$scope.custom = {
|
||||
time: '',
|
||||
from: 'grey',
|
||||
subobject: 'grey',
|
||||
reason: 'grey',
|
||||
message: 'grey'
|
||||
};
|
||||
$scope.sortable = ['time', 'from', 'subobject'];
|
||||
$scope.thumbs = 'thumb';
|
||||
|
||||
$scope.sortable = ['firstSeen', 'lastSeen', 'count', 'name', 'kind', 'subObject', 'reason', 'source'];
|
||||
$scope.count = 10;
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
|
||||
|
||||
function handleError(data, status, headers, config) {
|
||||
console.log("Error (" + status + "): " + data);
|
||||
$scope.loading = false;
|
||||
@@ -60,15 +54,26 @@ app.controller('ListEventsCtrl', [
|
||||
};
|
||||
|
||||
data.items.forEach(function(event) {
|
||||
var _sources = '';
|
||||
if (event.source) {
|
||||
_sources = event.source.component + ' ' + event.source.host;
|
||||
}
|
||||
|
||||
|
||||
$scope.content.push({
|
||||
time: $filter('date')(event.timestamp, 'medium'),
|
||||
from: event.source,
|
||||
subobject: event.involvedObject.fieldPath,
|
||||
firstSeen: $filter('date')(event.firstTimestamp, 'medium'),
|
||||
lastSeen: $filter('date')(event.lastTimestamp, 'medium'),
|
||||
count: event.count,
|
||||
name: event.involvedObject.name,
|
||||
kind: event.involvedObject.kind,
|
||||
subObject: event.involvedObject.fieldPath,
|
||||
reason: event.reason,
|
||||
source: _sources,
|
||||
message: event.message
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
}).error($scope.handleError);
|
||||
|
Reference in New Issue
Block a user