Skip to content

Commit 893dd85

Browse files
committed
addjusted UI for the status change
1 parent fa37b5b commit 893dd85

File tree

7 files changed

+19
-10
lines changed

7 files changed

+19
-10
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ public class ExampleApplication {
145145

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

148+
## Schedulers
149+
![Schedulers](screenshots/schedulers-screen.png)
150+
148151
## Triggers
149152
![Triggers](screenshots/triggers-screen.png)
150153

core/pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@
115115
<classPatterns>
116116
<pattern>org.sterl.spring.persistent_tasks.api.**</pattern>
117117
</classPatterns>
118-
<outputFile>
119-
../spring-persistent-tasks-ui/src/server-api.d.ts</outputFile>
118+
<outputFile>../ui/src/server-api.d.ts</outputFile>
120119
<outputKind>module</outputKind>
121120
</configuration>
122121
</plugin>

db/src/main/resources/spring-persistent-tasks/db/pt-changelog-v1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<column computed="false" name="running_duration_in_ms" type="bigint" />
4848
<column computed="false" name="start_time" type="${offsetdatetime.type}" />
4949
<column computed="false" name="state" type="${binary.type}" />
50-
<column computed="false" name="status" type="varchar(20)">
50+
<column computed="false" name="status" type="varchar(20)" defaultValue="WAITING">
5151
<constraints nullable="false" />
5252
</column>
5353
<column computed="false" name="last_ping" type="${offsetdatetime.type}" />

screenshots/schedulers-screen.png

91.2 KB
Loading

ui/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
<artifactId>spring-boot-starter-web</artifactId>
1919
<scope>provided</scope>
2020
</dependency>
21+
<dependency>
22+
<groupId>org.sterl.spring</groupId>
23+
<artifactId>spring-persistent-tasks-core</artifactId>
24+
<version>${project.version}</version>
25+
</dependency>
2126
</dependencies>
2227

2328
<build>

ui/src/server-api.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ export interface Serializable {
9494
export interface Consumer<T> {
9595
}
9696

97-
export type TriggerStatus = "NEW" | "RUNNING" | "SUCCESS" | "FAILED" | "CANCELED";
97+
export type TriggerStatus = "WAITING" | "RUNNING" | "SUCCESS" | "FAILED" | "CANCELED";

ui/src/trigger/views/trigger-staus.view.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@ interface Props {
77
const TriggerStatusView = ({ data }: Props) => {
88
if (!data) return undefined;
99

10-
if (data.status === "SUCCESS") return <Badge bg="success">SUCCESS</Badge>;
11-
if (data.status === "RUNNING") return <Badge>RUNNING</Badge>;
12-
if (data.status === "FAILED") return <Badge bg="danger">FAILED</Badge>;
10+
if (data.status === "SUCCESS") return <Badge bg="success">Success</Badge>;
11+
if (data.status === "FAILED") return <Badge bg="danger">Failed</Badge>;
12+
if (data.status === "RUNNING") return <Badge>Running</Badge>;
1313

14-
if (data.end != null && data.status === "NEW") {
15-
return <Badge bg="warning">RETRY</Badge>;
14+
if (data.executionCount > 0 && data.status === "WAITING") {
15+
return <Badge bg="warning">Retry</Badge>;
1616
}
17-
if (data.status === "NEW") return <Badge bg="secondary">WAITING</Badge>;
17+
if (data.status === "WAITING") return <Badge bg="secondary">Wating</Badge>;
18+
if (data.status === "CANCELED")
19+
return <Badge bg="secondary">Canceled</Badge>;
1820

1921
return <Badge>{data.status}</Badge>;
2022
};

0 commit comments

Comments
 (0)