From ee7faa55618339378ee565a70bf7d10d7bd60374 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 6 Dec 2017 10:32:50 -0800 Subject: [PATCH 1/2] Warn errors in prod --- ui/app/controllers/application.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/app/controllers/application.js b/ui/app/controllers/application.js index f577ec54eafa..ee8bee9eebc0 100644 --- a/ui/app/controllers/application.js +++ b/ui/app/controllers/application.js @@ -33,6 +33,11 @@ export default Controller.extend({ run.next(() => { throw this.get('error'); }); + } else { + run.next(() => { + // eslint-disable-next-line + console.warn('UNRECOVERABLE ERROR:', this.get('error')); + }); } }), }); From 19d900e896e1c9a81097791fcea864870d37a81a Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Wed, 6 Dec 2017 11:08:01 -0800 Subject: [PATCH 2/2] A short guide for proxying to a different nomad cluster when developing the UI --- ui/DEVELOPMENT_MODE.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ui/DEVELOPMENT_MODE.md diff --git a/ui/DEVELOPMENT_MODE.md b/ui/DEVELOPMENT_MODE.md new file mode 100644 index 000000000000..cd55ae896245 --- /dev/null +++ b/ui/DEVELOPMENT_MODE.md @@ -0,0 +1,42 @@ +## Running the Web UI in development mode against a production Nomad cluster + +:warning: **Running the Web UI in development mode is only necessary when debugging +issues. Unless you are debugging an issue, please only use the Web UI contained +in the Nomad binary.** :warning: + +The production Web UI concatenates and minifies JavaScript and CSS. This can make errors +cryptic or useless. In development mode, files are as expected and stack traces are useful. + +Debugging Web UI issues with the Web UI in development mode is done in three steps: + + 1. Cloning the Nomad Repo + 2. Setting up your environment (or using Vagrant) + 3. Serving the Web UI locally while proxying to the production Nomad cluster + +### Cloning the Nomad Repo + +The Web UI is part of the same repo as Nomad itself. Clone the repo +[using Github](https://help.github.com/articles/cloning-a-repository/). + +### Setting up your environment + +The [Web UI README](README.md) includes a list of software prerequisites and instructions +for running the UI locally or with the Vagrant VM. + +### Serving the Web UI locally while proxying to the production Nomad cluster + +Serving the Web UI is done with a single command in the `/ui` directory. + + - **Local:** `ember serve` + - **Vagrant:** `ember serve --watch polling --port 4201` + +However, this will use the [Mirage fixtures](http://www.ember-cli-mirage.com/) as a backend. +To use your own Nomad cluster as a backend, use the proxy option. + + - **Local:** `ember serve --proxy https://demo.nomadproject.io` + - **Vagrant:** `ember serve --watch polling --port 4201 --proxy https://demo.nomadproject.io` + +The Web UI will now be accessible from your host machine. + + - **Local:** [http://localhost:4200](http://localhost:4200) + - **Vagrant:** [http://localhost:4201](http://localhost:4201)