mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-15 19:49:36 +00:00
Update dashboard breadcrumbs
- Update back buttons - Ignore duplicated README.md - Rename /minions to /nodes - Deactivate more buttons - Updates to list selection and node detail page
This commit is contained in:
@@ -18,7 +18,7 @@ angular.module('kubernetesApp.components.dashboard', [])
|
||||
$scope.subPages = [
|
||||
{category: 'dashboard', name: 'Explore', value: '/dashboard/groups/type/selector/'},
|
||||
{category: 'dashboard', name: 'Pods', value: '/dashboard/pods'},
|
||||
{category: 'dashboard', name: 'Minions', value: '/dashboard/minions'},
|
||||
{category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes'},
|
||||
{category: 'dashboard', name: 'Replication Controllers', value: '/dashboard/replicationcontrollers'},
|
||||
{category: 'dashboard', name: 'Services', value: '/dashboard/services'},
|
||||
{category: 'dashboard', name: 'Events', value: '/dashboard/events'}
|
||||
|
@@ -39,11 +39,6 @@ app.controller('ListEventsCtrl', [
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
|
||||
|
||||
$scope.moreClick = function(d, e) {
|
||||
$location.path('/dashboard/pods/' + d.id);
|
||||
e.stopPropagation();
|
||||
};
|
||||
|
||||
function handleError(data, status, headers, config) {
|
||||
console.log("Error (" + status + "): " + data);
|
||||
$scope.loading = false;
|
||||
@@ -51,7 +46,7 @@ app.controller('ListEventsCtrl', [
|
||||
|
||||
$scope.content = [];
|
||||
|
||||
function getData(dataId) {
|
||||
function getData() {
|
||||
$scope.loading = true;
|
||||
k8sApi.getEvents().success(function(data) {
|
||||
$scope.loading = false;
|
||||
@@ -79,7 +74,7 @@ app.controller('ListEventsCtrl', [
|
||||
}).error($scope.handleError);
|
||||
}
|
||||
|
||||
getData($routeParams.serviceId);
|
||||
getData();
|
||||
|
||||
}
|
||||
]);
|
||||
|
@@ -28,12 +28,7 @@ app.controller('ListMinionsCtrl', [
|
||||
$scope.thumbs = 'thumb';
|
||||
$scope.count = 10;
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
|
||||
|
||||
$scope.moreClick = function(d, e) {
|
||||
$location.path('/dashboard/pods/' + d.id);
|
||||
e.stopPropagation();
|
||||
};
|
||||
$scope.go = function(data) { $location.path('/dashboard/nodes/' + data.name); };
|
||||
|
||||
function handleError(data, status, headers, config) {
|
||||
console.log("Error (" + status + "): " + data);
|
||||
@@ -42,7 +37,7 @@ app.controller('ListMinionsCtrl', [
|
||||
|
||||
$scope.content = [];
|
||||
|
||||
function getData(dataId) {
|
||||
function getData() {
|
||||
$scope.loading = true;
|
||||
k8sApi.getMinions().success(function(data) {
|
||||
$scope.loading = false;
|
||||
@@ -70,7 +65,7 @@ app.controller('ListMinionsCtrl', [
|
||||
}).error($scope.handleError);
|
||||
}
|
||||
|
||||
getData($routeParams.serviceId);
|
||||
getData();
|
||||
|
||||
}
|
||||
]);
|
||||
|
@@ -37,12 +37,7 @@ app.controller('ListPodsCtrl', [
|
||||
$scope.sortable = ['pod', 'ip', 'status'];
|
||||
$scope.count = 10;
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
|
||||
|
||||
$scope.moreClick = function(d, e) {
|
||||
$location.path('/dashboard/pods/' + d.id);
|
||||
e.stopPropagation();
|
||||
};
|
||||
$scope.go = function(data) { $location.path('/dashboard/pods/' + data.pod); };
|
||||
|
||||
var orderedPodNames = [];
|
||||
|
||||
@@ -55,7 +50,7 @@ app.controller('ListPodsCtrl', [
|
||||
|
||||
$scope.content = [];
|
||||
|
||||
function getData(dataId) {
|
||||
function getData() {
|
||||
$scope.loading = true;
|
||||
k8sApi.getPods().success(angular.bind(this, function(data) {
|
||||
$scope.loading = false;
|
||||
@@ -130,7 +125,7 @@ app.controller('ListPodsCtrl', [
|
||||
return _.indexOf(orderedPodNames, name) + 1;
|
||||
};
|
||||
|
||||
getData($routeParams.serviceId);
|
||||
getData();
|
||||
|
||||
}
|
||||
]);
|
||||
|
@@ -36,12 +36,7 @@ app.controller('ListReplicationControllersCtrl', [
|
||||
$scope.thumbs = 'thumb';
|
||||
$scope.count = 10;
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/pods/' + d.id); };
|
||||
|
||||
$scope.moreClick = function(d, e) {
|
||||
$location.path('/dashboard/pods/' + d.id);
|
||||
e.stopPropagation();
|
||||
};
|
||||
$scope.go = function(data) { $location.path('/dashboard/replicationcontrollers/' + data.controller); };
|
||||
|
||||
function handleError(data, status, headers, config) {
|
||||
console.log("Error (" + status + "): " + data);
|
||||
@@ -50,7 +45,7 @@ app.controller('ListReplicationControllersCtrl', [
|
||||
|
||||
$scope.content = [];
|
||||
|
||||
function getData(dataId) {
|
||||
function getData() {
|
||||
$scope.loading = true;
|
||||
k8sApi.getReplicationControllers().success(function(data) {
|
||||
$scope.loading = false;
|
||||
@@ -95,7 +90,7 @@ app.controller('ListReplicationControllersCtrl', [
|
||||
}).error($scope.handleError);
|
||||
}
|
||||
|
||||
getData($routeParams.serviceId);
|
||||
getData();
|
||||
|
||||
}
|
||||
]);
|
||||
|
@@ -9,7 +9,8 @@ app.controller('ListServicesCtrl', [
|
||||
'$routeParams',
|
||||
'k8sApi',
|
||||
'$rootScope',
|
||||
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
|
||||
'$location',
|
||||
function($scope, $interval, $routeParams, k8sApi, $rootScope, $location) {
|
||||
'use strict';
|
||||
$scope.doTheBack = function() { window.history.back(); };
|
||||
|
||||
@@ -31,6 +32,8 @@ app.controller('ListServicesCtrl', [
|
||||
$scope.sortable = ['name', 'ip', 'port'];
|
||||
$scope.count = 10;
|
||||
|
||||
$scope.go = function(data) { $location.path('/dashboard/services/' + data.name); };
|
||||
|
||||
$scope.content = [];
|
||||
|
||||
$rootScope.doTheBack = $scope.doTheBack;
|
||||
@@ -40,9 +43,9 @@ app.controller('ListServicesCtrl', [
|
||||
$scope_.loading = false;
|
||||
};
|
||||
|
||||
$scope.getData = function(dataId) {
|
||||
$scope.getData = function() {
|
||||
$scope.loading = true;
|
||||
k8sApi.getServices(dataId).success(angular.bind(this, function(data) {
|
||||
k8sApi.getServices().success(angular.bind(this, function(data) {
|
||||
$scope.services = data;
|
||||
$scope.loading = false;
|
||||
|
||||
@@ -105,6 +108,6 @@ app.controller('ListServicesCtrl', [
|
||||
})).error($scope.handleError);
|
||||
};
|
||||
|
||||
$scope.getData($routeParams.serviceId);
|
||||
$scope.getData();
|
||||
}
|
||||
]);
|
||||
|
@@ -0,0 +1,33 @@
|
||||
/**=========================================================
|
||||
* Module: Nodes
|
||||
* Visualizer for nodes
|
||||
=========================================================*/
|
||||
|
||||
app.controller('NodeCtrl', [
|
||||
'$scope',
|
||||
'$interval',
|
||||
'$routeParams',
|
||||
'k8sApi',
|
||||
'$rootScope',
|
||||
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
|
||||
'use strict';
|
||||
$scope.doTheBack = function() { window.history.back(); };
|
||||
|
||||
$rootScope.doTheBack = $scope.doTheBack;
|
||||
|
||||
$scope.handleError = function(data, status, headers, config) {
|
||||
console.log("Error (" + status + "): " + data);
|
||||
$scope_.loading = false;
|
||||
};
|
||||
|
||||
$scope.handleNode = function(nodeId) {
|
||||
$scope.loading = true;
|
||||
k8sApi.getNodes(nodeId).success(angular.bind(this, function(data) {
|
||||
$scope.node = data;
|
||||
$scope.loading = false;
|
||||
})).error($scope.handleError);
|
||||
};
|
||||
|
||||
$scope.handleNode($routeParams.nodeId);
|
||||
}
|
||||
]);
|
@@ -28,5 +28,8 @@ app.controller('ReplicationControllerCtrl', [
|
||||
$scope.controller.k8sApi = k8sApi;
|
||||
$scope.controller.scope = $scope;
|
||||
$scope.controller.getData($routeParams.replicationControllerId);
|
||||
|
||||
$scope.doTheBack = function() { window.history.back(); };
|
||||
|
||||
}
|
||||
]);
|
||||
|
@@ -30,11 +30,7 @@ app.controller('ServiceCtrl', [
|
||||
$scope.controller.scope = $scope;
|
||||
$scope.controller.getData($routeParams.serviceId);
|
||||
|
||||
$scope.go = function(d) { $location.path('/dashboard/services/' + d.id); }
|
||||
$scope.doTheBack = function() { window.history.back(); };
|
||||
|
||||
$scope.moreClick = function(d, e) {
|
||||
$location.path('/dashboard/services/' + d.id);
|
||||
e.stopPropagation();
|
||||
}
|
||||
}
|
||||
]);
|
||||
|
@@ -28,12 +28,12 @@
|
||||
$scope.subpages = [
|
||||
{
|
||||
category: 'dashboard',
|
||||
name: 'Groups',
|
||||
name: 'Explore',
|
||||
value: '/dashboard/groups/type/selector/',
|
||||
id: 'groupsView'
|
||||
},
|
||||
{category: 'dashboard', name: 'Pods', value: '/dashboard/pods', id: 'podsView'},
|
||||
{category: 'dashboard', name: 'Nodes', value: '/dashboard/minions', id: 'minionsView'},
|
||||
{category: 'dashboard', name: 'Nodes', value: '/dashboard/nodes', id: 'minionsView'},
|
||||
{
|
||||
category: 'dashboard',
|
||||
name: 'Replication Controllers',
|
||||
@@ -68,8 +68,10 @@
|
||||
filters: '=',
|
||||
customClass: '=customClass',
|
||||
thumbs: '=',
|
||||
count: '='
|
||||
count: '=',
|
||||
doSelect: '&onSelect'
|
||||
},
|
||||
transclude: true,
|
||||
controller: function($scope, $filter, $window, $location) {
|
||||
var orderBy = $filter('orderBy');
|
||||
$scope.currentPage = 0;
|
||||
@@ -81,13 +83,6 @@
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$scope.go = function(d) {
|
||||
if (d.pod) {
|
||||
$location.path('/dashboard/pods/' + d.pod);
|
||||
} else if (d.name) {
|
||||
$location.path('/dashboard/services/' + d.name);
|
||||
}
|
||||
};
|
||||
$scope.order = function(predicate, reverse) {
|
||||
$scope.content = orderBy($scope.content, predicate, reverse);
|
||||
$scope.predicate = predicate;
|
||||
@@ -95,6 +90,7 @@
|
||||
$scope.order($scope.sortable[0], false);
|
||||
$scope.getNumber = function(num) { return new Array(num); };
|
||||
$scope.goToPage = function(page) { $scope.currentPage = page; };
|
||||
$scope.showMore = function() { return angular.isDefined($scope.moreClick);}
|
||||
},
|
||||
templateUrl: 'views/partials/md-table.tmpl.html'
|
||||
};
|
||||
|
Reference in New Issue
Block a user