diff --git a/SAS/TMSS/deploy/nginx/default.conf b/SAS/TMSS/deploy/nginx/default.conf index 7f0ef561b3be74657b57f921bc118f5243f10803..1530354b214a58596c3649830a878d035ec1a43d 100644 --- a/SAS/TMSS/deploy/nginx/default.conf +++ b/SAS/TMSS/deploy/nginx/default.conf @@ -10,7 +10,7 @@ server { listen 8008; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload" always; - add_header Content-Security-Policy "default-src 'self' data: https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com https://fonts.googleapis.com https://cdnjs.cloudflare.com; font-src 'self' data: https://stackpath.bootstrapcdn.com https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; connect-src 'self' ws://localhost:5678 ws://tmss.lofar.eu:5678"; + add_header Content-Security-Policy "default-src 'self' data: https://cdnjs.cloudflare.com; style-src 'self' 'unsafe-inline' https://stackpath.bootstrapcdn.com https://fonts.googleapis.com https://cdnjs.cloudflare.com; font-src 'self' data: https://stackpath.bootstrapcdn.com https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com; connect-src 'self' ws://localhost:5678 ws://tmss.lofar.eu:5678; img-src 'self' https://tile.openstreetmap.org"; add_header Referrer-Policy 'strict-origin'; location / { diff --git a/SAS/TMSS/frontend/tmss_webapp/public/index.html b/SAS/TMSS/frontend/tmss_webapp/public/index.html index 30166fe66d2ace69afd71bf1d68a9db964915521..bfabe2ac294630b49d7f8832cd7ed1c6835db5b3 100644 --- a/SAS/TMSS/frontend/tmss_webapp/public/index.html +++ b/SAS/TMSS/frontend/tmss_webapp/public/index.html @@ -8,10 +8,7 @@ <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <title>TMSS</title> - <meta http-equiv="Content-Security-Policy" content="default-src *; - img-src * 'self' data: https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; - style-src 'self' 'unsafe-inline' *" /> - </head> + </head> <body> <noscript>You need to enable JavaScript to run this app.</noscript> <div id="root"></div> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationConstraintsview.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationConstraintsview.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationView.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationView.js index 032028e4b4796d7c3457bcfd39ff67c9fd053566..b034c5032bdc5296d83780bf9478b962ce7e93b1 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationView.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Station/StationView.js @@ -79,16 +79,17 @@ export default function StationView(props) { /> <TabView> - <TabPanel header="Station List" className="TabStation"> + <TabPanel header="Station Geo Map" className="TabStation"> <div className="StationListWrap" > <ListBox options={stations} optionLabel="0" className="StationListbox" onChange={(e) => ZoomTo(e.value)}/> <StationGeoView stations={stationsGeo } selected={selectedStation} mapRef={ setMap} ></StationGeoView > </div> </TabPanel> - <TabPanel header="Geo Plot"> - <div className="GeoMap"> - <StationGeoView stations={stationsGeo} selected={selectedStation}></StationGeoView > - </div> + <TabPanel header="Station Constraints Plot"> + <div className="StationListWrap" > + <ListBox options={stations} optionLabel="0" className="StationListbox" onChange={(e) => ZoomTo(e.value)}/> + <div> A Contraints view will be implemnted here soon. </div> + </div> </TabPanel> </TabView> diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.js new file mode 100644 index 0000000000000000000000000000000000000000..f36ccd799e7ac500a687b1d8417713fb53b3c4f6 --- /dev/null +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.js @@ -0,0 +1,29 @@ +const ExternalUrlsUtils = { + + + + BaseLofarMonitorUrl : "https://proxy.lofar.eu/lofmonitor/station_overview?station=", + + /** + * Function to give back a scheduling constraint url + * @param {string} Station - The Station + * @param {string} schedulingUnit - the Unit we are looking at + * @param {string} onDate - 2023-02-14 formatedf formated of the date + * @returns string with the url + */ + getUserRolePermissionForStationAndSchedulingUnitOnDate(station,schedulingUnit,onDate) { + return "/api/scheduling_unit_blueprint/" + schedulingUnit + "/scheduling_constraints_plot/" + station + "/" + onDate + }, + + /** + * Function to give back the Lofar Monitoring Url + * @param {string} Station - The Station + * @returns string with the url + */ + + getLofarMontitorUrlForStation(station) { + return this.BaseLofarMonitorUrl + station + } +}; + +export default ExternalUrlsUtils; \ No newline at end of file diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.test.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.test.js new file mode 100644 index 0000000000000000000000000000000000000000..356d6d89fe33b739d40c50f3fac83fab1a049959 --- /dev/null +++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/externalurls.test.js @@ -0,0 +1,16 @@ +import externalUrls from "./externalurls"; + +describe('getLofarMontitorUrlForStation', () => { + it('should return the correct url', () => { + const subbandString = externalUrls.getLofarMontitorUrlForStation("CS002") + expect(subbandString).toEqual("https://proxy.lofar.eu/lofmonitor/station_overview?station=CS002") + }) +}); + +describe('getUserRolePermissionForStationAndSchedulingUnitOnDate', () => { + it('should return the correct url', () => { + const subbandString = externalUrls.getUserRolePermissionForStationAndSchedulingUnitOnDate("CS003", 21, "1976-08-06") + expect(subbandString).toEqual("/api/scheduling_unit_blueprint/21/scheduling_constraints_plot/CS003/1976-08-06") + + }) +}); \ No newline at end of file