Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(north group): ekuiper, websocket, sparkplugb plug-ins do not display topic info #491

Merged
merged 2 commits into from
Jul 21, 2023
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
12 changes: 11 additions & 1 deletion src/composables/config/useSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const useSubscriptionList = () => {
const isListLoading = ref(false)
const subscriptionList: Ref<Array<SubscriptionDataInTable>> = ref([])
const node = computed(() => route.params.node.toString())
const nodePlugin = computed(() => route.params.plugin.toString())

const allChecked = computed({
get() {
Expand All @@ -41,6 +42,13 @@ export const useSubscriptionList = () => {
return newCheckedList
})

const isShowTopic = computed(() => {
const lowerCasePlugin = nodePlugin.value.toLocaleLowerCase()
const ignorePlugin = ['ekuiper', 'websocket', 'sparkplugb']
const noShowTopic = ignorePlugin.includes(lowerCasePlugin)
return !noShowTopic
})

const getSubscriptionList = async () => {
isListLoading.value = true
const list = await querySubscription(node.value)
Expand Down Expand Up @@ -83,6 +91,7 @@ export const useSubscriptionList = () => {
subCheckedList,
isListLoading,
allChecked,
isShowTopic,

getSubscriptionList,
unsubscribeGroup,
Expand Down Expand Up @@ -120,7 +129,8 @@ export const useAddSubscription = (props: AddSubscriptionProps) => {
const rules = computed(() => {
return {
driver: [{ required: true, message: t('config.southDeviceRequired') }],
group: [{ required: true, message: createCommonErrorMessage('select', ' group') }],
group: [{ required: true, message: createCommonErrorMessage('select', t('config.group')) }],
topic: [{ required: true, message: createCommonErrorMessage('input', t('config.topic')) }],
}
})
const subscriptionForm: Ref<SubscriptionDataForm> = ref(createRawSubscriptionForm())
Expand Down
4 changes: 3 additions & 1 deletion src/views/config/northDriver/Group.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<emqx-table-column :label="$t('config.deviceName')" prop="name">
<template #default="{ row }">{{ row.driver }}</template>
</emqx-table-column>
<emqx-table-column :label="$t('config.topic')">
<emqx-table-column v-if="isShowTopic" :label="$t('config.topic')">
<template #default="{ row }">{{ row?.params?.topic }}</template>
</emqx-table-column>
<emqx-table-column align="left" :label="$t('common.oper')" width="140px">
Expand All @@ -66,6 +66,8 @@ const {
subCheckedList,
isListLoading,
allChecked,
isShowTopic,

unsubscribeGroup,
clearSubscription,
batchUnsubscribeGroups,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<emqx-option v-for="{ name } in groupList" :key="name" :value="name" :label="name" />
</emqx-select>
</emqx-form-item>
<emqx-form-item v-if="isMQTTPugin" :label="$t('config.topic')">
<emqx-form-item v-if="isMQTTPugin" prop="topic" :label="$t('config.topic')">
<emqx-input v-model="subscriptionForm.topic" />
</emqx-form-item>
</emqx-form>
Expand Down