mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add quick namespace filtering to CronJobs view
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
d3287f5e21
commit
e0c64b37ad
@ -8,5 +8,9 @@
|
|||||||
&.warning {
|
&.warning {
|
||||||
@include table-cell-warning;
|
@include table-cell-warning;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.filterNamespace {
|
||||||
|
border-bottom: unset;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,6 +19,9 @@ import { withInjectables } from "@ogre-tools/injectable-react";
|
|||||||
import cronJobStoreInjectable from "./store.injectable";
|
import cronJobStoreInjectable from "./store.injectable";
|
||||||
import jobStoreInjectable from "../+workloads-jobs/store.injectable";
|
import jobStoreInjectable from "../+workloads-jobs/store.injectable";
|
||||||
import eventStoreInjectable from "../+events/store.injectable";
|
import eventStoreInjectable from "../+events/store.injectable";
|
||||||
|
import { prevDefault } from "../../utils";
|
||||||
|
import type { FilterByNamespace } from "../+namespaces/namespace-select-filter-model/filter-by-namespace.injectable";
|
||||||
|
import filterByNamespaceInjectable from "../+namespaces/namespace-select-filter-model/filter-by-namespace.injectable";
|
||||||
|
|
||||||
enum columnId {
|
enum columnId {
|
||||||
name = "name",
|
name = "name",
|
||||||
@ -34,6 +37,7 @@ interface Dependencies {
|
|||||||
cronJobStore: CronJobStore;
|
cronJobStore: CronJobStore;
|
||||||
jobStore: JobStore;
|
jobStore: JobStore;
|
||||||
eventStore: EventStore;
|
eventStore: EventStore;
|
||||||
|
filterByNamespace: FilterByNamespace;
|
||||||
}
|
}
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
@ -43,6 +47,7 @@ class NonInjectedCronJobs extends React.Component<Dependencies>{
|
|||||||
cronJobStore,
|
cronJobStore,
|
||||||
eventStore,
|
eventStore,
|
||||||
jobStore,
|
jobStore,
|
||||||
|
filterByNamespace,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -83,7 +88,13 @@ class NonInjectedCronJobs extends React.Component<Dependencies>{
|
|||||||
renderTableContents={cronJob => [
|
renderTableContents={cronJob => [
|
||||||
cronJob.getName(),
|
cronJob.getName(),
|
||||||
<KubeObjectStatusIcon key="icon" object={cronJob} />,
|
<KubeObjectStatusIcon key="icon" object={cronJob} />,
|
||||||
cronJob.getNs(),
|
<a
|
||||||
|
key="namespace"
|
||||||
|
className="filterNamespace"
|
||||||
|
onClick={prevDefault(() => filterByNamespace(cronJob.getNs()))}
|
||||||
|
>
|
||||||
|
{cronJob.getNs()}
|
||||||
|
</a>,
|
||||||
cronJob.isNeverRun() ? "never" : cronJob.getSchedule(),
|
cronJob.isNeverRun() ? "never" : cronJob.getSchedule(),
|
||||||
cronJob.getSuspendFlag(),
|
cronJob.getSuspendFlag(),
|
||||||
cronJobStore.getActiveJobsNum(cronJob),
|
cronJobStore.getActiveJobsNum(cronJob),
|
||||||
@ -98,9 +109,10 @@ class NonInjectedCronJobs extends React.Component<Dependencies>{
|
|||||||
|
|
||||||
export const CronJobs = withInjectables<Dependencies>(NonInjectedCronJobs, {
|
export const CronJobs = withInjectables<Dependencies>(NonInjectedCronJobs, {
|
||||||
getProps: (di, props) => ({
|
getProps: (di, props) => ({
|
||||||
|
...props,
|
||||||
cronJobStore: di.inject(cronJobStoreInjectable),
|
cronJobStore: di.inject(cronJobStoreInjectable),
|
||||||
eventStore: di.inject(eventStoreInjectable),
|
eventStore: di.inject(eventStoreInjectable),
|
||||||
jobStore: di.inject(jobStoreInjectable),
|
jobStore: di.inject(jobStoreInjectable),
|
||||||
...props,
|
filterByNamespace: di.inject(filterByNamespaceInjectable),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user