feat: add scheduled tasks UI to devtools plugin
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> remove circular dependency Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> remove another unused backend defaults dependency Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> revert package.json Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> revert the other package.json Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> modify yarn lock file Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> fix api report for type Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> fix bulid api reports Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback and fixes Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback and fixes Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> add changeset Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> rebase yarn.lock Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> fix import for task response type Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> fix lint Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> fix debounce import Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> add lodash Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> remove debounce logic Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> remove unused auth Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> readd back changeset Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> remove example app from changeset Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> Update plugins/devtools/src/components/Content/ScheduledTasksContent/ScheduledTasksContent.tsx Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> Update .changeset/short-lizards-find.md Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com> address feedback Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
```ts
|
||||
import { BasicPermission } from '@backstage/plugin-permission-common';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
|
||||
// @public (undocumented)
|
||||
@@ -44,6 +45,12 @@ export const devToolsInfoReadPermission: BasicPermission;
|
||||
// @public
|
||||
export const devToolsPermissions: BasicPermission[];
|
||||
|
||||
// @public (undocumented)
|
||||
export const devToolsTaskSchedulerCreatePermission: BasicPermission;
|
||||
|
||||
// @public (undocumented)
|
||||
export const devToolsTaskSchedulerReadPermission: BasicPermission;
|
||||
|
||||
// @public (undocumented)
|
||||
export type Endpoint = {
|
||||
name: string;
|
||||
@@ -83,4 +90,57 @@ export type PackageDependency = {
|
||||
name: string;
|
||||
versions: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type ScheduledTasks = {
|
||||
scheduledTasks?: TaskApiTasksResponse[];
|
||||
error?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface TaskApiTasksResponse {
|
||||
// (undocumented)
|
||||
pluginId: string;
|
||||
// (undocumented)
|
||||
scope: 'global' | 'local';
|
||||
// (undocumented)
|
||||
settings: {
|
||||
version: number;
|
||||
} & JsonObject;
|
||||
// (undocumented)
|
||||
taskId: string;
|
||||
// (undocumented)
|
||||
taskState:
|
||||
| {
|
||||
status: 'running';
|
||||
startedAt: string;
|
||||
timesOutAt?: string;
|
||||
lastRunError?: string;
|
||||
lastRunEndedAt?: string;
|
||||
}
|
||||
| {
|
||||
status: 'idle';
|
||||
startsAt?: string;
|
||||
lastRunError?: string;
|
||||
lastRunEndedAt?: string;
|
||||
}
|
||||
| null;
|
||||
// (undocumented)
|
||||
workerState:
|
||||
| {
|
||||
status: 'initial-wait';
|
||||
}
|
||||
| {
|
||||
status: 'idle';
|
||||
}
|
||||
| {
|
||||
status: 'running';
|
||||
}
|
||||
| null;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export type TriggerScheduledTask = {
|
||||
error?: string;
|
||||
};
|
||||
```
|
||||
|
||||
@@ -48,6 +48,22 @@ export const devToolsExternalDependenciesReadPermission = createPermission({
|
||||
attributes: { action: 'read' },
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const devToolsTaskSchedulerReadPermission = createPermission({
|
||||
name: 'devtools.task-scheduler',
|
||||
attributes: { action: 'read' },
|
||||
});
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const devToolsTaskSchedulerCreatePermission = createPermission({
|
||||
name: 'devtools.task-scheduler',
|
||||
attributes: { action: 'create' },
|
||||
});
|
||||
|
||||
/**
|
||||
* List of all Devtools permissions
|
||||
*
|
||||
@@ -58,4 +74,6 @@ export const devToolsPermissions = [
|
||||
devToolsInfoReadPermission,
|
||||
devToolsConfigReadPermission,
|
||||
devToolsExternalDependenciesReadPermission,
|
||||
devToolsTaskSchedulerReadPermission,
|
||||
devToolsTaskSchedulerCreatePermission,
|
||||
];
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
/* We want to maintain the same information as an enum, so we disable the redeclaration warning */
|
||||
/* eslint-disable @typescript-eslint/no-redeclare */
|
||||
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
|
||||
/** @public */
|
||||
export type Endpoint = {
|
||||
@@ -82,3 +82,54 @@ export type ConfigError = {
|
||||
messages?: string[];
|
||||
stack?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* The shape of a task definition as returned by the service's REST API.
|
||||
* This is a duplication of the below:
|
||||
* @see https://github.com/backstage/backstage/blob/master/packages/backend-defaults/src/entrypoints/scheduler/lib/types.ts
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface TaskApiTasksResponse {
|
||||
taskId: string;
|
||||
pluginId: string;
|
||||
scope: 'global' | 'local';
|
||||
settings: { version: number } & JsonObject;
|
||||
taskState:
|
||||
| {
|
||||
status: 'running';
|
||||
startedAt: string;
|
||||
timesOutAt?: string;
|
||||
lastRunError?: string;
|
||||
lastRunEndedAt?: string;
|
||||
}
|
||||
| {
|
||||
status: 'idle';
|
||||
startsAt?: string;
|
||||
lastRunError?: string;
|
||||
lastRunEndedAt?: string;
|
||||
}
|
||||
| null;
|
||||
workerState:
|
||||
| {
|
||||
status: 'initial-wait';
|
||||
}
|
||||
| {
|
||||
status: 'idle';
|
||||
}
|
||||
| {
|
||||
status: 'running';
|
||||
}
|
||||
| null;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export type ScheduledTasks = {
|
||||
scheduledTasks?: TaskApiTasksResponse[];
|
||||
error?: string;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export type TriggerScheduledTask = {
|
||||
error?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user