@@ -69,25 +69,33 @@ class CoderRemoteEnvironment(
6969 }
7070 }
7171 })
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+ }
7785 }
7886 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+ }
8998 }
90-
9199 return actions
92100 }
93101
0 commit comments