Enabling configurable columns for all major tables (#2029)

* Configurable columns in Deployments table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in DaemonSets table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in StatefulSets table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in ReplicaSets table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Jobs table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in CronJobs table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Nodes table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in ConfigMaps table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Secrets table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in ResourceQuota table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in LimitRanges table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in HPAs table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in PodDistributionBudget table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Services table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Endpoints table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Ingresses table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in NetworkPolicies table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Storage section

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Namespaces table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Events table

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Apps section

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in Access Control section

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Configurable columns in CRDs tables

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev authored and GitHub committed 2021-01-28 12:18:45 +03:00
1 parent a102ebad62
commit 3640f313b3
30 files changed
+439 -357

No files matched your search

@@ -18,12 +18,13 @@ import { KubeObjectStatusIcon } from "../kube-object-status-icon";
import { ConfirmDialog } from "../confirm-dialog/confirm-dialog";
import { Notifications } from "../notifications/notifications";
enum sortBy {
enum columnId {
name = "name",
namespace = "namespace",
schedule = "schedule",
suspend = "suspend",
active = "active",
lastSchedule = "schedule",
lastSchedule = "last-schedule",
age = "age",
}
@@ -35,15 +36,17 @@ export class CronJobs extends React.Component<Props> {
render() {
return (
<KubeObjectListLayout
isConfigurable
tableId="workload_cronjobs"
className="CronJobs" store={cronJobStore}
dependentStores={[jobStore, eventStore]}
sortingCallbacks={{
[sortBy.name]: (cronJob: CronJob) => cronJob.getName(),
[sortBy.namespace]: (cronJob: CronJob) => cronJob.getNs(),
[sortBy.suspend]: (cronJob: CronJob) => cronJob.getSuspendFlag(),
[sortBy.active]: (cronJob: CronJob) => cronJobStore.getActiveJobsNum(cronJob),
[sortBy.lastSchedule]: (cronJob: CronJob) => cronJob.getLastScheduleTime(),
[sortBy.age]: (cronJob: CronJob) => cronJob.metadata.creationTimestamp,
[columnId.name]: (cronJob: CronJob) => cronJob.getName(),
[columnId.namespace]: (cronJob: CronJob) => cronJob.getNs(),
[columnId.suspend]: (cronJob: CronJob) => cronJob.getSuspendFlag(),
[columnId.active]: (cronJob: CronJob) => cronJobStore.getActiveJobsNum(cronJob),
[columnId.lastSchedule]: (cronJob: CronJob) => cronJob.getLastScheduleTime(),
[columnId.age]: (cronJob: CronJob) => cronJob.metadata.creationTimestamp,
}}
searchFilters={[
(cronJob: CronJob) => cronJob.getSearchFields(),
@@ -51,14 +54,14 @@ export class CronJobs extends React.Component<Props> {
]}
renderHeaderTitle="Cron Jobs"
renderTableHeader={[
{ title: "Name", className: "name", sortBy: sortBy.name },
{ className: "warning" },
{ title: "Namespace", className: "namespace", sortBy: sortBy.namespace },
{ title: "Schedule", className: "schedule" },
{ title: "Suspend", className: "suspend", sortBy: sortBy.suspend },
{ title: "Active", className: "active", sortBy: sortBy.active },
{ title: "Last schedule", className: "last-schedule", sortBy: sortBy.lastSchedule },
{ title: "Age", className: "age", sortBy: sortBy.age },
{ title: "Name", className: "name", sortBy: columnId.name, id: columnId.name },
{ className: "warning", showWithColumn: columnId.name },
{ title: "Namespace", className: "namespace", sortBy: columnId.namespace, id: columnId.namespace },
{ title: "Schedule", className: "schedule", id: columnId.schedule },
{ title: "Suspend", className: "suspend", sortBy: columnId.suspend, id: columnId.suspend },
{ title: "Active", className: "active", sortBy: columnId.active, id: columnId.active },
{ title: "Last schedule", className: "last-schedule", sortBy: columnId.lastSchedule, id: columnId.lastSchedule },
{ title: "Age", className: "age", sortBy: columnId.age, id: columnId.age },
]}
renderTableContents={(cronJob: CronJob) => [
cronJob.getName(),