Skip to content

Commit da0dcaf

Browse files
Merge pull request #732 from marle3003/dependabot/npm_and_yarn/webui/develop/vue-3.5.23
Bump vue from 3.5.22 to 3.5.23 in /webui
2 parents 8ed1fed + ab97651 commit da0dcaf

File tree

4 files changed

+94
-84
lines changed

4 files changed

+94
-84
lines changed

webui/package-lock.json

Lines changed: 71 additions & 71 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"http-status-codes": "^2.3.0",
3030
"js-yaml": "^4.1.0",
3131
"ncp": "^2.0.0",
32-
"vue": "^3.5.22",
32+
"vue": "^3.5.23",
3333
"vue-router": "^4.6.3",
3434
"vue3-ace-editor": "^2.2.4",
3535
"vue3-highlightjs": "^1.0.5",

webui/src/components/dashboard/kafka/KafkaTopic.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { type Ref, onUnmounted } from 'vue'
2+
import { type Ref, computed, onUnmounted } from 'vue'
33
import { useRoute } from 'vue-router'
44
import { useService } from '@/composables/services'
55
import KafkaGroups from './KafkaGroups.vue'
@@ -13,29 +13,29 @@ const route = useRoute()
1313
const serviceName = route.params.service!.toString()
1414
const topicName = route.params.topic?.toString()
1515
const { service, close } = <{service: Ref<KafkaService | null>, close: () => void}>fetchService(serviceName, 'kafka')
16-
function topic() {
16+
const topic = computed(() => {
1717
if (!service.value) {return null}
1818
for (let topic of service.value?.topics){
1919
if (topic.name == topicName) {
2020
return topic
2121
}
2222
}
2323
return null
24-
}
24+
})
2525
onUnmounted(() => {
2626
close()
2727
})
2828
</script>
2929

3030
<template>
31-
<div v-if="$route.name == 'kafkaTopic' && service != null">
31+
<div v-if="$route.name == 'kafkaTopic' && service != null && topic">
3232
<div class="card-group">
3333
<section class="card" aria-label="Info">
3434
<div class="card-body">
3535
<div class="row">
3636
<div class="col header mb-3">
3737
<p id="topic" class="label">Topic</p>
38-
<p aria-labelledby="topic">{{ topic()?.name }}</p>
38+
<p aria-labelledby="topic">{{ topic.name }}</p>
3939
</div>
4040
<div class="col header">
4141
<p id="cluster" class="label">Cluster</p>
@@ -56,7 +56,7 @@ onUnmounted(() => {
5656
<div class="row">
5757
<div class="col">
5858
<p id="description" class="label">Description</p>
59-
<markdown :source="topic()?.description" aria-labelledby="description" :html="true" />
59+
<markdown :source="topic.description" aria-labelledby="description" :html="true" />
6060
</div>
6161

6262
</div>
@@ -77,13 +77,13 @@ onUnmounted(() => {
7777
<kafka-messages :service="service" :topicName="topicName" />
7878
</div>
7979
<div class="tab-pane fade" id="partitions" role="tabpanel" aria-labelledby="partitions-tab">
80-
<kafka-partition :topic="topic()!" />
80+
<kafka-partition :topic="topic" />
8181
</div>
8282
<div class="tab-pane fade" id="groups" role="tabpanel" aria-labelledby="groups-tab">
8383
<kafka-groups :service="service" :topicName="topicName"/>
8484
</div>
8585
<div class="tab-pane fade" id="configs" role="tabpanel" aria-labelledby="configs-tab">
86-
<topic-config v-if="topic()" :topic="topic()!" />
86+
<topic-config :topic="topic" />
8787
</div>
8888
</div>
8989
</div>

webui/src/components/dashboard/kafka/TopicConfig.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SourceView from '../SourceView.vue'
44
import SchemaExpand from '../SchemaExpand.vue'
55
import SchemaValidate from '../SchemaValidate.vue'
66
import { usePrettyLanguage } from '@/composables/usePrettyLanguage'
7-
import { computed, ref } from 'vue'
7+
import { computed, onMounted, ref } from 'vue'
88
99
const props = defineProps<{
1010
topic: KafkaTopic,
@@ -30,9 +30,19 @@ function filename() {
3030
return `${props.topic.name}-example${ext}`
3131
}
3232
33-
// select first message
34-
const first = messages(props.topic)[0]!
35-
selected.value = props.topic.messages[first]!
33+
onMounted(() => {
34+
if (!props.topic) {
35+
return
36+
}
37+
const first = messages(props.topic)[0]
38+
if (first) {
39+
const msg = props.topic.messages[first]
40+
if (msg) {
41+
selected.value = msg
42+
}
43+
}
44+
45+
})
3646
3747
function selectedMessageChange(event: any){
3848
for (const messageId in props.topic.messages){

0 commit comments

Comments
 (0)