// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import React from "react"; import { compose } from 'redux'; import { withStyles, Dialog, DialogTitle, DialogContent, DialogActions, Button, StyleRulesCallback, WithStyles, Grid } from '@material-ui/core'; import { WithDialogProps, withDialog } from "store/dialog/with-dialog"; import { API_CLIENT_AUTHORIZATION_ATTRIBUTES_DIALOG } from 'store/api-client-authorizations/api-client-authorizations-actions'; import { ArvadosTheme } from 'common/custom-theme'; import { ApiClientAuthorization } from 'models/api-client-authorization'; import { formatDate } from 'common/formatters'; type CssRules = 'root'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { fontSize: '0.875rem', '& div:nth-child(odd)': { textAlign: 'right', color: theme.palette.grey["500"] } } }); interface AttributesKeepServiceDialogDataProps { apiClientAuthorization: ApiClientAuthorization; } export const AttributesApiClientAuthorizationDialog = compose( withDialog(API_CLIENT_AUTHORIZATION_ATTRIBUTES_DIALOG), withStyles(styles))( ({ open, closeDialog, data, classes }: WithDialogProps & WithStyles) => Attributes {data.apiClientAuthorization && UUID {data.apiClientAuthorization.uuid} Owner uuid {data.apiClientAuthorization.ownerUuid} API Client ID {data.apiClientAuthorization.apiClientId} API Token {data.apiClientAuthorization.apiToken} Created by IP address {data.apiClientAuthorization.createdByIpAddress || '(none)'} Default owner {data.apiClientAuthorization.defaultOwnerUuid || '(none)'} Expires at {formatDate(data.apiClientAuthorization.expiresAt) || '(none)'} Last used at {formatDate(data.apiClientAuthorization.lastUsedAt) || '(none)'} Last used by IP address {data.apiClientAuthorization.lastUsedByIpAddress || '(none)'} Scopes {JSON.stringify(data.apiClientAuthorization.scopes || '(none)')} User ID {data.apiClientAuthorization.userId || '(none)'} Created at {formatDate(data.apiClientAuthorization.createdAt) || '(none)'} Updated at {formatDate(data.apiClientAuthorization.updatedAt) || '(none)'} } );