/weave-ui

Weave UI

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Weave UI

Weave iPaaS 控制台

Usage

Prerequisites:

If you're on a Mac and use Homebrew, you can follow these steps:

  brew install node watchman
  npm install -g bower

Setup:

  ./scripts/update-dependencies

Run development server:

  npm start

Connect to UI at https://localhost:8000/ . The server automatically picks up file changes, restarts itself, and reloads the web browser. This is intended only for development, see below for distributing customizations.

Run development server pointed at another instance of the Rancher API

  RANCHER="http://rancher:8080/" npm start

and/or pointed at another instance of the Catalog API

  CATALOG="http://catalog:8088/" npm start

RANCHER and CATALOG can also be hostname[:port] or ip[:port].

Compiling for distribution

Rancher releases include a static copy of the UI passed in during build as a tarball. To generate that, run:

  ./scripts/build-static

Customizing

We highly suggest making customizations as an ember-cli addon rather than forking this repo, making a bunch of changes and then fighting conflicts to keep it up to date with upstream forever. ui-example-addon-machine is an example addon that adds a custom screen for a docker-machine driver. If there is no way for you to get to what you want to change from an addon, PRs to this repo that add generalized hooks so that you can are accepted.

Hosting remotely

If you want to customize the UI, re-packaging all of Rancher to distribute the UI is possible but not terribly convenient. Instead you can change Cattle to load the UI source from a remote web server:

  • Build with ./scripts/build-static -l -c 'your-server.com'
  • Upload ./dist/static/latest so that it's available at http://your-server.com/latest (you can rename the "latest" part with the -v flag)
  • If your Rancher is behind a SSL proxy, your-server must also respond to SSL requests
  • Change the value of http[s]://your-rancher:8080/v1/settings/api.ui.index to //yourserver.com/latest

Running Tests

  npm install -g ember-cli
  • ember test
  • ember test --server

Useful links

License

Copyright (c) 2014-2017 HeheCloud

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.