mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add cronjob trigger (#694)
Signed-off-by: Nox <aurelien.gaston@krondor.fr> Co-authored-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
1 parent
0f11b03692
commit
8f778ea379
12 files changed
+259
-37
No files matched your search
@@ -3,8 +3,10 @@ import "./cronjobs.scss";
|
||||
import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { RouteComponentProps } from "react-router";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { t, Trans } from "@lingui/macro";
|
||||
import { CronJob, cronJobApi } from "../../api/endpoints/cron-job.api";
|
||||
import { MenuItem } from "../menu";
|
||||
import { Icon } from "../icon";
|
||||
import { cronJobStore } from "./cronjob.store";
|
||||
import { jobStore } from "../+workloads-jobs/job.store";
|
||||
import { eventStore } from "../+events/event.store";
|
||||
@@ -12,7 +14,9 @@ import { KubeObjectMenu, KubeObjectMenuProps } from "../kube-object/kube-object-
|
||||
import { ICronJobsRouteParams } from "../+workloads";
|
||||
import { KubeObjectListLayout } from "../kube-object";
|
||||
import { KubeEventIcon } from "../+events/kube-event-icon";
|
||||
import { _i18n } from "../../i18n";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { CronJobTriggerDialog } from "./cronjob-trigger-dialog";
|
||||
|
||||
enum sortBy {
|
||||
name = "name",
|
||||
@@ -79,8 +83,14 @@ export class CronJobs extends React.Component<Props> {
|
||||
}
|
||||
|
||||
export function CronJobMenu(props: KubeObjectMenuProps<CronJob>) {
|
||||
const { object, toolbar } = props;
|
||||
return (
|
||||
<KubeObjectMenu {...props}/>
|
||||
<KubeObjectMenu {...props}>
|
||||
<MenuItem onClick={() => CronJobTriggerDialog.open(object)}>
|
||||
<Icon material="play_circle_filled" title={_i18n._(t`Trigger`)} interactive={toolbar}/>
|
||||
<span className="title"><Trans>Trigger</Trans></span>
|
||||
</MenuItem>
|
||||
</KubeObjectMenu>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user