Skip to content

Commit

Permalink
fix: query maxShowSize
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Sep 23, 2023
1 parent 0ade427 commit 4191a04
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/views/SnapshotPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ const router = useRouter();
const title = useTitle();
const snapshotId = computed(() => String(route.params.snapshotId || ``));
const maxShowSize = 5000
const showSize = computed(() => {
const n = Number(route.params.maxShowSize || ``);
if (1 <= n && n <= maxShowSize) {
const n = Number(route.query.showSize || ``);
if (Number.isSafeInteger(n) && 1 <= n && n <= 8000) {
return n;
}
return maxShowSize;
return 2000;
});
const screenshotUrl = shallowRef(``);
Expand All @@ -38,7 +37,7 @@ watchEffect(async () => {
}
if (localSnapshot.nodes.length > showSize.value) {
message.warning(
`当前展示最大节点数量为${showSize.value}\n之后的${
`当前展示节点数量为${showSize.value}\n之后的${
localSnapshot.nodes.length - showSize.value
}个节点将被丢弃\n使用showSize查询参数可以修改展示数量`,
);
Expand Down

0 comments on commit 4191a04

Please sign in to comment.