Skip to content

Commit

Permalink
runs ui
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Jan 16, 2025
1 parent b202de6 commit 558acb1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js_modules/dagster-ui/packages/ui-core/client.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const RUN_FRAGMENT = gql`
repositoryName
repositoryLocationName
}
allConcurrencyKeys
hasReExecutePermission
hasTerminatePermission
hasDeletePermission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {RunMetricsDialog} from 'shared/runs/RunMetricsDialog.oss';
import {DeletionDialog} from './DeletionDialog';
import {QueuedRunCriteriaDialog} from './QueuedRunCriteriaDialog';
import {RunConfigDialog} from './RunConfigDialog';
import {RunPoolsDialog} from './RunPoolsDialog';
import {doneStatuses} from './RunStatuses';
import {RunsQueryRefetchContext} from './RunUtils';
import {TerminationDialog} from './TerminationDialog';
Expand All @@ -30,6 +31,7 @@ type VisibleDialog =
| 'queue-criteria'
| 'free_slots'
| 'metrics'
| 'pools'
| null;

export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean}) => {
Expand Down Expand Up @@ -93,6 +95,11 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean
<Button icon={<Icon name="tag" />} onClick={() => setVisibleDialog('config')}>
View tags and config
</Button>
{run.allConcurrencyKeys && run.allConcurrencyKeys.length ? (
<Tooltip content="View pools" position="top" targetTagName="div">
<Button icon={<Icon name="concurrency" />} onClick={() => setVisibleDialog('pools')} />
</Tooltip>
) : null}
<Popover
position="bottom-right"
content={
Expand Down Expand Up @@ -204,6 +211,13 @@ export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean
selectedRuns={{[run.id]: run.canTerminate}}
/>
) : null}
{run.allConcurrencyKeys && run.allConcurrencyKeys.length ? (
<RunPoolsDialog
isOpen={visibleDialog === 'pools'}
pools={run.allConcurrencyKeys}
onClose={() => setVisibleDialog(null)}
/>
) : null}
</div>
);
};
28 changes: 28 additions & 0 deletions js_modules/dagster-ui/packages/ui-core/src/runs/RunPoolsDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {Box, Button, Dialog, DialogFooter} from '@dagster-io/ui-components';

import {PoolTag} from '../instance/PoolTag';

export const RunPoolsDialog = ({
isOpen,
onClose,
pools,
}: {
isOpen: boolean;
onClose: () => void;
pools: string[];
}) => {
return (
<Dialog isOpen={isOpen} onClose={onClose} canOutsideClickClose canEscapeKeyClose title="Pools">
<Box margin={{horizontal: 24, vertical: 12}} flex={{gap: 12}}>
{pools.map((pool) => (
<PoolTag key={pool} pool={pool} />
))}
</Box>
<DialogFooter topBorder>
<Button onClick={onClose} intent="primary">
Close
</Button>
</DialogFooter>
</Dialog>
);
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 558acb1

Please sign in to comment.