Skip to content

Commit 707b0ea

Browse files
committed
ui: show deploy button only if allowed
Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 7428baa commit 707b0ea

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

ui/src/components/view/InfoCard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,9 @@
764764
</a-button>
765765
</router-link>
766766
</div>
767-
<image-deploy-instance-button :resource="resource" />
767+
<image-deploy-instance-button
768+
v-if="'deployVirtualMachine' in $store.getters.apis && ['template', 'iso'].includes($route.meta.name)"
769+
:resource="resource" />
768770
</div>
769771

770772
<div class="account-center-tags" v-if="showKeys || resource.apikeyaccess">

ui/src/views/image/IsoZones.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
<span v-if="record.created">{{ $toLocaleDate(record.created) }}</span>
5353
</template>
5454
<template v-if="column.key === 'actions'">
55-
<span style="margin-right: 5px">
55+
<span style="margin-right: 5px" v-if="'deployVirtualMachine' in $store.getters.apis">
5656
<tooltip-button
57-
:disabled="!('deployVirtualMachine' in $store.getters.apis) || !record.isready"
57+
:disabled="!record.isready"
5858
:title="$t('label.vm.add')"
5959
icon="rocket-outlined"
6060
@onClick="onAddInstance(record)"/>

ui/src/views/image/TemplateZones.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@
5252
<span v-if="record.created">{{ $toLocaleDate(record.created) }}</span>
5353
</template>
5454
<template v-if="column.key === 'actions'">
55-
<span style="margin-right: 5px">
55+
<span style="margin-right: 5px" v-if="'deployVirtualMachine' in $store.getters.apis">
5656
<tooltip-button
57-
:disabled="!('deployVirtualMachine' in $store.getters.apis) || !record.isready"
57+
:disabled="!record.isready"
5858
:title="$t('label.vm.add')"
5959
icon="rocket-outlined"
6060
@onClick="onAddInstance(record)"/>

0 commit comments

Comments
 (0)