Skip to content

Commit d3bdc78

Browse files
committed
fix: UI should distinguish pending from offline
1 parent 4e8309d commit d3bdc78

File tree

2 files changed

+11
-0
lines changed
  • plugins/plugin-codeflare

2 files changed

+11
-0
lines changed

Diff for: plugins/plugin-codeflare/src/tray/watchers/profile/status.ts

+7
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ export default class ProfileStatusWatcher {
4141
? "pending"
4242
: this.headReadiness === "error" || this.workerReadiness === "error"
4343
? "error"
44+
: this.isOffline(this.headReadiness) && this.isOffline(this.workerReadiness)
45+
? "offline"
4446
: !this.isReady(this.headReadiness) && !this.isReady(this.workerReadiness)
4547
? "pending"
4648
: "success"
4749
}
4850

51+
private isOffline(readiness: string) {
52+
const match = readiness.match(/^(\d)+\/(\d)+$/)
53+
return match && match[1] === "0"
54+
}
55+
4956
private isReady(readiness: string) {
5057
const match = readiness.match(/^(\d)+\/(\d)+$/)
5158
return match && match[1] === match[2]

Diff for: plugins/plugin-codeflare/web/scss/components/ProfileExplorer/_index.scss

+4
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@
6767
background-color: var(--color-warning);
6868
}
6969

70+
&--offline {
71+
background-color: var(--color-red);
72+
}
73+
7074
&--success {
7175
background-color: var(--color-ok);
7276
}

0 commit comments

Comments
 (0)