Skip to content

Commit

Permalink
add a permalink button to copy cost url with params / daterange (#6052)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdvr authored Dec 13, 2024
1 parent 6c5ce24 commit 932c26b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion torchci/pages/cost_analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from "@mui/material";
import { DatePicker, LocalizationProvider } from "@mui/x-date-pickers";
import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
import CopyLink from "components/CopyLink";
import TimeSeriesPanel, {
ChartType,
Granularity,
Expand Down Expand Up @@ -580,19 +581,33 @@ export default function Page() {
);
};

// get full url if router is ready
const fullUrl = routerReady
? `${window.location.origin}${router.asPath}`
: "";

return (
<div>
<Stack direction="row" spacing={2} sx={{ mb: 2 }}>
<Typography fontSize={"2rem"} fontWeight={"bold"}>
PyTorch CI Cost & Runtime Analytics
</Typography>

<Tooltip title="This page gives an estimate of cost and duration of CI jobs. Note: prices are list prices for the providers and may not reflect actual costs.">
<Typography fontSize={"1rem"} fontWeight={"bold"}>
<FaInfoCircle />
</Typography>
</Tooltip>
<CopyLink
textToCopy={fullUrl}
link={true}
compressed={false}
style={{
fontSize: "1rem",
borderRadius: 10,
}}
/>
</Stack>

<Grid container spacing={2}>
<Grid item xs={8}>
<DateRangePicker
Expand Down

0 comments on commit 932c26b

Please sign in to comment.