@@ -69,25 +69,33 @@ class CoderRemoteEnvironment(
69
69
}
70
70
}
71
71
})
72
- if (wsRawStatus.canStart() && ! workspace.outdated) {
73
- actions.add(Action (context.i18n.ptrl(" Start" )) {
74
- val build = client.startWorkspace(workspace)
75
- update(workspace.copy(latestBuild = build), agent)
76
- })
72
+
73
+ if (wsRawStatus.canStart()) {
74
+ if (workspace.outdated) {
75
+ actions.add(Action (context.i18n.ptrl(" Update and start" )) {
76
+ val build = client.updateWorkspace(workspace)
77
+ update(workspace.copy(latestBuild = build), agent)
78
+ })
79
+ } else {
80
+ actions.add(Action (context.i18n.ptrl(" Start" )) {
81
+ val build = client.startWorkspace(workspace)
82
+ update(workspace.copy(latestBuild = build), agent)
83
+ })
84
+ }
77
85
}
78
86
if (wsRawStatus.canStop()) {
79
- actions.add(Action (context.i18n.ptrl(" Stop" )) {
80
- val build = client.stopWorkspace(workspace)
81
- update(workspace.copy(latestBuild = build), agent)
82
- })
83
- }
84
- if (workspace.outdated) {
85
- actions.add(Action (context.i18n.ptrl(" Update and start" )) {
86
- val build = client.updateWorkspace(workspace)
87
- update(workspace.copy(latestBuild = build), agent)
88
- })
87
+ if (workspace.outdated) {
88
+ actions.add(Action (context.i18n.ptrl(" Update and restart" )) {
89
+ val build = client.updateWorkspace(workspace)
90
+ update(workspace.copy(latestBuild = build), agent)
91
+ })
92
+ } else {
93
+ actions.add(Action (context.i18n.ptrl(" Stop" )) {
94
+ val build = client.stopWorkspace(workspace)
95
+ update(workspace.copy(latestBuild = build), agent)
96
+ })
97
+ }
89
98
}
90
-
91
99
return actions
92
100
}
93
101
0 commit comments