Copilot commented on code in PR #515:
URL: 
https://github.com/apache/skywalking-booster-ui/pull/515#discussion_r2660911462


##########
src/views/dashboard/related/log/List.vue:
##########
@@ -54,11 +54,14 @@ limitations under the License. -->
   const logStore = useLogStore();
   const dashboardStore = useDashboardStore();
   const type = ref<string>(dashboardStore.layerId === "BROWSER" ? "browser" : 
"service");
-  const pageSize = ref<number>(15);
+  const pageSize = ref<number>(PageSizeDefault);
   const total = computed(() =>
-    logStore.logs.length === pageSize.value
-      ? pageSize.value * logStore.conditions.paging.pageNum + 1
-      : pageSize.value * logStore.conditions.paging.pageNum,
+    logStore.logs.length < pageSize.value
+      ? pageSize.value * logStore.conditions.paging.pageNum
+      : pageSize.value * logStore.conditions.paging.pageNum + 1,
+  );
+  const displayLogs = computed(() =>
+    logStore.logs.length === pageSize.value ? logStore.logs.slice(0, 
pageSize.value) : logStore.logs,
   );

Review Comment:
   The displayLogs computed property has redundant logic. When 
logStore.logs.length equals pageSize.value, it slices the array to 
pageSize.value, which produces the same result as returning the array directly. 
The slice operation in this condition serves no purpose and adds unnecessary 
computation.
   ```suggestion
     const displayLogs = computed(() => logStore.logs);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to