mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-12 17:46:20 +08:00
feat: remove console (#10181)
This commit is contained in:
parent
1dae294d76
commit
5c5904216b
1 changed files with 0 additions and 25 deletions
|
@ -272,43 +272,20 @@ const getContent = async (pre: boolean) => {
|
||||||
|
|
||||||
if (logs.value.length == 0) {
|
if (logs.value.length == 0) {
|
||||||
logs.value = newLogs;
|
logs.value = newLogs;
|
||||||
console.log('首次加载');
|
|
||||||
} else {
|
} else {
|
||||||
// if (end.value) {
|
|
||||||
// console.log('加载到底了');
|
|
||||||
// if (pre) {
|
|
||||||
// console.log('向上拼接' + newLogs.length + '行');
|
|
||||||
// } else {
|
|
||||||
// console.log('向下拼接' + newLogs.length + '行');
|
|
||||||
// }
|
|
||||||
// logs.value = pre ? [...newLogs, ...logs.value] : [...lastLogs.value, ...newLogs];
|
|
||||||
// } else {
|
|
||||||
// console.log('未加载到底');
|
|
||||||
// if (pre) {
|
|
||||||
// console.log('向上拼接' + newLogs.length + '行');
|
|
||||||
// } else {
|
|
||||||
// console.log('向下拼接' + newLogs.length + '行');
|
|
||||||
// }
|
|
||||||
// logs.value = pre ? [...newLogs, ...logs.value] : [...lastLogs.value, ...newLogs];
|
|
||||||
// }
|
|
||||||
// pre 向上拼接
|
|
||||||
if (pre) {
|
if (pre) {
|
||||||
logs.value = [...newLogs, ...logs.value];
|
logs.value = [...newLogs, ...logs.value];
|
||||||
} else {
|
} else {
|
||||||
if (end.value) {
|
if (end.value) {
|
||||||
console.log('lastLogs 拼接');
|
|
||||||
logs.value = [...lastLogs.value, ...newLogs];
|
logs.value = [...lastLogs.value, ...newLogs];
|
||||||
} else {
|
} else {
|
||||||
logs.value = [...logs.value, ...newLogs];
|
logs.value = [...logs.value, ...newLogs];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(logs.value.length);
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
if (logContainer.value) {
|
if (logContainer.value) {
|
||||||
if (pre) {
|
if (pre) {
|
||||||
console.log(logs.value[0]);
|
|
||||||
|
|
||||||
if (readReq.page > 1) {
|
if (readReq.page > 1) {
|
||||||
const addedLines = newLogs.length;
|
const addedLines = newLogs.length;
|
||||||
const newScrollPosition = lastScrollTop.value + (addedLines * logHeight) / 3;
|
const newScrollPosition = lastScrollTop.value + (addedLines * logHeight) / 3;
|
||||||
|
@ -326,7 +303,6 @@ const getContent = async (pre: boolean) => {
|
||||||
|
|
||||||
logCount.value = logs.value.length;
|
logCount.value = logs.value.length;
|
||||||
end.value = res.data.end;
|
end.value = res.data.end;
|
||||||
console.log('end=' + end.value);
|
|
||||||
emit('update:hasContent', logs.value.length > 0);
|
emit('update:hasContent', logs.value.length > 0);
|
||||||
if (readReq.latest) {
|
if (readReq.latest) {
|
||||||
readReq.page = res.data.total;
|
readReq.page = res.data.total;
|
||||||
|
@ -339,7 +315,6 @@ const getContent = async (pre: boolean) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (logs.value && logs.value.length > 3000) {
|
if (logs.value && logs.value.length > 3000) {
|
||||||
console.log('日志过长,进行裁剪');
|
|
||||||
if (pre) {
|
if (pre) {
|
||||||
logs.value.splice(logs.value.length - readReq.pageSize, readReq.pageSize);
|
logs.value.splice(logs.value.length - readReq.pageSize, readReq.pageSize);
|
||||||
if (maxPage.value > 1) {
|
if (maxPage.value > 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue