1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from 'redux';
6 import { dialogActions } from 'store/dialog/dialog-actions';
7 import { RootState } from 'store/store';
8 import { ResourceKind, extractUuidKind } from 'models/resource';
9 import { getResource } from 'store/resources/resources';
10 import { GroupContentsResourcePrefix } from 'services/groups-service/groups-service';
11 import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
12 import { ContainerRequestResource } from 'models/container-request';
13 import { CollectionResource } from 'models/collection';
14 import { ProjectResource } from 'models/project';
15 import { ServiceRepository } from 'services/services';
16 import { FilterBuilder } from 'services/api/filter-builder';
17 import { ListResults } from 'services/common-service/common-service';
18 import { RepositoryResource } from 'models/repositories';
19 import { SshKeyResource } from 'models/ssh-key';
20 import { VirtualMachinesResource } from 'models/virtual-machines';
21 import { UserResource } from 'models/user';
22 import { LinkResource } from 'models/link';
23 import { KeepServiceResource } from 'models/keep-services';
24 import { ApiClientAuthorization } from 'models/api-client-authorization';
25 import React from 'react';
27 export const ADVANCED_TAB_DIALOG = 'advancedTabDialog';
29 interface AdvancedTabDialogData {
31 metadata: ListResults<LinkResource> | string;
32 user: UserResource | string;
34 pythonExample: string;
36 cliGetExample: string;
37 cliUpdateHeader: string;
38 cliUpdateExample: string;
44 COLLECTION = 'collection',
45 STORAGE_CLASSES_CONFIRMED = 'storage_classes_confirmed'
49 CONTAINER_REQUEST = 'container_request',
50 OUTPUT_NAME = 'output_name'
55 DELETE_AT = 'delete_at'
59 REPOSITORY = 'repository',
60 CREATED_AT = 'created_at'
64 SSH_KEY = 'authorized_key',
65 CREATED_AT = 'created_at'
68 enum VirtualMachineData {
69 VIRTUAL_MACHINE = 'virtual_machine',
70 CREATED_AT = 'created_at'
74 REPOSITORIES = 'repositories',
75 AUTORIZED_KEYS = 'authorized_keys',
76 VIRTUAL_MACHINES = 'virtual_machines',
77 KEEP_SERVICES = 'keep_services',
79 API_CLIENT_AUTHORIZATIONS = 'api_client_authorizations',
83 enum KeepServiceData {
84 KEEP_SERVICE = 'keep_services',
85 CREATED_AT = 'created_at'
93 enum ApiClientAuthorizationsData {
94 API_CLIENT_AUTHORIZATION = 'api_client_authorization',
95 DEFAULT_OWNER_UUID = 'default_owner_uuid'
100 PROPERTIES = 'properties'
103 type AdvanceResourceKind = CollectionData | ProcessData | ProjectData | RepositoryData | SshKeyData | VirtualMachineData | KeepServiceData | ApiClientAuthorizationsData | UserData | LinkData;
104 type AdvanceResourcePrefix = GroupContentsResourcePrefix | ResourcePrefix;
105 type AdvanceResponseData = ContainerRequestResource | ProjectResource | CollectionResource | RepositoryResource | SshKeyResource | VirtualMachinesResource | KeepServiceResource | ApiClientAuthorization | UserResource | LinkResource | undefined;
107 export const openAdvancedTabDialog = (uuid: string) =>
108 async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
109 const kind = extractUuidKind(uuid);
111 case ResourceKind.COLLECTION:
112 const { data: dataCollection, metadata: metaCollection, user: userCollection } = await dispatch<any>(getDataForAdvancedTab(uuid));
113 const advanceDataCollection = advancedTabData({
115 metadata: metaCollection,
116 user: userCollection,
117 apiResponseKind: collectionApiResponse,
118 data: dataCollection,
119 resourceKind: CollectionData.COLLECTION,
120 resourcePrefix: GroupContentsResourcePrefix.COLLECTION,
121 resourceKindProperty: CollectionData.STORAGE_CLASSES_CONFIRMED,
122 property: dataCollection.storageClassesConfirmed
124 dispatch<any>(initAdvancedTabDialog(advanceDataCollection));
126 case ResourceKind.PROCESS:
127 const { data: dataProcess, metadata: metaProcess, user: userProcess } = await dispatch<any>(getDataForAdvancedTab(uuid));
128 const advancedDataProcess = advancedTabData({
130 metadata: metaProcess,
132 apiResponseKind: containerRequestApiResponse,
134 resourceKind: ProcessData.CONTAINER_REQUEST,
135 resourcePrefix: GroupContentsResourcePrefix.PROCESS,
136 resourceKindProperty: ProcessData.OUTPUT_NAME,
137 property: dataProcess.outputName
139 dispatch<any>(initAdvancedTabDialog(advancedDataProcess));
141 case ResourceKind.PROJECT:
142 const { data: dataProject, metadata: metaProject, user: userProject } = await dispatch<any>(getDataForAdvancedTab(uuid));
143 const advanceDataProject = advancedTabData({
145 metadata: metaProject,
147 apiResponseKind: groupRequestApiResponse,
149 resourceKind: ProjectData.GROUP,
150 resourcePrefix: GroupContentsResourcePrefix.PROJECT,
151 resourceKindProperty: ProjectData.DELETE_AT,
152 property: dataProject.deleteAt
154 dispatch<any>(initAdvancedTabDialog(advanceDataProject));
156 case ResourceKind.REPOSITORY:
157 const dataRepository = getState().repositories.items.find(it => it.uuid === uuid);
158 const advanceDataRepository = advancedTabData({
162 apiResponseKind: repositoryApiResponse,
163 data: dataRepository,
164 resourceKind: RepositoryData.REPOSITORY,
165 resourcePrefix: ResourcePrefix.REPOSITORIES,
166 resourceKindProperty: RepositoryData.CREATED_AT,
167 property: dataRepository!.createdAt
169 dispatch<any>(initAdvancedTabDialog(advanceDataRepository));
171 case ResourceKind.SSH_KEY:
172 const dataSshKey = getState().auth.sshKeys.find(it => it.uuid === uuid);
173 const advanceDataSshKey = advancedTabData({
177 apiResponseKind: sshKeyApiResponse,
179 resourceKind: SshKeyData.SSH_KEY,
180 resourcePrefix: ResourcePrefix.AUTORIZED_KEYS,
181 resourceKindProperty: SshKeyData.CREATED_AT,
182 property: dataSshKey!.createdAt
184 dispatch<any>(initAdvancedTabDialog(advanceDataSshKey));
186 case ResourceKind.VIRTUAL_MACHINE:
187 const dataVirtualMachine = getState().virtualMachines.virtualMachines.items.find(it => it.uuid === uuid);
188 const advanceDataVirtualMachine = advancedTabData({
192 apiResponseKind: virtualMachineApiResponse,
193 data: dataVirtualMachine,
194 resourceKind: VirtualMachineData.VIRTUAL_MACHINE,
195 resourcePrefix: ResourcePrefix.VIRTUAL_MACHINES,
196 resourceKindProperty: VirtualMachineData.CREATED_AT,
197 property: dataVirtualMachine.createdAt
199 dispatch<any>(initAdvancedTabDialog(advanceDataVirtualMachine));
201 case ResourceKind.KEEP_SERVICE:
202 const dataKeepService = getState().keepServices.find(it => it.uuid === uuid);
203 const advanceDataKeepService = advancedTabData({
207 apiResponseKind: keepServiceApiResponse,
208 data: dataKeepService,
209 resourceKind: KeepServiceData.KEEP_SERVICE,
210 resourcePrefix: ResourcePrefix.KEEP_SERVICES,
211 resourceKindProperty: KeepServiceData.CREATED_AT,
212 property: dataKeepService!.createdAt
214 dispatch<any>(initAdvancedTabDialog(advanceDataKeepService));
216 case ResourceKind.USER:
217 const { resources } = getState();
218 const data = getResource<UserResource>(uuid)(resources);
219 const metadata = await services.linkService.list({
220 filters: new FilterBuilder()
221 .addEqual('head_uuid', uuid)
224 const advanceDataUser = advancedTabData({
228 apiResponseKind: userApiResponse,
230 resourceKind: UserData.USER,
231 resourcePrefix: ResourcePrefix.USERS,
232 resourceKindProperty: UserData.USERNAME,
233 property: data!.username
235 dispatch<any>(initAdvancedTabDialog(advanceDataUser));
237 case ResourceKind.API_CLIENT_AUTHORIZATION:
238 const apiClientAuthorizationResources = getState().resources;
239 const dataApiClientAuthorization = getResource<ApiClientAuthorization>(uuid)(apiClientAuthorizationResources);
240 const advanceDataApiClientAuthorization = advancedTabData({
244 apiResponseKind: apiClientAuthorizationApiResponse,
245 data: dataApiClientAuthorization,
246 resourceKind: ApiClientAuthorizationsData.API_CLIENT_AUTHORIZATION,
247 resourcePrefix: ResourcePrefix.API_CLIENT_AUTHORIZATIONS,
248 resourceKindProperty: ApiClientAuthorizationsData.DEFAULT_OWNER_UUID,
249 property: dataApiClientAuthorization!.defaultOwnerUuid
251 dispatch<any>(initAdvancedTabDialog(advanceDataApiClientAuthorization));
253 case ResourceKind.LINK:
254 const linkResources = getState().resources;
255 const dataLink = getResource<LinkResource>(uuid)(linkResources);
256 const advanceDataLink = advancedTabData({
260 apiResponseKind: linkApiResponse,
262 resourceKind: LinkData.LINK,
263 resourcePrefix: ResourcePrefix.LINKS,
264 resourceKindProperty: LinkData.PROPERTIES,
265 property: dataLink!.properties
267 dispatch<any>(initAdvancedTabDialog(advanceDataLink));
270 dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Could not open advanced tab for this resource.", hideDuration: 2000, kind: SnackbarKind.ERROR }));
274 const getDataForAdvancedTab = (uuid: string) =>
275 async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
276 const { resources } = getState();
277 const data = getResource<any>(uuid)(resources);
278 const metadata = await services.linkService.list({
279 filters: new FilterBuilder()
280 .addEqual('head_uuid', uuid)
284 return { data, metadata };
287 const initAdvancedTabDialog = (data: AdvancedTabDialogData) => dialogActions.OPEN_DIALOG({ id: ADVANCED_TAB_DIALOG, data });
289 interface AdvancedTabData {
291 metadata: ListResults<LinkResource> | string;
292 user: UserResource | string;
293 apiResponseKind: any;
294 data: AdvanceResponseData;
295 resourceKind: AdvanceResourceKind;
296 resourcePrefix: AdvanceResourcePrefix;
297 resourceKindProperty: AdvanceResourceKind;
301 const advancedTabData = ({ uuid, user, metadata, apiResponseKind, data, resourceKind, resourcePrefix, resourceKindProperty, property }: AdvancedTabData) => {
306 apiResponse: apiResponseKind(data),
307 pythonHeader: pythonHeader(resourceKind),
308 pythonExample: pythonExample(uuid, resourcePrefix),
309 cliGetHeader: cliGetHeader(resourceKind),
310 cliGetExample: cliGetExample(uuid, resourceKind),
311 cliUpdateHeader: cliUpdateHeader(resourceKind, resourceKindProperty),
312 cliUpdateExample: cliUpdateExample(uuid, resourceKind, property, resourceKindProperty),
313 curlHeader: curlHeader(resourceKind, resourceKindProperty),
314 curlExample: curlExample(uuid, resourcePrefix, property, resourceKind, resourceKindProperty),
318 const pythonHeader = (resourceKind: string) =>
319 `An example python command to get a ${resourceKind} using its uuid:`;
321 const pythonExample = (uuid: string, resourcePrefix: string) => {
322 const pythonExample = `import arvados
324 x = arvados.api().${resourcePrefix}().get(uuid='${uuid}').execute()`;
326 return pythonExample;
329 const cliGetHeader = (resourceKind: string) =>
330 `An example arv command to get a ${resourceKind} using its uuid:`;
332 const cliGetExample = (uuid: string, resourceKind: string) => {
333 const cliGetExample = `arv ${resourceKind} get \\
336 return cliGetExample;
339 const cliUpdateHeader = (resourceKind: string, resourceName: string) =>
340 `An example arv command to update the "${resourceName}" attribute for the current ${resourceKind}:`;
342 const cliUpdateExample = (uuid: string, resourceKind: string, resource: string | string[], resourceName: string) => {
343 const CLIUpdateCollectionExample = `arv ${resourceKind} update \\
345 --${resourceKind} '{"${resourceName}":${JSON.stringify(resource)}}'`;
347 return CLIUpdateCollectionExample;
350 const curlHeader = (resourceKind: string, resource: string) =>
351 `An example curl command to update the "${resource}" attribute for the current ${resourceKind}:`;
353 const curlExample = (uuid: string, resourcePrefix: string, resource: string | string[], resourceKind: string, resourceName: string) => {
354 const curlExample = `curl -X PUT \\
355 -H "Authorization: OAuth2 $ARVADOS_API_TOKEN" \\
356 --data-urlencode ${resourceKind}@/dev/stdin \\
357 https://$ARVADOS_API_HOST/arvados/v1/${resourcePrefix}/${uuid} \\
360 "${resourceName}": ${JSON.stringify(resource, null, 4)}
367 const stringify = (item: string | null | number | boolean) =>
368 JSON.stringify(item) || 'null';
370 const stringifyObject = (item: any) =>
371 JSON.stringify(item, null, 2) || 'null';
373 const containerRequestApiResponse = (apiResponse: ContainerRequestResource) => {
374 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, properties, state, requestingContainerUuid, containerUuid,
375 containerCountMax, mounts, runtimeConstraints, containerImage, environment, cwd, command, outputPath, priority, expiresAt, filters, containerCount,
376 useExisting, schedulingParameters, outputUuid, logUuid, outputName, outputTtl } = apiResponse;
379 "owner_uuid": "${ownerUuid}",
380 "created_at": "${createdAt}",
381 "modified_at": ${stringify(modifiedAt)},
382 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
383 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
384 "name": ${stringify(name)},
385 "description": ${stringify(description)},
386 "properties": ${stringifyObject(properties)},
387 "state": ${stringify(state)},
388 "requesting_container_uuid": ${stringify(requestingContainerUuid)},
389 "container_uuid": ${stringify(containerUuid)},
390 "container_count_max": ${stringify(containerCountMax)},
391 "mounts": ${stringifyObject(mounts)},
392 "runtime_constraints": ${stringifyObject(runtimeConstraints)},
393 "container_image": ${stringify(containerImage)},
394 "environment": ${stringifyObject(environment)},
395 "cwd": ${stringify(cwd)},
396 "command": ${stringifyObject(command)},
397 "output_path": ${stringify(outputPath)},
398 "priority": ${stringify(priority)},
399 "expires_at": ${stringify(expiresAt)},
400 "filters": ${stringify(filters)},
401 "container_count": ${stringify(containerCount)},
402 "use_existing": ${stringify(useExisting)},
403 "scheduling_parameters": ${stringifyObject(schedulingParameters)},
404 "output_uuid": ${stringify(outputUuid)},
405 "log_uuid": ${stringify(logUuid)},
406 "output_name": ${stringify(outputName)},
407 "output_ttl": ${stringify(outputTtl)}`;
409 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
412 const collectionApiResponse = (apiResponse: CollectionResource) => {
413 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, properties, portableDataHash, replicationDesired,
414 replicationConfirmedAt, replicationConfirmed, deleteAt, trashAt, isTrashed, storageClassesDesired,
415 storageClassesConfirmed, storageClassesConfirmedAt, currentVersionUuid, version, preserveVersion, fileCount, fileSizeTotal } = apiResponse;
418 "owner_uuid": "${ownerUuid}",
419 "created_at": "${createdAt}",
420 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
421 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
422 "modified_at": ${stringify(modifiedAt)},
423 "portable_data_hash": ${stringify(portableDataHash)},
424 "replication_desired": ${stringify(replicationDesired)},
425 "replication_confirmed_at": ${stringify(replicationConfirmedAt)},
426 "replication_confirmed": ${stringify(replicationConfirmed)},
427 "name": ${stringify(name)},
428 "description": ${stringify(description)},
429 "properties": ${stringifyObject(properties)},
430 "delete_at": ${stringify(deleteAt)},
431 "trash_at": ${stringify(trashAt)},
432 "is_trashed": ${stringify(isTrashed)},
433 "storage_classes_desired": ${JSON.stringify(storageClassesDesired, null, 2)},
434 "storage_classes_confirmed": ${JSON.stringify(storageClassesConfirmed, null, 2)},
435 "storage_classes_confirmed_at": ${stringify(storageClassesConfirmedAt)},
436 "current_version_uuid": ${stringify(currentVersionUuid)},
437 "version": ${version},
438 "preserve_version": ${preserveVersion},
439 "file_count": ${fileCount},
440 "file_size_total": ${fileSizeTotal}`;
442 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
445 const groupRequestApiResponse = (apiResponse: ProjectResource) => {
446 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, description, groupClass, trashAt, isTrashed, deleteAt, properties, writableBy } = apiResponse;
449 "owner_uuid": "${ownerUuid}",
450 "created_at": "${createdAt}",
451 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
452 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
453 "modified_at": ${stringify(modifiedAt)},
454 "name": ${stringify(name)},
455 "description": ${stringify(description)},
456 "group_class": ${stringify(groupClass)},
457 "trash_at": ${stringify(trashAt)},
458 "is_trashed": ${stringify(isTrashed)},
459 "delete_at": ${stringify(deleteAt)},
460 "properties": ${stringifyObject(properties)},
461 "writable_by": ${stringifyObject(writableBy)}`;
463 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
466 const repositoryApiResponse = (apiResponse: RepositoryResource) => {
467 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, cloneUrls } = apiResponse;
470 "owner_uuid": "${ownerUuid}",
471 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
472 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
473 "modified_at": ${stringify(modifiedAt)},
474 "name": ${stringify(name)},
475 "created_at": "${createdAt}",
476 "clone_urls": ${stringifyObject(cloneUrls)}`;
478 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
481 const sshKeyApiResponse = (apiResponse: SshKeyResource) => {
482 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, authorizedUserUuid, expiresAt } = apiResponse;
485 "owner_uuid": "${ownerUuid}",
486 "authorized_user_uuid": "${authorizedUserUuid}",
487 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
488 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
489 "modified_at": ${stringify(modifiedAt)},
490 "name": ${stringify(name)},
491 "created_at": "${createdAt}",
492 "expires_at": "${expiresAt}"`;
493 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
496 const virtualMachineApiResponse = (apiResponse: VirtualMachinesResource) => {
497 const { uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, hostname } = apiResponse;
499 "hostname": ${stringify(hostname)},
501 "owner_uuid": "${ownerUuid}",
502 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
503 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
504 "modified_at": ${stringify(modifiedAt)},
505 "modified_at": ${stringify(modifiedAt)},
506 "created_at": "${createdAt}"`;
508 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
511 const keepServiceApiResponse = (apiResponse: KeepServiceResource) => {
513 uuid, readOnly, serviceHost, servicePort, serviceSslFlag, serviceType,
514 ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid
518 "owner_uuid": "${ownerUuid}",
519 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
520 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
521 "modified_at": ${stringify(modifiedAt)},
522 "service_host": "${serviceHost}",
523 "service_port": "${servicePort}",
524 "service_ssl_flag": "${stringify(serviceSslFlag)}",
525 "service_type": "${serviceType}",
526 "created_at": "${createdAt}",
527 "read_only": "${stringify(readOnly)}"`;
529 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
532 const userApiResponse = (apiResponse: UserResource) => {
534 uuid, ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid,
535 email, firstName, lastName, username, isActive, isAdmin, prefs, defaultOwnerUuid,
539 "owner_uuid": "${ownerUuid}",
540 "created_at": "${createdAt}",
541 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
542 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
543 "modified_at": ${stringify(modifiedAt)},
545 "first_name": "${firstName}",
546 "last_name": "${stringify(lastName)}",
547 "username": "${username}",
548 "is_active": "${isActive},
549 "is_admin": "${isAdmin},
550 "prefs": "${stringifyObject(prefs)},
551 "default_owner_uuid": "${defaultOwnerUuid},
552 "username": "${username}"`;
554 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
557 const apiClientAuthorizationApiResponse = (apiResponse: ApiClientAuthorization) => {
559 uuid, ownerUuid, apiToken, apiClientId, userId, createdByIpAddress, lastUsedByIpAddress,
560 lastUsedAt, expiresAt, defaultOwnerUuid, scopes, updatedAt, createdAt
564 "owner_uuid": "${ownerUuid}",
565 "api_token": "${stringify(apiToken)}",
566 "api_client_id": "${stringify(apiClientId)}",
567 "user_id": "${stringify(userId)}",
568 "created_by_ip_address": "${stringify(createdByIpAddress)}",
569 "last_used_by_ip_address": "${stringify(lastUsedByIpAddress)}",
570 "last_used_at": "${stringify(lastUsedAt)}",
571 "expires_at": "${stringify(expiresAt)}",
572 "created_at": "${stringify(createdAt)}",
573 "updated_at": "${stringify(updatedAt)}",
574 "default_owner_uuid": "${stringify(defaultOwnerUuid)}",
575 "scopes": "${JSON.stringify(scopes, null, 2)}"`;
577 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;
580 const linkApiResponse = (apiResponse: LinkResource) => {
582 uuid, name, headUuid, properties, headKind, tailUuid, tailKind, linkClass,
583 ownerUuid, createdAt, modifiedAt, modifiedByClientUuid, modifiedByUserUuid
588 "head_uuid": "${headUuid}",
589 "head_kind": "${headKind}",
590 "tail_uuid": "${tailUuid}",
591 "tail_kind": "${tailKind}",
592 "link_class": "${linkClass}",
593 "owner_uuid": "${ownerUuid}",
594 "created_at": "${stringify(createdAt)}",
595 "modified_at": ${stringify(modifiedAt)},
596 "modified_by_client_uuid": ${stringify(modifiedByClientUuid)},
597 "modified_by_user_uuid": ${stringify(modifiedByUserUuid)},
598 "properties": "${JSON.stringify(properties, null, 2)}"`;
600 return <span style={{ marginLeft: '-15px' }}>{'{'} {response} {'\n'} <span style={{ marginLeft: '-15px' }}>{'}'}</span></span>;