From 2c8170c25e231eb8827bb0944b76c2f4b041d84e Mon Sep 17 00:00:00 2001 From: Alexandre Strzelewicz Date: Sat, 26 May 2018 19:09:21 +0200 Subject: [PATCH] chore: keymetrics -> pm2 --- lib/API.js | 5 ++++- lib/API/Dashboard.js | 2 +- lib/API/Keymetrics/cli-api.js | 14 +++++++------- lib/API/Keymetrics/motd | 19 ++++++++++++------- lib/API/Monit.js | 4 ++-- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/lib/API.js b/lib/API.js index d99b8d312..514c24eb0 100644 --- a/lib/API.js +++ b/lib/API.js @@ -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 ` to get more details about an app')); diff --git a/lib/API/Dashboard.js b/lib/API/Dashboard.js index 6e12f6c89..85c37a7f6 100644 --- a/lib/API/Dashboard.js +++ b/lib/API/Dashboard.js @@ -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%', diff --git a/lib/API/Keymetrics/cli-api.js b/lib/API/Keymetrics/cli-api.js index 596c0f964..e6561e7dd 100644 --- a/lib/API/Keymetrics/cli-api.js +++ b/lib/API/Keymetrics/cli-api.js @@ -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); @@ -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(); } @@ -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); @@ -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) { @@ -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, @@ -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 @@ -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); diff --git a/lib/API/Keymetrics/motd b/lib/API/Keymetrics/motd index 26b30058a..9d44fc761 100644 --- a/lib/API/Keymetrics/motd +++ b/lib/API/Keymetrics/motd @@ -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 diff --git a/lib/API/Monit.js b/lib/API/Monit.js index 08d9a63af..9d86c27ca 100644 --- a/lib/API/Monit.js +++ b/lib/API/Monit.js @@ -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); @@ -244,4 +244,4 @@ Monit.updateBars = function(proc) { return this; } -module.exports = Monit; \ No newline at end of file +module.exports = Monit;