Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add serverless monitoring #1462

Merged
merged 10 commits into from
Feb 1, 2023
2 changes: 1 addition & 1 deletion ui/packages/tidb-dashboard-for-dbaas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pingcap/tidb-dashboard-for-dbaas",
"version": "0.0.59",
"version": "0.0.60",
"main": "dist/main.js",
"module": "dist/main.js",
"files": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,22 @@ export const LimitTimeRange: React.FC<LimitTimeRangeProps> = ({
}, [recent_seconds])

const disabledDate = (current) => {
const today = dayjs().startOf('hour')
const todayStartWithHour = dayjs().startOf('hour')
const todayStartWithDay = dayjs().startOf('day')
const todayEndWidthDay = dayjs().endOf('day')

// Can not select days before 2 days ago
const tooEarly =
today.subtract(selectableHours, 'hour') > dayjs(current).startOf('hour')
todayStartWithHour.subtract(selectableHours, 'hour') >
dayjs(current).startOf('hour') &&
todayStartWithDay.subtract(selectableHours / 24, 'day') >
dayjs(current).startOf('day')

// Can not select days after today
const tooLate = today < dayjs(current).startOf('hour')
const tooLate =
todayStartWithHour < dayjs(current).startOf('hour') &&
todayEndWidthDay < dayjs(current).endOf('day')

return current && (tooEarly || tooLate)
}

Expand Down