This repository was archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Enable data synchronization from the UI #98
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2d61752
Sync data from the UI
Ehevi d0a9974
Cleanup :broom:
Ehevi 1ca1d06
Cleanup
Ehevi c20790e
Typo fix
Ehevi 4949b3f
Fix typos
Ehevi 3ce878e
Cleanup
Ehevi 5131c35
Cleanup
Ehevi 73638c2
Test cleanup :broom:
Ehevi 3a673df
Address review comments
Ehevi c3a9d43
Update the periods view test
Ehevi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| * See http://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| * All rights not expressly granted are reserved. | ||
| * | ||
| * This software is distributed under the terms of the GNU General Public | ||
| * License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| * | ||
| * In applying this license CERN does not waive the privileges and immunities | ||
| * granted to it by virtue of its status as an Intergovernmental Organization | ||
| * or submit itself to any jurisdiction. | ||
| */ | ||
|
|
||
| import { h } from '/js/src/index.js'; | ||
| import { RCT } from '../../../../config.js'; | ||
| const { pagesNames } = RCT; | ||
|
|
||
| function useState(defaultValue) { | ||
| let value = defaultValue; | ||
|
|
||
| function getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| function setValue(newValue) { | ||
| value = newValue; | ||
| } | ||
|
|
||
| return [getValue, setValue]; | ||
| } | ||
|
|
||
| const modes = { | ||
| requested: 0, | ||
| waiting: 1, | ||
| }; | ||
|
|
||
| export default function noDataView( | ||
| model, dataPointer, | ||
| ) { | ||
| const [mode, setMode] = useState(modes.waiting); | ||
| const goBackBtn = h('button.btn.btn-primary.m3', { | ||
| onclick: () => model.removeCurrentData(), | ||
| }, 'Go back'); | ||
| const reloadBtn = h('button.btn.btn-primary.m3', { | ||
| onclick: async () => { | ||
| if (mode() === modes.waiting) { | ||
| await model.sync(); | ||
|
|
||
| /* | ||
| * Await model.fetchedData.reqForData(true); | ||
| * model.notify(); | ||
| * document.location.reload(true); | ||
| */ | ||
| } else { | ||
| model.fetchedData.reqForData(true); | ||
| } | ||
| setMode(modes.requested); | ||
| }, | ||
| }, 'Reload'); | ||
| const noDataMessage = h('h3', 'No data found'); | ||
| const noDataExplanation = h('h5', `${ | ||
| dataPointer.page === pagesNames.periods | ||
| ? 'Please sysnchronize with outer services' | ||
| : 'There is no data to be displayed here' | ||
| }`); | ||
|
|
||
| const noPeriodsView = h('.loginDiv.top-100', [ | ||
| h('.synchronize-90'), | ||
| noDataMessage, | ||
| noDataExplanation, | ||
| reloadBtn, | ||
| ]); | ||
|
|
||
| const noDataView = h('.loginDiv.top-100', [ | ||
| h('.nothing-found-90'), | ||
| noDataMessage, | ||
| noDataExplanation, | ||
| goBackBtn, | ||
| ]); | ||
|
|
||
| return dataPointer.page === pagesNames.periods | ||
| ? mode() === modes.requested | ||
| ? 'loading' | ||
| : noPeriodsView | ||
| : noDataView; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,71 @@ | ||
| ENV_MODE=test | ||
| RUNNING_ENV=DOCKER | ||
|
|
||
| ## logger | ||
| RCT_LOG_FILENAME=${RCT_LOG_FILENAME:-reports/rctlogs.txt} | ||
| RCT_LOG_FILE_LOGLEV=${RCT_LOG_FILE_LOGLEV:-warn} | ||
| RCT_LOG_CONSOLE_LOGLEV=${RCT_LOG_CONSOLE_LOGLEV:-debug} | ||
| RCT_LOG_CONSOLE_SYSD=${RCT_LOG_CONSOLE_SYSD:-} | ||
|
|
||
| ## http server | ||
| RCT_HTTP_PORT=8081 | ||
| RCT_HOSTNAME=localhost | ||
| RCT_TLS_ENABLED=false | ||
|
|
||
| RCT_JWT_SECRET=secret | ||
| RCT_JWT_EXPIRATION=12h | ||
|
|
||
| ## external services connections | ||
| CERN_SOCKS=false | ||
| RCT_SYNC_TASK_AT_START=false | ||
|
|
||
| ## database configuration | ||
| ### general | ||
| RCT_DB_HOST=database | ||
| RCT_DB_NAME=rct-db | ||
| RCT_DB_PORT=5432 | ||
| RCT_DB_USERNAME=rct-user | ||
| RCT_DB_PASSWORD=rct-passwd | ||
| MOCK_DB=${MOCK_DB:-true} | ||
|
|
||
| CERN_SOCKS=false | ||
|
|
||
| RCT_SYNC_TASK_AT_START=false | ||
|
|
||
|
|
||
| ### docker container postgres configuration | ||
| POSTGRES_PASSWORD=postgres | ||
| POSTGRES_USER=postgres | ||
| POSTGRES_DB=postgres | ||
| PGDATA=/var/lib/postgresql/data/pgdata | ||
| POSTGRES_HOST_AUTH_METHOD=md5 | ||
| POSTGRES_HOST_AUTH_METHOD=md5 | ||
|
|
||
| ### endpoints | ||
| _DEF_BK_HOST=ali-bookkeeping.cern.ch | ||
| _DEF_ML_HOST=alimonitor.cern.ch | ||
| _DEF_ML_PROT=https | ||
|
|
||
| ### bkp | ||
| RCT_EP_BK_RUNS_PROT=https | ||
| RCT_EP_BK_RUNS_HOST=${RCT_EP_BK_RUNS_HOST:-$_DEF_BK_HOST} | ||
| RCT_EP_BK_RUNS_PATH=${RCT_EP_BK_RUNS_PATH:-/api/runs?filter[definitions]=PHYSICS} | ||
|
|
||
|
|
||
| ### data passes | ||
| RCT_EP_ML_DP_RAW_PROT=$_DEF_ML_PROT | ||
| RCT_EP_ML_DP_RAW_HOST=${RCT_EP_ML_DP_RAW_HOST:-$_DEF_ML_HOST} | ||
| RCT_EP_ML_DP_RAW_PATH=${RCT_EP_ML_DP_RAW_PATH:-/production/raw.jsp?res_path=json} | ||
|
|
||
|
|
||
| RCT_EP_ML_DP_DET_PROT=$_DEF_ML_PROT | ||
| RCT_EP_ML_DP_DET_HOST=${RCT_EP_ML_DP_DET_HOST:-$_DEF_ML_HOST} | ||
| RCT_EP_ML_DP_DET_PATH=${RCT_EP_ML_DP_DET_PATH:-/raw/raw_details.jsp?timesel=0&res_path=json} | ||
|
|
||
|
|
||
| ### simulation passes | ||
| RCT_EP_ML_MC_RAW_PROT=$_DEF_ML_PROT | ||
| RCT_EP_ML_MC_RAW_HOST=${RCT_EP_ML_MC_RAW_HOST:-$_DEF_ML_HOST} | ||
| RCT_EP_ML_MC_RAW_PATH=${RCT_EP_ML_MC_RAW_PATH:-/MC/?res_path=json} | ||
|
|
||
| RCT_EP_ML_MC_DET_PROT=$_DEF_ML_PROT | ||
| RCT_EP_ML_MC_DET_HOST=${RCT_EP_ML_MC_DET_HOST:-$_DEF_ML_HOST} | ||
| RCT_EP_ML_MC_DET_PATH=${RCT_EP_ML_MC_DET_PATH:-/job_events.jsp?timesel=0&res_path=json} | ||
|
|
||
| RCT_EP_ML_MC_TAG_PROT=$_DEF_ML_PROT | ||
| RCT_EP_ML_MC_TAG_HOST=${RCT_EP_ML_MC_TAG_HOST:-$_DEF_ML_HOST} | ||
| RCT_EP_ML_MC_TAG_PATH=${RCT_EP_ML_MC_TAG_PATH:-/MC/prodDetails.jsp?res_path=json} | ||
xsalonx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.