Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 71 additions & 71 deletions webui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"http-status-codes": "^2.3.0",
"js-yaml": "^4.1.0",
"ncp": "^2.0.0",
"vue": "^3.5.22",
"vue": "^3.5.23",
"vue-router": "^4.6.3",
"vue3-ace-editor": "^2.2.4",
"vue3-highlightjs": "^1.0.5",
Expand Down
16 changes: 8 additions & 8 deletions webui/src/components/dashboard/kafka/KafkaTopic.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { type Ref, onUnmounted } from 'vue'
import { type Ref, computed, onUnmounted } from 'vue'
import { useRoute } from 'vue-router'
import { useService } from '@/composables/services'
import KafkaGroups from './KafkaGroups.vue'
Expand All @@ -13,29 +13,29 @@ const route = useRoute()
const serviceName = route.params.service!.toString()
const topicName = route.params.topic?.toString()
const { service, close } = <{service: Ref<KafkaService | null>, close: () => void}>fetchService(serviceName, 'kafka')
function topic() {
const topic = computed(() => {
if (!service.value) {return null}
for (let topic of service.value?.topics){
if (topic.name == topicName) {
return topic
}
}
return null
}
})
onUnmounted(() => {
close()
})
</script>

<template>
<div v-if="$route.name == 'kafkaTopic' && service != null">
<div v-if="$route.name == 'kafkaTopic' && service != null && topic">
<div class="card-group">
<section class="card" aria-label="Info">
<div class="card-body">
<div class="row">
<div class="col header mb-3">
<p id="topic" class="label">Topic</p>
<p aria-labelledby="topic">{{ topic()?.name }}</p>
<p aria-labelledby="topic">{{ topic.name }}</p>
</div>
<div class="col header">
<p id="cluster" class="label">Cluster</p>
Expand All @@ -56,7 +56,7 @@ onUnmounted(() => {
<div class="row">
<div class="col">
<p id="description" class="label">Description</p>
<markdown :source="topic()?.description" aria-labelledby="description" :html="true" />
<markdown :source="topic.description" aria-labelledby="description" :html="true" />
</div>

</div>
Expand All @@ -77,13 +77,13 @@ onUnmounted(() => {
<kafka-messages :service="service" :topicName="topicName" />
</div>
<div class="tab-pane fade" id="partitions" role="tabpanel" aria-labelledby="partitions-tab">
<kafka-partition :topic="topic()!" />
<kafka-partition :topic="topic" />
</div>
<div class="tab-pane fade" id="groups" role="tabpanel" aria-labelledby="groups-tab">
<kafka-groups :service="service" :topicName="topicName"/>
</div>
<div class="tab-pane fade" id="configs" role="tabpanel" aria-labelledby="configs-tab">
<topic-config v-if="topic()" :topic="topic()!" />
<topic-config :topic="topic" />
</div>
</div>
</div>
Expand Down
18 changes: 14 additions & 4 deletions webui/src/components/dashboard/kafka/TopicConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SourceView from '../SourceView.vue'
import SchemaExpand from '../SchemaExpand.vue'
import SchemaValidate from '../SchemaValidate.vue'
import { usePrettyLanguage } from '@/composables/usePrettyLanguage'
import { computed, ref } from 'vue'
import { computed, onMounted, ref } from 'vue'

const props = defineProps<{
topic: KafkaTopic,
Expand All @@ -30,9 +30,19 @@ function filename() {
return `${props.topic.name}-example${ext}`
}

// select first message
const first = messages(props.topic)[0]!
selected.value = props.topic.messages[first]!
onMounted(() => {
if (!props.topic) {
return
}
const first = messages(props.topic)[0]
if (first) {
const msg = props.topic.messages[first]
if (msg) {
selected.value = msg
}
}

})

function selectedMessageChange(event: any){
for (const messageId in props.topic.messages){
Expand Down
Loading