Skip to content
/ pm2-gui Public
forked from Tjatse/pm2-gui

An elegant web & terminal interface for Unitech/PM2.

License

Notifications You must be signed in to change notification settings

dmzz/pm2-gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pm2-gui NPM version Build Status

An elegant web interface for Unitech/PM2.

Compatible with PM2 v0.12.3.

Guide

# Feature - All the heartbeats (no matter **monitor** or **tail (logs)**) are automatic destroyed. - The `PM2` processes are watched by a subscribed emitter. - Communicated with `PM2` through **RPC** socket directly. - Socket.io between client and server. - Monitor CPU and Memory usage of server in a real-time. - Monitor `PM2` processes in a real-time. - PM2 *restart/stop/delete*. - *stopWatch* files before *restart/stop/delete* - *restartWatch* files before *restart* - Supports [ANSI color codes](#tail_logs) by [ansi-html](https://github.com/Tjatse/ansi-html). # Cautions - Web Interface is wrote by CSS3 && HTML5, so view it with the latest version of the browser (WebGL, Animation, WebSocket supports), e.g. Chrome, Safari and Firefox. - I've never test it on Internet Explorer / Windows. # Installation ``` $ npm install -g pm2-gui ``` # CLI ``` Usage: pm2-gui [cmd] [options]

Commands:

start [options] [port]  Launch the web server, port default by 8088
config                  show all configs
set <key> <value>       set config by key-value pairs
rm <key>                remove config by key

Options:

-h, --help     output usage information
-v, --version  output the version number

Basic Examples:

Start the web server, by default port (8088):
$ pm2-gui start

Start the web server, by specific port (8090):
$ pm2-gui start 8090

<a name="cli_web" />
## Run Web Interface
```bash
  Usage: start [options] [port]

  Options:

    -h, --help       output usage information
    --config [file]  pass JSON config file with options
    --no-debug  hide stdout/stderr information
    --config    path to custom .json config. Default value pm2-gui.json
## Configs ```javascript { "refresh": 3000, "manipulation": true, "pm2": "~/.pm2", "port": 8088 } ```
  • refresh The heartbeat duration of monitor (backend), 5000 by default.
  • manipulation A value indicates whether the client has permission to restart/stop processes, true by default.
  • pm2 Root directory of Unitech/PM2, ~/.pm2 by default.
  • password The encrypted authentication code, if this config is set, users need to be authorized before accessing the index page, password could only be set by pm2-gui set password [password].
  • port Web GUI port, can be set only from config file

You can quit set configurations by pm2-gui start --config [file], the [file] must be an valid JSON, and can including all the above keys.

Example

# Load the JSON configured file which is named as `pm2-gui.json` in current directory.
$ pm2-gui start --config

# Load the specific JSON configured file in current directory.
$ pm2-gui start --config conf.json

Set Config

Usage

$ pm2-gui set <key> <value>

Example

$ pm2-gui set refresh 2000

Above command will set refresh to 2 seconds.

Remove Config

Usage

$ pm2-gui rm <key>

Example

$ pm2-gui rm refresh

Above command will remove refresh config and it will be set to 5000 (milliseconds) by default.

# Authorization Run the following commands: ```bash $ pm2-gui set password 1234 $ pm2-gui start ```

When you visiting http://[domain]:8088 in your browser, it will be redirected to http://[domain]:8088/auth, and you need to typo the password (1234) to login.

Otherwise, if you do not want to deny anybody, just simply remove it:

$ pm2-gui rm password
$ pm2-gui start
# UI/UX - Amazing and smooth animations. - High performance.

Backend (without --no-debug option):

image

Login

image

Home

image

Empty List

image

Processes

image

Describe Complete Information

image

Tail Logs

image

$ npm test

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

An elegant web & terminal interface for Unitech/PM2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 90.3%
  • CSS 5.7%
  • Shell 2.4%
  • HTML 1.6%