Skip to content

Commit

Permalink
addjusted UI for the status change
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlp committed Dec 28, 2024
1 parent fa37b5b commit 893dd85
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public class ExampleApplication {

- http://localhost:8080/task-ui

## Schedulers
![Schedulers](screenshots/schedulers-screen.png)

## Triggers
![Triggers](screenshots/triggers-screen.png)

Expand Down
3 changes: 1 addition & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@
<classPatterns>
<pattern>org.sterl.spring.persistent_tasks.api.**</pattern>
</classPatterns>
<outputFile>
../spring-persistent-tasks-ui/src/server-api.d.ts</outputFile>
<outputFile>../ui/src/server-api.d.ts</outputFile>
<outputKind>module</outputKind>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<column computed="false" name="running_duration_in_ms" type="bigint" />
<column computed="false" name="start_time" type="${offsetdatetime.type}" />
<column computed="false" name="state" type="${binary.type}" />
<column computed="false" name="status" type="varchar(20)">
<column computed="false" name="status" type="varchar(20)" defaultValue="WAITING">
<constraints nullable="false" />
</column>
<column computed="false" name="last_ping" type="${offsetdatetime.type}" />
Expand Down
Binary file added screenshots/schedulers-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sterl.spring</groupId>
<artifactId>spring-persistent-tasks-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/server-api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ export interface Serializable {
export interface Consumer<T> {
}

export type TriggerStatus = "NEW" | "RUNNING" | "SUCCESS" | "FAILED" | "CANCELED";
export type TriggerStatus = "WAITING" | "RUNNING" | "SUCCESS" | "FAILED" | "CANCELED";
14 changes: 8 additions & 6 deletions ui/src/trigger/views/trigger-staus.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ interface Props {
const TriggerStatusView = ({ data }: Props) => {
if (!data) return undefined;

if (data.status === "SUCCESS") return <Badge bg="success">SUCCESS</Badge>;
if (data.status === "RUNNING") return <Badge>RUNNING</Badge>;
if (data.status === "FAILED") return <Badge bg="danger">FAILED</Badge>;
if (data.status === "SUCCESS") return <Badge bg="success">Success</Badge>;
if (data.status === "FAILED") return <Badge bg="danger">Failed</Badge>;
if (data.status === "RUNNING") return <Badge>Running</Badge>;

if (data.end != null && data.status === "NEW") {
return <Badge bg="warning">RETRY</Badge>;
if (data.executionCount > 0 && data.status === "WAITING") {
return <Badge bg="warning">Retry</Badge>;
}
if (data.status === "NEW") return <Badge bg="secondary">WAITING</Badge>;
if (data.status === "WAITING") return <Badge bg="secondary">Wating</Badge>;
if (data.status === "CANCELED")
return <Badge bg="secondary">Canceled</Badge>;

return <Badge>{data.status}</Badge>;
};
Expand Down

0 comments on commit 893dd85

Please sign in to comment.