Add the force update for disabled live update

This commit is contained in:
nabenabe0928
2024-01-19 09:01:15 +01:00
parent a2cf3ebd54
commit 78e1e11802
3 changed files with 10 additions and 4 deletions
+2 -1
View File
@@ -192,7 +192,7 @@ def create_app(
@json_api_view
def get_study_detail(study_id: int) -> dict[str, Any]:
# Use the following default values if not specified in request.params.
query_params = dict(after=0, limit=1000)
query_params = dict(after=0, limit=2000)
for query_key in query_params:
try:
query_params[query_key] = int(request.params[query_key])
@@ -235,6 +235,7 @@ def create_app(
plotly_graph_objects = get_plotly_graph_objects(system_attrs)
skipped_trial_ids = get_skipped_trial_ids(system_attrs)
skipped_trial_numbers = [t.number for t in trials if t._trial_id in skipped_trial_ids]
limit = len(trials) if limit == 0 else limit
fetched_trials_partially = after + limit < len(trials)
return serialize_study_detail(
summary,
+2 -2
View File
@@ -235,9 +235,9 @@ export const actionCreator = () => {
})
}
const updateStudyDetail = (studyId: number) => {
const updateStudyDetail = (studyId: number, forceFetchAllTrials: boolean = false) => {
let nLocalFixedTrials = 0
const nMaximumTrialsAtOnce = 2000
const nMaximumTrialsAtOnce = forceFetchAllTrials ? 0 : 2000
if (studyId in studyDetails) {
const currentTrials = studyDetails[studyId].trials
const firstUpdatable = currentTrials.findIndex((trial) =>
+6 -1
View File
@@ -310,7 +310,12 @@ export const AppDrawer: FC<{
<ListItemButton
sx={styleListItemButton}
onClick={() => {
action.saveReloadInterval(reloadInterval === -1 ? 10 : -1)
const newReloadInterval = reloadInterval === -1 ? 10 : -1
action.saveReloadInterval(newReloadInterval)
if (newReloadInterval === -1) {
const forceFetchAllTrials = true
action.updateStudyDetail(studyId, forceFetchAllTrials)
}
}}
>
<ListItemIcon sx={styleListItemIcon}>