1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-27 17:55:10 +03:00
awx/awx/ui
2019-05-10 09:18:07 -04:00
..
build load migrations page in dev environment 2019-02-13 09:14:11 -05:00
client Merge branch 'downstream' into devel 2019-05-10 09:18:07 -04:00
grunt-tasks Extract translations from ejs files 2019-02-11 12:59:47 -05:00
po #3415 propose the change translation in Japanese 2019-03-15 08:27:41 +09:00
test Adds some test coverage for host_filter queries 2019-05-08 14:59:04 -04:00
utils Add updates to UI license grabber from jlmitch5. 2018-11-19 12:00:00 -05:00
__init__.py
.eslintignore De-lint test files and update test,build config 2017-10-10 16:59:42 -04:00
.eslintrc.js generate host_config_key using random UUIDs, not a time-based md5 hash 2018-11-28 10:43:45 -05:00
.jshintrc generate host_config_key using random UUIDs, not a time-based md5 hash 2018-11-28 10:43:45 -05:00
.npmrc
apps.py
conf.py Update wording. 2019-04-12 16:09:30 -04:00
context_processors.py make deprecation warnings at /api/ much more obvious 2019-04-18 12:32:49 -04:00
fields.py convert py2 -> py3 2019-01-15 14:09:01 -05:00
Gruntfile.js Update UI build system 2017-09-07 18:09:14 -04:00
models.py
package-lock.json Bumps Bootstrap to 4.3.1 2019-04-15 13:20:00 -04:00
package.json Adding an option to run all the tests without a retry statement 2019-04-23 13:18:34 -04:00
README.md update docs for development environment 2019-03-07 10:30:31 -05:00
urls.py Flake8 fixes and URL updates 2017-11-10 17:04:33 -05:00
views.py Merge branch 'release_3.2.4' into release_3.3.0 2018-04-26 11:10:28 -04:00

AWX UI

Requirements

  • node.js 8.x LTS
  • npm >=5.10
  • bzip2, gcc-c++, git, make

Development

The API development server will need to be running. See CONTRIBUTING.md.

# Build ui for the devel environment - reachable at https://localhost:8043
make ui-devel

# Alternatively, start the ui development server. While running, the ui will be reachable
# at https://localhost:3000 and updated automatically when code changes.
make ui-docker

# When using docker machine, use this command to start the ui development server instead.
DOCKER_MACHINE_NAME=default make ui-docker-machine

Development with an external server

If you normally run awx on an external host/server (in this example, awx.local), you'll need to reconfigure the webpack proxy slightly for make ui-docker to work:

/awx/settings/development.py
+
+CSRF_TRUSTED_ORIGINS = ['awx.local:8043']

awx/ui/build/webpack.watch.js
-        host: '127.0.0.1',
+        host: '0.0.0.0',
+        disableHostCheck: true,

/awx/ui/package.json
@@ -7,7 +7,7 @@
   "config": {
     ...
+    "django_host": "awx.local"
   },

Testing

# run linters
make jshint

# run unit tests
make ui-test-ci

# run e2e tests - see awx/ui/test/e2e for more information
npm --prefix awx/ui run e2e

Note: Unit tests are run on your host machine and not in the development containers.

Adding dependencies

# add an exact development or build dependency
npm install --prefix awx/ui --save-dev --save-exact dev-package@1.2.3
# add an exact production dependency
npm install --prefix awx/ui --save --save-exact prod-package@1.23

# add the updated package.json and package-lock.json files to scm
git add awx/ui/package.json awx/ui/package-lock.json

Removing dependencies

# remove a development or build dependency
npm uninstall --prefix awx/ui --save-dev dev-package

# remove a production dependency
npm uninstall --prefix awx/ui --save prod-package

Building for Production

# built files are placed in awx/ui/static
make ui-release