1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { dialogActions } from '~/store/dialog/dialog-actions';
6 import { RootState } from '../store';
7 import { Dispatch } from 'redux';
8 import { getProcess } from '~/store/processes/process';
9 import { quote } from 'shell-quote';
11 export const PROCESS_COMMAND_DIALOG_NAME = 'processCommandDialog';
13 export interface ProcessCommandDialogData {
18 export const openProcessCommandDialog = (processUuid: string) =>
19 (dispatch: Dispatch<any>, getState: () => RootState) => {
20 const process = getProcess(processUuid)(getState().resources);
22 const data: ProcessCommandDialogData = {
23 command: quote(process.containerRequest.command),
24 processName: process.containerRequest.name,
26 dispatch(dialogActions.OPEN_DIALOG({ id: PROCESS_COMMAND_DIALOG_NAME, data }));