Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 11f9474

Browse files
Merge pull request #397 from MicrosoftDX/dev
Dev
2 parents c3539de + 7be5ab5 commit 11f9474

File tree

12 files changed

+60
-30
lines changed

12 files changed

+60
-30
lines changed

.vscode/launch.json

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// Name of configuration; appears in the launch configuration drop down menu.
88
"name": "Launch Server/server.js",
99
// Type of configuration. Possible values: "node", "mono".
10+
"request": "launch",
1011
"type": "node",
1112
// Workspace relative or absolute path to the program.
1213
"program": "${workspaceRoot}/Server/server.js",
@@ -29,19 +30,11 @@
2930
// If JavaScript source maps are enabled, the generated code is expected in this directory.
3031
"outDir": null
3132
},
32-
{
33-
"name": "Attach",
34-
"type": "node",
35-
// TCP/IP address. Default is "localhost".
36-
"address": "localhost",
37-
// Port to attach to.
38-
"port": 5858,
39-
"sourceMaps": false
40-
},
4133
{
4234
// not working since latest vs code and electron versions :-(
4335
"name": "Launch desktop App",
4436
"type": "node",
37+
"request": "launch",
4538
"program": "${workspaceRoot}/desktop/app/background.js",
4639
"stopOnEntry": false,
4740
"args": [
@@ -54,6 +47,7 @@
5447
{
5548
"name": "Launch node.js sample",
5649
"type": "node",
50+
"request": "launch",
5751
"program": "${workspaceRoot}/client samples/nodejs/app.js",
5852
"stopOnEntry": false,
5953
"args": [
@@ -66,6 +60,7 @@
6660
{
6761
"name": "Launch botbuilder sample",
6862
"type": "node",
63+
"request": "launch",
6964
"program": "${workspaceRoot}/client samples/botbuilder/index.js",
7065
"stopOnEntry": false,
7166
"args": [
@@ -78,6 +73,7 @@
7873
{
7974
"name": "Launch ContosoFlowers sample",
8075
"type": "node",
76+
"request": "launch",
8177
"program": "${workspaceRoot}/client samples/contosoflowers/app.js",
8278
"stopOnEntry": false,
8379
"args": [

Plugins/Vorlon/plugins/botFrameworkInspector/control.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ body {
189189
height: 100%;
190190
overflow: hidden;
191191
flex-grow: 5;
192+
max-width: 50%;
192193
}
193194

194195
.scroll {

Plugins/Vorlon/plugins/botFrameworkInspector/vorlon.botFrameworkInspector.dashboard.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
declare var cytoscape: any;
44

55
module VORLON {
6+
declare var vorlonBaseURL: string;
7+
68
export class BotFrameworkInspectorDashboard extends DashboardPlugin {
9+
710
constructor() {
811
super("botFrameworkInspector", "control.html", "control.css");
912
this._ready = false;
@@ -114,7 +117,7 @@ module VORLON {
114117
callback();
115118
};
116119

117-
script.src = url;
120+
script.src = vorlonBaseURL + url;
118121
document.getElementsByTagName("head")[0].appendChild(script);
119122
}
120123

Plugins/Vorlon/vorlon.clientMessenger.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,23 @@
5353
Core._listenClientId = listenClientId;
5454
this._serverUrl = serverUrl;
5555

56+
var options = {
57+
"path": serverUrl.replace(/h.*:\/\/[^\/]*/, "") + "/socket.io"
58+
}
59+
5660
switch (side) {
5761
case RuntimeSide.Client:
58-
this._socket = io.connect(serverUrl);
62+
this._socket = io.connect(serverUrl + "/client", options);
5963
this._isConnected = true;
6064
break;
6165
case RuntimeSide.Dashboard:
62-
this._socket = io.connect(serverUrl + "/dashboard");
66+
this._socket = io.connect(serverUrl + "/dashboard", options);
6367
this._isConnected = true;
6468
break;
6569
}
6670

6771
if (this.isConnected) {
68-
var manager = io.Manager(serverUrl);
72+
var manager = io.Manager(serverUrl, options);
6973
manager.on('connect_error',(err) => {
7074
if (this.onError) {
7175
this.onError(err);

Plugins/Vorlon/vorlon.core.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
Core._side = RuntimeSide.Client;
4949
Core._sessionID = sessionId;
5050
Core._listenClientId = listenClientId;
51+
52+
if(serverUrl[serverUrl.length-1] === '/'){
53+
serverUrl = serverUrl.slice(0, -1);
54+
}
5155

5256
if(serverUrl.match("$https://")){
5357
Core._isHttpsEnabled = true;

Server/Scripts/vorlon.server.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export module VORLON {
7979
});
8080

8181
app.get(this.baseURLConfig.baseURL + "/vorlon.max.js/", (req: any, res: any) => {
82-
res.redirect("/vorlon.max.js/default");
82+
res.redirect(this.baseURLConfig.baseURL + "/vorlon.max.js/default");
8383
});
8484

8585
app.get(this.baseURLConfig.baseURL + "/vorlon.max.js/:idsession", (req: any, res: any) => {
@@ -284,8 +284,14 @@ export module VORLON {
284284
javascriptFile += "if (((typeof window != 'undefined' && window.module) || (typeof module != 'undefined')) && typeof module.exports != 'undefined') {\r\n";
285285
javascriptFile += "module.exports = VORLON;};\r\n";
286286

287+
var startUrl = this.httpConfig.protocol + "://" + req.headers.host;
288+
if(baseUrl) {
289+
var splittedBaseUrl = baseUrl.split('//');
290+
startUrl = splittedBaseUrl[splittedBaseUrl.length - 1] === this.httpConfig.protocol ? baseUrl : startUrl + baseUrl;
291+
}
292+
287293
if (autostart) {
288-
javascriptFile += "\r (function() { VORLON.Core.StartClientSide('" + this.httpConfig.protocol + "://" + req.headers.host + "/', '" + req.params.idsession + "'); }());";
294+
javascriptFile += "\r (function() { VORLON.Core.StartClientSide('" + startUrl + "/', '" + req.params.idsession + "'); }());";
289295
}
290296

291297
res.header('Content-Type', 'application/javascript');
@@ -295,18 +301,21 @@ export module VORLON {
295301
}
296302

297303
public start(httpServer: http.Server): void {
304+
298305
//SOCKET.IO
299-
var io = socketio(httpServer);
306+
var io = socketio(httpServer, { path: this.baseURLConfig.baseURL + "/socket.io" });
300307
this._io = io;
301308

302309
//Listen on /
303-
io.on("connection", socket => {
310+
this._io
311+
.of(this.baseURLConfig.baseURL + "/client")
312+
.on("connection", socket => {
304313
this.addClient(socket);
305314
});
306315

307316
//Listen on /dashboard
308-
var dashboardio = io
309-
.of("/dashboard")
317+
this._io
318+
.of(this.baseURLConfig.baseURL + "/dashboard")
310319
.on("connection", socket => {
311320
this.addDashboard(socket);
312321
});
@@ -420,7 +429,7 @@ export module VORLON {
420429
this._sessions.all().forEach((session) => {
421430
for (var clientid in session.connectedClients) {
422431
var client = session.connectedClients[clientid];
423-
if ("/#" + receiveMessage.data.socketid === client.socket.id) {
432+
if (this.baseURLConfig.baseURL + "/client#" + receiveMessage.data.socketid === client.socket.id) {
424433
client.opened = false;
425434
if (this.dashboards[session.sessionId]) {
426435
this._log.debug(formatLog("PLUGIN", "Send RemoveClient to Dashboard " + socket.id, receiveMessage));

Server/config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
"activateAuth": false,
88
"username": "",
99
"password": "",
10-
"host": "localhost",
10+
"host": "0.0.0.0",
1111
"port": 1337,
1212
"enableWebproxy": true,
1313
"baseProxyURL": "",
14-
"proxyHost": "localhost",
14+
"proxyHost": "0.0.0.0",
1515
"proxyPort": 5050,
1616
"proxyEnvPort": false,
1717
"vorlonServerURL": "",
@@ -143,7 +143,7 @@
143143
"name": "Modernizr",
144144
"panel": "bottom",
145145
"foldername": "modernizrReport",
146-
"enabled": false
146+
"enabled": true
147147
},
148148
{
149149
"id": "DOMTIMELINE",

Server/config/vorlon.baseurlconfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export module VORLON {
1313
var catalogstring = catalogdata.toString().replace(/^\uFEFF/, '');
1414
var catalog = JSON.parse(catalogstring);
1515
if (catalog.baseURL != undefined) {
16-
this.baseURL = catalog.baseURL;
16+
this.baseURL = process.env.BASE_URL || catalog.baseURL;
1717
}
1818
else {
1919
this.baseURL = "";
2020
}
2121

2222
if (catalog.baseProxyURL != undefined) {
23-
this.baseProxyURL = catalog.baseProxyURL;
23+
this.baseProxyURL = process.env.BASE_PROXY_URL || catalog.baseProxyURL;
2424
}
2525
else {
2626
this.baseProxyURL = "";

Server/public/vorlon.dashboardManager.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,23 @@ module VORLON {
1818
DashboardManager.SessionId = sessionid;
1919
DashboardManager.PluginsLoaded = false;
2020
DashboardManager.DisplayingClient = false;
21+
DashboardManager.vorlonBaseURL = vorlonBaseURL;
2122
//Client ID
2223
DashboardManager.ListenClientid = listenClientid;
2324
DashboardManager.ClientList = {};
2425
DashboardManager.StartListeningServer()
2526
DashboardManager.GetClients();
2627
DashboardManager.CatalogUrl = vorlonBaseURL + "/getplugins/" + sessionid;
27-
DashboardManager.vorlonBaseURL = vorlonBaseURL;
2828
}
2929

3030
public static StartListeningServer(clientid: string = ""): void{
3131
var getUrl = window.location;
3232
var baseUrl = getUrl.protocol + "//" + getUrl.host;
33+
34+
if(DashboardManager.vorlonBaseURL) {
35+
baseUrl = DashboardManager.vorlonBaseURL.split('//')[0] === getUrl.protocol ? DashboardManager.vorlonBaseURL : baseUrl + DashboardManager.vorlonBaseURL;
36+
}
37+
3338
VORLON.Core.StopListening();
3439
VORLON.Core.StartDashboardSide(baseUrl, DashboardManager.SessionId, clientid, DashboardManager.divMapper);
3540
if(!VORLON.Core.Messenger.onAddClient && !VORLON.Core.Messenger.onAddClient){

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,16 @@ gulp.task('webserver', function() {
320320

321321
gulp.task('typescript-to-js-server', function() {
322322
var tsResult = gulp.src(['./Server/**/*.ts', '!./Server/node_modules', '!./Server/node_modules/**'], { base: './' })
323-
.pipe(sourcemaps.init())
323+
// .pipe(sourcemaps.init())
324324
.pipe(typescript({ noExternalResolve: true, target: 'ES5', module: 'commonjs' }));
325325

326326
return tsResult.js
327327
.pipe(sourcemaps.write({
328328
includeContent: false,
329329
// Return relative source map root directories per file.
330330
sourceRoot: function (file) {
331-
var sourceFile = path.join(file.cwd, file.sourceMap.file);
332-
return path.relative(path.dirname(sourceFile), file.cwd);
331+
// var sourceFile = path.join(file.cwd, file.sourceMap.file);
332+
// return path.relative(path.dirname(sourceFile), file.cwd);
333333
}
334334
}))
335335
.pipe(gulp.dest('.'));

0 commit comments

Comments
 (0)