From 3399b16c7e0fd73960ccea8011bec06ec627c05c Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Thu, 4 Mar 2021 07:36:38 +0100 Subject: [PATCH] initial list --- package.json | 2 +- src/clients/InitialAccessTokenList.tsx | 35 +++++++++++++++++++++++++- src/clients/messages.json | 1 + yarn.lock | 8 +++--- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index f4b7e3ad08..961243784d 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@patternfly/react-table": "4.23.0", "file-saver": "^2.0.2", "i18next": "^19.6.2", - "keycloak-admin": "1.14.7", + "keycloak-admin": "1.14.8", "lodash": "^4.17.20", "moment": "^2.29.1", "react": "^16.8.5", diff --git a/src/clients/InitialAccessTokenList.tsx b/src/clients/InitialAccessTokenList.tsx index aa17bac309..1a7f70bfdb 100644 --- a/src/clients/InitialAccessTokenList.tsx +++ b/src/clients/InitialAccessTokenList.tsx @@ -1,8 +1,41 @@ import React from "react"; +import moment from "moment"; +import { KeycloakDataTable } from "../components/table-toolbar/KeycloakDataTable"; import { useAdminClient } from "../context/auth/AdminClient"; +import { useRealm } from "../context/realm-context/RealmContext"; export const InitialAccessTokenList = () => { const adminClient = useAdminClient(); - return

Hello

; + const { realm } = useRealm(); + const loader = async () => + await adminClient.realms.getClientsInitialAccess({ realm }); + + return ( + moment(row.timestamp * 1000).fromNow(), + }, + { + name: "expiration", + cellRenderer: (row) => + moment(moment.now() - row.expiration * 1000).fromNow(), + }, + { + name: "count", + }, + { + name: "remainingCount", + }, + ]} + /> + ); }; diff --git a/src/clients/messages.json b/src/clients/messages.json index 9befced254..420348cbc7 100644 --- a/src/clients/messages.json +++ b/src/clients/messages.json @@ -73,6 +73,7 @@ "downloadAdapterConfig": "Download adapter config", "disableConfirm": "If you disable this client, you cannot initiate a login or obtain access tokens.", "clientDeleteConfirm": "If you delete this client, all associated data will be removed.", + "searchInitialAccessToken": "Search token", "clientAuthentication": "Client authentication", "authentication": "Authentication", "authenticationFlow": "Authentication flow", diff --git a/yarn.lock b/yarn.lock index 79f4b16ce6..db22e76e4e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13477,10 +13477,10 @@ junk@^3.1.0: resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1" integrity sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ== -keycloak-admin@1.14.7: - version "1.14.7" - resolved "https://registry.yarnpkg.com/keycloak-admin/-/keycloak-admin-1.14.7.tgz#fe86f296cc6774ec3256b3211d5cd3c76cf79b9c" - integrity sha512-PvDcs8E9VVlhe/1Te/TA5AP8gOkQqIxOmI08Eae3gOvxtt7Ucdd4hxa/ZUX5B7/PvOQH+mFqP5XHVovAZWtmFA== +keycloak-admin@1.14.8: + version "1.14.8" + resolved "https://registry.yarnpkg.com/keycloak-admin/-/keycloak-admin-1.14.8.tgz#c6935146eab94ba125761888b04442c51ec1d5e5" + integrity sha512-1eX7HTL/C1M51QGWg47TiYNZrIhmv6ximyscghCZxd1waKC7jjo1vqHOZkBUBQDSFYDEq61b7hH64gbw2XOgYw== dependencies: axios "^0.21.0" camelize "^1.0.0"