matlab-proxy 0.10.0__tar.gz → 0.10.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of matlab-proxy might be problematic. Click here for more details.
- {matlab-proxy-0.10.0/matlab_proxy.egg-info → matlab-proxy-0.10.1}/PKG-INFO +1 -1
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/index.js +57 -34
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/reducers/index.js +23 -1
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/selectors/index.js +2 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/app.py +3 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/app_state.py +12 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/settings.py +11 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/environment_variables.py +70 -29
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1/matlab_proxy.egg-info}/PKG-INFO +1 -1
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/setup.py +1 -1
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/LICENSE.md +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/MANIFEST.in +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/README.md +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/.gitignore +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/README.md +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/package-lock.json +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/package.json +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/favicon.ico +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/index.html +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/manifest.json +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/robots.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actionCreators/actionCreators.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actionCreators/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actions/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/css/site7.min.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-account-hover.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-contact-hover.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/App.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/App.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/MATLAB-env-blur.png +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Confirmation/Confirmation.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Confirmation/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/Controls.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/Controls.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/feedback.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/help.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/restart.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/sign-out.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/start.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/stop.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/terminate.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/EntitlementSelector/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/Error.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/Error.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/Help.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/Help.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/Information.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/Information.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/MHLM.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/NLM.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/MatlabJsd.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/Overlay.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/Overlay.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/index.css +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/index.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/jest.config.json +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/logo.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/reducers/reducers.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/selectors/selectors.spec.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/serviceWorker.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/setupTests.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/test/utils/react-test.js +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/__init__.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/constants.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/default_configuration.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/devel.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/icons/matlab.svg +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/matlab/startup.m +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/__init__.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/event_loop.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/list_servers.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mw.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/__init__.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/exceptions.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/logger.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/token_auth.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/validators.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/system.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/windows.py +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/SOURCES.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/dependency_links.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/entry_points.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/not-zip-safe +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/requires.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/top_level.txt +0 -0
- {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/setup.cfg +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright 2020-
|
|
1
|
+
// Copyright 2020-2023 The MathWorks, Inc.
|
|
2
2
|
|
|
3
3
|
import React, { useState, useCallback, useEffect, useMemo } from 'react';
|
|
4
4
|
import { useSelector, useDispatch } from 'react-redux';
|
|
@@ -14,20 +14,22 @@ import Information from '../Information';
|
|
|
14
14
|
import Help from '../Help';
|
|
15
15
|
import Error from '../Error';
|
|
16
16
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
selectOverlayVisible,
|
|
18
|
+
selectFetchStatusPeriod,
|
|
19
|
+
selectHasFetchedServerStatus,
|
|
20
|
+
selectLicensingProvided,
|
|
21
|
+
selectMatlabUp,
|
|
22
|
+
selectError,
|
|
23
|
+
selectLoadUrl,
|
|
24
|
+
selectIsConnectionError,
|
|
25
|
+
selectHasFetchedEnvConfig,
|
|
26
|
+
selectAuthEnabled,
|
|
27
|
+
selectIsAuthenticated,
|
|
28
|
+
selectLicensingMhlmHasEntitlements,
|
|
29
|
+
selectIsEntitled,
|
|
30
|
+
selectLicensingInfo,
|
|
31
|
+
selectUseMOS,
|
|
32
|
+
selectUseMRE,
|
|
31
33
|
} from "../../selectors";
|
|
32
34
|
|
|
33
35
|
import {
|
|
@@ -56,17 +58,34 @@ function App() {
|
|
|
56
58
|
const isAuthenticated = useSelector(selectIsAuthenticated)
|
|
57
59
|
const authEnabled = useSelector(selectAuthEnabled);
|
|
58
60
|
const licensingInfo = useSelector(selectLicensingInfo);
|
|
61
|
+
const useMOS = useSelector(selectUseMOS);
|
|
62
|
+
const useMRE = useSelector(selectUseMRE);
|
|
59
63
|
|
|
60
64
|
const baseUrl = useMemo(() => {
|
|
61
|
-
const url = document.URL
|
|
65
|
+
const url = document.URL
|
|
62
66
|
return url.split(window.location.origin)[1].split('index.html')[0]
|
|
63
67
|
}, [])
|
|
64
|
-
|
|
65
|
-
const parseQueryParams = (url)
|
|
68
|
+
|
|
69
|
+
const parseQueryParams = (url) => {
|
|
66
70
|
const queryParams = new URLSearchParams(url.search);
|
|
67
71
|
return queryParams;
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
const fullyQualifiedUrl = useMemo(() => {
|
|
75
|
+
// Returns the Fully Qualified URL used to load the page.
|
|
76
|
+
const url = document.URL
|
|
77
|
+
let baseUrlStr = url.split('/index.html')[0]
|
|
78
|
+
return baseUrlStr;
|
|
79
|
+
}, [])
|
|
80
|
+
|
|
81
|
+
const htmlToRenderMATLAB = () => {
|
|
82
|
+
let theHtmlToRenderMATLAB = useMOS ? "index-matlabonlineserver.html" : 'index-jsd-cr.html'
|
|
83
|
+
if (useMRE) {
|
|
84
|
+
theHtmlToRenderMATLAB += `?mre=${fullyQualifiedUrl}`
|
|
85
|
+
}
|
|
86
|
+
return theHtmlToRenderMATLAB
|
|
87
|
+
}
|
|
88
|
+
|
|
70
89
|
const toggleOverlayVisible = useCallback(
|
|
71
90
|
() => dispatch(setOverlayVisibility(!overlayVisible)),
|
|
72
91
|
[overlayVisible, dispatch]
|
|
@@ -137,10 +156,10 @@ function App() {
|
|
|
137
156
|
// Periodic fetch server status
|
|
138
157
|
useInterval(() => {
|
|
139
158
|
dispatch(fetchServerStatus());
|
|
140
|
-
},
|
|
159
|
+
}, fetchStatusPeriod);
|
|
141
160
|
|
|
142
161
|
// Load URL
|
|
143
|
-
useEffect(() => {
|
|
162
|
+
useEffect(() => {
|
|
144
163
|
if (loadUrl !== null) {
|
|
145
164
|
window.location.href = loadUrl;
|
|
146
165
|
}
|
|
@@ -148,14 +167,14 @@ function App() {
|
|
|
148
167
|
|
|
149
168
|
useEffect(() => {
|
|
150
169
|
const queryParams = parseQueryParams(window.location);
|
|
151
|
-
const token = queryParams.get("mwi_auth_token");
|
|
170
|
+
const token = queryParams.get("mwi_auth_token");
|
|
152
171
|
|
|
153
|
-
if(token){
|
|
154
|
-
dispatch(updateAuthStatus(token));
|
|
172
|
+
if (token) {
|
|
173
|
+
dispatch(updateAuthStatus(token));
|
|
155
174
|
}
|
|
156
|
-
window.history.replaceState(null, '', `${baseUrl}index.html`);
|
|
175
|
+
window.history.replaceState(null, '', `${baseUrl}index.html`);
|
|
157
176
|
}, [dispatch, baseUrl]);
|
|
158
|
-
|
|
177
|
+
|
|
159
178
|
// Display one of:
|
|
160
179
|
// * Confirmation
|
|
161
180
|
// * Help
|
|
@@ -163,16 +182,16 @@ function App() {
|
|
|
163
182
|
// * License gatherer
|
|
164
183
|
// * License selector
|
|
165
184
|
// * Status Information
|
|
166
|
-
let overlayContent;
|
|
185
|
+
let overlayContent;
|
|
167
186
|
|
|
168
187
|
if (dialog) {
|
|
169
188
|
// TODO Inline confirmation component build
|
|
170
189
|
overlayContent = dialog;
|
|
171
|
-
}
|
|
190
|
+
}
|
|
172
191
|
// Give precedence to token auth over licensing info ie. once after token auth is done, show licensing if not provided.
|
|
173
|
-
else if((!licensingProvided) && hasFetchedServerStatus && (!authEnabled || isAuthenticated)) {
|
|
192
|
+
else if ((!licensingProvided) && hasFetchedServerStatus && (!authEnabled || isAuthenticated)) {
|
|
174
193
|
overlayContent = <LicensingGatherer role="licensing" aria-describedby="license-window" />;
|
|
175
|
-
}
|
|
194
|
+
}
|
|
176
195
|
// Show license selector if the user has entitlements and is not currently entitled
|
|
177
196
|
else if (hasEntitlements && !isEntitled) {
|
|
178
197
|
overlayContent = <EntitlementSelector options={licensingInfo.entitlements} />;
|
|
@@ -192,19 +211,23 @@ function App() {
|
|
|
192
211
|
</Overlay>
|
|
193
212
|
) : null;
|
|
194
213
|
|
|
214
|
+
|
|
195
215
|
// FIXME Until https://github.com/http-party/node-http-proxy/issues/1342
|
|
196
216
|
// is addressed, use a direct URL in development mode. Once that is
|
|
197
217
|
// fixed, the request will be served by the fake MATLAB Embedded Connector
|
|
198
218
|
// process in development mode
|
|
219
|
+
|
|
220
|
+
// MW Internal Comment: See g2992889 for a discussion on why a FQDN is required in the MRE parameter.
|
|
221
|
+
// MW Internal Comment: Using websocket on breaks some UI components : `./index-matlabonlineserver.html?websocket=on&mre=${fullyQualifiedUrl}`;
|
|
199
222
|
const matlabUrl = process.env.NODE_ENV === 'development'
|
|
200
223
|
? 'http://localhost:31515/index-jsd-cr.html'
|
|
201
|
-
:
|
|
224
|
+
: `./${htmlToRenderMATLAB()}`;
|
|
202
225
|
|
|
203
226
|
let matlabJsd = null;
|
|
204
|
-
if(matlabUp){
|
|
205
|
-
matlabJsd = (!authEnabled || isAuthenticated)
|
|
206
|
-
|
|
207
|
-
|
|
227
|
+
if (matlabUp) {
|
|
228
|
+
matlabJsd = (!authEnabled || isAuthenticated)
|
|
229
|
+
? (<MatlabJsd url={matlabUrl} />)
|
|
230
|
+
: <img style={{ objectFit: 'fill' }} src={blurredBackground} alt='Blurred MATLAB environment' />
|
|
208
231
|
}
|
|
209
232
|
|
|
210
233
|
const overlayTrigger = overlayVisible ? null : <OverlayTrigger />;
|
|
@@ -35,6 +35,26 @@ export function authEnabled(state = false, action) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
// Stores information on whether to use MOS HTML while rendering MATLAB.
|
|
39
|
+
export function useMOS(state = false, action) {
|
|
40
|
+
switch (action.type) {
|
|
41
|
+
case RECEIVE_ENV_CONFIG:
|
|
42
|
+
return action.config.useMOS;
|
|
43
|
+
default:
|
|
44
|
+
return state;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Stores information on whether to provide MRE parameter to HTML while rendering MATLAB.
|
|
49
|
+
export function useMRE(state = false, action) {
|
|
50
|
+
switch (action.type) {
|
|
51
|
+
case RECEIVE_ENV_CONFIG:
|
|
52
|
+
return action.config.useMRE;
|
|
53
|
+
default:
|
|
54
|
+
return state;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
38
58
|
// Stores status of token authentication.
|
|
39
59
|
export function authStatus(state = false, action) {
|
|
40
60
|
switch (action.type) {
|
|
@@ -251,7 +271,7 @@ export function envConfig(state = null, action) {
|
|
|
251
271
|
case RECEIVE_ENV_CONFIG:
|
|
252
272
|
// Token authentication info is also sent as a response to /get_env_config endpoint.
|
|
253
273
|
// As its already stored in 'authStatus', 'authEnabled' and 'authToken', ignoring it in envConfig.
|
|
254
|
-
const { authStatus, authEnabled, ...envConfig } = action.config
|
|
274
|
+
const { authStatus, authEnabled, useMOS, useMRE, ...envConfig } = action.config
|
|
255
275
|
return envConfig
|
|
256
276
|
default:
|
|
257
277
|
return state;
|
|
@@ -284,4 +304,6 @@ export default combineReducers({
|
|
|
284
304
|
error,
|
|
285
305
|
envConfig,
|
|
286
306
|
authInfo,
|
|
307
|
+
useMOS,
|
|
308
|
+
useMRE,
|
|
287
309
|
});
|
|
@@ -15,6 +15,8 @@ export const selectError = state => state.error;
|
|
|
15
15
|
export const selectAuthEnabled = state => state.authInfo.authEnabled;
|
|
16
16
|
export const selectAuthToken = state => state.authInfo.authToken;
|
|
17
17
|
export const selectIsAuthenticated = state => state.authInfo.authStatus === true;
|
|
18
|
+
export const selectUseMOS = state => state.useMOS === true;
|
|
19
|
+
export const selectUseMRE = state => state.useMRE === true;
|
|
18
20
|
|
|
19
21
|
export const selectTriggerPosition = createSelector(
|
|
20
22
|
state => state.triggerPosition,
|
|
@@ -152,6 +152,9 @@ async def get_env_config(req):
|
|
|
152
152
|
config = state.settings["env_config"]
|
|
153
153
|
config["authEnabled"] = state.settings["mwi_is_token_auth_enabled"]
|
|
154
154
|
|
|
155
|
+
config["useMOS"] = mwi_env.Experimental.should_use_mos_html()
|
|
156
|
+
config["useMRE"] = mwi_env.Experimental.should_use_mre_html()
|
|
157
|
+
|
|
155
158
|
# In a previously authenticated session, if the url is accessed without the token(using session cookie), send the token as well.
|
|
156
159
|
config["authStatus"] = True if await token_auth.authenticate_request(req) else False
|
|
157
160
|
return web.json_response(config)
|
|
@@ -679,6 +679,18 @@ class AppState:
|
|
|
679
679
|
# The mwi_logs_dir is where MATLAB will write any subsequent logs
|
|
680
680
|
matlab_env["MATLAB_LOG_DIR"] = str(self.mwi_logs_dir)
|
|
681
681
|
|
|
682
|
+
# Set MW_CONNECTOR_CONTEXT_ROOT for MPA
|
|
683
|
+
if mwi_env.Experimental.is_mpa_enabled():
|
|
684
|
+
matlab_env["MW_CONNECTOR_CONTEXT_ROOT"] = self.settings.get("base_url", "/")
|
|
685
|
+
logger.info(
|
|
686
|
+
f"MW_CONNECTOR_CONTEXT_ROOT is set to: {matlab_env['MW_CONNECTOR_CONTEXT_ROOT']}"
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
# Setup Simulink Online which requires a pre-warm stage
|
|
690
|
+
if mwi_env.Experimental.is_simulink_enabled():
|
|
691
|
+
logger.info("Enabling usage of Simulink Online...")
|
|
692
|
+
matlab_env["PREWARM_SIMULINK"] = "true"
|
|
693
|
+
|
|
682
694
|
# Env setup related to logging
|
|
683
695
|
# Very verbose logging in debug mode
|
|
684
696
|
if logger.isEnabledFor(logging.getLevelName("DEBUG")):
|
|
@@ -369,6 +369,14 @@ def get_matlab_settings():
|
|
|
369
369
|
f"Set {mwi_env.get_env_name_custom_matlab_root()} to a valid MATLAB root path"
|
|
370
370
|
)
|
|
371
371
|
|
|
372
|
+
mpa_flags = (
|
|
373
|
+
mwi_env.Experimental.get_mpa_flags()
|
|
374
|
+
if mwi_env.Experimental.is_mpa_enabled()
|
|
375
|
+
else ""
|
|
376
|
+
)
|
|
377
|
+
profile_matlab_startup = (
|
|
378
|
+
"-timing" if mwi_env.Experimental.is_matlab_startup_profiling_enabled() else ""
|
|
379
|
+
)
|
|
372
380
|
return {
|
|
373
381
|
"matlab_path": matlab_root_path,
|
|
374
382
|
"matlab_version": matlab_version,
|
|
@@ -377,7 +385,10 @@ def get_matlab_settings():
|
|
|
377
385
|
"-nosplash",
|
|
378
386
|
*flag_to_hide_desktop,
|
|
379
387
|
"-softwareopengl",
|
|
388
|
+
# " v=mvm ",
|
|
380
389
|
*matlab_lic_mode,
|
|
390
|
+
*mpa_flags,
|
|
391
|
+
profile_matlab_startup,
|
|
381
392
|
"-r",
|
|
382
393
|
f"try; run('{matlab_startup_file}'); catch ME; disp(ME.message); end;",
|
|
383
394
|
],
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright 2020-2023 The MathWorks, Inc.
|
|
2
2
|
"""This file lists and exposes the environment variables which are used by the integration."""
|
|
3
3
|
|
|
4
4
|
import os
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
def _is_env_set_to_true(env_name: str) -> bool:
|
|
8
|
+
"""Helper function that returns True if the environment variable specified is set to True.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
env_name (str): Name of the environment variable to check the state for.
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
bool: True if the value of the environment variable is a case insensitive match to the string "True"
|
|
15
|
+
"""
|
|
16
|
+
return os.environ.get(env_name, "false").lower() == "true"
|
|
17
|
+
|
|
18
|
+
|
|
7
19
|
def get_env_name_network_license_manager():
|
|
8
20
|
"""Specifies the path to valid license file or address of a network license server"""
|
|
9
21
|
return "MLM_LICENSE_FILE"
|
|
@@ -20,19 +32,10 @@ def get_env_name_logging_level():
|
|
|
20
32
|
|
|
21
33
|
|
|
22
34
|
def get_env_name_enable_web_logging():
|
|
23
|
-
"""
|
|
35
|
+
"""Enable the logging of asyncio web traffic by setting to true"""
|
|
24
36
|
return "MWI_ENABLE_WEB_LOGGING"
|
|
25
37
|
|
|
26
38
|
|
|
27
|
-
def get_old_env_name_enable_web_logging():
|
|
28
|
-
"""
|
|
29
|
-
Enable the logging of asyncio web traffic by setting to true
|
|
30
|
-
This name is deprecated and was last published in version v0.2.10 of matlab-proxy.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
return "MWI_WEB_LOGGING_ENABLED"
|
|
34
|
-
|
|
35
|
-
|
|
36
39
|
def get_env_name_log_file():
|
|
37
40
|
"""Specifies a file into which logging content is directed"""
|
|
38
41
|
return "MWI_LOG_FILE"
|
|
@@ -89,32 +92,17 @@ def get_env_name_matlab_tempdir():
|
|
|
89
92
|
|
|
90
93
|
def is_development_mode_enabled():
|
|
91
94
|
"""Returns true if the app is in development mode."""
|
|
92
|
-
return
|
|
95
|
+
return _is_env_set_to_true(get_env_name_development())
|
|
93
96
|
|
|
94
97
|
|
|
95
98
|
def is_testing_mode_enabled():
|
|
96
99
|
"""Returns true if the app is in testing mode."""
|
|
97
|
-
return (
|
|
98
|
-
is_development_mode_enabled()
|
|
99
|
-
and os.environ.get(get_env_name_testing(), "false").lower() == "true"
|
|
100
|
-
)
|
|
100
|
+
return is_development_mode_enabled() and _is_env_set_to_true(get_env_name_testing())
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
def is_web_logging_enabled():
|
|
104
104
|
"""Returns true if the web logging is required to be enabled"""
|
|
105
|
-
|
|
106
|
-
if os.environ.get(get_old_env_name_enable_web_logging(), None) is not None:
|
|
107
|
-
from matlab_proxy.util import mwi
|
|
108
|
-
|
|
109
|
-
logger = mwi.logger.get()
|
|
110
|
-
logger.warning(
|
|
111
|
-
f"Usage of {get_old_env_name_enable_web_logging()} is being deprecated from v0.2.10 and will be removed in a future release.\n Use {get_env_name_enable_web_logging()} instead. "
|
|
112
|
-
)
|
|
113
|
-
return (
|
|
114
|
-
os.environ.get(get_old_env_name_enable_web_logging(), "false").lower()
|
|
115
|
-
== "true"
|
|
116
|
-
)
|
|
117
|
-
return os.environ.get(get_env_name_enable_web_logging(), "false").lower() == "true"
|
|
105
|
+
return _is_env_set_to_true(get_env_name_enable_web_logging())
|
|
118
106
|
|
|
119
107
|
|
|
120
108
|
def get_env_name_ssl_cert_file():
|
|
@@ -155,3 +143,56 @@ def get_env_name_custom_matlab_root():
|
|
|
155
143
|
def get_env_name_process_startup_timeout():
|
|
156
144
|
"""User specified timeout in seconds for processes launched by matlab-proxy"""
|
|
157
145
|
return "MWI_PROCESS_START_TIMEOUT"
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class Experimental:
|
|
149
|
+
"""This class houses functions which are undocumented APIs and Environment variables.
|
|
150
|
+
Note: Never add any state to this class. Its only intended for use as an abstraction layer
|
|
151
|
+
for functions which are not ready for prime time.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
@staticmethod
|
|
155
|
+
def get_env_name_enable_simulink():
|
|
156
|
+
"""Returns the environment variable name used to enable simulink support"""
|
|
157
|
+
##NOTE: Simulink Online is unavailable for general use as of R2023b.
|
|
158
|
+
return "MWI_ENABLE_SIMULINK"
|
|
159
|
+
|
|
160
|
+
@staticmethod
|
|
161
|
+
def is_simulink_enabled():
|
|
162
|
+
"""Returns true if the simulink online is enabled."""
|
|
163
|
+
return _is_env_set_to_true(Experimental.get_env_name_enable_simulink())
|
|
164
|
+
|
|
165
|
+
@staticmethod
|
|
166
|
+
def should_use_mos_html():
|
|
167
|
+
"""Returns true if matlab-proxy should use MOS htmls to load MATLAB"""
|
|
168
|
+
return _is_env_set_to_true("MWI_USE_MOS") or Experimental.is_simulink_enabled()
|
|
169
|
+
|
|
170
|
+
@staticmethod
|
|
171
|
+
def should_use_mre_html():
|
|
172
|
+
"""Returns true if matlab-proxy should provide MRE parameter to the htmls used to load MATLAB"""
|
|
173
|
+
return _is_env_set_to_true("MWI_USE_MRE")
|
|
174
|
+
|
|
175
|
+
@staticmethod
|
|
176
|
+
def get_env_name_enable_mpa():
|
|
177
|
+
"""Returns the environment variable name used to enable MPA support"""
|
|
178
|
+
return "MWI_ENABLE_MPA"
|
|
179
|
+
|
|
180
|
+
@staticmethod
|
|
181
|
+
def is_mpa_enabled():
|
|
182
|
+
"""Returns true if the simulink online is enabled."""
|
|
183
|
+
return _is_env_set_to_true(Experimental.get_env_name_enable_mpa())
|
|
184
|
+
|
|
185
|
+
@staticmethod
|
|
186
|
+
def get_env_name_profile_matlab_startup():
|
|
187
|
+
"""Returns the environment variable name used to enable MPA support"""
|
|
188
|
+
return "MWI_PROFILE_MATLAB_STARTUP"
|
|
189
|
+
|
|
190
|
+
@staticmethod
|
|
191
|
+
def is_matlab_startup_profiling_enabled():
|
|
192
|
+
"""Returns true if the simulink online is enabled."""
|
|
193
|
+
return _is_env_set_to_true(Experimental.get_env_name_profile_matlab_startup())
|
|
194
|
+
|
|
195
|
+
@staticmethod
|
|
196
|
+
def get_mpa_flags():
|
|
197
|
+
"""Returns list of flags required to enable MPA"""
|
|
198
|
+
return ["-webui", "-externalUI"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.ttf
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.woff
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Confirmation/Confirmation.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/Information.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.css
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.css
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-error.svg
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-ok.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/__init__.py
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/helpers.py
RENAMED
|
File without changes
|
{matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/request.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|