From 2bbf460664b7fdd16e5a1deec6c4c8a9e55c357b Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 22 Jun 2022 11:39:28 +0200 Subject: [PATCH 01/10] Added API implementation on server side --- caimira/apps/calculator/__init__.py | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/caimira/apps/calculator/__init__.py b/caimira/apps/calculator/__init__.py index ee522bde..0c3505c2 100644 --- a/caimira/apps/calculator/__init__.py +++ b/caimira/apps/calculator/__init__.py @@ -18,6 +18,7 @@ import zlib import jinja2 import loky from tornado.web import Application, RequestHandler, StaticFileHandler +from tornado.httpclient import AsyncHTTPClient, HTTPRequest import tornado.log from . import markdown_tools @@ -249,6 +250,51 @@ class ReadmeHandler(BaseRequestHandler): self.finish(readme) +class ArveData(BaseRequestHandler): + async def get(self, hotel_id, floor_id): + client_id = self.settings["arve_client_id"] + client_secret = self.settings['arve_client_secret'] + arve_api_key = self.settings['arve_api_key'] + + http_client = AsyncHTTPClient() + + URL = 'https://arveapi.auth.eu-central-1.amazoncognito.com/oauth2/token' + headers = { "Content-Type": "application/x-www-form-urlencoded", + "Authorization": b"Basic " + base64.b64encode(f'{client_id}:{client_secret}'.encode()) + } + + try: + response = await http_client.fetch(HTTPRequest( + url=URL, + method='POST', + headers=headers, + body="grant_type=client_credentials" + ), + raise_error=True) + except Exception as e: + print("Something went wrong: %s" % e) + + access_token = json.loads(response.body)['access_token'] + + URL = f'https://api.arve.swiss/v1/{hotel_id}/{floor_id}' + headers = { + "x-api-key": arve_api_key, + "Authorization": f'Bearer {access_token}' + } + try: + response = await http_client.fetch(HTTPRequest( + url=URL, + method='GET', + headers=headers, + ), + raise_error=True) + except Exception as e: + print("Something went wrong: %s" % e) + + self.set_header("Content-Type", 'application/json') + return self.finish(response.body) + + def make_app( debug: bool = False, calculator_prefix: str = '/calculator', @@ -266,6 +312,7 @@ def make_app( (calculator_prefix + r'/report-json', ConcentrationModelJsonResponse), (calculator_prefix + r'/baseline-model/result', StaticModel), (calculator_prefix + r'/user-guide', ReadmeHandler), + (calculator_prefix + r'/api/arve/v1/(.*)/(.*)', ArveData), (calculator_prefix + r'/static/(.*)', StaticFileHandler, {'path': calculator_static_dir}), ] @@ -298,6 +345,9 @@ def make_app( # COOKIE_SECRET being undefined will result in no login information being # presented to the user. cookie_secret=os.environ.get('COOKIE_SECRET', ''), + arve_client_id=os.environ.get('ARVE_CLIENT_ID', ''), + arve_client_secret=os.environ.get('ARVE_CLIENT_SECRET', ''), + arve_api_key=os.environ.get('ARVE_API_KEY', ''), # Process parallelism controls. There is a balance between serving a single report # requests quickly or serving multiple requests concurrently. From f793300b1400f8322aa75301ab606c0a344fa8c3 Mon Sep 17 00:00:00 2001 From: Luis Aleixo Date: Wed, 22 Jun 2022 14:59:49 +0200 Subject: [PATCH 02/10] Added UI for sensors selection and handled UI navigations --- caimira/apps/calculator/model_generator.py | 4 + caimira/apps/calculator/static/js/form.js | 76 +++++++++++++++++++ .../templates/base/calculator.form.html.j2 | 2 - caimira/apps/templates/base/layout.html.j2 | 1 + .../templates/cern/calculator.form.html.j2 | 23 ++++++ 5 files changed, 104 insertions(+), 2 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index 254ae02c..e86bfa53 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -31,6 +31,7 @@ class FormData: activity_type: str air_changes: float air_supply: float + arve_sensors_option: bool ceiling_height: float exposed_coffee_break_option: str exposed_coffee_duration: int @@ -77,6 +78,7 @@ class FormData: window_width: float windows_number: int window_opening_regime: str + sensor_in_use: str short_range_option: str short_range_interactions: list @@ -86,6 +88,7 @@ class FormData: 'activity_type': 'office', 'air_changes': 0., 'air_supply': 0., + 'arve_sensors_option': False, 'calculator_version': _NO_DEFAULT, 'ceiling_height': 0., 'exposed_coffee_break_option': 'coffee_break_0', @@ -132,6 +135,7 @@ class FormData: 'windows_frequency': 60., 'windows_number': 0, 'window_opening_regime': 'windows_open_permanently', + 'sensor_in_use': _NO_DEFAULT, 'short_range_option': 'short_range_no', 'short_range_interactions': '[]', } diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index 655ff5ac..b7fa2eed 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -271,6 +271,72 @@ function on_wearing_mask_change() { }) } +function populate_temp_hum_values(data, index) { + $("#sensor_temperature").text(data[index].Details.T + '°C'); + $("#sensor_humidity").text(data[index].Details.RH + '%'); + $("[name='inside_temp']").val(data[index].Details.T + 273.15); + $("[name='humidity']").val(data[index].Details.RH/100); +}; + +function clear_sensors_data() { + $("#sensor_temperature").text(); + $("#sensor_humidity").text(); + $("[name='inside_temp']").val(); + $("[name='humidity']").val(); +} + +//Data from ARVE sensors +var DATA_FROM_SENSORS; +function show_sensors_data(url) { + + const HOTEL_ID = "CERN" + const FLOOR_ID = "1" + + if ($('#sensors > option').length == 0) { + $.ajax({ + url: `${$('#url_prefix').data().calculator_prefix}/api/arve/v1/${HOTEL_ID}/${FLOOR_ID}`, + type: 'GET', + success: function (result) { + DATA_FROM_SENSORS = result; + result.map(room => { + $("#sensors").append(``); + }); + populate_temp_hum_values(result, 0); + if (url.searchParams.has('sensor_in_use')) { + $("#sensors").val(url.searchParams.get('sensor_in_use')); + populate_temp_hum_values(result, result.findIndex(function(sensor) { + return sensor.RoomId == url.searchParams.get('sensor_in_use'); + })); + } + }, + error: function() { + alert('One error occured.'); + }, + }); + } +}; + +$("#sensors").change(function (el) { + sensor_id = DATA_FROM_SENSORS.findIndex(function(sensor) { + return sensor.RoomId == el.target.value + }); + populate_temp_hum_values(DATA_FROM_SENSORS, sensor_id); +}); + +function on_use_sensors_data_change(url) { + sensor_data = $('input[type=radio][name=arve_sensors_option]') + sensor_data.each(function (index) { + if (this.checked) { + getChildElement($(this)).show(); + show_sensors_data(url); + } + else { + getChildElement($(this)).hide(); + clear_sensors_data(); + } + }) +} + function on_short_range_option_change() { short_range = $('input[type=radio][name=short_range_option]') short_range.each(function (index){ @@ -706,6 +772,10 @@ $(document).ready(function () { $("#sr_interactions").text(index - 1); } + else if (name == 'sensor_in_use') { + // TODO - Validate if sensor exists + } + //Ignore 0 (default) values from server side else if (!(elemObj.classList.contains("non_zero") || elemObj.classList.contains("remove_zero")) || (value != "0.0" && value != "0")) { elemObj.value = value; @@ -743,6 +813,12 @@ $(document).ready(function () { //Check all radio buttons previously selected $("input[type=radio]:checked").each(function() {require_fields(this)}); + // When the arve_sensors_option changes we want to make its respective + // children show/hide. + $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); + // Call the function now to handle forward/back button presses in the browser. + on_use_sensors_data_change(url); + // When the ventilation_type changes we want to make its respective // children show/hide. $("input[type=radio][name=ventilation_type]").change(on_ventilation_type_change); diff --git a/caimira/apps/templates/base/calculator.form.html.j2 b/caimira/apps/templates/base/calculator.form.html.j2 index 37699a44..07561755 100644 --- a/caimira/apps/templates/base/calculator.form.html.j2 +++ b/caimira/apps/templates/base/calculator.form.html.j2 @@ -85,8 +85,6 @@ {% endblock room_data %} -
-
diff --git a/caimira/apps/templates/base/layout.html.j2 b/caimira/apps/templates/base/layout.html.j2 index 6e61f45b..e7ac6dea 100644 --- a/caimira/apps/templates/base/layout.html.j2 +++ b/caimira/apps/templates/base/layout.html.j2 @@ -5,6 +5,7 @@ + {% block title %} diff --git a/caimira/apps/templates/cern/calculator.form.html.j2 b/caimira/apps/templates/cern/calculator.form.html.j2 index 79a879d9..ffc67bd2 100644 --- a/caimira/apps/templates/cern/calculator.form.html.j2 +++ b/caimira/apps/templates/cern/calculator.form.html.j2 @@ -4,4 +4,27 @@ <div data-tooltip="The area you wish to study (choose one of the 2 options). Use GIS Portal or measure. Also indicate if a central (radiator-type) heating system is in use."> <span class="tooltip_text">?</span> </div> + + <div class="split"> + <div>Use data from ARVE sensors:</div> + <div> + <input class="ml-2" type="radio" id="arve_sensor_no" name="arve_sensors_option" value=0 checked="checked"> + <label for="arve_sensor_no">No</label> + <input class="ml-2" type="radio" id="arve_sensor_yes" name="arve_sensors_option" value=1 data-enables="#DIVsensors_data"> + <label for="arve_sensor_yes">Yes</label> + </div> + </div> + <div id="DIVsensors_data" style="display:none"> + <div class="form-group row mb-0"> + <div class="col-sm-4"><label class="col-form-label">Sensor:</label></div> + <div class="col-sm-6"> + <select id="sensors" name="sensor_in_use" class="form-control"> + </select> + </div> + </div> + <div> + <div><label>Temperature: </label><span class="ml-3 font-weight-bold" id="sensor_temperature"></span></div> + <div><label>Relative Humidity: </label><span class="ml-3 font-weight-bold" id="sensor_humidity"></span></div> + </div> + </div> {% endblock room_data %} \ No newline at end of file From b455fdee141ac5bce1304f900833dd9439410457 Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Wed, 22 Jun 2022 15:21:43 +0200 Subject: [PATCH 03/10] Handled typo on baseline model --- caimira/apps/calculator/model_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index e86bfa53..be60d0d8 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -135,7 +135,7 @@ class FormData: 'windows_frequency': 60., 'windows_number': 0, 'window_opening_regime': 'windows_open_permanently', - 'sensor_in_use': _NO_DEFAULT, + 'sensor_in_use': '', 'short_range_option': 'short_range_no', 'short_range_interactions': '[]', } From 67a47dfd748bd67934a5caeb58942833400c81df Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Mon, 27 Jun 2022 16:13:08 +0100 Subject: [PATCH 04/10] Added Math.round to input values --- caimira/apps/calculator/static/js/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index b7fa2eed..ffa0f4f4 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -272,8 +272,8 @@ function on_wearing_mask_change() { } function populate_temp_hum_values(data, index) { - $("#sensor_temperature").text(data[index].Details.T + '°C'); - $("#sensor_humidity").text(data[index].Details.RH + '%'); + $("#sensor_temperature").text(Math.round(data[index].Details.T) + '°C'); + $("#sensor_humidity").text(Math.round(data[index].Details.RH) + '%'); $("[name='inside_temp']").val(data[index].Details.T + 273.15); $("[name='humidity']").val(data[index].Details.RH/100); }; From 81f399e2d7bff2f9a285c1758a66ae2c0ac8387e Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Mon, 4 Jul 2022 15:55:13 +0200 Subject: [PATCH 05/10] added verification for inside_temperature data from sensors --- caimira/apps/calculator/model_generator.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index be60d0d8..dca76a96 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -53,7 +53,7 @@ class FormData: infected_lunch_start: minutes_since_midnight #Used if infected_dont_have_breaks_with_exposed infected_people: int infected_start: minutes_since_midnight - inside_temp: float + inside_temp: str location_name: str location_latitude: float location_longitude: float @@ -112,7 +112,7 @@ class FormData: 'infected_lunch_start': '12:30', 'infected_people': _NO_DEFAULT, 'infected_start': '08:30', - 'inside_temp': 293., + 'inside_temp': '', 'location_latitude': _NO_DEFAULT, 'location_longitude': _NO_DEFAULT, 'location_name': _NO_DEFAULT, @@ -291,14 +291,17 @@ class FormData: volume = self.room_volume else: volume = self.floor_area * self.ceiling_height - if self.humidity == '': + + if self.arve_sensors_option == False: if self.room_heating_option: humidity = 0.3 else: humidity = 0.5 + inside_temp = 293. else: humidity = float(self.humidity) - room = models.Room(volume=volume, inside_temp=models.PiecewiseConstant((0, 24), (self.inside_temp,)), humidity=humidity) + inside_temp = float(self.inside_temp) + room = models.Room(volume=volume, inside_temp=models.PiecewiseConstant((0, 24), (inside_temp,)), humidity=humidity) infected_population = self.infected_population() @@ -748,7 +751,7 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'infected_lunch_start': '12:30', 'infected_people': '1', 'infected_start': '09:00', - 'inside_temp': 293., + 'inside_temp': '293.', 'location_latitude': 46.20833, 'location_longitude': 6.14275, 'location_name': 'Geneva', From ee794ec9b75384668b37dd3f64d00ba8f056ce1d Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Mon, 4 Jul 2022 16:04:54 +0200 Subject: [PATCH 06/10] Added reference for external api call for humidity and inside temperature --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f87dbe69..6edebd28 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,9 @@ There is one external API call to fetch required information related to the geog The documentation for this geocoding service is available at https://developers.arcgis.com/rest/geocode/api-reference/geocoding-suggest.htm . Please note that there is no need for keys on this API call. It is **free-of-charge**. +- **Humidity and Inside Temperature:** +There may be one external API call to fetch information related to a location specified in the UI. The data is related to the inside temperature and humidity of the selected location. + ## Update configuration If you need to **update** existing configuration, then modify this repository and after having logged in, run: From 7af00de5d48c8a4cc7c82c2f78cba060f42f958b Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 5 Jul 2022 10:26:06 +0200 Subject: [PATCH 07/10] added inside_temp and humidity as floats with "_NO_DEFAULT" default value --- caimira/apps/calculator/model_generator.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index dca76a96..cedcbb39 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -43,7 +43,7 @@ class FormData: floor_area: float hepa_amount: float hepa_option: bool - humidity: str + humidity: float infected_coffee_break_option: str #Used if infected_dont_have_breaks_with_exposed infected_coffee_duration: int #Used if infected_dont_have_breaks_with_exposed infected_dont_have_breaks_with_exposed: bool @@ -53,7 +53,7 @@ class FormData: infected_lunch_start: minutes_since_midnight #Used if infected_dont_have_breaks_with_exposed infected_people: int infected_start: minutes_since_midnight - inside_temp: str + inside_temp: float location_name: str location_latitude: float location_longitude: float @@ -102,7 +102,7 @@ class FormData: 'floor_area': 0., 'hepa_amount': 0., 'hepa_option': False, - 'humidity': '', + 'humidity': _NO_DEFAULT, 'infected_coffee_break_option': 'coffee_break_0', 'infected_coffee_duration': 5, 'infected_dont_have_breaks_with_exposed': False, @@ -112,7 +112,7 @@ class FormData: 'infected_lunch_start': '12:30', 'infected_people': _NO_DEFAULT, 'infected_start': '08:30', - 'inside_temp': '', + 'inside_temp': _NO_DEFAULT, 'location_latitude': _NO_DEFAULT, 'location_longitude': _NO_DEFAULT, 'location_name': _NO_DEFAULT, @@ -299,8 +299,9 @@ class FormData: humidity = 0.5 inside_temp = 293. else: - humidity = float(self.humidity) - inside_temp = float(self.inside_temp) + humidity = self.humidity + inside_temp = self.inside_temp + room = models.Room(volume=volume, inside_temp=models.PiecewiseConstant((0, 24), (inside_temp,)), humidity=humidity) infected_population = self.infected_population() @@ -741,7 +742,7 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]: 'floor_area': '', 'hepa_amount': '250', 'hepa_option': '0', - 'humidity': '', + 'humidity': '0.5', 'infected_coffee_break_option': 'coffee_break_4', 'infected_coffee_duration': '10', 'infected_dont_have_breaks_with_exposed': '1', From d90e03446b33c911b11e4a6da57b82db21a07b39 Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 12 Jul 2022 11:47:01 +0200 Subject: [PATCH 08/10] Completely removed ARVE sensors on base theme --- caimira/apps/calculator/model_generator.py | 6 ++--- caimira/apps/calculator/static/js/form.js | 26 +++++++++------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/caimira/apps/calculator/model_generator.py b/caimira/apps/calculator/model_generator.py index cedcbb39..6b9a6796 100644 --- a/caimira/apps/calculator/model_generator.py +++ b/caimira/apps/calculator/model_generator.py @@ -43,7 +43,7 @@ class FormData: floor_area: float hepa_amount: float hepa_option: bool - humidity: float + humidity: str infected_coffee_break_option: str #Used if infected_dont_have_breaks_with_exposed infected_coffee_duration: int #Used if infected_dont_have_breaks_with_exposed infected_dont_have_breaks_with_exposed: bool @@ -102,7 +102,7 @@ class FormData: 'floor_area': 0., 'hepa_amount': 0., 'hepa_option': False, - 'humidity': _NO_DEFAULT, + 'humidity': '', 'infected_coffee_break_option': 'coffee_break_0', 'infected_coffee_duration': 5, 'infected_dont_have_breaks_with_exposed': False, @@ -299,7 +299,7 @@ class FormData: humidity = 0.5 inside_temp = 293. else: - humidity = self.humidity + humidity = float(self.humidity) inside_temp = self.inside_temp room = models.Room(volume=volume, inside_temp=models.PiecewiseConstant((0, 24), (inside_temp,)), humidity=humidity) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index ffa0f4f4..ca89fac0 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -278,13 +278,6 @@ function populate_temp_hum_values(data, index) { $("[name='humidity']").val(data[index].Details.RH/100); }; -function clear_sensors_data() { - $("#sensor_temperature").text(); - $("#sensor_humidity").text(); - $("[name='inside_temp']").val(); - $("[name='humidity']").val(); -} - //Data from ARVE sensors var DATA_FROM_SENSORS; function show_sensors_data(url) { @@ -332,7 +325,6 @@ function on_use_sensors_data_change(url) { } else { getChildElement($(this)).hide(); - clear_sensors_data(); } }) } @@ -470,6 +462,11 @@ function validate_form(form) { }); } + // Logic for the API requests. Always set humity input as the empty string so that we can profit from the "room_heating_option default" values for humidity. + if ($("#arve_sensor_no").prop('checked')) { + $("[name='humidity']").val(''); + } + // Validate location input. if (submit) { // We make the non-visible location inputs mandatory, without marking them as "required" inputs. @@ -813,11 +810,13 @@ $(document).ready(function () { //Check all radio buttons previously selected $("input[type=radio]:checked").each(function() {require_fields(this)}); - // When the arve_sensors_option changes we want to make its respective + // On CERN theme, When the arve_sensors_option changes we want to make its respective // children show/hide. - $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); - // Call the function now to handle forward/back button presses in the browser. - on_use_sensors_data_change(url); + if ($("input[type=radio][name=arve_sensors_option]").length > 0) { + $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); + // Call the function now to handle forward/back button presses in the browser. + on_use_sensors_data_change(url); + } // When the ventilation_type changes we want to make its respective // children show/hide. @@ -917,9 +916,6 @@ $(document).ready(function () { templateSelection: formatLocationSelection }); - // Logic for the API requests. Always set humity input as the empty string so that we can profit from the "room_heating_option default" values for humidity. - $("[name='humidity']").val(""); - function formatlocation(suggestedLocation) { // Function is called for each location from the geocoding API. From 3081031d120f9f088c90b5f35552467e504f714c Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Tue, 12 Jul 2022 11:59:12 +0200 Subject: [PATCH 09/10] Updated readme on the API references --- README.md | 2 +- caimira/apps/calculator/static/js/form.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6edebd28..0122b1ab 100644 --- a/README.md +++ b/README.md @@ -308,7 +308,7 @@ The documentation for this geocoding service is available at https://developers. Please note that there is no need for keys on this API call. It is **free-of-charge**. - **Humidity and Inside Temperature:** -There may be one external API call to fetch information related to a location specified in the UI. The data is related to the inside temperature and humidity of the selected location. +There is the possibility of using one external API call to fetch information related to a location specified in the UI. The data is related to the inside temperature and humidity taken from an indoor measurement device. Note that the API currently used from ARVE is only available for the `CERN theme` as the authorised sensors are installed at CERN." ## Update configuration diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index ca89fac0..b84f9376 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -810,7 +810,7 @@ $(document).ready(function () { //Check all radio buttons previously selected $("input[type=radio]:checked").each(function() {require_fields(this)}); - // On CERN theme, When the arve_sensors_option changes we want to make its respective + // On CERN theme, when the arve_sensors_option changes we want to make its respective // children show/hide. if ($("input[type=radio][name=arve_sensors_option]").length > 0) { $("input[type=radio][name=arve_sensors_option]").change(on_use_sensors_data_change); From 8da4e7fc255559aa59f462daf70ebe1d7d160e1d Mon Sep 17 00:00:00 2001 From: Luis Aleixo <luis.aleixo@cern.ch> Date: Mon, 19 Sep 2022 09:05:17 +0200 Subject: [PATCH 10/10] Changed alert message for authentication errors --- caimira/apps/calculator/static/js/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caimira/apps/calculator/static/js/form.js b/caimira/apps/calculator/static/js/form.js index b84f9376..25ca0af4 100644 --- a/caimira/apps/calculator/static/js/form.js +++ b/caimira/apps/calculator/static/js/form.js @@ -303,7 +303,7 @@ function show_sensors_data(url) { } }, error: function() { - alert('One error occured.'); + alert('Authentication Error - Something went wrong during the authentication process.'); }, }); }