Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { buildPublicConfig } = require('./lib/config/publicConfigProvider.js');

// IO
const readline = require('readline');
const Utils = require('./lib/Utils.js');
const Utils = require('./lib/utils');
const { Console } = require('node:console');

// Services
Expand All @@ -28,7 +28,7 @@ const services = require('./lib/alimonitor-services');
const database = require('./lib/database');

// Server
const { webUiServer } = require('./server/index.js');
const { webUiServer } = require('./lib/server');

// Extract important
const EP = config.public.endpoints;
Expand Down
73 changes: 0 additions & 73 deletions app/config/databasePersistance.js

This file was deleted.

4 changes: 2 additions & 2 deletions app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
const ResProvider = require('../lib/ResProvider.js');
const { ResProvider } = require('../lib/utils');

module.exports = Object.freeze({
// Web-Ui config
Expand All @@ -23,7 +23,7 @@ module.exports = Object.freeze({
winston: ResProvider.winston(),
database: ResProvider.database(),
syncTaskAtStart: ResProvider.envOrDef('RCT_SYNC_TASK_AT_START', false, Boolean),
databasePersistance: require('./databasePersistance.js'),
rctData: require('./rct-data'),
public: require('./public.js'),

// External services config
Expand Down
84 changes: 10 additions & 74 deletions app/config/public.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,53 +12,19 @@
* or submit itself to any jurisdiction.
*/

const detectors = require('./detectors.js');
const matchExcludeType = 'matchexclude';
const fromToType = 'fromto';

const matchExcludeType = 'match-exclude-type';
const fromToType = 'from-to-type';

const runsViewsFilteringTypes = {
name: matchExcludeType,
run_number: fromToType,
time_start: fromToType,
time_end: fromToType,
time_trg_start: fromToType,
time_trg_end: fromToType,
l3_current: fromToType,
dipole_current: fromToType,
energy_per_beam: fromToType,
ir: fromToType,
filling_scheme: fromToType,
triggers_conf: matchExcludeType,
fill_number: fromToType,
run_type: matchExcludeType,
mu: matchExcludeType,
center_of_mass_energy: fromToType,
};

const dataPassesViews = {
name: matchExcludeType,
description: matchExcludeType,
pass_type: matchExcludeType,
jira: matchExcludeType,
ml: matchExcludeType,
number_of_events: fromToType,
software_version: matchExcludeType,
size: fromToType,
};

const mcViews = {
name: matchExcludeType,
description: matchExcludeType,
jira: matchExcludeType,
ml: matchExcludeType,
pwg: matchExcludeType,
number_of_events: fromToType,
};
const { roles, flags: flagsTypes, detectors } = require('./rct-data');

module.exports = { // Properties that will be provided to frontend in the public folder
roles: require('./roles.js'),
flagsTypes: require('./flagsDefinitions.json'),
filterTypes: {
matchExcludeType,
fromToType,
},

roles,
flagsTypes,
endpoints: {
login: '/login/',
logout: '/logout/',
Expand Down Expand Up @@ -107,36 +73,6 @@ module.exports = { // Properties that will be provided to frontend in the public
verification_insert: 'verification_insert',
},

filteringParams: {
types: {
matchExcludeType: matchExcludeType,
fromToType: fromToType,
},
pages: {
periods: {
name: matchExcludeType,
year: fromToType,
beam: matchExcludeType,
energy: fromToType,
},
runsPerPeriod: runsViewsFilteringTypes,
mc: mcViews,
anchoredPerMC: dataPassesViews,
anchoragePerDatapass: mcViews,
dataPasses: dataPassesViews,
runsPerDataPass: runsViewsFilteringTypes,

flags: {
start: fromToType,
end: fromToType,
flag: matchExcludeType,
comment: matchExcludeType,
production_id: fromToType,
name: matchExcludeType,
},
},

},
detectors: detectors,
themes: {
ehevi: 'ehevi',
Expand Down
25 changes: 25 additions & 0 deletions app/config/rct-data/beamTypesMappings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* @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.
*/

const beamTypesMappings = {
pp: 'p-p',
nn: 'n-n',
XeXe: 'Xe-Xe',
PbPb: 'Pb-Pb',
pPb: 'p-Pb',
Pbp: 'p-Pb',
pA: 'p-A',
};

module.exports = beamTypesMappings;
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const detectors = [
'CPV',
'EMC',
Expand Down
41 changes: 41 additions & 0 deletions app/config/rct-data/healthcheckQueries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @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.
*/

const detectors = require('./detectors.js').sort();
const flags = require('./flags.json');
const physicalParticlesData = require('./physicalParticlesData.js');

const healthcheckQueries = {
detectors: {
description: 'detectors dict insert',
query: detectors.map((d) => `INSERT INTO detectors_subsystems("id", "name") VALUES (DEFAULT, '${d}');`),
},
particle: {
description: 'particles dict insert',
query: Object.entries(physicalParticlesData).map(([name, d]) => `INSERT INTO particle_phys_data("id", "name", "full_name", "A", "Z")
VALUES (DEFAULT, '${name}', '${d.full_name}', ${d.A}, ${d.Z});`),
},
flags: {
description: 'flags types dict insert',
query: flags.map((f) => `INSERT INTO flags_types_dictionary("id", "name", "method", "bad", "obsolate")
VALUES (${f.id}, '${f.name}', '${f.method}', ${f.bad}::bool, ${f.obsolete}::bool);`),
},
};

const suppressHealthcheckLogs = (process.env['RCT_SUPRESS_HEALTHCECK_LOGS']?.toLowerCase() || 'true') == 'true';

module.exports = {
suppressHealthcheckLogs,
healthcheckQueries,
};
29 changes: 29 additions & 0 deletions app/config/rct-data/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @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.
*/

const detectors = require('./detectors.js').sort();
const flags = require('./flags.json');
const roles = require('./roles.js');
const physicalParticlesData = require('./physicalParticlesData.js');
const beamTypesMappings = require('./beamTypesMappings.js');
const healthcheckQueries = require('./healthcheckQueries.js');

module.exports = {
detectors,
roles,
flags,
physicalParticlesData,
beamTypesMappings,
...healthcheckQueries,
};
38 changes: 38 additions & 0 deletions app/config/rct-data/physicalParticlesData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* @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.
*/

const physicalParticlesData = {
p: {
full_name: 'proton',
Z: 1,
A: 1,
},
Pb: {
full_name: 'lead',
Z: 83,
A: 207,
},
O: {
full_name: 'oxygen',
A: 8,
Z: 16,
},
Xe: {
full_name: 'xenon',
A: 54,
Z: 131,
},
};

module.exports = physicalParticlesData;
3 changes: 1 addition & 2 deletions app/config/roles.js → app/config/rct-data/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
const detectors = require('./detectors.js');

const meta = {
SSO_DET_ROLE: 'det-',
};

const detectors = require('./detectors.js');

const dict = {
Admin: 'admin',
Global: 'global',
Expand Down
3 changes: 2 additions & 1 deletion app/config/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/
const ResProvider = require('../lib/ResProvider.js');

const { ResProvider } = require('../lib/utils');

const services = {
bookkeeping: {
Expand Down
Loading