Skip to content
1 change: 1 addition & 0 deletions airflow-core/src/airflow/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"axios": "^1.8.4",
"chakra-react-select": "6.1.0",
"chart.js": "^4.4.9",
"chartjs-adapter-dayjs-4": "^1.0.4",
"chartjs-plugin-annotation": "^3.1.0",
"dayjs": "^1.11.13",
"debounce-promise": "^3.1.2",
Expand Down
15 changes: 15 additions & 0 deletions airflow-core/src/airflow/ui/pnpm-lock.yaml

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 @@ -65,6 +65,7 @@
"panel": {
"buttons": {
"options": "Options",
"showGantt": "Show Gantt",
"showGraph": "Show Graph",
"showGrid": "Show Grid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"panel": {
"buttons": {
"options": "選項",
"showGantt": "顯示甘特圖",
"showGraph": "顯示圖表",
"showGrid": "顯示網格"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { Tooltip } from "src/components/ui/Tooltip";
import { OpenGroupsProvider } from "src/context/openGroups";

import { DagBreadcrumb } from "./DagBreadcrumb";
import { Gantt } from "./Gantt/Gantt";
import { Graph } from "./Graph";
import { Grid } from "./Grid";
import { NavTabs } from "./NavTabs";
Expand All @@ -52,12 +53,14 @@ type Props = {

export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => {
const { t: translate } = useTranslation();
const { dagId = "" } = useParams();
const { dagId = "", runId } = useParams();
const { data: dag } = useDagServiceGetDag({ dagId });
const [defaultDagView] = useLocalStorage<"graph" | "grid">("default_dag_view", "grid");
const panelGroupRef = useRef(null);
const [dagView, setDagView] = useLocalStorage<"graph" | "grid">(`dag_view-${dagId}`, defaultDagView);
const [limit, setLimit] = useLocalStorage<number>(`dag_runs_limit-${dagId}`, 10);

const [showGantt, setShowGantt] = useLocalStorage<boolean>(`show_gantt-${dagId}`, true);
const { fitView, getZoom } = useReactFlow();
const { data: warningData } = useDagWarningServiceListDagWarnings({ dagId });
const { onClose, onOpen, open } = useDisclosure();
Expand Down Expand Up @@ -110,16 +113,30 @@ export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => {
key={`${dagView}-${direction}`}
ref={panelGroupRef}
>
<Panel defaultSize={dagView === "graph" ? 70 : 20} id="main-panel" minSize={6} order={1}>
<Panel
defaultSize={dagView === "graph" ? 70 : 20}
id="main-panel"
minSize={showGantt && dagView === "grid" && Boolean(runId) ? 30 : 6}
order={1}
>
<Box height="100%" marginInlineEnd={2} overflowY="auto" position="relative">
<PanelButtons
dagView={dagView}
limit={limit}
panelGroupRef={panelGroupRef}
setDagView={setDagView}
setLimit={setLimit}
setShowGantt={setShowGantt}
showGantt={showGantt}
/>
{dagView === "graph" ? <Graph /> : <Grid limit={limit} />}
{dagView === "graph" ? (
<Graph />
) : (
<HStack gap={0}>
<Grid limit={limit} showGantt={Boolean(runId) && showGantt} />
{showGantt ? <Gantt limit={limit} /> : undefined}
</HStack>
)}
</Box>
</Panel>
{!isRightPanelCollapsed && (
Expand Down
Loading
Loading