diff --git a/.gitignore b/.gitignore index 6231ea4071..1e48c997b8 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,6 @@ use_dev_supervisor.txt /_build/ /_build_kube_dev/ /Dockerfile.kube-dev + +awx/ui_next/src +awx/ui_next/build diff --git a/MANIFEST.in b/MANIFEST.in index 04cde5e9f6..09a5392c50 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ recursive-include awx/templates *.html recursive-include awx/api/templates *.md *.html *.yml recursive-include awx/ui/build *.html recursive-include awx/ui/build * +recursive-include awx/ui_next/build * recursive-include awx/playbooks *.yml recursive-include awx/lib/site-packages * recursive-include awx/plugins *.ps1 diff --git a/Makefile b/Makefile index 310f3f9499..329f790259 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +-include awx/ui_next/Makefile + PYTHON ?= python3.9 DOCKER_COMPOSE ?= docker-compose OFFICIAL ?= no @@ -447,7 +449,7 @@ HEADLESS ?= no ifeq ($(HEADLESS), yes) dist/$(SDIST_TAR_FILE): else -dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE) +dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE) awx/ui_next/build endif $(PYTHON) -m build -s ln -sf $(SDIST_TAR_FILE) dist/awx.tar.gz @@ -495,8 +497,6 @@ docker-compose-sources: .git/hooks/pre-commit -e enable_prometheus=$(PROMETHEUS) \ -e enable_grafana=$(GRAFANA) $(EXTRA_SOURCES_ANSIBLE_OPTS) - - docker-compose: awx/projects docker-compose-sources $(DOCKER_COMPOSE) -f tools/docker-compose/_sources/docker-compose.yml $(COMPOSE_OPTS) up $(COMPOSE_UP_OPTS) --remove-orphans @@ -590,7 +590,7 @@ awx-kube-dev-build: Dockerfile.kube-dev -t $(DEV_DOCKER_TAG_BASE)/awx_kube_devel:$(COMPOSE_TAG) . ## Build awx image for deployment on Kubernetes environment. -awx-kube-build: Dockerfile +awx-kube-build: Dockerfile awx/ui_next/src DOCKER_BUILDKIT=1 docker build -f Dockerfile \ --build-arg VERSION=$(VERSION) \ --build-arg SETUPTOOLS_SCM_PRETEND_VERSION=$(VERSION) \ @@ -652,3 +652,11 @@ help/generate: } \ { lastLine = $$0 }' $(MAKEFILE_LIST) | sort -u @printf "\n" + +## Display help for a specific target folder +help/%: + @make -s help MAKEFILE_LIST="$*/Makefile" + +## Display help for a specific target folder +help/%/aliases: + @make -s help/all MAKEFILE_LIST="$*/Makefile.aliases" \ No newline at end of file diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index 74a36b3e2d..c9bef813d0 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -83,7 +83,11 @@ USE_L10N = True USE_TZ = True -STATICFILES_DIRS = [os.path.join(BASE_DIR, 'ui', 'build', 'static'), os.path.join(BASE_DIR, 'static')] +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'ui', 'build', 'static'), + os.path.join(BASE_DIR, 'ui_next', 'build'), + os.path.join(BASE_DIR, 'static'), +] # Absolute filesystem path to the directory where static file are collected via # the collectstatic command. @@ -290,7 +294,12 @@ TEMPLATES = [ ], 'builtins': ['awx.main.templatetags.swagger'], }, - 'DIRS': [os.path.join(BASE_DIR, 'templates'), os.path.join(BASE_DIR, 'ui', 'build'), os.path.join(BASE_DIR, 'ui', 'public')], + 'DIRS': [ + os.path.join(BASE_DIR, 'templates'), + os.path.join(BASE_DIR, 'ui', 'build'), + os.path.join(BASE_DIR, 'ui', 'public'), + os.path.join(BASE_DIR, 'ui_next', 'build', 'awx'), + ], }, ] diff --git a/awx/ui/src/screens/Dashboard/Dashboard.js b/awx/ui/src/screens/Dashboard/Dashboard.js index 1481b9ac5f..9ec35d7ba0 100644 --- a/awx/ui/src/screens/Dashboard/Dashboard.js +++ b/awx/ui/src/screens/Dashboard/Dashboard.js @@ -1,14 +1,16 @@ import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { t } from '@lingui/macro'; +import { t, Trans } from '@lingui/macro'; import { + Banner, Card, PageSection, Tabs, Tab, TabTitleText, } from '@patternfly/react-core'; +import { InfoCircleIcon } from '@patternfly/react-icons'; import useRequest from 'hooks/useRequest'; import { DashboardAPI } from 'api'; @@ -69,6 +71,15 @@ function Dashboard() { } return ( <> + + +

+ A tech preview of the new Ansible Automation + Platform user interface can be found{' '} + here. +

+
+
+``` + +or + +```bash +export UI_NEXT_GIT_BRANCH_REPO_SSH=git@ +``` + +optionally set branch (default is main) + +```bash +export UI_NEXT_GIT_BRANCH_BRANCH=main +``` + +### via symlink to existing clone + +```bash +export UI_NEXT_LOCAL = /path/to/your/ui_next +``` + +## Build + +```bash +make ui_next/build +``` diff --git a/awx/ui_next/urls.py b/awx/ui_next/urls.py new file mode 100644 index 0000000000..c96994091c --- /dev/null +++ b/awx/ui_next/urls.py @@ -0,0 +1,32 @@ +from django.urls import re_path +from django.utils.translation import gettext_lazy as _ +from django.views.generic.base import TemplateView + +from awx.main.utils.licensing import server_product_name + + +class IndexView(TemplateView): + template_name = 'index_awx.html' + + +# TODO: Hao fix this +class MigrationsNotran(TemplateView): + template_name = 'installing.html' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + product_name = server_product_name() + context['title'] = _('%s Upgrading' % product_name) + context['image_alt'] = _('Logo') + context['aria_spinner'] = _('Loading') + context['message_upgrade'] = _('%s is currently upgrading.' % product_name) + context['message_refresh'] = _('This page will refresh when complete.') + return context + + +app_name = 'ui_next' + +urlpatterns = [ + re_path(r'^$', IndexView.as_view(), name='index'), + re_path(r'^migrations_notran/$', MigrationsNotran.as_view(), name='migrations_notran'), +] diff --git a/awx/urls.py b/awx/urls.py index c99eda011c..605f549d23 100644 --- a/awx/urls.py +++ b/awx/urls.py @@ -9,6 +9,7 @@ from awx.main.views import handle_400, handle_403, handle_404, handle_500, handl urlpatterns = [ re_path(r'', include('awx.ui.urls', namespace='ui')), + re_path(r'^ui_next/.*', include('awx.ui_next.urls', namespace='ui_next')), re_path(r'^api/', include('awx.api.urls', namespace='api')), re_path(r'^sso/', include('awx.sso.urls', namespace='sso')), re_path(r'^sso/', include('social_django.urls', namespace='social')),