From 39d352ebecc424465462b9aa99cc6368b7dfe36a Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 16 Apr 2021 20:30:50 +0100 Subject: [PATCH] Add presenter to bapsicle. --- .github/workflows/build.yaml | 3 +++ .gitignore | 26 ++++++++++---------------- .gitmodules | 3 +++ package-lock.json | 12 ++++++++++++ package.json | 26 ++++++++++++++++++++++++++ presenter | 1 + server.py | 10 ++++++++++ templates/index.html | 4 ++-- 8 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 .gitmodules create mode 100644 package-lock.json create mode 100644 package.json create mode 160000 presenter diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 133868e..be678da 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build .app run: | + npm run presenter-make build/build-macos.sh zip -r build/output/BAPSicle.zip build/output/BAPSicle.app - name: Archive Build @@ -45,6 +46,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build executable run: | + npm run presenter-make build/build-linux.sh - name: Archive Build uses: actions/upload-artifact@v2 @@ -70,6 +72,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Build .exe run: | + npm run presenter-make build/build-windows.bat - name: Archive Build uses: actions/upload-artifact@v2 diff --git a/.gitignore b/.gitignore index d366f2e..ab19151 100644 --- a/.gitignore +++ b/.gitignore @@ -2,31 +2,25 @@ .vscode/settings.json __pycache__/ - - *.egg-info/ +*.pyo +venv/ build/build-exe-config.json +build/build-exe-pyinstaller-command.bat +build/build-exe-pyinstaller-command.sh +build/build/BAPSicle/ +build/output/ +*.spec install/*.exe install/nssm -*.pyo - -*.spec - -build/build-exe-pyinstaller-command.bat - -build/build/BAPSicle/ - -build/output/ - build.py -venv/ - dev/welcome.mp3 -build/build-exe-pyinstaller-command.sh - music-tmp/ + + +presenter-build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..6241b00 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "presenter"] + path = presenter + url = https://github.com/michael-grace/WebStudio.git diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ebfd655 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,12 @@ +{ + "name": "bapsicle", + "version": "0.1.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "0.1.0", + "license": "ISC" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..8b3fd88 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "bapsicle", + "version": "0.1.0", + "description": "Broadcast Playout System", + "main": "index.js", + "directories": { + "doc": "docs", + "test": "tests" + }, + "scripts": { + "presenter-install": "cd presenter && git submodule update --init && yarn --network-timeout 100000", + "presenter-make": "npm run presenter-install && (rm -r presenter-build || true) && cd presenter && yarn build && cp -r build ../presenter-build && cd ../ && npm install", + "test": "echo \"Error: no test specified\" && exit 1", + "presenter-start": "cd presenter && yarn start" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/universityradioyork/bapsicle.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/universityradioyork/bapsicle/issues" + }, + "homepage": "https://github.com/universityradioyork/bapsicle#readme" +} diff --git a/presenter b/presenter new file mode 160000 index 0000000..68b5091 --- /dev/null +++ b/presenter @@ -0,0 +1 @@ +Subproject commit 68b5091b5853dab6ee9ace542eb6fe0a8dc1edf0 diff --git a/server.py b/server.py index 083eec3..e565788 100644 --- a/server.py +++ b/server.py @@ -502,6 +502,16 @@ def serve_static(path: str): return send_from_directory("ui-static", path) +@app.route("/presenter/") +def serve_presenter_index(): + return send_from_directory("presenter-build", "index.html") + + +@app.route("/presenter/") +def serve_presenter_static(path: str): + return send_from_directory("presenter-build", path) + + def startServer(): process_title = "startServer" setproctitle(process_title) diff --git a/templates/index.html b/templates/index.html index 0015f70..8d7c65e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,8 +13,8 @@

Wanted the actual playout controller?

- - Open WebStudio + + Open BAPS Presenter

Version: {{data.server_version}} - Build: {{data.server_build}}