Skip to content

Commit 0e5a7b9

Browse files
authored
Merge pull request #185 from leemo1989/master
1、修复当数据库过大时,前端默认没有选择日期,导致的查询超时问题。增加了前端默认选择日期为当前日期
2 parents 56fadb0 + 5aa0009 commit 0e5a7b9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

web/ui/src/components/Log.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ export default {
103103
var vm = this;
104104
$(this.$refs.latest).checkbox();
105105
$(this.$refs.failedOnly).checkbox();
106+
107+
// 挂载时,初始化日期选择为当前日志,防止大数据量的时候,用户无差别请求导致的io超时
108+
const time = new Date();
109+
const day = ("0" + time.getDate()).slice(-2);
110+
const month = ("0" + (time.getMonth() + 1)).slice(-2);
111+
const today = time.getFullYear() + "-" + (month) + "-" + (day);
112+
this.begin = this.end = today;
106113
},
107114
108115
watch: {

0 commit comments

Comments
 (0)