summaryrefslogtreecommitdiffstats
path: root/glances/outputs/static/README.md
blob: bac2decbc2d3658ff0fc7a893fc73b7ed630cd3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Focus on the Glances Web User Interface

In order to build the assets of the Web UI, you'll need [NPM](https://docs.npmjs.com/getting-started/what-is-npm).

NPM is a package manager for JavaScript related to [Node.js](https://nodejs.org/en/).

NodeJS should be installed/updated on your system.

## Pre-requisites

### Install NodeJS

Example on Ubuntu OS:

```bash
sudo apt install nodejs
```

### Upgrade NodeJS

Example on Ubuntu OS:

```bash
sudo apt update
sudo apt install nodejs
sudo npm install -g n
sudo n lts
hash -r
```

## Build Glances WebUI

You must run the following command from the `glances/outputs/static/` directory.

### Install dependencies

```bash
$ npm ci
```

### Build assets

Run the build command to build assets once :

```bash
$ npm run build
```

or use the watch command to rebuild only modified files :

```bash
$ npm run watch
```

## Anatomy

```bash
static
|
|--- css
|
|--- images
|
|--- js
|
|--- public # path where builds are put
|
|--- templates (bottle)
```

## Data

Each plugin receives the data in the following format:

* stats
* views
* isBsd
* isLinux
* isMac
* isWindows