import { loadVocabulary } from '~/store/vocabulary/vocabulary-actions';
import { virtualMachineActionSet } from '~/views-components/context-menu/action-sets/virtual-machine-action-set';
import { computeNodeActionSet } from '~/views-components/context-menu/action-sets/compute-node-action-set';
+import { apiClientAuthorizationActionSet } from '~/views-components/context-menu/action-sets/api-client-authorization-action-set';
console.log(`Starting arvados [${getBuildInfo()}]`);
addMenuActionSet(ContextMenuKind.VIRTUAL_MACHINE, virtualMachineActionSet);
addMenuActionSet(ContextMenuKind.KEEP_SERVICE, keepServiceActionSet);
addMenuActionSet(ContextMenuKind.NODE, computeNodeActionSet);
+addMenuActionSet(ContextMenuKind.API_CLIENT_AUTHORIZATION, apiClientAuthorizationActionSet);
fetchConfig()
.then(({ config, apiHost }) => {
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export interface ApiClientAuthorization {
+ uuid: string;
+ apiToken: string;
+ apiClientId: number;
+ userId: number;
+ createdByIpAddress: string;
+ lastUsedByIpAddress: string;
+ lastUsedAt: string;
+ expiresAt: string;
+ createdAt: string;
+ updatedAt: string;
+ ownerUuid: string;
+ defaultOwnerUuid: string;
+ scopes: string[];
+}
\ No newline at end of file
}
export enum ResourceKind {
+ API_CLIENT_AUTHORIZATION = "arvados#apiClientAuthorization",
COLLECTION = "arvados#collection",
CONTAINER = "arvados#container",
CONTAINER_REQUEST = "arvados#containerRequest",
}
export enum ResourceObjectType {
+ API_CLIENT_AUTHORIZATION = 'gj3su',
COLLECTION = '4zz18',
CONTAINER = 'dz642',
CONTAINER_REQUEST = 'xvhdp',
return ResourceKind.KEEP_SERVICE;
case ResourceObjectType.NODE:
return ResourceKind.NODE;
+ case ResourceObjectType.API_CLIENT_AUTHORIZATION:
+ return ResourceKind.API_CLIENT_AUTHORIZATION;
default:
return undefined;
}
const sshKeysMatch = Routes.matchSshKeysRoute(pathname);
const keepServicesMatch = Routes.matchKeepServicesRoute(pathname);
const computeNodesMatch = Routes.matchComputeNodesRoute(pathname);
+ const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname);
const myAccountMatch = Routes.matchMyAccountRoute(pathname);
if (projectMatch) {
store.dispatch(WorkbenchActions.loadKeepServices);
} else if (computeNodesMatch) {
store.dispatch(WorkbenchActions.loadComputeNodes);
+ } else if (apiClientAuthorizationsMatch) {
+ store.dispatch(WorkbenchActions.loadApiClientAuthorizations);
} else if (myAccountMatch) {
store.dispatch(WorkbenchActions.loadMyAccount);
}
SSH_KEYS: `/ssh-keys`,
MY_ACCOUNT: '/my-account',
KEEP_SERVICES: `/keep-services`,
- COMPUTE_NODES: `/nodes`
+ COMPUTE_NODES: `/nodes`,
+ API_CLIENT_AUTHORIZATIONS: `/api_client_authorizations`
};
export const getResourceUrl = (uuid: string) => {
matchPath(route, { path: Routes.KEEP_SERVICES });
export const matchComputeNodesRoute = (route: string) =>
- matchPath(route, { path: Routes.COMPUTE_NODES });
\ No newline at end of file
+ matchPath(route, { path: Routes.COMPUTE_NODES });
+
+export const matchApiClientAuthorizationsRoute = (route: string) =>
+ matchPath(route, { path: Routes.API_CLIENT_AUTHORIZATIONS });
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { AxiosInstance } from "axios";
+import { ApiActions } from '~/services/api/api-actions';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
+import { CommonService } from '~/services/common-service/common-service';
+
+export class ApiClientAuthorizationService extends CommonService<ApiClientAuthorization> {
+ constructor(serverApi: AxiosInstance, actions: ApiActions) {
+ super(serverApi, "api_client_authorizations", actions);
+ }
+}
\ No newline at end of file
// SPDX-License-Identifier: AGPL-3.0
import * as _ from "lodash";
-import { AxiosInstance, AxiosPromise } from "axios";
+import { AxiosInstance } from "axios";
import { Resource } from "src/models/resource";
-import * as uuid from "uuid/v4";
import { ApiActions } from "~/services/api/api-actions";
-
-export interface ListArguments {
- limit?: number;
- offset?: number;
- filters?: string;
- order?: string;
- select?: string[];
- distinct?: boolean;
- count?: string;
-}
-
-export interface ListResults<T> {
- kind: string;
- offset: number;
- limit: number;
- items: T[];
- itemsAvailable: number;
-}
-
-export interface Errors {
- errors: string[];
- errorToken: string;
-}
+import { CommonService } from "~/services/common-service/common-service";
export enum CommonResourceServiceError {
UNIQUE_VIOLATION = 'UniqueViolation',
NONE = 'None'
}
-export class CommonResourceService<T extends Resource> {
-
- static mapResponseKeys = (response: { data: any }) =>
- CommonResourceService.mapKeys(_.camelCase)(response.data)
-
- static mapKeys = (mapFn: (key: string) => string) =>
- (value: any): any => {
- switch (true) {
- case _.isPlainObject(value):
- return Object
- .keys(value)
- .map(key => [key, mapFn(key)])
- .reduce((newValue, [key, newKey]) => ({
- ...newValue,
- [newKey]: CommonResourceService.mapKeys(mapFn)(value[key])
- }), {});
- case _.isArray(value):
- return value.map(CommonResourceService.mapKeys(mapFn));
- default:
- return value;
- }
- }
-
- static defaultResponse<R>(promise: AxiosPromise<R>, actions: ApiActions, mapKeys = true): Promise<R> {
- const reqId = uuid();
- actions.progressFn(reqId, true);
- return promise
- .then(data => {
- actions.progressFn(reqId, false);
- return data;
- })
- .then((response: { data: any }) => {
- return mapKeys ? CommonResourceService.mapResponseKeys(response) : response.data;
- })
- .catch(({ response }) => {
- actions.progressFn(reqId, false);
- const errors = CommonResourceService.mapResponseKeys(response) as Errors;
- actions.errorFn(reqId, errors);
- throw errors;
- });
- }
-
- protected serverApi: AxiosInstance;
- protected resourceType: string;
- protected actions: ApiActions;
+export class CommonResourceService<T extends Resource> extends CommonService<T> {
constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions) {
- this.serverApi = serverApi;
- this.resourceType = '/' + resourceType + '/';
- this.actions = actions;
- }
-
- create(data?: Partial<T>) {
- return CommonResourceService.defaultResponse(
- this.serverApi
- .post<T>(this.resourceType, data && CommonResourceService.mapKeys(_.snakeCase)(data)),
- this.actions
- );
- }
-
- delete(uuid: string): Promise<T> {
- return CommonResourceService.defaultResponse(
- this.serverApi
- .delete(this.resourceType + uuid),
- this.actions
- );
- }
-
- get(uuid: string) {
- return CommonResourceService.defaultResponse(
- this.serverApi
- .get<T>(this.resourceType + uuid),
- this.actions
- );
- }
-
- list(args: ListArguments = {}): Promise<ListResults<T>> {
- const { filters, order, ...other } = args;
- const params = {
- ...other,
- filters: filters ? `[${filters}]` : undefined,
- order: order ? order : undefined
- };
- return CommonResourceService.defaultResponse(
- this.serverApi
- .get(this.resourceType, {
- params: CommonResourceService.mapKeys(_.snakeCase)(params)
- }),
- this.actions
- );
- }
-
- update(uuid: string, data: Partial<T>) {
- return CommonResourceService.defaultResponse(
- this.serverApi
- .put<T>(this.resourceType + uuid, data && CommonResourceService.mapKeys(_.snakeCase)(data)),
- this.actions
- );
+ super(serverApi, resourceType, actions);
}
+
}
export const getCommonResourceServiceError = (errorResponse: any) => {
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as _ from "lodash";
+import { AxiosInstance, AxiosPromise } from "axios";
+import * as uuid from "uuid/v4";
+import { ApiActions } from "~/services/api/api-actions";
+
+interface Errors {
+ errors: string[];
+ errorToken: string;
+}
+
+export interface ListArguments {
+ limit?: number;
+ offset?: number;
+ filters?: string;
+ order?: string;
+ select?: string[];
+ distinct?: boolean;
+ count?: string;
+}
+
+export interface ListResults<T> {
+ kind: string;
+ offset: number;
+ limit: number;
+ items: T[];
+ itemsAvailable: number;
+}
+
+export class CommonService<T> {
+ protected serverApi: AxiosInstance;
+ protected resourceType: string;
+ protected actions: ApiActions;
+
+ constructor(serverApi: AxiosInstance, resourceType: string, actions: ApiActions) {
+ this.serverApi = serverApi;
+ this.resourceType = '/' + resourceType + '/';
+ this.actions = actions;
+ }
+
+ static mapResponseKeys = (response: { data: any }) =>
+ CommonService.mapKeys(_.camelCase)(response.data)
+
+ static mapKeys = (mapFn: (key: string) => string) =>
+ (value: any): any => {
+ switch (true) {
+ case _.isPlainObject(value):
+ return Object
+ .keys(value)
+ .map(key => [key, mapFn(key)])
+ .reduce((newValue, [key, newKey]) => ({
+ ...newValue,
+ [newKey]: CommonService.mapKeys(mapFn)(value[key])
+ }), {});
+ case _.isArray(value):
+ return value.map(CommonService.mapKeys(mapFn));
+ default:
+ return value;
+ }
+ }
+
+ static defaultResponse<R>(promise: AxiosPromise<R>, actions: ApiActions, mapKeys = true): Promise<R> {
+ const reqId = uuid();
+ actions.progressFn(reqId, true);
+ return promise
+ .then(data => {
+ actions.progressFn(reqId, false);
+ return data;
+ })
+ .then((response: { data: any }) => {
+ return mapKeys ? CommonService.mapResponseKeys(response) : response.data;
+ })
+ .catch(({ response }) => {
+ actions.progressFn(reqId, false);
+ const errors = CommonService.mapResponseKeys(response) as Errors;
+ actions.errorFn(reqId, errors);
+ throw errors;
+ });
+ }
+
+ create(data?: Partial<T>) {
+ return CommonService.defaultResponse(
+ this.serverApi
+ .post<T>(this.resourceType, data && CommonService.mapKeys(_.snakeCase)(data)),
+ this.actions
+ );
+ }
+
+ delete(uuid: string): Promise<T> {
+ return CommonService.defaultResponse(
+ this.serverApi
+ .delete(this.resourceType + uuid),
+ this.actions
+ );
+ }
+
+ get(uuid: string) {
+ return CommonService.defaultResponse(
+ this.serverApi
+ .get<T>(this.resourceType + uuid),
+ this.actions
+ );
+ }
+
+ list(args: ListArguments = {}): Promise<ListResults<T>> {
+ const { filters, order, ...other } = args;
+ const params = {
+ ...other,
+ filters: filters ? `[${filters}]` : undefined,
+ order: order ? order : undefined
+ };
+ return CommonService.defaultResponse(
+ this.serverApi
+ .get(this.resourceType, {
+ params: CommonService.mapKeys(_.snakeCase)(params)
+ }),
+ this.actions
+ );
+ }
+
+ update(uuid: string, data: Partial<T>) {
+ return CommonService.defaultResponse(
+ this.serverApi
+ .put<T>(this.resourceType + uuid, data && CommonService.mapKeys(_.snakeCase)(data)),
+ this.actions
+ );
+ }
+}
\ No newline at end of file
import { GroupsService, GroupContentsResource } from "../groups-service/groups-service";
import { LinkClass } from "~/models/link";
import { FilterBuilder, joinFilters } from "~/services/api/filter-builder";
-import { ListResults } from "~/services/common-service/common-resource-service";
+import { ListResults } from '~/services/common-service/common-service';
export interface FavoriteListArguments {
limit?: number;
// SPDX-License-Identifier: AGPL-3.0
import * as _ from "lodash";
-import { CommonResourceService, ListResults, ListArguments } from '~/services/common-service/common-resource-service';
+import { CommonResourceService } from '~/services/common-service/common-resource-service';
+import { ListResults, ListArguments } from '~/services/common-service/common-service';
import { AxiosInstance } from "axios";
import { CollectionResource } from "~/models/collection";
import { ProjectResource } from "~/models/project";
import { LinkService } from "~/services/link-service/link-service";
import { PermissionResource } from "~/models/permission";
-import { ListArguments, ListResults, CommonResourceService } from '~/services/common-service/common-resource-service';
+import { CommonResourceService } from '~/services/common-service/common-resource-service';
import { LinkClass } from '../../models/link';
+import { ListArguments, ListResults } from '~/services/common-service/common-service';
export class PermissionService extends LinkService<PermissionResource> {
import { GroupsService } from "../groups-service/groups-service";
import { ProjectResource } from "~/models/project";
import { GroupClass } from "~/models/group";
-import { ListArguments } from "~/services/common-service/common-resource-service";
+import { ListArguments } from "~/services/common-service/common-service";
import { FilterBuilder, joinFilters } from "~/services/api/filter-builder";
import { TrashableResourceService } from '~/services/common-service/trashable-resource-service';
import { snakeCase } from 'lodash';
// SPDX-License-Identifier: AGPL-3.0
import Axios from "axios";
+import { ApiClientAuthorizationService } from '~/services/api-client-authorization-service/api-client-authorization-service';
import { AuthService } from "./auth-service/auth-service";
import { GroupsService } from "./groups-service/groups-service";
import { ProjectService } from "./project-service/project-service";
const webdavClient = new WebDAV();
webdavClient.defaults.baseURL = config.keepWebServiceUrl;
+ const apiClientAuthorizationService = new ApiClientAuthorizationService(apiClient, actions);
const authorizedKeysService = new AuthorizedKeysService(apiClient, actions);
const containerRequestService = new ContainerRequestService(apiClient, actions);
const containerService = new ContainerService(apiClient, actions);
return {
ancestorsService,
apiClient,
+ apiClientAuthorizationService,
authService,
authorizedKeysService,
collectionFilesService,
import { ProjectResource } from '~/models/project';
import { ServiceRepository } from '~/services/services';
import { FilterBuilder } from '~/services/api/filter-builder';
+import { ListResults } from '~/services/common-service/common-service';
import { RepositoryResource } from '~/models/repositories';
import { SshKeyResource } from '~/models/ssh-key';
import { VirtualMachinesResource } from '~/models/virtual-machines';
import { UserResource } from '~/models/user';
-import { ListResults } from '~/services/common-service/common-resource-service';
import { LinkResource } from '~/models/link';
import { KeepServiceResource } from '~/models/keep-services';
import { NodeResource } from '~/models/node';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
export const ADVANCED_TAB_DIALOG = 'advancedTabDialog';
AUTORIZED_KEYS = 'authorized_keys',
VIRTUAL_MACHINES = 'virtual_machines',
KEEP_SERVICES = 'keep_services',
- COMPUTE_NODES = 'nodes'
+ COMPUTE_NODES = 'nodes',
+ API_CLIENT_AUTHORIZATIONS = 'api_client_authorizations'
}
enum KeepServiceData {
PROPERTIES = 'properties'
}
-type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | VirtualMachineData | KeepServiceData | ComputeNodeData;
+enum ApiClientAuthorizationsData {
+ API_CLIENT_AUTHORIZATION = 'api_client_authorization',
+ DEFAULT_OWNER_UUID = 'default_owner_uuid'
+}
+
+type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | VirtualMachineData | KeepServiceData | ComputeNodeData | ApiClientAuthorizationsData;
type AdvanceResourcePrefix = GroupContentsResourcePrefix | ResourcePrefix;
-type AdvanceResponseData = ContainerRequestResource | ProjectResource | CollectionResource | RepositoryResource | SshKeyResource | VirtualMachinesResource | KeepServiceResource | NodeResource | undefined;
+type AdvanceResponseData = ContainerRequestResource | ProjectResource | CollectionResource | RepositoryResource | SshKeyResource | VirtualMachinesResource | KeepServiceResource | NodeResource | ApiClientAuthorization | undefined;
export const openAdvancedTabDialog = (uuid: string) =>
async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
});
dispatch<any>(initAdvancedTabDialog(advanceDataComputeNode));
break;
+ case ResourceKind.API_CLIENT_AUTHORIZATION:
+ const dataApiClientAuthorization = getState().apiClientAuthorizations.find(item => item.uuid === uuid);
+ const advanceDataApiClientAuthorization = advancedTabData({
+ uuid,
+ metadata: '',
+ user: '',
+ apiResponseKind: apiClientAuthorizationApiResponse,
+ data: dataApiClientAuthorization,
+ resourceKind: ApiClientAuthorizationsData.API_CLIENT_AUTHORIZATION,
+ resourcePrefix: ResourcePrefix.API_CLIENT_AUTHORIZATIONS,
+ resourceKindProperty: ApiClientAuthorizationsData.DEFAULT_OWNER_UUID,
+ property: dataApiClientAuthorization!.defaultOwnerUuid
+ });
+ dispatch<any>(initAdvancedTabDialog(advanceDataApiClientAuthorization));
+ break;
default:
dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not open advanced tab for this resource.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
}
"properties": "${JSON.stringify(properties, null, 4)}",
"info": "${JSON.stringify(info, null, 4)}"`;
+ return response;
+};
+
+const apiClientAuthorizationApiResponse = (apiResponse: ApiClientAuthorization) => {
+ const {
+ uuid, ownerUuid, apiToken, apiClientId, userId, createdByIpAddress, lastUsedByIpAddress,
+ lastUsedAt, expiresAt, defaultOwnerUuid, scopes, updatedAt, createdAt
+ } = apiResponse;
+ const response = `"uuid": "${uuid}",
+"owner_uuid": "${ownerUuid}",
+"api_token": "${stringify(apiToken)}",
+"api_client_id": "${stringify(apiClientId)}",
+"user_id": "${stringify(userId)}",
+"created_by_ip_address": "${stringify(createdByIpAddress)}",
+"last_used_by_ip_address": "${stringify(lastUsedByIpAddress)}",
+"last_used_at": "${stringify(lastUsedAt)}",
+"expires_at": "${stringify(expiresAt)}",
+"created_at": "${stringify(createdAt)}",
+"updated_at": "${stringify(updatedAt)}",
+"default_owner_uuid": "${stringify(defaultOwnerUuid)}",
+"scopes": "${JSON.stringify(scopes, null, 4)}"`;
+
return response;
};
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Dispatch } from "redux";
+import { unionize, ofType, UnionOf } from "~/common/unionize";
+import { RootState } from '~/store/store';
+import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
+import { ServiceRepository } from "~/services/services";
+import { dialogActions } from '~/store/dialog/dialog-actions';
+import { snackbarActions } from '~/store/snackbar/snackbar-actions';
+import { navigateToRootProject } from '~/store/navigation/navigation-action';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
+
+export const apiClientAuthorizationsActions = unionize({
+ SET_API_CLIENT_AUTHORIZATIONS: ofType<ApiClientAuthorization[]>(),
+ REMOVE_API_CLIENT_AUTHORIZATION: ofType<string>()
+});
+
+export type ApiClientAuthorizationsActions = UnionOf<typeof apiClientAuthorizationsActions>;
+
+export const API_CLIENT_AUTHORIZATION_REMOVE_DIALOG = 'apiClientAuthorizationRemoveDialog';
+export const API_CLIENT_AUTHORIZATION_ATTRIBUTES_DIALOG = 'apiClientAuthorizationAttributesDialog';
+export const API_CLIENT_AUTHORIZATION_HELP_DIALOG = 'apiClientAuthorizationHelpDialog';
+
+export const loadApiClientAuthorizationsPanel = () =>
+ async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const user = getState().auth.user;
+ if (user && user.isAdmin) {
+ try {
+ dispatch(setBreadcrumbs([{ label: 'Api client authorizations' }]));
+ const response = await services.apiClientAuthorizationService.list();
+ dispatch(apiClientAuthorizationsActions.SET_API_CLIENT_AUTHORIZATIONS(response.items));
+ } catch (e) {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: "You don't have permissions to view this page", hideDuration: 2000 }));
+ return;
+ }
+ } else {
+ dispatch(navigateToRootProject);
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: "You don't have permissions to view this page", hideDuration: 2000 }));
+ }
+ };
+
+export const openApiClientAuthorizationAttributesDialog = (uuid: string) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ const apiClientAuthorization = getState().apiClientAuthorizations.find(node => node.uuid === uuid);
+ dispatch(dialogActions.OPEN_DIALOG({ id: API_CLIENT_AUTHORIZATION_ATTRIBUTES_DIALOG, data: { apiClientAuthorization } }));
+ };
+
+export const openApiClientAuthorizationRemoveDialog = (uuid: string) =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ dispatch(dialogActions.OPEN_DIALOG({
+ id: API_CLIENT_AUTHORIZATION_REMOVE_DIALOG,
+ data: {
+ title: 'Remove api client authorization',
+ text: 'Are you sure you want to remove this api client authorization?',
+ confirmButtonLabel: 'Remove',
+ uuid
+ }
+ }));
+ };
+
+export const removeApiClientAuthorization = (uuid: string) =>
+ async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...' }));
+ try {
+ await services.apiClientAuthorizationService.delete(uuid);
+ dispatch(apiClientAuthorizationsActions.REMOVE_API_CLIENT_AUTHORIZATION(uuid));
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Api client authorization has been successfully removed.', hideDuration: 2000 }));
+ } catch (e) {
+ return;
+ }
+ };
+
+export const openApiClientAuthorizationsHelpDialog = () =>
+ (dispatch: Dispatch, getState: () => RootState) => {
+ const apiHost = getState().properties.apiHost;
+ const user = getState().auth.user;
+ const email = user ? user.email : '';
+ const apiToken = getState().auth.apiToken;
+ dispatch(dialogActions.OPEN_DIALOG({ id: API_CLIENT_AUTHORIZATION_HELP_DIALOG, data: { apiHost, apiToken, email } }));
+ };
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import {
+ apiClientAuthorizationsActions,
+ ApiClientAuthorizationsActions
+} from '~/store/api-client-authorizations/api-client-authorizations-actions';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
+
+export type ApiClientAuthorizationsState = ApiClientAuthorization[];
+
+const initialState: ApiClientAuthorizationsState = [];
+
+export const apiClientAuthorizationsReducer =
+ (state: ApiClientAuthorizationsState = initialState, action: ApiClientAuthorizationsActions): ApiClientAuthorizationsState =>
+ apiClientAuthorizationsActions.match(action, {
+ SET_API_CLIENT_AUTHORIZATIONS: apiClientAuthorizations => apiClientAuthorizations,
+ REMOVE_API_CLIENT_AUTHORIZATION: (uuid: string) =>
+ state.filter((apiClientAuthorization) => apiClientAuthorization.uuid !== uuid),
+ default: () => state
+ });
\ No newline at end of file
import { VirtualMachinesResource } from '~/models/virtual-machines';
import { KeepServiceResource } from '~/models/keep-services';
import { NodeResource } from '~/models/node';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
export const contextMenuActions = unionize({
OPEN_CONTEXT_MENU: ofType<{ position: ContextMenuPosition, resource: ContextMenuResource }>(),
}));
};
+export const openApiClientAuthorizationContextMenu =
+ (event: React.MouseEvent<HTMLElement>, apiClientAuthorization: ApiClientAuthorization) =>
+ (dispatch: Dispatch) => {
+ dispatch<any>(openContextMenu(event, {
+ name: '',
+ uuid: apiClientAuthorization.uuid,
+ ownerUuid: apiClientAuthorization.ownerUuid,
+ kind: ResourceKind.API_CLIENT_AUTHORIZATION,
+ menuKind: ContextMenuKind.API_CLIENT_AUTHORIZATION
+ }));
+ };
+
export const openRootProjectContextMenu = (event: React.MouseEvent<HTMLElement>, projectUuid: string) =>
(dispatch: Dispatch, getState: () => RootState) => {
const res = getResource<UserResource>(projectUuid)(getState().resources);
import { RootState } from "../store";
import { DataColumns } from "~/components/data-table/data-table";
import { DataExplorer } from './data-explorer-reducer';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { createTree } from "~/models/tree";
import { DataTableFilters } from "~/components/data-table-filters/data-table-filters-tree";
export const navigateToKeepServices = push(Routes.KEEP_SERVICES);
-export const navigateToComputeNodes = push(Routes.COMPUTE_NODES);
\ No newline at end of file
+export const navigateToComputeNodes = push(Routes.COMPUTE_NODES);
+
+export const navigateToApiClientAuthorizations = push(Routes.API_CLIENT_AUTHORIZATIONS);
\ No newline at end of file
import { snackbarActions, SnackbarKind } from '../snackbar/snackbar-actions';
import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions.ts';
import { DataExplorer, getDataExplorer } from '../data-explorer/data-explorer-reducer';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { loadContainers } from '../processes/processes-actions';
import { ResourceKind } from '~/models/resource';
import { getResource } from "~/store/resources/resources";
import { SearchResultsPanelColumnNames } from '~/views/search-results-panel/search-results-panel-view';
import { OrderDirection, OrderBuilder } from '~/services/api/order-builder';
import { GroupContentsResource, GroupContentsResourcePrefix } from "~/services/groups-service/groups-service";
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { searchResultsPanelActions } from '~/store/search-results-panel/search-results-panel-actions';
import { getFilters } from '~/store/search-bar/search-bar-actions';
import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer";
import { loadMissingProcessesInformation, getFilters } from '~/store/project-panel/project-panel-middleware-service';
import { snackbarActions } from '~/store/snackbar/snackbar-actions';
import { sharedWithMePanelActions } from './shared-with-me-panel-actions';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { GroupContentsResource, GroupContentsResourcePrefix } from '~/services/groups-service/groups-service';
import { SortDirection } from '~/components/data-table/data-column';
import { OrderBuilder, OrderDirection } from '~/services/api/order-builder';
import { repositoriesReducer } from '~/store/repositories/repositories-reducer';
import { keepServicesReducer } from '~/store/keep-services/keep-services-reducer';
import { computeNodesReducer } from '~/store/compute-nodes/compute-nodes-reducer';
+import { apiClientAuthorizationsReducer } from '~/store/api-client-authorizations/api-client-authorizations-reducer';
const composeEnhancers =
(process.env.NODE_ENV === 'development' &&
virtualMachines: virtualMachinesReducer,
repositories: repositoriesReducer,
keepServices: keepServicesReducer,
- computeNodes: computeNodesReducer
+ computeNodes: computeNodesReducer,
+ apiClientAuthorizations: apiClientAuthorizationsReducer
});
import { unionize, ofType, UnionOf } from "~/common/unionize";
import { VirtualMachineLogins } from '~/models/virtual-machines';
import { FilterBuilder } from "~/services/api/filter-builder";
-import { ListResults } from "~/services/common-service/common-resource-service";
+import { ListResults } from "~/services/common-service/common-service";
import { dialogActions } from '~/store/dialog/dialog-actions';
import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
// SPDX-License-Identifier: AGPL-3.0
import { virtualMachinesActions, VirtualMachineActions } from '~/store/virtual-machines/virtual-machines-actions';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { VirtualMachineLogins } from '~/models/virtual-machines';
interface VirtualMachines {
import { loadRepositoriesPanel } from '~/store/repositories/repositories-actions';
import { loadKeepServicesPanel } from '~/store/keep-services/keep-services-actions';
import { loadComputeNodesPanel } from '~/store/compute-nodes/compute-nodes-actions';
+import { loadApiClientAuthorizationsPanel } from '~/store/api-client-authorizations/api-client-authorizations-actions';
export const WORKBENCH_LOADING_SCREEN = 'workbenchLoadingScreen';
await dispatch(loadComputeNodesPanel());
});
+export const loadApiClientAuthorizations = handleFirstTimeLoad(
+ async (dispatch: Dispatch<any>) => {
+ await dispatch(loadApiClientAuthorizationsPanel());
+ });
+
const finishLoadingProject = (project: GroupContentsResource | string) =>
async (dispatch: Dispatch<any>) => {
const uuid = typeof project === 'string' ? project : project.uuid;
import { WorkflowPanelColumnNames } from '~/views/workflow-panel/workflow-panel-view';
import { OrderDirection, OrderBuilder } from '~/services/api/order-builder';
import { WorkflowResource } from '~/models/workflow';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { workflowPanelActions } from './workflow-panel-actions';
import { getSortColumn } from "~/store/data-explorer/data-explorer-reducer";
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as 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<CssRules> = (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<AttributesKeepServiceDialogDataProps> & WithStyles<CssRules>) =>
+ <Dialog open={open} onClose={closeDialog} fullWidth maxWidth='sm'>
+ <DialogTitle>Attributes</DialogTitle>
+ <DialogContent>
+ {data.apiClientAuthorization && <Grid container direction="row" spacing={16} className={classes.root}>
+ <Grid item xs={5}>UUID</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.uuid}</Grid>
+ <Grid item xs={5}>Owner uuid</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.ownerUuid}</Grid>
+ <Grid item xs={5}>API Client ID</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.apiClientId}</Grid>
+ <Grid item xs={5}>API Token</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.apiToken}</Grid>
+ <Grid item xs={5}>Created by IP address</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.createdByIpAddress || '(none)'}</Grid>
+ <Grid item xs={5}>Default owner</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.defaultOwnerUuid || '(none)'}</Grid>
+ <Grid item xs={5}>Expires at</Grid>
+ <Grid item xs={7}>{formatDate(data.apiClientAuthorization.expiresAt) || '(none)'}</Grid>
+ <Grid item xs={5}>Last used at</Grid>
+ <Grid item xs={7}>{formatDate(data.apiClientAuthorization.lastUsedAt) || '(none)'}</Grid>
+ <Grid item xs={5}>Last used by IP address</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.lastUsedByIpAddress || '(none)'}</Grid>
+ <Grid item xs={5}>Scopes</Grid>
+ <Grid item xs={7}>{JSON.stringify(data.apiClientAuthorization.scopes || '(none)')}</Grid>
+ <Grid item xs={5}>User ID</Grid>
+ <Grid item xs={7}>{data.apiClientAuthorization.userId || '(none)'}</Grid>
+ <Grid item xs={5}>Created at</Grid>
+ <Grid item xs={7}>{formatDate(data.apiClientAuthorization.createdAt) || '(none)'}</Grid>
+ <Grid item xs={5}>Updated at</Grid>
+ <Grid item xs={7}>{formatDate(data.apiClientAuthorization.updatedAt) || '(none)'}</Grid>
+ </Grid>}
+ </DialogContent>
+ <DialogActions>
+ <Button
+ variant='flat'
+ color='primary'
+ onClick={closeDialog}>
+ Close
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from "react";
+import { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from "@material-ui/core";
+import { WithDialogProps } from "~/store/dialog/with-dialog";
+import { withDialog } from '~/store/dialog/with-dialog';
+import { DefaultCodeSnippet } from '~/components/default-code-snippet/default-code-snippet';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { compose } from "redux";
+import { API_CLIENT_AUTHORIZATION_HELP_DIALOG } from '~/store/api-client-authorizations/api-client-authorizations-actions';
+
+type CssRules = 'codeSnippet';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ codeSnippet: {
+ borderRadius: theme.spacing.unit * 0.5,
+ border: `1px solid ${theme.palette.grey["400"]}`,
+ '& pre': {
+ fontSize: '0.815rem'
+ }
+ }
+});
+
+interface HelpApiClientAuthorizationDataProps {
+ apiHost: string;
+ apiToken: string;
+ email: string;
+}
+
+export const HelpApiClientAuthorizationDialog = compose(
+ withDialog(API_CLIENT_AUTHORIZATION_HELP_DIALOG),
+ withStyles(styles))(
+ (props: WithDialogProps<HelpApiClientAuthorizationDataProps> & WithStyles<CssRules>) =>
+ <Dialog open={props.open}
+ onClose={props.closeDialog}
+ fullWidth
+ maxWidth='md'>
+ <DialogTitle>HELP:</DialogTitle>
+ <DialogContent>
+ <DefaultCodeSnippet
+ className={props.classes.codeSnippet}
+ lines={[snippetText(props.data)]} />
+ {/* // lines={snippetText2(props.data)} /> */}
+ </DialogContent>
+ <DialogActions>
+ <Button
+ variant='flat'
+ color='primary'
+ onClick={props.closeDialog}>
+ Close
+ </Button>
+ </DialogActions>
+ </Dialog>
+ );
+
+const snippetText = (data: HelpApiClientAuthorizationDataProps) => `### Pasting the following lines at a shell prompt will allow Arvados SDKs
+### to authenticate to your account, ${data.email}
+
+read ARVADOS_API_TOKEN <<EOF
+${data.apiToken}
+EOF
+export ARVADOS_API_TOKEN ARVADOS_API_HOST=${data.apiHost}
+unset ARVADOS_API_HOST_INSECURE`;
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+import { Dispatch, compose } from 'redux';
+import { connect } from "react-redux";
+import { ConfirmationDialog } from "~/components/confirmation-dialog/confirmation-dialog";
+import { withDialog, WithDialogProps } from "~/store/dialog/with-dialog";
+import { API_CLIENT_AUTHORIZATION_REMOVE_DIALOG, removeApiClientAuthorization } from '~/store/api-client-authorizations/api-client-authorizations-actions';
+
+const mapDispatchToProps = (dispatch: Dispatch, props: WithDialogProps<any>) => ({
+ onConfirm: () => {
+ props.closeDialog();
+ dispatch<any>(removeApiClientAuthorization(props.data.uuid));
+ }
+});
+
+export const RemoveApiClientAuthorizationDialog = compose(
+ withDialog(API_CLIENT_AUTHORIZATION_REMOVE_DIALOG),
+ connect(null, mapDispatchToProps)
+)(ConfirmationDialog);
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import {
+ openApiClientAuthorizationAttributesDialog,
+ openApiClientAuthorizationRemoveDialog
+} from '~/store/api-client-authorizations/api-client-authorizations-actions';
+import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
+import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
+import { AdvancedIcon, RemoveIcon, AttributesIcon } from "~/components/icon/icon";
+
+export const apiClientAuthorizationActionSet: ContextMenuActionSet = [[{
+ name: "Attributes",
+ icon: AttributesIcon,
+ execute: (dispatch, { uuid }) => {
+ dispatch<any>(openApiClientAuthorizationAttributesDialog(uuid));
+ }
+}, {
+ name: "Advanced",
+ icon: AdvancedIcon,
+ execute: (dispatch, { uuid }) => {
+ dispatch<any>(openAdvancedTabDialog(uuid));
+ }
+}, {
+ name: "Remove",
+ icon: RemoveIcon,
+ execute: (dispatch, { uuid }) => {
+ dispatch<any>(openApiClientAuthorizationRemoveDialog(uuid));
+ }
+}]];
};
export enum ContextMenuKind {
+ API_CLIENT_AUTHORIZATION = "ApiClientAuthorization",
ROOT_PROJECT = "RootProject",
PROJECT = "Project",
RESOURCE = "Resource",
import { RootState } from "~/store/store";
import { openCurrentTokenDialog } from '~/store/current-token-dialog/current-token-dialog-actions';
import { openRepositoriesPanel } from "~/store/repositories/repositories-actions";
-import { navigateToSshKeys, navigateToKeepServices, navigateToComputeNodes, navigateToMyAccount } from '~/store/navigation/navigation-action';
+import {
+ navigateToSshKeys, navigateToKeepServices, navigateToComputeNodes,
+ navigateToApiClientAuthorizations, navigateToMyAccount
+} from '~/store/navigation/navigation-action';
import { openVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
interface AccountMenuProps {
<MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
<MenuItem onClick={() => dispatch(openCurrentTokenDialog)}>Current token</MenuItem>
<MenuItem onClick={() => dispatch(navigateToSshKeys)}>Ssh Keys</MenuItem>
+ { user.isAdmin && <MenuItem onClick={() => dispatch(navigateToApiClientAuthorizations)}>Api Tokens</MenuItem> }
{ user.isAdmin && <MenuItem onClick={() => dispatch(navigateToKeepServices)}>Keep Services</MenuItem> }
{ user.isAdmin && <MenuItem onClick={() => dispatch(navigateToComputeNodes)}>Compute Nodes</MenuItem> }
<MenuItem onClick={() => dispatch(navigateToMyAccount)}>My account</MenuItem>
const pathname = router.location ? router.location.pathname : '';
return !Routes.matchWorkflowRoute(pathname) && !Routes.matchVirtualMachineRoute(pathname) &&
!Routes.matchRepositoriesRoute(pathname) && !Routes.matchSshKeysRoute(pathname) &&
- !Routes.matchKeepServicesRoute(pathname) && !Routes.matchComputeNodesRoute(pathname);
+ !Routes.matchKeepServicesRoute(pathname) && !Routes.matchComputeNodesRoute(pathname) &&
+ !Routes.matchApiClientAuthorizationsRoute(pathname);
};
export const MainContentBar = connect((state: RootState) => ({
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import {
+ StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Grid,
+ Table, TableHead, TableRow, TableCell, TableBody, Tooltip, IconButton
+} from '@material-ui/core';
+import { ArvadosTheme } from '~/common/custom-theme';
+import { MoreOptionsIcon, HelpIcon } from '~/components/icon/icon';
+import { ApiClientAuthorization } from '~/models/api-client-authorization';
+import { formatDate } from '~/common/formatters';
+
+type CssRules = 'root' | 'tableRow' | 'helpIconGrid' | 'tableGrid';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ root: {
+ width: '100%',
+ overflow: 'auto'
+ },
+ helpIconGrid: {
+ textAlign: 'right'
+ },
+ tableGrid: {
+ marginTop: theme.spacing.unit
+ },
+ tableRow: {
+ '& td, th': {
+ whiteSpace: 'nowrap'
+ }
+ }
+});
+
+export interface ApiClientAuthorizationPanelRootActionProps {
+ openRowOptions: (event: React.MouseEvent<HTMLElement>, keepService: ApiClientAuthorization) => void;
+ openHelpDialog: () => void;
+}
+
+export interface ApiClientAuthorizationPanelRootDataProps {
+ apiClientAuthorizations: ApiClientAuthorization[];
+ hasApiClientAuthorizations: boolean;
+}
+
+type ApiClientAuthorizationPanelRootProps = ApiClientAuthorizationPanelRootActionProps
+ & ApiClientAuthorizationPanelRootDataProps & WithStyles<CssRules>;
+
+export const ApiClientAuthorizationPanelRoot = withStyles(styles)(
+ ({ classes, hasApiClientAuthorizations, apiClientAuthorizations, openRowOptions, openHelpDialog }: ApiClientAuthorizationPanelRootProps) =>
+ <Card className={classes.root}>
+ <CardContent>
+ {hasApiClientAuthorizations && <Grid container direction="row" justify="flex-end">
+ <Grid item xs={12} className={classes.helpIconGrid}>
+ <Tooltip title="Api token - help">
+ <IconButton onClick={openHelpDialog}>
+ <HelpIcon />
+ </IconButton>
+ </Tooltip>
+ </Grid>
+ <Grid item xs={12}>
+ <Table>
+ <TableHead>
+ <TableRow className={classes.tableRow}>
+ <TableCell>UUID</TableCell>
+ <TableCell>API Client ID</TableCell>
+ <TableCell>API Token</TableCell>
+ <TableCell>Created by IP address</TableCell>
+ <TableCell>Default owner</TableCell>
+ <TableCell>Expires at</TableCell>
+ <TableCell>Last used at</TableCell>
+ <TableCell>Last used by IP address</TableCell>
+ <TableCell>Scopes</TableCell>
+ <TableCell>User ID</TableCell>
+ <TableCell />
+ </TableRow>
+ </TableHead>
+ <TableBody>
+ {apiClientAuthorizations.map((apiClientAuthorizatio, index) =>
+ <TableRow key={index} className={classes.tableRow}>
+ <TableCell>{apiClientAuthorizatio.uuid}</TableCell>
+ <TableCell>{apiClientAuthorizatio.apiClientId}</TableCell>
+ <TableCell>{apiClientAuthorizatio.apiToken}</TableCell>
+ <TableCell>{apiClientAuthorizatio.createdByIpAddress || '(none)'}</TableCell>
+ <TableCell>{apiClientAuthorizatio.defaultOwnerUuid || '(none)'}</TableCell>
+ <TableCell>{formatDate(apiClientAuthorizatio.expiresAt) || '(none)'}</TableCell>
+ <TableCell>{formatDate(apiClientAuthorizatio.lastUsedAt) || '(none)'}</TableCell>
+ <TableCell>{apiClientAuthorizatio.lastUsedByIpAddress || '(none)'}</TableCell>
+ <TableCell>{JSON.stringify(apiClientAuthorizatio.scopes)}</TableCell>
+ <TableCell>{apiClientAuthorizatio.userId}</TableCell>
+ <TableCell>
+ <Tooltip title="More options" disableFocusListener>
+ <IconButton onClick={event => openRowOptions(event, apiClientAuthorizatio)}>
+ <MoreOptionsIcon />
+ </IconButton>
+ </Tooltip>
+ </TableCell>
+ </TableRow>)}
+ </TableBody>
+ </Table>
+ </Grid>
+ </Grid>}
+ </CardContent>
+ </Card>
+);
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { RootState } from '~/store/store';
+import { Dispatch } from 'redux';
+import { connect } from 'react-redux';
+import {
+ ApiClientAuthorizationPanelRoot,
+ ApiClientAuthorizationPanelRootDataProps,
+ ApiClientAuthorizationPanelRootActionProps
+} from '~/views/api-client-authorization-panel/api-client-authorization-panel-root';
+import { openApiClientAuthorizationContextMenu } from '~/store/context-menu/context-menu-actions';
+import { openApiClientAuthorizationsHelpDialog } from '~/store/api-client-authorizations/api-client-authorizations-actions';
+
+const mapStateToProps = (state: RootState): ApiClientAuthorizationPanelRootDataProps => {
+ return {
+ apiClientAuthorizations: state.apiClientAuthorizations,
+ hasApiClientAuthorizations: state.apiClientAuthorizations.length > 0
+ };
+};
+
+const mapDispatchToProps = (dispatch: Dispatch): ApiClientAuthorizationPanelRootActionProps => ({
+ openRowOptions: (event, apiClientAuthorization) => {
+ dispatch<any>(openApiClientAuthorizationContextMenu(event, apiClientAuthorization));
+ },
+ openHelpDialog: () => {
+ dispatch<any>(openApiClientAuthorizationsHelpDialog());
+ }
+});
+
+export const ApiClientAuthorizationPanel = connect(mapStateToProps, mapDispatchToProps)(ApiClientAuthorizationPanelRoot);
\ No newline at end of file
overflow: 'auto'
},
tableRow: {
- '& td, th': {
+ '& th': {
whiteSpace: 'nowrap'
}
}
<TableBody>
{computeNodes.map((computeNode, index) =>
<TableRow key={index} className={classes.tableRow}>
- <TableCell>{computeNode.uuid}</TableCell>
+ <TableCell>{JSON.stringify(computeNode.info, null, 4)}</TableCell>
<TableCell>{computeNode.uuid}</TableCell>
<TableCell>{computeNode.domain}</TableCell>
<TableCell>{formatDate(computeNode.firstPingAt) || '(none)'}</TableCell>
import { compose, Dispatch } from 'redux';
import { saveRequestedDate, loadVirtualMachinesData } from '~/store/virtual-machines/virtual-machines-actions';
import { RootState } from '~/store/store';
-import { ListResults } from '~/services/common-service/common-resource-service';
+import { ListResults } from '~/services/common-service/common-service';
import { HelpIcon, MoreOptionsIcon } from '~/components/icon/icon';
import { VirtualMachineLogins, VirtualMachinesResource } from '~/models/virtual-machines';
import { Routes } from '~/routes/routes';
import { RepositoriesPanel } from '~/views/repositories-panel/repositories-panel';
import { KeepServicePanel } from '~/views/keep-service-panel/keep-service-panel';
import { ComputeNodePanel } from '~/views/compute-node-panel/compute-node-panel';
+import { ApiClientAuthorizationPanel } from '~/views/api-client-authorization-panel/api-client-authorization-panel';
import { RepositoriesSampleGitDialog } from '~/views-components/repositories-sample-git-dialog/repositories-sample-git-dialog';
import { RepositoryAttributesDialog } from '~/views-components/repository-attributes-dialog/repository-attributes-dialog';
import { CreateRepositoryDialog } from '~/views-components/dialog-forms/create-repository-dialog';
import { RemoveRepositoryDialog } from '~/views-components/repository-remove-dialog/repository-remove-dialog';
import { CreateSshKeyDialog } from '~/views-components/dialog-forms/create-ssh-key-dialog';
import { PublicKeyDialog } from '~/views-components/ssh-keys-dialog/public-key-dialog';
+import { RemoveApiClientAuthorizationDialog } from '~/views-components/api-client-authorizations-dialog/remove-dialog';
import { RemoveComputeNodeDialog } from '~/views-components/compute-nodes-dialog/remove-dialog';
import { RemoveKeepServiceDialog } from '~/views-components/keep-services-dialog/remove-dialog';
import { RemoveSshKeyDialog } from '~/views-components/ssh-keys-dialog/remove-dialog';
import { RemoveVirtualMachineDialog } from '~/views-components/virtual-machines-dialog/remove-dialog';
+import { AttributesApiClientAuthorizationDialog } from '~/views-components/api-client-authorizations-dialog/attributes-dialog';
import { AttributesComputeNodeDialog } from '~/views-components/compute-nodes-dialog/attributes-dialog';
import { AttributesKeepServiceDialog } from '~/views-components/keep-services-dialog/attributes-dialog';
import { AttributesSshKeyDialog } from '~/views-components/ssh-keys-dialog/attributes-dialog';
import { VirtualMachineAttributesDialog } from '~/views-components/virtual-machines-dialog/attributes-dialog';
+import { HelpApiClientAuthorizationDialog } from '~/views-components/api-client-authorizations-dialog/help-dialog';
type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
<Route path={Routes.SSH_KEYS} component={SshKeyPanel} />
<Route path={Routes.KEEP_SERVICES} component={KeepServicePanel} />
<Route path={Routes.COMPUTE_NODES} component={ComputeNodePanel} />
+ <Route path={Routes.API_CLIENT_AUTHORIZATIONS} component={ApiClientAuthorizationPanel} />
<Route path={Routes.MY_ACCOUNT} component={MyAccountPanel} />
</Switch>
</Grid>
<DetailsPanel />
</Grid>
<AdvancedTabDialog />
+ <AttributesApiClientAuthorizationDialog />
<AttributesComputeNodeDialog />
<AttributesKeepServiceDialog />
<AttributesSshKeyDialog />
<CurrentTokenDialog />
<FileRemoveDialog />
<FilesUploadCollectionDialog />
+ <HelpApiClientAuthorizationDialog />
<MoveCollectionDialog />
<MoveProcessDialog />
<MoveProjectDialog />
<ProcessCommandDialog />
<ProcessInputDialog />
<ProjectPropertiesDialog />
+ <RemoveApiClientAuthorizationDialog />
<RemoveComputeNodeDialog />
<RemoveKeepServiceDialog />
<RemoveProcessDialog />