diff --git a/src/store/logs.ts b/src/store/logs.ts index ba01d69d..7418e502 100644 --- a/src/store/logs.ts +++ b/src/store/logs.ts @@ -3,6 +3,7 @@ import { LOG_LEVEL } from '@/config' import type { Log, LogWithSeq } from '@/types' import { useStorage } from '@vueuse/core' import { ref, watch } from 'vue' +import { sourceIPLabelMap } from './settings' export const logs = ref([]) export const logFilter = ref('') @@ -27,6 +28,13 @@ export const initLogs = () => { return } + for (const ip in sourceIPLabelMap.value) { + if (data.payload.includes(ip)) { + data.payload = data.payload.replace(ip, `${ip}(${sourceIPLabelMap.value[ip]})`) + break + } + } + logs.value.unshift({ ...data, time: new Date().valueOf(),