github.imxd.top/hashicorp/consul@v1.4.5/ui/README.md (about)

     1  ## Consul Web UI
     2  
     3  This directory contains the Consul Web UI. Consul contains a built-in
     4  HTTP server that serves this directory, but any common HTTP server
     5  is capable of serving it.
     6  
     7  It uses JavaScript and [Ember](http://emberjs.com) to communicate with
     8  the [Consul API](https://www.consul.io/api/index.html). The basic
     9  features it provides are:
    10  
    11  - Service view. A list of your registered services, their
    12  health and the nodes they run on.
    13  - Node view. A list of your registered nodes, the services running
    14  on each and the health of the node.
    15  - Key/value view and update
    16  
    17  It's aware of multiple datacenters, so you can get a quick global
    18  overview before drilling into specific data-centers for detailed
    19  views.
    20  
    21  The UI uses some internal undocumented HTTP APIs to optimize
    22  performance and usability.
    23  
    24  ### Development
    25  
    26  Improvements and bug fixes are welcome and encouraged for the Web UI.
    27  
    28  You'll need sass to compile CSS stylesheets. Install that with
    29  bundler:
    30  
    31      cd ui/
    32      bundle
    33  
    34  Reloading compilation for development:
    35  
    36      make watch
    37  
    38  Consul ships with an HTTP server for the API and UI. By default, when
    39  you run the agent, it is off. However, if you pass a `-ui-dir` flag
    40  with a path to this directory, you'll be able to access the UI via the
    41  Consul HTTP server address, which defaults to `localhost:8500/ui`.
    42  
    43  An example of this command, from inside the `ui/` directory, would be:
    44  
    45      consul agent -bootstrap -server -data-dir /tmp/ -ui-dir .
    46  
    47  Basic tests can be run by adding the `?test` query parameter to the
    48  application.
    49  
    50  When developing Consul, it's recommended that you use the included
    51  development configuration.
    52  
    53      consul agent -config-file=development_config.json
    54  
    55  ### Releasing
    56  
    57  `make dist`
    58  
    59  The `../pkg/web_ui` folder will contain the files you should use for deployment.
    60  
    61  ### Acknowledgments
    62  
    63  Cog icon by useiconic.com from the [Noun Project](https://thenounproject.com/term/setting/45865/)
    64  
    65  ### Compiling the UI into the Go binary
    66  
    67  The UI is compiled and shipped with the Consul go binary. The generated bindata
    68  file lives in the `command/agent/bindata_assetfs.go` file and is checked into
    69  source control. This is useful so that not every Consul developer needs to set
    70  up bundler etc. To re-generate the file, first follow the compilation steps
    71  above to build the UI assets into the `pkg/web_ui` folder. With that done, from the
    72  root of the Consul repo, run:
    73  
    74  ```
    75  $ make static-assets
    76  ```
    77  
    78  The file will now be refreshed with the current UI data. You can now rebuild the
    79  Consul binary normally with `make bin` or `make dev`, and see the updated UI
    80  after re-launching Consul.