• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..11-Feb-2020-

app/H03-May-2022-10,56610,020

blueprints/H11-Feb-2020-11

config/H03-May-2022-43

lib/H03-May-2022-5949

node-tests/config/H11-Feb-2020-

public/assets/H03-May-2022-

tests/H03-May-2022-4,1183,937

.editorconfigH A D11-Feb-2020383 2316

.ember-cliH A D11-Feb-2020280 108

.eslintignoreH A D11-Feb-2020294 2217

.gitignoreH A D11-Feb-2020395 2722

.nvmrcH A D11-Feb-20203

.prettierrcH A D11-Feb-202053 43

.watchmanconfigH A D11-Feb-202037 43

GNUmakefileH A D11-Feb-20201.5 KiB8546

README.mdH A D11-Feb-20203.2 KiB10668

_redirectsH A D11-Feb-202031 32

package.jsonH A D11-Feb-20204.8 KiB130129

yarn.lockH A D11-Feb-2020496.1 KiB12,01810,452

README.md

1# consul-ui
2
3
4## Prerequisites
5
6You will need the following things properly installed on your computer.
7
8* [Git](https://git-scm.com/)
9* [Node.js](https://nodejs.org/) (with npm)
10* [yarn](https://yarnpkg.com)
11* [Ember CLI](https://ember-cli.com/)
12* [Google Chrome](https://google.com/chrome/)
13
14## Installation
15
16* `git clone https://github.com/hashicorp/consul.git` this repository
17* `cd ui-v2`
18* `yarn install`
19
20All tooling scripts below primarily use `make` which in turn call node package scripts.
21
22## Running / Development
23
24The source code comes with a small development mode that runs enough of the consul API
25as a set of mocks/fixtures to be able to run the UI without having to run
26consul.
27
28* `make start` or `yarn start` to start the ember app
29* Visit your app at [http://localhost:4200](http://localhost:4200).
30
31To enable ACLs using the mock API, use Web Inspector to set a cookie as follows:
32
33```
34CONSUL_ACLS_ENABLE=1
35```
36
37This will enable the ACLs login page, to which you can login with any ACL
38token/secret.
39
40You can also use a number of other cookie key/values to set various things whilst
41developing the UI, such as (but not limited to):
42
43```
44CONSUL_SERVICE_COUNT=1000
45CONSUL_NODE_CODE=1000
46// etc etc
47```
48
49See `./node_modules/@hashicorp/consul-api-double` for more details.
50
51If you wish to run the UI code against a running consul instance, uncomment the `proxy`
52line in `.ember-cli` to point ember-cli to your consul instance.
53
54You can also run the UI against a normal Consul installation.
55
56`make start-consul` or `yarn run start:consul` will use the `CONSUL_HTTP_ADDR`
57environment variable to locate the Consul installation. If that it not set
58`start-consul` will use `http://localhost:8500`.
59
60Example usage:
61
62```
63CONSUL_HTTP_ADDR=http://10.0.0.1:8500 make start-consul
64```
65
66### Code Generators
67
68Make use of the many generators for code, try `ember help generate` for more details
69
70### Running Tests
71
72Please note: You do not need to run `make start-api`/`yarn run start:api` to run the tests, but the same mock consul API is used.
73
74* `make test` or `yarn run test`
75* `make test-view` or `yarn run test:view` to view the tests running in Chrome
76
77### Linting
78
79`make lint` currently runs linting on the majority of js files and hbs files (using `ember-template-lint`).
80
81See `.eslintrc.js` and `.eslintignore` for specific configuration.
82
83### Building
84
85* `make build` builds the UI for production usage (env=production)
86* `make build-ci` builds the UI for CI/test usage (env=test)
87
88Static files are built into ./dist
89
90#### Running Tests in Parallel
91Alternatively, `ember-exam` can be used to split the tests across multiple browser instances for faster results. Most options are the same as `ember test`. To see a full list of options, run `ember exam --help`.
92
93**Note:** The `EMBER_EXAM_PARALLEL` environment variable must be set to override the default `parallel` value of `1` browser instance in [testem.js](./testem.js).
94
95To quickly run the tests across 4 parallel browser instances:
96```sh
97make test-parallel
98```
99
100To run manually:
101```sh
102$ EMBER_EXAM_PARALLEL=true ./node_modules/.bin/ember exam --split <num> --parallel
103```
104
105More ways to split tests can be found in the [ember-exam README.md](https://github.com/trentmwillis/ember-exam/blob/master/README.md).
106