Skip to content

Commit

Permalink
chore: keymetrics -> pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed May 26, 2018
1 parent c4804cb commit 2c8170c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
5 changes: 4 additions & 1 deletion lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,10 @@ class API {
UX.miniDisplay(list);
else if (!commander.silent) {
if (that.gl_interact_infos) {
Common.printOut(chalk.green.bold('●') + ' Agent Online | Dashboard Access: ' + chalk.bold('https://app.keymetrics.io/#/r/%s') + ' | Server name: %s', that.gl_interact_infos.public_key, that.gl_interact_infos.machine_name);
Common.printOut('%s Agent Online | Access: %s | Server: %s',
chalk.green.bold('⇆'),
chalk.bold('https://app.pm2.io/#/r/' + that.gl_interact_infos.public_key),
chalk.bold(that.gl_interact_infos.machine_name));
}
UX.dispAsTable(list, commander);
Common.printOut(chalk.white.italic(' Use `pm2 show <id|name>` to get more details about an app'));
Expand Down
2 changes: 1 addition & 1 deletion lib/API/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Dashboard.init = function() {
});

this.box4 = blessed.text({
content: ' left/right: switch boards | up/down/mouse: scroll | Ctrl-C: exit{|} {cyan-fg}{bold}To go further check out https://keymetrics.io/{/} ',
content: ' left/right: switch boards | up/down/mouse: scroll | Ctrl-C: exit{|} {cyan-fg}{bold}To go further check out https://pm2.io/{/} ',
left: '0%',
top: '95%',
width: '100%',
Expand Down
14 changes: 7 additions & 7 deletions lib/API/Keymetrics/cli-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = function(CLI) {
return that.exitCli(cst.ERROR_EXIT);
}
Common.printOut(chalk.bold('Opening Dashboard in Browser...'));
open('https://app.keymetrics.io/#/r/' + data.public_key);
open('https://app.pm2.io/#/r/' + data.public_key);
setTimeout(function() {
that.exitCli();
}, 200);
Expand All @@ -37,7 +37,7 @@ module.exports = function(CLI) {
CLI.prototype.registerToKM = function() {
printMotd();

promptly.confirm(chalk.bold('Do you have a Keymetrics.io account? (y/n)'), function (err, answer) {
promptly.confirm(chalk.bold('Do you have a pm2.io account? (y/n)'), function (err, answer) {
if (answer == true) {
return loginPrompt();
}
Expand Down Expand Up @@ -130,7 +130,7 @@ module.exports = function(CLI) {
secret_key : target_bucket.secret_id,
pm2_version: pkg.version
}, function(err, dt) {
open('https://app.keymetrics.io/#/r/' + target_bucket.public_id);
open('https://app.pm2.io/#/r/' + target_bucket.public_id);
setTimeout(function() {
process.exit(cst.SUCCESS_EXIT);
}, 100);
Expand All @@ -144,7 +144,7 @@ module.exports = function(CLI) {
*/
function loginPrompt(cb) {
var KM = require('./kmapi.js');
console.log(chalk.bold('Log in to Keymetrics'));
console.log(chalk.bold('Log in to pm2.io'));
(function retry() {
promptly.prompt('Username or Email: ', function(err, username) {
promptly.password('Password: ', { replace : '*' }, function(err, password) {
Expand Down Expand Up @@ -192,7 +192,7 @@ module.exports = function(CLI) {
}
else {
var target_bucket = buckets[0];
console.log('Connecting local PM2 to Keymetrics Bucket [%s]', target_bucket.name);
console.log('Connecting local PM2 Runtime to pm2.io, bucket name= [%s]', target_bucket.name);

KMDaemon.launchAndInteract(cst, {
public_key : target_bucket.public_id,
Expand All @@ -219,7 +219,7 @@ module.exports = function(CLI) {
function registerPrompt() {
var KM = require('./kmapi.js');

console.log(chalk.bold('Now registering to Keymetrics'));
console.log(chalk.bold('Now registering to pm2.io'));
promptly.prompt('Username: ', {
validator : validateUsername,
retry : true
Expand All @@ -229,7 +229,7 @@ module.exports = function(CLI) {
retry : true
}, function(err, email) {
promptly.password('Password: ', { replace : '*' }, function(err, password) {
process.stdout.write(chalk.bold('Creating account on Keymetrics..'));
process.stdout.write(chalk.bold('Creating account on pm2.io ...'));
var inter = setInterval(function() {
process.stdout.write('.');
}, 300);
Expand Down
19 changes: 12 additions & 7 deletions lib/API/Keymetrics/motd
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
__ __ __ _
/ //_/__ __ ______ ___ ___ / /______(_)_________
/ ,< / _ \/ / / / __ `__ \/ _ \/ __/ ___/ / ___/ ___/
/ /| / __/ /_/ / / / / / / __/ /_/ / / / /__(__ )
/_/ |_\___/\__, /_/ /_/ /_/\___/\__/_/ /_/\___/____/
/____/

Harden your Node.js application, today
88888888ba 88b d88 ad888888b, 88 ,ad8888ba,
88 "8b 888b d888 d8" "88 88 d8"' `"8b
88 ,8P 88`8b d8'88 a8P 88 d8' `8b
88aaaaaa8P' 88 `8b d8' 88 ,d8P" 88 88 88
88""""""' 88 `8b d8' 88 a8P" 88 88 88
88 88 `8b d8' 88 a8P' 88 Y8, ,8P
88 88 `888' 88 d8" 888 88 Y8a. .a8P
88 88 `8' 88 88888888888 888 88 `"Y8888Y"'

https://pm2.io/

Add Control and Monitoring to Your Node.js Apps
4 changes: 2 additions & 2 deletions lib/API/Monit.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Monit.reset = function(msg) {

this.multi.charm.reset();

this.multi.write('\x1B[32m⌬ PM2 \x1B[39mmonitoring\x1B[96m (To go further check out https://app.keymetrics.io) \x1B[39m\n\n');
this.multi.write('\x1B[32m⌬ PM2 \x1B[39mmonitoring\x1B[96m (To go further check out https://app.pm2.io) \x1B[39m\n\n');

if(msg) {
this.multi.write(msg);
Expand Down Expand Up @@ -244,4 +244,4 @@ Monit.updateBars = function(proc) {
return this;
}

module.exports = Monit;
module.exports = Monit;

0 comments on commit 2c8170c

Please sign in to comment.