Skip to content

Commit 41d5504

Browse files
committed
Store page size to localStorage
1 parent 89c3ae5 commit 41d5504

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

teepod/src/console.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ <h3>Derive VM</h3>
13141314
const searchQuery = ref('');
13151315
const currentPage = ref(1);
13161316
const pageInput = ref(1);
1317-
const pageSize = ref(50);
1317+
const pageSize = ref(parseInt(localStorage.getItem('pageSize')) || 50);
13181318
const totalVMs = ref(0);
13191319
const hasMorePages = ref(false);
13201320
const loadingVMDetails = ref(false);
@@ -2240,6 +2240,16 @@ <h3>Derive VM</h3>
22402240
}
22412241
}, { deep: true });
22422242

2243+
// Watch for changes to searchQuery and reset page to 1
2244+
watch(searchQuery, () => {
2245+
currentPage.value = 1;
2246+
pageInput.value = 1;
2247+
});
2248+
2249+
watch(pageSize, (newValue) => {
2250+
localStorage.setItem('pageSize', newValue);
2251+
});
2252+
22432253
return {
22442254
vms,
22452255
vmForm,

0 commit comments

Comments
 (0)