Skip to content

Commit

Permalink
runs ui
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Jan 22, 2025
1 parent 6a319db commit 30ce73f
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 7 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 @@ -19,17 +19,18 @@ export const PoolTag = ({pool}: {pool: string}) => {
},
);

const concurrencyLimit = data?.instance.concurrencyLimit;
return (
<Tag>
<Tag intent={concurrencyLimit && concurrencyLimit.limit === null ? 'warning' : 'none'}>
<Box flex={{gap: 4, alignItems: 'center'}}>
<Icon name="dynamic_feed" />
<Link to={path}>{pool}</Link>
{data?.instance.concurrencyLimit && data.instance.concurrencyLimit.limit === null ? (
{concurrencyLimit && concurrencyLimit.limit === null ? (
<Tooltip
placement="top"
content="This pool currently does not have any slots configured."
>
<Icon name="check_warning" />
<Icon name="warning_outline" />
</Tooltip>
) : null}
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const RUN_FRAGMENT = gql`
repositoryName
repositoryLocationName
}
allPools
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.allPools && run.allPools.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.allPools && run.allPools.length ? (
<RunPoolsDialog
isOpen={visibleDialog === 'pools'}
pools={run.allPools}
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 30ce73f

Please sign in to comment.