fix snmp链路测试
This commit is contained in:
@@ -48,6 +48,7 @@ import {
|
||||
setMessageStatus,
|
||||
} from '@/api/message'
|
||||
import useLoading from '@/hooks/loading'
|
||||
import useNotificationSocket from '@/hooks/useNotificationSocket'
|
||||
import { Message } from '@arco-design/web-vue'
|
||||
import { computed, reactive, ref, toRefs } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
@@ -111,6 +112,9 @@ async function fetchSourceData() {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
const upsertMessageToTop = (message: MessageRecord) => {
|
||||
messageData.messageList = [message, ...messageData.messageList.filter((item) => item.id !== message.id)]
|
||||
}
|
||||
async function readMessage(data: MessageListType) {
|
||||
const ids = data.map((item) => item.id)
|
||||
await setMessageStatus({ ids })
|
||||
@@ -190,6 +194,10 @@ const emptyList = () => {
|
||||
messageData.messageList = []
|
||||
}
|
||||
fetchSourceData()
|
||||
useNotificationSocket<MessageRecord>({
|
||||
onNotification: upsertMessageToTop,
|
||||
onReconnectAfter: fetchSourceData,
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
||||
@@ -49,10 +49,10 @@
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
</li>
|
||||
<!-- <li>
|
||||
<li>
|
||||
<a-tooltip :content="$t('settings.navbar.alerts')">
|
||||
<div class="message-box-trigger">
|
||||
<a-badge :count="9" dot>
|
||||
<a-badge dot>
|
||||
<a-button class="nav-btn" type="outline" :shape="'circle'" @click="setPopoverVisible">
|
||||
<icon-notification />
|
||||
</a-button>
|
||||
@@ -70,7 +70,7 @@
|
||||
<message-box />
|
||||
</template>
|
||||
</a-popover>
|
||||
</li> -->
|
||||
</li>
|
||||
<li>
|
||||
<a-tooltip :content="isFullscreen ? t('settings.navbar.screen.toExit') : t('settings.navbar.screen.toFull')">
|
||||
<a-button class="nav-btn" type="outline" :shape="'circle'" @click="toggleFullScreen">
|
||||
|
||||
Reference in New Issue
Block a user