Skip to content

Commit ae2f345

Browse files
Added django mgt command to copy vue files to tau dashboard. Added command to startup script, to grab latest compiled version of dashboard app.
1 parent a9c6a72 commit ae2f345

File tree

5 files changed

+39
-9
lines changed

5 files changed

+39
-9
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV PYTHONUNBUFFERED=1 PYTHONHASHSEED=random \
55

66
ENV NODE_VERSION 14
77

8-
RUN curl --proto '=https' --tlsv1.2 -fsLS https://deb.nodesource.com/setup_14.x | sh -\
8+
RUN curl --proto '=https' --tlsv1.2 -fsLS https://deb.nodesource.com/setup_16.x | sh -\
99
&& apt install -y nodejs\
1010
&& npm install --global npm\
1111
&& npm install --global @vue/cli

scripts/start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
./wait_for_postgres.py && \
33
./manage.py migrate && \
4+
./manage.py collect_dashboard && \
45
./manage.py collectstatic --noinput && \
56
./manage.py import_helix_endpoints helix_endpoints.json && \
7+
./manage.py import_eventsub_subscriptions eventsub_subscriptions.json && \
68
/usr/local/bin/supervisord -n -c /etc/supervisord.conf

tau-dashboard/package-lock.json

Lines changed: 16 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tau/config/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class Common(Configuration): # pylint: disable=no-init
1212
BASE_PORT = int(os.environ.get("PORT", 8000))
1313
BASE_URL = f"{PROTOCOL}//{PUBLIC_URL}"
1414
BEHIND_PROXY = (os.environ.get("BEHIND_PROXY", "false").lower() == "true")
15+
BASE_DIR = BASE_DIR
1516

1617
if BASE_PORT not in [80, 443] and not BEHIND_PROXY:
1718
BASE_URL = BASE_URL + f":{BASE_PORT}"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import os
2+
3+
from django.conf import settings
4+
from django.core.management.base import BaseCommand
5+
6+
class Command(BaseCommand):
7+
help = 'Copies vue generated dashboard html/js/css files to proper django dashboard directories.'
8+
9+
def handle(self, *args, **kwargs):
10+
templates_dir = f'{settings.BASE_DIR}/dashboard/templates/dashboard'
11+
static_dir = f'{settings.BASE_DIR}/dashboard/static'
12+
source_dir = f'{settings.BASE_DIR}/../tau-dashboard/dist'
13+
print('Copying compiled dashboard Vue app to templates/static...')
14+
os.system(f'mkdir -p {templates_dir}')
15+
os.system(f'cp -v {source_dir}/index.html {templates_dir}')
16+
if os.path.exists(static_dir):
17+
os.system(f'rm -rf {static_dir}')
18+
os.system(f'cp -rf -v {source_dir}/static {static_dir}')
19+

0 commit comments

Comments
 (0)