perf: integrate Pinia store for log cache management (#3852)
* perf: integrate Pinia store for log cache management * perf: remove unused code
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { useCommonStore } from '@/stores/common';
|
||||
import { storeToRefs } from 'pinia';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -23,6 +24,8 @@ import { useCommonStore } from '@/stores/common';
|
||||
export default {
|
||||
name: 'ConsoleDisplayer',
|
||||
data() {
|
||||
const commonStore = useCommonStore();
|
||||
const { log_cache } = storeToRefs(commonStore);
|
||||
return {
|
||||
autoScroll: true, // 默认开启自动滚动
|
||||
logColorAnsiMap: {
|
||||
@@ -35,7 +38,7 @@ export default {
|
||||
'\u001b[32m': 'color: #00FF00;', // green
|
||||
'default': 'color: #FFFFFF;'
|
||||
},
|
||||
logCache: useCommonStore().getLogCache(),
|
||||
logCache: log_cache,
|
||||
historyNum_: -1,
|
||||
logLevels: ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'],
|
||||
selectedLevels: [0, 1, 2, 3, 4], // 默认选中所有级别
|
||||
|
||||
Reference in New Issue
Block a user