start a new React-based UI (#111)

This doesn't do much yet but should provide a better foundation for
improvement than the jQuery UI, as described in the github issue.
This commit is contained in:
Scott Lamb
2021-01-31 21:55:25 -08:00
parent c547a49ac8
commit f281922359
67 changed files with 11454 additions and 8052 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# This file is part of Moonfire NVR, a security camera network video recorder.
# Copyright (C) 2021 The Moonfire NVR Authors; see AUTHORS and LICENSE.txt.
# SPDX-License-Identifier: GPL-v3.0-or-later WITH GPL-3.0-linking-exception.
# SPDX-License-Identifier: GPL-v3.0-or-later WITH GPL-3.0-linking-exception
"""Checks that expected header lines are present.
Call in either of two modes:
@@ -19,14 +19,14 @@ import re
import sys
# Filenames matching this regexp are expected to have the header lines.
FILENAME_MATCHER = re.compile(r'.*\.(py|rs|sh|sql)$')
FILENAME_MATCHER = re.compile(r'.*\.([jt]sx?|html|css|py|rs|sh|sql)$')
MAX_LINE_COUNT = 10
EXPECTED_LINES = [
re.compile(r'This file is part of Moonfire NVR, a security camera network video recorder\.'),
re.compile(r'Copyright \(C\) 20\d{2} The Moonfire NVR Authors; see AUTHORS and LICENSE\.txt\.'),
re.compile(r'SPDX-License-Identifier: GPL-v3\.0-or-later WITH GPL-3\.0-linking-exception\.'),
re.compile(r'SPDX-License-Identifier: GPL-v3\.0-or-later WITH GPL-3\.0-linking-exception\.?'),
]
def has_license(f):

View File

@@ -21,49 +21,51 @@ jobs:
extra_components: rustfmt
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
server/target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libncurses-dev libsqlite3-dev pkgconf
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
- name: Test
run: cd server && cargo test ${{ matrix.extra_args }} --all
- name: Check formatting
if: matrix.rust == 'stable'
run: cd server && cargo fmt --all -- --check
- name: Checkout
uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
server/target
key: ${{ matrix.rust }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libncurses-dev libsqlite3-dev pkgconf
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: ${{ matrix.extra_components }}
- name: Test
run: cd server && cargo test ${{ matrix.extra_args }} --all
- name: Check formatting
if: matrix.rust == 'stable'
run: cd server && cargo fmt --all -- --check
js:
name: Build and lint Javascript frontend
name: Build, test, lint, and check formatting of Javascript frontend
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: cd ui && npm ci
- run: cd ui && npm run build
- run: cd ui && npm run lint
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14"
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: cd ui && npm ci
- run: cd ui && npm run build
- run: cd ui && npm run test
- run: cd ui && npm run lint
- run: cd ui && npm run check-format
license:
name: Check copyright/license headers
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py
- name: Checkout
uses: actions/checkout@v2
- run: find . -type f -print0 | xargs -0 .github/workflows/check-license.py