diff --git a/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx b/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx index 11faf7c1..dc787b6c 100644 --- a/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx +++ b/cmd/relay/relay-admin-ui/src/components/Dash/Dash.tsx @@ -63,12 +63,6 @@ const Dash: FC<{}> = () => { const [modalConfirm, setModalConfirm] = useState<() => void>(() => { }); const [modalCancel, setModalCancel] = useState<() => void>(() => { }); - const [editingPerSecondRateLimit, setEditingPerSecondRateLimimt] = - useState(null); - const [editingPerHourRateLimit, setEditingPerHourRateLimit] = - useState(null); - const [editingPerDayRateLimit, setEditingPerDayRateLimit] = - useState(null); const [editingRepoLimit, setEditingRepoLimit] = useState(null); @@ -1000,178 +994,16 @@ const Dash: FC<{}> = () => { {pds.Cursor?.toLocaleString()} - - {pds.PerSecondEventRate.Max?.toLocaleString()} - /sec - - - setEditingPerSecondRateLimimt(pds)} - className={editingPerSecondRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-second-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerSecondEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerSecondRateLimimt(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerSecondRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerSecondEventRate.Max?.toLocaleString()} + /sec - - {pds.PerHourEventRate.Max?.toLocaleString()} - /hour - - - setEditingPerHourRateLimit(pds)} - className={editingPerHourRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-hour-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerHourEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerHourRateLimit(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerHourRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerHourEventRate.Max?.toLocaleString()} + /sec - - {pds.PerDayEventRate.Max?.toLocaleString()} - /day - - - setEditingPerDayRateLimit(pds)} - className={editingPerDayRateLimit ? "hidden" : ""} - > - - { - const newRateLimit = document.getElementById( - `per-day-rate-limit-${pds.ID}` - ) as HTMLInputElement; - if (newRateLimit) { - pds.PerDayEventRate.Max = +newRateLimit.value; - updateRateLimits(pds); - } - setEditingPerDayRateLimit(null); - }} - className={ - "rounded-md p-2 ml-1 hover:text-green-600 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50" + - (editingPerDayRateLimit?.ID === pds.ID - ? "" - : " hidden") - } - > - + {pds.PerDayEventRate.Max?.toLocaleString()} + /sec