fix snmp链路测试

This commit is contained in:
zxr
2026-07-05 21:21:53 +08:00
parent 1ad0323715
commit cc6ea1acc6
11 changed files with 223 additions and 23 deletions

View File

@@ -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">

View File

@@ -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">