mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-06 17:15:38 -08:00
wf work
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
This functionality allows you to define **custom properties** for devices, which can store and display additional information on the device listing page. By marking properties as visible, you can enhance the user interface with quick actions, notes, or external links.
|
This functionality allows you to define **custom properties** for devices, which can store and display additional information on the device listing page. By marking properties as "Show", you can enhance the user interface with quick actions, notes, or external links.
|
||||||
|
|
||||||
### Key Features:
|
### Key Features:
|
||||||
- **Customizable Properties**: Define specific properties for each device.
|
- **Customizable Properties**: Define specific properties for each device.
|
||||||
@@ -63,10 +63,10 @@ Visible properties (`CUSTPROP_show: true`) are displayed as interactive icons in
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Example Scenarios
|
## Example Use Cases
|
||||||
|
|
||||||
1. **Device Documentation Link**:
|
1. **Device Documentation Link**:
|
||||||
- Add a custom property with `CUSTPROP_type` set to `link` or `link_new_tab` to allow quick navigation to the documentation.
|
- Add a custom property with `CUSTPROP_type` set to `link` or `link_new_tab` to allow quick navigation to the external documentation of the device.
|
||||||
|
|
||||||
2. **Firmware Details**:
|
2. **Firmware Details**:
|
||||||
- Use `CUSTPROP_type: show_notes` to display firmware versions or upgrade instructions in a modal.
|
- Use `CUSTPROP_type: show_notes` to display firmware versions or upgrade instructions in a modal.
|
||||||
|
|||||||
@@ -1,35 +1,38 @@
|
|||||||
## Development environment set up
|
# Development environment set up
|
||||||
|
|
||||||
>[!NOTE]
|
>[!NOTE]
|
||||||
> Replace `/development` with the path where your code files will be stored. The default container name is `netalertx` so there might be a conflict with your running containers.
|
> Replace `/development` with the path where your code files will be stored. The default container name is `netalertx` so there might be a conflict with your running containers.
|
||||||
|
|
||||||
### Development Guidelines
|
## Development Guidelines
|
||||||
|
|
||||||
**Priority Order (Highest to Lowest):**
|
Before starting development, please scan the below development guidelines.
|
||||||
|
|
||||||
|
### Priority Order (Highest to Lowest)
|
||||||
|
|
||||||
1. 🔼 Fixing core bugs that lack workarounds.
|
1. 🔼 Fixing core bugs that lack workarounds.
|
||||||
2. 🔵 Adding core functionality that unlocks other features (e.g., plugins).
|
2. 🔵 Adding core functionality that unlocks other features (e.g., plugins).
|
||||||
3. 🔵 Refactoring to enable faster development.
|
3. 🔵 Refactoring to enable faster development.
|
||||||
4. 🔽 UI improvements (PRs welcome).
|
4. 🔽 UI improvements (PRs welcome).
|
||||||
|
|
||||||
💡 **Design Philosophy:**
|
### Design Philosophy
|
||||||
|
|
||||||
Focus on core functionality and integrate with existing tools rather than reinventing the wheel.
|
Focus on core functionality and integrate with existing tools rather than reinventing the wheel.
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
- Using **Apprise** for notifications instead of implementing multiple separate gateways.
|
- Using **Apprise** for notifications instead of implementing multiple separate gateways.
|
||||||
- Implementing **regex-based validation** instead of one-off validation for each setting.
|
- Implementing **regex-based validation** instead of one-off validation for each setting.
|
||||||
|
|
||||||
📌 **Note on UI requests:**
|
> [!NOTE]
|
||||||
|
> UI changes have lower priority, however, PRs are welcome, but **keep them small & focused**.
|
||||||
|
|
||||||
- UI changes have lower priority due to framework limitations and mobile support constraints.
|
## Development Environment Set Up
|
||||||
- PRs are welcome, but **keep them small & focused**.
|
|
||||||
|
|
||||||
## 1. Download the code:
|
### 1. Download the code:
|
||||||
|
|
||||||
- `mkdir /development`
|
- `mkdir /development`
|
||||||
- `cd /development && git clone https://github.com/jokob-sk/NetAlertX.git`
|
- `cd /development && git clone https://github.com/jokob-sk/NetAlertX.git`
|
||||||
|
|
||||||
## 2. Create a DEV .env_dev file
|
### 2. Create a DEV .env_dev file
|
||||||
|
|
||||||
`touch /development/.env_dev && sudo nano /development/.env_dev`
|
`touch /development/.env_dev && sudo nano /development/.env_dev`
|
||||||
|
|
||||||
@@ -43,10 +46,12 @@ TZ=Europe/Berlin
|
|||||||
PORT=22222 # make sure this port is unique on your whole network
|
PORT=22222 # make sure this port is unique on your whole network
|
||||||
DEV_LOCATION=/development/NetAlertX
|
DEV_LOCATION=/development/NetAlertX
|
||||||
APP_DATA_LOCATION=/volume/docker_appdata
|
APP_DATA_LOCATION=/volume/docker_appdata
|
||||||
|
# Make sure your GRAPHQL_PORT setting has a port that is unique on your whole host network
|
||||||
|
APP_CONF_OVERRIDE={"GRAPHQL_PORT":"22223"}
|
||||||
# ALWAYS_FRESH_INSTALL=true # uncommenting this will always delete the content of /config and /db dirs on boot to simulate a fresh install
|
# ALWAYS_FRESH_INSTALL=true # uncommenting this will always delete the content of /config and /db dirs on boot to simulate a fresh install
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. Create /db and /config dirs
|
### 3. Create /db and /config dirs
|
||||||
|
|
||||||
Create a folder `netalertx` in the `APP_DATA_LOCATION` (in this example in `/volume/docker_appdata`) with 2 subfolders `db` and `config`.
|
Create a folder `netalertx` in the `APP_DATA_LOCATION` (in this example in `/volume/docker_appdata`) with 2 subfolders `db` and `config`.
|
||||||
|
|
||||||
@@ -54,7 +59,7 @@ Create a folder `netalertx` in the `APP_DATA_LOCATION` (in this example in `/vol
|
|||||||
- `mkdir /volume/docker_appdata/netalertx/db`
|
- `mkdir /volume/docker_appdata/netalertx/db`
|
||||||
- `mkdir /volume/docker_appdata/netalertx/config`
|
- `mkdir /volume/docker_appdata/netalertx/config`
|
||||||
|
|
||||||
## 4. Run the container
|
### 4. Run the container
|
||||||
|
|
||||||
- `cd /development/NetAlertX && sudo docker-compose --env-file ../.env_dev `
|
- `cd /development/NetAlertX && sudo docker-compose --env-file ../.env_dev `
|
||||||
|
|
||||||
@@ -63,7 +68,7 @@ You can then modify the python script without restarting/rebuilding the containe
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
## 💡 Tips
|
## Tips
|
||||||
|
|
||||||
A quick cheat sheet of useful commands.
|
A quick cheat sheet of useful commands.
|
||||||
|
|
||||||
@@ -75,9 +80,9 @@ A command to stop, remove the container and the image (replace `netalertx` and `
|
|||||||
|
|
||||||
### Restart the server backend
|
### Restart the server backend
|
||||||
|
|
||||||
Most code changes can be tetsed without rebuilding the container. When working on the python server backend, you only need to restart the server.
|
Most code changes can be tested without rebuilding the container. When working on the python server backend, you only need to restart the server.
|
||||||
|
|
||||||
1. You can usually restart the backend via Maintenance > Logs > Restart server
|
1. You can usually restart the backend via _Maintenance > Logs > Restart_ server
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -86,11 +91,13 @@ Most code changes can be tetsed without rebuilding the container. When working o
|
|||||||
- `sudo docker exec -it netalertx /bin/bash`
|
- `sudo docker exec -it netalertx /bin/bash`
|
||||||
- `pkill -f "python /app/server" && python /app/server & `
|
- `pkill -f "python /app/server" && python /app/server & `
|
||||||
|
|
||||||
3. If none of the above work, restart the docker image. This is usually the last resort as sometimes the Docker engine becomes unresponsive and the whole engine needs to be restarted.
|
3. If none of the above work, restart the docker caontainer.
|
||||||
|
|
||||||
## ➕ Contributing & Pull Requests
|
- This is usually the last resort as sometimes the Docker engine becomes unresponsive and the whole engine needs to be restarted.
|
||||||
|
|
||||||
**Before submitting a PR, please ensure:**
|
## Contributing & Pull Requests
|
||||||
|
|
||||||
|
### Before submitting a PR, please ensure:
|
||||||
|
|
||||||
✔ Changes are **backward-compatible** with existing installs.
|
✔ Changes are **backward-compatible** with existing installs.
|
||||||
✔ No unnecessary changes are made.
|
✔ No unnecessary changes are made.
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# `docker-compose.yaml` Examples
|
# `docker-compose.yaml` Examples
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> The container needs to run in `network_mode:"host"`.
|
||||||
|
|
||||||
### Example 1
|
### Example 1
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -43,14 +43,13 @@ The application installation folder in the docker container has changed from `/h
|
|||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
Exmaples of docker files with the new mount points.
|
Examples of docker files with the new mount points.
|
||||||
|
|
||||||
## Example 1: Mapping folders
|
## Example 1: Mapping folders
|
||||||
|
|
||||||
### Old docker-compose.yml
|
### Old docker-compose.yml
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
pialert:
|
pialert:
|
||||||
container_name: pialert
|
container_name: pialert
|
||||||
@@ -72,7 +71,6 @@ services:
|
|||||||
### New docker-compose.yml
|
### New docker-compose.yml
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
netalertx: # ⚠ This has changed (🟡optional)
|
netalertx: # ⚠ This has changed (🟡optional)
|
||||||
container_name: netalertx # ⚠ This has changed (🟡optional)
|
container_name: netalertx # ⚠ This has changed (🟡optional)
|
||||||
@@ -100,7 +98,6 @@ services:
|
|||||||
### Old docker-compose.yml
|
### Old docker-compose.yml
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
pialert:
|
pialert:
|
||||||
container_name: pialert
|
container_name: pialert
|
||||||
@@ -122,7 +119,6 @@ services:
|
|||||||
### New docker-compose.yml
|
### New docker-compose.yml
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
netalertx: # ⚠ This has changed (🟡optional)
|
netalertx: # ⚠ This has changed (🟡optional)
|
||||||
container_name: netalertx # ⚠ This has changed (🟡optional)
|
container_name: netalertx # ⚠ This has changed (🟡optional)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ NetAlertX provides contextual help within the application:
|
|||||||
|
|
||||||
- **Hover over settings, fields, or labels** to see additional tooltips and guidance.
|
- **Hover over settings, fields, or labels** to see additional tooltips and guidance.
|
||||||
- **Click ❔ (question-mark) icons** next to various elements to view detailed information.
|
- **Click ❔ (question-mark) icons** next to various elements to view detailed information.
|
||||||
- Access the in-app **Help / FAQ** section for frequently asked questions and quick answers.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1524,7 +1524,7 @@ input[readonly] {
|
|||||||
margin:0px;
|
margin:0px;
|
||||||
align-items:center;
|
align-items:center;
|
||||||
border-radius:20px;
|
border-radius:20px;
|
||||||
width:180px;
|
width:190px; /* Don't change, smaller causes line break in network view */
|
||||||
display:flex;
|
display:flex;
|
||||||
flex-direction:column;
|
flex-direction:column;
|
||||||
justify-content:center;
|
justify-content:center;
|
||||||
|
|||||||
Reference in New Issue
Block a user