Compare commits
32 Commits
linting-fi
...
ba3481759b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba3481759b | ||
|
|
7125cea29b | ||
|
|
8586c5a307 | ||
|
|
0d81315809 | ||
|
|
8f193f1e2c | ||
|
|
b1eef8aa09 | ||
|
|
2da17f272c | ||
|
|
7bcb4586b2 | ||
|
|
d3326b3362 | ||
|
|
b9d3f430fe | ||
|
|
067336dcc1 | ||
|
|
8acb0a876a | ||
|
|
d1be41eca4 | ||
|
|
00e953a7ce | ||
|
|
b9ef9ad041 | ||
|
|
e90fbf17d3 | ||
|
|
139447b253 | ||
|
|
fa9fc2c8e3 | ||
|
|
30071c6848 | ||
|
|
b0bd3c8191 | ||
|
|
c753da9e15 | ||
|
|
4770ee5942 | ||
|
|
5cd53bc8f9 | ||
|
|
5e47ccc9ef | ||
|
|
f5d7c0f9a0 | ||
|
|
35b7e80be4 | ||
|
|
07eeac0a0b | ||
|
|
240d86bf1e | ||
|
|
274fd50a92 | ||
|
|
bbf49c3686 | ||
|
|
e3458630ba | ||
|
|
2f6f1e49e9 |
@@ -35,7 +35,7 @@ RUN apk add --no-cache bash shadow python3 python3-dev gcc musl-dev libffi-dev o
|
|||||||
# Create virtual environment owned by root, but readable by everyone else. This makes it easy to copy
|
# Create virtual environment owned by root, but readable by everyone else. This makes it easy to copy
|
||||||
# into hardened stage without worrying about permissions and keeps image size small. Keeping the commands
|
# into hardened stage without worrying about permissions and keeps image size small. Keeping the commands
|
||||||
# together makes for a slightly smaller image size.
|
# together makes for a slightly smaller image size.
|
||||||
RUN pip install -r /tmp/requirements.txt && \
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
|
||||||
chmod -R u-rwx,g-rwx /opt
|
chmod -R u-rwx,g-rwx /opt
|
||||||
|
|
||||||
# second stage is the main runtime stage with just the minimum required to run the application
|
# second stage is the main runtime stage with just the minimum required to run the application
|
||||||
@@ -71,7 +71,7 @@ ENV LOG_APP_PHP_ERRORS=${NETALERTX_LOG}/app.php_errors.log
|
|||||||
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
||||||
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
||||||
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
||||||
ENV LOG_CROND=${NETALERTX_LOG}/crond.log
|
ENV LOG_CRON=${NETALERTX_LOG}/cron.log
|
||||||
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
||||||
|
|
||||||
# System Services configuration files
|
# System Services configuration files
|
||||||
@@ -81,11 +81,11 @@ ENV SYSTEM_SERVICES_SCRIPTS=${SYSTEM_SERVICES}/scripts
|
|||||||
ENV SYSTEM_SERVICES_CONFIG=${SYSTEM_SERVICES}/config
|
ENV SYSTEM_SERVICES_CONFIG=${SYSTEM_SERVICES}/config
|
||||||
ENV SYSTEM_NGINX_CONFIG=${SYSTEM_SERVICES_CONFIG}/nginx
|
ENV SYSTEM_NGINX_CONFIG=${SYSTEM_SERVICES_CONFIG}/nginx
|
||||||
ENV SYSTEM_NGINX_CONFIG_TEMPLATE=${SYSTEM_NGINX_CONFIG}/netalertx.conf.template
|
ENV SYSTEM_NGINX_CONFIG_TEMPLATE=${SYSTEM_NGINX_CONFIG}/netalertx.conf.template
|
||||||
|
ENV SYSTEM_SERVICES_CONFIG_CRON=${SYSTEM_SERVICES_CONFIG}/cron
|
||||||
ENV SYSTEM_SERVICES_ACTIVE_CONFIG=/tmp/nginx/active-config
|
ENV SYSTEM_SERVICES_ACTIVE_CONFIG=/tmp/nginx/active-config
|
||||||
ENV SYSTEM_SERVICES_ACTIVE_CONFIG_FILE=${SYSTEM_SERVICES_ACTIVE_CONFIG}/nginx.conf
|
ENV SYSTEM_SERVICES_ACTIVE_CONFIG_FILE=${SYSTEM_SERVICES_ACTIVE_CONFIG}/nginx.conf
|
||||||
ENV SYSTEM_SERVICES_PHP_FOLDER=${SYSTEM_SERVICES_CONFIG}/php
|
ENV SYSTEM_SERVICES_PHP_FOLDER=${SYSTEM_SERVICES_CONFIG}/php
|
||||||
ENV SYSTEM_SERVICES_PHP_FPM_D=${SYSTEM_SERVICES_PHP_FOLDER}/php-fpm.d
|
ENV SYSTEM_SERVICES_PHP_FPM_D=${SYSTEM_SERVICES_PHP_FOLDER}/php-fpm.d
|
||||||
ENV SYSTEM_SERVICES_CROND=${SYSTEM_SERVICES_CONFIG}/crond
|
|
||||||
ENV SYSTEM_SERVICES_RUN=/tmp/run
|
ENV SYSTEM_SERVICES_RUN=/tmp/run
|
||||||
ENV SYSTEM_SERVICES_RUN_TMP=${SYSTEM_SERVICES_RUN}/tmp
|
ENV SYSTEM_SERVICES_RUN_TMP=${SYSTEM_SERVICES_RUN}/tmp
|
||||||
ENV SYSTEM_SERVICES_RUN_LOG=${SYSTEM_SERVICES_RUN}/logs
|
ENV SYSTEM_SERVICES_RUN_LOG=${SYSTEM_SERVICES_RUN}/logs
|
||||||
@@ -119,7 +119,7 @@ ENV LANG=C.UTF-8
|
|||||||
RUN apk add --no-cache bash mtr libbsd zip lsblk tzdata curl arp-scan iproute2 iproute2-ss nmap \
|
RUN apk add --no-cache bash mtr libbsd zip lsblk tzdata curl arp-scan iproute2 iproute2-ss nmap \
|
||||||
nmap-scripts traceroute nbtscan net-tools net-snmp-tools bind-tools awake ca-certificates \
|
nmap-scripts traceroute nbtscan net-tools net-snmp-tools bind-tools awake ca-certificates \
|
||||||
sqlite php83 php83-fpm php83-cgi php83-curl php83-sqlite3 php83-session python3 envsubst \
|
sqlite php83 php83-fpm php83-cgi php83-curl php83-sqlite3 php83-session python3 envsubst \
|
||||||
nginx shadow && \
|
nginx supercronic shadow && \
|
||||||
rm -Rf /var/cache/apk/* && \
|
rm -Rf /var/cache/apk/* && \
|
||||||
rm -Rf /etc/nginx && \
|
rm -Rf /etc/nginx && \
|
||||||
addgroup -g 20211 ${NETALERTX_GROUP} && \
|
addgroup -g 20211 ${NETALERTX_GROUP} && \
|
||||||
@@ -150,26 +150,26 @@ COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
|||||||
# This is done after the copy of the venv to ensure the venv is in place
|
# This is done after the copy of the venv to ensure the venv is in place
|
||||||
# although it may be quicker to do it before the copy, it keeps the image
|
# although it may be quicker to do it before the copy, it keeps the image
|
||||||
# layers smaller to do it after.
|
# layers smaller to do it after.
|
||||||
RUN if [ -f .VERSION ]; then \
|
RUN if [ -f '.VERSION' ]; then \
|
||||||
cp .VERSION ${NETALERTX_APP}/.VERSION; \
|
cp '.VERSION' "${NETALERTX_APP}/.VERSION"; \
|
||||||
else \
|
else \
|
||||||
echo "DEVELOPMENT 00000000" > ${NETALERTX_APP}/.VERSION; \
|
echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/.VERSION"; \
|
||||||
fi && \
|
fi && \
|
||||||
chown 20212:20212 ${NETALERTX_APP}/.VERSION && \
|
chown 20212:20212 "${NETALERTX_APP}/.VERSION" && \
|
||||||
apk add libcap && \
|
apk add --no-cache libcap && \
|
||||||
setcap cap_net_raw+ep /bin/busybox && \
|
setcap cap_net_raw+ep /bin/busybox && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/arp-scan && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/arp-scan && \
|
||||||
setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nbtscan && \
|
setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nbtscan && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/traceroute && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/traceroute && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip $(readlink -f ${VIRTUAL_ENV_BIN}/python) && \
|
setcap cap_net_raw,cap_net_admin+eip "$(readlink -f ${VIRTUAL_ENV_BIN}/python)" && \
|
||||||
/bin/sh /build/init-nginx.sh && \
|
/bin/sh /build/init-nginx.sh && \
|
||||||
/bin/sh /build/init-php-fpm.sh && \
|
/bin/sh /build/init-php-fpm.sh && \
|
||||||
/bin/sh /build/init-crond.sh && \
|
/bin/sh /build/init-cron.sh && \
|
||||||
/bin/sh /build/init-backend.sh && \
|
/bin/sh /build/init-backend.sh && \
|
||||||
rm -rf /build && \
|
rm -rf /build && \
|
||||||
apk del libcap && \
|
apk del libcap && \
|
||||||
date +%s > ${NETALERTX_FRONT}/buildtimestamp.txt
|
date +%s > "${NETALERTX_FRONT}/buildtimestamp.txt"
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
|
||||||
@@ -186,13 +186,15 @@ ENV UMASK=0077
|
|||||||
# AI may claim this is stupid, but it's actually least possible permissions as
|
# AI may claim this is stupid, but it's actually least possible permissions as
|
||||||
# read-only user cannot login, cannot sudo, has no write permission, and cannot even
|
# read-only user cannot login, cannot sudo, has no write permission, and cannot even
|
||||||
# read the files it owns. The read-only user is ownership-as-a-lock hardening pattern.
|
# read the files it owns. The read-only user is ownership-as-a-lock hardening pattern.
|
||||||
RUN addgroup -g 20212 ${READ_ONLY_GROUP} && \
|
RUN addgroup -g 20212 "${READ_ONLY_GROUP}" && \
|
||||||
adduser -u 20212 -G ${READ_ONLY_GROUP} -D -h /app ${READ_ONLY_USER}
|
adduser -u 20212 -G "${READ_ONLY_GROUP}" -D -h /app "${READ_ONLY_USER}"
|
||||||
|
|
||||||
|
|
||||||
# reduce permissions to minimum necessary for all NetAlertX files and folders
|
# reduce permissions to minimum necessary for all NetAlertX files and folders
|
||||||
# Permissions 005 and 004 are not typos, they enable read-only. Everyone can
|
# Permissions 005 and 004 are not typos, they enable read-only. Everyone can
|
||||||
# read the read-only files, and nobody can write to them, even the readonly user.
|
# read the read-only files, and nobody can write to them, even the readonly user.
|
||||||
|
|
||||||
|
# hadolint ignore=SC2114
|
||||||
RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
||||||
chmod -R 004 ${READ_ONLY_FOLDERS} && \
|
chmod -R 004 ${READ_ONLY_FOLDERS} && \
|
||||||
find ${READ_ONLY_FOLDERS} -type d -exec chmod 005 {} + && \
|
find ${READ_ONLY_FOLDERS} -type d -exec chmod 005 {} + && \
|
||||||
@@ -211,7 +213,7 @@ RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
|||||||
/srv /media && \
|
/srv /media && \
|
||||||
sed -i "/^\(${READ_ONLY_USER}\|${NETALERTX_USER}\):/!d" /etc/passwd && \
|
sed -i "/^\(${READ_ONLY_USER}\|${NETALERTX_USER}\):/!d" /etc/passwd && \
|
||||||
sed -i "/^\(${READ_ONLY_GROUP}\|${NETALERTX_GROUP}\):/!d" /etc/group && \
|
sed -i "/^\(${READ_ONLY_GROUP}\|${NETALERTX_GROUP}\):/!d" /etc/group && \
|
||||||
echo -ne '#!/bin/sh\n"$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo
|
printf '#!/bin/sh\n"$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo
|
||||||
|
|
||||||
USER netalertx
|
USER netalertx
|
||||||
|
|
||||||
@@ -230,6 +232,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|||||||
# Open and wide to avoid permission issues during development allowing max
|
# Open and wide to avoid permission issues during development allowing max
|
||||||
# flexibility.
|
# flexibility.
|
||||||
|
|
||||||
|
# hadolint ignore=DL3006
|
||||||
FROM runner AS netalertx-devcontainer
|
FROM runner AS netalertx-devcontainer
|
||||||
ENV INSTALL_DIR=/app
|
ENV INSTALL_DIR=/app
|
||||||
|
|
||||||
@@ -243,9 +246,14 @@ ENV PYDEVD_DISABLE_FILE_VALIDATION=1
|
|||||||
COPY .devcontainer/resources/devcontainer-overlay/ /
|
COPY .devcontainer/resources/devcontainer-overlay/ /
|
||||||
USER root
|
USER root
|
||||||
# Install common tools, create user, and set up sudo
|
# Install common tools, create user, and set up sudo
|
||||||
|
|
||||||
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
|
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
|
||||||
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
|
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
|
||||||
docker-cli-compose
|
docker-cli-compose shellcheck
|
||||||
|
|
||||||
|
# Install hadolint (Dockerfile linter)
|
||||||
|
RUN curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o /usr/local/bin/hadolint && \
|
||||||
|
chmod +x /usr/local/bin/hadolint
|
||||||
|
|
||||||
RUN install -d -o netalertx -g netalertx -m 755 /services/php/modules && \
|
RUN install -d -o netalertx -g netalertx -m 755 /services/php/modules && \
|
||||||
cp -a /usr/lib/php83/modules/. /services/php/modules/ && \
|
cp -a /usr/lib/php83/modules/. /services/php/modules/ && \
|
||||||
|
|||||||
@@ -75,7 +75,9 @@
|
|||||||
"alexcvzz.vscode-sqlite",
|
"alexcvzz.vscode-sqlite",
|
||||||
"mkhl.shfmt",
|
"mkhl.shfmt",
|
||||||
"charliermarsh.ruff",
|
"charliermarsh.ruff",
|
||||||
"ms-python.flake8"
|
"ms-python.flake8",
|
||||||
|
"exiasr.hadolint",
|
||||||
|
"timonwong.shellcheck"
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"terminal.integrated.cwd": "${containerWorkspaceFolder}",
|
"terminal.integrated.cwd": "${containerWorkspaceFolder}",
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
# Open and wide to avoid permission issues during development allowing max
|
# Open and wide to avoid permission issues during development allowing max
|
||||||
# flexibility.
|
# flexibility.
|
||||||
|
|
||||||
|
# hadolint ignore=DL3006
|
||||||
FROM runner AS netalertx-devcontainer
|
FROM runner AS netalertx-devcontainer
|
||||||
ENV INSTALL_DIR=/app
|
ENV INSTALL_DIR=/app
|
||||||
|
|
||||||
@@ -20,9 +21,14 @@ ENV PYDEVD_DISABLE_FILE_VALIDATION=1
|
|||||||
COPY .devcontainer/resources/devcontainer-overlay/ /
|
COPY .devcontainer/resources/devcontainer-overlay/ /
|
||||||
USER root
|
USER root
|
||||||
# Install common tools, create user, and set up sudo
|
# Install common tools, create user, and set up sudo
|
||||||
|
|
||||||
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
|
RUN apk add --no-cache git nano vim jq php83-pecl-xdebug py3-pip nodejs sudo gpgconf pytest \
|
||||||
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
|
pytest-cov zsh alpine-zsh-config shfmt github-cli py3-yaml py3-docker-py docker-cli docker-cli-buildx \
|
||||||
docker-cli-compose
|
docker-cli-compose shellcheck
|
||||||
|
|
||||||
|
# Install hadolint (Dockerfile linter)
|
||||||
|
RUN curl -L https://github.com/hadolint/hadolint/releases/latest/download/hadolint-Linux-x86_64 -o /usr/local/bin/hadolint && \
|
||||||
|
chmod +x /usr/local/bin/hadolint
|
||||||
|
|
||||||
RUN install -d -o netalertx -g netalertx -m 755 /services/php/modules && \
|
RUN install -d -o netalertx -g netalertx -m 755 /services/php/modules && \
|
||||||
cp -a /usr/lib/php83/modules/. /services/php/modules/ && \
|
cp -a /usr/lib/php83/modules/. /services/php/modules/ && \
|
||||||
|
|||||||
@@ -7,27 +7,28 @@
|
|||||||
# the final .devcontainer/Dockerfile used by the devcontainer.
|
# the final .devcontainer/Dockerfile used by the devcontainer.
|
||||||
|
|
||||||
echo "Generating .devcontainer/Dockerfile"
|
echo "Generating .devcontainer/Dockerfile"
|
||||||
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
SCRIPT_PATH=$(set -- "$0"; dirname -- "$1")
|
||||||
|
SCRIPT_DIR=$(cd "$SCRIPT_PATH" && pwd -P)
|
||||||
DEVCONTAINER_DIR="${SCRIPT_DIR%/scripts}"
|
DEVCONTAINER_DIR="${SCRIPT_DIR%/scripts}"
|
||||||
ROOT_DIR="${DEVCONTAINER_DIR%/.devcontainer}"
|
ROOT_DIR="${DEVCONTAINER_DIR%/.devcontainer}"
|
||||||
|
|
||||||
OUT_FILE="${DEVCONTAINER_DIR}/Dockerfile"
|
OUT_FILE="${DEVCONTAINER_DIR}/Dockerfile"
|
||||||
|
|
||||||
echo "Adding base Dockerfile from $ROOT_DIR..."
|
echo "Adding base Dockerfile from $ROOT_DIR and merging to devcontainer-Dockerfile"
|
||||||
|
{
|
||||||
|
|
||||||
echo "# DO NOT MODIFY THIS FILE DIRECTLY. IT IS AUTO-GENERATED BY .devcontainer/scripts/generate-configs.sh" > "$OUT_FILE"
|
echo "# DO NOT MODIFY THIS FILE DIRECTLY. IT IS AUTO-GENERATED BY .devcontainer/scripts/generate-configs.sh"
|
||||||
echo "" >> "$OUT_FILE"
|
echo ""
|
||||||
echo "# ---/Dockerfile---" >> "$OUT_FILE"
|
echo "# ---/Dockerfile---"
|
||||||
|
|
||||||
cat "${ROOT_DIR}/Dockerfile" >> "$OUT_FILE"
|
cat "${ROOT_DIR}/Dockerfile"
|
||||||
|
|
||||||
echo "" >> "$OUT_FILE"
|
echo ""
|
||||||
echo "# ---/resources/devcontainer-Dockerfile---" >> "$OUT_FILE"
|
echo "# ---/resources/devcontainer-Dockerfile---"
|
||||||
echo "" >> "$OUT_FILE"
|
echo ""
|
||||||
|
cat "${DEVCONTAINER_DIR}/resources/devcontainer-Dockerfile"
|
||||||
|
} > "$OUT_FILE"
|
||||||
|
|
||||||
echo "Adding devcontainer-Dockerfile from $DEVCONTAINER_DIR/resources..."
|
echo "Generated $OUT_FILE using root dir $ROOT_DIR"
|
||||||
cat "${DEVCONTAINER_DIR}/resources/devcontainer-Dockerfile" >> "$OUT_FILE"
|
|
||||||
|
|
||||||
echo "Generated $OUT_FILE using root dir $ROOT_DIR" >&2
|
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
SOURCE_DIR=${SOURCE_DIR:-/workspaces/NetAlertX}
|
SOURCE_DIR=${SOURCE_DIR:-/workspaces/NetAlertX}
|
||||||
PY_SITE_PACKAGES="${VIRTUAL_ENV:-/opt/venv}/lib/python3.12/site-packages"
|
PY_SITE_PACKAGES="${VIRTUAL_ENV:-/opt/venv}/lib/python3.12/site-packages"
|
||||||
SOURCE_SERVICES_DIR="${SOURCE_DIR}/install/production-filesystem/services"
|
|
||||||
|
|
||||||
LOG_FILES=(
|
LOG_FILES=(
|
||||||
LOG_APP
|
LOG_APP
|
||||||
@@ -26,7 +25,7 @@ LOG_FILES=(
|
|||||||
LOG_EXECUTION_QUEUE
|
LOG_EXECUTION_QUEUE
|
||||||
LOG_APP_PHP_ERRORS
|
LOG_APP_PHP_ERRORS
|
||||||
LOG_IP_CHANGES
|
LOG_IP_CHANGES
|
||||||
LOG_CROND
|
LOG_CRON
|
||||||
LOG_REPORT_OUTPUT_TXT
|
LOG_REPORT_OUTPUT_TXT
|
||||||
LOG_REPORT_OUTPUT_HTML
|
LOG_REPORT_OUTPUT_HTML
|
||||||
LOG_REPORT_OUTPUT_JSON
|
LOG_REPORT_OUTPUT_JSON
|
||||||
|
|||||||
6
.github/copilot-instructions.md
vendored
@@ -83,3 +83,9 @@ Backend loop phases (see `server/__main__.py` and `server/plugin.py`): `once`, `
|
|||||||
- Be sure to offer choices when appropriate.
|
- Be sure to offer choices when appropriate.
|
||||||
- Always understand the intent of the user's request and undo/redo as needed.
|
- Always understand the intent of the user's request and undo/redo as needed.
|
||||||
- Above all, use the simplest possible code that meets the need so it can be easily audited and maintained.
|
- Above all, use the simplest possible code that meets the need so it can be easily audited and maintained.
|
||||||
|
- Always leave logging enabled. If there is a possiblity it will be difficult to debug with current logging, add more logging.
|
||||||
|
- Always run the testFailure tool before executing any tests to gather current failure information and avoid redundant runs.
|
||||||
|
- Always prioritize using the appropriate tools in the environment first. As an example if a test is failing use `testFailure` then `runTests`. Never `runTests` first.
|
||||||
|
- Docker tests take an extremely long time to run. Avoid changes to docker or tests until you've examined the exisiting testFailures and runTests results.
|
||||||
|
- Environment tools are designed specifically for your use in this project and running them in this order will give you the best results.
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/code_checks.yml
vendored
@@ -84,7 +84,7 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
echo "🔍 Linting Dockerfiles..."
|
echo "🔍 Linting Dockerfiles..."
|
||||||
/tmp/hadolint Dockerfile* || true
|
/tmp/hadolint --config .hadolint.yaml Dockerfile* || true
|
||||||
|
|
||||||
docker-tests:
|
docker-tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -95,5 +95,5 @@ jobs:
|
|||||||
- name: Run Docker-based tests
|
- name: Run Docker-based tests
|
||||||
run: |
|
run: |
|
||||||
echo "🐳 Running Docker-based tests..."
|
echo "🐳 Running Docker-based tests..."
|
||||||
chmod +x ./run_docker_tests.sh
|
chmod +x ./test/docker_tests/run_docker_tests.sh
|
||||||
./run_docker_tests.sh
|
./test/docker_tests/run_docker_tests.sh
|
||||||
|
|||||||
2
.hadolint.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ignored:
|
||||||
|
- DL3018
|
||||||
32
Dockerfile
@@ -32,7 +32,7 @@ RUN apk add --no-cache bash shadow python3 python3-dev gcc musl-dev libffi-dev o
|
|||||||
# Create virtual environment owned by root, but readable by everyone else. This makes it easy to copy
|
# Create virtual environment owned by root, but readable by everyone else. This makes it easy to copy
|
||||||
# into hardened stage without worrying about permissions and keeps image size small. Keeping the commands
|
# into hardened stage without worrying about permissions and keeps image size small. Keeping the commands
|
||||||
# together makes for a slightly smaller image size.
|
# together makes for a slightly smaller image size.
|
||||||
RUN pip install -r /tmp/requirements.txt && \
|
RUN pip install --no-cache-dir -r /tmp/requirements.txt && \
|
||||||
chmod -R u-rwx,g-rwx /opt
|
chmod -R u-rwx,g-rwx /opt
|
||||||
|
|
||||||
# second stage is the main runtime stage with just the minimum required to run the application
|
# second stage is the main runtime stage with just the minimum required to run the application
|
||||||
@@ -68,7 +68,7 @@ ENV LOG_APP_PHP_ERRORS=${NETALERTX_LOG}/app.php_errors.log
|
|||||||
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
||||||
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
||||||
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
||||||
ENV LOG_CROND=${NETALERTX_LOG}/crond.log
|
ENV LOG_CRON=${NETALERTX_LOG}/cron.log
|
||||||
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
||||||
|
|
||||||
# System Services configuration files
|
# System Services configuration files
|
||||||
@@ -78,11 +78,11 @@ ENV SYSTEM_SERVICES_SCRIPTS=${SYSTEM_SERVICES}/scripts
|
|||||||
ENV SYSTEM_SERVICES_CONFIG=${SYSTEM_SERVICES}/config
|
ENV SYSTEM_SERVICES_CONFIG=${SYSTEM_SERVICES}/config
|
||||||
ENV SYSTEM_NGINX_CONFIG=${SYSTEM_SERVICES_CONFIG}/nginx
|
ENV SYSTEM_NGINX_CONFIG=${SYSTEM_SERVICES_CONFIG}/nginx
|
||||||
ENV SYSTEM_NGINX_CONFIG_TEMPLATE=${SYSTEM_NGINX_CONFIG}/netalertx.conf.template
|
ENV SYSTEM_NGINX_CONFIG_TEMPLATE=${SYSTEM_NGINX_CONFIG}/netalertx.conf.template
|
||||||
|
ENV SYSTEM_SERVICES_CONFIG_CRON=${SYSTEM_SERVICES_CONFIG}/cron
|
||||||
ENV SYSTEM_SERVICES_ACTIVE_CONFIG=/tmp/nginx/active-config
|
ENV SYSTEM_SERVICES_ACTIVE_CONFIG=/tmp/nginx/active-config
|
||||||
ENV SYSTEM_SERVICES_ACTIVE_CONFIG_FILE=${SYSTEM_SERVICES_ACTIVE_CONFIG}/nginx.conf
|
ENV SYSTEM_SERVICES_ACTIVE_CONFIG_FILE=${SYSTEM_SERVICES_ACTIVE_CONFIG}/nginx.conf
|
||||||
ENV SYSTEM_SERVICES_PHP_FOLDER=${SYSTEM_SERVICES_CONFIG}/php
|
ENV SYSTEM_SERVICES_PHP_FOLDER=${SYSTEM_SERVICES_CONFIG}/php
|
||||||
ENV SYSTEM_SERVICES_PHP_FPM_D=${SYSTEM_SERVICES_PHP_FOLDER}/php-fpm.d
|
ENV SYSTEM_SERVICES_PHP_FPM_D=${SYSTEM_SERVICES_PHP_FOLDER}/php-fpm.d
|
||||||
ENV SYSTEM_SERVICES_CROND=${SYSTEM_SERVICES_CONFIG}/crond
|
|
||||||
ENV SYSTEM_SERVICES_RUN=/tmp/run
|
ENV SYSTEM_SERVICES_RUN=/tmp/run
|
||||||
ENV SYSTEM_SERVICES_RUN_TMP=${SYSTEM_SERVICES_RUN}/tmp
|
ENV SYSTEM_SERVICES_RUN_TMP=${SYSTEM_SERVICES_RUN}/tmp
|
||||||
ENV SYSTEM_SERVICES_RUN_LOG=${SYSTEM_SERVICES_RUN}/logs
|
ENV SYSTEM_SERVICES_RUN_LOG=${SYSTEM_SERVICES_RUN}/logs
|
||||||
@@ -116,7 +116,7 @@ ENV LANG=C.UTF-8
|
|||||||
RUN apk add --no-cache bash mtr libbsd zip lsblk tzdata curl arp-scan iproute2 iproute2-ss nmap \
|
RUN apk add --no-cache bash mtr libbsd zip lsblk tzdata curl arp-scan iproute2 iproute2-ss nmap \
|
||||||
nmap-scripts traceroute nbtscan net-tools net-snmp-tools bind-tools awake ca-certificates \
|
nmap-scripts traceroute nbtscan net-tools net-snmp-tools bind-tools awake ca-certificates \
|
||||||
sqlite php83 php83-fpm php83-cgi php83-curl php83-sqlite3 php83-session python3 envsubst \
|
sqlite php83 php83-fpm php83-cgi php83-curl php83-sqlite3 php83-session python3 envsubst \
|
||||||
nginx shadow && \
|
nginx supercronic shadow && \
|
||||||
rm -Rf /var/cache/apk/* && \
|
rm -Rf /var/cache/apk/* && \
|
||||||
rm -Rf /etc/nginx && \
|
rm -Rf /etc/nginx && \
|
||||||
addgroup -g 20211 ${NETALERTX_GROUP} && \
|
addgroup -g 20211 ${NETALERTX_GROUP} && \
|
||||||
@@ -147,26 +147,26 @@ COPY --from=builder --chown=20212:20212 ${VIRTUAL_ENV} ${VIRTUAL_ENV}
|
|||||||
# This is done after the copy of the venv to ensure the venv is in place
|
# This is done after the copy of the venv to ensure the venv is in place
|
||||||
# although it may be quicker to do it before the copy, it keeps the image
|
# although it may be quicker to do it before the copy, it keeps the image
|
||||||
# layers smaller to do it after.
|
# layers smaller to do it after.
|
||||||
RUN if [ -f .VERSION ]; then \
|
RUN if [ -f '.VERSION' ]; then \
|
||||||
cp .VERSION ${NETALERTX_APP}/.VERSION; \
|
cp '.VERSION' "${NETALERTX_APP}/.VERSION"; \
|
||||||
else \
|
else \
|
||||||
echo "DEVELOPMENT 00000000" > ${NETALERTX_APP}/.VERSION; \
|
echo "DEVELOPMENT 00000000" > "${NETALERTX_APP}/.VERSION"; \
|
||||||
fi && \
|
fi && \
|
||||||
chown 20212:20212 ${NETALERTX_APP}/.VERSION && \
|
chown 20212:20212 "${NETALERTX_APP}/.VERSION" && \
|
||||||
apk add libcap && \
|
apk add --no-cache libcap && \
|
||||||
setcap cap_net_raw+ep /bin/busybox && \
|
setcap cap_net_raw+ep /bin/busybox && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/nmap && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/arp-scan && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/arp-scan && \
|
||||||
setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nbtscan && \
|
setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nbtscan && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip /usr/bin/traceroute && \
|
setcap cap_net_raw,cap_net_admin+eip /usr/bin/traceroute && \
|
||||||
setcap cap_net_raw,cap_net_admin+eip $(readlink -f ${VIRTUAL_ENV_BIN}/python) && \
|
setcap cap_net_raw,cap_net_admin+eip "$(readlink -f ${VIRTUAL_ENV_BIN}/python)" && \
|
||||||
/bin/sh /build/init-nginx.sh && \
|
/bin/sh /build/init-nginx.sh && \
|
||||||
/bin/sh /build/init-php-fpm.sh && \
|
/bin/sh /build/init-php-fpm.sh && \
|
||||||
/bin/sh /build/init-crond.sh && \
|
/bin/sh /build/init-cron.sh && \
|
||||||
/bin/sh /build/init-backend.sh && \
|
/bin/sh /build/init-backend.sh && \
|
||||||
rm -rf /build && \
|
rm -rf /build && \
|
||||||
apk del libcap && \
|
apk del libcap && \
|
||||||
date +%s > ${NETALERTX_FRONT}/buildtimestamp.txt
|
date +%s > "${NETALERTX_FRONT}/buildtimestamp.txt"
|
||||||
|
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
|
||||||
@@ -183,13 +183,15 @@ ENV UMASK=0077
|
|||||||
# AI may claim this is stupid, but it's actually least possible permissions as
|
# AI may claim this is stupid, but it's actually least possible permissions as
|
||||||
# read-only user cannot login, cannot sudo, has no write permission, and cannot even
|
# read-only user cannot login, cannot sudo, has no write permission, and cannot even
|
||||||
# read the files it owns. The read-only user is ownership-as-a-lock hardening pattern.
|
# read the files it owns. The read-only user is ownership-as-a-lock hardening pattern.
|
||||||
RUN addgroup -g 20212 ${READ_ONLY_GROUP} && \
|
RUN addgroup -g 20212 "${READ_ONLY_GROUP}" && \
|
||||||
adduser -u 20212 -G ${READ_ONLY_GROUP} -D -h /app ${READ_ONLY_USER}
|
adduser -u 20212 -G "${READ_ONLY_GROUP}" -D -h /app "${READ_ONLY_USER}"
|
||||||
|
|
||||||
|
|
||||||
# reduce permissions to minimum necessary for all NetAlertX files and folders
|
# reduce permissions to minimum necessary for all NetAlertX files and folders
|
||||||
# Permissions 005 and 004 are not typos, they enable read-only. Everyone can
|
# Permissions 005 and 004 are not typos, they enable read-only. Everyone can
|
||||||
# read the read-only files, and nobody can write to them, even the readonly user.
|
# read the read-only files, and nobody can write to them, even the readonly user.
|
||||||
|
|
||||||
|
# hadolint ignore=SC2114
|
||||||
RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
||||||
chmod -R 004 ${READ_ONLY_FOLDERS} && \
|
chmod -R 004 ${READ_ONLY_FOLDERS} && \
|
||||||
find ${READ_ONLY_FOLDERS} -type d -exec chmod 005 {} + && \
|
find ${READ_ONLY_FOLDERS} -type d -exec chmod 005 {} + && \
|
||||||
@@ -208,7 +210,7 @@ RUN chown -R ${READ_ONLY_USER}:${READ_ONLY_GROUP} ${READ_ONLY_FOLDERS} && \
|
|||||||
/srv /media && \
|
/srv /media && \
|
||||||
sed -i "/^\(${READ_ONLY_USER}\|${NETALERTX_USER}\):/!d" /etc/passwd && \
|
sed -i "/^\(${READ_ONLY_USER}\|${NETALERTX_USER}\):/!d" /etc/passwd && \
|
||||||
sed -i "/^\(${READ_ONLY_GROUP}\|${NETALERTX_GROUP}\):/!d" /etc/group && \
|
sed -i "/^\(${READ_ONLY_GROUP}\|${NETALERTX_GROUP}\):/!d" /etc/group && \
|
||||||
echo -ne '#!/bin/sh\n"$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo
|
printf '#!/bin/sh\n"$@"\n' > /usr/bin/sudo && chmod +x /usr/bin/sudo
|
||||||
|
|
||||||
USER netalertx
|
USER netalertx
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ ENV LOG_APP_PHP_ERRORS=${NETALERTX_LOG}/app.php_errors.log
|
|||||||
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
ENV LOG_EXECUTION_QUEUE=${NETALERTX_LOG}/execution_queue.log
|
||||||
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
ENV LOG_REPORT_OUTPUT_JSON=${NETALERTX_LOG}/report_output.json
|
||||||
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
ENV LOG_STDOUT=${NETALERTX_LOG}/stdout.log
|
||||||
ENV LOG_CROND=${NETALERTX_LOG}/crond.log
|
ENV LOG_CRON=${NETALERTX_LOG}/cron.log
|
||||||
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
ENV LOG_NGINX_ERROR=${NETALERTX_LOG}/nginx-error.log
|
||||||
|
|
||||||
# System Services configuration files
|
# System Services configuration files
|
||||||
@@ -132,25 +132,29 @@ COPY --chmod=775 --chown=${USER_ID}:${USER_GID} . ${INSTALL_DIR}/
|
|||||||
|
|
||||||
|
|
||||||
# ❗ IMPORTANT - if you modify this file modify the /install/install_dependecies.debian.sh file as well ❗
|
# ❗ IMPORTANT - if you modify this file modify the /install/install_dependecies.debian.sh file as well ❗
|
||||||
RUN apt update && apt-get install -y \
|
# hadolint ignore=DL3008,DL3027
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
tini snmp ca-certificates curl libwww-perl arp-scan sudo gettext-base \
|
tini snmp ca-certificates curl libwww-perl arp-scan sudo gettext-base \
|
||||||
nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools \
|
nginx-light php php-cgi php-fpm php-sqlite3 php-curl sqlite3 dnsutils net-tools \
|
||||||
python3 python3-dev iproute2 nmap python3-pip zip git systemctl usbutils traceroute nbtscan openrc \
|
python3 python3-dev iproute2 nmap python3-pip zip git systemctl usbutils traceroute nbtscan openrc \
|
||||||
busybox nginx nginx-core mtr python3-venv
|
busybox nginx nginx-core mtr python3-venv && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# While php8.3 is in debian bookworm repos, php-fpm is not included so we need to add sury.org repo
|
# While php8.3 is in debian bookworm repos, php-fpm is not included so we need to add sury.org repo
|
||||||
# (Ondřej Surý maintains php packages for debian. This is temp until debian includes php-fpm in their
|
# (Ondřej Surý maintains php packages for debian. This is temp until debian includes php-fpm in their
|
||||||
# repos. Likely it will be in Debian Trixie.). This keeps the image up-to-date with the alpine version.
|
# repos. Likely it will be in Debian Trixie.). This keeps the image up-to-date with the alpine version.
|
||||||
|
# hadolint ignore=DL3008
|
||||||
RUN apt-get install -y --no-install-recommends \
|
RUN apt-get install -y --no-install-recommends \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
lsb-release \
|
lsb-release \
|
||||||
wget && \
|
wget && \
|
||||||
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
|
wget -q -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
|
||||||
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
|
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y php8.3-fpm php8.3-cli php8.3-sqlite3 php8.3-common php8.3-curl php8.3-cgi && \
|
apt-get install -y --no-install-recommends php8.3-fpm php8.3-cli php8.3-sqlite3 php8.3-common php8.3-curl php8.3-cgi && \
|
||||||
ln -s /usr/sbin/php-fpm8.3 /usr/sbin/php-fpm83 # make it compatible with alpine version
|
ln -s /usr/sbin/php-fpm8.3 /usr/sbin/php-fpm83 && \
|
||||||
|
rm -rf /var/lib/apt/lists/* # make it compatible with alpine version
|
||||||
|
|
||||||
# Setup virtual python environment and use pip3 to install packages
|
# Setup virtual python environment and use pip3 to install packages
|
||||||
RUN python3 -m venv ${VIRTUAL_ENV} && \
|
RUN python3 -m venv ${VIRTUAL_ENV} && \
|
||||||
|
|||||||
65
README.md
@@ -34,23 +34,24 @@ Get visibility of what's going on on your WIFI/LAN network and enable presence d
|
|||||||
## 🚀 Quick Start
|
## 🚀 Quick Start
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
Start NetAlertX in seconds with Docker:
|
Start NetAlertX in seconds with Docker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d --rm --network=host \
|
docker run -d \
|
||||||
-v /local_data_dir/config:/data/config \
|
--network=host \
|
||||||
-v /local_data_dir/db:/data/db \
|
--restart unless-stopped \
|
||||||
-v /etc/localtime:/etc/localtime \
|
-v /local_data_dir:/data \
|
||||||
--mount type=tmpfs,target=/tmp/api \
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
-e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \
|
-e APP_CONF_OVERRIDE='{"GRAPHQL_PORT":"20214"}' \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: Your `/local_data_dir` should contain a `config` and `db` folder.
|
||||||
|
|
||||||
To deploy a containerized instance directly from the source repository, execute the following BASH sequence:
|
To deploy a containerized instance directly from the source repository, execute the following BASH sequence:
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/jokob-sk/NetAlertX.git
|
git clone https://github.com/jokob-sk/NetAlertX.git
|
||||||
@@ -67,9 +68,9 @@ For other install methods, check the [installation docs](#-documentation)
|
|||||||
|
|
||||||
|
|
||||||
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|
||||||
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
|
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
|
||||||
|
|
||||||
![showcase][showcase]
|
![showcase][showcase]
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>📷 Click for more screenshots</summary>
|
<summary>📷 Click for more screenshots</summary>
|
||||||
@@ -87,15 +88,15 @@ For other install methods, check the [installation docs](#-documentation)
|
|||||||
|
|
||||||
### Scanners
|
### Scanners
|
||||||
|
|
||||||
The app scans your network for **New devices**, **New connections** (re-connections), **Disconnections**, **"Always Connected" devices down**, Devices **IP changes** and **Internet IP address changes**. Discovery & scan methods include: **arp-scan**, **Pi-hole - DB import**, **Pi-hole - DHCP leases import**, **Generic DHCP leases import**, **UNIFI controller import**, **SNMP-enabled router import**. Check the [Plugins](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) docs for a full list of avaliable plugins.
|
The app scans your network for **New devices**, **New connections** (re-connections), **Disconnections**, **"Always Connected" devices down**, Devices **IP changes** and **Internet IP address changes**. Discovery & scan methods include: **arp-scan**, **Pi-hole - DB import**, **Pi-hole - DHCP leases import**, **Generic DHCP leases import**, **UNIFI controller import**, **SNMP-enabled router import**. Check the [Plugins](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) docs for a full list of avaliable plugins.
|
||||||
|
|
||||||
### Notification gateways
|
### Notification gateways
|
||||||
|
|
||||||
Send notifications to more than 80+ services, including Telegram via [Apprise](https://hub.docker.com/r/caronc/apprise), or use native [Pushsafer](https://www.pushsafer.com/), [Pushover](https://www.pushover.net/), or [NTFY](https://ntfy.sh/) publishers.
|
Send notifications to more than 80+ services, including Telegram via [Apprise](https://hub.docker.com/r/caronc/apprise), or use native [Pushsafer](https://www.pushsafer.com/), [Pushover](https://www.pushover.net/), or [NTFY](https://ntfy.sh/) publishers.
|
||||||
|
|
||||||
### Integrations and Plugins
|
### Integrations and Plugins
|
||||||
|
|
||||||
Feed your data and device changes into [Home Assistant](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md), read [API endpoints](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md), or use [Webhooks](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md) to setup custom automation flows. You can also
|
Feed your data and device changes into [Home Assistant](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HOME_ASSISTANT.md), read [API endpoints](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md), or use [Webhooks](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md) to setup custom automation flows. You can also
|
||||||
build your own scanners with the [Plugin system](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) in as little as [15 minutes](https://www.youtube.com/watch?v=cdbxlwiWhv8).
|
build your own scanners with the [Plugin system](https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md#readme) in as little as [15 minutes](https://www.youtube.com/watch?v=cdbxlwiWhv8).
|
||||||
|
|
||||||
### Workflows
|
### Workflows
|
||||||
@@ -108,10 +109,10 @@ The [workflows module](https://github.com/jokob-sk/NetAlertX/blob/main/docs/WORK
|
|||||||
|
|
||||||
Supported browsers: Chrome, Firefox
|
Supported browsers: Chrome, Firefox
|
||||||
|
|
||||||
- [[Installation] Docker](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md)
|
- [[Installation] Docker](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md)
|
||||||
- [[Installation] Home Assistant](https://github.com/alexbelgium/hassio-addons/tree/master/netalertx)
|
- [[Installation] Home Assistant](https://github.com/alexbelgium/hassio-addons/tree/master/netalertx)
|
||||||
- [[Installation] Bare metal](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md)
|
- [[Installation] Bare metal](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md)
|
||||||
- [[Installation] Unraid App](https://unraid.net/community/apps)
|
- [[Installation] Unraid App](https://unraid.net/community/apps)
|
||||||
- [[Setup] Usage and Configuration](https://github.com/jokob-sk/NetAlertX/blob/main/docs/README.md)
|
- [[Setup] Usage and Configuration](https://github.com/jokob-sk/NetAlertX/blob/main/docs/README.md)
|
||||||
- [[Development] API docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md)
|
- [[Development] API docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md)
|
||||||
- [[Development] Custom Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md)
|
- [[Development] Custom Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md)
|
||||||
@@ -132,19 +133,19 @@ See [Security Best Practices](https://github.com/jokob-sk/NetAlertX/security) fo
|
|||||||
|
|
||||||
## ❓ FAQ
|
## ❓ FAQ
|
||||||
|
|
||||||
**Q: Why don’t I see any devices?**
|
**Q: Why don’t I see any devices?**
|
||||||
A: Ensure the container has proper network access (e.g., use `--network host` on Linux). Also check that your scan method is properly configured in the UI.
|
A: Ensure the container has proper network access (e.g., use `--network host` on Linux). Also check that your scan method is properly configured in the UI.
|
||||||
|
|
||||||
**Q: Does this work on Wi-Fi-only devices like Raspberry Pi?**
|
**Q: Does this work on Wi-Fi-only devices like Raspberry Pi?**
|
||||||
A: Yes, but some scanners (e.g. ARP) work best on Ethernet. For Wi-Fi, try SNMP, DHCP, or Pi-hole import.
|
A: Yes, but some scanners (e.g. ARP) work best on Ethernet. For Wi-Fi, try SNMP, DHCP, or Pi-hole import.
|
||||||
|
|
||||||
**Q: Will this send any data to the internet?**
|
**Q: Will this send any data to the internet?**
|
||||||
A: No. All scans and data remain local, unless you set up cloud-based notifications.
|
A: No. All scans and data remain local, unless you set up cloud-based notifications.
|
||||||
|
|
||||||
**Q: Can I use this without Docker?**
|
**Q: Can I use this without Docker?**
|
||||||
A: Yes! You can install it bare-metal. See the [bare metal installation guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md).
|
A: Yes! You can install it bare-metal. See the [bare metal installation guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md).
|
||||||
|
|
||||||
**Q: Where is the data stored?**
|
**Q: Where is the data stored?**
|
||||||
A: In the `/data/config` and `/data/db` folders. Back up these folders regularly.
|
A: In the `/data/config` and `/data/db` folders. Back up these folders regularly.
|
||||||
|
|
||||||
|
|
||||||
@@ -162,9 +163,9 @@ Check the [GitHub Issues](https://github.com/jokob-sk/NetAlertX/issues) for the
|
|||||||
|
|
||||||
### 📧 Get notified what's new
|
### 📧 Get notified what's new
|
||||||
|
|
||||||
Get notified about a new release, what new functionality you can use and about breaking changes.
|
Get notified about a new release, what new functionality you can use and about breaking changes.
|
||||||
|
|
||||||
![Follow and star][follow_star]
|
![Follow and star][follow_star]
|
||||||
|
|
||||||
### 🔀 Other Alternative Apps
|
### 🔀 Other Alternative Apps
|
||||||
|
|
||||||
@@ -175,15 +176,15 @@ Get notified about a new release, what new functionality you can use and about b
|
|||||||
|
|
||||||
### 💙 Donations
|
### 💙 Donations
|
||||||
|
|
||||||
Thank you to everyone who appreciates this tool and donates.
|
Thank you to everyone who appreciates this tool and donates.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Click for more ways to donate</summary>
|
<summary>Click for more ways to donate</summary>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
| [](https://github.com/sponsors/jokob-sk) | [](https://www.buymeacoffee.com/jokobsk) | [](https://www.patreon.com/user?u=84385063) |
|
| [](https://github.com/sponsors/jokob-sk) | [](https://www.buymeacoffee.com/jokobsk) | [](https://www.patreon.com/user?u=84385063) |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
|
||||||
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
|
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
|
||||||
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
|
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
|
||||||
@@ -194,11 +195,11 @@ Thank you to everyone who appreciates this tool and donates.
|
|||||||
|
|
||||||
### 🏗 Contributors
|
### 🏗 Contributors
|
||||||
|
|
||||||
This project would be nothing without the amazing work of the community, with special thanks to:
|
This project would be nothing without the amazing work of the community, with special thanks to:
|
||||||
|
|
||||||
> [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert) (the original creator of PiAlert), [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and much more), [Macleykun](https://github.com/Macleykun) (Help with Dockerfile clean-up), [vladaurosh](https://github.com/vladaurosh) for Alpine re-base help, [Final-Hawk](https://github.com/Final-Hawk) (Help with NTFY, styling and other fixes), [TeroRERO](https://github.com/terorero) (Spanish translations), [Data-Monkey](https://github.com/Data-Monkey), (Split-up of the python.py file and more), [cvc90](https://github.com/cvc90) (Spanish translation and various UI work) to name a few. Check out all the [amazing contributors](https://github.com/jokob-sk/NetAlertX/graphs/contributors).
|
> [pucherot/Pi.Alert](https://github.com/pucherot/Pi.Alert) (the original creator of PiAlert), [leiweibau](https://github.com/leiweibau/Pi.Alert): Dark mode (and much more), [Macleykun](https://github.com/Macleykun) (Help with Dockerfile clean-up), [vladaurosh](https://github.com/vladaurosh) for Alpine re-base help, [Final-Hawk](https://github.com/Final-Hawk) (Help with NTFY, styling and other fixes), [TeroRERO](https://github.com/terorero) (Spanish translations), [Data-Monkey](https://github.com/Data-Monkey), (Split-up of the python.py file and more), [cvc90](https://github.com/cvc90) (Spanish translation and various UI work) to name a few. Check out all the [amazing contributors](https://github.com/jokob-sk/NetAlertX/graphs/contributors).
|
||||||
|
|
||||||
### 🌍 Translations
|
### 🌍 Translations
|
||||||
|
|
||||||
Proudly using [Weblate](https://hosted.weblate.org/projects/pialert/). Help out and suggest languages in the [online portal of Weblate](https://hosted.weblate.org/projects/pialert/core/).
|
Proudly using [Weblate](https://hosted.weblate.org/projects/pialert/). Help out and suggest languages in the [online portal of Weblate](https://hosted.weblate.org/projects/pialert/core/).
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export INSTALL_DIR=/app
|
export INSTALL_DIR=/app
|
||||||
|
|
||||||
LOG_FILE="${INSTALL_DIR}/log/execution_queue.log"
|
if [ -f "${LOG_EXECUTION_QUEUE}" ] && grep -q "cron_restart_backend" "${LOG_EXECUTION_QUEUE}"; then
|
||||||
|
echo "$(date): Restarting backend triggered by cron_restart_backend"
|
||||||
# Check if there are any entries with cron_restart_backend
|
killall python3 || echo "killall python3 failed or no process found"
|
||||||
if grep -q "cron_restart_backend" "$LOG_FILE"; then
|
sleep 2
|
||||||
# Restart python application using s6
|
/services/start-backend.sh &
|
||||||
s6-svc -r /var/run/s6-rc/servicedirs/netalertx
|
|
||||||
echo 'done'
|
|
||||||
|
|
||||||
# Remove all lines containing cron_restart_backend from the log file
|
# Remove all lines containing cron_restart_backend from the log file
|
||||||
sed -i '/cron_restart_backend/d' "$LOG_FILE"
|
# Atomic replacement with temp file. grep returns 1 if no lines selected (file becomes empty), which is valid here.
|
||||||
|
grep -v "cron_restart_backend" "${LOG_EXECUTION_QUEUE}" > "${LOG_EXECUTION_QUEUE}.tmp"
|
||||||
|
RC=$?
|
||||||
|
if [ $RC -eq 0 ] || [ $RC -eq 1 ]; then
|
||||||
|
mv "${LOG_EXECUTION_QUEUE}.tmp" "${LOG_EXECUTION_QUEUE}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NetAlertX API Documentation
|
# API Documentation
|
||||||
|
|
||||||
This API provides programmatic access to **devices, events, sessions, metrics, network tools, and sync** in NetAlertX. It is implemented as a **REST and GraphQL server**. All requests require authentication via **API Token** (`API_TOKEN` setting) unless explicitly noted. For example, to authorize a GraphQL request, you need to use a `Authorization: Bearer API_TOKEN` header as per example below:
|
This API provides programmatic access to **devices, events, sessions, metrics, network tools, and sync** in NetAlertX. It is implemented as a **REST and GraphQL server**. All requests require authentication via **API Token** (`API_TOKEN` setting) unless explicitly noted. For example, to authorize a GraphQL request, you need to use a `Authorization: Bearer API_TOKEN` header as per example below:
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +1,114 @@
|
|||||||
### Loading...
|
# Troubleshooting Common Issues
|
||||||
|
|
||||||
Often if the application is misconfigured the `Loading...` dialog is continuously displayed. This is most likely caused by the backed failing to start. The **Maintenance -> Logs** section should give you more details on what's happening. If there is no exception, check the Portainer log, or start the container in the foreground (without the `-d` parameter) to observe any exceptions. It's advisable to enable `trace` or `debug`. Check the [Debug tips](./DEBUG_TIPS.md) on detailed instructions.
|
> [!TIP]
|
||||||
|
> Before troubleshooting, ensure you have set the correct [Debugging and LOG_LEVEL](./DEBUG_TIPS.md).
|
||||||
|
|
||||||
The issue might be related to the backend server, so please check [Debugging GraphQL issues](./DEBUG_API_SERVER.md).
|
---
|
||||||
|
|
||||||
Please also check the browser logs (usually accessible by pressing `F12`):
|
## Docker Container Doesn't Start
|
||||||
|
|
||||||
1. Switch to the Console tab and refresh the page
|
Initial setup issues are often caused by **missing permissions** or **incorrectly mapped volumes**. Always double-check your `docker run` or `docker-compose.yml` against the [official setup guide](./DOCKER_INSTALLATION.md) before proceeding.
|
||||||
2. Switch to teh Network tab and refresh the page
|
|
||||||
|
|
||||||
If you are not sure how to resolve the errors yourself, please post screenshots of the above into the issue, or discord discussion, where your problem is being solved.
|
|
||||||
|
|
||||||
### Incorrect SCAN_SUBNETS
|
|
||||||
|
|
||||||
One of the most common issues is not configuring `SCAN_SUBNETS` correctly. If this setting is misconfigured you will only see one or two devices in your devices list after a scan. Please read the [subnets docs](./SUBNETS.md) carefully to resolve this.
|
|
||||||
|
|
||||||
### Duplicate devices and notifications
|
|
||||||
|
|
||||||
The app uses the MAC address as an unique identifier for devices. If a new MAC is detected a new device is added to the application and corresponding notifications are triggered. This means that if the MAC of an existing device changes, the device will be logged as a new device. You can usually prevent this from happening by changing the device configuration (in Android, iOS, or Windows) for your network. See the [Random Macs](./RANDOM_MAC.md) guide for details.
|
|
||||||
|
|
||||||
### Permissions
|
### Permissions
|
||||||
|
|
||||||
Make sure you [File permissions](./FILE_PERMISSIONS.md) are set correctly.
|
Make sure your [file permissions](./FILE_PERMISSIONS.md) are correctly set:
|
||||||
|
|
||||||
* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/tmp/log`.
|
* If you encounter AJAX errors, cannot write to the database, or see an empty screen, check that permissions are correct and review the logs under `/tmp/log`.
|
||||||
* To solve permission issues you can try setting the owner and group of the `app.db` by executing the following on the host system: `docker exec netalertx chown -R www-data:www-data /data/db/app.db`.
|
* To fix permission issues with the database, update the owner and group of `app.db` as described in the [File Permissions guide](./FILE_PERMISSIONS.md).
|
||||||
* If still facing issues, try to map the app.db file (⚠ not folder) to `:/data/db/app.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details)
|
|
||||||
|
|
||||||
### Container restarts / crashes
|
### Container Restarts / Crashes
|
||||||
|
|
||||||
* Check the logs for details. Often a required setting for a notification method is missing.
|
* Check the logs for details. Often, required settings are missing.
|
||||||
|
* For more detailed troubleshooting, see [Debug and Troubleshooting Tips](./DEBUG_TIPS.md).
|
||||||
|
* To observe errors directly, run the container in the foreground instead of `-d`:
|
||||||
|
|
||||||
### unable to resolve host
|
```bash
|
||||||
|
docker run --rm -it <your_image>
|
||||||
|
```
|
||||||
|
|
||||||
* Check that your `SCAN_SUBNETS` variable is using the correct mask and `--interface`. See the [subnets docs for details](./SUBNETS.md).
|
---
|
||||||
|
|
||||||
### Invalid JSON
|
## Docker Container Starts, But the Application Misbehaves
|
||||||
|
|
||||||
Check the [Invalid JSON errors debug help](./DEBUG_INVALID_JSON.md) docs on how to proceed.
|
If the container starts but the app shows unexpected behavior, the cause is often **data corruption**, **incorrect configuration**, or **unexpected input data**.
|
||||||
|
|
||||||
### sudo execution failing (e.g.: on arpscan) on a Raspberry Pi 4
|
### Continuous "Loading..." Screen
|
||||||
|
|
||||||
> sudo: unexpected child termination condition: 0
|
A misconfigured application may display a persistent `Loading...` dialog. This is usually caused by the backend failing to start.
|
||||||
|
|
||||||
Resolution based on [this issue](https://github.com/linuxserver/docker-papermerge/issues/4#issuecomment-1003657581)
|
**Steps to troubleshoot:**
|
||||||
|
|
||||||
|
1. Check **Maintenance → Logs** for exceptions.
|
||||||
|
2. If no exception is visible, check the Portainer logs.
|
||||||
|
3. Start the container in the foreground to observe exceptions.
|
||||||
|
4. Enable `trace` or `debug` logging for detailed output (see [Debug Tips](./DEBUG_TIPS.md)).
|
||||||
|
5. Verify that `GRAPHQL_PORT` is correctly configured.
|
||||||
|
6. Check browser logs (press `F12`):
|
||||||
|
|
||||||
|
* **Console tab** → refresh the page
|
||||||
|
* **Network tab** → refresh the page
|
||||||
|
|
||||||
|
If you are unsure how to resolve errors, provide screenshots or log excerpts in your issue report or Discord discussion.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Common Configuration Issues
|
||||||
|
|
||||||
|
#### Incorrect `SCAN_SUBNETS`
|
||||||
|
|
||||||
|
If `SCAN_SUBNETS` is misconfigured, you may see only a few devices in your device list after a scan. See the [Subnets Documentation](./SUBNETS.md) for proper configuration.
|
||||||
|
|
||||||
|
#### Duplicate Devices and Notifications
|
||||||
|
|
||||||
|
* Devices are identified by their **MAC address**.
|
||||||
|
* If a device's MAC changes, it will be treated as a new device, triggering notifications.
|
||||||
|
* Prevent this by adjusting your device configuration for Android, iOS, or Windows. See the [Random MACs Guide](./RANDOM_MAC.md).
|
||||||
|
|
||||||
|
#### Unable to Resolve Host
|
||||||
|
|
||||||
|
* Ensure `SCAN_SUBNETS` uses the correct mask and `--interface`.
|
||||||
|
* Refer to the [Subnets Documentation](./SUBNETS.md) for detailed guidance.
|
||||||
|
|
||||||
|
#### Invalid JSON Errors
|
||||||
|
|
||||||
|
* Follow the steps in [Invalid JSON Errors Debug Help](./DEBUG_INVALID_JSON.md).
|
||||||
|
|
||||||
|
#### Sudo Execution Fails (e.g., on arpscan on Raspberry Pi 4)
|
||||||
|
|
||||||
|
Error:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
sudo: unexpected child termination condition: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
**Resolution**:
|
||||||
|
|
||||||
|
```bash
|
||||||
wget ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.3-2_armhf.deb
|
wget ftp.us.debian.org/debian/pool/main/libs/libseccomp/libseccomp2_2.5.3-2_armhf.deb
|
||||||
sudo dpkg -i libseccomp2_2.5.3-2_armhf.deb
|
sudo dpkg -i libseccomp2_2.5.3-2_armhf.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
The link above will probably break in time too. Go to https://packages.debian.org/sid/armhf/libseccomp2/download to find the new version number and put that in the url.
|
> ⚠️ The link may break over time. Check [Debian Packages](https://packages.debian.org/sid/armhf/libseccomp2/download) for the latest version.
|
||||||
|
|
||||||
### Only Router and own device show up
|
#### Only Router and Own Device Show Up
|
||||||
|
|
||||||
Make sure that the subnet and interface in `SCAN_SUBNETS` are correct. If your device/NAS has multiple ethernet ports, you probably need to change `eth0` to something else.
|
* Verify the subnet and interface in `SCAN_SUBNETS`.
|
||||||
|
* On devices with multiple Ethernet ports, you may need to change `eth0` to the correct interface.
|
||||||
|
|
||||||
### Losing my settings and devices after an update
|
#### Losing Settings or Devices After Update
|
||||||
|
|
||||||
If you lose your devices and/or settings after an update that means you don't have the `/data/db` and `/data/config` folders mapped to a permanent storage. That means every time you update these folders are re-created. Make sure you have the [volumes specified correctly](./DOCKER_COMPOSE.md) in your `docker-compose.yml` or run command.
|
* Ensure `/data/db` and `/data/config` are mapped to persistent storage.
|
||||||
|
* Without persistent volumes, these folders are recreated on every update.
|
||||||
|
* See [Docker Volumes Setup](./DOCKER_COMPOSE.md) for proper configuration.
|
||||||
|
|
||||||
|
#### Application Performance Issues
|
||||||
|
|
||||||
### The application is slow
|
Slowness can be caused by:
|
||||||
|
|
||||||
|
* Incorrect settings (causing app restarts) → check `app.log`.
|
||||||
|
* Too many background processes → disable unnecessary scanners.
|
||||||
|
* Long scans → limit the number of scanned devices.
|
||||||
|
* Excessive disk operations or failing maintenance plugins.
|
||||||
|
|
||||||
|
> See [Performance Tips](./PERFORMANCE.md) for detailed optimization steps.
|
||||||
|
|
||||||
Slowness is usually caused by incorrect settings (the app might restart, so check the `app.log`), too many background processes (disable unnecessary scanners), too long scans (limit the number of scanned devices), too many disk operations, or some maintenance plugins might have failed. See the [Performance tips](./PERFORMANCE.md) docs for details.
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
# Debugging GraphQL server issues
|
# Debugging GraphQL server issues
|
||||||
|
|
||||||
The GraphQL server is an API middle layer, running on it's own port specified by `GRAPHQL_PORT`, to retrieve and show the data in the UI. It can also be used to retrieve data for custom third party integarions. Check the [API documentation](./API.md) for details.
|
The GraphQL server is an API middle layer, running on it's own port specified by `GRAPHQL_PORT`, to retrieve and show the data in the UI. It can also be used to retrieve data for custom third party integarions. Check the [API documentation](./API.md) for details.
|
||||||
|
|
||||||
The most common issue is that the GraphQL server doesn't start properly, usually due to a **port conflict**. If you are running multiple NetAlertX instances, make sure to use **unique ports** by changing the `GRAPHQL_PORT` setting. The default is `20212`.
|
The most common issue is that the GraphQL server doesn't start properly, usually due to a **port conflict**. If you are running multiple NetAlertX instances, make sure to use **unique ports** by changing the `GRAPHQL_PORT` setting. The default is `20212`.
|
||||||
|
|
||||||
## How to update the `GRAPHQL_PORT` in case of issues
|
## How to update the `GRAPHQL_PORT` in case of issues
|
||||||
|
|
||||||
As a first troubleshooting step try changing the default `GRAPHQL_PORT` setting. Please remember NetAlertX is running on the host so any application uising the same port will cause issues.
|
As a first troubleshooting step try changing the default `GRAPHQL_PORT` setting. Please remember NetAlertX is running on the host so any application uising the same port will cause issues.
|
||||||
|
|
||||||
### Updating the setting via the Settings UI
|
### Updating the setting via the Settings UI
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ Ideally use the Settings UI to update the setting under General -> Core -> Graph
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
You might need to temporarily stop other applications or NetAlertX instances causing conflicts to update the setting. The `API_TOKEN` is used to authenticate any API calls, including GraphQL requests.
|
You might need to temporarily stop other applications or NetAlertX instances causing conflicts to update the setting. The `API_TOKEN` is used to authenticate any API calls, including GraphQL requests.
|
||||||
|
|
||||||
### Updating the `app.conf` file
|
### Updating the `app.conf` file
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ If the UI is not accessible, you can directly edit the `app.conf` file in your `
|
|||||||
|
|
||||||
### Using a docker variable
|
### Using a docker variable
|
||||||
|
|
||||||
All application settings can also be initialized via the `APP_CONF_OVERRIDE` docker env variable.
|
All application settings can also be initialized via the `APP_CONF_OVERRIDE` docker env variable.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
Check the the HTTP response of the failing backend call by following these steps:
|
Check the the HTTP response of the failing backend call by following these steps:
|
||||||
|
|
||||||
- Open developer console in your browser (usually, e. g. for Chrome, key F12 on the keyboard).
|
- Open developer console in your browser (usually, e. g. for Chrome, key F12 on the keyboard).
|
||||||
- Follow the steps in this screenshot:
|
- Follow the steps in this screenshot:
|
||||||
|
|
||||||
![F12DeveloperConsole][F12DeveloperConsole]
|
![F12DeveloperConsole][F12DeveloperConsole]
|
||||||
|
|
||||||
- Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end):
|
- Copy the URL causing the error and enter it in the address bar of your browser directly and hit enter. The copied URLs could look something like this (notice the query strings at the end):
|
||||||
- `http://<NetAlertX URL>:20211/api/table_devices.json?nocache=1704141103121`
|
- `http://<server>:20211/api/table_devices.json?nocache=1704141103121`
|
||||||
- `http://<NetAlertX URL>:20211/php/server/devices.php?action=getDevicesTotals`
|
- `http://<server>:20211/php/server/devices.php?action=getDevicesTotals`
|
||||||
|
|
||||||
|
|
||||||
- Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query.
|
- Post the error response in the existing issue thread on GitHub or create a new issue and include the redacted response of the failing query.
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
# Troubleshooting plugins
|
# Troubleshooting plugins
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> Before troubleshooting, please ensure you have the right [Debugging and LOG_LEVEL set](./DEBUG_TIPS.md).
|
||||||
|
|
||||||
## High-level overview
|
## High-level overview
|
||||||
|
|
||||||
If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`).
|
If a Plugin supplies data to the main app it's done either vie a SQL query or via a script that updates the `last_result.log` file in the plugin log folder (`app/log/plugins/`).
|
||||||
@@ -9,7 +12,7 @@ For a more in-depth overview on how plugins work check the [Plugins development
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- Make sure you read and followed the specific plugin setup instructions.
|
- Make sure you read and followed the specific plugin setup instructions.
|
||||||
- Ensure you have [debug enabled (see More Logging)](./DEBUG_TIPS.md)
|
- Ensure you have [debug enabled (see More Logging)](./DEBUG_TIPS.md)
|
||||||
|
|
||||||
### Potential issues
|
### Potential issues
|
||||||
|
|
||||||
@@ -47,9 +50,9 @@ Input data from the plugin might cause mapping issues in specific edge cases. Lo
|
|||||||
17:31:05 [Plugins] history_to_insert count: 4
|
17:31:05 [Plugins] history_to_insert count: 4
|
||||||
17:31:05 [Plugins] objects_to_insert count: 0
|
17:31:05 [Plugins] objects_to_insert count: 0
|
||||||
17:31:05 [Plugins] objects_to_update count: 4
|
17:31:05 [Plugins] objects_to_update count: 4
|
||||||
17:31:05 [Plugin utils] In pluginEvents there are 2 events with the status "watched-not-changed"
|
17:31:05 [Plugin utils] In pluginEvents there are 2 events with the status "watched-not-changed"
|
||||||
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "missing-in-last-scan"
|
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "missing-in-last-scan"
|
||||||
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "watched-not-changed"
|
17:31:05 [Plugin utils] In pluginObjects there are 2 events with the status "watched-not-changed"
|
||||||
17:31:05 [Plugins] Mapping objects to database table: CurrentScan
|
17:31:05 [Plugins] Mapping objects to database table: CurrentScan
|
||||||
17:31:05 [Plugins] SQL query for mapping: INSERT into CurrentScan ( "cur_MAC", "cur_IP", "cur_LastQuery", "cur_Name", "cur_Vendor", "cur_ScanMethod") VALUES ( ?, ?, ?, ?, ?, ?)
|
17:31:05 [Plugins] SQL query for mapping: INSERT into CurrentScan ( "cur_MAC", "cur_IP", "cur_LastQuery", "cur_Name", "cur_Vendor", "cur_ScanMethod") VALUES ( ?, ?, ?, ?, ?, ?)
|
||||||
17:31:05 [Plugins] SQL sqlParams for mapping: [('01:01:01:01:01:01', '172.30.0.1', 0, 'aaaa', 'vvvvvvvvv', 'PIHOLE'), ('02:42:ac:1e:00:02', '172.30.0.2', 0, 'dddd', 'vvvvv2222', 'PIHOLE')]
|
17:31:05 [Plugins] SQL sqlParams for mapping: [('01:01:01:01:01:01', '172.30.0.1', 0, 'aaaa', 'vvvvvvvvv', 'PIHOLE'), ('02:42:ac:1e:00:02', '172.30.0.2', 0, 'dddd', 'vvvvv2222', 'PIHOLE')]
|
||||||
@@ -80,7 +83,7 @@ These values, if formatted correctly, will also show up in the UI:
|
|||||||
|
|
||||||
### Sharing application state
|
### Sharing application state
|
||||||
|
|
||||||
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
||||||
|
|
||||||
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
||||||
2. Wait for the issue to occur.
|
2. Wait for the issue to occur.
|
||||||
|
|||||||
@@ -1,30 +1,36 @@
|
|||||||
# Debugging and troubleshooting
|
# Debugging and troubleshooting
|
||||||
|
|
||||||
Please follow tips 1 - 4 to get a more detailed error.
|
Please follow tips 1 - 4 to get a more detailed error.
|
||||||
|
|
||||||
## 1. More Logging
|
## 1. More Logging
|
||||||
|
|
||||||
When debugging an issue always set the highest log level:
|
When debugging an issue always set the highest log level:
|
||||||
|
|
||||||
`LOG_LEVEL='trace'`
|
`LOG_LEVEL='trace'`
|
||||||
|
|
||||||
## 2. Surfacing errors when container restarts
|
## 2. Surfacing errors when container restarts
|
||||||
|
|
||||||
Start the container via the **terminal** with a command similar to this one:
|
Start the container via the **terminal** with a command similar to this one:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm --network=host \
|
docker run \
|
||||||
-v /local_data_dir/netalertx/config:/data/config \
|
--network=host \
|
||||||
-v /local_data_dir/netalertx/db:/data/db \
|
--restart unless-stopped \
|
||||||
-v /etc/localtime:/etc/localtime \
|
-v /local_data_dir:/data \
|
||||||
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
|
-e APP_CONF_OVERRIDE='{"GRAPHQL_PORT":"20214"}' \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> ⚠ Please note, don't use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
|
Note: Your `/local_data_dir` should contain a `config` and `db` folder.
|
||||||
|
|
||||||
## 3. Check the _dev image and open issues
|
> [!NOTE]
|
||||||
|
> ⚠ The most important part is NOT to use the `-d` parameter so you see the error when the container crashes. Use this error in your issue description.
|
||||||
|
|
||||||
|
## 3. Check the _dev image and open issues
|
||||||
|
|
||||||
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
|
If possible, check if your issue got fixed in the `_dev` image before opening a new issue. The container is:
|
||||||
|
|
||||||
@@ -34,7 +40,7 @@ If possible, check if your issue got fixed in the `_dev` image before opening a
|
|||||||
|
|
||||||
Please also search [open issues](https://github.com/jokob-sk/NetAlertX/issues).
|
Please also search [open issues](https://github.com/jokob-sk/NetAlertX/issues).
|
||||||
|
|
||||||
## 4. Disable restart behavior
|
## 4. Disable restart behavior
|
||||||
|
|
||||||
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:
|
To prevent a Docker container from automatically restarting in a Docker Compose file, specify the restart policy as `no`:
|
||||||
|
|
||||||
@@ -48,9 +54,14 @@ services:
|
|||||||
# Other service configurations...
|
# Other service configurations...
|
||||||
```
|
```
|
||||||
|
|
||||||
## 5. Sharing application state
|
## 5. TMP mount directories to rule host out permission issues
|
||||||
|
|
||||||
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
Try starting the container with all data to be in non-persistent volumes. If this works, the issue might be related to the permissions of your persistent data mount locations on your server. See teh [Permissions guide](./FILE_PERMISSIONS.md) for details.
|
||||||
|
|
||||||
|
|
||||||
|
## 6. Sharing application state
|
||||||
|
|
||||||
|
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
|
||||||
|
|
||||||
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
|
||||||
2. Wait for the issue to occur.
|
2. Wait for the issue to occur.
|
||||||
@@ -61,4 +72,4 @@ Sometimes specific log sections are needed to debug issues. The Devices and Curr
|
|||||||
|
|
||||||
## Common issues
|
## Common issues
|
||||||
|
|
||||||
See [Common issues](./COMMON_ISSUES.md) for details.
|
See [Common issues](./COMMON_ISSUES.md) for additional troubleshooting tips.
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ NetAlertX allows you to mass-edit devices via a CSV export and import feature, o
|
|||||||
|
|
||||||
## UI multi edit
|
## UI multi edit
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Make sure you have your backups saved and restorable before doing any mass edits. Check [Backup strategies](./BACKUPS.md).
|
> Make sure you have your backups saved and restorable before doing any mass edits. Check [Backup strategies](./BACKUPS.md).
|
||||||
|
|
||||||
You can select devices in the _Devices_ view by selecting devices to edit and then clicking the _Multi-edit_ button or via the _Maintenance_ > _Multi-Edit_ section.
|
You can select devices in the _Devices_ view by selecting devices to edit and then clicking the _Multi-edit_ button or via the _Maintenance_ > _Multi-Edit_ section.
|
||||||
|
|
||||||
@@ -16,23 +16,23 @@ You can select devices in the _Devices_ view by selecting devices to edit and th
|
|||||||
|
|
||||||
The database and device structure may change with new releases. When using the CSV import functionality, ensure the format matches what the application expects. To avoid issues, you can first export the devices and review the column formats before importing any custom data.
|
The database and device structure may change with new releases. When using the CSV import functionality, ensure the format matches what the application expects. To avoid issues, you can first export the devices and review the column formats before importing any custom data.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> As always, backup everything, just in case.
|
> As always, backup everything, just in case.
|
||||||
|
|
||||||
1. In _Maintenance_ > _Backup / Restore_ click the _CSV Export_ button.
|
1. In _Maintenance_ > _Backup / Restore_ click the _CSV Export_ button.
|
||||||
2. A `devices.csv` is generated in the `/config` folder
|
2. A `devices.csv` is generated in the `/config` folder
|
||||||
3. Edit the `devices.csv` file however you like.
|
3. Edit the `devices.csv` file however you like.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `<your netalertx url>/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this)
|
> The file containing a list of Devices including the Network relationships between Network Nodes and connected devices. You can also trigger this by acessing this URL: `<server>:20211/php/server/devices.php?action=ExportCSV` or via the `CSV Backup` plugin. (💡 You can schedule this)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### File encoding format
|
### File encoding format
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Keep Linux line endings (suggested editors: Nano, Notepad++)
|
> Keep Linux line endings (suggested editors: Nano, Notepad++)
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# NetAlertX - Device Management
|
# Device Management
|
||||||
|
|
||||||
The Main Info section is where most of the device identifiable information is stored and edited. Some of the information is autodetected via various plugins. Initial values for most of the fields can be specified in the `NEWDEV` plugin.
|
The Main Info section is where most of the device identifiable information is stored and edited. Some of the information is autodetected via various plugins. Initial values for most of the fields can be specified in the `NEWDEV` plugin.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
>
|
>
|
||||||
> You can multi-edit devices by selecting them in the main Devices view, from the Mainetence section, or via the CSV Export functionality under Maintenance. More info can be found in the [Devices Bulk-editing docs](./DEVICES_BULK_EDITING.md).
|
> You can multi-edit devices by selecting them in the main Devices view, from the Mainetence section, or via the CSV Export functionality under Maintenance. More info can be found in the [Devices Bulk-editing docs](./DEVICES_BULK_EDITING.md).
|
||||||
|
|
||||||
@@ -14,23 +14,23 @@ The Main Info section is where most of the device identifiable information is st
|
|||||||
- **MAC**: MAC addres of the device. Not editable, unless creating a new dummy device.
|
- **MAC**: MAC addres of the device. Not editable, unless creating a new dummy device.
|
||||||
- **Last IP**: IP addres of the device. Not editable, unless creating a new dummy device.
|
- **Last IP**: IP addres of the device. Not editable, unless creating a new dummy device.
|
||||||
- **Name**: Friendly device name. Autodetected via various 🆎 Name discovery [plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The app attaches `(IP match)` if the name is discovered via an IP match and not MAC match which could mean the name could be incorrect as IPs might change.
|
- **Name**: Friendly device name. Autodetected via various 🆎 Name discovery [plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The app attaches `(IP match)` if the name is discovered via an IP match and not MAC match which could mean the name could be incorrect as IPs might change.
|
||||||
- **Icon**: Partially autodetected. Select an existing or [add a custom icon](./ICONS.md). You can also auto-apply the same icon on all devices of the same type.
|
- **Icon**: Partially autodetected. Select an existing or [add a custom icon](./ICONS.md). You can also auto-apply the same icon on all devices of the same type.
|
||||||
- **Owner**: Device owner (The list is self-populated with existing owners and you can add custom values).
|
- **Owner**: Device owner (The list is self-populated with existing owners and you can add custom values).
|
||||||
- **Type**: Select a device type from the dropdown list (`Smartphone`, `Tablet`,
|
- **Type**: Select a device type from the dropdown list (`Smartphone`, `Tablet`,
|
||||||
`Laptop`, `TV`, `router`, etc.) or add a new device type. If you want the device to act as a **Network device** (and be able to be a network node in the Network view), select a type under Network Devices or add a new Network Device type in Settings. More information can be found in the [Network Setup docs](./NETWORK_TREE.md).
|
`Laptop`, `TV`, `router`, etc.) or add a new device type. If you want the device to act as a **Network device** (and be able to be a network node in the Network view), select a type under Network Devices or add a new Network Device type in Settings. More information can be found in the [Network Setup docs](./NETWORK_TREE.md).
|
||||||
- **Vendor**: The manufacturing vendor. Automatically updated by NetAlertX when empty or unknown, can be edited.
|
- **Vendor**: The manufacturing vendor. Automatically updated by NetAlertX when empty or unknown, can be edited.
|
||||||
- **Group**: Select a group (`Always on`, `Personal`, `Friends`, etc.) or type
|
- **Group**: Select a group (`Always on`, `Personal`, `Friends`, etc.) or type
|
||||||
your own Group name.
|
your own Group name.
|
||||||
- **Location**: Select the location, usually a room, where the device is located (`Kitchen`, `Attic`, `Living room`, etc.) or add a custom Location.
|
- **Location**: Select the location, usually a room, where the device is located (`Kitchen`, `Attic`, `Living room`, etc.) or add a custom Location.
|
||||||
- **Comments**: Add any comments for the device, such as a serial number, or maintenance information.
|
- **Comments**: Add any comments for the device, such as a serial number, or maintenance information.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
>
|
>
|
||||||
> Please note the above usage of the fields are only suggestions. You can use most of these fields for other purposes, such as storing the network interface, company owning a device, or similar.
|
> Please note the above usage of the fields are only suggestions. You can use most of these fields for other purposes, such as storing the network interface, company owning a device, or similar.
|
||||||
|
|
||||||
## Dummy devices
|
## Dummy devices
|
||||||
|
|
||||||
You can create dummy devices from the Devices listing screen.
|
You can create dummy devices from the Devices listing screen.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -39,12 +39,12 @@ The **MAC** field and the **Last IP** field will then become editable.
|
|||||||

|

|
||||||
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
>
|
>
|
||||||
> You can couple this with the `ICMP` plugin which can be used to monitor the status of these devices, if they are actual devices reachable with the `ping` command. If not, you can use a loopback IP address so they appear online, such as `0.0.0.0` or `127.0.0.1`.
|
> You can couple this with the `ICMP` plugin which can be used to monitor the status of these devices, if they are actual devices reachable with the `ping` command. If not, you can use a loopback IP address so they appear online, such as `0.0.0.0` or `127.0.0.1`.
|
||||||
|
|
||||||
## Copying data from an existing device.
|
## Copying data from an existing device.
|
||||||
|
|
||||||
To speed up device population you can also copy data from an existing device. This can be done from the **Tools** tab on the Device details.
|
To speed up device population you can also copy data from an existing device. This can be done from the **Tools** tab on the Device details.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
# NetAlertX and Docker Compose
|
# NetAlertX and Docker Compose
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.
|
Great care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.Good care is taken to ensure NetAlertX meets the needs of everyone while being flexible enough for anyone. This document outlines how you can configure your docker-compose. There are many settings, so we recommend using the Baseline Docker Compose as-is, or modifying it for your system.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The container needs to run in `network_mode:"host"` to access Layer 2 networking such as arp, nmap and others. Due to lack of support for this feature, Windows host is not a supported operating system.
|
> The container needs to run in `network_mode:"host"` to access Layer 2 networking such as arp, nmap and others. Due to lack of support for this feature, Windows host is not a supported operating system.
|
||||||
|
|
||||||
## Baseline Docker Compose
|
## Baseline Docker Compose
|
||||||
|
|
||||||
There is one baseline for NetAlertX. That's the default security-enabled official distribution.
|
There is one baseline for NetAlertX. That's the default security-enabled official distribution.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
@@ -45,7 +43,7 @@ services:
|
|||||||
# - /home/user/netalertx_data:/data:rw
|
# - /home/user/netalertx_data:/data:rw
|
||||||
|
|
||||||
- type: bind # Bind mount for timezone consistency
|
- type: bind # Bind mount for timezone consistency
|
||||||
source: /etc/localtime
|
source: /etc/localtime
|
||||||
target: /etc/localtime
|
target: /etc/localtime
|
||||||
read_only: true
|
read_only: true
|
||||||
|
|
||||||
@@ -125,9 +123,9 @@ docker compose up
|
|||||||
|
|
||||||
### Modification 1: Use a Local Folder (Bind Mount)
|
### Modification 1: Use a Local Folder (Bind Mount)
|
||||||
|
|
||||||
By default, the baseline compose file uses a single named volume (netalertx_data) mounted at /data. This single-volume layout is preferred because NetAlertX manages both configuration and the database under /data (for example, /data/config and /data/db) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside /data.
|
By default, the baseline compose file uses a single named volume (netalertx_data) mounted at `/data`. This single-volume layout is preferred because NetAlertX manages both configuration and the database under `/data` (for example, `/data/config` and `/data/db`) via its web UI. Using one named volume simplifies permissions and portability: Docker manages the storage and NetAlertX manages the files inside `/data`.
|
||||||
|
|
||||||
A two-volume layout that mounts /data/config and /data/db separately (for example, netalertx_config and netalertx_db) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments.
|
A two-volume layout that mounts `/data/config` and `/data/db` separately (for example, `netalertx_config` and `netalertx_db`) is supported for backward compatibility and some advanced workflows, but it is an abnormal/legacy layout and not recommended for new deployments.
|
||||||
|
|
||||||
However, if you prefer to have direct, file-level access to your configuration for manual editing, a "bind mount" is a simple alternative. This tells Docker to use a specific folder from your computer (the "host") inside the container.
|
However, if you prefer to have direct, file-level access to your configuration for manual editing, a "bind mount" is a simple alternative. This tells Docker to use a specific folder from your computer (the "host") inside the container.
|
||||||
|
|
||||||
@@ -187,7 +185,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- PORT=${PORT}
|
- PORT=${PORT}
|
||||||
- GRAPHQL_PORT=${GRAPHQL_PORT}
|
- GRAPHQL_PORT=${GRAPHQL_PORT}
|
||||||
|
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
# NetAlertX - Network scanner & notification framework
|
# NetAlertX - Network scanner & notification framework
|
||||||
|
|
||||||
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|
| [📑 Docker guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DOCKER_INSTALLATION.md) | [🚀 Releases](https://github.com/jokob-sk/NetAlertX/releases) | [📚 Docs](https://jokob-sk.github.io/NetAlertX/) | [🔌 Plugins](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md) | [🤖 Ask AI](https://gurubase.io/g/netalertx)
|
||||||
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
|
|----------------------| ----------------------| ----------------------| ----------------------| ----------------------|
|
||||||
|
|
||||||
<a href="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" target="_blank">
|
<a href="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" target="_blank">
|
||||||
<img src="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" width="1000px" />
|
<img src="https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/docs/img/GENERAL/github_social_image.jpg" width="1000px" />
|
||||||
@@ -16,19 +16,18 @@
|
|||||||
Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and screenshots 📷.
|
Head to [https://netalertx.com/](https://netalertx.com/) for more gifs and screenshots 📷.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> There is also an experimental 🧪 [bare-metal install](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md) method available.
|
> There is also an experimental 🧪 [bare-metal install](https://github.com/jokob-sk/NetAlertX/blob/main/docs/HW_INSTALL.md) method available.
|
||||||
|
|
||||||
## 📕 Basic Usage
|
## 📕 Basic Usage
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> You will have to run the container on the `host` network and specify `SCAN_SUBNETS` unless you use other [plugin scanners](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The initial scan can take a few minutes, so please wait 5-10 minutes for the initial discovery to finish.
|
> You will have to run the container on the `host` network and specify `SCAN_SUBNETS` unless you use other [plugin scanners](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). The initial scan can take a few minutes, so please wait 5-10 minutes for the initial discovery to finish.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -d --rm --network=host \
|
docker run -d --rm --network=host \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
|
||||||
-v /etc/localtime:/etc/localtime \
|
-v /etc/localtime:/etc/localtime \
|
||||||
--mount type=tmpfs,target=/tmp/api \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
-e PORT=20211 \
|
-e PORT=20211 \
|
||||||
-e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \
|
-e APP_CONF_OVERRIDE={"GRAPHQL_PORT":"20214"} \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
@@ -58,49 +57,49 @@ See alternative [docked-compose examples](https://github.com/jokob-sk/NetAlertX/
|
|||||||
### Docker paths
|
### Docker paths
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> See also [Backup strategies](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md).
|
> See also [Backup strategies](https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md).
|
||||||
|
|
||||||
| Required | Path | Description |
|
| Required | Path | Description |
|
||||||
| :------------- | :------------- | :-------------|
|
| :------------- | :------------- | :-------------|
|
||||||
| ✅ | `:/data/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files |
|
| ✅ | `:/data/config` | Folder which will contain the `app.conf` & `devices.csv` ([read about devices.csv](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md)) files |
|
||||||
| ✅ | `:/data/db` | Folder which will contain the `app.db` database file |
|
| ✅ | `:/data/db` | Folder which will contain the `app.db` database file |
|
||||||
| ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. |
|
| ✅ | `/etc/localtime:/etc/localtime:ro` | Ensuring the timezone is teh same as on teh server. |
|
||||||
| | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container |
|
| | `:/tmp/log` | Logs folder useful for debugging if you have issues setting up the container |
|
||||||
| | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. |
|
| | `:/tmp/api` | The [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. Path configurable via `NETALERTX_API` environment variable. |
|
||||||
| | `:/app/front/plugins/<plugin>/ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). |
|
| | `:/app/front/plugins/<plugin>/ignore_plugin` | Map a file `ignore_plugin` to ignore a plugin. Plugins can be soft-disabled via settings. More in the [Plugin docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS.md). |
|
||||||
| | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/NetAlertX/blob/main/docs/REVERSE_DNS.md). |
|
| | `:/etc/resolv.conf` | Use a custom `resolv.conf` file for [better name resolution](https://github.com/jokob-sk/NetAlertX/blob/main/docs/REVERSE_DNS.md). |
|
||||||
|
|
||||||
> Use separate `db` and `config` directories, do not nest them.
|
> Use separate `db` and `config` directories, do not nest them.
|
||||||
|
|
||||||
### Initial setup
|
### Initial setup
|
||||||
|
|
||||||
- If unavailable, the app generates a default `app.conf` and `app.db` file on the first run.
|
- If unavailable, the app generates a default `app.conf` and `app.db` file on the first run.
|
||||||
- The preferred way is to manage the configuration via the Settings section in the UI, if UI is inaccessible you can modify [app.conf](https://github.com/jokob-sk/NetAlertX/tree/main/back) in the `/data/config/` folder directly
|
- The preferred way is to manage the configuration via the Settings section in the UI, if UI is inaccessible you can modify [app.conf](https://github.com/jokob-sk/NetAlertX/tree/main/back) in the `/data/config/` folder directly
|
||||||
|
|
||||||
#### Setting up scanners
|
#### Setting up scanners
|
||||||
|
|
||||||
You have to specify which network(s) should be scanned. This is done by entering subnets that are accessible from the host. If you use the default `ARPSCAN` plugin, you have to specify at least one valid subnet and interface in the `SCAN_SUBNETS` setting. See the documentation on [How to set up multiple SUBNETS, VLANs and what are limitations](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) for troubleshooting and more advanced scenarios.
|
You have to specify which network(s) should be scanned. This is done by entering subnets that are accessible from the host. If you use the default `ARPSCAN` plugin, you have to specify at least one valid subnet and interface in the `SCAN_SUBNETS` setting. See the documentation on [How to set up multiple SUBNETS, VLANs and what are limitations](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md) for troubleshooting and more advanced scenarios.
|
||||||
|
|
||||||
If you are running PiHole you can synchronize devices directly. Check the [PiHole configuration guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PIHOLE_GUIDE.md) for details.
|
If you are running PiHole you can synchronize devices directly. Check the [PiHole configuration guide](https://github.com/jokob-sk/NetAlertX/blob/main/docs/PIHOLE_GUIDE.md) for details.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> You can bulk-import devices via the [CSV import method](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md).
|
> You can bulk-import devices via the [CSV import method](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md).
|
||||||
|
|
||||||
#### Community guides
|
#### Community guides
|
||||||
|
|
||||||
You can read or watch several [community configuration guides](https://github.com/jokob-sk/NetAlertX/blob/main/docs/COMMUNITY_GUIDES.md) in Chinese, Korean, German, or French.
|
You can read or watch several [community configuration guides](https://github.com/jokob-sk/NetAlertX/blob/main/docs/COMMUNITY_GUIDES.md) in Chinese, Korean, German, or French.
|
||||||
|
|
||||||
|
> Please note these might be outdated. Rely on official documentation first.
|
||||||
|
|
||||||
> Please note these might be outdated. Rely on official documentation first.
|
|
||||||
|
|
||||||
#### Common issues
|
#### Common issues
|
||||||
|
|
||||||
- Before creating a new issue, please check if a similar issue was [already resolved](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed).
|
- Before creating a new issue, please check if a similar issue was [already resolved](https://github.com/jokob-sk/NetAlertX/issues?q=is%3Aissue+is%3Aclosed).
|
||||||
- Check also common issues and [debugging tips](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md).
|
- Check also common issues and [debugging tips](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEBUG_TIPS.md).
|
||||||
|
|
||||||
## 💙 Support me
|
## 💙 Support me
|
||||||
|
|
||||||
| [](https://github.com/sponsors/jokob-sk) | [](https://www.buymeacoffee.com/jokobsk) | [](https://www.patreon.com/user?u=84385063) |
|
| [](https://github.com/sponsors/jokob-sk) | [](https://www.buymeacoffee.com/jokobsk) | [](https://www.patreon.com/user?u=84385063) |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
|
|
||||||
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
|
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
|
||||||
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
|
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
# The NetAlertX Container Operator's Guide
|
# The NetAlertX Container Operator's Guide
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
> ⚠️ **Important:** The docker-compose has recently changed. Carefully read the [Migration guide](https://jokob-sk.github.io/NetAlertX/MIGRATION/?h=migrat#12-migration-from-netalertx-v25524) for detailed instructions.
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
This guide assumes you are starting with the official `docker-compose.yml` file provided with the project. We strongly recommend you start with or migrate to this file as your baseline and modify it to suit your specific needs (e.g., changing file paths). While there are many ways to configure NetAlertX, the default file is designed to meet the mandatory security baseline with layer-2 networking capabilities while operating securely and without startup warnings.
|
This guide assumes you are starting with the official `docker-compose.yml` file provided with the project. We strongly recommend you start with or migrate to this file as your baseline and modify it to suit your specific needs (e.g., changing file paths). While there are many ways to configure NetAlertX, the default file is designed to meet the mandatory security baseline with layer-2 networking capabilities while operating securely and without startup warnings.
|
||||||
|
|
||||||
This guide provides direct, concise solutions for common NetAlertX administrative tasks. It is structured to help you identify a problem, implement the solution, and understand the details.
|
This guide provides direct, concise solutions for common NetAlertX administrative tasks. It is structured to help you identify a problem, implement the solution, and understand the details.
|
||||||
|
|
||||||
## Guide Contents
|
## Guide Contents
|
||||||
|
|
||||||
- Using a Local Folder for Configuration
|
- Using a Local Folder for Configuration
|
||||||
- Migrating from a Local Folder to a Docker Volume
|
- Migrating from a Local Folder to a Docker Volume
|
||||||
- Applying a Custom Nginx Configuration
|
- Applying a Custom Nginx Configuration
|
||||||
- Mounting Additional Files for Plugins
|
- Mounting Additional Files for Plugins
|
||||||
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
|
|||||||
@@ -34,30 +34,26 @@ Copy and paste the following YAML into the **Web editor**:
|
|||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
|
|
||||||
# Use this line for stable release
|
# Use this line for stable release
|
||||||
image: "ghcr.io/jokob-sk/netalertx:latest"
|
image: "ghcr.io/jokob-sk/netalertx:latest"
|
||||||
|
|
||||||
# Or, use this for the latest development build
|
# Or, use this for the latest development build
|
||||||
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
||||||
|
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
cap_drop: # Drop all capabilities for enhanced security
|
||||||
|
- ALL
|
||||||
|
cap_add: # Re-add necessary capabilities
|
||||||
|
- NET_RAW
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_BIND_SERVICE
|
||||||
volumes:
|
volumes:
|
||||||
- ${APP_FOLDER}/netalertx/config:/data/config
|
- ${APP_FOLDER}/netalertx/config:/data/config
|
||||||
- ${APP_FOLDER}/netalertx/db:/data/db
|
- ${APP_FOLDER}/netalertx/db:/data/db
|
||||||
# Optional: logs (useful for debugging setup issues, comment out for performance)
|
# to sync with system time
|
||||||
- ${APP_FOLDER}/netalertx/log:/tmp/log
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
tmpfs:
|
||||||
# API storage options:
|
# All writable runtime state resides under /tmp; comment out to persist logs between restarts
|
||||||
# (Option 1) tmpfs (default, best performance)
|
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
||||||
- type: tmpfs
|
|
||||||
target: /tmp/api
|
|
||||||
|
|
||||||
# (Option 2) bind mount (useful for debugging)
|
|
||||||
# - ${APP_FOLDER}/netalertx/api:/tmp/api
|
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
- PORT=${PORT}
|
- PORT=${PORT}
|
||||||
- APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}
|
- APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}
|
||||||
@@ -78,11 +74,12 @@ In the **Environment variables** section of Portainer, add the following:
|
|||||||
## 5. Ensure permissions
|
## 5. Ensure permissions
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
|
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
|
||||||
> ```bash
|
>
|
||||||
> sudo chown -R 20211:20211 /local_data_dir
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
> sudo chmod -R a+rwx /local_data_dir
|
>
|
||||||
> ```
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -104,4 +101,4 @@ http://<your-docker-host-ip>:22022
|
|||||||
* Check logs via Portainer → **Containers** → `netalertx` → **Logs**.
|
* Check logs via Portainer → **Containers** → `netalertx` → **Logs**.
|
||||||
* Logs are stored under `${APP_FOLDER}/netalertx/log` if you enabled that volume.
|
* Logs are stored under `${APP_FOLDER}/netalertx/log` if you enabled that volume.
|
||||||
|
|
||||||
Once the application is running, configure it by reading the [initial setup](INITIAL_SETUP.md) guide, or [troubleshoot common issues](COMMON_ISSUES.md).
|
Once the application is running, configure it by reading the [initial setup](INITIAL_SETUP.md) guide, or [troubleshoot common issues](COMMON_ISSUES.md).
|
||||||
|
|||||||
@@ -41,15 +41,7 @@ Use the following Compose snippet to deploy NetAlertX with a **static LAN IP** a
|
|||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
image: ghcr.io/jokob-sk/netalertx:latest
|
image: ghcr.io/jokob-sk/netalertx:latest
|
||||||
ports:
|
...
|
||||||
- 20211:20211
|
|
||||||
volumes:
|
|
||||||
- /mnt/YOUR_SERVER/netalertx/config:/data/config:rw
|
|
||||||
- /mnt/YOUR_SERVER/netalertx/db:/netalertx/data/db:rw
|
|
||||||
- /mnt/YOUR_SERVER/netalertx/logs:/netalertx/tmp/log:rw
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
environment:
|
|
||||||
- PORT=20211
|
|
||||||
networks:
|
networks:
|
||||||
swarm-ipvlan:
|
swarm-ipvlan:
|
||||||
ipv4_address: 192.168.1.240 # ⚠️ Choose a free IP from your LAN
|
ipv4_address: 192.168.1.240 # ⚠️ Choose a free IP from your LAN
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
# Managing File Permissions for NetAlertX on a Read-Only Container
|
# Managing File Permissions for NetAlertX on a Read-Only Container
|
||||||
|
|
||||||
|
Sometimes, permission issues arise if your existing host directories were created by a previous container running as root or another UID. The container will fail to start with "Permission Denied" errors.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> NetAlertX runs in a **secure, read-only Alpine-based container** under a dedicated `netalertx` user (UID 20211, GID 20211). All writable paths are either mounted as **persistent volumes** or **`tmpfs` filesystems**. This ensures consistent file ownership and prevents privilege escalation.
|
> NetAlertX runs in a **secure, read-only Alpine-based container** under a dedicated `netalertx` user (UID 20211, GID 20211). All writable paths are either mounted as **persistent volumes** or **`tmpfs` filesystems**. This ensures consistent file ownership and prevents privilege escalation.
|
||||||
|
|
||||||
|
Try starting the container with all data to be in non-persistent volumes. If this works, the issue might be related to the permissions of your persistent data mount locations on your server.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm --network=host \
|
||||||
|
-v /etc/localtime:/etc/localtime:ro \
|
||||||
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
|
-e PORT=20211 \
|
||||||
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
> The above should be only used as a test - once the container restarts, all data is lost.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Writable Paths
|
## Writable Paths
|
||||||
@@ -25,18 +40,14 @@ NetAlertX requires certain paths to be writable at runtime. These paths should b
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Fixing Permission Problems
|
|
||||||
|
|
||||||
Sometimes, permission issues arise if your existing host directories were created by a previous container running as root or another UID. The container will fail to start with "Permission Denied" errors.
|
|
||||||
|
|
||||||
### Solution
|
### Solution
|
||||||
|
|
||||||
1. **Run the container once as root** (`--user "0"`) to allow it to correct permissions automatically:
|
1. **Run the container once as root** (`--user "0"`) to allow it to correct permissions automatically:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run -it --rm --name netalertx --user "0" \
|
docker run -it --rm --name netalertx --user "0" \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir:/data \
|
||||||
-v /local_data_dir/db:/data/db \
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -47,11 +58,12 @@ docker run -it --rm --name netalertx --user "0" \
|
|||||||
> The container startup script detects `root` and runs `chown -R 20211:20211` on all volumes, fixing ownership for the secure `netalertx` user.
|
> The container startup script detects `root` and runs `chown -R 20211:20211` on all volumes, fixing ownership for the secure `netalertx` user.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
|
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
|
||||||
> ```bash
|
>
|
||||||
> sudo chown -R 20211:20211 /local_data_dir
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
> sudo chmod -R a+rwx /local_data_dir
|
>
|
||||||
> ```
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
|
>
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -59,22 +71,21 @@ docker run -it --rm --name netalertx --user "0" \
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx"
|
image: "ghcr.io/jokob-sk/netalertx"
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
cap_drop: # Drop all capabilities for enhanced security
|
cap_drop: # Drop all capabilities for enhanced security
|
||||||
- ALL
|
- ALL
|
||||||
cap_add: # Add only the necessary capabilities
|
cap_add: # Add only the necessary capabilities
|
||||||
- NET_ADMIN # Required for ARP scanning
|
- NET_ADMIN # Required for ARP scanning
|
||||||
- NET_RAW # Required for raw socket operations
|
- NET_RAW # Required for raw socket operations
|
||||||
- NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan)
|
- NET_BIND_SERVICE # Required to bind to privileged ports (nbtscan)
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir:/data
|
||||||
- /local_data_dir/db:/data/db
|
- /etc/localtime:/etc/localtime
|
||||||
- /etc/localtime:/etc/localtime
|
environment:
|
||||||
environment:
|
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NetAlertX Community Helper Scripts Overview
|
# Community Helper Scripts Overview
|
||||||
|
|
||||||
This page provides an overview of community-contributed scripts for NetAlertX. These scripts are not actively maintained and are provided as-is.
|
This page provides an overview of community-contributed scripts for NetAlertX. These scripts are not actively maintained and are provided as-is.
|
||||||
|
|
||||||
@@ -14,8 +14,8 @@ You can find all scripts in this [scripts GitHub folder](https://github.com/joko
|
|||||||
|
|
||||||
## Important Notes
|
## Important Notes
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> These scripts are community-supplied and not actively maintained. Use at your own discretion.
|
> These scripts are community-supplied and not actively maintained. Use at your own discretion.
|
||||||
|
|
||||||
For detailed usage instructions, refer to each script's documentation in each [scripts GitHub folder](https://github.com/jokob-sk/NetAlertX/tree/main/scripts).
|
For detailed usage instructions, refer to each script's documentation in each [scripts GitHub folder](https://github.com/jokob-sk/NetAlertX/tree/main/scripts).
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ To download and install NetAlertX on the hardware/server directly use the `curl`
|
|||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> This is an Experimental feature 🧪 and it relies on community support.
|
> This is an Experimental feature 🧪 and it relies on community support.
|
||||||
>
|
>
|
||||||
> 🙏 Looking for maintainers for this installation method 🙂 Current community volunteers:
|
> 🙏 Looking for maintainers for this installation method 🙂 Current community volunteers:
|
||||||
> - [slammingprogramming](https://github.com/slammingprogramming)
|
> - [slammingprogramming](https://github.com/slammingprogramming)
|
||||||
> - [ingoratsdorf](https://github.com/ingoratsdorf)
|
> - [ingoratsdorf](https://github.com/ingoratsdorf)
|
||||||
>
|
>
|
||||||
@@ -13,8 +13,7 @@ To download and install NetAlertX on the hardware/server directly use the `curl`
|
|||||||
> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**.
|
> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> A warning to the installation method below: Piping to bash is [controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash) and may
|
> A warning to the installation method below: Piping to bash is [controversial](https://pi-hole.net/2016/07/25/curling-and-piping-to-bash) and may be dangerous, as you cannot see the code that's about to be executed on your system.
|
||||||
be dangerous, as you cannot see the code that's about to be executed on your system.
|
|
||||||
|
|
||||||
If you trust this repo, you can download the install script via one of the methods (curl/wget) below and it will fo its best to install NetAlertX on your system.
|
If you trust this repo, you can download the install script via one of the methods (curl/wget) below and it will fo its best to install NetAlertX on your system.
|
||||||
|
|
||||||
@@ -40,7 +39,7 @@ Some facts about what and where something will be changed/installed by the HW in
|
|||||||
- Only tested to work on the system listed in the install directory.
|
- Only tested to work on the system listed in the install directory.
|
||||||
- **EXPERIMENTAL** and not recommended way to install NetAlertX.
|
- **EXPERIMENTAL** and not recommended way to install NetAlertX.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> If the below fails try grabbing and installing one of the [previous releases](https://github.com/jokob-sk/NetAlertX/releases) and run the installation from the zip package.
|
> If the below fails try grabbing and installing one of the [previous releases](https://github.com/jokob-sk/NetAlertX/releases) and run the installation from the zip package.
|
||||||
|
|
||||||
These commands will download the `install.debian12.sh` script from the GitHub repository, make it executable with `chmod`, and then run it using `./install.debian12.sh`.
|
These commands will download the `install.debian12.sh` script from the GitHub repository, make it executable with `chmod`, and then run it using `./install.debian12.sh`.
|
||||||
@@ -81,7 +80,7 @@ wget https://raw.githubusercontent.com/jokob-sk/NetAlertX/main/install/ubuntu24/
|
|||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Use this on a clean LXC/VM for Debian 13 OR Ubuntu 24.
|
> Use this on a clean LXC/VM for Debian 13 OR Ubuntu 24.
|
||||||
> The Scipt will detect OS and build acordingly.
|
> The Scipt will detect OS and build acordingly.
|
||||||
> Maintained by [JVKeller](https://github.com/JVKeller)
|
> Maintained by [JVKeller](https://github.com/JVKeller)
|
||||||
|
|
||||||
### Installation via wget
|
### Installation via wget
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
# Migration
|
# Migration
|
||||||
|
|
||||||
> [!WARNING]
|
|
||||||
> ⚠️ **Important:** The documentation has been recently updated and some instructions may have changed.
|
|
||||||
> If you are using the currently live production image, please follow the instructions on [Docker Hub](https://hub.docker.com/r/jokobsk/netalertx) for building and running the container.
|
|
||||||
> These docs reflect the latest development version and may differ from the production image.
|
|
||||||
|
|
||||||
|
|
||||||
When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow the migration steps below to ensure your data and configuration are properly transferred.
|
When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow the migration steps below to ensure your data and configuration are properly transferred.
|
||||||
|
|
||||||
@@ -13,13 +7,13 @@ When upgrading from older versions of NetAlertX (or PiAlert by jokob-sk), follow
|
|||||||
|
|
||||||
## Migration scenarios
|
## Migration scenarios
|
||||||
|
|
||||||
- You are running PiAlert (by jokob-sk)
|
- You are running PiAlert (by jokob-sk)
|
||||||
→ [Read the 1.1 Migration from PiAlert to NetAlertX `v25.5.24`](#11-migration-from-pialert-to-netalertx-v25524)
|
→ [Read the 1.1 Migration from PiAlert to NetAlertX `v25.5.24`](#11-migration-from-pialert-to-netalertx-v25524)
|
||||||
|
|
||||||
- You are running NetAlertX (by jokob-sk) `25.5.24` or older
|
- You are running NetAlertX (by jokob-sk) `25.5.24` or older
|
||||||
→ [Read the 1.2 Migration from NetAlertX `v25.5.24`](#12-migration-from-netalertx-v25524)
|
→ [Read the 1.2 Migration from NetAlertX `v25.5.24`](#12-migration-from-netalertx-v25524)
|
||||||
|
|
||||||
- You are running NetAlertX (by jokob-sk) (`v25.6.7` to `v25.10.1`)
|
- You are running NetAlertX (by jokob-sk) (`v25.6.7` to `v25.10.1`)
|
||||||
→ [Read the 1.3 Migration from NetAlertX `v25.10.1`](#13-migration-from-netalertx-v25101)
|
→ [Read the 1.3 Migration from NetAlertX `v25.10.1`](#13-migration-from-netalertx-v25101)
|
||||||
|
|
||||||
|
|
||||||
@@ -30,40 +24,40 @@ You can migrate data manually, for example by exporting and importing devices us
|
|||||||
|
|
||||||
### 1.1 Migration from PiAlert to NetAlertX `v25.5.24`
|
### 1.1 Migration from PiAlert to NetAlertX `v25.5.24`
|
||||||
|
|
||||||
#### STEPS:
|
#### STEPS:
|
||||||
|
|
||||||
The application will automatically migrate the database, configuration, and all device information.
|
The application will automatically migrate the database, configuration, and all device information.
|
||||||
A banner message will appear at the top of the web UI reminding you to update your Docker mount points.
|
A banner message will appear at the top of the web UI reminding you to update your Docker mount points.
|
||||||
|
|
||||||
1. Stop the container
|
1. Stop the container
|
||||||
2. [Back up your setup](./BACKUPS.md)
|
2. [Back up your setup](./BACKUPS.md)
|
||||||
3. Update the Docker file mount locations in your `docker-compose.yml` or docker run command (See below **New Docker mount locations**).
|
3. Update the Docker file mount locations in your `docker-compose.yml` or docker run command (See below **New Docker mount locations**).
|
||||||
4. Rename the DB and conf files to `app.db` and `app.conf` and place them in the appropriate location.
|
4. Rename the DB and conf files to `app.db` and `app.conf` and place them in the appropriate location.
|
||||||
5. Start the container
|
5. Start the container
|
||||||
|
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> If you have trouble accessing past backups, config or database files you can copy them into the newly mapped directories, for example by running this command in the container: `cp -r /data/config /home/pi/pialert/config/old_backup_files`. This should create a folder in the `config` directory called `old_backup_files` containing all the files in that location. Another approach is to map the old location and the new one at the same time to copy things over.
|
> If you have trouble accessing past backups, config or database files you can copy them into the newly mapped directories, for example by running this command in the container: `cp -r /data/config /home/pi/pialert/config/old_backup_files`. This should create a folder in the `config` directory called `old_backup_files` containing all the files in that location. Another approach is to map the old location and the new one at the same time to copy things over.
|
||||||
|
|
||||||
#### New Docker mount locations
|
#### New Docker mount locations
|
||||||
|
|
||||||
The internal application path in the container has changed from `/home/pi/pialert` to `/app`. Update your volume mounts as follows:
|
The internal application path in the container has changed from `/home/pi/pialert` to `/app`. Update your volume mounts as follows:
|
||||||
|
|
||||||
| Old mount point | New mount point |
|
| Old mount point | New mount point |
|
||||||
|----------------------|---------------|
|
|----------------------|---------------|
|
||||||
| `/home/pi/pialert/config` | `/data/config` |
|
| `/home/pi/pialert/config` | `/data/config` |
|
||||||
| `/home/pi/pialert/db` | `/data/db` |
|
| `/home/pi/pialert/db` | `/data/db` |
|
||||||
|
|
||||||
|
|
||||||
If you were mounting files directly, please note the file names have changed:
|
If you were mounting files directly, please note the file names have changed:
|
||||||
|
|
||||||
| Old file name | New file name |
|
| Old file name | New file name |
|
||||||
|----------------------|---------------|
|
|----------------------|---------------|
|
||||||
| `pialert.conf` | `app.conf` |
|
| `pialert.conf` | `app.conf` |
|
||||||
| `pialert.db` | `app.db` |
|
| `pialert.db` | `app.db` |
|
||||||
|
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The application automatically creates symlinks from the old database and config locations to the new ones, so data loss should not occur. Read the [backup strategies](./BACKUPS.md) guide to backup your setup.
|
> The application automatically creates symlinks from the old database and config locations to the new ones, so data loss should not occur. Read the [backup strategies](./BACKUPS.md) guide to backup your setup.
|
||||||
|
|
||||||
|
|
||||||
@@ -80,17 +74,17 @@ services:
|
|||||||
pialert:
|
pialert:
|
||||||
container_name: pialert
|
container_name: pialert
|
||||||
# use the below line if you want to test the latest dev image
|
# use the below line if you want to test the latest dev image
|
||||||
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
||||||
image: "jokobsk/pialert:latest"
|
image: "jokobsk/pialert:latest"
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/home/pi/pialert/config
|
- /local_data_dir/config:/home/pi/pialert/config
|
||||||
- /local_data_dir/db:/home/pi/pialert/db
|
- /local_data_dir/db:/home/pi/pialert/db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/home/pi/pialert/front/log
|
- /local_data_dir/logs:/home/pi/pialert/front/log
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -98,26 +92,26 @@ services:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx: # 🆕 This has changed
|
netalertx: # 🆕 This has changed
|
||||||
container_name: netalertx # 🆕 This has changed
|
container_name: netalertx # 🆕 This has changed
|
||||||
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
|
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config # 🆕 This has changed
|
- /local_data_dir/config:/data/config # 🆕 This has changed
|
||||||
- /local_data_dir/db:/data/db # 🆕 This has changed
|
- /local_data_dir/db:/data/db # 🆕 This has changed
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log # 🆕 This has changed
|
- /local_data_dir/logs:/tmp/log # 🆕 This has changed
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
##### Example 2: Mapping files
|
##### Example 2: Mapping files
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The recommendation is to map folders as in Example 1, map files directly only when needed.
|
> The recommendation is to map folders as in Example 1, map files directly only when needed.
|
||||||
|
|
||||||
###### Old docker-compose.yml
|
###### Old docker-compose.yml
|
||||||
|
|
||||||
@@ -126,17 +120,17 @@ services:
|
|||||||
pialert:
|
pialert:
|
||||||
container_name: pialert
|
container_name: pialert
|
||||||
# use the below line if you want to test the latest dev image
|
# use the below line if you want to test the latest dev image
|
||||||
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
||||||
image: "jokobsk/pialert:latest"
|
image: "jokobsk/pialert:latest"
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config/pialert.conf:/home/pi/pialert/config/pialert.conf
|
- /local_data_dir/config/pialert.conf:/home/pi/pialert/config/pialert.conf
|
||||||
- /local_data_dir/db/pialert.db:/home/pi/pialert/db/pialert.db
|
- /local_data_dir/db/pialert.db:/home/pi/pialert/db/pialert.db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/home/pi/pialert/front/log
|
- /local_data_dir/logs:/home/pi/pialert/front/log
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -144,18 +138,18 @@ services:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx: # 🆕 This has changed
|
netalertx: # 🆕 This has changed
|
||||||
container_name: netalertx # 🆕 This has changed
|
container_name: netalertx # 🆕 This has changed
|
||||||
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
|
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This has changed
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config/app.conf:/data/config/app.conf # 🆕 This has changed
|
- /local_data_dir/config/app.conf:/data/config/app.conf # 🆕 This has changed
|
||||||
- /local_data_dir/db/app.db:/data/db/app.db # 🆕 This has changed
|
- /local_data_dir/db/app.db:/data/db/app.db # 🆕 This has changed
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log # 🆕 This has changed
|
- /local_data_dir/logs:/tmp/log # 🆕 This has changed
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -164,13 +158,13 @@ services:
|
|||||||
|
|
||||||
Versions before `v25.10.1` require an intermediate migration through `v25.5.24` to ensure database compatibility. Skipping this step may cause compatibility issues due to database schema changes introduced after `v25.5.24`.
|
Versions before `v25.10.1` require an intermediate migration through `v25.5.24` to ensure database compatibility. Skipping this step may cause compatibility issues due to database schema changes introduced after `v25.5.24`.
|
||||||
|
|
||||||
#### STEPS:
|
#### STEPS:
|
||||||
|
|
||||||
1. Stop the container
|
1. Stop the container
|
||||||
2. [Back up your setup](./BACKUPS.md)
|
2. [Back up your setup](./BACKUPS.md)
|
||||||
3. Upgrade to `v25.5.24` by pinning the release version (See Examples below)
|
3. Upgrade to `v25.5.24` by pinning the release version (See Examples below)
|
||||||
4. Start the container and verify everything works as expected.
|
4. Start the container and verify everything works as expected.
|
||||||
5. Stop the container
|
5. Stop the container
|
||||||
6. Upgrade to `v25.10.1` by pinning the release version (See Examples below)
|
6. Upgrade to `v25.10.1` by pinning the release version (See Examples below)
|
||||||
7. Start the container and verify everything works as expected.
|
7. Start the container and verify everything works as expected.
|
||||||
|
|
||||||
@@ -184,62 +178,62 @@ Examples of docker files with the tagged version.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This is important
|
image: "ghcr.io/jokob-sk/netalertx:25.5.24" # 🆕 This is important
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir/config:/data/config
|
||||||
- /local_data_dir/db:/data/db
|
- /local_data_dir/db:/data/db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log
|
- /local_data_dir/logs:/tmp/log
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
|
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir/config:/data/config
|
||||||
- /local_data_dir/db:/data/db
|
- /local_data_dir/db:/data/db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log
|
- /local_data_dir/logs:/tmp/log
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.3 Migration from NetAlertX `v25.10.1`
|
### 1.3 Migration from NetAlertX `v25.10.1`
|
||||||
|
|
||||||
Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md).
|
Starting from v25.10.1, the container uses a [more secure, read-only runtime environment](./SECURITY_FEATURES.md), which requires all writable paths (e.g., logs, API cache, temporary data) to be mounted as `tmpfs` or permanent writable volumes, with sufficient access [permissions](./FILE_PERMISSIONS.md). The data location has also hanged from `/app/db` and `/app/config` to `/data/db` and `/data/config`. See detailed steps below.
|
||||||
|
|
||||||
#### STEPS:
|
#### STEPS:
|
||||||
|
|
||||||
1. Stop the container
|
1. Stop the container
|
||||||
2. [Back up your setup](./BACKUPS.md)
|
2. [Back up your setup](./BACKUPS.md)
|
||||||
3. Upgrade to `v25.10.1` by pinning the release version (See the example below)
|
3. Upgrade to `v25.10.1` by pinning the release version (See the example below)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
|
image: "ghcr.io/jokob-sk/netalertx:25.10.1" # 🆕 This is important
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir/config:/app/config
|
||||||
- /local_data_dir/db:/data/db
|
- /local_data_dir/db:/app/db
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- /local_data_dir/logs:/tmp/log
|
- /local_data_dir/logs:/tmp/log
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -248,21 +242,21 @@ services:
|
|||||||
6. Perform a one-off migration to the latest `netalertx` image and `20211` user:
|
6. Perform a one-off migration to the latest `netalertx` image and `20211` user:
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> The example below assumes your `/config` and `/db` folders are stored in `local_data_dir`.
|
> The example below assumes your `/config` and `/db` folders are stored in `local_data_dir`.
|
||||||
> Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup.
|
> Replace this path with your actual configuration directory. `netalertx` is the container name, which might differ from your setup.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -it --rm --name netalertx --user "0" \
|
docker run -it --rm --name netalertx --user "0" \
|
||||||
-v /local_data_dir/config:/data/config \
|
-v /local_data_dir/config:/data/config \
|
||||||
-v /local_data_dir/db:/data/db \
|
-v /local_data_dir/db:/data/db \
|
||||||
|
--tmpfs /tmp:uid=20211,gid=20211,mode=1700 \
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
ghcr.io/jokob-sk/netalertx:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
..or alternatively execute:
|
..or alternatively execute:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo chown -R 20211:20211 /local_data_dir/config
|
sudo chown -R 20211:20211 /local_data_dir
|
||||||
sudo chown -R 20211:20211 /local_data_dir/db
|
|
||||||
sudo chmod -R a+rwx /local_data_dir/
|
sudo chmod -R a+rwx /local_data_dir/
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -271,22 +265,19 @@ sudo chmod -R a+rwx /local_data_dir/
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx" # 🆕 This is important
|
image: "ghcr.io/jokob-sk/netalertx" # 🆕 This has changed
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
cap_drop: # 🆕 New line
|
cap_drop: # 🆕 New line
|
||||||
- ALL # 🆕 New line
|
- ALL # 🆕 New line
|
||||||
cap_add: # 🆕 New line
|
cap_add: # 🆕 New line
|
||||||
- NET_RAW # 🆕 New line
|
- NET_RAW # 🆕 New line
|
||||||
- NET_ADMIN # 🆕 New line
|
- NET_ADMIN # 🆕 New line
|
||||||
- NET_BIND_SERVICE # 🆕 New line
|
- NET_BIND_SERVICE # 🆕 New line
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config:/data/config
|
- /local_data_dir:/data # 🆕 This folder contains your /db and /config directories and the parent changed from /app to /data
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
|
||||||
#- /local_data_dir/logs:/tmp/log
|
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
||||||
- /etc/localtime:/etc/localtime:ro # 🆕 New line
|
- /etc/localtime:/etc/localtime:ro # 🆕 New line
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
## How to Set Up Your Network Page
|
## How to Set Up Your Network Page
|
||||||
|
|
||||||
The **Network** page lets you map how devices connect — visually and logically.
|
The **Network** page lets you map how devices connect — visually and logically.
|
||||||
It’s especially useful for planning infrastructure, assigning parent-child relationships, and spotting gaps.
|
It’s especially useful for planning infrastructure, assigning parent-child relationships, and spotting gaps.
|
||||||
|
|
||||||

|

|
||||||
@@ -9,11 +9,11 @@ To get started, you’ll need to define at least one root node and mark certain
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Start by creating a root device with the MAC address `Internet`, if the application didn’t create one already.
|
Start by creating a root device with the MAC address `Internet`, if the application didn’t create one already.
|
||||||
This special MAC address (`Internet`) is required for the root network node — no other value is currently supported.
|
This special MAC address (`Internet`) is required for the root network node — no other value is currently supported.
|
||||||
Set its **Type** to a valid network type — such as `Router` or `Gateway`.
|
Set its **Type** to a valid network type — such as `Router` or `Gateway`.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> If you don’t have one, use the [Create new device](./DEVICE_MANAGEMENT.md#dummy-devices) button on the **Devices** page to add a root device.
|
> If you don’t have one, use the [Create new device](./DEVICE_MANAGEMENT.md#dummy-devices) button on the **Devices** page to add a root device.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -21,15 +21,15 @@ Set its **Type** to a valid network type — such as `Router` or `Gateway`.
|
|||||||
## ⚡ Quick Setup
|
## ⚡ Quick Setup
|
||||||
|
|
||||||
1. Open the device you want to use as a network node (e.g. a Switch).
|
1. Open the device you want to use as a network node (e.g. a Switch).
|
||||||
2. Set its **Type** to one of the following:
|
2. Set its **Type** to one of the following:
|
||||||
`AP`, `Firewall`, `Gateway`, `PLC`, `Powerline`, `Router`, `Switch`, `USB LAN Adapter`, `USB WIFI Adapter`, `WLAN`
|
`AP`, `Firewall`, `Gateway`, `PLC`, `Powerline`, `Router`, `Switch`, `USB LAN Adapter`, `USB WIFI Adapter`, `WLAN`
|
||||||
*(Or add custom types under **Settings → General → `NETWORK_DEVICE_TYPES`**.)*
|
*(Or add custom types under **Settings → General → `NETWORK_DEVICE_TYPES`**.)*
|
||||||
3. Save the device.
|
3. Save the device.
|
||||||
4. Go to the **Network** page — supported device types will appear as tabs.
|
4. Go to the **Network** page — supported device types will appear as tabs.
|
||||||
5. Use the **Assign** button to connect unassigned devices to a network node.
|
5. Use the **Assign** button to connect unassigned devices to a network node.
|
||||||
6. If the **Port** is `0` or empty, a Wi-Fi icon is shown. Otherwise, an Ethernet icon appears.
|
6. If the **Port** is `0` or empty, a Wi-Fi icon is shown. Otherwise, an Ethernet icon appears.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Use [bulk editing](./DEVICES_BULK_EDITING.md) with _CSV Export_ to fix `Internet` root assignments or update many devices at once.
|
> Use [bulk editing](./DEVICES_BULK_EDITING.md) with _CSV Export_ to fix `Internet` root assignments or update many devices at once.
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -42,20 +42,22 @@ Let’s walk through setting up a device named `raspberrypi` to act as a network
|
|||||||
|
|
||||||
### 1. Set Device Type and Parent
|
### 1. Set Device Type and Parent
|
||||||
|
|
||||||
- Go to the **Devices** page
|
- Go to the **Devices** page
|
||||||
- Open the device detail view for `raspberrypi`
|
- Open the device detail view for `raspberrypi`
|
||||||
- In the **Type** dropdown, select `Switch`
|
- In the **Type** dropdown, select `Switch`
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
- Optionally assign a **Parent Node** (where this device connects to) and the **Relationship type** of the connection.
|
- Optionally assign a **Parent Node** (where this device connects to) and the **Relationship type** of the connection.
|
||||||
The `nic` relationship type can affect parent notifications — see the setting description and [Notifications documentation](./NOTIFICATIONS.md) for more.
|
The `nic` relationship type can affect parent notifications — see the setting description and [Notifications documentation](./NOTIFICATIONS.md) for more.
|
||||||
|
- A device’s parent MAC will be overwritten by plugins if its current value is any of the following: "null", "(unknown)" "(Unknown)".
|
||||||
|
- If you want plugins to be able to overwrite the parent value (for example, when mixing plugins that do not provide parent MACs like `ARPSCAN` with those that do, like `UNIFIAPI`), you must set the setting `NEWDEV_devParentMAC` to None.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Only certain device types can act as network nodes:
|
> Only certain device types can act as network nodes:
|
||||||
> `AP`, `Firewall`, `Gateway`, `Hypervisor`, `PLC`, `Powerline`, `Router`, `Switch`, `USB LAN Adapter`, `USB WIFI Adapter`, `WLAN`
|
> `AP`, `Firewall`, `Gateway`, `Hypervisor`, `PLC`, `Powerline`, `Router`, `Switch`, `USB LAN Adapter`, `USB WIFI Adapter`, `WLAN`
|
||||||
> You can add custom types via the `NETWORK_DEVICE_TYPES` setting.
|
> You can add custom types via the `NETWORK_DEVICE_TYPES` setting.
|
||||||
|
|
||||||
- Click **Save**
|
- Click **Save**
|
||||||
@@ -81,7 +83,7 @@ You can confirm that `raspberrypi` now acts as a network device in two places:
|
|||||||
### 3. Assign Connected Devices
|
### 3. Assign Connected Devices
|
||||||
|
|
||||||
- Use the **Assign** button to link other devices (e.g. PCs) to `raspberrypi`.
|
- Use the **Assign** button to link other devices (e.g. PCs) to `raspberrypi`.
|
||||||
- After assigning, connected devices will appear beneath the `raspberrypi` switch node.
|
- After assigning, connected devices will appear beneath the `raspberrypi` switch node.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -92,9 +94,9 @@ You can confirm that `raspberrypi` now acts as a network device in two places:
|
|||||||
> Hovering over devices in the tree reveals connection details and tooltips for quick inspection.
|
> Hovering over devices in the tree reveals connection details and tooltips for quick inspection.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Selecting certain relationship types hides the device in the default device views.
|
> Selecting certain relationship types hides the device in the default device views.
|
||||||
> You can change this behavior by adjusting the `UI_hide_rel_types` setting, which by default is set to `["nic","virtual"]`.
|
> You can change this behavior by adjusting the `UI_hide_rel_types` setting, which by default is set to `["nic","virtual"]`.
|
||||||
> This means devices with `devParentRelType` set to `nic` or `virtual` will not be shown.
|
> This means devices with `devParentRelType` set to `nic` or `virtual` will not be shown.
|
||||||
> All devices, regardless of relationship type, are always accessible in the **All devices** view.
|
> All devices, regardless of relationship type, are always accessible in the **All devices** view.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,47 +1,50 @@
|
|||||||
# Performance Optimization Guide
|
# Performance Optimization Guide
|
||||||
|
|
||||||
There are several ways to improve the application's performance. The application has been tested on a range of devices, from a Raspberry Pi 4 to NAS and NUC systems. If you are running the application on a lower-end device, carefully fine-tune the performance settings to ensure an optimal user experience.
|
There are several ways to improve the application's performance. The application has been tested on a range of devices, from Raspberry Pi 4 units to NAS and NUC systems. If you are running the application on a lower-end device, fine-tuning the performance settings can significantly improve the user experience.
|
||||||
|
|
||||||
## Common Causes of Slowness
|
## Common Causes of Slowness
|
||||||
|
|
||||||
Performance issues are usually caused by:
|
Performance issues are usually caused by:
|
||||||
|
|
||||||
- **Incorrect settings** – The app may restart unexpectedly. Check `app.log` under **Maintenance → Logs** for details.
|
* **Incorrect settings** – The app may restart unexpectedly. Check `app.log` under **Maintenance → Logs** for details.
|
||||||
- **Too many background processes** – Disable unnecessary scanners.
|
* **Too many background processes** – Disable unnecessary scanners.
|
||||||
- **Long scan durations** – Limit the number of scanned devices.
|
* **Long scan durations** – Limit the number of scanned devices.
|
||||||
- **Excessive disk operations** – Optimize scanning and logging settings.
|
* **Excessive disk operations** – Optimize scanning and logging settings.
|
||||||
- **Failed maintenance plugins** – Ensure maintenance tasks are running properly.
|
* **Maintenance plugin failures** – If cleanup tasks fail, performance can degrade over time.
|
||||||
|
|
||||||
The application performs regular maintenance and database cleanup. If these tasks fail, performance may degrade.
|
The application performs regular maintenance and database cleanup. If these tasks are failing, you will see slowdowns.
|
||||||
|
|
||||||
### Database and Log File Size
|
### Database and Log File Size
|
||||||
|
|
||||||
A large database or oversized log files can slow down performance. You can check database and table sizes on the **Maintenance** page.
|
A large database or oversized log files can impact performance. You can check database and table sizes on the **Maintenance** page.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> - For **~100 devices**, the database should be around **50MB**.
|
>
|
||||||
> - No table should exceed **10,000 rows** in a healthy system.
|
> * For **~100 devices**, the database should be around **50 MB**.
|
||||||
> - These numbers vary based on network activity and settings.
|
> * No table should exceed **10,000 rows** in a healthy system.
|
||||||
|
> * Actual values vary based on network activity and plugin settings.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Maintenance Plugins
|
## Maintenance Plugins
|
||||||
|
|
||||||
Two plugins help maintain the application’s performance:
|
Two plugins help maintain the system’s performance:
|
||||||
|
|
||||||
### **1. Database Cleanup (DBCLNP)**
|
### **1. Database Cleanup (DBCLNP)**
|
||||||
- Responsible for database maintenance.
|
|
||||||
- Check settings in the [DB Cleanup Plugin Docs](/front/plugins/db_cleanup/README.md).
|
* Handles database maintenance and cleanup.
|
||||||
- Ensure it’s not failing by checking logs.
|
* See the [DB Cleanup Plugin Docs](/front/plugins/db_cleanup/README.md).
|
||||||
- Adjust the schedule (`DBCLNP_RUN_SCHD`) and timeout (`DBCLNP_RUN_TIMEOUT`) if needed.
|
* Ensure it’s not failing by checking logs.
|
||||||
|
* Adjust the schedule (`DBCLNP_RUN_SCHD`) and timeout (`DBCLNP_RUN_TIMEOUT`) if necessary.
|
||||||
|
|
||||||
### **2. Maintenance (MAINT)**
|
### **2. Maintenance (MAINT)**
|
||||||
- Handles log cleanup and other maintenance tasks.
|
|
||||||
- Check settings in the [Maintenance Plugin Docs](/front/plugins/maintenance/README.md).
|
* Cleans logs and performs general maintenance tasks.
|
||||||
- Ensure it’s running correctly by checking logs.
|
* See the [Maintenance Plugin Docs](/front/plugins/maintenance/README.md).
|
||||||
- Adjust the schedule (`MAINT_RUN_SCHD`) and timeout (`MAINT_RUN_TIMEOUT`) if needed.
|
* Verify proper operation via logs.
|
||||||
|
* Adjust the schedule (`MAINT_RUN_SCHD`) and timeout (`MAINT_RUN_TIMEOUT`) if needed.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -50,48 +53,56 @@ Two plugins help maintain the application’s performance:
|
|||||||
Frequent scans increase resource usage, network traffic, and database read/write cycles.
|
Frequent scans increase resource usage, network traffic, and database read/write cycles.
|
||||||
|
|
||||||
### **Optimizations**
|
### **Optimizations**
|
||||||
- **Increase scan intervals** (`<PLUGIN>_RUN_SCHD`) on busy networks or low-end hardware.
|
|
||||||
- **Extend scan timeouts** (`<PLUGIN>_RUN_TIMEOUT`) to prevent failures.
|
|
||||||
- **Reduce the subnet size** – e.g., from `/16` to `/24` to lower scan loads.
|
|
||||||
|
|
||||||
Some plugins have additional options to limit the number of scanned devices. If certain plugins take too long to complete, check if you can optimize scan times by selecting a scan range.
|
* **Increase scan intervals** (`<PLUGIN>_RUN_SCHD`) on busy networks or low-end hardware.
|
||||||
|
* **Increase timeouts** (`<PLUGIN>_RUN_TIMEOUT`) to avoid plugin failures.
|
||||||
|
* **Reduce subnet size** – e.g., use `/24` instead of `/16` to reduce scan load.
|
||||||
|
|
||||||
For example, the **ICMP plugin** allows you to specify a regular expression to scan only IPs that match a specific pattern.
|
Some plugins also include options to limit which devices are scanned. If certain plugins consistently run long, consider narrowing their scope.
|
||||||
|
|
||||||
|
For example, the **ICMP plugin** allows scanning only IPs that match a specific regular expression.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Storing Temporary Files in Memory
|
## Storing Temporary Files in Memory
|
||||||
|
|
||||||
On systems with slower I/O speeds, you can optimize performance by storing temporary files in memory. This primarily applies to the API directory (default: `/tmp/api`, configurable via `NETALERTX_API`) and `/tmp/log` folders.
|
On devices with slower I/O, you can improve performance by storing temporary files (and optionally the database) in memory using `tmpfs`.
|
||||||
|
|
||||||
Using `tmpfs` reduces disk writes and improves performance. However, it should be **disabled** if persistent logs or API data storage are required.
|
> [!WARNING]
|
||||||
|
> Storing the **database** in `tmpfs` is generally discouraged. Use this only if device data and historical records are not required to persist. If needed, you can pair this setup with the `SYNC` plugin to store important persistent data on another node. See the [Plugins docs](./PLUGINS.md) for details.
|
||||||
|
|
||||||
Below is an optimized `docker-compose.yml` snippet:
|
Using `tmpfs` reduces disk writes and speeds up I/O, but **all data stored in memory will be lost on restart**.
|
||||||
|
|
||||||
|
Below is an optimized `docker-compose.yml` snippet using non-persistent logs, API data, and DB:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
# Uncomment the line below to test the latest dev image
|
# Use this line for the stable release
|
||||||
|
image: "ghcr.io/jokob-sk/netalertx:latest"
|
||||||
|
# Or use this line for the latest development build
|
||||||
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
||||||
image: "ghcr.io/jokob-sk/netalertx:latest"
|
network_mode: "host"
|
||||||
network_mode: "host"
|
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
|
||||||
- /local_data_dir/config:/data/config
|
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
# (Optional) Useful for debugging setup issues
|
|
||||||
- /local_data_dir/logs:/tmp/log
|
|
||||||
# (API: OPTION 1) Store temporary files in memory (recommended for performance)
|
|
||||||
- type: tmpfs # ◀ 🔺
|
|
||||||
target: /tmp/api # ◀ 🔺
|
|
||||||
# (API: OPTION 2) Store API data on disk (useful for debugging)
|
|
||||||
# - /local_data_dir/api:/tmp/api
|
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
environment:
|
|
||||||
- PORT=20211
|
|
||||||
|
|
||||||
|
cap_drop: # Drop all capabilities for enhanced security
|
||||||
|
- ALL
|
||||||
|
cap_add: # Re-add necessary capabilities
|
||||||
|
- NET_RAW
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_BIND_SERVICE
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- ${APP_FOLDER}/netalertx/config:/data/config
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
|
tmpfs:
|
||||||
|
# All writable runtime state resides under /tmp; comment out to persist logs between restarts
|
||||||
|
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
||||||
|
- "/data/db:uid=20211,gid=20211,mode=1700" # ⚠ You will lose historical data on restart
|
||||||
|
|
||||||
|
environment:
|
||||||
|
- PORT=${PORT}
|
||||||
|
- APP_CONF_OVERRIDE=${APP_CONF_OVERRIDE}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable NetAlertX to execute dig and nslookup commands to automatically resolve device names based on their IP addresses.
|
If you are running a DNS server, such as **AdGuard**, set up **Private reverse DNS servers** for a better name resolution on your network. Enabling this setting will enable NetAlertX to execute dig and nslookup commands to automatically resolve device names based on their IP addresses.
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Before proceeding, ensure that [name resolution plugins](/local_data_dir/NAME_RESOLUTION.md) are enabled.
|
> Before proceeding, ensure that [name resolution plugins](/local_data_dir/NAME_RESOLUTION.md) are enabled.
|
||||||
> You can customize how names are cleaned using the `NEWDEV_NAME_CLEANUP_REGEX` setting.
|
> You can customize how names are cleaned using the `NEWDEV_NAME_CLEANUP_REGEX` setting.
|
||||||
> To auto-update Fully Qualified Domain Names (FQDN), enable the `REFRESH_FQDN` setting.
|
> To auto-update Fully Qualified Domain Names (FQDN), enable the `REFRESH_FQDN` setting.
|
||||||
|
|
||||||
|
|
||||||
> Example 1: Reverse DNS `disabled`
|
> Example 1: Reverse DNS `disabled`
|
||||||
>
|
>
|
||||||
> ```
|
> ```
|
||||||
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
||||||
> ** server can't find 58.1.168.192.in-addr.arpa: NXDOMAIN
|
> ** server can't find 58.1.168.192.in-addr.arpa: NXDOMAIN
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
> Example 2: Reverse DNS `enabled`
|
> Example 2: Reverse DNS `enabled`
|
||||||
>
|
>
|
||||||
> ```
|
> ```
|
||||||
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
> jokob@Synology-NAS:/$ nslookup 192.168.1.58
|
||||||
> 45.1.168.192.in-addr.arpa name = jokob-NUC.localdomain.
|
> 45.1.168.192.in-addr.arpa name = jokob-NUC.localdomain.
|
||||||
@@ -33,23 +33,14 @@ If you are running a DNS server, such as **AdGuard**, set up **Private reverse D
|
|||||||
|
|
||||||
### Specifying the DNS in the container
|
### Specifying the DNS in the container
|
||||||
|
|
||||||
You can specify the DNS server in the docker-compose to improve name resolution on your network.
|
You can specify the DNS server in the docker-compose to improve name resolution on your network.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx:latest"
|
image: "ghcr.io/jokob-sk/netalertx:latest"
|
||||||
restart: unless-stopped
|
...
|
||||||
volumes:
|
|
||||||
- /local_data_dir/config:/data/config
|
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
# - /local_data_dir/log:/tmp/log
|
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
environment:
|
|
||||||
- PORT=20211
|
|
||||||
network_mode: host
|
|
||||||
dns: # specifying the DNS servers used for the container
|
dns: # specifying the DNS servers used for the container
|
||||||
- 10.8.0.1
|
- 10.8.0.1
|
||||||
- 10.8.0.17
|
- 10.8.0.17
|
||||||
@@ -57,7 +48,7 @@ services:
|
|||||||
|
|
||||||
### Using a custom resolv.conf file
|
### Using a custom resolv.conf file
|
||||||
|
|
||||||
You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details.
|
You can configure a custom **/etc/resolv.conf** file in **docker-compose.yml** and set the nameserver to your LAN DNS server (e.g.: Pi-Hole). See the relevant [resolv.conf man](https://www.man7.org/linux/man-pages/man5/resolv.conf.5.html) entry for details.
|
||||||
|
|
||||||
#### docker-compose.yml:
|
#### docker-compose.yml:
|
||||||
|
|
||||||
@@ -66,18 +57,10 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
image: "ghcr.io/jokob-sk/netalertx:latest"
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
- /local_data_dir/config/app.conf:/data/config/app.conf
|
...
|
||||||
- /local_data_dir/db:/data/db
|
|
||||||
- /local_data_dir/log:/tmp/log
|
|
||||||
- /local_data_dir/config/resolv.conf:/etc/resolv.conf # ⚠ Mapping the /resolv.conf file for better name resolution
|
- /local_data_dir/config/resolv.conf:/etc/resolv.conf # ⚠ Mapping the /resolv.conf file for better name resolution
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
...
|
||||||
- /etc/localtime:/etc/localtime:ro
|
|
||||||
environment:
|
|
||||||
- PORT=20211
|
|
||||||
network_mode: host
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### /local_data_dir/config/resolv.conf:
|
#### /local_data_dir/config/resolv.conf:
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
> Submitted by amazing [cvc90](https://github.com/cvc90) 🙏
|
> Submitted by amazing [cvc90](https://github.com/cvc90) 🙏
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> There are various NGINX config files for NetAlertX, some for the bare-metal install, currently Debian 12 and Ubuntu 24 (`netalertx.conf`), and one for the docker container (`netalertx.template.conf`).
|
> There are various NGINX config files for NetAlertX, some for the bare-metal install, currently Debian 12 and Ubuntu 24 (`netalertx.conf`), and one for the docker container (`netalertx.template.conf`).
|
||||||
>
|
>
|
||||||
> The first one you can find in the respective bare metal installer folder `/app/install/\<system\>/netalertx.conf`.
|
> The first one you can find in the respective bare metal installer folder `/app/install/\<system\>/netalertx.conf`.
|
||||||
> The docker one can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup.
|
> The docker one can be found in the [install](https://github.com/jokob-sk/NetAlertX/tree/main/install) folder. Map, or use, the one appropriate for your setup.
|
||||||
|
|
||||||
@@ -17,14 +17,14 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
proxy_preserve_host on;
|
proxy_preserve_host on;
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Activate the new website by running the following command:
|
3. Activate the new website by running the following command:
|
||||||
|
|
||||||
@@ -43,18 +43,18 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
proxy_preserve_host on;
|
proxy_preserve_host on;
|
||||||
location ^~ /netalertx/ {
|
location ^~ /netalertx/ {
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
||||||
rewrite ^/netalertx/?(.*)$ /$1 break;
|
rewrite ^/netalertx/?(.*)$ /$1 break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
||||||
|
|
||||||
@@ -73,13 +73,13 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
proxy_preserve_host on;
|
proxy_preserve_host on;
|
||||||
location ^~ /netalertx/ {
|
location ^~ /netalertx/ {
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
||||||
rewrite ^/netalertx/?(.*)$ /$1 break;
|
rewrite ^/netalertx/?(.*)$ /$1 break;
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
@@ -89,13 +89,13 @@
|
|||||||
sub_filter '(?>$host)/js' '/netalertx/js';
|
sub_filter '(?>$host)/js' '/netalertx/js';
|
||||||
sub_filter '/img' '/netalertx/img';
|
sub_filter '/img' '/netalertx/img';
|
||||||
sub_filter '/lib' '/netalertx/lib';
|
sub_filter '/lib' '/netalertx/lib';
|
||||||
sub_filter '/php' '/netalertx/php';
|
sub_filter '/php' '/netalertx/php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`nginx -s reload` or `systemctl restart nginx`
|
`nginx -s reload` or `systemctl restart nginx`
|
||||||
@@ -111,17 +111,17 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 443;
|
listen 443;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
SSLEngine On;
|
SSLEngine On;
|
||||||
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
||||||
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
||||||
proxy_preserve_host on;
|
proxy_preserve_host on;
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
||||||
|
|
||||||
@@ -140,23 +140,23 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 443;
|
listen 443;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
SSLEngine On;
|
SSLEngine On;
|
||||||
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
||||||
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
||||||
location ^~ /netalertx/ {
|
location ^~ /netalertx/ {
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
||||||
rewrite ^/netalertx/?(.*)$ /$1 break;
|
rewrite ^/netalertx/?(.*)$ /$1 break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`nginx -s reload` or `systemctl restart nginx`
|
`nginx -s reload` or `systemctl restart nginx`
|
||||||
@@ -172,15 +172,15 @@
|
|||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 443;
|
listen 443;
|
||||||
server_name netalertx;
|
server_name netalertx;
|
||||||
SSLEngine On;
|
SSLEngine On;
|
||||||
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
SSLCertificateFile /etc/ssl/certs/netalertx.pem;
|
||||||
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
SSLCertificateKeyFile /etc/ssl/private/netalertx.key;
|
||||||
location ^~ /netalertx/ {
|
location ^~ /netalertx/ {
|
||||||
proxy_pass http://localhost:20211/;
|
proxy_pass http://localhost:20211/;
|
||||||
proxy_pass_reverse http://localhost:20211/;
|
proxy_pass_reverse http://localhost:20211/;
|
||||||
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
proxy_redirect ~^/(.*)$ /netalertx/$1;
|
||||||
rewrite ^/netalertx/?(.*)$ /$1 break;
|
rewrite ^/netalertx/?(.*)$ /$1 break;
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
@@ -190,13 +190,13 @@
|
|||||||
sub_filter '(?>$host)/js' '/netalertx/js';
|
sub_filter '(?>$host)/js' '/netalertx/js';
|
||||||
sub_filter '/img' '/netalertx/img';
|
sub_filter '/img' '/netalertx/img';
|
||||||
sub_filter '/lib' '/netalertx/lib';
|
sub_filter '/lib' '/netalertx/lib';
|
||||||
sub_filter '/php' '/netalertx/php';
|
sub_filter '/php' '/netalertx/php';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
3. Check your config with `nginx -t`. If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`nginx -s reload` or `systemctl restart nginx`
|
`nginx -s reload` or `systemctl restart nginx`
|
||||||
@@ -218,10 +218,10 @@
|
|||||||
ProxyPass / http://localhost:20211/
|
ProxyPass / http://localhost:20211/
|
||||||
ProxyPassReverse / http://localhost:20211/
|
ProxyPassReverse / http://localhost:20211/
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`a2ensite netalertx` or `service apache2 reload`
|
`a2ensite netalertx` or `service apache2 reload`
|
||||||
@@ -245,10 +245,10 @@
|
|||||||
ProxyPassReverse / http://localhost:20211/
|
ProxyPassReverse / http://localhost:20211/
|
||||||
}
|
}
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`a2ensite netalertx` or `service apache2 reload`
|
`a2ensite netalertx` or `service apache2 reload`
|
||||||
@@ -273,10 +273,10 @@
|
|||||||
ProxyPass / http://localhost:20211/
|
ProxyPass / http://localhost:20211/
|
||||||
ProxyPassReverse / http://localhost:20211/
|
ProxyPassReverse / http://localhost:20211/
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`a2ensite netalertx` or `service apache2 reload`
|
`a2ensite netalertx` or `service apache2 reload`
|
||||||
@@ -290,11 +290,11 @@
|
|||||||
1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf.
|
1. On your Apache server, create a new file called /etc/apache2/sites-available/netalertx.conf.
|
||||||
|
|
||||||
2. In this file, paste the following code:
|
2. In this file, paste the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
<VirtualHost *:443>
|
<VirtualHost *:443>
|
||||||
ServerName netalertx
|
ServerName netalertx
|
||||||
SSLEngine On
|
SSLEngine On
|
||||||
SSLCertificateFile /etc/ssl/certs/netalertx.pem
|
SSLCertificateFile /etc/ssl/certs/netalertx.pem
|
||||||
SSLCertificateKeyFile /etc/ssl/private/netalertx.key
|
SSLCertificateKeyFile /etc/ssl/private/netalertx.key
|
||||||
location ^~ /netalertx/ {
|
location ^~ /netalertx/ {
|
||||||
@@ -303,10 +303,10 @@
|
|||||||
ProxyPassReverse / http://localhost:20211/
|
ProxyPassReverse / http://localhost:20211/
|
||||||
}
|
}
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
3. Check your config with `httpd -t` (or `apache2ctl -t` on Debian/Ubuntu). If there are any issues, it will tell you.
|
||||||
|
|
||||||
4. Activate the new website by running the following command:
|
4. Activate the new website by running the following command:
|
||||||
|
|
||||||
`a2ensite netalertx` or `service apache2 reload`
|
`a2ensite netalertx` or `service apache2 reload`
|
||||||
@@ -381,7 +381,7 @@ location ^~ /netalertx/ {
|
|||||||
|
|
||||||
> Submitted by [Isegrimm](https://github.com/Isegrimm) 🙏 (based on this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/449#discussioncomment-7281442))
|
> Submitted by [Isegrimm](https://github.com/Isegrimm) 🙏 (based on this [discussion](https://github.com/jokob-sk/NetAlertX/discussions/449#discussioncomment-7281442))
|
||||||
|
|
||||||
Assuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/netalertx/.
|
Assuming the user already has a working Traefik setup, this is what's needed to make NetAlertX work at a URL like www.domain.com/netalertx/.
|
||||||
|
|
||||||
Note: Everything in these configs assumes '**www.domain.com**' as your domainname and '**section31**' as an arbitrary name for your certificate setup. You will have to substitute these with your own.
|
Note: Everything in these configs assumes '**www.domain.com**' as your domainname and '**section31**' as an arbitrary name for your certificate setup. You will have to substitute these with your own.
|
||||||
|
|
||||||
@@ -496,14 +496,9 @@ server {
|
|||||||
Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/default`) into the docker container:
|
Mapping the updated file (on the local filesystem at `/appl/docker/netalertx/default`) into the docker container:
|
||||||
|
|
||||||
|
|
||||||
```bash
|
```yaml
|
||||||
docker run -d --rm --network=host \
|
...
|
||||||
--name=netalertx \
|
volumes:
|
||||||
-v /appl/docker/netalertx/config:/data/config \
|
- /appl/docker/netalertx/default:/etc/nginx/sites-available/default
|
||||||
-v /appl/docker/netalertx/db:/data/db \
|
...
|
||||||
-v /etc/localtime:/etc/localtime \
|
|
||||||
-v /appl/docker/netalertx/default:/etc/nginx/sites-available/default \
|
|
||||||
-e PORT=20211 \
|
|
||||||
ghcr.io/jokob-sk/netalertx:latest
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,62 +1,64 @@
|
|||||||
# Sessions Section in Device View
|
# Sessions Section – Device View
|
||||||
|
|
||||||
The **Sessions Section** provides details about a device's connection history. This data is automatically detected and cannot be edited by the user.
|
The **Sessions Section** shows a device’s connection history. All data is automatically detected and **cannot be edited**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Key Fields
|
## Key Fields
|
||||||
|
|
||||||
1. **Date and Time of First Connection**
|
| Field | Description | Editable? |
|
||||||
- **Description:** Displays the first detected connection time for the device.
|
| ------------------------------ | ------------------------------------------------------------------------------------------------ | --------------- |
|
||||||
- **Editability:** Uneditable (auto-detected).
|
| **First Connection** | The first time the device was detected on the network. | ❌ Auto-detected |
|
||||||
- **Source:** Automatically captured when the device is first added to the system.
|
| **Last Connection** | The most recent time the device was online. | ❌ Auto-detected |
|
||||||
|
|
||||||
2. **Date and Time of Last Connection**
|
|
||||||
- **Description:** Shows the most recent time the device was online.
|
|
||||||
- **Editability:** Uneditable (auto-detected).
|
|
||||||
- **Source:** Updated with every new connection event.
|
|
||||||
|
|
||||||
3. **Offline Devices with Missing or Conflicting Data**
|
|
||||||
- **Description:** Handles cases where a device is offline but has incomplete or conflicting session data (e.g., missing start times).
|
|
||||||
- **Handling:** The system flags these cases for review and attempts to infer missing details.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## How Sessions are Discovered and Calculated
|
## How Session Information Works
|
||||||
|
|
||||||
### 1. Detecting New Devices
|
### 1. Detecting New Devices
|
||||||
When a device is first detected in the network, the system logs it in the events table:
|
|
||||||
|
|
||||||
`INSERT INTO Events (eve_MAC, eve_IP, eve_DateTime, eve_EventType, eve_AdditionalInfo, eve_PendingAlertEmail) SELECT cur_MAC, cur_IP, '{startTime}', 'New Device', cur_Vendor, 1 FROM CurrentScan WHERE NOT EXISTS (SELECT 1 FROM Devices WHERE devMac = cur_MAC)`
|
* New devices are automatically detected when they first appear on the network.
|
||||||
|
* A **New Device** record is created, capturing the MAC, IP, vendor, and detection time.
|
||||||
|
|
||||||
- Devices scanned in the current cycle (**CurrentScan**) are checked against the **Devices** table.
|
### 2. Recording Connection Sessions
|
||||||
- If a device is new:
|
|
||||||
- A **New Device** event is logged.
|
|
||||||
- The device’s MAC, IP, vendor, and detection time are recorded.
|
|
||||||
|
|
||||||
### 2. Logging Connection Sessions
|
* Every time a device connects, a session entry is created.
|
||||||
When a new connection is detected, the system creates a session record:
|
* Captured details include:
|
||||||
|
|
||||||
`INSERT INTO Sessions (ses_MAC, ses_IP, ses_EventTypeConnection, ses_DateTimeConnection, ses_EventTypeDisconnection, ses_DateTimeDisconnection, ses_StillConnected, ses_AdditionalInfo) SELECT cur_MAC, cur_IP, 'Connected', '{startTime}', NULL, NULL, 1, cur_Vendor FROM CurrentScan WHERE NOT EXISTS (SELECT 1 FROM Sessions WHERE ses_MAC = cur_MAC)`
|
* Connection type (wired or wireless)
|
||||||
|
* Connection time
|
||||||
- A new session is logged in the **Sessions** table if no prior session exists.
|
* Device details (MAC, IP, vendor)
|
||||||
- Fields like `MAC`, `IP`, `Connection Type`, and `Connection Time` are populated.
|
|
||||||
- The `Still Connected` flag is set to `1` (active connection).
|
|
||||||
|
|
||||||
### 3. Handling Missing or Conflicting Data
|
### 3. Handling Missing or Conflicting Data
|
||||||
- Devices with incomplete or conflicting session data (e.g., missing start times) are detected.
|
|
||||||
- The system flags these records and attempts corrections by inferring details from available data.
|
* **Triggers:**
|
||||||
|
Devices are flagged when session data is incomplete, inconsistent, or conflicting. Examples include:
|
||||||
|
|
||||||
|
* Missing first or last connection timestamps
|
||||||
|
* Overlapping session records
|
||||||
|
* Sessions showing a device as connected and disconnected at the same time
|
||||||
|
|
||||||
|
* **System response:**
|
||||||
|
|
||||||
|
* Automatically highlights affected devices in the **Sessions Section**.
|
||||||
|
* Attempts to **infer missing information** from available data, such as:
|
||||||
|
|
||||||
|
* Estimating first or last connection times from nearby session events
|
||||||
|
* Correcting overlapping session periods
|
||||||
|
* Reconciling conflicting connection statuses
|
||||||
|
|
||||||
|
* **User impact:**
|
||||||
|
|
||||||
|
* Users do **not** need to manually fix session data.
|
||||||
|
* The system ensures the device’s connection history remains as accurate as possible for monitoring and reporting.
|
||||||
|
|
||||||
### 4. Updating Sessions
|
### 4. Updating Sessions
|
||||||
- When a device reconnects, its session is updated with a new connection timestamp.
|
|
||||||
- When a device disconnects:
|
|
||||||
- The **Disconnection Time** is recorded.
|
|
||||||
- The `Still Connected` flag is set to `0`.
|
|
||||||
|
|
||||||
The session information is then used to display the device presence under **Monitoring** -> **Presence**.
|
* **Reconnect:** Updates session with the new connection timestamp.
|
||||||
|
* **Disconnect:** Records disconnection time and marks the device as offline.
|
||||||
|
|
||||||
|
This session information feeds directly into **Monitoring → Presence**, providing a live view of which devices are currently online.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Installation on a Synology NAS
|
# Installation on a Synology NAS
|
||||||
|
|
||||||
There are different ways to install NetAlertX on a Synology, including SSH-ing into the machine and using the command line. For this guide, we will use the Project option in Container manager.
|
There are different ways to install NetAlertX on a Synology, including SSH-ing into the machine and using the command line. For this guide, we will use the Project option in Container manager.
|
||||||
|
|
||||||
## Create the folder structure
|
## Create the folder structure
|
||||||
|
|
||||||
The folders you are creating below will contain the configuration and the database. Back them up regularly.
|
The folders you are creating below will contain the configuration and the database. Back them up regularly.
|
||||||
|
|
||||||
1. Create a parent folder named `netalertx`
|
1. Create a parent folder named `netalertx`
|
||||||
2. Create a `db` sub-folder
|
2. Create a `db` sub-folder
|
||||||
@@ -29,23 +29,30 @@ The folders you are creating below will contain the configuration and the databa
|
|||||||
- Path: `/app_storage/netalertx` (will differ from yours)
|
- Path: `/app_storage/netalertx` (will differ from yours)
|
||||||
- Paste in the following template:
|
- Paste in the following template:
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
netalertx:
|
netalertx:
|
||||||
container_name: netalertx
|
container_name: netalertx
|
||||||
# use the below line if you want to test the latest dev image
|
# use the below line if you want to test the latest dev image
|
||||||
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
# image: "ghcr.io/jokob-sk/netalertx-dev:latest"
|
||||||
image: "ghcr.io/jokob-sk/netalertx:latest"
|
image: "ghcr.io/jokob-sk/netalertx:latest"
|
||||||
network_mode: "host"
|
network_mode: "host"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
cap_drop: # Drop all capabilities for enhanced security
|
||||||
|
- ALL
|
||||||
|
cap_add: # Re-add necessary capabilities
|
||||||
|
- NET_RAW
|
||||||
|
- NET_ADMIN
|
||||||
|
- NET_BIND_SERVICE
|
||||||
volumes:
|
volumes:
|
||||||
- local/path/config:/data/config
|
- /app_storage/netalertx:/data
|
||||||
- local/path/db:/data/db
|
# to sync with system time
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- local/path/logs:/tmp/log
|
tmpfs:
|
||||||
# Ensuring the timezone is the same as on the server - make sure also the TIMEZONE setting is configured
|
# All writable runtime state resides under /tmp; comment out to persist logs between restarts
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- "/tmp:uid=20211,gid=20211,mode=1700,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
|
||||||
environment:
|
environment:
|
||||||
- PORT=20211
|
- PORT=20211
|
||||||
```
|
```
|
||||||
@@ -58,10 +65,7 @@ services:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
volumes:
|
volumes:
|
||||||
- /volume1/app_storage/netalertx/config:/data/config
|
- /volume1/app_storage/netalertx:/data
|
||||||
- /volume1/app_storage/netalertx/db:/data/db
|
|
||||||
# (optional) useful for debugging if you have issues setting up the container
|
|
||||||
# - local/path/logs:/tmp/log <- commented out with # ⚠
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@@ -72,4 +76,13 @@ services:
|
|||||||

|

|
||||||
|
|
||||||
10. Navigate to `<Synology URL>:20211` (or your custom port).
|
10. Navigate to `<Synology URL>:20211` (or your custom port).
|
||||||
11. Read the [Subnets](./SUBNETS.md) and [Plugins](/docs/PLUGINS.md) docs to complete your setup.
|
11. Read the [Subnets](./SUBNETS.md) and [Plugins](/docs/PLUGINS.md) docs to complete your setup.
|
||||||
|
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> If you are facing permissions issues run the following commands on your server. This will change the owner and assure sufficient access to the database and config files that are stored in the `/local_data_dir/db` and `/local_data_dir/config` folders (replace `local_data_dir` with the location where your `/db` and `/config` folders are located).
|
||||||
|
>
|
||||||
|
> `sudo chown -R 20211:20211 /local_data_dir`
|
||||||
|
>
|
||||||
|
> `sudo chmod -R a+rwx /local_data_dir`
|
||||||
|
>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# Docker Update Strategies to upgrade NetAlertX
|
# Docker Update Strategies to upgrade NetAlertX
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> For versions prior to `v25.6.7` upgrade to version `v25.5.24` first (`docker pull ghcr.io/jokob-sk/netalertx:25.5.24`) as later versions don't support a full upgrade. Alternatively, devices and settings can be migrated manually, e.g. via [CSV import](./DEVICES_BULK_EDITING.md).
|
> For versions prior to `v25.6.7` upgrade to version `v25.5.24` first (`docker pull ghcr.io/jokob-sk/netalertx:25.5.24`) as later versions don't support a full upgrade. Alternatively, devices and settings can be migrated manually, e.g. via [CSV import](./DEVICES_BULK_EDITING.md).
|
||||||
|
> See the [Migration guide](./MIGRATION.md) for details.
|
||||||
|
|
||||||
This guide outlines approaches for updating Docker containers, usually when upgrading to a newer version of NetAlertX. Each method offers different benefits depending on the situation. Here are the methods:
|
This guide outlines approaches for updating Docker containers, usually when upgrading to a newer version of NetAlertX. Each method offers different benefits depending on the situation. Here are the methods:
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ You can choose any approach that fits your workflow.
|
|||||||
> In the examples I assume that the container name is `netalertx` and the image name is `netalertx` as well.
|
> In the examples I assume that the container name is `netalertx` and the image name is `netalertx` as well.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> See also [Backup strategies](./BACKUPS.md) to be on the safe side.
|
> See also [Backup strategies](./BACKUPS.md) to be on the safe side.
|
||||||
|
|
||||||
## 1. Manual Updates
|
## 1. Manual Updates
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ sudo docker-compose up --pull always -d
|
|||||||
|
|
||||||
## 2. Dockcheck for Bulk Container Updates
|
## 2. Dockcheck for Bulk Container Updates
|
||||||
|
|
||||||
Always check the [Dockcheck](https://github.com/mag37/dockcheck) docs if encountering issues with the guide below.
|
Always check the [Dockcheck](https://github.com/mag37/dockcheck) docs if encountering issues with the guide below.
|
||||||
|
|
||||||
Dockcheck is a useful tool if you have multiple containers to update and some flexibility for handling potential issues that might arise during mass updates. Dockcheck allows you to inspect each container and decide when to update.
|
Dockcheck is a useful tool if you have multiple containers to update and some flexibility for handling potential issues that might arise during mass updates. Dockcheck allows you to inspect each container and decide when to update.
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ sudo ./dockcheck.sh
|
|||||||
|
|
||||||
## 3. Automated Updates with Watchtower
|
## 3. Automated Updates with Watchtower
|
||||||
|
|
||||||
Always check the [watchtower](https://github.com/containrrr/watchtower) docs if encountering issues with the guide below.
|
Always check the [watchtower](https://github.com/containrrr/watchtower) docs if encountering issues with the guide below.
|
||||||
|
|
||||||
Watchtower monitors your Docker containers and automatically updates them when new images are available. This is ideal for ongoing updates without manual intervention.
|
Watchtower monitors your Docker containers and automatically updates them when new images are available. This is ideal for ongoing updates without manual intervention.
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ docker run -d \
|
|||||||
--interval 300 # Check for updates every 5 minutes
|
--interval 300 # Check for updates every 5 minutes
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 3. Run Watchtower to update only NetAlertX:
|
#### 3. Run Watchtower to update only NetAlertX:
|
||||||
|
|
||||||
You can specify which containers to monitor by listing them. For example, to monitor netalertx only:
|
You can specify which containers to monitor by listing them. For example, to monitor netalertx only:
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The application uses the following default ports:
|
The application uses the following default ports:
|
||||||
|
|
||||||
- **Web UI**: `20211`
|
- **Web UI**: `20211`
|
||||||
- **GraphQL API**: `20212`
|
- **GraphQL API**: `20212`
|
||||||
|
|
||||||
The **Web UI** is served by an **nginx** server, while the **API backend** runs on a **Flask (Python)** server.
|
The **Web UI** is served by an **nginx** server, while the **API backend** runs on a **Flask (Python)** server.
|
||||||
@@ -25,8 +25,8 @@ Follow all of the below in order to disqualify potential causes of issues and to
|
|||||||
|
|
||||||
When opening an issue or debugging:
|
When opening an issue or debugging:
|
||||||
|
|
||||||
1. Include a screenshot of what you see when accessing `HTTP://<your rpi IP>/20211` (or your custom port)
|
1. Include a screenshot of what you see when accessing `HTTP://<your_server>:20211` (or your custom port)
|
||||||
1. [Follow steps 1, 2, 3, 4 on this page](./DEBUG_TIPS.md)
|
1. [Follow steps 1, 2, 3, 4 on this page](./DEBUG_TIPS.md)
|
||||||
1. Execute the following in the container to see the processes and their ports and submit a screenshot of the result:
|
1. Execute the following in the container to see the processes and their ports and submit a screenshot of the result:
|
||||||
- `sudo apk add lsof`
|
- `sudo apk add lsof`
|
||||||
- `sudo lsof -i`
|
- `sudo lsof -i`
|
||||||
@@ -36,21 +36,21 @@ When opening an issue or debugging:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 2. JavaScript issues
|
### 2. JavaScript issues
|
||||||
|
|
||||||
Check for browser console (F12 browser dev console) errors + check different browsers.
|
Check for browser console (F12 browser dev console) errors + check different browsers.
|
||||||
|
|
||||||
### 3. Clear the app cache and cached JavaScript files
|
### 3. Clear the app cache and cached JavaScript files
|
||||||
|
|
||||||
Refresh the browser cache (usually shoft + refresh), try a private window, or different browsers. Please also refresh the app cache by clicking the 🔃 (reload) button in the header of the application.
|
Refresh the browser cache (usually shoft + refresh), try a private window, or different browsers. Please also refresh the app cache by clicking the 🔃 (reload) button in the header of the application.
|
||||||
|
|
||||||
### 4. Disable proxies
|
### 4. Disable proxies
|
||||||
|
|
||||||
If you have any reverse proxy or similar, try disabling it.
|
If you have any reverse proxy or similar, try disabling it.
|
||||||
|
|
||||||
### 5. Disable your firewall
|
### 5. Disable your firewall
|
||||||
|
|
||||||
If you are using a firewall, try to temporarily disabling it.
|
If you are using a firewall, try to temporarily disabling it.
|
||||||
|
|
||||||
### 6. Post your docker start details
|
### 6. Post your docker start details
|
||||||
|
|
||||||
@@ -67,6 +67,6 @@ In the container execute and investigate:
|
|||||||
### 8. Make sure permissions are correct
|
### 8. Make sure permissions are correct
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> You can try to start the container without mapping the `/data/config` and `/data/db` dirs and if the UI shows up then the issue is most likely related to your file system permissions or file ownership.
|
> You can try to start the container without mapping the `/data/config` and `/data/db` dirs and if the UI shows up then the issue is most likely related to your file system permissions or file ownership.
|
||||||
|
|
||||||
Please read the [Permissions troubleshooting guide](./FILE_PERMISSIONS.md) and provide a screesnhot of the permissions and ownership in the `/data/db` and `app/config` directories.
|
Please read the [Permissions troubleshooting guide](./FILE_PERMISSIONS.md) and provide a screesnhot of the permissions and ownership in the `/data/db` and `app/config` directories.
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
# Workflows debugging and troubleshooting
|
# Workflows debugging and troubleshooting
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
> Before troubleshooting, please ensure you have [Debugging enabled](./DEBUG_TIPS.md).
|
> Before troubleshooting, please ensure you have the right [Debugging and LOG_LEVEL set](./DEBUG_TIPS.md).
|
||||||
|
|
||||||
Workflows are triggered by various events. These events are captured and listed in the _Integrations -> App Events_ section of the application.
|
Workflows are triggered by various events. These events are captured and listed in the _Integrations -> App Events_ section of the application.
|
||||||
|
|
||||||
## Troubleshooting triggers
|
## Troubleshooting triggers
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Workflow events are processed once every 5 seconds. However, if a scan or other background tasks are running, this can cause a delay up to a few minutes.
|
> Workflow events are processed once every 5 seconds. However, if a scan or other background tasks are running, this can cause a delay up to a few minutes.
|
||||||
|
|
||||||
If an event doesn't trigger a workflow as expected, check the _App Events_ section for the event. You can filter these by the ID of the device (`devMAC` or `devGUID`).
|
If an event doesn't trigger a workflow as expected, check the _App Events_ section for the event. You can filter these by the ID of the device (`devMAC` or `devGUID`).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Once you find the _Event Guid_ and _Object GUID_, use them to find relevant debug entries.
|
Once you find the _Event Guid_ and _Object GUID_, use them to find relevant debug entries.
|
||||||
|
|
||||||
Navigate to _Mainetenace -> Logs_ where you can filter the logs based on the _Event or Object GUID_.
|
Navigate to _Mainetenace -> Logs_ where you can filter the logs based on the _Event or Object GUID_.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -24,9 +24,9 @@ Below you can find some example `app.log` entries that will help you understand
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Sample Device Update Workflow'
|
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Sample Device Update Workflow'
|
||||||
16:27:03 [WF] self.triggered 'False' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "insert"}'
|
16:27:03 [WF] self.triggered 'False' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "insert"}'
|
||||||
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Location Change'
|
16:27:03 [WF] Checking if '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggers the workflow 'Location Change'
|
||||||
16:27:03 [WF] self.triggered 'True' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "update"}'
|
16:27:03 [WF] self.triggered 'True' for event '[[155], ['13f0ce26-1835-4c48-ae03-cdaf38f328fe'], [0], ['2025-04-02 05:26:56'], ['Devices'], ['050b6980-7af6-4409-950d-08e9786b7b33'], ['DEVICES'], ['00:11:32:ef:a5:6c'], ['192.168.1.82'], ['050b6980-7af6-4409-950d-08e9786b7b33'], [None], [0], [0], ['devPresentLastScan'], ['online'], ['update'], [None], [None], [None], [None]] and trigger {"object_type": "Devices", "event_type": "update"}'
|
||||||
16:27:03 [WF] Event with GUID '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggered the workflow 'Location Change'
|
16:27:03 [WF] Event with GUID '13f0ce26-1835-4c48-ae03-cdaf38f328fe' triggered the workflow 'Location Change'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
0
docs/img/DEBUG_GRAPHQL/Init_check.png → docs/img/DEBUG_API_SERVER/Init_check.png
Executable file → Normal file
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 135 KiB |
0
docs/img/DEBUG_GRAPHQL/app_conf_graphql_port.png → docs/img/DEBUG_API_SERVER/app_conf_graphql_port.png
Executable file → Normal file
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
0
docs/img/DEBUG_GRAPHQL/dev_console_graphql_json.png → docs/img/DEBUG_API_SERVER/dev_console_graphql_json.png
Executable file → Normal file
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
0
docs/img/DEBUG_GRAPHQL/graphql_running_logs.png → docs/img/DEBUG_API_SERVER/graphql_running_logs.png
Executable file → Normal file
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
0
docs/img/DEBUG_GRAPHQL/graphql_settings_port_token.png → docs/img/DEBUG_API_SERVER/graphql_settings_port_token.png
Executable file → Normal file
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
0
docs/img/DEBUG_GRAPHQL/network_graphql.png → docs/img/DEBUG_API_SERVER/network_graphql.png
Executable file → Normal file
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
# NetAlertX
|
# NetAlertX
|
||||||
# Open Source Network Guard / WIFI & LAN intrusion detector
|
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||||
#
|
#
|
||||||
# app.css - Front module. CSS styles
|
# app.css - Front module. CSS styles
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@@ -36,7 +36,7 @@ a[target="_blank"] {
|
|||||||
display: inline-block; /* Needed for positioning */
|
display: inline-block; /* Needed for positioning */
|
||||||
padding-right: 0.6em; /* Space for the icon */
|
padding-right: 0.6em; /* Space for the icon */
|
||||||
}
|
}
|
||||||
|
|
||||||
a[target="_blank"]::after {
|
a[target="_blank"]::after {
|
||||||
content: '↗';
|
content: '↗';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -55,7 +55,7 @@ a[target="_blank"] {
|
|||||||
right: -7px;
|
right: -7px;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
/* .select2-container--default .select2-selection--multiple .select2-selection__choice
|
/* .select2-container--default .select2-selection--multiple .select2-selection__choice
|
||||||
{
|
{
|
||||||
padding-right: 15px !important;
|
padding-right: 15px !important;
|
||||||
@@ -70,6 +70,11 @@ a[target="_blank"] {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-is-valid="0"] {
|
||||||
|
/* border: 1px solid red; */
|
||||||
|
background-color: #ff4b4b !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
Helper Classes
|
Helper Classes
|
||||||
----------------------------------------------------------------------------- */
|
----------------------------------------------------------------------------- */
|
||||||
@@ -100,7 +105,7 @@ a[target="_blank"] {
|
|||||||
background-color: black;
|
background-color: black;
|
||||||
font-family: 'Courier New', monospace;
|
font-family: 'Courier New', monospace;
|
||||||
font-size: .85em;
|
font-size: .85em;
|
||||||
|
|
||||||
}
|
}
|
||||||
.logs-row textarea
|
.logs-row textarea
|
||||||
{
|
{
|
||||||
@@ -110,12 +115,12 @@ a[target="_blank"] {
|
|||||||
display:contents;
|
display:contents;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0.4em
|
padding: 0.4em
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#tab_Logging .actions .toggle{
|
#tab_Logging .actions .toggle{
|
||||||
|
|
||||||
margin: 0.5em;
|
margin: 0.5em;
|
||||||
height: 3em;
|
height: 3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,8 +139,8 @@ a[target="_blank"] {
|
|||||||
}
|
}
|
||||||
.log-area
|
.log-area
|
||||||
{
|
{
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
width:100%;
|
width:100%;
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
border-bottom-style: solid;
|
border-bottom-style: solid;
|
||||||
border-color: #606060;
|
border-color: #606060;
|
||||||
@@ -246,7 +251,7 @@ a[target="_blank"] {
|
|||||||
{
|
{
|
||||||
padding:8px;
|
padding:8px;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-status
|
.header-status
|
||||||
{
|
{
|
||||||
@@ -262,7 +267,7 @@ a[target="_blank"] {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 3px;
|
top: 3px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
display: none;
|
display: none;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,9 +303,9 @@ body
|
|||||||
|
|
||||||
.NetAlertX-logo
|
.NetAlertX-logo
|
||||||
{
|
{
|
||||||
border-color:transparent !important;
|
border-color:transparent !important;
|
||||||
height: 50px !important;
|
height: 50px !important;
|
||||||
width: 50px !important;
|
width: 50px !important;
|
||||||
margin-top:15px !important;
|
margin-top:15px !important;
|
||||||
border-radius: 1px !important;
|
border-radius: 1px !important;
|
||||||
}
|
}
|
||||||
@@ -327,7 +332,7 @@ body
|
|||||||
.content-wrapper,
|
.content-wrapper,
|
||||||
.right-side,
|
.right-side,
|
||||||
.main-footer {
|
.main-footer {
|
||||||
margin-left: 150px;
|
margin-left: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -740,7 +745,7 @@ body
|
|||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ticker-message
|
#ticker-message
|
||||||
{
|
{
|
||||||
color:#FFFFFF;
|
color:#FFFFFF;
|
||||||
}
|
}
|
||||||
@@ -774,7 +779,7 @@ body
|
|||||||
.file-checking .icon-wrap{
|
.file-checking .icon-wrap{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -788,7 +793,7 @@ body
|
|||||||
|
|
||||||
.file-checking .file-name-wrap{
|
.file-checking .file-name-wrap{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
@@ -796,7 +801,7 @@ body
|
|||||||
.file-checking{
|
.file-checking{
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -854,16 +859,16 @@ body
|
|||||||
|
|
||||||
.db_tools_table_cell_a {
|
.db_tools_table_cell_a {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
min-width: 180px;
|
min-width: 180px;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.db_tools_table_cell_b {
|
.db_tools_table_cell_b {
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
@@ -876,12 +881,12 @@ height: 50px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.nav-tabs-custom .tab-content {
|
.nav-tabs-custom .tab-content {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
.nav-tabs-custom .tab-content {
|
.nav-tabs-custom .tab-content {
|
||||||
overflow: scroll;
|
overflow: scroll;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -898,7 +903,7 @@ height: 50px;
|
|||||||
font-size: 16px !important;
|
font-size: 16px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deviceSelector
|
.deviceSelector
|
||||||
{
|
{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -935,7 +940,7 @@ height: 50px;
|
|||||||
height: 10px;
|
height: 10px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/* background: #fff; */
|
/* background: #fff; */
|
||||||
opacity: .75;
|
opacity: .75;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------- */
|
/* --------------------------------------------------------- */
|
||||||
@@ -979,32 +984,32 @@ height: 50px;
|
|||||||
}
|
}
|
||||||
/* .setting_input{
|
/* .setting_input{
|
||||||
width:70%;
|
width:70%;
|
||||||
|
|
||||||
}
|
}
|
||||||
.setting_name
|
.setting_name
|
||||||
{
|
{
|
||||||
width:30%;
|
width:30%;
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.setting_description {
|
.setting_description {
|
||||||
/* color: green; */
|
/* color: green; */
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
/* .setting_input{
|
/* .setting_input{
|
||||||
width:40%;
|
width:40%;
|
||||||
|
|
||||||
}
|
}
|
||||||
.setting_name
|
.setting_name
|
||||||
{
|
{
|
||||||
width:19%;
|
width:19%;
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hide unusable buttons on the settings page for the NEWDEV plugin*/
|
/* Hide unusable buttons on the settings page for the NEWDEV plugin*/
|
||||||
#settingsPage #add_option_NEWDEV_devGroup,
|
#settingsPage #add_option_NEWDEV_devGroup,
|
||||||
#settingsPage #add_option_NEWDEV_devLocation,
|
#settingsPage #add_option_NEWDEV_devLocation,
|
||||||
#settingsPage #add_option_NEWDEV_devOwner,
|
#settingsPage #add_option_NEWDEV_devOwner,
|
||||||
#settingsPage #copy_icons_NEWDEV_devIcon,
|
#settingsPage #copy_icons_NEWDEV_devIcon,
|
||||||
#settingsPage #add_icon_NEWDEV_devIcon,
|
#settingsPage #add_icon_NEWDEV_devIcon,
|
||||||
@@ -1024,11 +1029,11 @@ height: 50px;
|
|||||||
|
|
||||||
#settingsPage .small-box .inner .card-title {
|
#settingsPage .small-box .inner .card-title {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.settingswrap
|
.settingswrap
|
||||||
{
|
{
|
||||||
@@ -1048,13 +1053,13 @@ height: 50px;
|
|||||||
.padding-bottom
|
.padding-bottom
|
||||||
{
|
{
|
||||||
padding-bottom: 100px;
|
padding-bottom: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-group
|
.settings-group
|
||||||
{
|
{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
padding-bottom: 9px;
|
padding-bottom: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overview-section .small-box .icon
|
.overview-section .small-box .icon
|
||||||
@@ -1069,7 +1074,7 @@ height: 50px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.overview-group
|
.overview-group
|
||||||
{
|
{
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
padding-top: 7px;
|
padding-top: 7px;
|
||||||
padding-bottom: 9px;
|
padding-bottom: 9px;
|
||||||
@@ -1082,8 +1087,8 @@ height: 50px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#settingsPage .table_row {
|
#settingsPage .table_row {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
/* width:100%; */
|
/* width:100%; */
|
||||||
/* display: flex; */
|
/* display: flex; */
|
||||||
border-bottom-width: 1px;
|
border-bottom-width: 1px;
|
||||||
@@ -1102,7 +1107,7 @@ height: 50px;
|
|||||||
.setting_name
|
.setting_name
|
||||||
{
|
{
|
||||||
/* width:19%; */
|
/* width:19%; */
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1111,24 +1116,24 @@ height: 50px;
|
|||||||
display:none !important;
|
display:none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center
|
.center
|
||||||
{
|
{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
-ms-transform: translate(-50%, -50%);
|
-ms-transform: translate(-50%, -50%);
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-margin
|
.top-margin
|
||||||
{
|
{
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Settings */
|
/* Settings */
|
||||||
|
|
||||||
#settingsPage .overview-setting-value{
|
#settingsPage .overview-setting-value{
|
||||||
display:unset;
|
display:unset;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1165,7 +1170,7 @@ height: 50px;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text-overflow-hidden
|
.text-overflow-hidden
|
||||||
{
|
{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: clip;
|
text-overflow: clip;
|
||||||
}
|
}
|
||||||
@@ -1175,9 +1180,9 @@ height: 50px;
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
/* background-color: #272c30; */
|
/* background-color: #272c30; */
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
#settingsPage .panel-heading:hover{
|
#settingsPage .panel-heading:hover{
|
||||||
background-color: #272c30;
|
background-color: #272c30;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1185,12 +1190,12 @@ height: 50px;
|
|||||||
font-size: medium;
|
font-size: medium;
|
||||||
/* background-color: #272c30; */
|
/* background-color: #272c30; */
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings_content input[type=checkbox]
|
.settings_content input[type=checkbox]
|
||||||
{
|
{
|
||||||
width: auto
|
width: auto
|
||||||
}
|
}
|
||||||
|
|
||||||
.override{
|
.override{
|
||||||
@@ -1212,7 +1217,7 @@ height: 50px;
|
|||||||
input[readonly] {
|
input[readonly] {
|
||||||
/* Apply styles to the readonly input */
|
/* Apply styles to the readonly input */
|
||||||
background-color: #646566 !important;
|
background-color: #646566 !important;
|
||||||
color: #e6e6e6;
|
color: #e6e6e6;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1300,7 +1305,7 @@ input[readonly] {
|
|||||||
/* margin-bottom:20px; */
|
/* margin-bottom:20px; */
|
||||||
}
|
}
|
||||||
|
|
||||||
#settingsPage .select2-selection
|
#settingsPage .select2-selection
|
||||||
{
|
{
|
||||||
width: initial;
|
width: initial;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -1314,8 +1319,8 @@ input[readonly] {
|
|||||||
#settingsPage .select2-selection
|
#settingsPage .select2-selection
|
||||||
{
|
{
|
||||||
background-color: rgb(96, 96, 96);
|
background-color: rgb(96, 96, 96);
|
||||||
}
|
}
|
||||||
#settingsPage .select2-container
|
#settingsPage .select2-container
|
||||||
{
|
{
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
@@ -1398,7 +1403,7 @@ input[readonly] {
|
|||||||
backdrop-filter: brightness(50%);
|
backdrop-filter: brightness(50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconPreviewSelector
|
.iconPreviewSelector
|
||||||
{
|
{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
@@ -1440,7 +1445,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.dummyDevice
|
.dummyDevice
|
||||||
{
|
{
|
||||||
text-align: end;
|
text-align: end;
|
||||||
}
|
}
|
||||||
@@ -1461,7 +1466,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.info-icon-nav
|
.info-icon-nav
|
||||||
{
|
{
|
||||||
top: -6px;
|
top: -6px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -1538,7 +1543,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#panDetails .input-group {
|
#panDetails .input-group {
|
||||||
|
|
||||||
min-height: 40px;
|
min-height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1583,7 +1588,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.devicePropAction
|
.devicePropAction
|
||||||
{
|
{
|
||||||
width: 1.2em;
|
width: 1.2em;
|
||||||
height: 1.2em;
|
height: 1.2em;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -1593,11 +1598,11 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.devicePropAction:hover
|
.devicePropAction:hover
|
||||||
{
|
{
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
padding: 0em;
|
padding: 0em;
|
||||||
margin: 0em;
|
margin: 0em;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1607,7 +1612,7 @@ input[readonly] {
|
|||||||
display: block;
|
display: block;
|
||||||
float:inline-end;
|
float:inline-end;
|
||||||
height: 2em;
|
height: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#panDetails .dataTables_wrapper .bottom .dataTables_info
|
#panDetails .dataTables_wrapper .bottom .dataTables_info
|
||||||
{
|
{
|
||||||
@@ -1636,22 +1641,22 @@ input[readonly] {
|
|||||||
height: 14px;
|
height: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#deviceDetailsEdit .select2-container--default .select2-selection--multiple .select2-selection__choice
|
#deviceDetailsEdit .select2-container--default .select2-selection--multiple .select2-selection__choice
|
||||||
{
|
{
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#deviceDetailsEdit .select2-container--disabled
|
#deviceDetailsEdit .select2-container--disabled
|
||||||
{
|
{
|
||||||
background-color: #606060;
|
background-color: #606060;
|
||||||
}
|
}
|
||||||
|
|
||||||
#deviceDetailsEdit .select2-container--default .select2-selection--multiple .select2-selection__choice span
|
#deviceDetailsEdit .select2-container--default .select2-selection--multiple .select2-selection__choice span
|
||||||
{
|
{
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#deviceDetailsEdit .select2-selection
|
#deviceDetailsEdit .select2-selection
|
||||||
{
|
{
|
||||||
width: initial;
|
width: initial;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -1681,7 +1686,7 @@ input[readonly] {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.custom-badge
|
.custom-badge
|
||||||
{
|
{
|
||||||
border: 1px solid #aaa;
|
border: 1px solid #aaa;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
@@ -1716,7 +1721,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#deviceDetailsEdit .select2-container
|
#deviceDetailsEdit .select2-container
|
||||||
{
|
{
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
@@ -1799,7 +1804,7 @@ input[readonly] {
|
|||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
#networkTree .netNodeText
|
#networkTree .netNodeText
|
||||||
{
|
{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
#networkTree .netPort
|
#networkTree .netPort
|
||||||
@@ -1812,7 +1817,7 @@ input[readonly] {
|
|||||||
#networkTree .portBckgIcon
|
#networkTree .portBckgIcon
|
||||||
{
|
{
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
display: initial;
|
display: initial;
|
||||||
float: left;
|
float: left;
|
||||||
width: 1em;
|
width: 1em;
|
||||||
}
|
}
|
||||||
@@ -1822,7 +1827,7 @@ input[readonly] {
|
|||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
/* border: solid;
|
/* border: solid;
|
||||||
border-color:#606060; */
|
border-color:#606060; */
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
#networkTree .netIcon
|
#networkTree .netIcon
|
||||||
{
|
{
|
||||||
@@ -1850,8 +1855,8 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#hover-box .devName
|
#hover-box .devName
|
||||||
{
|
{
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
display: contents;
|
display: contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1910,7 +1915,7 @@ input[readonly] {
|
|||||||
#networkTree .highlightedNode
|
#networkTree .highlightedNode
|
||||||
{
|
{
|
||||||
/* border: solid; */
|
/* border: solid; */
|
||||||
border-color:var(--color-lightblue);
|
border-color:var(--color-lightblue);
|
||||||
box-shadow: var(--color-lightblue) 0px 0px 20px;
|
box-shadow: var(--color-lightblue) 0px 0px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1968,7 +1973,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sort-btn {
|
.sort-btn {
|
||||||
|
|
||||||
right: 5px;
|
right: 5px;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
@@ -2020,7 +2025,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.plugin-filters
|
.plugin-filters
|
||||||
{
|
{
|
||||||
margin: 7px;
|
margin: 7px;
|
||||||
margin-right: 7px;
|
margin-right: 7px;
|
||||||
margin-bottom: 9px;
|
margin-bottom: 9px;
|
||||||
@@ -2054,7 +2059,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.plugin-content #tabs-content-location
|
.plugin-content #tabs-content-location
|
||||||
{
|
{
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
@@ -2066,7 +2071,7 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.plugin-content .tab-content
|
.plugin-content .tab-content
|
||||||
{
|
{
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2103,7 +2108,7 @@ input[readonly] {
|
|||||||
|
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
.header-server-time {
|
.header-server-time {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2234,12 +2239,12 @@ input[readonly] {
|
|||||||
display: grid;
|
display: grid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workflowContainerWrap .panel-collapse
|
#workflowContainerWrap .panel-collapse
|
||||||
{
|
{
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflows
|
.workflows
|
||||||
{
|
{
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
}
|
}
|
||||||
@@ -2285,7 +2290,7 @@ input[readonly] {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflows .button-container
|
.workflows .button-container
|
||||||
{
|
{
|
||||||
/* display: contents; */
|
/* display: contents; */
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -2305,7 +2310,7 @@ input[readonly] {
|
|||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflows .button-container
|
.workflows .button-container
|
||||||
{
|
{
|
||||||
padding-right: 0px !important;
|
padding-right: 0px !important;
|
||||||
padding-left: 0px !important;
|
padding-left: 0px !important;
|
||||||
@@ -2318,19 +2323,19 @@ input[readonly] {
|
|||||||
|
|
||||||
/* .button-container button
|
/* .button-container button
|
||||||
{
|
{
|
||||||
width:100%;
|
width:100%;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
.red-hover-text:hover
|
.red-hover-text:hover
|
||||||
{
|
{
|
||||||
color: var(--color-red) !important;
|
color: var(--color-red) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.green-hover-text:hover
|
.green-hover-text:hover
|
||||||
{
|
{
|
||||||
color: var(--color-green) !important;
|
color: var(--color-green) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflows .bckg-icon-1-line
|
.workflows .bckg-icon-1-line
|
||||||
{
|
{
|
||||||
font-size: 3em;
|
font-size: 3em;
|
||||||
@@ -2362,7 +2367,7 @@ input[readonly] {
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflows .workflow-card
|
.workflows .workflow-card
|
||||||
{
|
{
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
@@ -2372,7 +2377,7 @@ input[readonly] {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.workflow-card, .actions-list
|
.workflow-card, .actions-list
|
||||||
{
|
{
|
||||||
display: contents;
|
display: contents;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
@@ -2384,7 +2389,7 @@ input[readonly] {
|
|||||||
z-index:1;
|
z-index:1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.condition
|
.condition
|
||||||
{
|
{
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
#---------------------------------------------------------------------------------#
|
#---------------------------------------------------------------------------------#
|
||||||
# NetAlertX #
|
# NetAlertX #
|
||||||
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
||||||
# #
|
# #
|
||||||
# devices.php - Front module. Devices list page #
|
# devices.php - Front module. Devices list page #
|
||||||
#---------------------------------------------------------------------------------#
|
#---------------------------------------------------------------------------------#
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require 'php/templates/header.php';
|
require 'php/templates/header.php';
|
||||||
|
|
||||||
// check permissions
|
// check permissions
|
||||||
// Use environment-aware paths with fallback to legacy locations
|
// Use environment-aware paths with fallback to legacy locations
|
||||||
$dbFolderPath = rtrim(getenv('NETALERTX_DB') ?: '/data/db', '/');
|
$dbFolderPath = rtrim(getenv('NETALERTX_DB') ?: '/data/db', '/');
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
<!-- Page ------------------------------------------------------------------ -->
|
<!-- Page ------------------------------------------------------------------ -->
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
@@ -55,15 +55,15 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="box" id="clients">
|
<div class="box" id="clients">
|
||||||
<div class="box-header ">
|
<div class="box-header ">
|
||||||
<h3 class="box-title col-md-12"><?= lang('Device_Shortcut_OnlineChart');?> </h3>
|
<h3 class="box-title col-md-12"><?= lang('Device_Shortcut_OnlineChart');?> </h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="chart">
|
<div class="chart">
|
||||||
<script src="lib/chart.js/Chart.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
<script src="lib/chart.js/Chart.js?v=<?php include 'php/templates/version.php'; ?>"></script>
|
||||||
<!-- presence chart -->
|
<!-- presence chart -->
|
||||||
<?php
|
<?php
|
||||||
require 'php/components/graph_online_history.php';
|
require 'php/components/graph_online_history.php';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<!-- Device Filters ------------------------------------------------------- -->
|
<!-- Device Filters ------------------------------------------------------- -->
|
||||||
<div class="box box-aqua hidden" id="columnFiltersWrap">
|
<div class="box box-aqua hidden" id="columnFiltersWrap">
|
||||||
<div class="box-header ">
|
<div class="box-header ">
|
||||||
<h3 class="box-title col-md-12"><?= lang('Devices_Filters');?> </h3>
|
<h3 class="box-title col-md-12"><?= lang('Devices_Filters');?> </h3>
|
||||||
</div>
|
</div>
|
||||||
<!-- Placeholder ------------------------------------------------------- -->
|
<!-- Placeholder ------------------------------------------------------- -->
|
||||||
<div id="columnFilters" ></div>
|
<div id="columnFilters" ></div>
|
||||||
@@ -88,8 +88,8 @@
|
|||||||
<!-- box-header -->
|
<!-- box-header -->
|
||||||
<div class="box-header">
|
<div class="box-header">
|
||||||
<div class=" col-sm-8 ">
|
<div class=" col-sm-8 ">
|
||||||
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
|
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="dummyDevice col-sm-4 ">
|
<div class="dummyDevice col-sm-4 ">
|
||||||
<span id="multiEditPlc">
|
<span id="multiEditPlc">
|
||||||
<!-- multi edit button placeholder -->
|
<!-- multi edit button placeholder -->
|
||||||
@@ -104,8 +104,8 @@
|
|||||||
<div class="box-body table-responsive">
|
<div class="box-body table-responsive">
|
||||||
<table id="tableDevices" class="table table-bordered table-hover table-striped">
|
<table id="tableDevices" class="table table-bordered table-hover table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
@@ -122,7 +122,7 @@
|
|||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!-- /.content-wrapper -->
|
<!-- /.content-wrapper -->
|
||||||
|
|
||||||
@@ -136,9 +136,9 @@
|
|||||||
<!-- page script ----------------------------------------------------------- -->
|
<!-- page script ----------------------------------------------------------- -->
|
||||||
<script>
|
<script>
|
||||||
var deviceStatus = 'all';
|
var deviceStatus = 'all';
|
||||||
var tableRows = getCache ("nax_parTableRows") == "" ? parseInt(getSetting("UI_DEFAULT_PAGE_SIZE")) : getCache ("nax_parTableRows") ;
|
|
||||||
var tableOrder = getCache ("nax_parTableOrder") == "" ? [[3,'desc'], [0,'asc']] : JSON.parse(getCache ("nax_parTableOrder")) ;
|
var tableOrder = getCache ("nax_parTableOrder") == "" ? [[3,'desc'], [0,'asc']] : JSON.parse(getCache ("nax_parTableOrder")) ;
|
||||||
|
|
||||||
var tableColumnHide = [];
|
var tableColumnHide = [];
|
||||||
var tableColumnOrder = [];
|
var tableColumnOrder = [];
|
||||||
var tableColumnVisible = [];
|
var tableColumnVisible = [];
|
||||||
@@ -161,7 +161,7 @@ function main () {
|
|||||||
|
|
||||||
//initialize the table headers in the correct order
|
//initialize the table headers in the correct order
|
||||||
var availableColumns = getSettingOptions("UI_device_columns").split(",");
|
var availableColumns = getSettingOptions("UI_device_columns").split(",");
|
||||||
headersDefaultOrder = availableColumns.map(val => getString(val));
|
headersDefaultOrder = availableColumns.map(val => getString(val));
|
||||||
|
|
||||||
var selectedColumns = JSON.parse(getSetting("UI_device_columns").replace(/'/g, '"'));
|
var selectedColumns = JSON.parse(getSetting("UI_device_columns").replace(/'/g, '"'));
|
||||||
|
|
||||||
@@ -190,10 +190,10 @@ function main () {
|
|||||||
|
|
||||||
// Initialize components with parameters
|
// Initialize components with parameters
|
||||||
initializeDatatable(getUrlAnchor('my_devices'));
|
initializeDatatable(getUrlAnchor('my_devices'));
|
||||||
|
|
||||||
// check if data outdated and show spinner if so
|
// check if data outdated and show spinner if so
|
||||||
handleLoadingDialog()
|
handleLoadingDialog()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -202,7 +202,7 @@ function mapIndx(oldIndex)
|
|||||||
{
|
{
|
||||||
// console.log(oldIndex);
|
// console.log(oldIndex);
|
||||||
// console.log(tableColumnOrder);
|
// console.log(tableColumnOrder);
|
||||||
|
|
||||||
for(i=0;i<tableColumnOrder.length;i++)
|
for(i=0;i<tableColumnOrder.length;i++)
|
||||||
{
|
{
|
||||||
if(tableColumnOrder[i] == oldIndex)
|
if(tableColumnOrder[i] == oldIndex)
|
||||||
@@ -311,7 +311,7 @@ function processDeviceTotals(devicesData) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Render info boxes/tile cards
|
// Render info boxes/tile cards
|
||||||
renderInfoboxes(dataArray);
|
renderInfoboxes(dataArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,9 +350,9 @@ function initFilters() {
|
|||||||
nocache: Date.now() // Prevent caching with a timestamp
|
nocache: Date.now() // Prevent caching with a timestamp
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
if (response && response.data) {
|
if (response && response.data) {
|
||||||
|
|
||||||
let resultJSON = response.data;
|
let resultJSON = response.data;
|
||||||
|
|
||||||
// Save the result to cache
|
// Save the result to cache
|
||||||
setCache("devicesFilters", JSON.stringify(resultJSON));
|
setCache("devicesFilters", JSON.stringify(resultJSON));
|
||||||
@@ -381,7 +381,7 @@ function initFilters() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Filter resultJSON to include only entries with columnName in columnFilters
|
// Filter resultJSON to include only entries with columnName in columnFilters
|
||||||
resultJSON = resultJSON.filter(entry =>
|
resultJSON = resultJSON.filter(entry =>
|
||||||
columnFilters.some(filter => filter[0] === entry.columnName)
|
columnFilters.some(filter => filter[0] === entry.columnName)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -451,7 +451,7 @@ function initFilters() {
|
|||||||
function renderFilters(customData) {
|
function renderFilters(customData) {
|
||||||
|
|
||||||
// console.log(JSON.stringify(customData));
|
// console.log(JSON.stringify(customData));
|
||||||
|
|
||||||
// Load filter data from the JSON file
|
// Load filter data from the JSON file
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: 'php/components/devices_filters.php', // PHP script URL
|
url: 'php/components/devices_filters.php', // PHP script URL
|
||||||
@@ -471,7 +471,7 @@ function renderFilters(customData) {
|
|||||||
|
|
||||||
// Update DataTable with the new filters or search value (if applicable)
|
// Update DataTable with the new filters or search value (if applicable)
|
||||||
$('#tableDevices').DataTable().draw();
|
$('#tableDevices').DataTable().draw();
|
||||||
|
|
||||||
// Optionally, apply column filters (if using filters for individual columns)
|
// Optionally, apply column filters (if using filters for individual columns)
|
||||||
const table = $('#tableDevices').DataTable();
|
const table = $('#tableDevices').DataTable();
|
||||||
table.columnFilters = columnFilters; // Apply your column filters logic
|
table.columnFilters = columnFilters; // Apply your column filters logic
|
||||||
@@ -493,11 +493,11 @@ function collectFilters() {
|
|||||||
// Loop through each filter group
|
// Loop through each filter group
|
||||||
document.querySelectorAll('.filter-group').forEach(filterGroup => {
|
document.querySelectorAll('.filter-group').forEach(filterGroup => {
|
||||||
const dropdown = filterGroup.querySelector('.filter-dropdown');
|
const dropdown = filterGroup.querySelector('.filter-dropdown');
|
||||||
|
|
||||||
if (dropdown) {
|
if (dropdown) {
|
||||||
const filterColumn = dropdown.getAttribute('data-column');
|
const filterColumn = dropdown.getAttribute('data-column');
|
||||||
const filterValue = dropdown.value;
|
const filterValue = dropdown.value;
|
||||||
|
|
||||||
if (filterValue && filterColumn) {
|
if (filterValue && filterColumn) {
|
||||||
columnFilters.push({
|
columnFilters.push({
|
||||||
filterColumn: filterColumn,
|
filterColumn: filterColumn,
|
||||||
@@ -548,7 +548,7 @@ function mapColumnIndexToFieldName(index, tableColumnVisible) {
|
|||||||
"devReqNicsOnline" // 29
|
"devReqNicsOnline" // 29
|
||||||
];
|
];
|
||||||
|
|
||||||
// console.log("OrderBy: " + columnNames[tableColumnOrder[index]]);
|
// console.log("OrderBy: " + columnNames[tableColumnOrder[index]]);
|
||||||
|
|
||||||
return columnNames[tableColumnOrder[index]] || null;
|
return columnNames[tableColumnOrder[index]] || null;
|
||||||
}
|
}
|
||||||
@@ -557,12 +557,15 @@ function mapColumnIndexToFieldName(index, tableColumnVisible) {
|
|||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// Initializes the main devices list datatable
|
// Initializes the main devices list datatable
|
||||||
function initializeDatatable (status) {
|
function initializeDatatable (status) {
|
||||||
|
|
||||||
if(!status)
|
if(!status)
|
||||||
{
|
{
|
||||||
status = 'my_devices'
|
status = 'my_devices'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// retrieve page size
|
||||||
|
var tableRows = getCache ("nax_parTableRows") == "" ? parseInt(getSetting("UI_DEFAULT_PAGE_SIZE")) : getCache ("nax_parTableRows") ;
|
||||||
|
|
||||||
// Save status selected
|
// Save status selected
|
||||||
deviceStatus = status;
|
deviceStatus = status;
|
||||||
|
|
||||||
@@ -579,7 +582,7 @@ function initializeDatatable (status) {
|
|||||||
case 'all_devices': tableTitle = getString('Gen_All_Devices'); color = 'gray'; break;
|
case 'all_devices': tableTitle = getString('Gen_All_Devices'); color = 'gray'; break;
|
||||||
case 'network_devices': tableTitle = getString('Network_Devices'); color = 'aqua'; break;
|
case 'network_devices': tableTitle = getString('Network_Devices'); color = 'aqua'; break;
|
||||||
default: tableTitle = getString('Device_Shortcut_Devices'); color = 'gray'; break;
|
default: tableTitle = getString('Device_Shortcut_Devices'); color = 'gray'; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set title and color
|
// Set title and color
|
||||||
$('#tableDevicesTitle')[0].className = 'box-title text-'+ color;
|
$('#tableDevicesTitle')[0].className = 'box-title text-'+ color;
|
||||||
@@ -588,23 +591,23 @@ function initializeDatatable (status) {
|
|||||||
|
|
||||||
// render table headers
|
// render table headers
|
||||||
html = '';
|
html = '';
|
||||||
|
|
||||||
for(index = 0; index < tableColumnOrder.length; index++)
|
for(index = 0; index < tableColumnOrder.length; index++)
|
||||||
{
|
{
|
||||||
html += '<th>' + headersDefaultOrder[tableColumnOrder[index]] + '</th>';
|
html += '<th>' + headersDefaultOrder[tableColumnOrder[index]] + '</th>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#tableDevices tr').html(html);
|
$('#tableDevices tr').html(html);
|
||||||
|
|
||||||
hideUIelements("UI_DEV_SECTIONS")
|
hideUIelements("UI_DEV_SECTIONS")
|
||||||
|
|
||||||
for(i = 0; i < tableColumnOrder.length; i++)
|
for(i = 0; i < tableColumnOrder.length; i++)
|
||||||
{
|
{
|
||||||
// hide this column if not in the tableColumnVisible variable (we need to keep the MAC address (index 11) for functionality reasons)
|
// hide this column if not in the tableColumnVisible variable (we need to keep the MAC address (index 11) for functionality reasons)
|
||||||
if(tableColumnVisible.includes(tableColumnOrder[i]) == false)
|
if(tableColumnVisible.includes(tableColumnOrder[i]) == false)
|
||||||
{
|
{
|
||||||
tableColumnHide.push(mapIndx(tableColumnOrder[i]));
|
tableColumnHide.push(mapIndx(tableColumnOrder[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var table = $('#tableDevices').DataTable({
|
var table = $('#tableDevices').DataTable({
|
||||||
@@ -690,7 +693,7 @@ function initializeDatatable (status) {
|
|||||||
"status": deviceStatus,
|
"status": deviceStatus,
|
||||||
"filters" : columnFilters
|
"filters" : columnFilters
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -766,8 +769,8 @@ function initializeDatatable (status) {
|
|||||||
|
|
||||||
// Parameters
|
// Parameters
|
||||||
'pageLength' : tableRows,
|
'pageLength' : tableRows,
|
||||||
'order' : tableOrder,
|
'order' : tableOrder,
|
||||||
'select' : true, // Enable selection
|
'select' : true, // Enable selection
|
||||||
|
|
||||||
'fixedHeader': true,
|
'fixedHeader': true,
|
||||||
'fixedHeader': {
|
'fixedHeader': {
|
||||||
@@ -776,19 +779,19 @@ function initializeDatatable (status) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'columnDefs' : [
|
'columnDefs' : [
|
||||||
{visible: false, targets: tableColumnHide },
|
{visible: false, targets: tableColumnHide },
|
||||||
{className: 'text-center', targets: [mapIndx(4), mapIndx(9), mapIndx(10), mapIndx(15), mapIndx(18)] },
|
{className: 'text-center', targets: [mapIndx(4), mapIndx(9), mapIndx(10), mapIndx(15), mapIndx(18)] },
|
||||||
{className: 'iconColumn text-center', targets: [mapIndx(3)]},
|
{className: 'iconColumn text-center', targets: [mapIndx(3)]},
|
||||||
{width: '80px', targets: [mapIndx(6), mapIndx(7), mapIndx(15), mapIndx(27)] },
|
{width: '80px', targets: [mapIndx(6), mapIndx(7), mapIndx(15), mapIndx(27)] },
|
||||||
{width: '85px', targets: [mapIndx(9)] },
|
{width: '85px', targets: [mapIndx(9)] },
|
||||||
{width: '30px', targets: [mapIndx(3), mapIndx(10), mapIndx(13), mapIndx(18)] },
|
{width: '30px', targets: [mapIndx(3), mapIndx(10), mapIndx(13), mapIndx(18)] },
|
||||||
{orderData: [mapIndx(12)], targets: mapIndx(8) },
|
{orderData: [mapIndx(12)], targets: mapIndx(8) },
|
||||||
|
|
||||||
// Device Name and FQDN
|
// Device Name and FQDN
|
||||||
{targets: [mapIndx(0), mapIndx(27)],
|
{targets: [mapIndx(0), mapIndx(27)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
|
|
||||||
// console.log(cellData)
|
// console.log(cellData)
|
||||||
$(td).html (
|
$(td).html (
|
||||||
`<b class="anonymizeDev "
|
`<b class="anonymizeDev "
|
||||||
>
|
>
|
||||||
@@ -811,9 +814,9 @@ function initializeDatatable (status) {
|
|||||||
);
|
);
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Connected Devices
|
// Connected Devices
|
||||||
{targets: [mapIndx(15)],
|
{targets: [mapIndx(15)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
// check if this is a network device
|
// check if this is a network device
|
||||||
if(getSetting("NETWORK_DEVICE_TYPES").includes(`'${rowData[mapIndx(2)]}'`) )
|
if(getSetting("NETWORK_DEVICE_TYPES").includes(`'${rowData[mapIndx(2)]}'`) )
|
||||||
{
|
{
|
||||||
@@ -823,13 +826,13 @@ function initializeDatatable (status) {
|
|||||||
{
|
{
|
||||||
$(td).html (`<i class="fa-solid fa-xmark" title="${getString("Device_Table_Not_Network_Device")}"></i>`)
|
$(td).html (`<i class="fa-solid fa-xmark" title="${getString("Device_Table_Not_Network_Device")}"></i>`)
|
||||||
}
|
}
|
||||||
|
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Icon
|
// Icon
|
||||||
{targets: [mapIndx(3)],
|
{targets: [mapIndx(3)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
|
|
||||||
if (!emptyArr.includes(cellData)){
|
if (!emptyArr.includes(cellData)){
|
||||||
$(td).html (atob(cellData));
|
$(td).html (atob(cellData));
|
||||||
} else {
|
} else {
|
||||||
@@ -837,7 +840,7 @@ function initializeDatatable (status) {
|
|||||||
}
|
}
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Full MAC
|
// Full MAC
|
||||||
{targets: [mapIndx(11)],
|
{targets: [mapIndx(11)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (!emptyArr.includes(cellData)){
|
if (!emptyArr.includes(cellData)){
|
||||||
@@ -846,8 +849,8 @@ function initializeDatatable (status) {
|
|||||||
$(td).html ('');
|
$(td).html ('');
|
||||||
}
|
}
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// IP address
|
// IP address
|
||||||
{targets: [mapIndx(8)],
|
{targets: [mapIndx(8)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (!emptyArr.includes(cellData)){
|
if (!emptyArr.includes(cellData)){
|
||||||
@@ -864,9 +867,9 @@ function initializeDatatable (status) {
|
|||||||
} else {
|
} else {
|
||||||
$(td).html ('');
|
$(td).html ('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// IP address (ordeable)
|
// IP address (ordeable)
|
||||||
{targets: [mapIndx(12)],
|
{targets: [mapIndx(12)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (!emptyArr.includes(cellData)){
|
if (!emptyArr.includes(cellData)){
|
||||||
@@ -874,10 +877,10 @@ function initializeDatatable (status) {
|
|||||||
} else {
|
} else {
|
||||||
$(td).html ('');
|
$(td).html ('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Custom Properties
|
// Custom Properties
|
||||||
{targets: [mapIndx(26)],
|
{targets: [mapIndx(26)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (!emptyArr.includes(cellData)){
|
if (!emptyArr.includes(cellData)){
|
||||||
@@ -885,10 +888,10 @@ function initializeDatatable (status) {
|
|||||||
} else {
|
} else {
|
||||||
$(td).html ('');
|
$(td).html ('');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Favorite
|
// Favorite
|
||||||
{targets: [mapIndx(4)],
|
{targets: [mapIndx(4)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (cellData == 1){
|
if (cellData == 1){
|
||||||
@@ -897,8 +900,8 @@ function initializeDatatable (status) {
|
|||||||
$(td).html ('');
|
$(td).html ('');
|
||||||
}
|
}
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Dates
|
// Dates
|
||||||
{targets: [mapIndx(6), mapIndx(7)],
|
{targets: [mapIndx(6), mapIndx(7)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
var result = cellData.toString(); // Convert to string
|
var result = cellData.toString(); // Convert to string
|
||||||
@@ -908,7 +911,7 @@ function initializeDatatable (status) {
|
|||||||
$(td).html (translateHTMLcodes (result));
|
$(td).html (translateHTMLcodes (result));
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Random MAC
|
// Random MAC
|
||||||
{targets: [mapIndx(9)],
|
{targets: [mapIndx(9)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
// console.log(cellData)
|
// console.log(cellData)
|
||||||
@@ -919,7 +922,7 @@ function initializeDatatable (status) {
|
|||||||
}
|
}
|
||||||
} },
|
} },
|
||||||
|
|
||||||
// Parent Mac
|
// Parent Mac
|
||||||
{targets: [mapIndx(14)],
|
{targets: [mapIndx(14)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
if (!isValidMac(cellData)) {
|
if (!isValidMac(cellData)) {
|
||||||
@@ -938,13 +941,13 @@ function initializeDatatable (status) {
|
|||||||
|
|
||||||
const chipHtml = renderDeviceLink(data, spanWrap, true); // pass the td as container
|
const chipHtml = renderDeviceLink(data, spanWrap, true); // pass the td as container
|
||||||
|
|
||||||
$(spanWrap).append(chipHtml);
|
$(spanWrap).append(chipHtml);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Status color
|
// Status color
|
||||||
{targets: [mapIndx(10)],
|
{targets: [mapIndx(10)],
|
||||||
'createdCell': function (td, cellData, rowData, row, col) {
|
'createdCell': function (td, cellData, rowData, row, col) {
|
||||||
|
|
||||||
tmp_devPresentLastScan = rowData[mapIndx(24)]
|
tmp_devPresentLastScan = rowData[mapIndx(24)]
|
||||||
tmp_devAlertDown = rowData[mapIndx(25)]
|
tmp_devAlertDown = rowData[mapIndx(25)]
|
||||||
|
|
||||||
@@ -954,11 +957,11 @@ function initializeDatatable (status) {
|
|||||||
rowData[mapIndx(11)], // MAC
|
rowData[mapIndx(11)], // MAC
|
||||||
cellData // optional text
|
cellData // optional text
|
||||||
);
|
);
|
||||||
|
|
||||||
$(td).html (`<a href="${badge.url}" class="badge ${badge.cssClass}">${badge.iconHtml} ${badge.text}</a>`);
|
$(td).html (`<a href="${badge.url}" class="badge ${badge.cssClass}">${badge.iconHtml} ${badge.text}</a>`);
|
||||||
} },
|
} },
|
||||||
],
|
],
|
||||||
|
|
||||||
// Processing
|
// Processing
|
||||||
'processing' : true,
|
'processing' : true,
|
||||||
'language' : {
|
'language' : {
|
||||||
@@ -978,7 +981,7 @@ function initializeDatatable (status) {
|
|||||||
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
$('#tableDevices').on( 'length.dt', function ( e, settings, len ) {
|
||||||
setCache ("nax_parTableRows", len, 129600); // save for 90 days
|
setCache ("nax_parTableRows", len, 129600); // save for 90 days
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$('#tableDevices').on( 'order.dt', function () {
|
$('#tableDevices').on( 'order.dt', function () {
|
||||||
setCache ("nax_parTableOrder", JSON.stringify (table.order()), 129600); // save for 90 days
|
setCache ("nax_parTableOrder", JSON.stringify (table.order()), 129600); // save for 90 days
|
||||||
} );
|
} );
|
||||||
@@ -998,7 +1001,7 @@ function initializeDatatable (status) {
|
|||||||
// Toggle visibility of element with ID 'multiEdit'
|
// Toggle visibility of element with ID 'multiEdit'
|
||||||
$('#multiEdit').toggle(anyRowSelected);
|
$('#multiEdit').toggle(anyRowSelected);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// search only after idle
|
// search only after idle
|
||||||
@@ -1014,59 +1017,59 @@ function initializeDatatable (status) {
|
|||||||
}, debounceTime);
|
}, debounceTime);
|
||||||
});
|
});
|
||||||
|
|
||||||
initHoverNodeInfo();
|
initHoverNodeInfo();
|
||||||
hideSpinner();
|
hideSpinner();
|
||||||
|
|
||||||
},
|
},
|
||||||
createdRow: function(row, data, dataIndex) {
|
createdRow: function(row, data, dataIndex) {
|
||||||
// add devMac to the table row
|
// add devMac to the table row
|
||||||
$(row).attr('my-devMac', data[mapIndx(11)]);
|
$(row).attr('my-devMac', data[mapIndx(11)]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function handleLoadingDialog(needsReload = false)
|
function handleLoadingDialog(needsReload = false)
|
||||||
{
|
{
|
||||||
// console.log(`needsReload: ${needsReload}`);
|
// console.log(`needsReload: ${needsReload}`);
|
||||||
|
|
||||||
$.get('php/server/query_logs.php?file=execution_queue.log&nocache=' + Date.now(), function(data) {
|
$.get('php/server/query_logs.php?file=execution_queue.log&nocache=' + Date.now(), function(data) {
|
||||||
|
|
||||||
if(data.includes("update_api|devices"))
|
if(data.includes("update_api|devices"))
|
||||||
{
|
{
|
||||||
showSpinner("devices_old")
|
showSpinner("devices_old")
|
||||||
|
|
||||||
setTimeout(handleLoadingDialog(true), 1000);
|
setTimeout(handleLoadingDialog(true), 1000);
|
||||||
|
|
||||||
} else if (needsReload)
|
} else if (needsReload)
|
||||||
{
|
{
|
||||||
location.reload();
|
location.reload();
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
// hideSpinner();
|
// hideSpinner();
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Function collects selected devices in the DataTable and redirects the user to
|
// Function collects selected devices in the DataTable and redirects the user to
|
||||||
// the Miantenance section with a 'macs' query string identifying selected devices
|
// the Miantenance section with a 'macs' query string identifying selected devices
|
||||||
function multiEditDevices()
|
function multiEditDevices()
|
||||||
{
|
{
|
||||||
// get selected devices
|
// get selected devices
|
||||||
var selectedDevicesDataTableData = $('#tableDevices').DataTable().rows({ selected: true, page: 'current' }).data().toArray();
|
var selectedDevicesDataTableData = $('#tableDevices').DataTable().rows({ selected: true, page: 'current' }).data().toArray();
|
||||||
|
|
||||||
console.log(selectedDevicesDataTableData);
|
console.log(selectedDevicesDataTableData);
|
||||||
|
|
||||||
macs = ""
|
macs = ""
|
||||||
|
|
||||||
for (var j = 0; j < selectedDevicesDataTableData.length; j++) {
|
for (var j = 0; j < selectedDevicesDataTableData.length; j++) {
|
||||||
macs += selectedDevicesDataTableData[j][mapIndx(11)] + ","; // [11] == MAC
|
macs += selectedDevicesDataTableData[j][mapIndx(11)] + ","; // [11] == MAC
|
||||||
}
|
}
|
||||||
|
|
||||||
// redirect to the Maintenance section
|
// redirect to the Maintenance section
|
||||||
@@ -1075,7 +1078,7 @@ function multiEditDevices()
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Function collects shown devices from the DataTable
|
// Function collects shown devices from the DataTable
|
||||||
function getMacsOfShownDevices() {
|
function getMacsOfShownDevices() {
|
||||||
var table = $('#tableDevices').DataTable();
|
var table = $('#tableDevices').DataTable();
|
||||||
|
|
||||||
@@ -1096,15 +1099,15 @@ function getMacsOfShownDevices() {
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Handle custom actions/properties on a device
|
// Handle custom actions/properties on a device
|
||||||
function renderCustomProps(custProps, mac) {
|
function renderCustomProps(custProps, mac) {
|
||||||
// Decode and parse the custom properties
|
// Decode and parse the custom properties
|
||||||
|
|
||||||
if (!isBase64(custProps)) {
|
if (!isBase64(custProps)) {
|
||||||
|
|
||||||
console.error(`Unable to decode CustomProps for ${mac}`);
|
console.error(`Unable to decode CustomProps for ${mac}`);
|
||||||
console.error(custProps);
|
console.error(custProps);
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
const props = JSON.parse(atob(custProps));
|
const props = JSON.parse(atob(custProps));
|
||||||
let html = "";
|
let html = "";
|
||||||
@@ -1150,13 +1153,13 @@ function renderCustomProps(custProps, mac) {
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Update cache with shown devices before navigating away
|
// Update cache with shown devices before navigating away
|
||||||
window.addEventListener('beforeunload', function(event) {
|
window.addEventListener('beforeunload', function(event) {
|
||||||
// Call your function here
|
// Call your function here
|
||||||
macs = getMacsOfShownDevices();
|
macs = getMacsOfShownDevices();
|
||||||
|
|
||||||
setCache("ntx_visible_macs", macs)
|
setCache("ntx_visible_macs", macs)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* NetAlertX
|
* NetAlertX
|
||||||
* Open Source Network Guard / WIFI & LAN intrusion detector
|
* Open Source Network Guard / WIFI & LAN intrusion detector
|
||||||
*
|
*
|
||||||
* common.js - Front module. Common Javascript functions
|
* common.js - Front module. Common Javascript functions
|
||||||
*-------------------------------------------------------------------------------
|
*-------------------------------------------------------------------------------
|
||||||
@@ -35,16 +35,16 @@ function getCache(key, noCookie = false)
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function setCache(key, data, expirationMinutes='')
|
function setCache(key, data, expirationMinutes='')
|
||||||
{
|
{
|
||||||
localStorage.setItem(key, data);
|
localStorage.setItem(key, data);
|
||||||
|
|
||||||
// // create cookie if expiration set to handle refresh of data
|
// // create cookie if expiration set to handle refresh of data
|
||||||
// if (expirationMinutes != '')
|
// if (expirationMinutes != '')
|
||||||
// {
|
// {
|
||||||
// setCookie ('cache_session_expiry', 'OK', 1)
|
// setCookie ('cache_session_expiry', 'OK', 1)
|
||||||
// }
|
// }
|
||||||
@@ -57,7 +57,7 @@ function setCookie (cookie, value, expirationMinutes='') {
|
|||||||
var expires = '';
|
var expires = '';
|
||||||
if (typeof expirationMinutes === 'number') {
|
if (typeof expirationMinutes === 'number') {
|
||||||
expires = ';expires=' + new Date(Date.now() + expirationMinutes *60*1000).toUTCString();
|
expires = ';expires=' + new Date(Date.now() + expirationMinutes *60*1000).toUTCString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save Cookie
|
// Save Cookie
|
||||||
document.cookie = cookie + "=" + value + expires;
|
document.cookie = cookie + "=" + value + expires;
|
||||||
@@ -107,42 +107,42 @@ function deleteAllCookies() {
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Get settings from the .json file generated by the python backend
|
// Get settings from the .json file generated by the python backend
|
||||||
// and cache them, if available, with options
|
// and cache them, if available, with options
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function cacheSettings()
|
function cacheSettings()
|
||||||
{
|
{
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if(!getCache('cacheSettings_completed') === true)
|
if(!getCache('cacheSettings_completed') === true)
|
||||||
{
|
{
|
||||||
$.get('php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(resSet) {
|
$.get('php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(resSet) {
|
||||||
|
|
||||||
$.get('php/server/query_json.php', { file: 'plugins.json', nocache: Date.now() }, function(resPlug) {
|
$.get('php/server/query_json.php', { file: 'plugins.json', nocache: Date.now() }, function(resPlug) {
|
||||||
|
|
||||||
pluginsData = resPlug["data"];
|
|
||||||
settingsData = resSet["data"];
|
|
||||||
|
|
||||||
settingsData.forEach((set) => {
|
pluginsData = resPlug["data"];
|
||||||
|
settingsData = resSet["data"];
|
||||||
|
|
||||||
|
settingsData.forEach((set) => {
|
||||||
|
|
||||||
resolvedOptions = createArray(set.setOptions)
|
resolvedOptions = createArray(set.setOptions)
|
||||||
resolvedOptionsOld = resolvedOptions
|
resolvedOptionsOld = resolvedOptions
|
||||||
setPlugObj = {};
|
setPlugObj = {};
|
||||||
options_params = [];
|
options_params = [];
|
||||||
resolved = ""
|
resolved = ""
|
||||||
|
|
||||||
// proceed only if first option item contains something to resolve
|
// proceed only if first option item contains something to resolve
|
||||||
if( !set.setKey.includes("__metadata") &&
|
if( !set.setKey.includes("__metadata") &&
|
||||||
resolvedOptions.length != 0 &&
|
resolvedOptions.length != 0 &&
|
||||||
resolvedOptions[0].includes("{value}"))
|
resolvedOptions[0].includes("{value}"))
|
||||||
{
|
{
|
||||||
// get setting definition from the plugin config if available
|
// get setting definition from the plugin config if available
|
||||||
setPlugObj = getPluginSettingObject(pluginsData, set.setKey)
|
setPlugObj = getPluginSettingObject(pluginsData, set.setKey)
|
||||||
|
|
||||||
// check if options contains parameters and resolve
|
// check if options contains parameters and resolve
|
||||||
if(setPlugObj != {} && setPlugObj["options_params"])
|
if(setPlugObj != {} && setPlugObj["options_params"])
|
||||||
{
|
{
|
||||||
// get option_params for {value} resolution
|
// get option_params for {value} resolution
|
||||||
options_params = setPlugObj["options_params"]
|
options_params = setPlugObj["options_params"]
|
||||||
|
|
||||||
if(options_params != [])
|
if(options_params != [])
|
||||||
{
|
{
|
||||||
@@ -154,19 +154,19 @@ function cacheSettings()
|
|||||||
{
|
{
|
||||||
resolvedOptions = `[${resolved}]`
|
resolvedOptions = `[${resolved}]`
|
||||||
} else // one value only
|
} else // one value only
|
||||||
{
|
{
|
||||||
resolvedOptions = `["${resolved}"]`
|
resolvedOptions = `["${resolved}"]`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setCache(`nax_set_${set.setKey}`, set.setValue)
|
setCache(`nax_set_${set.setKey}`, set.setValue)
|
||||||
setCache(`nax_set_opt_${set.setKey}`, resolvedOptions)
|
setCache(`nax_set_opt_${set.setKey}`, resolvedOptions)
|
||||||
});
|
});
|
||||||
}).then(() => handleSuccess('cacheSettings', resolve())).catch(() => handleFailure('cacheSettings', reject("cacheSettings already completed"))); // handle AJAX synchronization
|
}).then(() => handleSuccess('cacheSettings', resolve())).catch(() => handleFailure('cacheSettings', reject("cacheSettings already completed"))); // handle AJAX synchronization
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ function getSettingOptions (key) {
|
|||||||
|
|
||||||
// handle initial load to make sure everything is set-up and cached
|
// handle initial load to make sure everything is set-up and cached
|
||||||
// handleFirstLoad()
|
// handleFirstLoad()
|
||||||
|
|
||||||
result = getCache(`nax_set_opt_${key}`, true);
|
result = getCache(`nax_set_opt_${key}`, true);
|
||||||
|
|
||||||
if (result == "")
|
if (result == "")
|
||||||
@@ -194,7 +194,7 @@ function getSetting (key) {
|
|||||||
|
|
||||||
// handle initial load to make sure everything is set-up and cached
|
// handle initial load to make sure everything is set-up and cached
|
||||||
// handleFirstLoad()
|
// handleFirstLoad()
|
||||||
|
|
||||||
result = getCache(`nax_set_${key}`, true);
|
result = getCache(`nax_set_${key}`, true);
|
||||||
|
|
||||||
if (result == "")
|
if (result == "")
|
||||||
@@ -210,7 +210,7 @@ function getSetting (key) {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function cacheStrings() {
|
function cacheStrings() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
// Create a promise for each language (include en_us by default as fallback)
|
// Create a promise for each language (include en_us by default as fallback)
|
||||||
languagesToLoad = ['en_us']
|
languagesToLoad = ['en_us']
|
||||||
|
|
||||||
@@ -222,11 +222,11 @@ function cacheStrings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log(languagesToLoad);
|
console.log(languagesToLoad);
|
||||||
|
|
||||||
const languagePromises = languagesToLoad.map((language_code) => {
|
const languagePromises = languagesToLoad.map((language_code) => {
|
||||||
return new Promise((resolveLang, rejectLang) => {
|
return new Promise((resolveLang, rejectLang) => {
|
||||||
// Fetch core strings and translations
|
// Fetch core strings and translations
|
||||||
|
|
||||||
$.get(`php/templates/language/${language_code}.json?nocache=${Date.now()}`)
|
$.get(`php/templates/language/${language_code}.json?nocache=${Date.now()}`)
|
||||||
.done((res) => {
|
.done((res) => {
|
||||||
// Iterate over each key-value pair and store the translations
|
// Iterate over each key-value pair and store the translations
|
||||||
@@ -238,7 +238,7 @@ function cacheStrings() {
|
|||||||
$.get('php/server/query_json.php', { file: 'table_plugins_language_strings.json', nocache: Date.now() })
|
$.get('php/server/query_json.php', { file: 'table_plugins_language_strings.json', nocache: Date.now() })
|
||||||
.done((pluginRes) => {
|
.done((pluginRes) => {
|
||||||
const data = pluginRes["data"];
|
const data = pluginRes["data"];
|
||||||
|
|
||||||
// Store plugin translations
|
// Store plugin translations
|
||||||
data.forEach((langString) => {
|
data.forEach((langString) => {
|
||||||
setCache(`pia_lang_${langString.String_Key}_${langString.Language_Code}`, langString.String_Value);
|
setCache(`pia_lang_${langString.String_Key}_${langString.Language_Code}`, langString.String_Value);
|
||||||
@@ -269,7 +269,7 @@ function cacheStrings() {
|
|||||||
// Handle failure in any of the language processing
|
// Handle failure in any of the language processing
|
||||||
handleFailure('cacheStrings', reject);
|
handleFailure('cacheStrings', reject);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ function cacheStrings() {
|
|||||||
function getString(key) {
|
function getString(key) {
|
||||||
|
|
||||||
function fetchString(key) {
|
function fetchString(key) {
|
||||||
|
|
||||||
lang_code = getLangCode();
|
lang_code = getLangCode();
|
||||||
|
|
||||||
let result = getCache(`pia_lang_${key}_${lang_code}`, true);
|
let result = getCache(`pia_lang_${key}_${lang_code}`, true);
|
||||||
@@ -509,7 +509,7 @@ function isBase64(value) {
|
|||||||
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/;
|
const base64Regex = /^[A-Za-z0-9+/]+={0,2}$/;
|
||||||
if (!base64Regex.test(value)) return false;
|
if (!base64Regex.test(value)) return false;
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const decoded = atob(value);
|
const decoded = atob(value);
|
||||||
|
|
||||||
@@ -568,7 +568,7 @@ function decodeSpecialChars(str) {
|
|||||||
function utf8ToBase64(str) {
|
function utf8ToBase64(str) {
|
||||||
// Convert the string to a Uint8Array using TextEncoder
|
// Convert the string to a Uint8Array using TextEncoder
|
||||||
const utf8Bytes = new TextEncoder().encode(str);
|
const utf8Bytes = new TextEncoder().encode(str);
|
||||||
|
|
||||||
// Convert the Uint8Array to a base64-encoded string
|
// Convert the Uint8Array to a base64-encoded string
|
||||||
return btoa(String.fromCharCode(...utf8Bytes));
|
return btoa(String.fromCharCode(...utf8Bytes));
|
||||||
}
|
}
|
||||||
@@ -597,31 +597,31 @@ function handle_locked_DB(data)
|
|||||||
{
|
{
|
||||||
if(data.includes('database is locked'))
|
if(data.includes('database is locked'))
|
||||||
{
|
{
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
showSpinner()
|
showSpinner()
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
console.warn("Database locked - reload")
|
console.warn("Database locked - reload")
|
||||||
location.reload();
|
location.reload();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function numberArrayFromString(data)
|
function numberArrayFromString(data)
|
||||||
{
|
{
|
||||||
data = JSON.parse(sanitize(data));
|
data = JSON.parse(sanitize(data));
|
||||||
return data.replace(/\[|\]/g, '').split(',').map(Number);
|
return data.replace(/\[|\]/g, '').split(',').map(Number);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function saveData(functionName, id, value) {
|
function saveData(functionName, id, value) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "php/server/devices.php",
|
url: "php/server/devices.php",
|
||||||
data: { action: functionName, id: id, value:value },
|
data: { action: functionName, id: id, value:value },
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
if(sanitize(data) == 'OK')
|
if(sanitize(data) == 'OK')
|
||||||
{
|
{
|
||||||
showMessage("Saved")
|
showMessage("Saved")
|
||||||
@@ -630,7 +630,7 @@ function saveData(functionName, id, value) {
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
showMessage("ERROR")
|
showMessage("ERROR")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -670,13 +670,13 @@ function sleep(milliseconds) {
|
|||||||
} while (currentDate - date < milliseconds);
|
} while (currentDate - date < milliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
somethingChanged = false;
|
somethingChanged = false;
|
||||||
function settingsChanged()
|
function settingsChanged()
|
||||||
{
|
{
|
||||||
somethingChanged = true;
|
somethingChanged = true;
|
||||||
// Enable navigation prompt ... "Are you sure you want to leave..."
|
// Enable navigation prompt ... "Are you sure you want to leave..."
|
||||||
window.onbeforeunload = function() {
|
window.onbeforeunload = function() {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -694,16 +694,16 @@ function getUrlAnchor(defaultValue){
|
|||||||
selectedTab = defaultValue
|
selectedTab = defaultValue
|
||||||
|
|
||||||
// the #target from the url
|
// the #target from the url
|
||||||
target = window.location.hash.substr(1)
|
target = window.location.hash.substr(1)
|
||||||
|
|
||||||
// get only the part between #...?
|
// get only the part between #...?
|
||||||
if(target.includes('?'))
|
if(target.includes('?'))
|
||||||
{
|
{
|
||||||
target = target.split('?')[0]
|
target = target.split('?')[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
return target
|
return target
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -715,7 +715,7 @@ function getQueryString(key){
|
|||||||
get: (searchParams, prop) => searchParams.get(prop),
|
get: (searchParams, prop) => searchParams.get(prop),
|
||||||
});
|
});
|
||||||
|
|
||||||
tmp = params[key]
|
tmp = params[key]
|
||||||
|
|
||||||
if(emptyArr.includes(tmp))
|
if(emptyArr.includes(tmp))
|
||||||
{
|
{
|
||||||
@@ -726,17 +726,17 @@ function getQueryString(key){
|
|||||||
|
|
||||||
if (fullUrl.includes('?')) {
|
if (fullUrl.includes('?')) {
|
||||||
var queryString = fullUrl.split('?')[1];
|
var queryString = fullUrl.split('?')[1];
|
||||||
|
|
||||||
// Split the query string into individual parameters
|
// Split the query string into individual parameters
|
||||||
var paramsArray = queryString.split('&');
|
var paramsArray = queryString.split('&');
|
||||||
|
|
||||||
// Loop through the parameters array
|
// Loop through the parameters array
|
||||||
paramsArray.forEach(function(param) {
|
paramsArray.forEach(function(param) {
|
||||||
// Split each parameter into key and value
|
// Split each parameter into key and value
|
||||||
var keyValue = param.split('=');
|
var keyValue = param.split('=');
|
||||||
var keyTmp = decodeURIComponent(keyValue[0]);
|
var keyTmp = decodeURIComponent(keyValue[0]);
|
||||||
var value = decodeURIComponent(keyValue[1] || '');
|
var value = decodeURIComponent(keyValue[1] || '');
|
||||||
|
|
||||||
// Store key-value pair in the queryParams object
|
// Store key-value pair in the queryParams object
|
||||||
queryParams[keyTmp] = value;
|
queryParams[keyTmp] = value;
|
||||||
});
|
});
|
||||||
@@ -750,7 +750,7 @@ function getQueryString(key){
|
|||||||
result = emptyArr.includes(tmp) ? "" : tmp;
|
result = emptyArr.includes(tmp) ? "" : tmp;
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function translateHTMLcodes (text) {
|
function translateHTMLcodes (text) {
|
||||||
if (text == null || emptyArr.includes(text)) {
|
if (text == null || emptyArr.includes(text)) {
|
||||||
@@ -769,14 +769,14 @@ function translateHTMLcodes (text) {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function stopTimerRefreshData () {
|
function stopTimerRefreshData () {
|
||||||
try {
|
try {
|
||||||
clearTimeout (timerRefreshData);
|
clearTimeout (timerRefreshData);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function newTimerRefreshData (refeshFunction, timeToRefresh) {
|
function newTimerRefreshData (refeshFunction, timeToRefresh) {
|
||||||
|
|
||||||
if(timeToRefresh && (timeToRefresh != 0 || timeToRefresh != ""))
|
if(timeToRefresh && (timeToRefresh != 0 || timeToRefresh != ""))
|
||||||
{
|
{
|
||||||
time = parseInt(timeToRefresh)
|
time = parseInt(timeToRefresh)
|
||||||
@@ -813,7 +813,7 @@ function openInNewTab (url) {
|
|||||||
window.open(url, "_blank");
|
window.open(url, "_blank");
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Navigate to URL if the current URL is not in the provided list of URLs
|
// Navigate to URL if the current URL is not in the provided list of URLs
|
||||||
function openUrl(urls) {
|
function openUrl(urls) {
|
||||||
var currentUrl = window.location.href;
|
var currentUrl = window.location.href;
|
||||||
@@ -844,21 +844,21 @@ function openUrl(urls) {
|
|||||||
function forceLoadUrl(relativeUrl) {
|
function forceLoadUrl(relativeUrl) {
|
||||||
|
|
||||||
window.location.replace(relativeUrl);
|
window.location.replace(relativeUrl);
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function navigateToDeviceWithIp (ip) {
|
function navigateToDeviceWithIp (ip) {
|
||||||
|
|
||||||
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(res) {
|
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(res) {
|
||||||
|
|
||||||
devices = res["data"];
|
devices = res["data"];
|
||||||
|
|
||||||
mac = ""
|
mac = ""
|
||||||
|
|
||||||
$.each(devices, function(index, obj) {
|
$.each(devices, function(index, obj) {
|
||||||
|
|
||||||
if(obj.devLastIP.trim() == ip.trim())
|
if(obj.devLastIP.trim() == ip.trim())
|
||||||
{
|
{
|
||||||
mac = obj.devMac;
|
mac = obj.devMac;
|
||||||
@@ -866,7 +866,7 @@ function navigateToDeviceWithIp (ip) {
|
|||||||
window.open('./deviceDetails.php?mac=' + mac , "_blank");
|
window.open('./deviceDetails.php?mac=' + mac , "_blank");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,7 +898,7 @@ function getMac(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
return params.mac
|
return params.mac
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// A function used to make the IP address orderable
|
// A function used to make the IP address orderable
|
||||||
@@ -950,7 +950,7 @@ function isRandomMAC(mac)
|
|||||||
{
|
{
|
||||||
isRandom = false;
|
isRandom = false;
|
||||||
|
|
||||||
isRandom = ["2", "6", "A", "E", "a", "e"].includes(mac[1]);
|
isRandom = ["2", "6", "A", "E", "a", "e"].includes(mac[1]);
|
||||||
|
|
||||||
// if detected as random, make sure it doesn't start with a prefix which teh suer doesn't want to mark as random
|
// if detected as random, make sure it doesn't start with a prefix which teh suer doesn't want to mark as random
|
||||||
if(isRandom)
|
if(isRandom)
|
||||||
@@ -959,17 +959,17 @@ function isRandomMAC(mac)
|
|||||||
|
|
||||||
if(mac.startsWith(prefix))
|
if(mac.startsWith(prefix))
|
||||||
{
|
{
|
||||||
isRandom = false;
|
isRandom = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return isRandom;
|
return isRandom;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
// ---------------------------------------------------------
|
||||||
// Generate an array object from a string representation of an array
|
// Generate an array object from a string representation of an array
|
||||||
function createArray(input) {
|
function createArray(input) {
|
||||||
// Is already array, return
|
// Is already array, return
|
||||||
@@ -980,25 +980,25 @@ function isRandomMAC(mac)
|
|||||||
if (input === '[]' || input === '') {
|
if (input === '[]' || input === '') {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// handle integer
|
// handle integer
|
||||||
if (typeof input === 'number') {
|
if (typeof input === 'number') {
|
||||||
input = input.toString();
|
input = input.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regex pattern for brackets
|
// Regex pattern for brackets
|
||||||
const patternBrackets = /(^\s*\[)|(\]\s*$)/g;
|
const patternBrackets = /(^\s*\[)|(\]\s*$)/g;
|
||||||
const replacement = '';
|
const replacement = '';
|
||||||
|
|
||||||
// Remove brackets
|
// Remove brackets
|
||||||
const noBrackets = input.replace(patternBrackets, replacement);
|
const noBrackets = input.replace(patternBrackets, replacement);
|
||||||
|
|
||||||
const options = [];
|
const options = [];
|
||||||
|
|
||||||
// Detect the type of quote used after the opening bracket
|
// Detect the type of quote used after the opening bracket
|
||||||
const firstChar = noBrackets.trim()[0];
|
const firstChar = noBrackets.trim()[0];
|
||||||
const isDoubleQuoted = firstChar === '"';
|
const isDoubleQuoted = firstChar === '"';
|
||||||
const isSingleQuoted = firstChar === "'";
|
const isSingleQuoted = firstChar === "'";
|
||||||
|
|
||||||
// Create array while handling commas within quoted segments
|
// Create array while handling commas within quoted segments
|
||||||
let currentSegment = '';
|
let currentSegment = '';
|
||||||
let withinQuotes = false;
|
let withinQuotes = false;
|
||||||
@@ -1016,7 +1016,7 @@ function isRandomMAC(mac)
|
|||||||
}
|
}
|
||||||
// Push the last segment
|
// Push the last segment
|
||||||
options.push(currentSegment.trim());
|
options.push(currentSegment.trim());
|
||||||
|
|
||||||
// Remove quotes based on detected type
|
// Remove quotes based on detected type
|
||||||
options.forEach((item, index) => {
|
options.forEach((item, index) => {
|
||||||
let trimmedItem = item.trim();
|
let trimmedItem = item.trim();
|
||||||
@@ -1028,7 +1028,7 @@ function isRandomMAC(mac)
|
|||||||
}
|
}
|
||||||
options[index] = trimmedItem;
|
options[index] = trimmedItem;
|
||||||
});
|
});
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1037,7 +1037,7 @@ function isRandomMAC(mac)
|
|||||||
// for the value to be returned
|
// for the value to be returned
|
||||||
function getDevDataByMac(macAddress, dbColumn) {
|
function getDevDataByMac(macAddress, dbColumn) {
|
||||||
|
|
||||||
const sessionDataKey = 'devicesListAll_JSON';
|
const sessionDataKey = 'devicesListAll_JSON';
|
||||||
const devicesCache = getCache(sessionDataKey);
|
const devicesCache = getCache(sessionDataKey);
|
||||||
|
|
||||||
if (!devicesCache || devicesCache == "") {
|
if (!devicesCache || devicesCache == "") {
|
||||||
@@ -1068,11 +1068,11 @@ function getDevDataByMac(macAddress, dbColumn) {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Cache the devices as one JSON
|
// Cache the devices as one JSON
|
||||||
function cacheDevices()
|
function cacheDevices()
|
||||||
{
|
{
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|
||||||
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(data) {
|
$.get('php/server/query_json.php', { file: 'table_devices.json', nocache: Date.now() }, function(data) {
|
||||||
|
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
|
||||||
devicesListAll_JSON = data["data"]
|
devicesListAll_JSON = data["data"]
|
||||||
@@ -1093,11 +1093,11 @@ function cacheDevices()
|
|||||||
|
|
||||||
// console.log(getCache('devicesListAll_JSON'))
|
// console.log(getCache('devicesListAll_JSON'))
|
||||||
}).then(() => handleSuccess('cacheDevices', resolve())).catch(() => handleFailure('cacheDevices', reject("cacheDevices already completed"))); // handle AJAX synchronization
|
}).then(() => handleSuccess('cacheDevices', resolve())).catch(() => handleFailure('cacheDevices', reject("cacheDevices already completed"))); // handle AJAX synchronization
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var devicesListAll_JSON = []; // this will contain a list off all devices
|
var devicesListAll_JSON = []; // this will contain a list off all devices
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function isEmpty(value)
|
function isEmpty(value)
|
||||||
@@ -1127,7 +1127,7 @@ function getGuid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// UI
|
// UI
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -1230,7 +1230,7 @@ function hideSpinner() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// Calls a backend function to add a front-end event to an execution queue
|
// Calls a backend function to add a front-end event to an execution queue
|
||||||
function updateApi(apiEndpoints)
|
function updateApi(apiEndpoints)
|
||||||
@@ -1250,9 +1250,9 @@ function updateApi(apiEndpoints)
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// handling smooth scrolling
|
// handling smooth scrolling
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
function setupSmoothScrolling() {
|
function setupSmoothScrolling() {
|
||||||
// Function to scroll to the element
|
// Function to scroll to the element
|
||||||
function scrollToElement(id) {
|
function scrollToElement(id) {
|
||||||
@@ -1310,17 +1310,17 @@ function getPluginSettingObject(pluginsData, setting_key, unique_prefix ) {
|
|||||||
|
|
||||||
result = {}
|
result = {}
|
||||||
unique_prefix == undefined ? unique_prefix = setting_key.split("_")[0] : unique_prefix = unique_prefix;
|
unique_prefix == undefined ? unique_prefix = setting_key.split("_")[0] : unique_prefix = unique_prefix;
|
||||||
|
|
||||||
$.each(pluginsData, function (i, plgnObj){
|
$.each(pluginsData, function (i, plgnObj){
|
||||||
// go thru plugins
|
// go thru plugins
|
||||||
if(plgnObj.unique_prefix == unique_prefix)
|
if(plgnObj.unique_prefix == unique_prefix)
|
||||||
{
|
{
|
||||||
// go thru plugin settings
|
// go thru plugin settings
|
||||||
$.each(plgnObj["settings"], function (j, setObj){
|
$.each(plgnObj["settings"], function (j, setObj){
|
||||||
|
|
||||||
if(`${unique_prefix}_${setObj.function}` == setting_key)
|
if(`${unique_prefix}_${setObj.function}` == setting_key)
|
||||||
{
|
{
|
||||||
result = setObj
|
result = setObj
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -1372,7 +1372,7 @@ function arraysContainSameValues(arr1, arr2) {
|
|||||||
if (!Array.isArray(arr1) || !Array.isArray(arr2)) {
|
if (!Array.isArray(arr1) || !Array.isArray(arr2)) {
|
||||||
return false;
|
return false;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Sort and stringify arrays, then compare
|
// Sort and stringify arrays, then compare
|
||||||
return JSON.stringify(arr1.slice().sort()) === JSON.stringify(arr2.slice().sort());
|
return JSON.stringify(arr1.slice().sort()) === JSON.stringify(arr2.slice().sort());
|
||||||
}
|
}
|
||||||
@@ -1383,7 +1383,7 @@ function arraysContainSameValues(arr1, arr2) {
|
|||||||
function hideUIelements(setKey) {
|
function hideUIelements(setKey) {
|
||||||
|
|
||||||
hiddenSectionsSetting = getSetting(setKey)
|
hiddenSectionsSetting = getSetting(setKey)
|
||||||
|
|
||||||
if(hiddenSectionsSetting != "") // handle if settings not yet initialized
|
if(hiddenSectionsSetting != "") // handle if settings not yet initialized
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1398,9 +1398,9 @@ function hideUIelements(setKey) {
|
|||||||
|
|
||||||
if($('#' + hiddenSection))
|
if($('#' + hiddenSection))
|
||||||
{
|
{
|
||||||
$('#' + hiddenSection).hide()
|
$('#' + hiddenSection).hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1411,7 +1411,7 @@ function getDevicesList()
|
|||||||
{
|
{
|
||||||
// Read cache (skip cookie expiry check)
|
// Read cache (skip cookie expiry check)
|
||||||
devicesList = getCache('devicesListAll_JSON', true);
|
devicesList = getCache('devicesListAll_JSON', true);
|
||||||
|
|
||||||
if (devicesList != '') {
|
if (devicesList != '') {
|
||||||
devicesList = JSON.parse (devicesList);
|
devicesList = JSON.parse (devicesList);
|
||||||
} else {
|
} else {
|
||||||
@@ -1468,7 +1468,7 @@ $(document).ready(function() {
|
|||||||
// Restart Backend Python Server
|
// Restart Backend Python Server
|
||||||
|
|
||||||
function askRestartBackend() {
|
function askRestartBackend() {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning(getString('Maint_RestartServer'), getString('Maint_Restart_Server_noti_text'),
|
showModalWarning(getString('Maint_RestartServer'), getString('Maint_Restart_Server_noti_text'),
|
||||||
getString('Gen_Cancel'), getString('Maint_RestartServer'), 'restartBackend');
|
getString('Gen_Cancel'), getString('Maint_RestartServer'), 'restartBackend');
|
||||||
}
|
}
|
||||||
@@ -1477,7 +1477,7 @@ function askRestartBackend() {
|
|||||||
function restartBackend() {
|
function restartBackend() {
|
||||||
|
|
||||||
modalEventStatusId = 'modal-message-front-event'
|
modalEventStatusId = 'modal-message-front-event'
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
@@ -1523,7 +1523,7 @@ function clearCache() {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Function to check if cache needs to be refreshed because of setting changes
|
// Function to check if cache needs to be refreshed because of setting changes
|
||||||
function checkSettingChanges() {
|
function checkSettingChanges() {
|
||||||
$.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
$.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
||||||
const importedMilliseconds = parseInt(appState["settingsImported"] * 1000);
|
const importedMilliseconds = parseInt(appState["settingsImported"] * 1000);
|
||||||
const lastReloaded = parseInt(sessionStorage.getItem(sessionStorageKey + '_time'));
|
const lastReloaded = parseInt(sessionStorage.getItem(sessionStorageKey + '_time'));
|
||||||
|
|
||||||
@@ -1594,7 +1594,7 @@ function isAppInitialized() {
|
|||||||
|
|
||||||
lang_shouldBeCompletedCalls = getLangCode() == 'en_us' ? 1 : 2;
|
lang_shouldBeCompletedCalls = getLangCode() == 'en_us' ? 1 : 2;
|
||||||
|
|
||||||
// check if each ajax call completed succesfully
|
// check if each ajax call completed succesfully
|
||||||
$.each(completedCalls_final, function(index, call_name){
|
$.each(completedCalls_final, function(index, call_name){
|
||||||
|
|
||||||
if(getCache(call_name + "_completed") != "true")
|
if(getCache(call_name + "_completed") != "true")
|
||||||
@@ -1622,8 +1622,7 @@ async function executeOnce() {
|
|||||||
|
|
||||||
if (!isAppInitialized()) {
|
if (!isAppInitialized()) {
|
||||||
try {
|
try {
|
||||||
console.log("HERE");
|
|
||||||
|
|
||||||
await waitForGraphQLServer(); // Wait for the server to start
|
await waitForGraphQLServer(); // Wait for the server to start
|
||||||
|
|
||||||
await cacheDevices();
|
await cacheDevices();
|
||||||
@@ -1680,7 +1679,7 @@ const onAllCallsComplete = () => {
|
|||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// location.reload()
|
// location.reload()
|
||||||
// }, 10);
|
// }, 10);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// If not all strings are initialized, retry initialization
|
// If not all strings are initialized, retry initialization
|
||||||
console.log('❌ Not all strings are initialized. Retrying...');
|
console.log('❌ Not all strings are initialized. Retrying...');
|
||||||
@@ -1702,7 +1701,7 @@ const areAllStringsInitialized = () => {
|
|||||||
// Call the function to execute the code
|
// Call the function to execute the code
|
||||||
executeOnce();
|
executeOnce();
|
||||||
|
|
||||||
// Set timer for regular UI refresh if enabled
|
// Set timer for regular UI refresh if enabled
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
// page refresh if configured
|
// page refresh if configured
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ function showModalInput(
|
|||||||
btnOK = getString("Gen_Okay"),
|
btnOK = getString("Gen_Okay"),
|
||||||
callbackFunction = null,
|
callbackFunction = null,
|
||||||
triggeredBy = null,
|
triggeredBy = null,
|
||||||
defaultValue = ""
|
defaultValue = ""
|
||||||
) {
|
) {
|
||||||
prefix = "modal-input";
|
prefix = "modal-input";
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ function showModalInput(
|
|||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$(`#${prefix}-textarea`).focus();
|
$(`#${prefix}-textarea`).focus();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -143,7 +143,7 @@ function showModalFieldInput(
|
|||||||
$(`#${prefix}-OK`).html(btnOK);
|
$(`#${prefix}-OK`).html(btnOK);
|
||||||
|
|
||||||
if (callbackFunction != null) {
|
if (callbackFunction != null) {
|
||||||
|
|
||||||
modalCallbackFunction = callbackFunction;
|
modalCallbackFunction = callbackFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,11 +181,11 @@ function showModalPopupForm(
|
|||||||
$(`#${prefix}-cancel`).html(btnCancel);
|
$(`#${prefix}-cancel`).html(btnCancel);
|
||||||
$(`#${prefix}-OK`).html(btnOK);
|
$(`#${prefix}-OK`).html(btnOK);
|
||||||
|
|
||||||
// if curValue not null
|
// if curValue not null
|
||||||
|
|
||||||
if (curValue)
|
if (curValue)
|
||||||
{
|
{
|
||||||
initialValues = JSON.parse(atob(curValue));
|
initialValues = JSON.parse(atob(curValue));
|
||||||
}
|
}
|
||||||
|
|
||||||
outputHtml = "";
|
outputHtml = "";
|
||||||
@@ -193,7 +193,7 @@ function showModalPopupForm(
|
|||||||
if (Array.isArray(popupFormJson)) {
|
if (Array.isArray(popupFormJson)) {
|
||||||
popupFormJson.forEach((field, index) => {
|
popupFormJson.forEach((field, index) => {
|
||||||
// You'll need to define these or map them from `field`
|
// You'll need to define these or map them from `field`
|
||||||
const setKey = field.function || `field_${index}`;
|
const setKey = field.function || `field_${index}`;
|
||||||
const setName = getString(`${parentSettingKey}_popupform_${setKey}_name`);
|
const setName = getString(`${parentSettingKey}_popupform_${setKey}_name`);
|
||||||
const labelClasses = "col-sm-2"; // example, or from your obj.labelClasses
|
const labelClasses = "col-sm-2"; // example, or from your obj.labelClasses
|
||||||
const inputClasses = "col-sm-10"; // example, or from your obj.inputClasses
|
const inputClasses = "col-sm-10"; // example, or from your obj.inputClasses
|
||||||
@@ -207,9 +207,9 @@ function showModalPopupForm(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fieldOptionsOverride = field.type?.elements[0]?.elementOptions || [];
|
const fieldOptionsOverride = field.type?.elements[0]?.elementOptions || [];
|
||||||
const setValue = initialValue;
|
const setValue = initialValue;
|
||||||
const setType = JSON.stringify(field.type);
|
const setType = JSON.stringify(field.type);
|
||||||
const setEvents = field.events || []; // default to empty array if missing
|
const setEvents = field.events || []; // default to empty array if missing
|
||||||
const setObj = { setKey, setValue, setType, setEvents };
|
const setObj = { setKey, setValue, setType, setEvents };
|
||||||
|
|
||||||
@@ -218,17 +218,17 @@ function showModalPopupForm(
|
|||||||
<div class="form-group col-xs-12">
|
<div class="form-group col-xs-12">
|
||||||
<label id="${setKey}_label" class="${labelClasses}"> ${setName}
|
<label id="${setKey}_label" class="${labelClasses}"> ${setName}
|
||||||
<i my-set-key="${parentSettingKey}_popupform_${setKey}"
|
<i my-set-key="${parentSettingKey}_popupform_${setKey}"
|
||||||
title="${getString("Settings_Show_Description")}"
|
title="${getString("Settings_Show_Description")}"
|
||||||
class="fa fa-circle-info pointer helpIconSmallTopRight"
|
class="fa fa-circle-info pointer helpIconSmallTopRight"
|
||||||
onclick="showDescriptionPopup(this)">
|
onclick="showDescriptionPopup(this)">
|
||||||
</i>
|
</i>
|
||||||
</label>
|
</label>
|
||||||
<div class="${inputClasses}">
|
<div class="${inputClasses}">
|
||||||
${generateFormHtml(
|
${generateFormHtml(
|
||||||
null, // settingsData only required for datatables
|
null, // settingsData only required for datatables
|
||||||
setObj,
|
setObj,
|
||||||
null,
|
null,
|
||||||
fieldOptionsOverride,
|
fieldOptionsOverride,
|
||||||
null
|
null
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -239,7 +239,7 @@ function showModalPopupForm(
|
|||||||
outputHtml += inputFormHtml;
|
outputHtml += inputFormHtml;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(`#modal-form-plc`).html(outputHtml);
|
$(`#modal-form-plc`).html(outputHtml);
|
||||||
|
|
||||||
// Bind OK button click event
|
// Bind OK button click event
|
||||||
@@ -247,12 +247,19 @@ function showModalPopupForm(
|
|||||||
let settingsArray = [];
|
let settingsArray = [];
|
||||||
if (Array.isArray(popupFormJson)) {
|
if (Array.isArray(popupFormJson)) {
|
||||||
popupFormJson.forEach(field => {
|
popupFormJson.forEach(field => {
|
||||||
collectSetting(
|
const result = collectSetting(
|
||||||
`${parentSettingKey}_popupform`, // prefix
|
`${parentSettingKey}_popupform`, // prefix
|
||||||
field.function, // setCodeName
|
field.function, // setCodeName
|
||||||
field.type, // setType (object)
|
field.type, // setType (object)
|
||||||
settingsArray
|
settingsArray
|
||||||
);
|
);
|
||||||
|
settingsArray = result.settingsArray;
|
||||||
|
|
||||||
|
if (!result.dataIsValid) {
|
||||||
|
msg = getString("Gen_Invalid_Value") + ":" + result.failedSettingKey;
|
||||||
|
console.error(msg);
|
||||||
|
showModalOk("ERROR", msg);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +283,7 @@ function showModalPopupForm(
|
|||||||
const newOption = $("<option class='interactable-option'></option>")
|
const newOption = $("<option class='interactable-option'></option>")
|
||||||
.attr("value", encodedValue)
|
.attr("value", encodedValue)
|
||||||
.text(label);
|
.text(label);
|
||||||
|
|
||||||
$("#" + selectId).append(newOption);
|
$("#" + selectId).append(newOption);
|
||||||
initListInteractionOptions(newOption);
|
initListInteractionOptions(newOption);
|
||||||
}
|
}
|
||||||
@@ -429,10 +436,10 @@ function safeDecodeURIComponent(content) {
|
|||||||
return content; // Return the original content if decoding fails
|
return content; // Return the original content if decoding fails
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Backend notification Polling
|
// Backend notification Polling
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Function to check for notifications
|
// Function to check for notifications
|
||||||
function checkNotification() {
|
function checkNotification() {
|
||||||
@@ -440,7 +447,7 @@ function checkNotification() {
|
|||||||
const phpEndpoint = 'php/server/utilNotification.php';
|
const phpEndpoint = 'php/server/utilNotification.php';
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: notificationEndpoint,
|
url: notificationEndpoint,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// console.log(response);
|
// console.log(response);
|
||||||
@@ -492,7 +499,7 @@ function checkNotification() {
|
|||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
console.warn(`🟥 Error checking ${notificationEndpoint}`)
|
console.warn(`🟥 Error checking ${notificationEndpoint}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -582,7 +589,7 @@ const phpEndpoint = 'php/server/utilNotification.php';
|
|||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Write a notification
|
// Write a notification
|
||||||
function write_notification(content, level) {
|
function write_notification(content, level) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: phpEndpoint, // Change this to the path of your PHP script
|
url: phpEndpoint, // Change this to the path of your PHP script
|
||||||
@@ -603,8 +610,8 @@ function write_notification(content, level) {
|
|||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Write a notification
|
// Write a notification
|
||||||
function markNotificationAsRead(guid) {
|
function markNotificationAsRead(guid) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: phpEndpoint,
|
url: phpEndpoint,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
@@ -628,8 +635,8 @@ function markNotificationAsRead(guid) {
|
|||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Remove a notification
|
// Remove a notification
|
||||||
function removeNotification(guid) {
|
function removeNotification(guid) {
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: phpEndpoint,
|
url: phpEndpoint,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ function getPluginConfig(pluginsData, prefix) {
|
|||||||
// Show the description of a setting
|
// Show the description of a setting
|
||||||
function showDescriptionPopup(e) {
|
function showDescriptionPopup(e) {
|
||||||
|
|
||||||
console.log($(e).attr("my-set-key"));
|
console.log($(e).attr("my-set-key"));
|
||||||
|
|
||||||
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
|
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
|
||||||
}
|
}
|
||||||
@@ -92,13 +92,13 @@ function pluginCards(prefixesOfEnabledPlugins, includeSettings) {
|
|||||||
prefix + "_" + set
|
prefix + "_" + set
|
||||||
}">
|
}">
|
||||||
<code>${getSetting(prefix + "_" + set)}</code>
|
<code>${getSetting(prefix + "_" + set)}</code>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 col-xxl-1 padding-5px">
|
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 col-xxl-1 padding-5px">
|
||||||
<div class="small-box bg-green col-sm-12 " >
|
<div class="small-box bg-green col-sm-12 " >
|
||||||
<div class="inner col-sm-12">
|
<div class="inner col-sm-12">
|
||||||
@@ -110,10 +110,10 @@ function pluginCards(prefixesOfEnabledPlugins, includeSettings) {
|
|||||||
${includeSettings_html}
|
${includeSettings_html}
|
||||||
</div>
|
</div>
|
||||||
<a href="#${prefix}_header" onclick="toggleAllSettings('open')">
|
<a href="#${prefix}_header" onclick="toggleAllSettings('open')">
|
||||||
<div class="icon"> ${getString(prefix + "_icon")} </div>
|
<div class="icon"> ${getString(prefix + "_icon")} </div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
});
|
});
|
||||||
@@ -251,17 +251,17 @@ function settingsCollectedCorrectly(settingsArray, settingsJSON_DB) {
|
|||||||
function cloneDataTableRow(el){
|
function cloneDataTableRow(el){
|
||||||
|
|
||||||
console.log(el);
|
console.log(el);
|
||||||
|
|
||||||
const id = "NEWDEV_devCustomProps_table"; // Your table ID
|
const id = "NEWDEV_devCustomProps_table"; // Your table ID
|
||||||
const table = $('#'+id).DataTable();
|
const table = $('#'+id).DataTable();
|
||||||
|
|
||||||
|
|
||||||
// Get the 'my-index' attribute from the closest tr element
|
// Get the 'my-index' attribute from the closest tr element
|
||||||
const myIndex = parseInt($(el).closest("tr").attr("my-index"));
|
const myIndex = parseInt($(el).closest("tr").attr("my-index"));
|
||||||
|
|
||||||
// Find the row in the table with the matching 'my-index'
|
// Find the row in the table with the matching 'my-index'
|
||||||
const row = table.rows().nodes().to$().filter(`[my-index="${myIndex}"]`).first().get(0);
|
const row = table.rows().nodes().to$().filter(`[my-index="${myIndex}"]`).first().get(0);
|
||||||
|
|
||||||
// Clone the row (including its data and controls)
|
// Clone the row (including its data and controls)
|
||||||
let clonedRow = $(row).clone(true, true); // The true arguments copy the data and event handlers
|
let clonedRow = $(row).clone(true, true); // The true arguments copy the data and event handlers
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ function cloneDataTableRow(el){
|
|||||||
|
|
||||||
|
|
||||||
console.log(clonedRow);
|
console.log(clonedRow);
|
||||||
|
|
||||||
|
|
||||||
// Add the cloned row to the DataTable
|
// Add the cloned row to the DataTable
|
||||||
table.row.add(clonedRow[0]).draw();
|
table.row.add(clonedRow[0]).draw();
|
||||||
@@ -291,13 +291,13 @@ function removeDataTableRow(el) {
|
|||||||
|
|
||||||
// Find the row in the table with the matching 'my-index'
|
// Find the row in the table with the matching 'my-index'
|
||||||
const row = table.rows().nodes().to$().filter(`[my-index="${myIndex}"]`).first().get(0);
|
const row = table.rows().nodes().to$().filter(`[my-index="${myIndex}"]`).first().get(0);
|
||||||
|
|
||||||
// Remove the row from the DataTable
|
// Remove the row from the DataTable
|
||||||
table.row(row).remove().draw();
|
table.row(row).remove().draw();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showMessage (getString("CustProps_cant_remove"), 3000, "modal_red");
|
showMessage (getString("CustProps_cant_remove"), 3000, "modal_red");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,9 +308,9 @@ function addViaPopupForm(element) {
|
|||||||
|
|
||||||
const toId = $(element).attr("my-input-to");
|
const toId = $(element).attr("my-input-to");
|
||||||
const curValue = $(`#${toId}`).val();
|
const curValue = $(`#${toId}`).val();
|
||||||
const parsed = JSON.parse(atob($(`#${toId}`).data("elementoptionsbase64")));
|
const parsed = JSON.parse(atob($(`#${toId}`).data("elementoptionsbase64")));
|
||||||
const popupFormJson = parsed.find(obj => "popupForm" in obj)?.popupForm ?? null;
|
const popupFormJson = parsed.find(obj => "popupForm" in obj)?.popupForm ?? null;
|
||||||
|
|
||||||
console.log(`toId | curValue: ${toId} | ${curValue}`);
|
console.log(`toId | curValue: ${toId} | ${curValue}`);
|
||||||
|
|
||||||
showModalPopupForm(
|
showModalPopupForm(
|
||||||
@@ -393,7 +393,7 @@ function selectAll(element) {
|
|||||||
settingsChanged();
|
settingsChanged();
|
||||||
|
|
||||||
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
||||||
|
|
||||||
// Iterate over each option within the select element
|
// Iterate over each option within the select element
|
||||||
selectElement.find('option').each(function() {
|
selectElement.find('option').each(function() {
|
||||||
// Mark each option as selected
|
// Mark each option as selected
|
||||||
@@ -409,13 +409,13 @@ function selectAll(element) {
|
|||||||
function unselectAll(element) {
|
function unselectAll(element) {
|
||||||
settingsChanged();
|
settingsChanged();
|
||||||
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
||||||
|
|
||||||
// Iterate over each option within the select element
|
// Iterate over each option within the select element
|
||||||
selectElement.find('option').each(function() {
|
selectElement.find('option').each(function() {
|
||||||
// Unselect each option
|
// Unselect each option
|
||||||
$(this).prop('selected', false);
|
$(this).prop('selected', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Trigger the 'change' event to notify Bootstrap Select of the changes
|
// Trigger the 'change' event to notify Bootstrap Select of the changes
|
||||||
selectElement.trigger('change');
|
selectElement.trigger('change');
|
||||||
}
|
}
|
||||||
@@ -426,7 +426,7 @@ function selectChange(element) {
|
|||||||
settingsChanged();
|
settingsChanged();
|
||||||
|
|
||||||
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
var selectElement = $(`#${$(element).attr("my-input-to")}`);
|
||||||
|
|
||||||
selectElement.parent().find("input").focus().click();
|
selectElement.parent().find("input").focus().click();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,9 +464,9 @@ function initListInteractionOptions(element) {
|
|||||||
// Parent has my-transformers="name|base64"
|
// Parent has my-transformers="name|base64"
|
||||||
const toId = $parent.attr("id");
|
const toId = $parent.attr("id");
|
||||||
const curValue = $option.val();
|
const curValue = $option.val();
|
||||||
const parsed = JSON.parse(atob($parent.data("elementoptionsbase64")));
|
const parsed = JSON.parse(atob($parent.data("elementoptionsbase64")));
|
||||||
const popupFormJson = parsed.find(obj => "popupForm" in obj)?.popupForm ?? null;
|
const popupFormJson = parsed.find(obj => "popupForm" in obj)?.popupForm ?? null;
|
||||||
|
|
||||||
showModalPopupForm(
|
showModalPopupForm(
|
||||||
`<i class="fa fa-pen-to-square"></i> ${getString("Gen_Update_Value")}`, // title
|
`<i class="fa fa-pen-to-square"></i> ${getString("Gen_Update_Value")}`, // title
|
||||||
"", // message
|
"", // message
|
||||||
@@ -515,8 +515,8 @@ function filterRows(inputText) {
|
|||||||
var $panelHeader = $panel.find('.panel-heading');
|
var $panelHeader = $panel.find('.panel-heading');
|
||||||
var $panelBody = $panel.find('.panel-collapse');
|
var $panelBody = $panel.find('.panel-collapse');
|
||||||
|
|
||||||
$panel.show()
|
$panel.show()
|
||||||
$panelHeader.show()
|
$panelHeader.show()
|
||||||
$panelBody.collapse('show');
|
$panelBody.collapse('show');
|
||||||
|
|
||||||
$panelBody.find(".table_row:not(.docs)").each(function () {
|
$panelBody.find(".table_row:not(.docs)").each(function () {
|
||||||
@@ -525,11 +525,11 @@ function filterRows(inputText) {
|
|||||||
var isMetadataRow = rowId && rowId.endsWith("__metadata");
|
var isMetadataRow = rowId && rowId.endsWith("__metadata");
|
||||||
if (!isMetadataRow) {
|
if (!isMetadataRow) {
|
||||||
$row.show()
|
$row.show()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
// filter
|
// filter
|
||||||
|
|
||||||
@@ -537,25 +537,25 @@ function filterRows(inputText) {
|
|||||||
var $panel = $(this);
|
var $panel = $(this);
|
||||||
var $panelHeader = $panel.find('.panel-heading');
|
var $panelHeader = $panel.find('.panel-heading');
|
||||||
var $panelBody = $panel.find('.panel-collapse');
|
var $panelBody = $panel.find('.panel-collapse');
|
||||||
|
|
||||||
var anyVisible = false; // Flag to check if any row is visible
|
var anyVisible = false; // Flag to check if any row is visible
|
||||||
|
|
||||||
$panelBody.find(".table_row:not(.docs)").each(function () {
|
$panelBody.find(".table_row:not(.docs)").each(function () {
|
||||||
var $row = $(this);
|
var $row = $(this);
|
||||||
|
|
||||||
// Check if the row ID ends with "__metadata"
|
// Check if the row ID ends with "__metadata"
|
||||||
var rowId = $row.attr("id");
|
var rowId = $row.attr("id");
|
||||||
var isMetadataRow = rowId && rowId.endsWith("__metadata");
|
var isMetadataRow = rowId && rowId.endsWith("__metadata");
|
||||||
|
|
||||||
// Always hide metadata rows
|
// Always hide metadata rows
|
||||||
if (isMetadataRow) {
|
if (isMetadataRow) {
|
||||||
$row.hide();
|
$row.hide();
|
||||||
return; // Skip further processing for metadata rows
|
return; // Skip further processing for metadata rows
|
||||||
}
|
}
|
||||||
|
|
||||||
var description = $row.find(".setting_description").text().toLowerCase();
|
var description = $row.find(".setting_description").text().toLowerCase();
|
||||||
var setKey = $row.find(".setting_name code").text().toLowerCase();
|
var setKey = $row.find(".setting_name code").text().toLowerCase();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
description.includes(inputText.toLowerCase()) ||
|
description.includes(inputText.toLowerCase()) ||
|
||||||
setKey.includes(inputText.toLowerCase())
|
setKey.includes(inputText.toLowerCase())
|
||||||
@@ -566,7 +566,7 @@ function filterRows(inputText) {
|
|||||||
$row.hide();
|
$row.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Determine whether to hide or show the panel based on visibility of rows
|
// Determine whether to hide or show the panel based on visibility of rows
|
||||||
if (anyVisible) {
|
if (anyVisible) {
|
||||||
$panelBody.collapse('show'); // Ensure the panel body is shown if there are visible rows
|
$panelBody.collapse('show'); // Ensure the panel body is shown if there are visible rows
|
||||||
@@ -582,7 +582,7 @@ function filterRows(inputText) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -661,7 +661,7 @@ function generateOptionsOrSetOptions(
|
|||||||
processDataCallback, // Callback function to generate entries based on options
|
processDataCallback, // Callback function to generate entries based on options
|
||||||
targetField, // Target field or element where selected value should be applied or updated
|
targetField, // Target field or element where selected value should be applied or updated
|
||||||
transformers = [], // Transformers to be applied to the values
|
transformers = [], // Transformers to be applied to the values
|
||||||
overrideOptions = null // override options if available
|
overrideOptions = null // override options if available
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// console.log(setKey);
|
// console.log(setKey);
|
||||||
@@ -712,7 +712,7 @@ function applyTransformers(val, transformers) {
|
|||||||
break;
|
break;
|
||||||
case "getString":
|
case "getString":
|
||||||
// no change
|
// no change
|
||||||
val = val;
|
val = val;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.warn(`Unknown transformer: ${transformer}`);
|
console.warn(`Unknown transformer: ${transformer}`);
|
||||||
@@ -745,13 +745,13 @@ function reverseTransformers(val, transformers) {
|
|||||||
break;
|
break;
|
||||||
case "getString":
|
case "getString":
|
||||||
// retrieve string
|
// retrieve string
|
||||||
val = getString(val);
|
val = getString(val);
|
||||||
break;
|
break;
|
||||||
case "deviceChip":
|
case "deviceChip":
|
||||||
mac = val // value is mac
|
mac = val // value is mac
|
||||||
val = `${getDevDataByMac(mac, "devName")}`
|
val = `${getDevDataByMac(mac, "devName")}`
|
||||||
break;
|
break;
|
||||||
case "deviceRelType":
|
case "deviceRelType":
|
||||||
val = val; // nothing to do
|
val = val; // nothing to do
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -779,10 +779,11 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
let getStringKey = "";
|
let getStringKey = "";
|
||||||
let onClick = "console.log('onClick - Not implemented');";
|
let onClick = "console.log('onClick - Not implemented');";
|
||||||
let onChange = "console.log('onChange - Not implemented');";
|
let onChange = "console.log('onChange - Not implemented');";
|
||||||
|
let focusout = "console.log('focusout - Not implemented');";
|
||||||
let customParams = "";
|
let customParams = "";
|
||||||
let customId = "";
|
let customId = "";
|
||||||
let columns = [];
|
let columns = [];
|
||||||
let base64Regex = "";
|
let base64Regex = "";
|
||||||
let elementOptionsBase64 = btoa(JSON.stringify(elementOptions));
|
let elementOptionsBase64 = btoa(JSON.stringify(elementOptions));
|
||||||
|
|
||||||
elementOptions.forEach((option) => {
|
elementOptions.forEach((option) => {
|
||||||
@@ -830,6 +831,9 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
if (option.onChange) {
|
if (option.onChange) {
|
||||||
onChange = option.onChange;
|
onChange = option.onChange;
|
||||||
}
|
}
|
||||||
|
if (option.focusout) {
|
||||||
|
focusout = option.focusout;
|
||||||
|
}
|
||||||
if (option.customParams) {
|
if (option.customParams) {
|
||||||
customParams = option.customParams;
|
customParams = option.customParams;
|
||||||
}
|
}
|
||||||
@@ -867,7 +871,8 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -877,7 +882,7 @@ const handleElementOptions = (setKey, elementOptions, transformers, val) => {
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Creates an object from an array
|
// Creates an object from an array
|
||||||
function arrayToObject(array) {
|
function arrayToObject(array) {
|
||||||
const obj = [];
|
const obj = [];
|
||||||
array.forEach((item, index) => {
|
array.forEach((item, index) => {
|
||||||
@@ -895,18 +900,18 @@ function generateOptions(options, valuesArray, targetField, transformers, placeh
|
|||||||
|
|
||||||
resultArray = []
|
resultArray = []
|
||||||
selectedArray = []
|
selectedArray = []
|
||||||
cssClass = ""
|
cssClass = ""
|
||||||
|
|
||||||
// determine if options or values are used in the listing
|
// determine if options or values are used in the listing
|
||||||
if (valuesArray.length > 0 && options.length > 0){
|
if (valuesArray.length > 0 && options.length > 0){
|
||||||
|
|
||||||
// multiselect list -> options only + selected the ones in valuesArray
|
// multiselect list -> options only + selected the ones in valuesArray
|
||||||
resultArray = options;
|
resultArray = options;
|
||||||
selectedArray = valuesArray
|
selectedArray = valuesArray
|
||||||
|
|
||||||
} else if (valuesArray.length > 0 && options.length == 0){
|
} else if (valuesArray.length > 0 && options.length == 0){
|
||||||
|
|
||||||
// editable list -> values only
|
// editable list -> values only
|
||||||
resultArray = arrayToObject(valuesArray)
|
resultArray = arrayToObject(valuesArray)
|
||||||
cssClass = "interactable-option" // generates [1x 📝 | 2x 🚮]
|
cssClass = "interactable-option" // generates [1x 📝 | 2x 🚮]
|
||||||
} else if (options.length > 0){
|
} else if (options.length > 0){
|
||||||
@@ -914,7 +919,7 @@ function generateOptions(options, valuesArray, targetField, transformers, placeh
|
|||||||
// dropdown -> options only (value == 1 STRING not ARRAY)
|
// dropdown -> options only (value == 1 STRING not ARRAY)
|
||||||
resultArray = options;
|
resultArray = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a map to track the index of each item in valuesArray
|
// Create a map to track the index of each item in valuesArray
|
||||||
const orderMap = new Map(valuesArray.map((item, index) => [item, index]));
|
const orderMap = new Map(valuesArray.map((item, index) => [item, index]));
|
||||||
|
|
||||||
@@ -961,7 +966,7 @@ function generateList(options, valuesArray, targetField, transformers, placehold
|
|||||||
|
|
||||||
listHtml += `<li ${selected}>${labelName}</li>`;
|
listHtml += `<li ${selected}>${labelName}</li>`;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Place the resulting HTML into the specified placeholder div
|
// Place the resulting HTML into the specified placeholder div
|
||||||
$("#" + placeholder).replaceWith(listHtml);
|
$("#" + placeholder).replaceWith(listHtml);
|
||||||
}
|
}
|
||||||
@@ -972,7 +977,7 @@ function genListWithInputSet(options, valuesArray, targetField, transformers, pl
|
|||||||
|
|
||||||
var listHtml = "";
|
var listHtml = "";
|
||||||
|
|
||||||
|
|
||||||
options.forEach(function(item) {
|
options.forEach(function(item) {
|
||||||
|
|
||||||
let selected = valuesArray.includes(item.id) ? 'selected' : '';
|
let selected = valuesArray.includes(item.id) ? 'selected' : '';
|
||||||
@@ -988,9 +993,9 @@ function genListWithInputSet(options, valuesArray, targetField, transformers, pl
|
|||||||
}
|
}
|
||||||
|
|
||||||
listHtml += `<li ${selected}>
|
listHtml += `<li ${selected}>
|
||||||
<a href="javascript:void(0)" onclick="setTextValue('${targetField}','${item.id}')">${labelName}</a>
|
<a href="javascript:void(0)" onclick="setTextValue('${targetField}','${item.id}')">${labelName}</a>
|
||||||
</li>`;
|
</li>`;
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Place the resulting HTML into the specified placeholder div
|
// Place the resulting HTML into the specified placeholder div
|
||||||
@@ -1001,8 +1006,8 @@ function genListWithInputSet(options, valuesArray, targetField, transformers, pl
|
|||||||
// Collects a setting based on code name
|
// Collects a setting based on code name
|
||||||
function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
||||||
// Parse setType if it's a JSON string
|
// Parse setType if it's a JSON string
|
||||||
const setTypeObject = (typeof setType === "string")
|
const setTypeObject = (typeof setType === "string")
|
||||||
? JSON.parse(processQuotes(setType))
|
? JSON.parse(processQuotes(setType))
|
||||||
: setType;
|
: setType;
|
||||||
|
|
||||||
const dataType = setTypeObject.dataType;
|
const dataType = setTypeObject.dataType;
|
||||||
@@ -1015,6 +1020,20 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
|
|
||||||
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
||||||
|
|
||||||
|
// Check if validation failed
|
||||||
|
if (
|
||||||
|
$(`#${setCodeName}`)
|
||||||
|
&& $(`#${setCodeName}`).attr("data-is-valid")
|
||||||
|
&& $(`#${setCodeName}`).attr("data-is-valid") == 0
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"settingsArray": settingsArray,
|
||||||
|
"dataIsValid": false,
|
||||||
|
"failedSettingKey": setCodeName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const opts = handleElementOptions('none', elementOptions, transformers, val = "");
|
const opts = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
// Map of handlers
|
// Map of handlers
|
||||||
@@ -1038,7 +1057,7 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
let temps = [];
|
let temps = [];
|
||||||
if (opts.isOrdeable) {
|
if (opts.isOrdeable) {
|
||||||
temps = $(`#${setCodeName}`).val();
|
temps = $(`#${setCodeName}`).val();
|
||||||
} else {
|
} else {
|
||||||
const sel = $(`#${setCodeName}`).attr("my-editable") === "true" ? "" : ":selected";
|
const sel = $(`#${setCodeName}`).attr("my-editable") === "true" ? "" : ":selected";
|
||||||
$(`#${setCodeName} option${sel}`).each(function() {
|
$(`#${setCodeName} option${sel}`).each(function() {
|
||||||
const vl = $(this).val();
|
const vl = $(this).val();
|
||||||
@@ -1066,7 +1085,7 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
let handlerKey;
|
let handlerKey;
|
||||||
if (dataType === "string" && elementType === "datatable") {
|
if (dataType === "string" && elementType === "datatable") {
|
||||||
handlerKey = "datatableString";
|
handlerKey = "datatableString";
|
||||||
} else if (dataType === "string" ||
|
} else if (dataType === "string" ||
|
||||||
(dataType === "integer" && (opts.inputType === "number" || opts.inputType === "text"))) {
|
(dataType === "integer" && (opts.inputType === "number" || opts.inputType === "text"))) {
|
||||||
handlerKey = "simpleValue";
|
handlerKey = "simpleValue";
|
||||||
} else if (opts.inputType === "checkbox") {
|
} else if (opts.inputType === "checkbox") {
|
||||||
@@ -1084,7 +1103,11 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
const value = handlers[handlerKey]();
|
const value = handlers[handlerKey]();
|
||||||
settingsArray.push([prefix, setCodeName, dataType, value]);
|
settingsArray.push([prefix, setCodeName, dataType, value]);
|
||||||
|
|
||||||
return settingsArray;
|
return {
|
||||||
|
"settingsArray": settingsArray,
|
||||||
|
"dataIsValid": true,
|
||||||
|
"failedSettingKey": ""
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1093,22 +1116,22 @@ function collectSetting(prefix, setCodeName, setType, settingsArray) {
|
|||||||
function generateFormHtml(settingsData, set, overrideValue, overrideOptions, originalSetKey) {
|
function generateFormHtml(settingsData, set, overrideValue, overrideOptions, originalSetKey) {
|
||||||
let inputHtml = '';
|
let inputHtml = '';
|
||||||
|
|
||||||
isEmpty(overrideValue) ? inVal = set['setValue'] : inVal = overrideValue;
|
isEmpty(overrideValue) ? inVal = set['setValue'] : inVal = overrideValue;
|
||||||
const setKey = set['setKey'];
|
const setKey = set['setKey'];
|
||||||
const setType = set['setType'];
|
const setType = set['setType'];
|
||||||
|
|
||||||
// if (setKey == '') {
|
// if (setKey == '') {
|
||||||
|
|
||||||
// console.log(setType);
|
// console.log(setType);
|
||||||
// console.log(setKey);
|
// console.log(setKey);
|
||||||
// console.log(overrideValue);
|
// console.log(overrideValue);
|
||||||
// console.log(inVal);
|
// console.log(inVal);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Parse the setType JSON string
|
// Parse the setType JSON string
|
||||||
// console.log(processQuotes(setType));
|
// console.log(processQuotes(setType));
|
||||||
|
|
||||||
const setTypeObject = JSON.parse(processQuotes(setType))
|
const setTypeObject = JSON.parse(processQuotes(setType))
|
||||||
const dataType = setTypeObject.dataType;
|
const dataType = setTypeObject.dataType;
|
||||||
const elements = setTypeObject.elements || [];
|
const elements = setTypeObject.elements || [];
|
||||||
@@ -1137,20 +1160,21 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
||||||
|
|
||||||
// Override value
|
// Override value
|
||||||
let val = valRes;
|
let val = valRes;
|
||||||
|
|
||||||
// if (setKey == '') {
|
// if (setKey == '') {
|
||||||
|
|
||||||
// console.log(setType);
|
// console.log(setType);
|
||||||
// console.log(setKey);
|
// console.log(setKey);
|
||||||
// console.log(overrideValue);
|
// console.log(overrideValue);
|
||||||
// console.log(inVal);
|
// console.log(inVal);
|
||||||
// console.log(val);
|
// console.log(val);
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Generate HTML based on elementType
|
// Generate HTML based on elementType
|
||||||
@@ -1159,16 +1183,17 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
const multi = isMultiSelect ? "multiple" : "";
|
const multi = isMultiSelect ? "multiple" : "";
|
||||||
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
||||||
|
|
||||||
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
||||||
my-data-type="${dataType}"
|
onfocusout="${focusout}"
|
||||||
my-editable="${editable}"
|
my-data-type="${dataType}"
|
||||||
class="form-control ${addCss} ${cssClasses}"
|
my-editable="${editable}"
|
||||||
name="${setKey}"
|
class="form-control ${addCss} ${cssClasses}"
|
||||||
id="${setKey}"
|
name="${setKey}"
|
||||||
|
id="${setKey}"
|
||||||
my-transformers=${transformers}
|
my-transformers=${transformers}
|
||||||
my-customparams="${customParams}"
|
my-customparams="${customParams}"
|
||||||
my-customid="${customId}"
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
data-elementoptionsbase64="${elementOptionsBase64}"
|
data-elementoptionsbase64="${elementOptionsBase64}"
|
||||||
${multi}
|
${multi}
|
||||||
${readOnly ? "disabled" : ""}>
|
${readOnly ? "disabled" : ""}>
|
||||||
@@ -1182,31 +1207,32 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
const checked = val === 'True' || val === 'true' || val === '1' ? 'checked' : '';
|
const checked = val === 'True' || val === 'true' || val === '1' ? 'checked' : '';
|
||||||
const inputClass = inputType === 'checkbox' ? 'checkbox' : 'form-control';
|
const inputClass = inputType === 'checkbox' ? 'checkbox' : 'form-control';
|
||||||
|
|
||||||
inputHtml += `<input
|
inputHtml += `<input
|
||||||
class="${inputClass} ${cssClasses}"
|
class="${inputClass} ${cssClasses}"
|
||||||
onChange="settingsChanged();${onChange}"
|
onChange="settingsChanged();${onChange}"
|
||||||
my-data-type="${dataType}"
|
onfocusout="${focusout}"
|
||||||
my-customparams="${customParams}"
|
my-data-type="${dataType}"
|
||||||
my-customid="${customId}"
|
my-customparams="${customParams}"
|
||||||
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
my-base64Regex="${base64Regex}"
|
my-base64Regex="${base64Regex}"
|
||||||
id="${setKey}${suffix}"
|
id="${setKey}${suffix}"
|
||||||
type="${inputType}"
|
type="${inputType}"
|
||||||
value="${val}"
|
value="${val}"
|
||||||
${readOnly}
|
${readOnly}
|
||||||
${checked}
|
${checked}
|
||||||
placeholder="${placeholder}"
|
placeholder="${placeholder}"
|
||||||
/>`;
|
/>`;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'button':
|
case 'button':
|
||||||
inputHtml += `<button
|
inputHtml += `<button
|
||||||
class="btn btn-primary ${cssClasses}"
|
class="btn btn-primary ${cssClasses}"
|
||||||
my-customparams="${customParams}"
|
my-customparams="${customParams}"
|
||||||
my-customid="${customId}"
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
my-input-from="${sourceIds}"
|
my-input-from="${sourceIds}"
|
||||||
my-input-to="${setKey}"
|
my-input-to="${setKey}"
|
||||||
data-elementoptionsbase64="${elementOptionsBase64}"
|
data-elementoptionsbase64="${elementOptionsBase64}"
|
||||||
onclick="${onClick}">
|
onclick="${onClick}">
|
||||||
${getString(getStringKey)}
|
${getString(getStringKey)}
|
||||||
@@ -1214,21 +1240,23 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
inputHtml += `<textarea
|
inputHtml += `<textarea
|
||||||
class="form-control input"
|
class="form-control input"
|
||||||
my-customparams="${customParams}"
|
onChange="settingsChanged();${onChange}"
|
||||||
my-customid="${customId}"
|
onfocusout="${focusout}"
|
||||||
|
my-customparams="${customParams}"
|
||||||
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
my-data-type="${dataType}"
|
my-data-type="${dataType}"
|
||||||
id="${setKey}"
|
id="${setKey}"
|
||||||
${readOnly}>${val}</textarea>`;
|
${readOnly}>${val}</textarea>`;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'span':
|
case 'span':
|
||||||
inputHtml += `<span
|
inputHtml += `<span
|
||||||
class="${cssClasses}"
|
class="${cssClasses}"
|
||||||
my-data-type="${dataType}"
|
my-data-type="${dataType}"
|
||||||
my-customparams="${customParams}"
|
my-customparams="${customParams}"
|
||||||
my-customid="${customId}"
|
my-customid="${customId}"
|
||||||
my-originalSetKey="${originalSetKey}"
|
my-originalSetKey="${originalSetKey}"
|
||||||
onclick="${onClick}">
|
onclick="${onClick}">
|
||||||
@@ -1264,13 +1292,13 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
columnSetting["setOptions"] = getSetting(column.optionsOverride.replace("setting.",""));
|
columnSetting["setOptions"] = getSetting(column.optionsOverride.replace("setting.",""));
|
||||||
} else {
|
} else {
|
||||||
columnSetting["setOptions"] = column.optionsOverride;
|
columnSetting["setOptions"] = column.optionsOverride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
columnSettings.push(columnSetting)
|
columnSettings.push(columnSetting)
|
||||||
|
|
||||||
// helper for if val is empty
|
// helper for if val is empty
|
||||||
emptyVal.push('');
|
emptyVal.push('');
|
||||||
});
|
});
|
||||||
datatableHtml += '</tr></thead>';
|
datatableHtml += '</tr></thead>';
|
||||||
|
|
||||||
@@ -1290,7 +1318,7 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
let index = 0;
|
let index = 0;
|
||||||
val.forEach(rowData => {
|
val.forEach(rowData => {
|
||||||
datatableHtml += `<tr my-index="${index}">`;
|
datatableHtml += `<tr my-index="${index}">`;
|
||||||
|
|
||||||
let j = 0;
|
let j = 0;
|
||||||
columnSettings.forEach(set => {
|
columnSettings.forEach(set => {
|
||||||
// Extract the value for the current column based on the new structure
|
// Extract the value for the current column based on the new structure
|
||||||
@@ -1300,11 +1328,11 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
{
|
{
|
||||||
columnOverrideValue = ""
|
columnOverrideValue = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create unique key to prevent dropdown data duplication
|
// Create unique key to prevent dropdown data duplication
|
||||||
const oldKey = set["setKey"];
|
const oldKey = set["setKey"];
|
||||||
set["setKey"] = oldKey + "_" + index;
|
set["setKey"] = oldKey + "_" + index;
|
||||||
|
|
||||||
// Generate the cell HTML using the extracted value
|
// Generate the cell HTML using the extracted value
|
||||||
const cellHtml = generateFormHtml(
|
const cellHtml = generateFormHtml(
|
||||||
settingsData,
|
settingsData,
|
||||||
@@ -1314,17 +1342,17 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
oldKey
|
oldKey
|
||||||
);
|
);
|
||||||
datatableHtml += `<td> <div class="input-group"> ${cellHtml} </div></td>`;
|
datatableHtml += `<td> <div class="input-group"> ${cellHtml} </div></td>`;
|
||||||
|
|
||||||
// Restore the original key
|
// Restore the original key
|
||||||
set["setKey"] = oldKey;
|
set["setKey"] = oldKey;
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
});
|
});
|
||||||
datatableHtml += '</tr>';
|
datatableHtml += '</tr>';
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
datatableHtml += '</tbody></table>';
|
datatableHtml += '</tbody></table>';
|
||||||
|
|
||||||
inputHtml += datatableHtml;
|
inputHtml += datatableHtml;
|
||||||
@@ -1347,8 +1375,8 @@ function generateFormHtml(settingsData, set, overrideValue, overrideOptions, ori
|
|||||||
|
|
||||||
// Generate event HTML if applicable
|
// Generate event HTML if applicable
|
||||||
let eventsHtml = '';
|
let eventsHtml = '';
|
||||||
|
|
||||||
const eventsList = createArray(set['setEvents']);
|
const eventsList = createArray(set['setEvents']);
|
||||||
// inline buttons events
|
// inline buttons events
|
||||||
if (eventsList.length > 0) {
|
if (eventsList.length > 0) {
|
||||||
eventsList.forEach(event => {
|
eventsList.forEach(event => {
|
||||||
@@ -1387,7 +1415,7 @@ if (eventsList.length > 0) {
|
|||||||
data-myparam-setkey="${setKey}"
|
data-myparam-setkey="${setKey}"
|
||||||
data-myparam="${setKey}"
|
data-myparam="${setKey}"
|
||||||
data-myparam-plugin="${setKey.split('_')[0] || ''}"
|
data-myparam-plugin="${setKey.split('_')[0] || ''}"
|
||||||
data-myevent="${event}"
|
data-myevent="${event}"
|
||||||
onclick="execute_settingEvent(this)">
|
onclick="execute_settingEvent(this)">
|
||||||
<i title="${getString(event + "_event_tooltip")}" class="fa ${eventIcon}"></i>
|
<i title="${getString(event + "_event_tooltip")}" class="fa ${eventIcon}"></i>
|
||||||
</span>`;
|
</span>`;
|
||||||
@@ -1406,15 +1434,15 @@ function getSetObject(settingsData, setKey) {
|
|||||||
result = ""
|
result = ""
|
||||||
|
|
||||||
settingsData.forEach(function(set) {
|
settingsData.forEach(function(set) {
|
||||||
|
|
||||||
if (set.setKey == setKey) {
|
if (set.setKey == setKey) {
|
||||||
// console.log(set);
|
// console.log(set);
|
||||||
|
|
||||||
result = set;
|
result = set;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(result == "")
|
if(result == "")
|
||||||
@@ -1439,7 +1467,7 @@ function collectTableData(tableSelector) {
|
|||||||
|
|
||||||
cells.each((index, cell) => {
|
cells.each((index, cell) => {
|
||||||
const input = $(cell).find('input, select, textarea');
|
const input = $(cell).find('input, select, textarea');
|
||||||
|
|
||||||
if (input.length) {
|
if (input.length) {
|
||||||
if (input.attr('type') === 'checkbox') {
|
if (input.attr('type') === 'checkbox') {
|
||||||
// For checkboxes, check if they are checked
|
// For checkboxes, check if they are checked
|
||||||
@@ -1455,10 +1483,10 @@ function collectTableData(tableSelector) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
tableData.push(rowData);
|
tableData.push(rowData);
|
||||||
});
|
});
|
||||||
|
|
||||||
return tableData;
|
return tableData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* -----------------------------------------------------------------------------
|
/* -----------------------------------------------------------------------------
|
||||||
* NetAlertX
|
* NetAlertX
|
||||||
* Open Source Network Guard / WIFI & LAN intrusion detector
|
* Open Source Network Guard / WIFI & LAN intrusion detector
|
||||||
*
|
*
|
||||||
* ui_components.js - Front module. Common UI components
|
* ui_components.js - Front module. Common UI components
|
||||||
*-------------------------------------------------------------------------------
|
*-------------------------------------------------------------------------------
|
||||||
@@ -56,7 +56,7 @@ function getRandomBytes(elem, length) {
|
|||||||
window.crypto.getRandomValues(array);
|
window.crypto.getRandomValues(array);
|
||||||
|
|
||||||
// Convert bytes to hexadecimal string
|
// Convert bytes to hexadecimal string
|
||||||
let hexString = Array.from(array, byte =>
|
let hexString = Array.from(array, byte =>
|
||||||
byte.toString(16).padStart(2, '0')
|
byte.toString(16).padStart(2, '0')
|
||||||
).join('');
|
).join('');
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ function getRandomBytes(elem, length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// Updates the icon preview
|
// Updates the icon preview
|
||||||
function updateAllIconPreviews() {
|
function updateAllIconPreviews() {
|
||||||
$(".iconInputVal").each((index, el)=>{
|
$(".iconInputVal").each((index, el)=>{
|
||||||
updateIconPreview(el)
|
updateIconPreview(el)
|
||||||
@@ -79,7 +79,7 @@ function updateAllIconPreviews() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------
|
// ----------------------------------------------
|
||||||
// Updates the icon preview
|
// Updates the icon preview
|
||||||
function updateIconPreview(elem) {
|
function updateIconPreview(elem) {
|
||||||
|
|
||||||
const previewSpan = $(elem).parent().find(".iconPreview");
|
const previewSpan = $(elem).parent().find(".iconPreview");
|
||||||
@@ -97,7 +97,7 @@ function updateIconPreview(elem) {
|
|||||||
previewSpan.html(atob(newValue));
|
previewSpan.html(atob(newValue));
|
||||||
});
|
});
|
||||||
return; // Stop retrying if successful
|
return; // Stop retrying if successful
|
||||||
}
|
}
|
||||||
|
|
||||||
attempts++;
|
attempts++;
|
||||||
if (attempts < 10) {
|
if (attempts < 10) {
|
||||||
@@ -119,9 +119,9 @@ function validateRegex(elem) {
|
|||||||
const iconSpan = $(elem).parent().find(".validityCheck");
|
const iconSpan = $(elem).parent().find(".validityCheck");
|
||||||
const inputElem = $(elem);
|
const inputElem = $(elem);
|
||||||
const regexTmp = atob($(inputElem).attr("my-base64Regex")); // Decode base64 regex
|
const regexTmp = atob($(inputElem).attr("my-base64Regex")); // Decode base64 regex
|
||||||
|
|
||||||
const regex = new RegExp(regexTmp); // Convert to a valid RegExp object
|
const regex = new RegExp(regexTmp); // Convert to a valid RegExp object
|
||||||
|
|
||||||
let attempts = 0;
|
let attempts = 0;
|
||||||
|
|
||||||
function tryUpdateValidityResultIcon() {
|
function tryUpdateValidityResultIcon() {
|
||||||
@@ -140,8 +140,11 @@ function validateRegex(elem) {
|
|||||||
// Validate against regex
|
// Validate against regex
|
||||||
if (regex.test(value)) {
|
if (regex.test(value)) {
|
||||||
iconSpan.html("<i class='fa fa-check'></i>");
|
iconSpan.html("<i class='fa fa-check'></i>");
|
||||||
|
inputElem.attr("data-is-valid", "1");
|
||||||
} else {
|
} else {
|
||||||
iconSpan.html("<i class='fa fa-xmark'></i>");
|
iconSpan.html("<i class='fa fa-xmark'></i>");
|
||||||
|
showModalOk('WARNING', getString("Gen_Invalid_Value"));
|
||||||
|
inputElem.attr("data-is-valid", "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,7 +178,7 @@ function initializeiCheck () {
|
|||||||
increaseArea: '20%'
|
increaseArea: '20%'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -206,7 +209,7 @@ function copyToClipboard(buttonElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Simple Sortable Table columns
|
// Simple Sortable Table columns
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Function to handle column sorting when a user clicks on a table header
|
// Function to handle column sorting when a user clicks on a table header
|
||||||
@@ -268,9 +271,9 @@ function ipToNum(ip) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// handling events
|
// handling events
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
modalEventStatusId = 'modal-message-front-event'
|
modalEventStatusId = 'modal-message-front-event'
|
||||||
|
|
||||||
@@ -301,41 +304,41 @@ function execute_settingEvent(element) {
|
|||||||
updateModalState()
|
updateModalState()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else if (["add_option"].includes(feEvent)) {
|
} else if (["add_option"].includes(feEvent)) {
|
||||||
showModalFieldInput (
|
showModalFieldInput (
|
||||||
'<i class="fa fa-square-plus pointer"></i> ' + getString('Gen_Add'),
|
'<i class="fa fa-square-plus pointer"></i> ' + getString('Gen_Add'),
|
||||||
getString('Gen_Add'),
|
getString('Gen_Add'),
|
||||||
getString('Gen_Cancel'),
|
getString('Gen_Cancel'),
|
||||||
getString('Gen_Okay'),
|
getString('Gen_Okay'),
|
||||||
'', // curValue
|
'', // curValue
|
||||||
'addOptionFromModalInput',
|
'addOptionFromModalInput',
|
||||||
feSourceId // triggered by id
|
feSourceId // triggered by id
|
||||||
);
|
);
|
||||||
} else if (["add_icon"].includes(feEvent)) {
|
} else if (["add_icon"].includes(feEvent)) {
|
||||||
|
|
||||||
// Add new icon as base64 string
|
// Add new icon as base64 string
|
||||||
showModalInput (
|
showModalInput (
|
||||||
'<i class="fa fa-square-plus pointer"></i> ' + getString('DevDetail_button_AddIcon'),
|
'<i class="fa fa-square-plus pointer"></i> ' + getString('DevDetail_button_AddIcon'),
|
||||||
getString('DevDetail_button_AddIcon_Help'),
|
getString('DevDetail_button_AddIcon_Help'),
|
||||||
getString('Gen_Cancel'),
|
getString('Gen_Cancel'),
|
||||||
getString('Gen_Okay'),
|
getString('Gen_Okay'),
|
||||||
() => addIconAsBase64(element), // Wrap in an arrow function
|
() => addIconAsBase64(element), // Wrap in an arrow function
|
||||||
feSourceId // triggered by id
|
feSourceId // triggered by id
|
||||||
);
|
);
|
||||||
} else if (["select_icon"].includes(feEvent)) {
|
} else if (["select_icon"].includes(feEvent)) {
|
||||||
|
|
||||||
showIconSelection(feSetKey)
|
showIconSelection(feSetKey)
|
||||||
// myparam-setkey
|
// myparam-setkey
|
||||||
|
|
||||||
} else if (["copy_icons"].includes(feEvent)) {
|
} else if (["copy_icons"].includes(feEvent)) {
|
||||||
|
|
||||||
// Ask overwrite icon types
|
// Ask overwrite icon types
|
||||||
showModalWarning (
|
showModalWarning (
|
||||||
getString('DevDetail_button_OverwriteIcons'),
|
getString('DevDetail_button_OverwriteIcons'),
|
||||||
getString('DevDetail_button_OverwriteIcons_Warning'),
|
getString('DevDetail_button_OverwriteIcons_Warning'),
|
||||||
getString('Gen_Cancel'),
|
getString('Gen_Cancel'),
|
||||||
getString('Gen_Okay'),
|
getString('Gen_Okay'),
|
||||||
'overwriteIconType',
|
'overwriteIconType',
|
||||||
feSourceId // triggered by id
|
feSourceId // triggered by id
|
||||||
);
|
);
|
||||||
@@ -343,30 +346,30 @@ function execute_settingEvent(element) {
|
|||||||
|
|
||||||
goToDevice(feValue);
|
goToDevice(feValue);
|
||||||
} else if (["go_to_node"].includes(feEvent)) {
|
} else if (["go_to_node"].includes(feEvent)) {
|
||||||
|
|
||||||
goToNetworkNode(feValue);
|
goToNetworkNode(feValue);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.warn(`🔺Not implemented: ${feEvent}`)
|
console.warn(`🔺Not implemented: ${feEvent}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Go to the correct network node in the Network section
|
// Go to the correct network node in the Network section
|
||||||
function overwriteIconType()
|
function overwriteIconType()
|
||||||
{
|
{
|
||||||
const mac = getMac();
|
const mac = getMac();
|
||||||
|
|
||||||
if (!isValidMac(mac)) {
|
if (!isValidMac(mac)) {
|
||||||
showModalOK("Error", getString("Gen_InvalidMac"))
|
showModalOK("Error", getString("Gen_InvalidMac"))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct SQL query
|
// Construct SQL query
|
||||||
const rawSql = `
|
const rawSql = `
|
||||||
UPDATE Devices
|
UPDATE Devices
|
||||||
SET devIcon = (
|
SET devIcon = (
|
||||||
SELECT devIcon FROM Devices WHERE devMac = "${mac}"
|
SELECT devIcon FROM Devices WHERE devMac = "${mac}"
|
||||||
)
|
)
|
||||||
@@ -391,24 +394,24 @@ function overwriteIconType()
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Go to the correct network node in the Network section
|
// Go to the correct network node in the Network section
|
||||||
function goToNetworkNode(mac)
|
function goToNetworkNode(mac)
|
||||||
{
|
{
|
||||||
setCache('activeNetworkTab', mac.replaceAll(":","_")+'_id');
|
setCache('activeNetworkTab', mac.replaceAll(":","_")+'_id');
|
||||||
window.location.href = './network.php';
|
window.location.href = './network.php';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Go to the device
|
// Go to the device
|
||||||
function goToDevice(mac, newtab = false) {
|
function goToDevice(mac, newtab = false) {
|
||||||
const url = './deviceDetails.php?mac=' + encodeURIComponent(mac);
|
const url = './deviceDetails.php?mac=' + encodeURIComponent(mac);
|
||||||
|
|
||||||
if (newtab) {
|
if (newtab) {
|
||||||
window.open(url, '_blank');
|
window.open(url, '_blank');
|
||||||
} else {
|
} else {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// Updating the execution queue in in modal pop-up
|
// Updating the execution queue in in modal pop-up
|
||||||
@@ -437,7 +440,7 @@ function updateModalState() {
|
|||||||
function addOptionFromModalInput() {
|
function addOptionFromModalInput() {
|
||||||
var inputVal = $(`#modal-field-input-field`).val();
|
var inputVal = $(`#modal-field-input-field`).val();
|
||||||
console.log($('#modal-field-input-field'));
|
console.log($('#modal-field-input-field'));
|
||||||
|
|
||||||
var triggeredBy = $('#modal-field-input').attr("data-myparam-triggered-by");
|
var triggeredBy = $('#modal-field-input').attr("data-myparam-triggered-by");
|
||||||
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
||||||
|
|
||||||
@@ -475,16 +478,16 @@ function addIconAsBase64 (el) {
|
|||||||
|
|
||||||
|
|
||||||
console.log($('#modal-field-input-field'));
|
console.log($('#modal-field-input-field'));
|
||||||
|
|
||||||
var triggeredBy = $('#modal-input').attr("data-myparam-triggered-by");
|
var triggeredBy = $('#modal-input').attr("data-myparam-triggered-by");
|
||||||
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
||||||
|
|
||||||
// $('#'+targetId).val(iconHtmlBase64);
|
// $('#'+targetId).val(iconHtmlBase64);
|
||||||
|
|
||||||
// Add new option and set it as selected
|
// Add new option and set it as selected
|
||||||
$('#' + targetId).append(new Option(iconHtmlBase64, iconHtmlBase64)).val(iconHtmlBase64);
|
$('#' + targetId).append(new Option(iconHtmlBase64, iconHtmlBase64)).val(iconHtmlBase64);
|
||||||
|
|
||||||
updateIconPreview(el)
|
updateIconPreview(el)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,8 +525,8 @@ function showIconSelection(setKey) {
|
|||||||
// Populate the icon list
|
// Populate the icon list
|
||||||
Array.from(selectElement.options).forEach(option => {
|
Array.from(selectElement.options).forEach(option => {
|
||||||
if (option.value != "") {
|
if (option.value != "") {
|
||||||
|
|
||||||
|
|
||||||
const value = option.value;
|
const value = option.value;
|
||||||
|
|
||||||
// Decode the base64 value
|
// Decode the base64 value
|
||||||
@@ -566,7 +569,7 @@ function showIconSelection(setKey) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -661,7 +664,7 @@ function getRelationshipConf(relType) {
|
|||||||
// --color-red: #dd4b39;
|
// --color-red: #dd4b39;
|
||||||
|
|
||||||
switch (relType) {
|
switch (relType) {
|
||||||
|
|
||||||
case "child":
|
case "child":
|
||||||
color = "#f39c12"; // yellow
|
color = "#f39c12"; // yellow
|
||||||
cssClass = "text-yellow";
|
cssClass = "text-yellow";
|
||||||
@@ -673,11 +676,11 @@ function getRelationshipConf(relType) {
|
|||||||
case "virtual":
|
case "virtual":
|
||||||
color = "#0060df"; // blue
|
color = "#0060df"; // blue
|
||||||
cssClass = "text-blue";
|
cssClass = "text-blue";
|
||||||
break;
|
break;
|
||||||
case "logical":
|
case "logical":
|
||||||
color = "#00a65a"; // green
|
color = "#00a65a"; // green
|
||||||
cssClass = "text-green";
|
cssClass = "text-green";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
color = "#5B5B66"; // grey
|
color = "#5B5B66"; // grey
|
||||||
cssClass = "text-light-grey";
|
cssClass = "text-light-grey";
|
||||||
@@ -703,13 +706,13 @@ function initSelect2() {
|
|||||||
// check if cache ready
|
// check if cache ready
|
||||||
if(isValidJSON(devicesListAll_JSON))
|
if(isValidJSON(devicesListAll_JSON))
|
||||||
{
|
{
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
//Initialize Select2 Elements and make them sortable
|
//Initialize Select2 Elements and make them sortable
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
// Iterate over each Select2 dropdown
|
// Iterate over each Select2 dropdown
|
||||||
$('.select2').each(function() {
|
$('.select2').each(function() {
|
||||||
// handle Device chips, if my-transformers="deviceChip"
|
// handle Device chips, if my-transformers="deviceChip"
|
||||||
if($(this).attr("my-transformers") == "deviceChip")
|
if($(this).attr("my-transformers") == "deviceChip")
|
||||||
{
|
{
|
||||||
@@ -721,7 +724,7 @@ function initSelect2() {
|
|||||||
return m; // Allow HTML
|
return m; // Allow HTML
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if($(this).attr("my-transformers") == "deviceRelType") // handling dropdown for relationships
|
} else if($(this).attr("my-transformers") == "deviceRelType") // handling dropdown for relationships
|
||||||
{
|
{
|
||||||
var selectEl = $(this).select2({
|
var selectEl = $(this).select2({
|
||||||
@@ -730,26 +733,26 @@ function initSelect2() {
|
|||||||
if (!data.id) return data.text; // default for placeholder etc.
|
if (!data.id) return data.text; // default for placeholder etc.
|
||||||
|
|
||||||
const relConf = getRelationshipConf(data.text);
|
const relConf = getRelationshipConf(data.text);
|
||||||
|
|
||||||
// Custom HTML
|
// Custom HTML
|
||||||
const html = $(`
|
const html = $(`
|
||||||
<span class="custom-chip ${relConf.cssClass}" >
|
<span class="custom-chip ${relConf.cssClass}" >
|
||||||
${data.text}
|
${data.text}
|
||||||
</span>
|
</span>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
escapeMarkup: function (m) {
|
escapeMarkup: function (m) {
|
||||||
return m; // Allow HTML
|
return m; // Allow HTML
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} else // default handling - default template
|
} else // default handling - default template
|
||||||
{
|
{
|
||||||
var selectEl = $(this).select2();
|
var selectEl = $(this).select2();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply sortable functionality to the dropdown's dropdown-container
|
// Apply sortable functionality to the dropdown's dropdown-container
|
||||||
selectEl.next().children().children().children().sortable({
|
selectEl.next().children().children().children().sortable({
|
||||||
containment: 'parent',
|
containment: 'parent',
|
||||||
@@ -757,14 +760,14 @@ function initSelect2() {
|
|||||||
var sortedValues = $(this).children().map(function() {
|
var sortedValues = $(this).children().map(function() {
|
||||||
return $(this).attr('title');
|
return $(this).attr('title');
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
var sortedOptions = selectEl.find('option').sort(function(a, b) {
|
var sortedOptions = selectEl.find('option').sort(function(a, b) {
|
||||||
return sortedValues.indexOf($(a).text()) - sortedValues.indexOf($(b).text());
|
return sortedValues.indexOf($(a).text()) - sortedValues.indexOf($(b).text());
|
||||||
});
|
});
|
||||||
|
|
||||||
// Replace all options in selectEl
|
// Replace all options in selectEl
|
||||||
selectEl.empty().append(sortedOptions);
|
selectEl.empty().append(sortedOptions);
|
||||||
|
|
||||||
// Trigger change event on Select2
|
// Trigger change event on Select2
|
||||||
selectEl.trigger('change');
|
selectEl.trigger('change');
|
||||||
}
|
}
|
||||||
@@ -776,7 +779,7 @@ function initSelect2() {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
initSelect2()
|
initSelect2()
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------
|
// ------------------------------------------
|
||||||
@@ -816,7 +819,7 @@ function renderDeviceLink(data, container, useName = false) {
|
|||||||
'data-alert': device.devAlertDown,
|
'data-alert': device.devAlertDown,
|
||||||
'data-icon': device.devIcon
|
'data-icon': device.devIcon
|
||||||
});
|
});
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<a href="${badge.url}" target="_blank">
|
<a href="${badge.url}" target="_blank">
|
||||||
<span class="custom-chip">
|
<span class="custom-chip">
|
||||||
@@ -866,7 +869,7 @@ function initHoverNodeInfo() {
|
|||||||
$(document).on('mouseenter', '.hover-node-info', function (e) {
|
$(document).on('mouseenter', '.hover-node-info', function (e) {
|
||||||
const $el = $(this);
|
const $el = $(this);
|
||||||
lastTarget = this;
|
lastTarget = this;
|
||||||
|
|
||||||
// use timeout to prevent a quick hover and exit toi flash a card when navigating to a target node with your mouse
|
// use timeout to prevent a quick hover and exit toi flash a card when navigating to a target node with your mouse
|
||||||
clearTimeout(hoverTimeout);
|
clearTimeout(hoverTimeout);
|
||||||
|
|
||||||
@@ -893,25 +896,25 @@ function initHoverNodeInfo() {
|
|||||||
<div class="line">
|
<div class="line">
|
||||||
<b>Status:</b> <span>${status}</span><br>
|
<b>Status:</b> <span>${status}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>IP:</b> <span>${ip}</span><br>
|
<b>IP:</b> <span>${ip}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>MAC:</b> <span>${mac}</span><br>
|
<b>MAC:</b> <span>${mac}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>Vendor:</b> <span>${vendor}</span><br>
|
<b>Vendor:</b> <span>${vendor}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>Type:</b> <span>${type}</span><br>
|
<b>Type:</b> <span>${type}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>First seen:</b> <span>${firstseen}</span><br>
|
<b>First seen:</b> <span>${firstseen}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>Last seen:</b> <span>${lastseen}</span><br>
|
<b>Last seen:</b> <span>${lastseen}</span><br>
|
||||||
</div>
|
</div>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<b>Relationship:</b> <span class="${getRelationshipConf(relationship).cssClass}">${relationship}</span>
|
<b>Relationship:</b> <span class="${getRelationshipConf(relationship).cssClass}">${relationship}</span>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@@ -18,19 +18,19 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="deviceSelector col-md-11 col-sm-11" style="z-index:5">
|
<div class="deviceSelector col-md-11 col-sm-11" style="z-index:5">
|
||||||
<div class="db_info_table_row col-sm-12" >
|
<div class="db_info_table_row col-sm-12" >
|
||||||
<div class="form-group" >
|
<div class="form-group" >
|
||||||
<div class="input-group col-sm-12 " >
|
<div class="input-group col-sm-12 " >
|
||||||
<select class="form-control select2 select2-hidden-accessible" multiple="" style="width: 100%;" tabindex="-1" aria-hidden="true">
|
<select class="form-control select2 select2-hidden-accessible" multiple="" style="width: 100%;" tabindex="-1" aria-hidden="true">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1 hoverHighlight">
|
<div class="col-md-1 hoverHighlight">
|
||||||
<i class="fa-solid fa-circle-check hoverHighlight pointer" onclick="markAllSelected()" title="<?= lang('Gen_Add_All');?>"></i>
|
<i class="fa-solid fa-circle-check hoverHighlight pointer" onclick="markAllSelected()" title="<?= lang('Gen_Add_All');?>"></i>
|
||||||
<i class="fa-solid fa-circle-xmark hoverHighlight pointer" onclick="markAllNotSelected()" title="<?= lang('Gen_Remove_All');?>"></i>
|
<i class="fa-solid fa-circle-xmark hoverHighlight pointer" onclick="markAllNotSelected()" title="<?= lang('Gen_Remove_All');?>"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -69,19 +69,19 @@
|
|||||||
|
|
||||||
|
|
||||||
<script defer>
|
<script defer>
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Get plugin and settings data from API endpoints
|
// Get plugin and settings data from API endpoints
|
||||||
function getData(){
|
function getData(){
|
||||||
|
|
||||||
// some race condition, need to implement delay
|
// some race condition, need to implement delay
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$.get('php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(res) {
|
$.get('php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(res) {
|
||||||
|
|
||||||
settingsData = res["data"];
|
settingsData = res["data"];
|
||||||
|
|
||||||
excludedColumns = ["NEWDEV_devMac", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection", "NEWDEV_devLastNotification", "NEWDEV_devScan", "NEWDEV_devPresentLastScan", "NEWDEV_devCustomProps", "NEWDEV_devChildrenNicsDynamic", "NEWDEV_devChildrenDynamic" ]
|
excludedColumns = ["NEWDEV_devMac", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection", "NEWDEV_devLastNotification", "NEWDEV_devScan", "NEWDEV_devPresentLastScan", "NEWDEV_devCustomProps", "NEWDEV_devChildrenNicsDynamic", "NEWDEV_devChildrenDynamic" ]
|
||||||
|
|
||||||
const relevantColumns = settingsData.filter(set =>
|
const relevantColumns = settingsData.filter(set =>
|
||||||
set.setGroup === "NEWDEV" &&
|
set.setGroup === "NEWDEV" &&
|
||||||
set.setKey.includes("_dev") &&
|
set.setKey.includes("_dev") &&
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
// Append form groups to the column
|
// Append form groups to the column
|
||||||
for (let j = i * elementsPerColumn; j < Math.min((i + 1) * elementsPerColumn, multiEditColumns.length); j++) {
|
for (let j = i * elementsPerColumn; j < Math.min((i + 1) * elementsPerColumn, multiEditColumns.length); j++) {
|
||||||
|
|
||||||
const setTypeObject = JSON.parse(multiEditColumns[j].setType.replace(/'/g, '"'));
|
const setTypeObject = JSON.parse(multiEditColumns[j].setType.replace(/'/g, '"'));
|
||||||
|
|
||||||
// get the element with the input value(s)
|
// get the element with the input value(s)
|
||||||
let elements = setTypeObject.elements.filter(element => element.elementHasInputValue === 1);
|
let elements = setTypeObject.elements.filter(element => element.elementHasInputValue === 1);
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
const { elementType, elementOptions = [], transformers = [] } = elementWithInputValue;
|
||||||
const {
|
const {
|
||||||
inputType,
|
inputType,
|
||||||
readOnly,
|
readOnly,
|
||||||
isMultiSelect,
|
isMultiSelect,
|
||||||
@@ -137,10 +137,11 @@
|
|||||||
customId,
|
customId,
|
||||||
columns,
|
columns,
|
||||||
base64Regex,
|
base64Regex,
|
||||||
elementOptionsBase64
|
elementOptionsBase64,
|
||||||
|
focusout
|
||||||
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
} = handleElementOptions('none', elementOptions, transformers, val = "");
|
||||||
|
|
||||||
// render based on element type
|
// render based on element type
|
||||||
if (elementType === 'select') {
|
if (elementType === 'select') {
|
||||||
|
|
||||||
targetLocation = multiEditColumns[j].setKey + "_generateSetOptions"
|
targetLocation = multiEditColumns[j].setKey + "_generateSetOptions"
|
||||||
@@ -148,7 +149,7 @@
|
|||||||
generateOptionsOrSetOptions(multiEditColumns[j].setKey, [], targetLocation, generateOptions, null)
|
generateOptionsOrSetOptions(multiEditColumns[j].setKey, [], targetLocation, generateOptions, null)
|
||||||
|
|
||||||
console.log(multiEditColumns[j].setKey)
|
console.log(multiEditColumns[j].setKey)
|
||||||
// Handle Icons as they need a preview
|
// Handle Icons as they need a preview
|
||||||
if(multiEditColumns[j].setKey == 'NEWDEV_devIcon')
|
if(multiEditColumns[j].setKey == 'NEWDEV_devIcon')
|
||||||
{
|
{
|
||||||
input = `
|
input = `
|
||||||
@@ -157,37 +158,37 @@
|
|||||||
onChange="updateIconPreview(this)"
|
onChange="updateIconPreview(this)"
|
||||||
my-customparams="NEWDEV_devIcon,NEWDEV_devIcon_preview"
|
my-customparams="NEWDEV_devIcon,NEWDEV_devIcon_preview"
|
||||||
id="${multiEditColumns[j].setKey}"
|
id="${multiEditColumns[j].setKey}"
|
||||||
data-my-column="${multiEditColumns[j].setKey}"
|
data-my-column="${multiEditColumns[j].setKey}"
|
||||||
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}" >
|
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}" >
|
||||||
<option id="${targetLocation}"></option>
|
<option id="${targetLocation}"></option>
|
||||||
</select>`
|
</select>`
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
|
|
||||||
input = `<select class="form-control"
|
input = `<select class="form-control"
|
||||||
id="${multiEditColumns[j].setKey}"
|
id="${multiEditColumns[j].setKey}"
|
||||||
data-my-column="${multiEditColumns[j].setKey}"
|
data-my-column="${multiEditColumns[j].setKey}"
|
||||||
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}" >
|
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}" >
|
||||||
<option id="${targetLocation}"></option>
|
<option id="${targetLocation}"></option>
|
||||||
</select>`
|
</select>`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (elementType === 'input'){
|
} else if (elementType === 'input'){
|
||||||
|
|
||||||
// Add classes specifically for checkboxes
|
// Add classes specifically for checkboxes
|
||||||
inputType === 'checkbox' ? inputClass = 'checkbox' : inputClass = 'form-control';
|
inputType === 'checkbox' ? inputClass = 'checkbox' : inputClass = 'form-control';
|
||||||
|
|
||||||
|
|
||||||
input = `<input class="${inputClass}"
|
|
||||||
id="${multiEditColumns[j].setKey}"
|
input = `<input class="${inputClass}"
|
||||||
my-customid="${multiEditColumns[j].setKey}"
|
id="${multiEditColumns[j].setKey}"
|
||||||
data-my-column="${multiEditColumns[j].setKey}"
|
my-customid="${multiEditColumns[j].setKey}"
|
||||||
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}"
|
data-my-column="${multiEditColumns[j].setKey}"
|
||||||
|
data-my-targetColumns="${multiEditColumns[j].setKey.replace('NEWDEV_','')}"
|
||||||
type="${inputType}">`
|
type="${inputType}">`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const inputEntry = `<div class="form-group col-sm-12" >
|
const inputEntry = `<div class="form-group col-sm-12" >
|
||||||
<label class="col-sm-3 control-label">${multiEditColumns[j].setName}</label>
|
<label class="col-sm-3 control-label">${multiEditColumns[j].setName}</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
@@ -200,7 +201,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>`
|
</div>`
|
||||||
|
|
||||||
|
|
||||||
column.append(inputEntry);
|
column.append(inputEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,11 +216,11 @@
|
|||||||
initSelect2();
|
initSelect2();
|
||||||
initDeviceSelectors();
|
initDeviceSelectors();
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -262,10 +263,10 @@
|
|||||||
var option = new Option($('.deviceSelector select option[value="' + mac + '"]').html(), mac, true, true);
|
var option = new Option($('.deviceSelector select option[value="' + mac + '"]').html(), mac, true, true);
|
||||||
|
|
||||||
$('.deviceSelector select').append(option).trigger('change');
|
$('.deviceSelector select').append(option).trigger('change');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,7 +283,7 @@
|
|||||||
function markAllSelected() {
|
function markAllSelected() {
|
||||||
// Get the <select> element with the class 'deviceSelector'
|
// Get the <select> element with the class 'deviceSelector'
|
||||||
var selectElement = $('.deviceSelector select');
|
var selectElement = $('.deviceSelector select');
|
||||||
|
|
||||||
// Iterate over each option within the select element
|
// Iterate over each option within the select element
|
||||||
selectElement.find('option').each(function() {
|
selectElement.find('option').each(function() {
|
||||||
// Mark each option as selected
|
// Mark each option as selected
|
||||||
@@ -298,13 +299,13 @@
|
|||||||
function markAllNotSelected() {
|
function markAllNotSelected() {
|
||||||
// Get the <select> element with the class 'deviceSelector'
|
// Get the <select> element with the class 'deviceSelector'
|
||||||
var selectElement = $('.deviceSelector select');
|
var selectElement = $('.deviceSelector select');
|
||||||
|
|
||||||
// Iterate over each option within the select element
|
// Iterate over each option within the select element
|
||||||
selectElement.find('option').each(function() {
|
selectElement.find('option').each(function() {
|
||||||
// Unselect each option
|
// Unselect each option
|
||||||
$(this).prop('selected', false);
|
$(this).prop('selected', false);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Trigger the 'change' event to notify Bootstrap Select of the changes
|
// Trigger the 'change' event to notify Bootstrap Select of the changes
|
||||||
selectElement.trigger('change');
|
selectElement.trigger('change');
|
||||||
}
|
}
|
||||||
@@ -341,13 +342,13 @@
|
|||||||
|
|
||||||
// update selected
|
// update selected
|
||||||
if(selectorMacs() != "")
|
if(selectorMacs() != "")
|
||||||
{
|
{
|
||||||
executeAction('update', 'devMac', selectorMacs(), targetColumns, columnValue )
|
executeAction('update', 'devMac', selectorMacs(), targetColumns, columnValue )
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
showModalWarning(getString("Gen_Error"), getString('Device_MultiEdit_No_Devices'));
|
showModalWarning(getString("Gen_Error"), getString('Device_MultiEdit_No_Devices'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@@ -380,21 +381,21 @@ function executeAction(action, whereColumnName, key, targetColumns, newTargetCol
|
|||||||
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Ask to delete selected devices
|
// Ask to delete selected devices
|
||||||
function askDeleteSelectedDevices () {
|
function askDeleteSelectedDevices () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning(
|
showModalWarning(
|
||||||
getString('Maintenance_Tool_del_alldev_noti'),
|
getString('Maintenance_Tool_del_alldev_noti'),
|
||||||
getString('Gen_AreYouSure'),
|
getString('Gen_AreYouSure'),
|
||||||
getString('Gen_Cancel'),
|
getString('Gen_Cancel'),
|
||||||
getString('Gen_Delete'),
|
getString('Gen_Delete'),
|
||||||
'deleteSelectedDevices');
|
'deleteSelectedDevices');
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Delete selected devices
|
// Delete selected devices
|
||||||
function deleteSelectedDevices()
|
function deleteSelectedDevices()
|
||||||
{
|
{
|
||||||
macs_tmp = selectorMacs()
|
macs_tmp = selectorMacs()
|
||||||
executeAction('delete', 'devMac', macs_tmp )
|
executeAction('delete', 'devMac', macs_tmp )
|
||||||
write_notification('[Multi edit] Manually deleted devices with MACs:' + macs_tmp, 'info')
|
write_notification('[Multi edit] Manually deleted devices with MACs:' + macs_tmp, 'info')
|
||||||
|
|||||||
@@ -107,11 +107,11 @@
|
|||||||
"buttons": [
|
"buttons": [
|
||||||
{
|
{
|
||||||
"labelStringCode": "Maint_PurgeLog",
|
"labelStringCode": "Maint_PurgeLog",
|
||||||
"event": "logManage('crond.log', 'cleanLog')"
|
"event": "logManage('cron.log', 'cleanLog')"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"fileName": "crond.log",
|
"fileName": "cron.log",
|
||||||
"filePath": "__NETALERTX_LOG__/crond.log",
|
"filePath": "__NETALERTX_LOG__/cron.log",
|
||||||
"textAreaCssClass": "logs logs-small"
|
"textAreaCssClass": "logs logs-small"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -274,7 +274,7 @@ function cleanLog($logFile)
|
|||||||
|
|
||||||
$path = "";
|
$path = "";
|
||||||
|
|
||||||
$allowedFiles = ['app.log', 'app_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log', 'app.php_errors.log', 'execution_queue.log', 'db_is_locked.log', 'nginx-error.log', 'crond.log'];
|
$allowedFiles = ['app.log', 'app_front.log', 'IP_changes.log', 'stdout.log', 'stderr.log', 'app.php_errors.log', 'execution_queue.log', 'db_is_locked.log', 'nginx-error.log', 'cron.log'];
|
||||||
|
|
||||||
if(in_array($logFile, $allowedFiles))
|
if(in_array($logFile, $allowedFiles))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "تصفية",
|
"Gen_Filter": "تصفية",
|
||||||
"Gen_Generate": "إنشاء",
|
"Gen_Generate": "إنشاء",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "قاعدة البيانات مقفلة",
|
"Gen_LockedDB": "قاعدة البيانات مقفلة",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "غير متصل",
|
"Gen_Offline": "غير متصل",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtrar",
|
"Gen_Filter": "Filtrar",
|
||||||
"Gen_Generate": "Generar",
|
"Gen_Generate": "Generar",
|
||||||
"Gen_InvalidMac": "Mac address invàlida.",
|
"Gen_InvalidMac": "Mac address invàlida.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ERROR - DB podria estar bloquejada - Fes servir F12 Eines desenvolupament -> Consola o provar-ho més tard.",
|
"Gen_LockedDB": "ERROR - DB podria estar bloquejada - Fes servir F12 Eines desenvolupament -> Consola o provar-ho més tard.",
|
||||||
"Gen_NetworkMask": "Màscara de xarxa",
|
"Gen_NetworkMask": "Màscara de xarxa",
|
||||||
"Gen_Offline": "Fora de línia",
|
"Gen_Offline": "Fora de línia",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtr",
|
"Gen_Filter": "Filtr",
|
||||||
"Gen_Generate": "Vygenerovat",
|
"Gen_Generate": "Vygenerovat",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "CHYBA - Databáze je možná zamčená - Zkontrolujte F12 -> Nástroje pro vývojáře -> Konzole. nebo to zkuste později.",
|
"Gen_LockedDB": "CHYBA - Databáze je možná zamčená - Zkontrolujte F12 -> Nástroje pro vývojáře -> Konzole. nebo to zkuste později.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -315,6 +315,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "Generieren",
|
"Gen_Generate": "Generieren",
|
||||||
"Gen_InvalidMac": "Ungültige MAC-Adresse.",
|
"Gen_InvalidMac": "Ungültige MAC-Adresse.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ERROR - DB eventuell gesperrt - Nutze die Konsole in den Entwickler Werkzeugen (F12) zur Überprüfung oder probiere es später erneut.",
|
"Gen_LockedDB": "ERROR - DB eventuell gesperrt - Nutze die Konsole in den Entwickler Werkzeugen (F12) zur Überprüfung oder probiere es später erneut.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "Generate",
|
"Gen_Generate": "Generate",
|
||||||
"Gen_InvalidMac": "Invalid Mac address.",
|
"Gen_InvalidMac": "Invalid Mac address.",
|
||||||
|
"Gen_Invalid_Value": "An invalid value was entered",
|
||||||
"Gen_LockedDB": "ERROR - DB might be locked - Check F12 Dev tools -> Console or try later.",
|
"Gen_LockedDB": "ERROR - DB might be locked - Check F12 Dev tools -> Console or try later.",
|
||||||
"Gen_NetworkMask": "Network mask",
|
"Gen_NetworkMask": "Network mask",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -313,6 +313,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Generar",
|
"Gen_Generate": "Generar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "Fallo - La base de datos puede estar bloqueada - Pulsa F1 -> Ajustes de desarrolladores -> Consola o prueba más tarde.",
|
"Gen_LockedDB": "Fallo - La base de datos puede estar bloqueada - Pulsa F1 -> Ajustes de desarrolladores -> Consola o prueba más tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Desconectado",
|
"Gen_Offline": "Desconectado",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "",
|
"Gen_Filter": "",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "",
|
"Gen_LockedDB": "",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "",
|
"Gen_Offline": "",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtrer",
|
"Gen_Filter": "Filtrer",
|
||||||
"Gen_Generate": "Générer",
|
"Gen_Generate": "Générer",
|
||||||
"Gen_InvalidMac": "Adresse MAC invalide.",
|
"Gen_InvalidMac": "Adresse MAC invalide.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "Erreur - La base de données est peut-être verrouillée - Vérifier avec les outils de dév via F12 -> Console ou essayer plus tard.",
|
"Gen_LockedDB": "Erreur - La base de données est peut-être verrouillée - Vérifier avec les outils de dév via F12 -> Console ou essayer plus tard.",
|
||||||
"Gen_NetworkMask": "Masque réseau",
|
"Gen_NetworkMask": "Masque réseau",
|
||||||
"Gen_Offline": "Hors ligne",
|
"Gen_Offline": "Hors ligne",
|
||||||
|
|||||||
3
front/php/templates/language/it_it.json
Executable file → Normal file
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Genera",
|
"Gen_Generate": "Genera",
|
||||||
"Gen_InvalidMac": "Indirizzo Mac non valido.",
|
"Gen_InvalidMac": "Indirizzo Mac non valido.",
|
||||||
|
"Gen_Invalid_Value": "È stato inserito un valore non valido",
|
||||||
"Gen_LockedDB": "ERRORE: il DB potrebbe essere bloccato, controlla F12 Strumenti di sviluppo -> Console o riprova più tardi.",
|
"Gen_LockedDB": "ERRORE: il DB potrebbe essere bloccato, controlla F12 Strumenti di sviluppo -> Console o riprova più tardi.",
|
||||||
"Gen_NetworkMask": "Maschera di rete",
|
"Gen_NetworkMask": "Maschera di rete",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
@@ -761,4 +762,4 @@
|
|||||||
"settings_system_label": "Sistema",
|
"settings_system_label": "Sistema",
|
||||||
"settings_update_item_warning": "Aggiorna il valore qui sotto. Fai attenzione a seguire il formato precedente. <b>La convalida non viene eseguita.</b>",
|
"settings_update_item_warning": "Aggiorna il valore qui sotto. Fai attenzione a seguire il formato precedente. <b>La convalida non viene eseguita.</b>",
|
||||||
"test_event_tooltip": "Salva le modifiche prima di provare le nuove impostazioni."
|
"test_event_tooltip": "Salva le modifiche prima di provare le nuove impostazioni."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "",
|
"Gen_Filter": "",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "",
|
"Gen_LockedDB": "",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "",
|
"Gen_Offline": "",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filter",
|
"Gen_Filter": "Filter",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "FEIL - DB kan være låst - Sjekk F12 Dev tools -> Konsoll eller prøv senere.",
|
"Gen_LockedDB": "FEIL - DB kan være låst - Sjekk F12 Dev tools -> Konsoll eller prøv senere.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Frakoblet",
|
"Gen_Offline": "Frakoblet",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtr",
|
"Gen_Filter": "Filtr",
|
||||||
"Gen_Generate": "Wygeneruj",
|
"Gen_Generate": "Wygeneruj",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "Błąd - Baza danych może być zablokowana - Sprawdź narzędzia deweloperskie F12 -> Konsola lub spróbuj później.",
|
"Gen_LockedDB": "Błąd - Baza danych może być zablokowana - Sprawdź narzędzia deweloperskie F12 -> Konsola lub spróbuj później.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Niedostępne",
|
"Gen_Offline": "Niedostępne",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Gerar",
|
"Gen_Generate": "Gerar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
"Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
"BackDevices_darkmode_disabled": "Modo Noturno Desativado",
|
"BackDevices_darkmode_disabled": "Modo Noturno Desativado",
|
||||||
"BackDevices_darkmode_enabled": "Modo Noturno Ativado",
|
"BackDevices_darkmode_enabled": "Modo Noturno Ativado",
|
||||||
"CLEAR_NEW_FLAG_description": "Se ativado (<code>0</code> está desativado), dispositivos marcados como<b>Novo Dispositivo</b> serão desmarcados se o limite (especificado em horas) exceder o tempo da <b>Primeira Sessão </b>.",
|
"CLEAR_NEW_FLAG_description": "Se ativado (<code>0</code> está desativado), dispositivos marcados como<b>Novo Dispositivo</b> serão desmarcados se o limite (especificado em horas) exceder o tempo da <b>Primeira Sessão </b>.",
|
||||||
"CLEAR_NEW_FLAG_name": "",
|
"CLEAR_NEW_FLAG_name": "Limpar a flag nova",
|
||||||
"CustProps_cant_remove": "Não é possível remover, é necessária pelo menos uma propriedade.",
|
"CustProps_cant_remove": "Não é possível remover, é necessária pelo menos uma propriedade.",
|
||||||
"DAYS_TO_KEEP_EVENTS_description": "Esta é uma definição de manutenção. Especifica o número de dias de entradas de eventos que serão mantidas. Todos os eventos mais antigos serão apagados periodicamente. Também se aplica ao Histórico de eventos do plug-in.",
|
"DAYS_TO_KEEP_EVENTS_description": "Esta é uma definição de manutenção. Especifica o número de dias de entradas de eventos que serão mantidas. Todos os eventos mais antigos serão apagados periodicamente. Também se aplica ao Histórico de eventos do plug-in.",
|
||||||
"DAYS_TO_KEEP_EVENTS_name": "Apagar eventos mais antigos que",
|
"DAYS_TO_KEEP_EVENTS_name": "Apagar eventos mais antigos que",
|
||||||
@@ -73,10 +73,10 @@
|
|||||||
"DevDetail_CustomProps_reset_info": "Isto irá remover as suas propriedades personalizadas neste dispositivo e repô-las para o valor predefinido.",
|
"DevDetail_CustomProps_reset_info": "Isto irá remover as suas propriedades personalizadas neste dispositivo e repô-las para o valor predefinido.",
|
||||||
"DevDetail_DisplayFields_Title": "Visualização",
|
"DevDetail_DisplayFields_Title": "Visualização",
|
||||||
"DevDetail_EveandAl_AlertAllEvents": "Eventos de alerta",
|
"DevDetail_EveandAl_AlertAllEvents": "Eventos de alerta",
|
||||||
"DevDetail_EveandAl_AlertDown": "",
|
"DevDetail_EveandAl_AlertDown": "Alerta apagado",
|
||||||
"DevDetail_EveandAl_Archived": "Arquivado",
|
"DevDetail_EveandAl_Archived": "Arquivado",
|
||||||
"DevDetail_EveandAl_NewDevice": "Novo dispositivo",
|
"DevDetail_EveandAl_NewDevice": "Novo dispositivo",
|
||||||
"DevDetail_EveandAl_NewDevice_Tooltip": "",
|
"DevDetail_EveandAl_NewDevice_Tooltip": "Mostrará o estado “Novo” para o dispositivo e irá incluí-lo nas listas quando o filtro de “Novos dispositivos” estiver ativo. Não afeta as notificações.",
|
||||||
"DevDetail_EveandAl_RandomMAC": "MAC Aleatório",
|
"DevDetail_EveandAl_RandomMAC": "MAC Aleatório",
|
||||||
"DevDetail_EveandAl_ScanCycle": "Rastrear dispositivo",
|
"DevDetail_EveandAl_ScanCycle": "Rastrear dispositivo",
|
||||||
"DevDetail_EveandAl_ScanCycle_a": "Rastear dispositivo",
|
"DevDetail_EveandAl_ScanCycle_a": "Rastear dispositivo",
|
||||||
@@ -103,11 +103,11 @@
|
|||||||
"DevDetail_MainInfo_Type": "Tipo",
|
"DevDetail_MainInfo_Type": "Tipo",
|
||||||
"DevDetail_MainInfo_Vendor": "Fornecedor",
|
"DevDetail_MainInfo_Vendor": "Fornecedor",
|
||||||
"DevDetail_MainInfo_mac": "MAC",
|
"DevDetail_MainInfo_mac": "MAC",
|
||||||
"DevDetail_NavToChildNode": "",
|
"DevDetail_NavToChildNode": "Expandir subelemento",
|
||||||
"DevDetail_Network_Node_hover": "Selecione o dispositivo de rede principal ao qual o dispositivo atual está conectado, para preencher a árvore Rede.",
|
"DevDetail_Network_Node_hover": "Selecione o dispositivo de rede principal ao qual o dispositivo atual está conectado, para preencher a árvore Rede.",
|
||||||
"DevDetail_Network_Port_hover": "A porta a que este dispositivo está ligado no dispositivo de rede principal. Se for deixado vazio, é apresentado um ícone wifi na árvore Rede.",
|
"DevDetail_Network_Port_hover": "A porta a que este dispositivo está ligado no dispositivo de rede principal. Se for deixado vazio, é apresentado um ícone wifi na árvore Rede.",
|
||||||
"DevDetail_Nmap_Scans": "Varreduras manuais do Nmap",
|
"DevDetail_Nmap_Scans": "Varreduras manuais do Nmap",
|
||||||
"DevDetail_Nmap_Scans_desc": "",
|
"DevDetail_Nmap_Scans_desc": "Aqui pode executar análises NMAP manuais. Também pode agendar análises NMAP automáticas regulares através do plugin Serviços & Portos (NMAP). Aceda à https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/nmap_scan para saber mais",
|
||||||
"DevDetail_Nmap_buttonDefault": "Verificação predefinida",
|
"DevDetail_Nmap_buttonDefault": "Verificação predefinida",
|
||||||
"DevDetail_Nmap_buttonDefault_text": "Scan padrão: Nmap verifica as 1.000 portas superiores para cada protocolo de digitalização solicitado. Isto atinge cerca de 93% das portas TCP e 49% das portas UDP. (cerca de 5 segundos)",
|
"DevDetail_Nmap_buttonDefault_text": "Scan padrão: Nmap verifica as 1.000 portas superiores para cada protocolo de digitalização solicitado. Isto atinge cerca de 93% das portas TCP e 49% das portas UDP. (cerca de 5 segundos)",
|
||||||
"DevDetail_Nmap_buttonDetail": "Verificação Detalhada",
|
"DevDetail_Nmap_buttonDetail": "Verificação Detalhada",
|
||||||
@@ -155,34 +155,34 @@
|
|||||||
"DevDetail_Tab_NmapTablePort": "Porta",
|
"DevDetail_Tab_NmapTablePort": "Porta",
|
||||||
"DevDetail_Tab_NmapTableService": "Serviço",
|
"DevDetail_Tab_NmapTableService": "Serviço",
|
||||||
"DevDetail_Tab_NmapTableState": "Estado",
|
"DevDetail_Tab_NmapTableState": "Estado",
|
||||||
"DevDetail_Tab_NmapTableText": "",
|
"DevDetail_Tab_NmapTableText": "Configurar uma programação em <a href=\"/settings.php#NMAP_ACTIVE\">Definições</a>",
|
||||||
"DevDetail_Tab_NmapTableTime": "Tempo",
|
"DevDetail_Tab_NmapTableTime": "Tempo",
|
||||||
"DevDetail_Tab_Plugins": "Plugins",
|
"DevDetail_Tab_Plugins": "Plugins",
|
||||||
"DevDetail_Tab_Presence": "Presença",
|
"DevDetail_Tab_Presence": "Presença",
|
||||||
"DevDetail_Tab_Sessions": "Sessões",
|
"DevDetail_Tab_Sessions": "Sessões",
|
||||||
"DevDetail_Tab_Tools": "Ferramentas",
|
"DevDetail_Tab_Tools": "Ferramentas",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Description": "",
|
"DevDetail_Tab_Tools_Internet_Info_Description": "A ferramenta de informações da Internet apresenta dados sobre a ligação à Internet, como endereço IP, cidade, país, código de área e fuso horário.",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Error": "Ocorreu um erro",
|
"DevDetail_Tab_Tools_Internet_Info_Error": "Ocorreu um erro",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Start": "",
|
"DevDetail_Tab_Tools_Internet_Info_Start": "Start Internet Info",
|
||||||
"DevDetail_Tab_Tools_Internet_Info_Title": "",
|
"DevDetail_Tab_Tools_Internet_Info_Title": "Internet Info",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Description": "",
|
"DevDetail_Tab_Tools_Nslookup_Description": "Nslookup é uma ferramenta de linha de comandos usada para consultar o Sistema de Nomes de Domínio (DNS). O DNS é um sistema que traduz nomes de domínio, como www.google.com, em endereços IP, como 172.217.0.142.",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Error": "",
|
"DevDetail_Tab_Tools_Nslookup_Error": "Erro: O endereço IP não é válido",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Start": "",
|
"DevDetail_Tab_Tools_Nslookup_Start": "Inicia Nslookup",
|
||||||
"DevDetail_Tab_Tools_Nslookup_Title": "",
|
"DevDetail_Tab_Tools_Nslookup_Title": "Nslookup",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Description": "",
|
"DevDetail_Tab_Tools_Speedtest_Description": "A ferramenta Speedtest mede a velocidade de download, a velocidade de upload e a latência da ligação à Internet.",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Start": "",
|
"DevDetail_Tab_Tools_Speedtest_Start": "Iniciar Speedtest",
|
||||||
"DevDetail_Tab_Tools_Speedtest_Title": "",
|
"DevDetail_Tab_Tools_Speedtest_Title": "Speedtest Online",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Description": "",
|
"DevDetail_Tab_Tools_Traceroute_Description": "Traceroute é um comando de diagnóstico de rede usado para rastrear o caminho que os pacotes de dados percorrem de um anfitrião para outro.<br><br>O comando utiliza o Protocolo de Mensagens de Controlo da Internet (ICMP) para enviar pacotes aos nós intermédios na rota, cada node intermédio responde com um pacote ICMP de tempo limite (TTL expirado).<br><br>O comando utiliza o Protocolo de Mensagens de Controlo da Internet (ICMP) para enviar pacotes aos nodes intermédios na rota, cada node intermédio responde com um pacote ICMP de tempo limite (TTL expirado).<br><br>A saída do comando traceroute apresenta o endereço IP de cada node intermédio na rota.<br><br>O comando traceroute pode ser usado para diagnosticar problemas de rede, como atrasos, perda de pacotes e rotas bloqueadas.",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Error": "",
|
"DevDetail_Tab_Tools_Traceroute_Error": "Erro: O endereço IP não é válido",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Start": "",
|
"DevDetail_Tab_Tools_Traceroute_Start": "Iniciar Traceroute",
|
||||||
"DevDetail_Tab_Tools_Traceroute_Title": "",
|
"DevDetail_Tab_Tools_Traceroute_Title": "Traceroute",
|
||||||
"DevDetail_Tools_WOL": "",
|
"DevDetail_Tools_WOL": "Enviar comando WoL para ",
|
||||||
"DevDetail_Tools_WOL_noti": "",
|
"DevDetail_Tools_WOL_noti": "Wake-on-LAN",
|
||||||
"DevDetail_Tools_WOL_noti_text": "",
|
"DevDetail_Tools_WOL_noti_text": "O comando Wake-on-LAN é enviado para o endereço de broadcast. Se o destino não estiver na sub-rede/VLAN do NetAlertX, o dispositivo de destino não irá responder.",
|
||||||
"DevDetail_Type_hover": "",
|
"DevDetail_Type_hover": "O tipo do dispositivo. Se selecionar um dos dispositivos de rede predefinidos (por exemplo: AP, Firewall, Router, Switch…), eles aparecerão na configuração da árvore de rede como possíveis nós de rede principais.",
|
||||||
"DevDetail_Vendor_hover": "",
|
"DevDetail_Vendor_hover": "O fabricante deve ser detetado automaticamente. Pode substituir ou adicionar um valor personalizado.",
|
||||||
"DevDetail_WOL_Title": "",
|
"DevDetail_WOL_Title": "<i class=\"fa fa-power-off\"></i> Wake-on-LAN",
|
||||||
"DevDetail_button_AddIcon": "",
|
"DevDetail_button_AddIcon": "Adicionar novo ícone",
|
||||||
"DevDetail_button_AddIcon_Help": "Cole uma tag HTML SVG ou um ícone de tag HTML Font Awesome. Leia a <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/ICONS.md\" target=\"_blank\">documentação sobre ícones</a> para obter pormenores.",
|
"DevDetail_button_AddIcon_Help": "Cole uma tag HTML SVG ou um ícone de tag HTML Font Awesome. Leia a <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/ICONS.md\" target=\"_blank\">documentação sobre ícones</a> para obter pormenores.",
|
||||||
"DevDetail_button_AddIcon_Tooltip": "Adicione um novo ícone a este dispositivo que ainda não esteja disponível no menu suspenso.",
|
"DevDetail_button_AddIcon_Tooltip": "Adicione um novo ícone a este dispositivo que ainda não esteja disponível no menu suspenso.",
|
||||||
"DevDetail_button_Delete": "Apagar dispositivo",
|
"DevDetail_button_Delete": "Apagar dispositivo",
|
||||||
@@ -199,23 +199,23 @@
|
|||||||
"Device_MultiEdit_Backup": "",
|
"Device_MultiEdit_Backup": "",
|
||||||
"Device_MultiEdit_Fields": "Editar campos:",
|
"Device_MultiEdit_Fields": "Editar campos:",
|
||||||
"Device_MultiEdit_MassActions": "Ações em massa:",
|
"Device_MultiEdit_MassActions": "Ações em massa:",
|
||||||
"Device_MultiEdit_No_Devices": "",
|
"Device_MultiEdit_No_Devices": "Nenhum dispositivo selecionado.",
|
||||||
"Device_MultiEdit_Tooltip": "Cuidadoso. Clicar aqui aplicará o valor à esquerda a todos os dispositivos selecionados acima.",
|
"Device_MultiEdit_Tooltip": "Cuidadoso. Clicar aqui aplicará o valor à esquerda a todos os dispositivos selecionados acima.",
|
||||||
"Device_Searchbox": "Procurar",
|
"Device_Searchbox": "Procurar",
|
||||||
"Device_Shortcut_AllDevices": "",
|
"Device_Shortcut_AllDevices": "Os meus dispositivos",
|
||||||
"Device_Shortcut_AllNodes": "",
|
"Device_Shortcut_AllNodes": "Todos os Nodes",
|
||||||
"Device_Shortcut_Archived": "Arquivado",
|
"Device_Shortcut_Archived": "Arquivado",
|
||||||
"Device_Shortcut_Connected": "Conectado",
|
"Device_Shortcut_Connected": "Conectado",
|
||||||
"Device_Shortcut_Devices": "Dispositivos",
|
"Device_Shortcut_Devices": "Dispositivos",
|
||||||
"Device_Shortcut_DownAlerts": "Inativo e off-line",
|
"Device_Shortcut_DownAlerts": "Inativo e off-line",
|
||||||
"Device_Shortcut_DownOnly": "Inativo",
|
"Device_Shortcut_DownOnly": "Inativo",
|
||||||
"Device_Shortcut_Favorites": "Favoritos",
|
"Device_Shortcut_Favorites": "Favoritos",
|
||||||
"Device_Shortcut_NewDevices": "",
|
"Device_Shortcut_NewDevices": "Novo dispostivo",
|
||||||
"Device_Shortcut_OnlineChart": "Presença do dispositivo",
|
"Device_Shortcut_OnlineChart": "Presença do dispositivo",
|
||||||
"Device_TableHead_AlertDown": "Alerta em baixo",
|
"Device_TableHead_AlertDown": "Alerta em baixo",
|
||||||
"Device_TableHead_Connected_Devices": "Conexões",
|
"Device_TableHead_Connected_Devices": "Conexões",
|
||||||
"Device_TableHead_CustomProps": "",
|
"Device_TableHead_CustomProps": "Propriedades / Ações",
|
||||||
"Device_TableHead_FQDN": "",
|
"Device_TableHead_FQDN": "FQDN",
|
||||||
"Device_TableHead_Favorite": "Favorito",
|
"Device_TableHead_Favorite": "Favorito",
|
||||||
"Device_TableHead_FirstSession": "Primeira sessão",
|
"Device_TableHead_FirstSession": "Primeira sessão",
|
||||||
"Device_TableHead_GUID": "GUID",
|
"Device_TableHead_GUID": "GUID",
|
||||||
@@ -230,11 +230,11 @@
|
|||||||
"Device_TableHead_Name": "Nome",
|
"Device_TableHead_Name": "Nome",
|
||||||
"Device_TableHead_NetworkSite": "Site da rede",
|
"Device_TableHead_NetworkSite": "Site da rede",
|
||||||
"Device_TableHead_Owner": "Proprietário",
|
"Device_TableHead_Owner": "Proprietário",
|
||||||
"Device_TableHead_ParentRelType": "",
|
"Device_TableHead_ParentRelType": "Tipo de relação",
|
||||||
"Device_TableHead_Parent_MAC": "",
|
"Device_TableHead_Parent_MAC": "Node de rede anterior",
|
||||||
"Device_TableHead_Port": "Porta",
|
"Device_TableHead_Port": "Porta",
|
||||||
"Device_TableHead_PresentLastScan": "Presença",
|
"Device_TableHead_PresentLastScan": "Presença",
|
||||||
"Device_TableHead_ReqNicsOnline": "",
|
"Device_TableHead_ReqNicsOnline": "Exigir NICs online",
|
||||||
"Device_TableHead_RowID": "ID da linha",
|
"Device_TableHead_RowID": "ID da linha",
|
||||||
"Device_TableHead_Rowid": "ID da linha",
|
"Device_TableHead_Rowid": "ID da linha",
|
||||||
"Device_TableHead_SSID": "SSID",
|
"Device_TableHead_SSID": "SSID",
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
"ENCRYPTION_KEY_name": "Chave de encriptação",
|
"ENCRYPTION_KEY_name": "Chave de encriptação",
|
||||||
"Email_display_name": "Email",
|
"Email_display_name": "Email",
|
||||||
"Email_icon": "<i class=\"fa fa-at\"></i>",
|
"Email_icon": "<i class=\"fa fa-at\"></i>",
|
||||||
"Events_Loading": "",
|
"Events_Loading": "A carregar…",
|
||||||
"Events_Periodselect_All": "Todas as informações",
|
"Events_Periodselect_All": "Todas as informações",
|
||||||
"Events_Periodselect_LastMonth": "Mês passado",
|
"Events_Periodselect_LastMonth": "Mês passado",
|
||||||
"Events_Periodselect_LastWeek": "Semana passada",
|
"Events_Periodselect_LastWeek": "Semana passada",
|
||||||
@@ -268,7 +268,7 @@
|
|||||||
"Events_Shortcut_DownAlerts": "Alertas de queda",
|
"Events_Shortcut_DownAlerts": "Alertas de queda",
|
||||||
"Events_Shortcut_Events": "Eventos",
|
"Events_Shortcut_Events": "Eventos",
|
||||||
"Events_Shortcut_MissSessions": "Sessões ausentes",
|
"Events_Shortcut_MissSessions": "Sessões ausentes",
|
||||||
"Events_Shortcut_NewDevices": "",
|
"Events_Shortcut_NewDevices": "Novos dispositivos",
|
||||||
"Events_Shortcut_Sessions": "Sessões",
|
"Events_Shortcut_Sessions": "Sessões",
|
||||||
"Events_Shortcut_VoidSessions": "Sessões anuladas",
|
"Events_Shortcut_VoidSessions": "Sessões anuladas",
|
||||||
"Events_TableHead_AdditionalInfo": "Informação adicional",
|
"Events_TableHead_AdditionalInfo": "Informação adicional",
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
"Events_TableHead_Disconnection": "Desconexão",
|
"Events_TableHead_Disconnection": "Desconexão",
|
||||||
"Events_TableHead_Duration": "Duração",
|
"Events_TableHead_Duration": "Duração",
|
||||||
"Events_TableHead_DurationOrder": "Duração do pedido",
|
"Events_TableHead_DurationOrder": "Duração do pedido",
|
||||||
"Events_TableHead_EventType": "",
|
"Events_TableHead_EventType": "Tipos de eventos",
|
||||||
"Events_TableHead_IP": "IP",
|
"Events_TableHead_IP": "IP",
|
||||||
"Events_TableHead_IPOrder": "Pedido de IP",
|
"Events_TableHead_IPOrder": "Pedido de IP",
|
||||||
"Events_TableHead_Order": "Ordem",
|
"Events_TableHead_Order": "Ordem",
|
||||||
@@ -294,15 +294,15 @@
|
|||||||
"GRAPHQL_PORT_name": "Porta GraphQL",
|
"GRAPHQL_PORT_name": "Porta GraphQL",
|
||||||
"Gen_Action": "Ação",
|
"Gen_Action": "Ação",
|
||||||
"Gen_Add": "Adicionar",
|
"Gen_Add": "Adicionar",
|
||||||
"Gen_AddDevice": "",
|
"Gen_AddDevice": "Adicionar dispositivo",
|
||||||
"Gen_Add_All": "Adicionar todos",
|
"Gen_Add_All": "Adicionar todos",
|
||||||
"Gen_All_Devices": "",
|
"Gen_All_Devices": "Todos os dispostivos",
|
||||||
"Gen_AreYouSure": "Tem certeza?",
|
"Gen_AreYouSure": "Tem certeza?",
|
||||||
"Gen_Backup": "Executar backup",
|
"Gen_Backup": "Executar backup",
|
||||||
"Gen_Cancel": "Cancelar",
|
"Gen_Cancel": "Cancelar",
|
||||||
"Gen_Change": "Alterar",
|
"Gen_Change": "Alterar",
|
||||||
"Gen_Copy": "Executar",
|
"Gen_Copy": "Executar",
|
||||||
"Gen_CopyToClipboard": "",
|
"Gen_CopyToClipboard": "Copiar para a área de transferência",
|
||||||
"Gen_DataUpdatedUITakesTime": "OK - Pode levar um tempo para a interface do utilizador ser atualizada se uma verificação estiver em execução.",
|
"Gen_DataUpdatedUITakesTime": "OK - Pode levar um tempo para a interface do utilizador ser atualizada se uma verificação estiver em execução.",
|
||||||
"Gen_Delete": "Apagar",
|
"Gen_Delete": "Apagar",
|
||||||
"Gen_DeleteAll": "Apagar todos",
|
"Gen_DeleteAll": "Apagar todos",
|
||||||
@@ -310,9 +310,10 @@
|
|||||||
"Gen_Error": "Erro",
|
"Gen_Error": "Erro",
|
||||||
"Gen_Filter": "Filtro",
|
"Gen_Filter": "Filtro",
|
||||||
"Gen_Generate": "Gerar",
|
"Gen_Generate": "Gerar",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_Invalid_Value": "",
|
||||||
|
"Gen_InvalidMac": "Endereço MAC Inválido.",
|
||||||
"Gen_LockedDB": "ERRO - A base de dados pode estar bloqueada - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
"Gen_LockedDB": "ERRO - A base de dados pode estar bloqueada - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "Máscara de Rede",
|
||||||
"Gen_Offline": "Offline",
|
"Gen_Offline": "Offline",
|
||||||
"Gen_Okay": "Ok",
|
"Gen_Okay": "Ok",
|
||||||
"Gen_Online": "Online",
|
"Gen_Online": "Online",
|
||||||
@@ -329,8 +330,8 @@
|
|||||||
"Gen_Select": "Selecionar",
|
"Gen_Select": "Selecionar",
|
||||||
"Gen_SelectIcon": "<i class=\"fa-solid fa-chevron-down fa-fade\"></i>",
|
"Gen_SelectIcon": "<i class=\"fa-solid fa-chevron-down fa-fade\"></i>",
|
||||||
"Gen_SelectToPreview": "Selecionar para pré-visualizar",
|
"Gen_SelectToPreview": "Selecionar para pré-visualizar",
|
||||||
"Gen_Selected_Devices": "",
|
"Gen_Selected_Devices": "Seleciona dispostivos:",
|
||||||
"Gen_Subnet": "",
|
"Gen_Subnet": "Sub-rede",
|
||||||
"Gen_Switch": "Trocar",
|
"Gen_Switch": "Trocar",
|
||||||
"Gen_Upd": "Atualizado com sucesso",
|
"Gen_Upd": "Atualizado com sucesso",
|
||||||
"Gen_Upd_Fail": "A atualização falhou",
|
"Gen_Upd_Fail": "A atualização falhou",
|
||||||
@@ -344,14 +345,14 @@
|
|||||||
"General_display_name": "Geral",
|
"General_display_name": "Geral",
|
||||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||||
"HRS_TO_KEEP_NEWDEV_description": "",
|
"HRS_TO_KEEP_NEWDEV_description": "",
|
||||||
"HRS_TO_KEEP_NEWDEV_name": "",
|
"HRS_TO_KEEP_NEWDEV_name": "Remover novos dispostivos depois",
|
||||||
"HRS_TO_KEEP_OFFDEV_description": "",
|
"HRS_TO_KEEP_OFFDEV_description": "",
|
||||||
"HRS_TO_KEEP_OFFDEV_name": "Apagar dispositivos offline após",
|
"HRS_TO_KEEP_OFFDEV_name": "Apagar dispositivos offline após",
|
||||||
"LOADED_PLUGINS_description": "Quais plugins carregar. Adicionar plugins pode deixar a aplicação lenta. Leia mais sobre quais plugins precisam ser ativados, tipos ou opções de escaneamento na <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md\">documentação de plugins</a>. Plugins descarregados perderão as suas configurações. Somente plugins <code>desativados</code> podem ser descarregados.",
|
"LOADED_PLUGINS_description": "Quais plugins carregar. Adicionar plugins pode deixar a aplicação lenta. Leia mais sobre quais plugins precisam ser ativados, tipos ou opções de escaneamento na <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/docs/PLUGINS.md\">documentação de plugins</a>. Plugins descarregados perderão as suas configurações. Somente plugins <code>desativados</code> podem ser descarregados.",
|
||||||
"LOADED_PLUGINS_name": "Plugins carregados",
|
"LOADED_PLUGINS_name": "Plugins carregados",
|
||||||
"LOG_LEVEL_description": "Esta definição permite um registo mais detalhado. Útil para depurar eventos gravados na base de dados.",
|
"LOG_LEVEL_description": "Esta definição permite um registo mais detalhado. Útil para depurar eventos gravados na base de dados.",
|
||||||
"LOG_LEVEL_name": "Imprimir registo adicional",
|
"LOG_LEVEL_name": "Imprimir registo adicional",
|
||||||
"Loading": "",
|
"Loading": "A carregar…",
|
||||||
"Login_Box": "Introduza a sua palavra-passe",
|
"Login_Box": "Introduza a sua palavra-passe",
|
||||||
"Login_Default_PWD": "A palavra-passe predefinida “123456” ainda está ativa.",
|
"Login_Default_PWD": "A palavra-passe predefinida “123456” ainda está ativa.",
|
||||||
"Login_Info": "As palavra-passes são definidas por meio do plugin Definir palavra-passe. Verifique a <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/set_password\">documentação do SETPWD</a> se tiver problemas para fazer login.",
|
"Login_Info": "As palavra-passes são definidas por meio do plugin Definir palavra-passe. Verifique a <a target=\"_blank\" href=\"https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/set_password\">documentação do SETPWD</a> se tiver problemas para fazer login.",
|
||||||
@@ -369,20 +370,20 @@
|
|||||||
"Maint_PurgeLog": "Limpar o registo",
|
"Maint_PurgeLog": "Limpar o registo",
|
||||||
"Maint_RestartServer": "Reiniciar o servidor",
|
"Maint_RestartServer": "Reiniciar o servidor",
|
||||||
"Maint_Restart_Server_noti_text": "Tem certeza de que deseja reiniciar o servidor backend? Isto pode causar inconsistência na app. Faça primeiro um backup da sua configuração. <br/> <br/> Nota: Isto pode levar alguns minutos.",
|
"Maint_Restart_Server_noti_text": "Tem certeza de que deseja reiniciar o servidor backend? Isto pode causar inconsistência na app. Faça primeiro um backup da sua configuração. <br/> <br/> Nota: Isto pode levar alguns minutos.",
|
||||||
"Maintenance_InitCheck": "",
|
"Maintenance_InitCheck": "Verificação inicial",
|
||||||
"Maintenance_InitCheck_Checking": "",
|
"Maintenance_InitCheck_Checking": "A verificar…",
|
||||||
"Maintenance_InitCheck_QuickSetupGuide": "",
|
"Maintenance_InitCheck_QuickSetupGuide": "Certifique-se de que seguiu o <a href=\"https://jokob-sk.github.io/NetAlertX/INITIAL_SETUP/\" target=\"_blank\">guia de configuração rápida</a>.",
|
||||||
"Maintenance_InitCheck_Success": "",
|
"Maintenance_InitCheck_Success": "Aplicação inicializada com sucesso!",
|
||||||
"Maintenance_ReCheck": "",
|
"Maintenance_ReCheck": "Verificar novamente",
|
||||||
"Maintenance_Running_Version": "Versão instalada",
|
"Maintenance_Running_Version": "Versão instalada",
|
||||||
"Maintenance_Status": "Situação",
|
"Maintenance_Status": "Situação",
|
||||||
"Maintenance_Title": "Ferramentas de manutenção",
|
"Maintenance_Title": "Ferramentas de manutenção",
|
||||||
"Maintenance_Tool_DownloadConfig": "",
|
"Maintenance_Tool_DownloadConfig": "Exportar Definições",
|
||||||
"Maintenance_Tool_DownloadConfig_text": "Descarregue um backup completo da configuração das Configurações armazenada no ficheiro <code>app.conf</code>.",
|
"Maintenance_Tool_DownloadConfig_text": "Descarregue um backup completo da configuração das Configurações armazenada no ficheiro <code>app.conf</code>.",
|
||||||
"Maintenance_Tool_DownloadWorkflows": "",
|
"Maintenance_Tool_DownloadWorkflows": "Exportar Workflows",
|
||||||
"Maintenance_Tool_DownloadWorkflows_text": "",
|
"Maintenance_Tool_DownloadWorkflows_text": "Descarregue uma cópia completa de segurança dos seus Workflows armazenados no ficheiro <code>workflows.json</code> .",
|
||||||
"Maintenance_Tool_ExportCSV": "",
|
"Maintenance_Tool_ExportCSV": "Exportar dispostivos (csv)",
|
||||||
"Maintenance_Tool_ExportCSV_noti": "",
|
"Maintenance_Tool_ExportCSV_noti": "Exportar dispostivos (csv)",
|
||||||
"Maintenance_Tool_ExportCSV_noti_text": "Tem a certeza de que pretende gerar um ficheiro CSV?",
|
"Maintenance_Tool_ExportCSV_noti_text": "Tem a certeza de que pretende gerar um ficheiro CSV?",
|
||||||
"Maintenance_Tool_ExportCSV_text": "Gere um ficheiro CSV (valor separado por vírgula) contendo a lista de dispositivos, incluindo os relacionamentos de rede entre os nós de rede e os dispositivos conectados. Também pode acionar isto a aceder esta URL <code>your_NetAlertX_url/php/server/devices.php?action=ExportCSV</code> ou ativando o plugin <a href=\"settings.php#CSVBCKP_header\">CSV Backup</a>.",
|
"Maintenance_Tool_ExportCSV_text": "Gere um ficheiro CSV (valor separado por vírgula) contendo a lista de dispositivos, incluindo os relacionamentos de rede entre os nós de rede e os dispositivos conectados. Também pode acionar isto a aceder esta URL <code>your_NetAlertX_url/php/server/devices.php?action=ExportCSV</code> ou ativando o plugin <a href=\"settings.php#CSVBCKP_header\">CSV Backup</a>.",
|
||||||
"Maintenance_Tool_ImportCSV": "Importação de dispositivos (csv)",
|
"Maintenance_Tool_ImportCSV": "Importação de dispositivos (csv)",
|
||||||
@@ -413,31 +414,31 @@
|
|||||||
"Maintenance_Tool_del_ActHistory_noti": "Apagar atividade de rede",
|
"Maintenance_Tool_del_ActHistory_noti": "Apagar atividade de rede",
|
||||||
"Maintenance_Tool_del_ActHistory_noti_text": "Tem certeza de que deseja redefinir a atividade da rede?",
|
"Maintenance_Tool_del_ActHistory_noti_text": "Tem certeza de que deseja redefinir a atividade da rede?",
|
||||||
"Maintenance_Tool_del_ActHistory_text": "O gráfico de atividade da rede é redefinido. Isto não afeta os eventos.",
|
"Maintenance_Tool_del_ActHistory_text": "O gráfico de atividade da rede é redefinido. Isto não afeta os eventos.",
|
||||||
"Maintenance_Tool_del_alldev": "",
|
"Maintenance_Tool_del_alldev": "Remover todos os dispositivo",
|
||||||
"Maintenance_Tool_del_alldev_noti": "",
|
"Maintenance_Tool_del_alldev_noti": "Remover dispositivos",
|
||||||
"Maintenance_Tool_del_alldev_noti_text": "Tem certeza de que deseja apagar todos os dispositivos?",
|
"Maintenance_Tool_del_alldev_noti_text": "Tem certeza de que deseja apagar todos os dispositivos?",
|
||||||
"Maintenance_Tool_del_alldev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos serão apagados da base de dados.",
|
"Maintenance_Tool_del_alldev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_allevents": "Apagar eventos (Repor presença)",
|
"Maintenance_Tool_del_allevents": "Apagar eventos (Repor presença)",
|
||||||
"Maintenance_Tool_del_allevents30": "Apagar todos os eventos com mais que 30 dias",
|
"Maintenance_Tool_del_allevents30": "Apagar todos os eventos com mais que 30 dias",
|
||||||
"Maintenance_Tool_del_allevents30_noti": "Apagar eventos",
|
"Maintenance_Tool_del_allevents30_noti": "Apagar eventos",
|
||||||
"Maintenance_Tool_del_allevents30_noti_text": "",
|
"Maintenance_Tool_del_allevents30_noti_text": "Tem a certeza de que pretende eliminar todos os Eventos com mais de 30 dias? Isto repõe a presença de todos os dispositivos.",
|
||||||
"Maintenance_Tool_del_allevents30_text": "Antes de utilizar esta função, faça uma cópia de segurança. Apagar não pode ser anulado. Todos os eventos com mais que 30 dias na base de dados serão eliminados. Nesse momento, a presença de todos os dispositivos será reiniciada. Este facto pode dar origem a sessões inválidas. Isto significa que os dispositivos são apresentados como “presentes” apesar de estarem offline. Uma verificação enquanto o dispositivo em questão está online resolve o problema.",
|
"Maintenance_Tool_del_allevents30_text": "Antes de utilizar esta função, faça uma cópia de segurança. Apagar não pode ser anulado. Todos os eventos com mais que 30 dias na base de dados serão eliminados. Nesse momento, a presença de todos os dispositivos será reiniciada. Este facto pode dar origem a sessões inválidas. Isto significa que os dispositivos são apresentados como “presentes” apesar de estarem offline. Uma verificação enquanto o dispositivo em questão está online resolve o problema.",
|
||||||
"Maintenance_Tool_del_allevents_noti": "Apagar eventos",
|
"Maintenance_Tool_del_allevents_noti": "Apagar eventos",
|
||||||
"Maintenance_Tool_del_allevents_noti_text": "",
|
"Maintenance_Tool_del_allevents_noti_text": "Tem a certeza de que pretende eliminar todos os Eventos? Isto repõe a presença de todos os dispositivos.",
|
||||||
"Maintenance_Tool_del_allevents_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os eventos na base de dados serão apagados. Nesse momento, a presença de todos os dispositivos será redefinida. Isto pode levar a sessões inválidas. Isto significa que os dispositivos são exibidos como \"presente\" embora estejam offline. Uma varredura enquanto o dispositivo em questão é on-line resolve o problema.",
|
"Maintenance_Tool_del_allevents_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os eventos na base de dados serão apagados. Nesse momento, a presença de todos os dispositivos será redefinida. Isto pode levar a sessões inválidas. Isto significa que os dispositivos são exibidos como \"presente\" embora estejam offline. Uma varredura enquanto o dispositivo em questão é on-line resolve o problema.",
|
||||||
"Maintenance_Tool_del_empty_macs": "",
|
"Maintenance_Tool_del_empty_macs": "Eliminar dispositivos com endereços MACs vazios",
|
||||||
"Maintenance_Tool_del_empty_macs_noti": "",
|
"Maintenance_Tool_del_empty_macs_noti": "Elimitar dispositivos",
|
||||||
"Maintenance_Tool_del_empty_macs_noti_text": "Tem certeza que deseja apagar todos os dispositivos com endereços MAC vazios?<br>(talvez prefira arquivá-los)",
|
"Maintenance_Tool_del_empty_macs_noti_text": "Tem certeza que deseja apagar todos os dispositivos com endereços MAC vazios?<br>(talvez prefira arquivá-los)",
|
||||||
"Maintenance_Tool_del_empty_macs_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos sem MAC serão apagados da base de dados.",
|
"Maintenance_Tool_del_empty_macs_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos sem MAC serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_selecteddev": "Apagar dispositivos selecionados",
|
"Maintenance_Tool_del_selecteddev": "Apagar dispositivos selecionados",
|
||||||
"Maintenance_Tool_del_selecteddev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Dispositivos selecionados serão apagados da base de dados.",
|
"Maintenance_Tool_del_selecteddev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Dispositivos selecionados serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_del_unknowndev": "",
|
"Maintenance_Tool_del_unknowndev": "Eliminar dispositivos desconhecidos",
|
||||||
"Maintenance_Tool_del_unknowndev_noti": "",
|
"Maintenance_Tool_del_unknowndev_noti": "Eliminar dispositivos desconhecidos",
|
||||||
"Maintenance_Tool_del_unknowndev_noti_text": "Tem certeza que deseja apagar todos (desconhecidos) e (nome não encontrados) dispositivos?",
|
"Maintenance_Tool_del_unknowndev_noti_text": "Tem certeza que deseja apagar todos (desconhecidos) e (nome não encontrados) dispositivos?",
|
||||||
"Maintenance_Tool_del_unknowndev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos nomeados (não conhecidos) serão apagados da base de dados.",
|
"Maintenance_Tool_del_unknowndev_text": "Antes de usar esta função, faça um backup. Apagar não pode ser desfeito. Todos os dispositivos nomeados (não conhecidos) serão apagados da base de dados.",
|
||||||
"Maintenance_Tool_displayed_columns_text": "Altere a visibilidade e a ordem das colunas na página <a href=\"devices.php\"><b> <i class=\"fa fa-portátil\"></i> Dispositivos</b></a>.",
|
"Maintenance_Tool_displayed_columns_text": "Altere a visibilidade e a ordem das colunas na página <a href=\"devices.php\"><b> <i class=\"fa fa-portátil\"></i> Dispositivos</b></a>.",
|
||||||
"Maintenance_Tool_drag_me": "Arraste-me para reordenar colunas.",
|
"Maintenance_Tool_drag_me": "Arraste-me para reordenar colunas.",
|
||||||
"Maintenance_Tool_order_columns_text": "",
|
"Maintenance_Tool_order_columns_text": "Maintenance_Tool_order_columns_text",
|
||||||
"Maintenance_Tool_purgebackup": "Limpar cópias de segurança",
|
"Maintenance_Tool_purgebackup": "Limpar cópias de segurança",
|
||||||
"Maintenance_Tool_purgebackup_noti": "Limpar cópias de segurança",
|
"Maintenance_Tool_purgebackup_noti": "Limpar cópias de segurança",
|
||||||
"Maintenance_Tool_purgebackup_noti_text": "Tem certeza que deseja apagar todos os backups exceto os últimos 3?",
|
"Maintenance_Tool_purgebackup_noti_text": "Tem certeza que deseja apagar todos os backups exceto os últimos 3?",
|
||||||
@@ -450,13 +451,13 @@
|
|||||||
"Maintenance_Tool_upgrade_database_noti_text": "Tem certeza de que deseja atualizar a base de dados?<br>(talvez prefira arquivá-la)",
|
"Maintenance_Tool_upgrade_database_noti_text": "Tem certeza de que deseja atualizar a base de dados?<br>(talvez prefira arquivá-la)",
|
||||||
"Maintenance_Tool_upgrade_database_text": "Este botão atualizará a base de dados para ativar o gráfico Atividade de rede nas últimas 12 horas. Faça uma cópia de segurança da sua base de dados em caso de problemas.",
|
"Maintenance_Tool_upgrade_database_text": "Este botão atualizará a base de dados para ativar o gráfico Atividade de rede nas últimas 12 horas. Faça uma cópia de segurança da sua base de dados em caso de problemas.",
|
||||||
"Maintenance_Tools_Tab_BackupRestore": "Backup / Restauração",
|
"Maintenance_Tools_Tab_BackupRestore": "Backup / Restauração",
|
||||||
"Maintenance_Tools_Tab_Logging": "",
|
"Maintenance_Tools_Tab_Logging": "Logs",
|
||||||
"Maintenance_Tools_Tab_Settings": "Configurações",
|
"Maintenance_Tools_Tab_Settings": "Configurações",
|
||||||
"Maintenance_Tools_Tab_Tools": "Ferramentas",
|
"Maintenance_Tools_Tab_Tools": "Ferramentas",
|
||||||
"Maintenance_Tools_Tab_UISettings": "Configurações de interface",
|
"Maintenance_Tools_Tab_UISettings": "Configurações de interface",
|
||||||
"Maintenance_arp_status": "Estado de digitalização",
|
"Maintenance_arp_status": "Estado de digitalização",
|
||||||
"Maintenance_arp_status_off": "está atualmente desativado",
|
"Maintenance_arp_status_off": "está atualmente desativado",
|
||||||
"Maintenance_arp_status_on": "",
|
"Maintenance_arp_status_on": "Scan em curso",
|
||||||
"Maintenance_built_on": "Construído em",
|
"Maintenance_built_on": "Construído em",
|
||||||
"Maintenance_current_version": "Você está atualizado. Confira o que <a href=\"https://github.com/jokob-sk/NetAlertX/issues/138\" target=\"_blank\"> estou a trabalhar em</a>.",
|
"Maintenance_current_version": "Você está atualizado. Confira o que <a href=\"https://github.com/jokob-sk/NetAlertX/issues/138\" target=\"_blank\"> estou a trabalhar em</a>.",
|
||||||
"Maintenance_database_backup": "Backups DB",
|
"Maintenance_database_backup": "Backups DB",
|
||||||
@@ -467,8 +468,8 @@
|
|||||||
"Maintenance_database_rows": "Tabela (linhas)",
|
"Maintenance_database_rows": "Tabela (linhas)",
|
||||||
"Maintenance_database_size": "Tamanho da base de dados",
|
"Maintenance_database_size": "Tamanho da base de dados",
|
||||||
"Maintenance_lang_selector_apply": "Aplicar",
|
"Maintenance_lang_selector_apply": "Aplicar",
|
||||||
"Maintenance_lang_selector_empty": "",
|
"Maintenance_lang_selector_empty": "Escolha a lingua",
|
||||||
"Maintenance_lang_selector_lable": "",
|
"Maintenance_lang_selector_lable": "Escolha a lingua",
|
||||||
"Maintenance_lang_selector_text": "A mudança ocorre no lado do cliente, por isso afeta apenas o navegador atual.",
|
"Maintenance_lang_selector_text": "A mudança ocorre no lado do cliente, por isso afeta apenas o navegador atual.",
|
||||||
"Maintenance_new_version": "Uma nova versão está disponível. Confira as <a href=\"https://github.com/jokob-sk/NetAlertX/releases\" target=\"_blank\">notas de lançamento</a>.",
|
"Maintenance_new_version": "Uma nova versão está disponível. Confira as <a href=\"https://github.com/jokob-sk/NetAlertX/releases\" target=\"_blank\">notas de lançamento</a>.",
|
||||||
"Maintenance_themeselector_apply": "Aplicar",
|
"Maintenance_themeselector_apply": "Aplicar",
|
||||||
@@ -476,10 +477,10 @@
|
|||||||
"Maintenance_themeselector_lable": "Selecionar Skin",
|
"Maintenance_themeselector_lable": "Selecionar Skin",
|
||||||
"Maintenance_themeselector_text": "A mudança ocorre no lado do servidor, por isso afeta todos os dispositivos em uso.",
|
"Maintenance_themeselector_text": "A mudança ocorre no lado do servidor, por isso afeta todos os dispositivos em uso.",
|
||||||
"Maintenance_version": "Atualizações de apps",
|
"Maintenance_version": "Atualizações de apps",
|
||||||
"NETWORK_DEVICE_TYPES_description": "",
|
"NETWORK_DEVICE_TYPES_description": "Quais os tipos de dispositivos que podem ser usados como dispositivos de rede na vista de Rede. O tipo de dispositivo tem de corresponder exatamente à definição <code>Type</code> um dispositivo específico em Detalhes do dispositivo. Adicione-o ao dispositivo através do botão <code>+</code>. Não remova tipos existentes, apenas adicione novos.",
|
||||||
"NETWORK_DEVICE_TYPES_name": "Tipos de dispositivo de rede",
|
"NETWORK_DEVICE_TYPES_name": "Tipos de dispositivo de rede",
|
||||||
"Navigation_About": "Sobre a",
|
"Navigation_About": "Sobre a",
|
||||||
"Navigation_AppEvents": "",
|
"Navigation_AppEvents": "Eventos de aplicações",
|
||||||
"Navigation_Devices": "Dispositivos",
|
"Navigation_Devices": "Dispositivos",
|
||||||
"Navigation_Donations": "Doações",
|
"Navigation_Donations": "Doações",
|
||||||
"Navigation_Events": "Eventos",
|
"Navigation_Events": "Eventos",
|
||||||
@@ -489,38 +490,38 @@
|
|||||||
"Navigation_Network": "Rede",
|
"Navigation_Network": "Rede",
|
||||||
"Navigation_Notifications": "Notificações",
|
"Navigation_Notifications": "Notificações",
|
||||||
"Navigation_Plugins": "Plugins",
|
"Navigation_Plugins": "Plugins",
|
||||||
"Navigation_Presence": "",
|
"Navigation_Presence": "Presença",
|
||||||
"Navigation_Report": "",
|
"Navigation_Report": "Reports enviados",
|
||||||
"Navigation_Settings": "",
|
"Navigation_Settings": "Definições",
|
||||||
"Navigation_SystemInfo": "",
|
"Navigation_SystemInfo": "Informação de sistema",
|
||||||
"Navigation_Workflows": "",
|
"Navigation_Workflows": "Workflows",
|
||||||
"Network_Assign": "",
|
"Network_Assign": "Conectar ao nodo de network <i class=\"fa fa-server\"></i> em cima",
|
||||||
"Network_Cant_Assign": "",
|
"Network_Cant_Assign": "Não é possível atribuir o node raiz da Internet como um node folha filho.",
|
||||||
"Network_Cant_Assign_No_Node_Selected": "",
|
"Network_Cant_Assign_No_Node_Selected": "Não é possível atribuir, nenhum node pai selecionado.",
|
||||||
"Network_Configuration_Error": "",
|
"Network_Configuration_Error": "Erro de configuração",
|
||||||
"Network_Connected": "",
|
"Network_Connected": "Dispositivos conectados",
|
||||||
"Network_Devices": "",
|
"Network_Devices": "Dispositivos de rede",
|
||||||
"Network_ManageAdd": "",
|
"Network_ManageAdd": "Adicionar dispositivo",
|
||||||
"Network_ManageAdd_Name": "",
|
"Network_ManageAdd_Name": "Nome do dispositivo",
|
||||||
"Network_ManageAdd_Name_text": "",
|
"Network_ManageAdd_Name_text": "Nome sem caracteres especiais",
|
||||||
"Network_ManageAdd_Port": "",
|
"Network_ManageAdd_Port": "Contagem de portas",
|
||||||
"Network_ManageAdd_Port_text": "",
|
"Network_ManageAdd_Port_text": "Deixe em branco para Wi-Fi e Powerline",
|
||||||
"Network_ManageAdd_Submit": "",
|
"Network_ManageAdd_Submit": "Adicionar dispositivo",
|
||||||
"Network_ManageAdd_Type": "",
|
"Network_ManageAdd_Type": "Tipo de dispositivo",
|
||||||
"Network_ManageAdd_Type_text": "",
|
"Network_ManageAdd_Type_text": "-- Selecionar Tipo --",
|
||||||
"Network_ManageAssign": "",
|
"Network_ManageAssign": "Asignar",
|
||||||
"Network_ManageDel": "",
|
"Network_ManageDel": "Eliminar dispositivo",
|
||||||
"Network_ManageDel_Name": "",
|
"Network_ManageDel_Name": "Dispositivo a eliminar",
|
||||||
"Network_ManageDel_Name_text": "",
|
"Network_ManageDel_Name_text": "-- Seleciona dispositivo --",
|
||||||
"Network_ManageDel_Submit": "",
|
"Network_ManageDel_Submit": "Eliminar",
|
||||||
"Network_ManageDevices": "",
|
"Network_ManageDevices": "Gerir dispositivos",
|
||||||
"Network_ManageEdit": "",
|
"Network_ManageEdit": "Actualizar dispositivos",
|
||||||
"Network_ManageEdit_ID": "",
|
"Network_ManageEdit_ID": "Dispositivos a actualizar",
|
||||||
"Network_ManageEdit_ID_text": "",
|
"Network_ManageEdit_ID_text": "-- Selecionar dispositivo para edição --",
|
||||||
"Network_ManageEdit_Name": "",
|
"Network_ManageEdit_Name": "Novo nome de dispositivo",
|
||||||
"Network_ManageEdit_Name_text": "",
|
"Network_ManageEdit_Name_text": "Nome sem caracteres especiais",
|
||||||
"Network_ManageEdit_Port": "",
|
"Network_ManageEdit_Port": " Nova contagem de portas",
|
||||||
"Network_ManageEdit_Port_text": "",
|
"Network_ManageEdit_Port_text": "Deixe em branco para Wi-Fi e Powerline.",
|
||||||
"Network_ManageEdit_Submit": "",
|
"Network_ManageEdit_Submit": "",
|
||||||
"Network_ManageEdit_Type": "",
|
"Network_ManageEdit_Type": "",
|
||||||
"Network_ManageEdit_Type_text": "",
|
"Network_ManageEdit_Type_text": "",
|
||||||
@@ -761,4 +762,4 @@
|
|||||||
"settings_system_label": "",
|
"settings_system_label": "",
|
||||||
"settings_update_item_warning": "",
|
"settings_update_item_warning": "",
|
||||||
"test_event_tooltip": "Guarde as alterações antes de testar as definições."
|
"test_event_tooltip": "Guarde as alterações antes de testar as definições."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Фильтр",
|
"Gen_Filter": "Фильтр",
|
||||||
"Gen_Generate": "Генерировать",
|
"Gen_Generate": "Генерировать",
|
||||||
"Gen_InvalidMac": "Неверный Mac-адрес.",
|
"Gen_InvalidMac": "Неверный Mac-адрес.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ОШИБКА - Возможно, база данных заблокирована. Проверьте инструменты разработчика F12 -> Консоль или повторите попытку позже.",
|
"Gen_LockedDB": "ОШИБКА - Возможно, база данных заблокирована. Проверьте инструменты разработчика F12 -> Консоль или повторите попытку позже.",
|
||||||
"Gen_NetworkMask": "Маска сети",
|
"Gen_NetworkMask": "Маска сети",
|
||||||
"Gen_Offline": "Оффлайн",
|
"Gen_Offline": "Оффлайн",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "",
|
"Gen_Filter": "",
|
||||||
"Gen_Generate": "",
|
"Gen_Generate": "",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "",
|
"Gen_LockedDB": "",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "",
|
"Gen_Offline": "",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Filtre",
|
"Gen_Filter": "Filtre",
|
||||||
"Gen_Generate": "Oluştur",
|
"Gen_Generate": "Oluştur",
|
||||||
"Gen_InvalidMac": "",
|
"Gen_InvalidMac": "",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "HATA - Veritabanı kilitlenmiş olabilir - F12 Geliştirici araçlarını -> Konsol kısmını kontrol edin veya daha sonra tekrar deneyin.",
|
"Gen_LockedDB": "HATA - Veritabanı kilitlenmiş olabilir - F12 Geliştirici araçlarını -> Konsol kısmını kontrol edin veya daha sonra tekrar deneyin.",
|
||||||
"Gen_NetworkMask": "",
|
"Gen_NetworkMask": "",
|
||||||
"Gen_Offline": "Çevrimdışı",
|
"Gen_Offline": "Çevrimdışı",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "Фільтр",
|
"Gen_Filter": "Фільтр",
|
||||||
"Gen_Generate": "Генерувати",
|
"Gen_Generate": "Генерувати",
|
||||||
"Gen_InvalidMac": "Недійсна Mac-адреса.",
|
"Gen_InvalidMac": "Недійсна Mac-адреса.",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "ПОМИЛКА – БД може бути заблоковано – перевірте F12 Інструменти розробника -> Консоль або спробуйте пізніше.",
|
"Gen_LockedDB": "ПОМИЛКА – БД може бути заблоковано – перевірте F12 Інструменти розробника -> Консоль або спробуйте пізніше.",
|
||||||
"Gen_NetworkMask": "Маска мережі",
|
"Gen_NetworkMask": "Маска мережі",
|
||||||
"Gen_Offline": "Офлайн",
|
"Gen_Offline": "Офлайн",
|
||||||
|
|||||||
@@ -311,6 +311,7 @@
|
|||||||
"Gen_Filter": "筛选",
|
"Gen_Filter": "筛选",
|
||||||
"Gen_Generate": "生成",
|
"Gen_Generate": "生成",
|
||||||
"Gen_InvalidMac": "无效的 Mac 地址。",
|
"Gen_InvalidMac": "无效的 Mac 地址。",
|
||||||
|
"Gen_Invalid_Value": "",
|
||||||
"Gen_LockedDB": "错误 - DB 可能被锁定 - 检查 F12 开发工具 -> 控制台或稍后重试。",
|
"Gen_LockedDB": "错误 - DB 可能被锁定 - 检查 F12 开发工具 -> 控制台或稍后重试。",
|
||||||
"Gen_NetworkMask": "网络掩码",
|
"Gen_NetworkMask": "网络掩码",
|
||||||
"Gen_Offline": "离线",
|
"Gen_Offline": "离线",
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -36,12 +36,7 @@ def main():
|
|||||||
|
|
||||||
# Check if basic config settings supplied
|
# Check if basic config settings supplied
|
||||||
if check_config() is False:
|
if check_config() is False:
|
||||||
mylog(
|
mylog("none", f"[{pluginName}] ⚠ ERROR: Publisher notification gateway not set up correctly. Check your {confFileName} {pluginName}_* variables.")
|
||||||
"none",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] ⚠ ERROR: Publisher notification gateway not set up correctly. Check your {confFileName} {pluginName}_* variables."
|
|
||||||
],
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Create a database connection
|
# Create a database connection
|
||||||
|
|||||||
@@ -377,7 +377,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import conf
|
import conf
|
||||||
from const import confFileName, logPath
|
from const import logPath
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -36,11 +36,7 @@ def main():
|
|||||||
|
|
||||||
# Check if basic config settings supplied
|
# Check if basic config settings supplied
|
||||||
if not validate_config():
|
if not validate_config():
|
||||||
mylog(
|
mylog("none", f"[{pluginName}] ⚠ ERROR: Publisher not set up correctly. Check your {pluginName}_* variables.",)
|
||||||
"none",
|
|
||||||
f"[{pluginName}] ⚠ ERROR: Publisher notification gateway not set up correctly. "
|
|
||||||
f"Check your {confFileName} {pluginName}_* variables.",
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Create a database connection
|
# Create a database connection
|
||||||
|
|||||||
@@ -225,7 +225,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -138,10 +138,7 @@ def execute_arpscan(userSubnets):
|
|||||||
mylog("verbose", [f"[{pluginName}] All devices List len:", len(devices_list)])
|
mylog("verbose", [f"[{pluginName}] All devices List len:", len(devices_list)])
|
||||||
mylog("verbose", [f"[{pluginName}] Devices List:", devices_list])
|
mylog("verbose", [f"[{pluginName}] Devices List:", devices_list])
|
||||||
|
|
||||||
mylog(
|
mylog("verbose", [f"[{pluginName}] Found: Devices without duplicates ", len(unique_devices)],)
|
||||||
"verbose",
|
|
||||||
[f"[{pluginName}] Found: Devices without duplicates ", len(unique_devices)],
|
|
||||||
)
|
|
||||||
|
|
||||||
return unique_devices
|
return unique_devices
|
||||||
|
|
||||||
@@ -174,10 +171,7 @@ def execute_arpscan_on_interface(interface):
|
|||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
result = ""
|
result = ""
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
mylog(
|
mylog("warning", [f"[{pluginName}] arp-scan timed out after {timeout_seconds}s"],)
|
||||||
"warning",
|
|
||||||
[f"[{pluginName}] arp-scan timed out after {timeout_seconds}s"],
|
|
||||||
)
|
|
||||||
result = ""
|
result = ""
|
||||||
# stop looping if duration not set or expired
|
# stop looping if duration not set or expired
|
||||||
if scan_duration == 0 or (time.time() - start_time) > scan_duration:
|
if scan_duration == 0 or (time.time() - start_time) > scan_duration:
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ def main():
|
|||||||
|
|
||||||
device_data = get_device_data()
|
device_data = get_device_data()
|
||||||
|
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Found '{len(device_data)}' devices")
|
||||||
"verbose",
|
|
||||||
[f"[{pluginName}] Found '{len(device_data)}' devices"],
|
|
||||||
)
|
|
||||||
|
|
||||||
filtered_devices = [
|
filtered_devices = [
|
||||||
(key, device)
|
(key, device)
|
||||||
@@ -44,10 +41,7 @@ def main():
|
|||||||
if device.state == ConnectionState.CONNECTED
|
if device.state == ConnectionState.CONNECTED
|
||||||
]
|
]
|
||||||
|
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Processing '{len(filtered_devices)}' connected devices")
|
||||||
"verbose",
|
|
||||||
[f"[{pluginName}] Processing '{len(filtered_devices)}' connected devices"],
|
|
||||||
)
|
|
||||||
|
|
||||||
for mac, device in filtered_devices:
|
for mac, device in filtered_devices:
|
||||||
entry_mac = str(device.description.mac).lower()
|
entry_mac = str(device.description.mac).lower()
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -185,7 +185,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -75,10 +75,7 @@ def cleanup_database(
|
|||||||
|
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Cleanup Online History
|
# Cleanup Online History
|
||||||
mylog(
|
mylog("verbose", [f"[{pluginName}] Online_History: Delete all but keep latest 150 entries"],)
|
||||||
"verbose",
|
|
||||||
[f"[{pluginName}] Online_History: Delete all but keep latest 150 entries"],
|
|
||||||
)
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
"""DELETE from Online_History where "Index" not in (
|
"""DELETE from Online_History where "Index" not in (
|
||||||
SELECT "Index" from Online_History
|
SELECT "Index" from Online_History
|
||||||
@@ -87,24 +84,14 @@ def cleanup_database(
|
|||||||
|
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Cleanup Events
|
# Cleanup Events
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Events: Delete all older than {str(DAYS_TO_KEEP_EVENTS)} days (DAYS_TO_KEEP_EVENTS setting)")
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] Events: Delete all older than {str(DAYS_TO_KEEP_EVENTS)} days (DAYS_TO_KEEP_EVENTS setting)"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
cursor.execute(
|
cursor.execute(
|
||||||
f"""DELETE FROM Events
|
f"""DELETE FROM Events
|
||||||
WHERE eve_DateTime <= date('now', '-{str(DAYS_TO_KEEP_EVENTS)} day')"""
|
WHERE eve_DateTime <= date('now', '-{str(DAYS_TO_KEEP_EVENTS)} day')"""
|
||||||
)
|
)
|
||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Trim Plugins_History entries to less than PLUGINS_KEEP_HIST setting per unique "Plugin" column entry
|
# Trim Plugins_History entries to less than PLUGINS_KEEP_HIST setting per unique "Plugin" column entry
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Plugins_History: Trim Plugins_History entries to less than {str(PLUGINS_KEEP_HIST)} per Plugin (PLUGINS_KEEP_HIST setting)")
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] Plugins_History: Trim Plugins_History entries to less than {str(PLUGINS_KEEP_HIST)} per Plugin (PLUGINS_KEEP_HIST setting)"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build the SQL query to delete entries that exceed the limit per unique "Plugin" column entry
|
# Build the SQL query to delete entries that exceed the limit per unique "Plugin" column entry
|
||||||
delete_query = f"""DELETE FROM Plugins_History
|
delete_query = f"""DELETE FROM Plugins_History
|
||||||
@@ -125,12 +112,7 @@ def cleanup_database(
|
|||||||
|
|
||||||
histCount = get_setting_value("DBCLNP_NOTIFI_HIST")
|
histCount = get_setting_value("DBCLNP_NOTIFI_HIST")
|
||||||
|
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Plugins_History: Trim Notifications entries to less than {histCount}")
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] Plugins_History: Trim Notifications entries to less than {histCount}"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
# Build the SQL query to delete entries
|
# Build the SQL query to delete entries
|
||||||
delete_query = f"""DELETE FROM Notifications
|
delete_query = f"""DELETE FROM Notifications
|
||||||
@@ -170,12 +152,7 @@ def cleanup_database(
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Cleanup New Devices
|
# Cleanup New Devices
|
||||||
if HRS_TO_KEEP_NEWDEV != 0:
|
if HRS_TO_KEEP_NEWDEV != 0:
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_NEWDEV)} hours (HRS_TO_KEEP_NEWDEV setting)")
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_NEWDEV)} hours (HRS_TO_KEEP_NEWDEV setting)"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
query = f"""DELETE FROM Devices WHERE devIsNew = 1 AND devFirstConnection < date('now', '-{str(HRS_TO_KEEP_NEWDEV)} hour')"""
|
query = f"""DELETE FROM Devices WHERE devIsNew = 1 AND devFirstConnection < date('now', '-{str(HRS_TO_KEEP_NEWDEV)} hour')"""
|
||||||
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
||||||
cursor.execute(query)
|
cursor.execute(query)
|
||||||
@@ -183,12 +160,7 @@ def cleanup_database(
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Cleanup Offline Devices
|
# Cleanup Offline Devices
|
||||||
if HRS_TO_KEEP_OFFDEV != 0:
|
if HRS_TO_KEEP_OFFDEV != 0:
|
||||||
mylog(
|
mylog("verbose", f"[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_OFFDEV)} hours (HRS_TO_KEEP_OFFDEV setting)")
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f"[{pluginName}] Devices: Delete all New Devices older than {str(HRS_TO_KEEP_OFFDEV)} hours (HRS_TO_KEEP_OFFDEV setting)"
|
|
||||||
],
|
|
||||||
)
|
|
||||||
query = f"""DELETE FROM Devices WHERE devPresentLastScan = 0 AND devLastConnection < date('now', '-{str(HRS_TO_KEEP_OFFDEV)} hour')"""
|
query = f"""DELETE FROM Devices WHERE devPresentLastScan = 0 AND devLastConnection < date('now', '-{str(HRS_TO_KEEP_OFFDEV)} hour')"""
|
||||||
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
||||||
cursor.execute(query)
|
cursor.execute(query)
|
||||||
@@ -196,12 +168,7 @@ def cleanup_database(
|
|||||||
# -----------------------------------------------------
|
# -----------------------------------------------------
|
||||||
# Clear New Flag
|
# Clear New Flag
|
||||||
if CLEAR_NEW_FLAG != 0:
|
if CLEAR_NEW_FLAG != 0:
|
||||||
mylog(
|
mylog("verbose", f'[{pluginName}] Devices: Clear "New Device" flag for all devices older than {str(CLEAR_NEW_FLAG)} hours (CLEAR_NEW_FLAG setting)')
|
||||||
"verbose",
|
|
||||||
[
|
|
||||||
f'[{pluginName}] Devices: Clear "New Device" flag for all devices older than {str(CLEAR_NEW_FLAG)} hours (CLEAR_NEW_FLAG setting)'
|
|
||||||
],
|
|
||||||
)
|
|
||||||
query = f"""UPDATE Devices SET devIsNew = 0 WHERE devIsNew = 1 AND date(devFirstConnection, '+{str(CLEAR_NEW_FLAG)} hour') < date('now')"""
|
query = f"""UPDATE Devices SET devIsNew = 0 WHERE devIsNew = 1 AND date(devFirstConnection, '+{str(CLEAR_NEW_FLAG)} hour') < date('now')"""
|
||||||
# select * from Devices where devIsNew = 1 AND date(devFirstConnection, '+3 hour' ) < date('now')
|
# select * from Devices where devIsNew = 1 AND date(devFirstConnection, '+3 hour' ) < date('now')
|
||||||
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
mylog("verbose", [f"[{pluginName}] Query: {query} "])
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -596,7 +596,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -397,7 +397,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -180,7 +180,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -203,7 +203,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -468,7 +468,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -71,10 +71,7 @@ def get_entries(plugin_objects: Plugin_Objects) -> Plugin_Objects:
|
|||||||
status = lease.get('status')
|
status = lease.get('status')
|
||||||
device_name = comment or host_name or "(unknown)"
|
device_name = comment or host_name or "(unknown)"
|
||||||
|
|
||||||
mylog(
|
mylog('verbose', f"ID: {lease_id}, Address: {address}, MAC: {mac_address}, Host Name: {host_name}, Comment: {comment}, Last Seen: {last_seen}, Status: {status}")
|
||||||
'verbose',
|
|
||||||
[f"ID: {lease_id}, Address: {address}, MAC Address: {mac_address}, Host Name: {host_name}, Comment: {comment}, Last Seen: {last_seen}, Status: {status}"]
|
|
||||||
)
|
|
||||||
|
|
||||||
if (status == "bound"):
|
if (status == "bound"):
|
||||||
plugin_objects.add_object(
|
plugin_objects.add_object(
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -227,7 +227,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import hashlib
|
|
||||||
import re
|
import re
|
||||||
import nmap
|
import nmap
|
||||||
|
|
||||||
@@ -17,6 +16,7 @@ from plugin_helper import Plugin_Objects # noqa: E402 [flake8 lint suppression]
|
|||||||
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
from logger import mylog, Logger # noqa: E402 [flake8 lint suppression]
|
||||||
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
from helper import get_setting_value # noqa: E402 [flake8 lint suppression]
|
||||||
from const import logPath # noqa: E402 [flake8 lint suppression]
|
from const import logPath # noqa: E402 [flake8 lint suppression]
|
||||||
|
from utils.crypto_utils import string_to_mac_hash # noqa: E402 [flake8 lint suppression]
|
||||||
import conf # noqa: E402 [flake8 lint suppression]
|
import conf # noqa: E402 [flake8 lint suppression]
|
||||||
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
from pytz import timezone # noqa: E402 [flake8 lint suppression]
|
||||||
|
|
||||||
@@ -177,16 +177,6 @@ def parse_nmap_xml(xml_output, interface, fakeMac):
|
|||||||
return devices_list
|
return devices_list
|
||||||
|
|
||||||
|
|
||||||
def string_to_mac_hash(input_string):
|
|
||||||
# Calculate a hash using SHA-256
|
|
||||||
sha256_hash = hashlib.sha256(input_string.encode()).hexdigest()
|
|
||||||
|
|
||||||
# Take the first 12 characters of the hash and format as a MAC address
|
|
||||||
mac_hash = ':'.join(sha256_hash[i:i + 2] for i in range(0, 12, 2))
|
|
||||||
|
|
||||||
return mac_hash
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================================
|
# ===============================================================================
|
||||||
# BEGIN
|
# BEGIN
|
||||||
# ===============================================================================
|
# ===============================================================================
|
||||||
|
|||||||
@@ -476,7 +476,7 @@
|
|||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [
|
"elementOptions": [
|
||||||
{
|
{
|
||||||
"onChange": "validateRegex(this)"
|
"focusout": "validateRegex(this)"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
"base64Regex": "Xig/OlwqfCg/OlswLTldfFsxLTVdWzAtOV18WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlswLTldfDFbMC05XXwyWzAtM118WzAtOV0rLVswLTldK3xcKi9bMC05XSspKVxzKyg/OlwqfCg/OlsxLTldfFsxMl1bMC05XXwzWzAxXXxbMC05XSstWzAtOV0rfFwqL1swLTldKykpXHMrKD86XCp8KD86WzEtOV18MVswLTJdfFswLTldKy1bMC05XSt8XCovWzAtOV0rKSlccysoPzpcKnwoPzpbMC02XXxbMC02XS1bMC02XXxcKi9bMC05XSspKSQ="
|
||||||
|
|||||||