Skip to content

Commit

Permalink
Show kubeconfig tile only if kubeconfig available OR user can patch s…
Browse files Browse the repository at this point in the history
…hoots
  • Loading branch information
grolu committed Aug 16, 2022
1 parent 4c054dd commit 1436b52
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions frontend/src/components/ShootDetails/ShootAccessCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SPDX-License-Identifier: Apache-2.0
>
</terminal-list-tile>

<v-divider v-if="isTerminalTileVisible" inset></v-divider>
<v-divider v-if="isTerminalTileVisible && (isTerminalShortcutsTileVisible || isDashboardTileVisible || isCredentialsTileVisible || isKubeconfigTileVisible || isGardenctlTileVisible)" inset></v-divider>

<terminal-shortcuts-tile
v-if="isTerminalShortcutsTileVisible"
Expand All @@ -37,7 +37,7 @@ SPDX-License-Identifier: Apache-2.0
class="mt-3"
></terminal-shortcuts-tile>

<v-divider v-if="isTerminalShortcutsTileVisible" inset></v-divider>
<v-divider v-if="isTerminalShortcutsTileVisible && (isDashboardTileVisible || isCredentialsTileVisible || isKubeconfigTileVisible || isGardenctlTileVisible)" inset></v-divider>

<link-list-tile v-if="isDashboardTileVisible && !hasDashboardTokenAuth" icon="mdi-developer-board" app-title="Dashboard" :url="dashboardUrl" :url-text="dashboardUrlText" :is-shoot-status-hibernated="isShootStatusHibernated"></link-list-tile>

Expand Down Expand Up @@ -88,13 +88,13 @@ SPDX-License-Identifier: Apache-2.0
</v-list-item>
</template>

<v-divider v-if="isDashboardTileVisible" inset></v-divider>
<v-divider v-if="isDashboardTileVisible && (isCredentialsTileVisible || isKubeconfigTileVisible || isGardenctlTileVisible)" inset></v-divider>

<username-password v-if="isCredentialsTileVisible" :username="username" :password="password"></username-password>

<v-divider v-if="isCredentialsTileVisible" inset></v-divider>
<v-divider v-if="isCredentialsTileVisible && (isKubeconfigTileVisible || isGardenctlTileVisible)" inset></v-divider>

<v-list-item>
<v-list-item v-if="isKubeconfigTileVisible">
<v-list-item-icon>
<v-icon color="primary">mdi-file</v-icon>
</v-list-item-icon>
Expand Down Expand Up @@ -136,7 +136,7 @@ SPDX-License-Identifier: Apache-2.0
</v-card>
</v-expand-transition>

<v-divider v-if="isGardenctlTileVisible" inset></v-divider>
<v-divider v-if="isKubeconfigTileVisible && isGardenctlTileVisible" inset></v-divider>

<gardenctl-commands v-if="isGardenctlTileVisible" :shoot-item="shootItem"></gardenctl-commands>
</v-list>
Expand Down Expand Up @@ -186,7 +186,8 @@ export default {
'hasShootTerminalAccess',
'isAdmin',
'hasControlPlaneTerminalAccess',
'isTerminalShortcutsFeatureEnabled'
'isTerminalShortcutsFeatureEnabled',
'canPatchShoots'
]),
...mapState([
'cfg'
Expand Down Expand Up @@ -249,7 +250,7 @@ export default {
return this.hasControlPlaneTerminalAccess ? 'Open terminal into cluster or cluster\'s control plane' : 'Open terminal into cluster'
},
isAnyTileVisible () {
return this.isDashboardTileVisible || this.isCredentialsTileVisible || this.isTerminalTileVisible
return this.isDashboardTileVisible || this.isCredentialsTileVisible || this.isKubeconfigTileVisible || this.isTerminalTileVisible
},
isDashboardTileVisible () {
return !!this.dashboardUrl
Expand All @@ -260,6 +261,9 @@ export default {
isKubeconfigAvailable () {
return !!this.kubeconfig
},
isKubeconfigTileVisible () {
return this.isKubeconfigAvailable || this.canPatchShoots
},
isGardenctlTileVisible () {
return this.isAdmin
},
Expand Down

0 comments on commit 1436b52

Please sign in to comment.