Skip to content

Commit 789f25a

Browse files
committed
Hide container controls if there is only one container
Final change to louislam#649 as there is no need for the container controls if there is only a single container.
1 parent fc96f4e commit 789f25a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

frontend/src/components/Container.vue

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
<font-awesome-icon icon="terminal" />
2222
Bash
2323
</router-link>
24-
<button v-if="!isEditMode && status !== 'running' && status !== 'healthy'"
24+
<button v-if="this.serviceCount > 1 && !isEditMode && status !== 'running' && status !== 'healthy'"
2525
class="btn btn-primary"
2626
:disabled="processing"
2727
@click="startService">
2828
<font-awesome-icon icon="play" class="me-1" />
2929
{{ $t("startStack") }}
3030
</button>
31-
<button v-if="!isEditMode && (status === 'running' || status === 'healthy' || status === 'unhealthy')"
31+
<button v-if="this.serviceCount > 1 && !isEditMode && (status === 'running' || status === 'healthy' || status === 'unhealthy')"
3232
class="btn btn-normal"
3333
:disabled="processing"
3434
@click="restartService">
3535
<font-awesome-icon icon="rotate" class="me-1" />
3636
{{ $t("restartStack") }}
3737
</button>
38-
<button v-if="!isEditMode && (status === 'running' || status === 'healthy' || status === 'unhealthy')"
38+
<button v-if="this.serviceCount > 1 && !isEditMode && (status === 'running' || status === 'healthy' || status === 'unhealthy')"
3939
class="btn btn-normal"
4040
:disabled="processing"
4141
@click="stopService">
@@ -260,6 +260,10 @@ export default defineComponent({
260260
return this.jsonObject.services[this.name];
261261
},
262262
263+
serviceCount() {
264+
return Object.keys(this.jsonObject.services).length;
265+
},
266+
263267
jsonObject() {
264268
return this.$parent.$parent.jsonConfig;
265269
},

0 commit comments

Comments
 (0)