@@ -65,6 +65,28 @@ export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
65
65
}
66
66
}
67
67
68
+ // Unhealthy
69
+ if (
70
+ workspace . latest_build . status === "running" &&
71
+ ! workspace . health . healthy
72
+ ) {
73
+ notifications . push ( {
74
+ title : "Workspace is unhealthy" ,
75
+ severity : "warning" ,
76
+ detail : `Your workspace is running but ${
77
+ workspace . health . failing_agents . length > 1
78
+ ? `${ workspace . health . failing_agents . length } agents are unhealthy`
79
+ : `1 agent is unhealthy`
80
+ } .`,
81
+ actions : [
82
+ {
83
+ label : "Restart" ,
84
+ onClick : onRestartWorkspace ,
85
+ } ,
86
+ ] ,
87
+ } ) ;
88
+ }
89
+
68
90
// Pending in Queue
69
91
const [ showAlertPendingInQueue , setShowAlertPendingInQueue ] = useState ( false ) ;
70
92
// 2023-11-15 - MES - This effect will be called every single render because
@@ -104,33 +126,6 @@ export const WorkspaceNotifications: FC<WorkspaceNotificationsProps> = (
104
126
105
127
return (
106
128
< >
107
- { workspace . latest_build . status === "running" &&
108
- ! workspace . health . healthy && (
109
- < Alert
110
- severity = "warning"
111
- actions = {
112
- permissions . updateWorkspace && (
113
- < Button
114
- variant = "text"
115
- size = "small"
116
- onClick = { onRestartWorkspace }
117
- >
118
- Restart
119
- </ Button >
120
- )
121
- }
122
- >
123
- < AlertTitle > Workspace is unhealthy</ AlertTitle >
124
- < AlertDetail >
125
- Your workspace is running but{ " " }
126
- { workspace . health . failing_agents . length > 1
127
- ? `${ workspace . health . failing_agents . length } agents are unhealthy`
128
- : `1 agent is unhealthy` }
129
- .
130
- </ AlertDetail >
131
- </ Alert >
132
- ) }
133
-
134
129
< DormantWorkspaceBanner workspace = { workspace } />
135
130
136
131
{ showAlertPendingInQueue && (
0 commit comments