forked from MicrosoftDX/Vorlonjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,605 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var VORLON; | ||
(function (VORLON) { | ||
var ExpressClient = (function (_super) { | ||
__extends(ExpressClient, _super); | ||
function ExpressClient() { | ||
_super.call(this, "express"); | ||
this.hooked = false; | ||
this._ready = true; | ||
console.log('Started'); | ||
} | ||
ExpressClient.prototype.getID = function () { | ||
return "NODEJS"; | ||
}; | ||
ExpressClient.prototype.refresh = function () { | ||
}; | ||
ExpressClient.prototype.startClientSide = function () { | ||
}; | ||
ExpressClient.prototype.setupExpressHook = function () { | ||
console.log('Hooking express'); | ||
var expressSource; | ||
if (!VORLON.Tools.IsWindowAvailable) { | ||
if (!this._hookAlreadyDone) { | ||
this._hookAlreadyDone = true; | ||
var express = require('express'); | ||
} | ||
} | ||
this.hooked = true; | ||
}; | ||
ExpressClient.prototype._hookPrototype = function (that, expressSource) { | ||
if (!this._previousExpress) { | ||
this._previousExpress = expressSource.application.init; | ||
} | ||
expressSource.application.init = function () { | ||
console.log('IN EXPRESS !'); | ||
return that._previousExpress.apply(this); | ||
}; | ||
}; | ||
ExpressClient.prototype.onRealtimeMessageReceivedFromDashboardSide = function (receivedObject) { | ||
if (!VORLON.Tools.IsWindowAvailable) { | ||
if (receivedObject == 'express') { | ||
this.sendToDashboard({ type: 'express', data: global.express_vorlonJS }); | ||
} | ||
} | ||
}; | ||
return ExpressClient; | ||
}(VORLON.ClientPlugin)); | ||
VORLON.ExpressClient = ExpressClient; | ||
VORLON.Core.RegisterClientPlugin(new ExpressClient()); | ||
})(VORLON || (VORLON = {})); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var VORLON; | ||
(function (VORLON) { | ||
var NodejsClient = (function (_super) { | ||
__extends(NodejsClient, _super); | ||
function NodejsClient() { | ||
_super.call(this, "nodejs"); | ||
this._ready = true; | ||
console.log('Started'); | ||
} | ||
NodejsClient.prototype.getID = function () { | ||
return "NODEJS"; | ||
}; | ||
NodejsClient.prototype.refresh = function () { | ||
}; | ||
NodejsClient.prototype.startClientSide = function () { | ||
console.log('client'); | ||
}; | ||
NodejsClient.prototype.simpleStringify = function (object) { | ||
var simpleObject = {}; | ||
for (var prop in object) { | ||
if (!object.hasOwnProperty(prop)) { | ||
continue; | ||
} | ||
if (typeof (object[prop]) == 'object') { | ||
continue; | ||
} | ||
if (typeof (object[prop]) == 'function') { | ||
continue; | ||
} | ||
simpleObject[prop] = object[prop]; | ||
} | ||
return JSON.stringify(simpleObject); | ||
}; | ||
; | ||
NodejsClient.prototype.onRealtimeMessageReceivedFromDashboardSide = function (receivedObject) { | ||
if (!VORLON.Tools.IsWindowAvailable) { | ||
if (receivedObject == 'modules') { | ||
this.sendToDashboard({ type: 'modules', data: Object.keys(require('module')._cache) }); | ||
} | ||
else if (receivedObject == 'infos') { | ||
this.sendToDashboard({ type: 'infos', data: { | ||
title: process.title, | ||
version: process.version, | ||
platform: process.platform, | ||
arch: process.arch, | ||
debugPort: process['debugPort'], | ||
pid: process.pid, | ||
USERNAME: process.env.USERNAME, | ||
USERDOMAIN_ROAMINGPROFILE: process.env.USERDOMAIN_ROAMINGPROFILE, | ||
USERPROFILE: process.env.USERPROFILE, | ||
WINDIR: process.env.WINDIR, | ||
UATDATA: process.env.UATDATA, | ||
USERDOMAIN: process.env.USERDOMAIN, | ||
} }); | ||
} | ||
else if (receivedObject == 'memory') { | ||
var _that = this; | ||
_that.sendToDashboard({ type: 'memory', data: process.memoryUsage() }); | ||
setInterval(function () { | ||
_that.sendToDashboard({ type: 'memory', data: process.memoryUsage() }); | ||
}, 5000); | ||
} | ||
} | ||
}; | ||
return NodejsClient; | ||
}(VORLON.ClientPlugin)); | ||
VORLON.NodejsClient = NodejsClient; | ||
VORLON.Core.RegisterClientPlugin(new NodejsClient()); | ||
})(VORLON || (VORLON = {})); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.