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.

Files changed (130) hide show
  1. {matlab-proxy-0.10.0/matlab_proxy.egg-info → matlab-proxy-0.10.1}/PKG-INFO +1 -1
  2. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/index.js +57 -34
  3. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/reducers/index.js +23 -1
  4. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/selectors/index.js +2 -0
  5. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/app.py +3 -0
  6. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/app_state.py +12 -0
  7. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/settings.py +11 -0
  8. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/environment_variables.py +70 -29
  9. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1/matlab_proxy.egg-info}/PKG-INFO +1 -1
  10. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/setup.py +1 -1
  11. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/LICENSE.md +0 -0
  12. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/MANIFEST.in +0 -0
  13. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/README.md +0 -0
  14. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/.gitignore +0 -0
  15. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/README.md +0 -0
  16. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/package-lock.json +0 -0
  17. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/package.json +0 -0
  18. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/favicon.ico +0 -0
  19. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/index.html +0 -0
  20. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/manifest.json +0 -0
  21. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/public/robots.txt +0 -0
  22. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actionCreators/actionCreators.spec.js +0 -0
  23. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actionCreators/index.js +0 -0
  24. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/actions/index.js +0 -0
  25. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/css/bootstrap.min.css +0 -0
  26. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/css/site7.min.css +0 -0
  27. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.eot +0 -0
  28. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.svg +0 -0
  29. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.ttf +0 -0
  30. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff +0 -0
  31. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/glyphicons-halflings-regular.woff2 +0 -0
  32. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.svg +0 -0
  33. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.ttf +0 -0
  34. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-eps.woff +0 -0
  35. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.svg +0 -0
  36. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.ttf +0 -0
  37. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks-pictograms.woff +0 -0
  38. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.svg +0 -0
  39. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.ttf +0 -0
  40. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/fonts/mathworks.woff +0 -0
  41. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/bug_reports/workaround.gif +0 -0
  42. {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
  43. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-account.svg +0 -0
  44. {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
  45. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-header-contact.svg +0 -0
  46. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/3p/images/responsive/global/ico-sprite.png +0 -0
  47. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/App.css +0 -0
  48. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/App.spec.js +0 -0
  49. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/App/MATLAB-env-blur.png +0 -0
  50. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Confirmation/Confirmation.spec.js +0 -0
  51. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Confirmation/index.js +0 -0
  52. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/Controls.css +0 -0
  53. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/Controls.spec.js +0 -0
  54. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/feedback.svg +0 -0
  55. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/help.svg +0 -0
  56. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/index.js +0 -0
  57. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/restart.svg +0 -0
  58. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/sign-out.svg +0 -0
  59. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/start.svg +0 -0
  60. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/stop.svg +0 -0
  61. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Controls/terminate.svg +0 -0
  62. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/EntitlementSelector/EntitlementSelector.spec.js +0 -0
  63. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/EntitlementSelector/index.js +0 -0
  64. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/Error.css +0 -0
  65. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/Error.spec.js +0 -0
  66. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Error/index.js +0 -0
  67. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/Help.css +0 -0
  68. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/Help.spec.js +0 -0
  69. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Help/index.js +0 -0
  70. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/Information.css +0 -0
  71. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/Information.spec.js +0 -0
  72. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Information/index.js +0 -0
  73. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.css +0 -0
  74. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/ExistingLicense.js +0 -0
  75. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/LicenseGatherer.spec.js +0 -0
  76. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/LicensingGatherer.css +0 -0
  77. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/MHLM.js +0 -0
  78. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/NLM.js +0 -0
  79. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/LicensingGatherer/index.js +0 -0
  80. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/MatlabJsd.css +0 -0
  81. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/MatlabJsd.spec.js +0 -0
  82. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/MatlabJsd/index.js +0 -0
  83. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/Overlay.css +0 -0
  84. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/Overlay.spec.js +0 -0
  85. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/Overlay/index.js +0 -0
  86. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.css +0 -0
  87. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/OverlayTrigger.spec.js +0 -0
  88. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/ResizeOverlayTrigger.spec.js +0 -0
  89. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/arrow.svg +0 -0
  90. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/gripper.svg +0 -0
  91. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/index.js +0 -0
  92. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-error.svg +0 -0
  93. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/components/OverlayTrigger/trigger-ok.svg +0 -0
  94. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/index.css +0 -0
  95. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/index.js +0 -0
  96. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/jest.config.json +0 -0
  97. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/logo.svg +0 -0
  98. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/reducers/reducers.spec.js +0 -0
  99. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/selectors/selectors.spec.js +0 -0
  100. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/serviceWorker.js +0 -0
  101. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/setupTests.js +0 -0
  102. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/gui/src/test/utils/react-test.js +0 -0
  103. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/__init__.py +0 -0
  104. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/constants.py +0 -0
  105. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/default_configuration.py +0 -0
  106. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/devel.py +0 -0
  107. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/icons/matlab.svg +0 -0
  108. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/matlab/startup.m +0 -0
  109. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/__init__.py +0 -0
  110. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/event_loop.py +0 -0
  111. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/list_servers.py +0 -0
  112. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mw.py +0 -0
  113. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/__init__.py +0 -0
  114. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/custom_http_headers.py +0 -0
  115. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/__init__.py +0 -0
  116. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/helpers.py +0 -0
  117. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/embedded_connector/request.py +0 -0
  118. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/exceptions.py +0 -0
  119. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/logger.py +0 -0
  120. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/token_auth.py +0 -0
  121. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/mwi/validators.py +0 -0
  122. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/system.py +0 -0
  123. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy/util/windows.py +0 -0
  124. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/SOURCES.txt +0 -0
  125. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/dependency_links.txt +0 -0
  126. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/entry_points.txt +0 -0
  127. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/not-zip-safe +0 -0
  128. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/requires.txt +0 -0
  129. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/matlab_proxy.egg-info/top_level.txt +0 -0
  130. {matlab-proxy-0.10.0 → matlab-proxy-0.10.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -1,4 +1,4 @@
1
- // Copyright 2020-2022 The MathWorks, Inc.
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
- 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,
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
- }, fetchStatusPeriod);
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
- : './index-jsd-cr.html';
224
+ : `./${htmlToRenderMATLAB()}`;
202
225
 
203
226
  let matlabJsd = null;
204
- if(matlabUp){
205
- matlabJsd = (!authEnabled || isAuthenticated)
206
- ? ( <MatlabJsd url={matlabUrl} /> )
207
- : <img style={{objectFit: 'fill'}}src={blurredBackground} alt='Blurred MATLAB environment'/>
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 (c) 2020-2023 The MathWorks, Inc.
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
- """wef > v0.2.10 Enable the logging of asyncio web traffic by setting to true"""
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 os.environ.get(get_env_name_development(), "false").lower() == "true"
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"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: matlab-proxy
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Python® package enables you to launch MATLAB® and access it from a web browser.
5
5
  Home-page: https://github.com/mathworks/matlab-proxy/
6
6
  Author: The MathWorks, Inc.
@@ -68,7 +68,7 @@ long_description = (HERE / "README.md").read_text()
68
68
 
69
69
  setuptools.setup(
70
70
  name="matlab-proxy",
71
- version="0.10.0",
71
+ version="0.10.1",
72
72
  url=config["doc_url"],
73
73
  author="The MathWorks, Inc.",
74
74
  author_email="cloud@mathworks.com",
File without changes
File without changes
File without changes
File without changes