瀏覽代碼

查看日志最新的sse追加最新数据

yukai 1 年之前
父節點
當前提交
4d0ee2053f
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/views/system/monitor/lastLinesLog/index.vue

+ 1 - 2
src/views/system/monitor/lastLinesLog/index.vue

@@ -43,8 +43,7 @@ const topmsg=ref([]);
 const view = (row: any) => {
 	const es = new EventSource(getOrigin(import.meta.env.VITE_SERVER_URL + "subscribe/logInfo?name="+row.name));
 	es.addEventListener('log', ({ data }) => {
-
-		topmsg.value.push(data);
+		topmsg.value.unshift(data);
 	});
 	api.lastLinesLog.detail({name:row.name}).then((res: any) => {
 		errorMessage.value=res.list;