User interface for NethSecurity and NethSecurity Controller.
This repository includes two user interfaces:
- Standalone: the UI of a NethSecurity unit
- Controller: the UI of NethSecurity Controller that allows you to manage multiple NethSecurity units
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Follow the steps below to prepare the development environment:
- Install NethSecurity on a development machine
- If you need to code Controller UI install and configure NethSecurity Controller
- Create a copy of
.env.development.sample
and rename your copy to.env.development
- Edit
.env.development
:- If you need to code the Standalone UI:
- Set
VITE_STANDALONE_API_ENDPOINT
to the IP address or hostname of your NethSecurity - Set
VITE_UI_MODE
to"standalone"
- Set
- If you need to code the Controller UI:
- Set
VITE_CONTROLLER_API_ENDPOINT
to the IP address or hostname of your NethSecurity Controller - Set
VITE_UI_MODE
to"controller"
- Set
- If you need to code the Standalone UI:
You can develop and build inside a container (recommended) or on your workstation.
You have two options:
Build the container defined by Containerfile
:
podman build -t nethsecurity-ui .
Start development server (--network=host
is required for hot-reload):
podman run -ti -v $(pwd):/app:Z --network=host --name nethsec-ui --replace nethsecurity-ui dev
Compiles and minifies for production:
./build.sh
- Install VSCode extension Dev Containers (beware: this procedure may not work on VSCodium)
- Dev Containers uses Docker by default but you can configure it to use Podman: go to
File > Preferences > Settings
, searchdev containers docker path
and typepodman
asDocker path
- Open
nethsecurity-ui
directory (the repository root) in VSCode, if you haven't already - Open Command Palette (
CTRL+SHIFT+P
) and typeReopen in Container
(orRebuild and Reopen in Container
, if needed) - Open VSCode integrated terminal:
View > Terminal
- Enter one of the following commands:
npm install
: project setupnpm run dev
: start development server with hot-reloadnpm run build
: compiles and minifies for production. Build output is put insidedist
directory
Container configuration is contained inside .devcontainer/devcontainer.json
.
Developing inside a container is the recommended way, but if you want to do it on your workstation:
- Install Node.js (LTS version, currently v18) and npm
- Run a web server on your workstation (hot reloading enabled):
npm install
: project setupnpm run dev
: start development server with hot-reloadnpm run build
: compiles and minifies for production. Build output is put insidedist
directory