Skip to content

Commit

Permalink
Basic web interface - work in process (#21)
Browse files Browse the repository at this point in the history
* fix naming for assets

* Update README.md

* fix deploy action

* Config Path based on OS

* s6wrap nginx and fix docker local build

* favicon SDRE logo

* tauri app icon

* adjust cargo toml for front end

* wip

* working menu wuuuuuut

* use enum for checked state

* copyright, layout, remove example stuff, and search component

* fix layout spacing on borders

* Create pallet.png

* clippy

* search box layout and ui stuff

* fix margins

* move body parent div element to base function to avoid duplication

* refactor

* wip

* wip live page laying out

* wip live page laying out

* some color mods

* wip responsive live page layout

* wip map works wooo

* Update map_display.rs

* wip

* wip border stuff

* wip

* more layout margin improvements

* use keys to change panels

* wip on menuing and targeting the container elements

* cargo updates

* wip

* Update to latest rust

* wip

* cargo updates
  • Loading branch information
fredclausen authored May 7, 2024
1 parent 3c1123e commit b61fefd
Show file tree
Hide file tree
Showing 68 changed files with 1,038 additions and 529 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "App v__VERSION__"
tagName: SDREHub-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "SDR-E Hub v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: false
prerelease: false
Expand Down Expand Up @@ -333,6 +333,7 @@ jobs:
get_version_method: cargo_toml_file_in_repo:file=/Cargo.toml
cache_enabled: true
cache_path: ./bin/
cache_key: ${{ github.run_id }}

secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -360,6 +361,7 @@ jobs:
get_version_method: cargo_toml_file_in_repo:file=/Cargo.toml
cache_enabled: true
cache_path: ./bin/
cache_key: ${{ github.run_id }}
docker_latest_tag: test
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/on_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
releaseName: "App v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version.
# releaseName: "App v__VERSION__"
# releaseBody: "See the assets to download this version and install."
# releaseDraft: true
# prerelease: false
args: ${{ matrix.args }}
48 changes: 38 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ homepage = "https://github.com/sdr-enthusiasts/sdre-hub"
repository = "https://github.com/sdr-enthusiasts/sdre-hub"
readme = "README.MD"
license = "MIT"
rust-version = "1.77.2"
rust-version = "1.78.0"
keywords = [
"acars",
"vdlm",
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ COPY ./bin/sdre-hub.armv7/sdre-hub /opt/sdre-hub.armv7
COPY ./bin/sdre-hub.arm64/sdre-hub /opt/sdre-hub.arm64
COPY ./bin/sdre-hub.amd64/sdre-hub /opt/sdre-hub.amd64
COPY ./bin/sh-frontend /opt/sh-frontend

ENV SH_DATA_PATH="/opt/sdre-hub-data"
# hadolint ignore=DL3008,DL3003,SC1091
RUN set -x && \
KEPT_PACKAGES=() && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build_binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.77.2 as builder
FROM rust:1.78.0 as builder
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
WORKDIR /tmp/sdre-hub
# hadolint ignore=DL3008,DL3003,SC1091,DL4006,DL3009
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build_frontend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.77.2 as builder
FROM rust:1.78.0 as builder
WORKDIR /tmp/sdre-hub
# hadolint ignore=DL3008,DL3003,SC1091,DL4006,DL3009
RUN set -x && \
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM rust:1.77.2 as builder
FROM rust:1.78.0 as builder
WORKDIR /tmp/sdre-hub
# hadolint ignore=DL3008,DL3003,SC1091,DL4006
RUN set -x && \
apt-get update && \
apt-get install -y --no-install-recommends libzmq3-dev \
apt-get install -y --no-install-recommends libzmq3-dev && \
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash && \
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && \
cargo binstall trunk wasm-bindgen-cli --no-confirm && \
Expand All @@ -23,6 +23,7 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY rootfs /
COPY --from=builder /tmp/sdre-hub/target/release/sdre-hub /opt/sdre-hub
COPY --from=builder /tmp/sdre-hub/sh-frontend/dist /opt/sh-frontend
ENV SH_DATA_PATH="/opt/sdre-hub-data"
# hadolint ignore=DL3008,DL3003,SC1091
RUN set -x && \
KEPT_PACKAGES=() && \
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Sorry, there is no migration path from ACARS Hub to SDR-E Hub. The data that ACA
- [x] Application build
- [ ] Manage settings from the web interface
- [x] GitHub CI
- [ ] FIXME/TODO Cleanup
- [ ] Alpha 2
- [ ] Connect to data providers
- [ ] ADSB
Expand All @@ -39,13 +40,16 @@ Sorry, there is no migration path from ACARS Hub to SDR-E Hub. The data that ACA
- [ ] Satellite ACARS
- [ ] Combine data from data providers and provide a state machine to manage data
- [ ] Display data on the web interface
- [ ] FIXME/TODO Cleanup
- [ ] Alpha 3
- [ ] Implement database storage
- [ ] RRD style data storage for relevant stats
- [ ] SQL storage for historical data
- [ ] General stats
- [ ] FIXME/TODO Cleanup
- [ ] Beta 1
- [ ] Focus on interface; clean it up, mobile functionality, etc
- [ ] FIXME/TODO Cleanup

## Thank you

Expand Down
2 changes: 1 addition & 1 deletion rootfs/etc/nginx.sdrehub/sites-enabled/sdrehub
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ server {
access_log off;

# cache all of the files
location ~ \.(css|js|png|jpg|jpeg|gif|ico|woff|woff2|ttf|svg|eot|otf|map|mjs|mp3|wasm)$ {
location ~ \.(css|js|png|jpg|jpeg|gif|ico|woff|woff2|ttf|svg|eot|otf|map|mjs|mp3|wasm|webmanifest)$ {
expires 30d;
add_header Cache-Control "public";
root /opt/sh-frontend;
Expand Down
9 changes: 7 additions & 2 deletions rootfs/etc/s6-overlay/scripts/01-config-check
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/command/with-contenv bash
# shellcheck shell=bash
#!/bin/bash
## !/command/with-contenv bash
## shellcheck shell=bash

# check the environment and see if there are any SH_* variables set
# if so, warn the user that they really should be mapping a file
# to /opt/sdre-hub-data and using /opt/sdre-hub-data/sh_config.toml

SH_DATA=$(env | grep '^SH_')

# remove SH_DATA_PATH, if it exists in SH_DATA from the list of variables to check

SH_DATA=$(echo "$SH_DATA" | grep -v '^SH_DATA_PATH')

if [ -n "$SH_DATA" ]; then
echo "[01-config-check] WARNING: You have SH_* environment variables set. You should be using a config file instead."
echo " Please map a directory to /opt/sdre-hub-data and use /opt/sdre-hub-data/sh_config.toml"
Expand Down
12 changes: 4 additions & 8 deletions rootfs/etc/s6-overlay/scripts/nginx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
#!/command/with-contenv bash
#shellcheck shell=bash

# shellcheck disable=SC2016
echo "Starting web proxy service" | stdbuf -oL awk '{print "[nginx ] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
source /scripts/common
s6wrap=(s6wrap --quiet --timestamps --prepend="$(basename "$0")" --args)


# shellcheck disable=SC2016
mkdir -p /var/log/nginx
# TODO: Run this via wiede's script
# shellcheck disable=SC2016
exec \
/usr/sbin/nginx 2>&1 | stdbuf -oL awk '{print "[nginx ] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'

"${s6wrap[@]}" /usr/sbin/nginx
62 changes: 41 additions & 21 deletions sh-frontend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b61fefd

Please sign in to comment.