Skip to content

Commit

Permalink
cm keys click
Browse files Browse the repository at this point in the history
  • Loading branch information
weibaohui committed Nov 13, 2023
1 parent 1581201 commit 7039566
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/frontend/components/configmap/CmDataKeysView.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
<script setup lang="ts">
import { V1ConfigMap } from '@backend/k8s/model/V1ConfigMap'
import { ResType } from '@backend/k8s/watch/watch.model'
import CmView from '@frontend/components/configmap/CmView.vue'
import { useDrawerService } from '@frontend/service/drawer-service/use-drawer'
import { ColorHelper } from '@frontend/service/page/ColorHelper'
import { DrawerHelper } from '@frontend/service/page/DrawerHelper'
import { NSpace, NTag } from 'naive-ui'
const props = defineProps({
cm: V1ConfigMap,
})
const drawer = useDrawerService()
function show() {
DrawerHelper
.instance
.drawer(drawer)
.show(`${ResType.ConfigMap}:${props.cm.metadata.name}`, CmView, { cm: props.cm })
}
</script>

<template>
<NTag v-for="(v, k) in props.cm.data" :key="k">
{{ k }}
</NTag>
<NSpace v-for="(v, k) in props.cm.data" :key="k" :vertical="false">
<NTag :color="{ color: ColorHelper.randomColor() }">
<span @click="show">
{{ k }}
</span>
</NTag>
</NSpace>
</template>

<style scoped>
Expand Down

0 comments on commit 7039566

Please sign in to comment.