mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-20 07:43:35 -05:00
WIP
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -162,4 +162,4 @@ use_dev_supervisor.txt
|
||||
/_build_kube_dev/
|
||||
/Dockerfile.kube-dev
|
||||
|
||||
awx/ui-next/ansible-ui
|
||||
awx/ui_next/src
|
||||
|
||||
@@ -6,7 +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/ansible-ui/build *
|
||||
recursive-include awx/ui_next/src/build *
|
||||
recursive-include awx/playbooks *.yml
|
||||
recursive-include awx/lib/site-packages *
|
||||
recursive-include awx/plugins *.ps1
|
||||
|
||||
4
Makefile
4
Makefile
@@ -1,4 +1,4 @@
|
||||
include awx/ui-next/Makefile
|
||||
include awx/ui_next/Makefile
|
||||
|
||||
PYTHON ?= python3.9
|
||||
OFFICIAL ?= no
|
||||
@@ -460,7 +460,7 @@ HEADLESS ?= no
|
||||
ifeq ($(HEADLESS), yes)
|
||||
dist/$(SDIST_TAR_FILE):
|
||||
else
|
||||
dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE) awx/ui-next/ansible-ui/build
|
||||
dist/$(SDIST_TAR_FILE): $(UI_BUILD_FLAG_FILE) awx/ui_next/src/build
|
||||
endif
|
||||
$(PYTHON) -m build -s
|
||||
ln -sf $(SDIST_TAR_FILE) dist/awx.tar.gz
|
||||
|
||||
@@ -85,7 +85,7 @@ USE_TZ = True
|
||||
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, 'ui', 'build', 'static'),
|
||||
os.path.join(BASE_DIR, 'ui-next', 'ansible-ui', 'build'),
|
||||
os.path.join(BASE_DIR, 'ui_next', 'src', 'build'),
|
||||
os.path.join(BASE_DIR, 'static'),
|
||||
]
|
||||
|
||||
@@ -298,7 +298,7 @@ TEMPLATES = [
|
||||
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', 'ansible-ui', 'build', 'controller'),
|
||||
os.path.join(BASE_DIR, 'ui_next', 'src', 'build', 'awx'),
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
ui_next_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
ui_next_dir := $(shell realpath --relative-to $(CURDIR) $(dir $(ui_next_mkfile_path)))
|
||||
|
||||
ANSIBLE_UI_DIR ?= $(ui_next_dir)/src
|
||||
|
||||
ANSIBLE_UI_GIT_REPO_HTTPS ?=
|
||||
ANSIBLE_UI_GIT_REPO_SSH ?=
|
||||
ANSIBLE_UI_GIT_BRANCH ?= main
|
||||
|
||||
ANSIBLE_UI_LOCAL ?=
|
||||
|
||||
.PHONY: ui-next/clone-https
|
||||
## Shallow clone the ui-next repo via https skip if ANSIBLE_UI_GIT_REPO_HTTPS is undefined
|
||||
ui-next/clone-https:
|
||||
@if [ -z "$(ANSIBLE_UI_GIT_REPO_HTTPS)" ]; then \
|
||||
echo "SKIP: ui-next/clone-https. ANSIBLE_UI_GIT_REPO_HTTPS is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui-next/clone-https. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
git clone --depth 1 --branch $(ANSIBLE_UI_GIT_BRANCH) $(ANSIBLE_UI_GIT_REPO_HTTPS) $(ANSIBLE_UI_DIR) || true; \
|
||||
fi
|
||||
|
||||
.PHONY: ui-next/clone-ssh
|
||||
## Shallow clone the ui-next repo via ssh.
|
||||
ui-next/clone-ssh:
|
||||
@if [ -z "$(ANSIBLE_UI_GIT_REPO_SSH)" ]; then \
|
||||
echo "SKIP: ui-next/clone-ssh. ANSIBLE_UI_GIT_REPO_SSH is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui-next/clone-ssh. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
git clone --depth 1 --branch $(ANSIBLE_UI_GIT_BRANCH) $(ANSIBLE_UI_GIT_REPO_SSH) $(ANSIBLE_UI_DIR) || true; \
|
||||
fi
|
||||
|
||||
.PHONY: ui-next/link-local
|
||||
## Link to a existing local clone of ui-next repo.
|
||||
ui-next/link-local:
|
||||
@if [ -z "$(ANSIBLE_UI_LOCAL)" ]; then \
|
||||
echo "SKIP: ui-next/link-local. ANSIBLE_UI_LOCAL is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui-next/link-local. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
ln -s $(ANSIBLE_UI_LOCAL) $(ANSIBLE_UI_DIR); \
|
||||
fi
|
||||
|
||||
.PHONY: ui-next
|
||||
## Try to link to a local clone of ui-next repo if it exist otherwise clone via ssh than https.
|
||||
ui-next:
|
||||
@if [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui-next. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
$(MAKE) ui-next/link-local ui-next/clone-ssh ui-next/clone-https; \
|
||||
fi
|
||||
|
||||
## Alias for ui-next, will not run if ui-next already exist
|
||||
$(ANSIBLE_UI_DIR):
|
||||
$(MAKE) ui-next
|
||||
|
||||
.PHONY: ui-next/build
|
||||
## Build ui-next
|
||||
ui-next/build: ui-next
|
||||
cd $(ANSIBLE_UI_DIR) && \
|
||||
npm install webpack && \
|
||||
npm run build:controller
|
||||
|
||||
## Alias for ui-next/build, will not run if build already exist
|
||||
$(ANSIBLE_UI_DIR)/build:
|
||||
$(MAKE) ui-next/build
|
||||
|
||||
.PHONY: ui-next/clean
|
||||
## Clean ui-next
|
||||
ui-next/clean:
|
||||
rm -rf $(UI_NEXT_BUILD_FLAG_FILE)
|
||||
rm -rf $(ANSIBLE_UI_DIR)
|
||||
|
||||
.PHONY: ui-next/clean/build
|
||||
## Clean ui-next build
|
||||
ui-next/clean/build:
|
||||
rm -rf $(UI_NEXT_BUILD_FLAG_FILE)
|
||||
rm -rf $(ANSIBLE_UI_DIR)/build
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"name": "ui-next",
|
||||
"homepage": ".",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=16.13.1"
|
||||
},
|
||||
|
||||
}
|
||||
80
awx/ui_next/Makefile
Normal file
80
awx/ui_next/Makefile
Normal file
@@ -0,0 +1,80 @@
|
||||
ui_next_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
ui_next_dir := $(shell realpath --relative-to $(CURDIR) $(dir $(ui_next_mkfile_path)))
|
||||
|
||||
ANSIBLE_UI_DIR ?= $(ui_next_dir)/src
|
||||
|
||||
ANSIBLE_UI_GIT_REPO_HTTPS ?=
|
||||
ANSIBLE_UI_GIT_REPO_SSH ?=
|
||||
ANSIBLE_UI_GIT_BRANCH ?= main
|
||||
|
||||
ANSIBLE_UI_LOCAL ?=
|
||||
|
||||
.PHONY: ui_next/clone-https
|
||||
## Shallow clone the ui_next repo via https skip if ANSIBLE_UI_GIT_REPO_HTTPS is undefined
|
||||
ui_next/clone-https:
|
||||
@if [ -z "$(ANSIBLE_UI_GIT_REPO_HTTPS)" ]; then \
|
||||
echo "SKIP: ui_next/clone-https. ANSIBLE_UI_GIT_REPO_HTTPS is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui_next/clone-https. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
git clone --depth 1 --branch $(ANSIBLE_UI_GIT_BRANCH) $(ANSIBLE_UI_GIT_REPO_HTTPS) $(ANSIBLE_UI_DIR) || true; \
|
||||
fi
|
||||
|
||||
.PHONY: ui_next/clone-ssh
|
||||
## Shallow clone the ui_next repo via ssh.
|
||||
ui_next/clone-ssh:
|
||||
@if [ -z "$(ANSIBLE_UI_GIT_REPO_SSH)" ]; then \
|
||||
echo "SKIP: ui_next/clone-ssh. ANSIBLE_UI_GIT_REPO_SSH is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui_next/clone-ssh. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
git clone --depth 1 --branch $(ANSIBLE_UI_GIT_BRANCH) $(ANSIBLE_UI_GIT_REPO_SSH) $(ANSIBLE_UI_DIR) || true; \
|
||||
fi
|
||||
|
||||
.PHONY: ui_next/link-local
|
||||
## Link to a existing local clone of ui_next repo.
|
||||
ui_next/link-local:
|
||||
@if [ -z "$(ANSIBLE_UI_LOCAL)" ]; then \
|
||||
echo "SKIP: ui_next/link-local. ANSIBLE_UI_LOCAL is not set."; \
|
||||
elif [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui_next/link-local. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
ln -s $(ANSIBLE_UI_LOCAL) $(ANSIBLE_UI_DIR); \
|
||||
fi
|
||||
|
||||
.PHONY: ui_next
|
||||
## Try to link to a local clone of ui_next repo if it exist otherwise clone via ssh than https.
|
||||
ui_next:
|
||||
@if [ -d "$(ANSIBLE_UI_DIR)" ]; then \
|
||||
echo "SKIP: ui_next. $(ANSIBLE_UI_DIR) already exists."; \
|
||||
else \
|
||||
$(MAKE) ui_next/link-local ui_next/clone-ssh ui_next/clone-https; \
|
||||
fi
|
||||
|
||||
## Alias for ui_next, will not run if ui_next already exist
|
||||
$(ANSIBLE_UI_DIR):
|
||||
$(MAKE) ui_next
|
||||
|
||||
.PHONY: ui_next/build
|
||||
## Build ui_next
|
||||
ui_next/build: ui_next
|
||||
cd $(ANSIBLE_UI_DIR) && \
|
||||
npm install webpack && \
|
||||
npm run build:awx
|
||||
|
||||
## Alias for ui_next/build, will not run if build already exist
|
||||
$(ANSIBLE_UI_DIR)/build:
|
||||
$(MAKE) ui_next/build
|
||||
|
||||
.PHONY: ui_next/clean
|
||||
## Clean ui_next
|
||||
ui_next/clean:
|
||||
rm -rf $(UI_NEXT_BUILD_FLAG_FILE)
|
||||
rm -rf $(ANSIBLE_UI_DIR)
|
||||
|
||||
.PHONY: ui_next/clean/build
|
||||
## Clean ui_next build
|
||||
ui_next/clean/build:
|
||||
rm -rf $(UI_NEXT_BUILD_FLAG_FILE)
|
||||
rm -rf $(ANSIBLE_UI_DIR)/build
|
||||
|
||||
@@ -6,9 +6,10 @@ from awx.main.utils.licensing import server_product_name
|
||||
|
||||
|
||||
class IndexView(TemplateView):
|
||||
template_name = 'index_controller.html'
|
||||
template_name = 'index_awx.html'
|
||||
|
||||
|
||||
# TODO: Hao fix this
|
||||
class MigrationsNotran(TemplateView):
|
||||
template_name = 'installing.html'
|
||||
|
||||
@@ -23,7 +24,7 @@ class MigrationsNotran(TemplateView):
|
||||
return context
|
||||
|
||||
|
||||
app_name = 'ui-next'
|
||||
app_name = 'ui_next'
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^$', IndexView.as_view(), name='index'),
|
||||
@@ -9,8 +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'^controller/.*$', include('awx.ui-next.urls', namespace='controller')),
|
||||
# re_path(r'^ui-next/', include('awx.ui-next.urls', namespace='ui-next')),
|
||||
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')),
|
||||
|
||||
Reference in New Issue
Block a user