mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
Merge branch 'feature/dataLogPage' into 'main'
Feature/data log page See merge request apipark/APIPark!120
This commit is contained in:
@@ -38,33 +38,32 @@ const TimeRangeSelector = (props: TimeRangeSelectorProps) => {
|
||||
}, [bindRef])
|
||||
// 根据选择的时间范围计算开始和结束时间
|
||||
const calculateTimeRange = (curBtn: 'hour' | 'day' | 'threeDays' | 'sevenDays') => {
|
||||
const currentSecond = new Date().getTime() // 当前毫秒数时间戳
|
||||
const currentMin = currentSecond - (currentSecond % (60 * 1000)) // 当前分钟数时间戳
|
||||
let startMin = currentMin - 60 * 60 * 1000
|
||||
const currentSecond = Math.floor(Date.now() / 1000); // 当前秒级时间戳
|
||||
let startMin = currentSecond - 60 * 60
|
||||
switch (curBtn) {
|
||||
case 'hour': {
|
||||
startMin = currentMin - 60 * 60 * 1000
|
||||
startMin = currentSecond - 60 * 60
|
||||
break
|
||||
}
|
||||
case 'day': {
|
||||
startMin = currentMin - 24 * 60 * 60 * 1000
|
||||
startMin = currentSecond - 24 * 60 * 60
|
||||
break
|
||||
}
|
||||
case 'threeDays': {
|
||||
startMin =
|
||||
new Date(new Date().setHours(0, 0, 0, 0)).getTime() -
|
||||
2 * 24 * 60 * 60 * 1000
|
||||
Math.floor(new Date().setHours(0, 0, 0, 0) / 1000) -
|
||||
2 * 24 * 60 * 60
|
||||
break
|
||||
}
|
||||
case 'sevenDays': {
|
||||
startMin =
|
||||
new Date(new Date().setHours(0, 0, 0, 0)).getTime() -
|
||||
6 * 24 * 60 * 60 * 1000
|
||||
Math.floor(new Date().setHours(0, 0, 0, 0) / 1000) -
|
||||
6 * 24 * 60 * 60
|
||||
break
|
||||
}
|
||||
}
|
||||
if (onTimeRangeChange) {
|
||||
onTimeRangeChange({ start: startMin / 1000, end: currentMin / 1000 });
|
||||
onTimeRangeChange({ start: startMin, end: currentSecond });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ export const AiServiceSubscriberConfig = forwardRef<AiServiceSubscriberConfigHan
|
||||
getAiServiceList()
|
||||
}, [serviceId]);
|
||||
|
||||
return (<WithPermission access="team.service.subscription.add">
|
||||
return (<WithPermission access="">
|
||||
<Form
|
||||
layout='vertical'
|
||||
labelAlign='left'
|
||||
|
||||
@@ -14,16 +14,15 @@ import { useFetch } from '@common/hooks/http';
|
||||
import TimeRangeSelector, { TimeRange } from '@common/components/aoplatform/TimeRangeSelector';
|
||||
import { SearchBody } from '@dashboard/const/type';
|
||||
import TableBtnWithPermission from '@common/components/aoplatform/TableBtnWithPermission';
|
||||
import { getTime } from '@dashboard/utils/dashboard';
|
||||
const DataMaskingLogModal = (props: any) => {
|
||||
const { strategy } = props;
|
||||
const { state, accessData } = useGlobalContext()
|
||||
const { serviceId, teamId } = useParams<RouterParams>()
|
||||
const [datePickerValue, setDatePickerValue] = useState<any>();
|
||||
const defaultTime = getTime('hour', datePickerValue)
|
||||
const currentSecond = Math.floor(Date.now() / 1000); // 当前秒级时间戳
|
||||
const [queryData, setQueryData] = useState<SearchBody>({
|
||||
start: defaultTime.startTime,
|
||||
end: defaultTime.endTime
|
||||
start: currentSecond - 60 * 60,
|
||||
end: currentSecond
|
||||
})
|
||||
/**
|
||||
* 请求数据
|
||||
|
||||
@@ -239,7 +239,7 @@ export const SystemSubscriberConfig = forwardRef<SystemSubscriberConfigHandle,Sy
|
||||
getSystemList()
|
||||
}, [serviceId]);
|
||||
|
||||
return (<WithPermission access="team.service.subscription.add">
|
||||
return (<WithPermission access="">
|
||||
<Form
|
||||
layout='vertical'
|
||||
labelAlign='left'
|
||||
|
||||
Reference in New Issue
Block a user