diff --git a/src/frontend/src/components/PaginatorComponent/index.tsx b/src/frontend/src/components/PaginatorComponent/index.tsx index 0e9242f15..543daa6f6 100644 --- a/src/frontend/src/components/PaginatorComponent/index.tsx +++ b/src/frontend/src/components/PaginatorComponent/index.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { Select, SelectContent, @@ -24,6 +24,10 @@ export default function PaginatorComponent({ ); const [currentPage, setCurrentPage] = useState(1); + useEffect(() => { + setMaxPageIndex(Math.ceil(totalRowsCount / size)); + }, [totalRowsCount]); + return ( <>
diff --git a/src/frontend/src/pages/ApiKeysPage/index.tsx b/src/frontend/src/pages/ApiKeysPage/index.tsx index 2136aa152..5962540d4 100644 --- a/src/frontend/src/pages/ApiKeysPage/index.tsx +++ b/src/frontend/src/pages/ApiKeysPage/index.tsx @@ -17,8 +17,8 @@ import ConfirmationModal from "../../modals/ConfirmationModal"; import SecretKeyModal from "../../modals/SecretKeyModal"; import moment from "moment"; -import { ApiKey } from "../../types/components"; import Header from "../../components/headerComponent"; +import { ApiKey } from "../../types/components"; export default function ApiKeysPage() { const [loadingKeys, setLoadingKeys] = useState(true); @@ -81,7 +81,7 @@ export default function ApiKeysPage() { return ( <> -
+
{userData && (
@@ -106,7 +106,9 @@ export default function ApiKeysPage() { {keysList.current.length === 0 && !loadingKeys && ( <>
-

This user does not have any keys assigned at the moment.

+

+ This user does not have any keys assigned at the moment. +

)} @@ -122,91 +124,99 @@ export default function ApiKeysPage() { (loadingKeys ? " border-0" : "") } > - - - - Name - Key - Created - - Last Used - -
- -
-
-
- -
-
- {!loadingKeys && ( - - {keysList.current.map( - (api_keys: ApiKey, index: number) => ( - - - + {keysList.current.length > 0 && !loadingKeys && ( +
+ + + Name + Key + Created + + Last Used + +
+ +
+
+
+ +
+
+ {!loadingKeys && ( + + {keysList.current.map( + (api_keys: ApiKey, index: number) => ( + + + + + {api_keys.name} + + + + - {api_keys.name} + {api_keys.api_key} - - - - - {api_keys.api_key} - - - - {moment(api_keys.created_at).format( - "YYYY-MM-DD HH:mm" - )} - - - {moment(api_keys.last_used_at).format( - "YYYY-MM-DD HH:mm" - )} - - -
- { - console.log(keys); - handleDeleteKey(keys); - }} - > - - - - -
-
-
- ) - )} -
- )} -
+ + + {moment(api_keys.created_at).format( + "YYYY-MM-DD HH:mm" + )} + + + {moment(api_keys.last_used_at).format( + "YYYY-MM-DD HH:mm" + )} + + +
+ { + console.log(keys); + handleDeleteKey(keys); + }} + > + + + + +
+
+ + ) + )} + + )} + + )}