Commit 838a0c0e34d132e9f2bcf7fb3f26ba8e906076d7
1 parent
ed161eb8
Exists in
openam
Update desktop_ssa
Showing
1 changed file
with
123 additions
and
104 deletions
Show diff stats
desktop_ssa.php
... | ... | @@ -59,48 +59,61 @@ |
59 | 59 | |
60 | 60 | <link rel="stylesheet" type="text/css" href="js/lib/ext/resources/css/ext-all.css" /> |
61 | 61 | <link rel="stylesheet" type="text/css" href="js/resources/css/desktop.css" /> |
62 | - <link rel="stylesheet" type="text/css" href="js/resources/css/amda.css" /> | |
62 | + <link rel="stylesheet" type="text/css" href="js/resources/css/amda.css?v=2" /> | |
63 | 63 | |
64 | - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> | |
65 | - <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> | |
66 | - | |
67 | -<!-- <script type="text/javascript" src="js/lib/ext/builds/ext-core.js"></script> --> | |
68 | -<!-- <script type="text/javascript" src="js/lib/ext/bootstrap.js"></script> --> | |
69 | -<!-- <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script>--> | |
70 | - <script type="text/javascript" src="js/lib/ext/ext-all.js"></script> | |
71 | -<!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"> --> | |
72 | - <script type="text/javascript" src="js/lib/ext-override.js"></script> | |
64 | + <link rel="stylesheet" href="js/lib/codemirror/codemirror-5.65.12/lib/codemirror.css"> | |
65 | + <link rel="stylesheet" href="js/lib/codemirror/codemirror-5.65.12/addon/lint/lint.css"> | |
66 | + <link rel="stylesheet" href="js/lib/codemirror/codemirror-5.65.12/addon/hint/show-hint.css"> | |
73 | 67 | |
68 | + <link rel="icon" href="favicon.ico" type="image/x-icon"> | |
69 | + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> | |
74 | 70 | |
75 | - | |
76 | -<!-- Direct API --> | |
77 | - <script type="text/javascript" src="php/api.php"></script> | |
71 | + <!-- <script type="text/javascript" src="js/lib/ext/builds/ext-core.js"></script> --> | |
72 | + <!-- <script type="text/javascript" src="js/lib/ext/bootstrap.js"></script> --> | |
73 | + <!-- <script type="text/javascript" src="js/lib/ext/ext-all-debug-w-comments.js"></script> --> | |
74 | + <script type="text/javascript" src="js/lib/ext/ext-all.js"></script> | |
75 | + <!-- <script type="text/javascript" src="js/lib/ext/ext-all-dev.js"></script> --> | |
76 | + <script type="text/javascript" src="js/lib/ext-override.js"></script> | |
78 | 77 | |
79 | - | |
80 | -<!-- <script src="help/movies/Resources/scripts/prototype.js" language="JavaScript" type="text/javascript"></script> | |
78 | + <!-- Plotly module--> | |
79 | + <script src="js/lib/plotly/plotly-2.14.0.min.js"></script> | |
80 | + | |
81 | + <!-- CodeMirror module--> | |
82 | + <script src="js/lib/codemirror/codemirror-5.65.12/lib/codemirror.js"></script> | |
83 | + <script src="js/lib/codemirror/codemirror-5.65.12/addon/mode/simple.js"></script> | |
84 | + <script src="js/lib/codemirror/codemirror-5.65.12/addon/edit/closebrackets.js"></script> | |
85 | + <script src="js/lib/codemirror/codemirror-5.65.12/addon/lint/lint.js"></script> | |
86 | + <script src="js/lib/codemirror/codemirror-5.65.12/addon/selection/active-line.js"></script> | |
87 | + | |
88 | + <!-- Direct API --> | |
89 | + <script type="text/javascript" src="php/api.php"></script> | |
90 | + | |
91 | + <!-- <script src="help/movies/Resources/scripts/prototype.js" language="JavaScript" type="text/javascript"></script> | |
81 | 92 | <script src="help/movies/Resources/scripts/qtp_poster.js" language="JavaScript" type="text/javascript"></script> |
82 | 93 | <link href="help/movies/Resources/stylesheets/qtp_poster.css" rel="StyleSheet" type="text/css" /> ---> |
83 | 94 | |
84 | 95 | |
85 | 96 | <script type="text/javascript"> |
86 | - //Enable dynamic loading for improved debugging support | |
87 | - Ext.Loader.setConfig({enabled: true}); | |
88 | - | |
97 | + //Enable dynamic loading for improved debugging support | |
98 | + Ext.Loader.setConfig({ | |
99 | + enabled: true | |
100 | + }); | |
101 | + | |
89 | 102 | Ext.Loader.setPath({ |
90 | - 'Ext' : 'js/lib/ext/src', | |
91 | - 'Ext.ux.desktop' : 'js/lib/ux/desktop', | |
92 | - 'Ext.ux' : 'js/lib/ext/examples/ux', | |
93 | - 'MyDesktop' : 'js/lib/ux/desktop/exampleModules', | |
94 | - 'extensions' : 'js/lib/ux', | |
95 | - 'Ext.ux.amdaGrid' : 'js/lib/ux/grid', | |
96 | - 'samp' : 'js/lib/SAMP', | |
97 | - 'amdaDesktop' : 'js/app/controllers', | |
98 | - 'amdaUI' : 'js/app/views', | |
99 | - 'amdaPlotComp' : 'js/app/views/PlotComponents', | |
100 | - 'amdaModel' : 'js/app/models', | |
101 | - 'amdaPlotObj' : 'js/app/models/PlotObjects', | |
102 | - 'amdaReader' : 'js/app/stores', | |
103 | - 'amdaApp' : 'js/app' | |
103 | + 'Ext': 'js/lib/ext/src', | |
104 | + 'Ext.ux.desktop': 'js/lib/ux/desktop', | |
105 | + 'Ext.ux': 'js/lib/ext/examples/ux', | |
106 | + 'MyDesktop': 'js/lib/ux/desktop/exampleModules', | |
107 | + 'extensions': 'js/lib/ux', | |
108 | + 'Ext.ux.amdaGrid': 'js/lib/ux/grid', | |
109 | + 'samp': 'js/lib/SAMP', | |
110 | + 'amdaDesktop': 'js/app/controllers', | |
111 | + 'amdaUI': 'js/app/views', | |
112 | + 'amdaPlotComp': 'js/app/views/PlotComponents', | |
113 | + 'amdaModel': 'js/app/models', | |
114 | + 'amdaPlotObj': 'js/app/models/PlotObjects', | |
115 | + 'amdaReader': 'js/app/stores', | |
116 | + 'amdaApp': 'js/app' | |
104 | 117 | }); |
105 | 118 | |
106 | 119 | Ext.require('amdaDesktop.AmdaStateProvider'); |
... | ... | @@ -110,125 +123,130 @@ |
110 | 123 | Ext.require('amdaApp.AmdaApp'); |
111 | 124 | |
112 | 125 | var myDesktopApp; |
113 | - | |
126 | + | |
114 | 127 | var isMigration = false; |
115 | 128 | var sessionID = '<?php echo $sessionID; ?>'; |
116 | - var isFirstVisit = '<?php echo $usrMgr->isFirst; ?>'; | |
129 | + var isFirstVisit = '<?php echo $usrMgr->isFirst; ?>'; | |
117 | 130 | var isOldWS = false; // '<#?php echo $usrMgr->isOldWS; ?>'; |
118 | - var isSpecialInfo = '<?php echo $usrMgr->isSpecialInfo; ?>'; | |
119 | - var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>'; | |
131 | + var isSpecialInfo = '<?php echo $usrMgr->isSpecialInfo; ?>'; | |
132 | + var isNewInfo = '<?php echo $usrMgr->isNewInfo; ?>'; | |
120 | 133 | var news = '../data/' + sessionID + '/INFO'; |
121 | 134 | |
122 | - var AMDAVERSION = '<?php if (defined('AMDA_VERSION')) echo AMDA_VERSION;?>'; | |
123 | - | |
124 | - var wsSize = '<?php echo $usrMgr->getWsSize(); ?>'; | |
135 | + var AMDAVERSION = '<?php if (defined('AMDA_VERSION')) echo AMDA_VERSION; ?>'; | |
136 | + | |
137 | + var wsSize = '<?php echo $usrMgr->getWsSize(); ?>'; | |
125 | 138 | var diskQuota = '<?php echo DISK_QUOTA; ?>'; |
126 | 139 | |
127 | 140 | var freeSpace = diskQuota - wsSize; |
128 | 141 | |
129 | 142 | var helpDir = 'help/'; |
130 | 143 | var isGuest = sessionID.match('guest'); |
144 | + var amdaDefaultValues = null; | |
145 | + var amdaDefaultConfigs = null; | |
146 | + var amdaDefaultOptions = null; | |
131 | 147 | |
132 | 148 | var max_uploaded_file_size = '<?php echo MAX_UPLOADED_FILESIZE; ?>'; |
133 | - var guestSessionDuration = '<?php echo GuestSessionDuration*60; ?>'; // in secs | |
134 | - var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days | |
135 | - | |
136 | - var gatewayTimeout = '<?php if (defined('GATEWAY_TIMEOUT')) echo GATEWAY_TIMEOUT; else echo 300000; ?>'; // in msec | |
149 | + var guestSessionDuration = '<?php echo GuestSessionDuration * 60; ?>'; // in secs | |
150 | + var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days | |
137 | 151 | |
138 | - var logExecTime = <?php echo (defined('LOG_EXEC_TIME') && (LOG_EXEC_TIME === TRUE) ? 'true' : 'false'); ?>; | |
152 | + var gatewayTimeout = '<?php if (defined('GATEWAY_TIMEOUT')) echo GATEWAY_TIMEOUT; | |
153 | + else echo 300000; ?>'; // in msec | |
139 | 154 | |
155 | + var logExecTime = <?php echo (defined('LOG_EXEC_TIME') && (LOG_EXEC_TIME === TRUE) ? 'true' : 'false'); ?>; | |
140 | 156 | //create mask class (LoadMask for elements has been deprecated, use Ext.dom.Element.mask & Ext.dom.Element.unmask) |
141 | 157 | var AMDAMask = new Ext.Class({ |
142 | - show : function(interactivePlot) | |
143 | - { | |
144 | - var msg = 'Processing...Please wait'; | |
145 | - if (interactivePlot) | |
158 | + show: function(interactivePlot) { | |
159 | + var msg = 'Processing...Please wait'; | |
160 | + if (interactivePlot) | |
146 | 161 | msg += ' <br/> <p align="center"><input id="killopBtn" type="button" value="Kill process" /></p>'; |
147 | 162 | |
148 | - var mask = Ext.getBody().mask(msg); | |
163 | + var mask = Ext.getBody().mask(msg, 'amda-mask'); | |
149 | 164 | |
150 | - mask.dom.style.zIndex = '99998'; | |
151 | - | |
152 | - var maskMsg = Ext.DomQuery.select('div[class=x-mask-msg]'); | |
153 | - if (maskMsg) | |
154 | - maskMsg = maskMsg[0]; | |
155 | - | |
156 | - if (maskMsg) | |
157 | - maskMsg.style.zIndex = '99999'; | |
158 | - if (interactivePlot) | |
159 | - { | |
160 | - var killBtn = Ext.get('killopBtn'); | |
161 | - killBtn.on('click',function(e,t) { | |
162 | - AmdaAction.killPlotRequest(function (result, e) | |
163 | - { | |
164 | - var t = e.getTransaction(); | |
165 | - if (e.status) | |
166 | - { | |
167 | - if (!result) | |
168 | - myDesktopApp.errorMsg('Cannot kill process'); | |
169 | - } | |
170 | - else | |
171 | - myDesktopApp.errorMsg(e.message); | |
172 | - | |
173 | - },this); | |
174 | - | |
175 | - }, | |
176 | - this); | |
165 | + if (interactivePlot) { | |
166 | + var killBtn = Ext.get('killopBtn'); | |
167 | + killBtn.on('click', function(e, t) { | |
168 | + AmdaAction.killPlotRequest(function(result, e) { | |
169 | + var t = e.getTransaction(); | |
170 | + if (e.status) { | |
171 | + if (!result) | |
172 | + myDesktopApp.errorMsg('Cannot kill process'); | |
173 | + } else | |
174 | + myDesktopApp.errorMsg(e.message); | |
175 | + | |
176 | + }, this); | |
177 | + | |
178 | + }, | |
179 | + this); | |
177 | 180 | |
178 | 181 | } |
179 | 182 | }, |
180 | - hide : function() | |
181 | - { | |
183 | + hide: function() { | |
182 | 184 | Ext.getBody().unmask(); |
183 | 185 | this.tid = null; |
184 | 186 | }, |
185 | - isMasked : function() | |
186 | - { | |
187 | + isMasked: function() { | |
187 | 188 | return Ext.getBody().isMasked(); |
188 | 189 | } |
189 | 190 | }); |
190 | - | |
191 | + | |
191 | 192 | var loadMask; |
192 | 193 | |
193 | - Ext.onReady(function () { | |
194 | + Ext.onReady(function() { | |
194 | 195 | //TODO update jobsStatus onLogin |
195 | - Ext.Ajax.extraParams = {sessionID : sessionID}; | |
196 | + Ext.Ajax.extraParams = { | |
197 | + sessionID: sessionID | |
198 | + }; | |
196 | 199 | Ext.Ajax.timeout = gatewayTimeout; // msec ; should be the same value (or less) as gateway timeout |
197 | - Ext.Ajax.on('requestexception', function(conn, response, options, e) { | |
200 | + | |
201 | + Ext.Ajax.on('requestexception', function(conn, response, options, e) { | |
202 | + | |
198 | 203 | if (loadMask && loadMask.isMasked()) |
199 | 204 | loadMask.hide(); |
200 | 205 | |
201 | 206 | if (response && response.statusText) { |
202 | - if (response.timedout) | |
203 | - alert('Request processing time exceeds gateway timeout.<br/>In case of parameter from Remote Bases : please re-launch the same request in 10 min,<br/>otherwise contact AMDA team'); | |
204 | - else | |
207 | + if (response.timedout) | |
208 | + alert('Request processing time exceeds gateway timeout\n In case of parameter from Remote Bases : please re-launch the same request in 10 min,\n otherwise select "non-screen" FileOutput or contact AMDA team'); | |
209 | + else | |
205 | 210 | alert(response.statusText); |
206 | - } | |
207 | - else | |
211 | + } else | |
208 | 212 | alert('Communication failure'); |
209 | - }); | |
213 | + }); | |
210 | 214 | |
211 | 215 | // backspace key disable |
212 | 216 | Ext.EventManager.on(window, 'keydown', function(e, t) { |
213 | 217 | if (e.getKey() == e.BACKSPACE && ((!/^input$/i.test(t.tagName) && !/^textarea$/i.test(t.tagName)) || t.disabled || t.readOnly)) { |
214 | - e.stopEvent(); | |
218 | + e.stopEvent(); | |
215 | 219 | } |
216 | 220 | }); |
217 | 221 | |
218 | 222 | var stateProvider = Ext.create('amdaDesktop.AmdaStateProvider'); |
219 | - | |
220 | 223 | stateProvider.on({ |
221 | 224 | scope: this, |
222 | - afterrestore: function(provider) | |
223 | - { | |
224 | - amdaDesktop.JobsMgr.getStatus(); | |
225 | - Ext.state.Manager.setProvider(provider); | |
226 | - myDesktopApp = new amdaApp.AmdaApp(); | |
227 | - // global message bus | |
228 | - myDesktopApp.EventManager = new Ext.util.Observable(); | |
229 | - // not needed - for documentation only | |
230 | - myDesktopApp.EventManager.addEvents('refresh'); | |
231 | - loadMask = new AMDAMask(); | |
225 | + afterrestore: function(provider) { | |
226 | + AmdaAction.getDefaultValueTree(false, function(defaults){ | |
227 | + if(defaults['success']) | |
228 | + amdaDefaultValues=defaults['defaultValues']; | |
229 | + AmdaAction.getDefaultValueConfigs(function(configs){ | |
230 | + if(configs["success"]) | |
231 | + amdaDefaultConfigs = configs["configs"]; | |
232 | + | |
233 | + AmdaAction.getDefaultValueLinks(function(links){ | |
234 | + if(links["success"]) | |
235 | + amdaDefaultOptions = links['links']; | |
236 | + | |
237 | + amdaDesktop.JobsMgr.getStatus(); | |
238 | + Ext.state.Manager.setProvider(provider); | |
239 | + myDesktopApp = new amdaApp.AmdaApp(); | |
240 | + // global message bus | |
241 | + myDesktopApp.EventManager = new Ext.util.Observable(); | |
242 | + // not needed - for documentation only | |
243 | + myDesktopApp.EventManager.addEvents('refresh'); | |
244 | + loadMask = new AMDAMask(); | |
245 | + }) ; | |
246 | + }); | |
247 | + }) ; | |
248 | + | |
249 | + | |
232 | 250 | } |
233 | 251 | }); |
234 | 252 | |
... | ... | @@ -236,6 +254,7 @@ |
236 | 254 | }); |
237 | 255 | </script> |
238 | 256 | </head> |
239 | -<body/> | |
240 | -</html> | |
241 | 257 | |
258 | +<body /> | |
259 | + | |
260 | +</html> | |
... | ... |