Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/clusters/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ export default function Clusters() {

setTotalPages(totalPage);
setAllClusters(currentPageData);

return () => {
window.removeEventListener('resize', updatePageSize);
};
} else if (cluster === null || cluster) {
setTotalPages(1);
setAllClusters([]);
Expand Down
33 changes: 18 additions & 15 deletions src/components/clusters/schedulers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,23 +227,22 @@ export default function ShowCluster() {
}
});

if (alignment === 'card') {
const updatePageSize = () => {
if (window.matchMedia('(max-width: 1440px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1600px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1920px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2048px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2560px)').matches) {
setPageSize(15);
}
};
const updatePageSize = () => {
if (window.matchMedia('(max-width: 1440px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1600px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1920px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2048px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2560px)').matches) {
setPageSize(15);
}
};

if (alignment === 'card') {
updatePageSize();

window.addEventListener('resize', updatePageSize);
}

Expand Down Expand Up @@ -277,6 +276,10 @@ export default function ShowCluster() {

setSchedulerTotalPages(totalPage);
setAllSchedlers(currentPageData);

return () => {
window.removeEventListener('resize', updatePageSize);
};
} else {
setSchedulerTotalPages(1);
setAllSchedlers([]);
Expand Down
33 changes: 18 additions & 15 deletions src/components/clusters/seed-peers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,23 +211,22 @@ export default function ShowCluster() {
}
});

if (alignment === 'card') {
const updatePageSize = () => {
if (window.matchMedia('(max-width: 1440px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1600px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1920px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2048px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2560px)').matches) {
setPageSize(15);
}
};
const updatePageSize = () => {
if (window.matchMedia('(max-width: 1440px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1600px)').matches) {
setPageSize(9);
} else if (window.matchMedia('(max-width: 1920px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2048px)').matches) {
setPageSize(12);
} else if (window.matchMedia('(max-width: 2560px)').matches) {
setPageSize(15);
}
};

if (alignment === 'card') {
updatePageSize();

window.addEventListener('resize', updatePageSize);
}

Expand Down Expand Up @@ -261,6 +260,10 @@ export default function ShowCluster() {

setSeedPeerTotalPages(totalPage);
setAllSeedPeers(currentPageData);

return () => {
window.removeEventListener('resize', updatePageSize);
};
} else {
setSeedPeerTotalPages(1);
setAllSeedPeers([]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/developer/tokens/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default function PersonalAccessTokens() {
</Typography>
<IconButton
id="copy-button"
aria-label="delete"
aria-label="copy"
sx={{
p: '0',
width: '1.6rem',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default function PersistentCacheTask() {

setTotalPages(totalPage);
setAllClusters(currentPageData);

return () => {
window.removeEventListener('resize', updatePageSize);
};
} else if (cluster === null || cluster) {
setTotalPages(1);
setAllClusters([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export default function Information(props: InformationProps) {
setTotalPages(totalPage);
setAllPersistentCacheTasks(currentPageData);
setTaskIsLoading(true);

return () => {
window.removeEventListener('resize', updatePageSize);
};
} else if (persistentCacheTasksCount === null || persistentCacheTasksCount) {
setTotalPages(1);
setAllPersistentCacheTasks([]);
Expand Down
Loading