Skip to content

Commit

Permalink
Back to limiting waveform query duration to 1 hour
Browse files Browse the repository at this point in the history
  • Loading branch information
bclswl0827 committed Mar 5, 2024
1 parent a98cab6 commit 35beebc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 29 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Starting from v2.2.5, all notable changes to this project will be documented in this file.

## v2.10.2

- Input component optimization
- Back to limiting waveform query duration to 1 hour

## v2.10.1

- Support download SeisComP3 XML inventory directly from the frontend
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.10.1
v2.10.2
6 changes: 3 additions & 3 deletions app/v1/history/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package history
import "time"

const (
JSON_DURATION = time.Hour * 24 // The maximum duration of the JSON data to be exported
SAC_DURATION = time.Hour // The maximum duration of the SAC data to be exported
THRESHOLD = time.Minute // There are uneven gaps between the data if time difference is greater than THRESHOLD
JSON_DURATION = time.Hour // The maximum duration of the JSON data to be exported
SAC_DURATION = time.Hour // The maximum duration of the SAC data to be exported
THRESHOLD = time.Minute // There are uneven gaps between the data if time difference is greater than THRESHOLD
)

type History struct{}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_VERSION=v2.10.1
REACT_APP_RELEASE=f4439441-20240305224739
REACT_APP_VERSION=v2.10.2
REACT_APP_RELEASE=a98cab67-20240306000257
40 changes: 17 additions & 23 deletions frontend/src/src/components/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { TextField } from "@mui/material";
import { ChangeEvent, InputHTMLAttributes } from "react";
import { userThrottle } from "../helpers/utils/userThrottle";

interface InputProps {
readonly label: string;
Expand All @@ -23,34 +22,29 @@ export const Input = (props: InputProps) => {
onValueChange,
} = props;

const handleOnChange = userThrottle(
({ target }: ChangeEvent<HTMLTextAreaElement>) => {
if (!onValueChange) {
const handleOnChange = ({ target }: ChangeEvent<HTMLTextAreaElement>) => {
if (!onValueChange) {
return;
}
const { value } = target;
if (type === "number") {
const numberValue = Number(value);
if (isNaN(numberValue)) {
onValueChange(defaultValue);
return;
}
const { value } = target;
if (type === "number") {
const numberValue = Number(value);
if (isNaN(numberValue)) {
target.value = defaultValue.toString();
if (numberLimit) {
const { max, min } = numberLimit;
if (numberValue > max || numberValue < min) {
onValueChange(defaultValue);
return;
}
if (numberLimit) {
const { max, min } = numberLimit;
if (numberValue > max || numberValue < min) {
target.value = defaultValue.toString();
onValueChange(defaultValue);
return;
}
}
onValueChange(numberValue);
} else {
onValueChange(value);
}
},
1000
);
onValueChange(numberValue);
} else {
onValueChange(value);
}
};

return (
<TextField
Expand Down

0 comments on commit 35beebc

Please sign in to comment.