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 9d9331d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions frontend/src/components/ShootDetails/ShootAccessCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 9d9331d

Please sign in to comment.