Compare commits

...

290 Commits

Author SHA1 Message Date
github-actions[bot]
90f4abc037 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-11 11:53:47 +00:00
github-actions[bot]
8345bda25d [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-10 11:53:46 +00:00
jokob-sk
7656ef99e8 Merge pull request #910 from ytorres/patch-1
Some checks are pending
docker / docker_dev (push) Waiting to run
Update install_dependencies.debian.sh
2024-12-10 07:35:00 +11:00
jokob-sk
9c2841167c Merge pull request #911 from ytorres/patch-2
Update start.debian.sh
2024-12-10 07:34:03 +11:00
Yannick Torrès
03056f7823 Update start.debian.sh
1/ Fix {} arround user_notifications.json file => if there is just one file, this create a file named "{user_notifications.json} ;)

2/ Fix group for the above file
2024-12-09 19:06:18 +01:00
Yannick Torrès
2275bf3114 Update install_dependencies.debian.sh
Work on a fresh installation of Debian Bookworm
2024-12-09 19:00:23 +01:00
github-actions[bot]
ac0c13dced [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-09 11:53:39 +00:00
github-actions[bot]
74df660145 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-08 11:53:53 +00:00
jokob-sk
a7e35c4697 Move of LOG folder from /app/front/log to app/log 2024-12-08 21:06:44 +11:00
jokob-sk
cd9c4a2176 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-08 19:17:17 +11:00
jokob-sk
f7160f0843 Move of API folder from /app/front/api to app/api 2024-12-08 19:17:10 +11:00
github-actions[bot]
2ad80f5ba5 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-07 11:53:34 +00:00
jokob-sk
d7858c6042 GraphQL Settings 2024-12-07 19:25:07 +11:00
jokob-sk
79c4574e21 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-07 10:38:38 +11:00
jokob-sk
daff0ee7f2 📚Docs 2024-12-07 10:38:34 +11:00
github-actions[bot]
a22df52725 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-06 11:53:32 +00:00
jokob-sk
89b4b9b98e Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-06 07:39:00 +11:00
jokob-sk
80e8cb3f74 Icon cleanup 2024-12-06 07:38:51 +11:00
Massimo Pissarello
caef64ddf4 Translated using Weblate (Italian)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (733 of 733 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-12-05 13:00:38 +00:00
Sylvain Pichon
0d231caecd Translated using Weblate (French)
Currently translated at 100.0% (733 of 733 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-12-05 13:00:37 +00:00
gallegonovato
fbc43e6116 Translated using Weblate (Spanish)
Currently translated at 100.0% (733 of 733 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-12-05 13:00:36 +00:00
github-actions[bot]
db7a122f39 [🤖Automation] Update README with sponsors information 2024-12-05 11:53:43 +00:00
github-actions[bot]
bb39b0dc6c [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-04 11:53:56 +00:00
jokob-sk
a77dcb5809 Icon selector 2024-12-04 21:04:06 +11:00
jokob-sk
7a3c75920b Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-12-04 21:03:40 +11:00
jokob-sk
e92d1bb0ad Icon selector 2024-12-04 21:03:35 +11:00
github-actions[bot]
acfad67d45 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-03 11:53:51 +00:00
github-actions[bot]
4f9ac3df75 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-02 11:53:47 +00:00
jokob-sk
989d5dde8a FREEBOX attribution
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-02 12:45:31 +11:00
jokob-sk
4a75f9298f Merge pull request #901 from KayJay7/feature/freebox
Added FREEBOX plugin by @KayJay7 and @Lucide 🙏
2024-12-02 12:08:36 +11:00
jokob-sk
ea16302f1f Merge branch 'main' into feature/freebox 2024-12-02 12:04:33 +11:00
Alvise Bruniera
12f2d12d52 Updated FREEBOX documentation to mention the Iliadbox gateway 2024-12-02 00:17:32 +01:00
Alvise Bruniera
ae2f898b39 Added the Iliad certificate for Iliadbox support in the FREEBOX plugin 2024-12-02 00:14:34 +01:00
Alvise Bruniera
6b00d5339d Added dependency for FREEBOX in DOCKERFILE 2024-12-02 00:09:16 +01:00
jokob-sk
826bd8f524 NEWDEV_replace_preset_icon 2024-12-02 09:29:13 +11:00
jokob-sk
d4837c8d75 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-12-02 08:31:30 +11:00
jokob-sk
acdbe06f3d Sync - skip devStatus 2024-12-02 08:31:26 +11:00
anton garcias
c07481f1a8 Translated using Weblate (Catalan)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (732 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/
2024-12-01 15:00:33 +01:00
Massimo Pissarello
f3933998a5 Translated using Weblate (Italian)
Currently translated at 100.0% (732 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-12-01 15:00:32 +01:00
Sylvain Pichon
8935407b64 Translated using Weblate (French)
Currently translated at 100.0% (732 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-12-01 15:00:31 +01:00
gallegonovato
997465b63c Translated using Weblate (Spanish)
Currently translated at 100.0% (732 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-12-01 15:00:30 +01:00
Ettore Atalan
a2c4f2e618 Translated using Weblate (German)
Currently translated at 92.0% (674 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-12-01 15:00:29 +01:00
MVLPGaming
bbb2f3b718 Translated using Weblate (German)
Currently translated at 92.0% (674 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-12-01 15:00:28 +01:00
github-actions[bot]
2110d51c80 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-12-01 11:53:37 +00:00
jokob-sk
d2ad35628f Merge pull request #894 from Leicas/main
Some checks are pending
docker / docker_dev (push) Waiting to run
Fix for issue with OMADA plyging with ip detection sometimes breaking.
2024-12-01 12:23:24 +11:00
jokob-sk
1f3fd6825b Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-12-01 12:14:12 +11:00
jokob-sk
89840906a0 ICMP plugin 🆕 2024-12-01 12:13:56 +11:00
Anonymous
fb35548d99 Translated using Weblate (Catalan)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 97.9% (717 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/
2024-11-30 14:53:23 +01:00
Anonymous
e575312013 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 91.5% (670 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/zh_Hans/
2024-11-30 14:53:22 +01:00
Anonymous
a246dc271f Translated using Weblate (Polish)
Currently translated at 92.0% (674 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pl/
2024-11-30 14:53:22 +01:00
Anonymous
b10977b3c9 Translated using Weblate (Portuguese (Brazil))
Currently translated at 33.3% (244 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pt_BR/
2024-11-30 14:53:22 +01:00
Anonymous
be2c3733ca Translated using Weblate (Italian)
Currently translated at 97.9% (717 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-30 14:53:22 +01:00
Anonymous
01186a76f6 Translated using Weblate (Russian)
Currently translated at 97.9% (717 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-11-30 14:53:22 +01:00
Anonymous
277e441dc4 Translated using Weblate (Norwegian Bokmål)
Currently translated at 91.1% (667 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/nb_NO/
2024-11-30 14:53:22 +01:00
Anonymous
7b4c280d6d Translated using Weblate (French)
Currently translated at 97.9% (717 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-30 14:53:22 +01:00
Anonymous
c63f476370 Translated using Weblate (Spanish)
Currently translated at 97.9% (717 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-30 14:53:22 +01:00
Anonymous
93f4932854 Translated using Weblate (German)
Currently translated at 89.4% (655 of 732 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-11-30 14:53:22 +01:00
jokob-sk
1b116ebced IPNEIGH cleanup + attribution 2024-11-30 23:59:42 +11:00
jokob-sk
2baeef9179 Merge pull request #900 from jokob-sk/feature/IPNEIGH
Some checks are pending
docker / docker_dev (push) Waiting to run
Feature/ipneigh
2024-11-30 23:37:23 +11:00
jokob-sk
80a2261b21 Weblate 2024-11-30 23:36:19 +11:00
jokob-sk
afaac3277d Device Edit Rebuild + New Dummy Device 2024-11-30 23:34:20 +11:00
github-actions[bot]
d80a779205 [🤖Automation] Update README with sponsors information 2024-11-30 11:53:40 +00:00
Alvise Bruniera
6cb56525f3 Added the FREEBOX plugin to the plugin table 2024-11-30 11:31:05 +01:00
Alvise Bruniera
4e27a0df9e Changed description of a setting for the FREEBOX plugin 2024-11-30 11:27:04 +01:00
Alvise Bruniera
9a82d93f11 Added README for the FREEBOX plugin 2024-11-30 01:41:45 +01:00
Alvise Bruniera
925673706c Added FREEBOX plugin
Co-authored-by: artemiscode@hotmail.it <artemiscode@hotmail.it>
2024-11-29 20:41:41 +01:00
github-actions[bot]
a8e8162b3b [🤖Automation] Update README with sponsors information
Some checks failed
docker / docker_dev (push) Has been cancelled
2024-11-29 11:53:47 +00:00
Safeguard
1a2f0e13cd Translated using Weblate (Russian)
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-11-29 08:00:34 +00:00
jokob-sk
148eb5aa51 Merge pull request #896 from KayJay7/plugin/ipneigh
Add IPNEIGH plugin for IPv4/6 discovery using the `ip neigh` command by @KayJay7 🙏
2024-11-29 08:04:04 +11:00
github-actions[bot]
8492c7c50f [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-28 11:53:38 +00:00
KayJay7
e34281045d Fixed offline detection in IPNEIGH 2024-11-28 10:14:22 +00:00
github-actions[bot]
efe7458cce [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-27 11:53:45 +00:00
KayJay7
d92ebc24de Fixed note in IPNEIGH README.md 2024-11-26 14:37:17 +00:00
KayJay7
e6274b9f3d Added IPNEIGH to the plugins README.md file 2024-11-26 14:18:21 +00:00
KayJay7
c43b48ee5a Added IPNEIGH plugin 2024-11-26 14:05:42 +00:00
github-actions[bot]
473fa8f7b5 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-26 11:53:53 +00:00
SAVAS
d001a60595 Translated using Weblate (Turkish)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 22.9% (165 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/tr/
2024-11-26 08:05:46 +01:00
Sylvain Pichon
681b41e7d4 Translated using Weblate (French)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-25 20:42:00 +01:00
github-actions[bot]
bb262a0197 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-25 11:53:35 +00:00
Antoine Weill--Duflos
96be21fd68 Fix for issue with ip detection sometimes breaking. 2024-11-24 15:55:35 -05:00
github-actions[bot]
43521037cb [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-24 11:54:33 +00:00
github-actions[bot]
b86f2bf984 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-23 11:53:34 +00:00
Hosted Weblate
8f573cb41a Merge branch 'origin/main' into Weblate.
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-22 23:40:48 +00:00
anton garcias
17a3599d8f Translated using Weblate (Catalan)
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/
2024-11-22 23:39:47 +00:00
Anonymous
39b3064355 Translated using Weblate (French)
Currently translated at 99.8% (718 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-22 23:39:45 +00:00
jokob-sk
67fd08a093 chore:AdminLTE removal of bloat 2024-11-23 10:39:09 +11:00
jokob-sk
49254c92f8 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-23 09:29:07 +11:00
jokob-sk
f1f40021ee chore:Settings DB table refactor 2024-11-23 09:28:40 +11:00
github-actions[bot]
9af4fb5c85 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-22 11:53:40 +00:00
Hosted Weblate
5a4972a200 Merge branch 'origin/main' into Weblate. 2024-11-22 09:33:10 +00:00
anton garcias
70fe7b9c9c Translated using Weblate (Catalan)
Currently translated at 77.8% (560 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/
2024-11-22 09:33:09 +00:00
jokob-sk
0e438ffd57 chore:PHOLUS removal 2024-11-22 20:32:49 +11:00
jokob-sk
e776c3ac41 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-22 19:01:39 +11:00
jokob-sk
81af82073e (Unknown) vendor not updated #889 2024-11-22 19:01:20 +11:00
Hosted Weblate
cddf4cf086 Merge branch 'origin/main' into Weblate. 2024-11-22 07:43:50 +00:00
Massimo Pissarello
a4f3d8c60e Translated using Weblate (Italian)
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-22 07:43:49 +00:00
Sylvain Pichon
a8a2dab4bc Translated using Weblate (French)
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-22 07:43:48 +00:00
jokob-sk
9b0c722922 (Unknown) vendor not updated #889 2024-11-22 18:43:30 +11:00
jokob-sk
8f9c3d2091 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-22 13:23:38 +11:00
jokob-sk
c5ef9645e6 WAL truncating #769 2024-11-22 13:23:11 +11:00
Hosted Weblate
04faef6dae Merge branch 'origin/main' into Weblate. 2024-11-22 02:33:36 +01:00
gallegonovato
825bff9ce7 Translated using Weblate (Spanish)
Currently translated at 100.0% (719 of 719 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-22 02:33:36 +01:00
jokob-sk
eee84b23b8 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-22 12:33:24 +11:00
jokob-sk
a9a4d397dc (unknown) vendor update #889 2024-11-22 12:33:08 +11:00
Hosted Weblate
a0508f2db9 Merge branch 'origin/main' into Weblate.
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-22 00:14:34 +01:00
Sylvain Pichon
72942cb0d1 Translated using Weblate (French)
Currently translated at 100.0% (718 of 718 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-22 00:14:33 +01:00
jokob-sk
ca87a56549 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-22 10:13:44 +11:00
jokob-sk
84c5fdae43 Settings app.conf RW check + VNDRPDT plugin 2024-11-22 10:12:35 +11:00
github-actions[bot]
39473593c2 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-21 11:53:44 +00:00
github-actions[bot]
bc8e845385 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-20 11:53:54 +00:00
github-actions[bot]
1eee710040 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-19 11:53:35 +00:00
Massimo Pissarello
948635433a Translated using Weblate (Italian)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (718 of 718 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-19 03:01:03 +00:00
gallegonovato
302ab4b1d8 Translated using Weblate (Spanish)
Currently translated at 100.0% (718 of 718 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-19 03:01:02 +00:00
github-actions[bot]
7538b17695 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-18 11:53:48 +00:00
jokob-sk
55881249e2 Reverse proxy fix #779 2024-11-18 22:45:48 +11:00
jokob-sk
1b404e579a Prevent empty API_TOKEN #779 2024-11-18 22:34:39 +11:00
jokob-sk
ff9be75871 Prevent empty API_TOKEN #779 2024-11-18 22:21:49 +11:00
jokob-sk
b3d256339f 📚Docs 2024-11-18 22:11:21 +11:00
jokob-sk
0c4c8ca5c3 📚Docs 2024-11-18 21:49:16 +11:00
jokob-sk
69d41f2ed4 GraphQl 0.11.18.1 - better api_token initialization + menu fixes
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-18 12:16:49 +11:00
jokob-sk
76d1ec46a6 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-17 23:07:49 +11:00
jokob-sk
5aae841b82 GraphQl 0.2.17.7 - test script 2024-11-17 23:07:32 +11:00
github-actions[bot]
87ee8efe36 [🤖Automation] Update README with sponsors information 2024-11-17 11:53:44 +00:00
jokob-sk
404c5cc34b GraphQl 0.2.17.6 - pagination fix 2024-11-17 22:20:28 +11:00
jokob-sk
6d8dcc7a22 GraphQl 0.2.17.5 - deal with null values 2024-11-17 22:14:42 +11:00
jokob-sk
e6b82c14ff GraphQl 0.2.17.4 - deal with null values 2024-11-17 22:10:09 +11:00
jokob-sk
410becfe21 GraphQl 0.2.17.3 - sorting, filtering fix 2024-11-17 21:29:58 +11:00
jokob-sk
202baab409 GraphQl 0.2.17.2 - device tiles + filtering
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-17 15:43:30 +11:00
jokob-sk
31121eab2a Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-17 14:35:43 +11:00
jokob-sk
78fc9214bb GraphQl 0.11.17.1 - better api_token initialization + device tiles 2024-11-17 14:35:39 +11:00
github-actions[bot]
52632bc8ef [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-16 11:53:44 +00:00
jokob-sk
6407ee5c13 GraphQl 0.11.16.2 - better api_token initialization
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-16 14:11:10 +11:00
jokob-sk
ab8b07e614 GraphQl 0.11.16.1 - better port initialization 2024-11-16 13:41:54 +11:00
jokob-sk
81d3ee4af7 EMail Date #885 2024-11-16 13:03:04 +11:00
jokob-sk
4e90a82ea4 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-15 23:28:22 +11:00
jokob-sk
70e0542488 GraphQl 0.125 - Threading issues 2024-11-15 23:27:26 +11:00
github-actions[bot]
8b1830569b [🤖Automation] Update README with sponsors information 2024-11-15 11:53:38 +00:00
jokob-sk
60492157d1 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-15 20:13:10 +11:00
jokob-sk
44b18e131c GraphQl 0.124 - Running server check 2024-11-15 20:13:03 +11:00
anton garcias
7512d31e1b Translated using Weblate (Catalan)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 51.2% (367 of 716 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ca/
2024-11-14 19:00:25 +01:00
Safeguard
815480513c Translated using Weblate (Russian)
Currently translated at 100.0% (716 of 716 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-11-14 19:00:23 +01:00
github-actions[bot]
d1f3998fbf [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-14 11:53:39 +00:00
jokob-sk
7fae6a8cce Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-14 16:50:29 +11:00
jokob-sk
c1c6813b6e GraphQl 0.123 - Dynamic columns + re-adding old Device table columns 2024-11-14 16:50:23 +11:00
github-actions[bot]
66786d1d42 [🤖Automation] Update README with sponsors information
Some checks failed
docker / docker_dev (push) Has been cancelled
2024-11-13 11:53:46 +00:00
jokob-sk
072821181a GraphQl 0.122 - Sorting partially working
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-13 08:50:04 +11:00
jokob-sk
359360a5ea Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-12 23:17:23 +11:00
jokob-sk
f007eac656 GraphQl 0.121 - Pagination working 2024-11-12 23:17:20 +11:00
github-actions[bot]
5bed1172b6 [🤖Automation] Update README with sponsors information 2024-11-12 11:53:33 +00:00
Massimo Pissarello
76d1805439 Translated using Weblate (Italian)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (716 of 716 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-11 15:00:27 +01:00
Sylvain Pichon
34db6fec6c Translated using Weblate (French)
Currently translated at 100.0% (716 of 716 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-11 15:00:26 +01:00
gallegonovato
4f082b223d Translated using Weblate (Spanish)
Currently translated at 100.0% (716 of 716 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-11 15:00:24 +01:00
github-actions[bot]
cc8cddb039 [🤖Automation] Update README with sponsors information 2024-11-11 11:53:39 +00:00
jokob-sk
79fe759470 GraphQL 0.12 - devices.php use 2024-11-11 22:45:15 +11:00
jokob-sk
39bf09c24c Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-11 12:01:23 +11:00
jokob-sk
60777b2f82 GraphQL 0.11 - Load devices json on Query, _KEEP_ bugfix for old settings 2024-11-11 12:01:09 +11:00
github-actions[bot]
f4928e3895 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-10 11:54:02 +00:00
jokob-sk
bf9f55355e Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-10 21:23:09 +11:00
jokob-sk
0bc8b39cec 🔺GraphQL v0.1 + Devices table rebuild + removal of backend compatible scripts 2024-11-10 21:22:45 +11:00
github-actions[bot]
cf6c6a3510 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-09 11:53:49 +00:00
github-actions[bot]
ad359a5a4d [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-08 11:53:53 +00:00
github-actions[bot]
2663fbce0f [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-07 11:53:50 +00:00
github-actions[bot]
70a771e687 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-06 11:53:53 +00:00
jokob-sk
3cf3305b8f Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-06 08:14:37 +11:00
jokob-sk
775e46529d Integer name casues restart #874 2024-11-06 08:14:32 +11:00
github-actions[bot]
adf2ac3341 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-05 11:53:56 +00:00
github-actions[bot]
f426d7b960 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-04 11:53:37 +00:00
github-actions[bot]
dd3229284c [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-03 11:53:49 +00:00
github-actions[bot]
106ec07f3b [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-02 11:53:45 +00:00
Massimo Pissarello
4fb1a55ac0 Translated using Weblate (Italian)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-02 12:00:22 +01:00
gallegonovato
03239cd2b0 Translated using Weblate (Spanish)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-02 12:00:21 +01:00
jokob-sk
6523932a87 Update i-have-an-issue.yml
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-02 08:11:23 +11:00
jokob-sk
73e27a3883 Update i-have-an-issue.yml 2024-11-02 08:09:53 +11:00
github-actions[bot]
827fdd1504 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-11-01 11:53:49 +00:00
Anonymous
1f01bae1fd Translated using Weblate (Italian)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-11-01 11:47:47 +01:00
Anonymous
37a39e23df Translated using Weblate (French)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-11-01 11:47:47 +01:00
gallegonovato
7ce0215a56 Translated using Weblate (Spanish)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-01 11:47:46 +01:00
Anonymous
70be053bd2 Translated using Weblate (Spanish)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-11-01 11:47:46 +01:00
jokob-sk
ab0e99d870 Better settings description for name scanners #870 2024-11-01 20:13:25 +11:00
jokob-sk
2b9f009e8b Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-11-01 19:39:00 +11:00
jokob-sk
580c5ae36a Catalan empty lang file added 2024-11-01 19:38:55 +11:00
Safeguard
08644feac3 Translated using Weblate (Russian)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-11-01 09:00:25 +01:00
github-actions[bot]
d4b5672081 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-31 11:53:33 +00:00
Safeguard
1378c8707d Translated using Weblate (Russian)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-10-31 08:18:16 +01:00
jokob-sk
c6b5f0d18a Better descriptions
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-31 15:19:52 +11:00
jokob-sk
a6322f6cfa Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-31 15:19:24 +11:00
jokob-sk
c0bfb0d4e4 Better descriptions 2024-10-31 15:19:18 +11:00
github-actions[bot]
9c42cb0013 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-30 11:53:43 +00:00
Massimo Pissarello
e42c3d8b76 Translated using Weblate (Italian)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-30 03:08:06 +01:00
BlueTurtle
f13d3c38aa Translated using Weblate (French)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-10-30 03:08:05 +01:00
github-actions[bot]
38b8eaffe1 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-29 11:53:48 +00:00
Anonymous
4be345af45 Translated using Weblate (Chinese (Simplified Han script))
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 94.3% (672 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/zh_Hans/
2024-10-29 01:00:22 +00:00
Anonymous
36dd3f9f06 Translated using Weblate (Polish)
Currently translated at 95.0% (677 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pl/
2024-10-29 01:00:21 +00:00
Anonymous
a4b2fb0abf Translated using Weblate (Portuguese (Brazil))
Currently translated at 33.9% (242 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pt_BR/
2024-10-29 01:00:21 +00:00
Anonymous
de35cdafda Translated using Weblate (Italian)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-29 01:00:20 +00:00
Anonymous
96bce2666f Translated using Weblate (Russian)
Currently translated at 98.4% (701 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-10-29 01:00:19 +00:00
Anonymous
95d3fc55ab Translated using Weblate (Norwegian Bokmål)
Currently translated at 93.9% (669 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/nb_NO/
2024-10-29 01:00:18 +00:00
Anonymous
868210598f Translated using Weblate (French)
Currently translated at 98.7% (703 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-10-29 01:00:16 +00:00
Anonymous
fa14e657c9 Translated using Weblate (Spanish)
Currently translated at 99.8% (711 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-10-29 01:00:15 +00:00
Anonymous
84c1aad700 Translated using Weblate (German)
Currently translated at 92.4% (658 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-10-29 01:00:14 +00:00
github-actions[bot]
3c6a48617a [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-28 11:53:56 +00:00
jokob-sk
20c9b8c5ca 📚 Better notification docs + exclude New Device eve if disabled Alert Events
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-28 11:22:11 +11:00
jokob-sk
10ed589cd5 📚 Better notification docs + exclude New Device eve if disabled Alert Events 2024-10-28 11:17:34 +11:00
jokob-sk
bb33ab16fd Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-28 07:56:44 +11:00
jokob-sk
12c848d3cd Settins time logging + Saving Location issue #862 2024-10-28 07:56:38 +11:00
github-actions[bot]
87a0dbba46 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-27 11:53:46 +00:00
Massimo Pissarello
ea62b1116f Translated using Weblate (Italian)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-27 08:00:23 +01:00
gallegonovato
b52c7ae0ed Translated using Weblate (Spanish)
Currently translated at 100.0% (712 of 712 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-10-27 08:00:22 +01:00
github-actions[bot]
f46bfde782 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-26 11:53:45 +00:00
Hosted Weblate
463d7d7524 Merge branch 'origin/main' into Weblate.
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-26 02:33:00 +02:00
Massimo Pissarello
8e4e7bd76d Translated using Weblate (Italian)
Currently translated at 100.0% (706 of 706 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-26 02:33:00 +02:00
jokob-sk
cac35e2f20 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-26 11:32:45 +11:00
jokob-sk
425381a63e 🆕 Presence chart key 2024-10-26 11:32:29 +11:00
github-actions[bot]
9f6e61581e [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-25 11:53:42 +00:00
jokob-sk
9c255c77d1 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-25 08:00:09 +11:00
jokob-sk
c47ac62e9a 🆕 Delete offline after N hours HRS_TO_KEEP_OFFDEV #865 2024-10-25 07:59:53 +11:00
github-actions[bot]
7e2999b28a [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-24 11:53:49 +00:00
jokob-sk
840413843b Network diagram - Alphabetical sorting #860 2024-10-24 22:00:50 +11:00
jokob-sk
4c46b27643 🔌Plugins page rebuild with DataTables 2024-10-24 21:51:16 +11:00
jokob-sk
907a3e1df8 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-24 08:03:02 +11:00
jokob-sk
27131af434 Network diagram - Infinite recursion detection #857 2024-10-24 08:02:58 +11:00
github-actions[bot]
4d35013d3e [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-23 11:53:57 +00:00
github-actions[bot]
4e481f9307 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-22 11:53:41 +00:00
github-actions[bot]
05e4de0dc8 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-21 11:53:55 +00:00
Hosted Weblate
14aa07c69b Merge branch 'origin/main' into Weblate. 2024-10-21 10:50:31 +00:00
Sylvain Pichon
f0c90cef12 Translated using Weblate (French)
Currently translated at 100.0% (704 of 704 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-10-21 10:50:30 +00:00
jokob-sk
26503eaf52 🆕 IP clickable in Devices views #856 2024-10-21 21:50:01 +11:00
jokob-sk
c0f14e46ce Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-21 16:51:17 +11:00
jokob-sk
439066510f UNFIMP work - prevent incorrect MAC #848 2024-10-21 16:51:13 +11:00
gallegonovato
500822327c Translated using Weblate (Spanish)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (704 of 704 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-10-20 14:28:10 +02:00
github-actions[bot]
ed933f91f1 [🤖Automation] Update README with sponsors information 2024-10-20 11:53:35 +00:00
jokob-sk
bbb617ebda SPDTST increase maximum to 1000000 #854 + sync bugfix 2024-10-20 21:37:59 +11:00
jokob-sk
8b1e4635e6 Merge pull request #855 from johnwang16/add_events_for_imported_devs
Some checks are pending
docker / docker_dev (push) Waiting to run
Add events for imported devs - by @johnwang16 🎉
2024-10-20 13:20:15 +11:00
Massimo Pissarello
44e217a924 Translated using Weblate (Italian)
Currently translated at 100.0% (704 of 704 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-20 04:15:39 +02:00
johnwang16
400edd35d1 refactor redundant joins, bugfix event insert 2024-10-19 21:24:51 -04:00
johnwang16
9d1fccfe29 Add connection event for devices already connected 2024-10-19 15:12:33 -04:00
github-actions[bot]
6bad4764f6 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-19 11:53:37 +00:00
jokob-sk
d09bbbe73e ENV init settings fix
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-19 15:57:40 +11:00
jokob-sk
7d0b583571 Merge pull request #853 from johnwang16/auto_dark_mode
Allow auto light/dark mode matching user OS setting by @johnwang16  🙏
2024-10-19 14:30:32 +11:00
johnwang16
13a2e5ba26 bug fixes 2024-10-18 23:11:14 -04:00
jokob-sk
4af9efa8f7 Added filters to plugins 2024-10-19 13:13:55 +11:00
johnwang16
aa1a18015d Implement ui theme selector 2024-10-18 22:08:58 -04:00
jokob-sk
abd2f66814 🆕Source Plugin Column 2024-10-19 12:03:20 +11:00
johnwang16
7dd77e06d4 consolidate background-image css 2024-10-18 20:38:27 -04:00
jokob-sk
4f859b5671 🔄Sync: Generate token/key buttons #838 2024-10-19 11:20:25 +11:00
jokob-sk
e24903a123 📊Presence: Fix by the amazing @johnwang16 🙏 #814
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-19 10:27:48 +11:00
jokob-sk
367a024860 📚Docs: SyncHub Use case by @richtj999 🙏 #788 2024-10-19 10:09:36 +11:00
jokob-sk
987127302c 📚Docs: SyncHub Use case by @richtj999 🙏 #788 2024-10-19 10:06:31 +11:00
John Wang
8b1e732fa3 initial css copy for auto dark mode 2024-10-18 18:51:15 -04:00
jokob-sk
73b8ea9bfa CSS🖌️: Speedtest background 2024-10-19 09:21:25 +11:00
jokob-sk
77846df299 📚Docs: Notes On WiFi Extenders #852 2024-10-19 08:49:31 +11:00
jokob-sk
c91c31cfee ⚙️ Make Rogue DHCP timeout configurable #851 2024-10-19 08:36:17 +11:00
jokob-sk
ef2a102218 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-19 08:36:02 +11:00
jokob-sk
a8cc4de4d0 ⚙️ Make Rogue DHCP timeout configurable #851 2024-10-19 08:35:42 +11:00
gallegonovato
5f45308465 Translated using Weblate (Spanish)
Currently translated at 100.0% (702 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-10-18 22:15:51 +02:00
github-actions[bot]
e62131b832 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-18 11:53:36 +00:00
jokob-sk
68fe5fffee Merge pull request #850 from johnwang16/main
Some checks are pending
docker / docker_dev (push) Waiting to run
Fix network tree offline color for SVG icons - thanks to @johnwang16 🙏
2024-10-18 08:37:17 +11:00
John Wang
8d198b34c4 Merge pull request #1 from johnwang16/fix-nettree-icon-colors
Fix offline color for svg icons
2024-10-17 17:29:28 -04:00
John Wang
166f700425 Fix offline color for svg icons 2024-10-17 17:28:37 -04:00
jokob-sk
775f53d1d7 📚 Speedtest improvements 2024-10-18 08:16:13 +11:00
jokob-sk
3c8dae5868 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-18 08:00:31 +11:00
jokob-sk
56f1e6adf8 📚 docs + guess_icon logging 2024-10-18 08:00:27 +11:00
Safeguard
12226cb899 Translated using Weblate (Russian)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 100.0% (702 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-10-17 17:11:35 +02:00
wial88
2eb173b567 Translated using Weblate (German)
Currently translated at 93.8% (659 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-10-17 17:11:34 +02:00
github-actions[bot]
4ab8d67d76 [🤖Automation] Update README with sponsors information 2024-10-17 11:53:58 +00:00
jokob-sk
a3aa81f369 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-17 07:47:02 +11:00
jokob-sk
53f798e50e 📚 docs 2024-10-17 07:46:58 +11:00
Hosted Weblate
eeb740f60d Merge branch 'origin/main' into Weblate.
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-16 12:13:00 +00:00
Fabian Affolter
f3fd06725f Translated using Weblate (German)
Currently translated at 92.7% (651 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-10-16 12:12:59 +00:00
jokob-sk
eb16562e85 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2024-10-16 23:12:45 +11:00
jokob-sk
c77ae32736 📚 docs 2024-10-16 23:12:29 +11:00
github-actions[bot]
7549a98877 [🤖Automation] Update README with sponsors information 2024-10-16 11:53:58 +00:00
github-actions[bot]
02bf561c69 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-15 11:53:34 +00:00
Ettore Atalan
5fba247aaa Translated using Weblate (German)
Some checks are pending
docker / docker_dev (push) Waiting to run
Currently translated at 92.1% (647 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-10-14 21:15:48 +02:00
github-actions[bot]
cd4b556ee2 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-14 11:53:58 +00:00
github-actions[bot]
2471dfaf02 [🤖Automation] Update README with sponsors information
Some checks failed
docker / docker_dev (push) Has been cancelled
2024-10-13 11:53:43 +00:00
Massimo Pissarello
69d9584426 Translated using Weblate (Italian)
Currently translated at 100.0% (702 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/it/
2024-10-13 08:15:54 +00:00
Yannick Torrès
930f1a333e Translated using Weblate (French)
Currently translated at 100.0% (702 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-10-13 08:15:48 +00:00
github-actions[bot]
3d9bf32ec7 [🤖Automation] Update README with sponsors information
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-12 11:53:53 +00:00
jokob-sk
ff60ea82ea Merge pull request #837 from cvc90/Fix-Relative-URL-in-userNotifications
Changed the "absolute URL" target to "relative URL" in userNotifications.php for viewing reports
2024-10-12 18:03:21 +11:00
Anonymous
cb297aab8d Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 95.8% (673 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/zh_Hans/
2024-10-12 08:27:18 +02:00
Anonymous
7794380411 Translated using Weblate (Polish)
Currently translated at 96.5% (678 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/pl/
2024-10-12 08:27:18 +02:00
Anonymous
0c99c42b0a Translated using Weblate (Russian)
Currently translated at 99.4% (698 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/ru/
2024-10-12 08:27:18 +02:00
Anonymous
bb4f7616e4 Translated using Weblate (Norwegian Bokmål)
Currently translated at 95.4% (670 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/nb_NO/
2024-10-12 08:27:18 +02:00
Anonymous
1379923f30 Translated using Weblate (French)
Currently translated at 99.4% (698 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2024-10-12 08:27:17 +02:00
Anonymous
60e9684084 Translated using Weblate (Spanish)
Currently translated at 99.4% (698 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/es/
2024-10-12 08:27:17 +02:00
Anonymous
2235a8cf8e Translated using Weblate (German)
Currently translated at 92.7% (651 of 702 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/de/
2024-10-12 08:27:17 +02:00
Carlos V.
15eb19fda1 Update userNotifications.php
Changed the destination "absolute URL" to "relative URL" in reports to fix issues for reverse proxies
2024-10-12 08:24:35 +02:00
jokob-sk
3d51b1cd15 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX
Some checks are pending
docker / docker_dev (push) Waiting to run
2024-10-12 12:30:17 +11:00
jokob-sk
158ed324c2 docs + css 2024-10-12 12:30:00 +11:00
7348 changed files with 10767 additions and 748672 deletions

View File

@@ -9,6 +9,16 @@ body:
options:
- label: I have searched the existing open and closed issues and I checked the docs https://github.com/jokob-sk/NetAlertX/tree/main/docs
required: true
- type: checkboxes
attributes:
label: The issue occurs in the following browsers. Select at least 2.
description: This step helps me understand if this is a cache or browser-specific issue.
options:
- label: "Firefox"
- label: "Chrome"
- label: "Edge"
- label: "Safari (unsupported) - PRs welcome"
- label: "N/A - This is an issue with the backend"
- type: textarea
attributes:
label: Current Behavior
@@ -64,7 +74,7 @@ body:
***Generally speaking, all bug reports should have logs provided.***
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
Additionally, any additional info? Screenshots? References? Anything that will give us more context about the issue you are encountering!
You can use `tail -100 /app/front/log/app.log` in the container if you have trouble getting to the log files.
You can use `tail -100 /app/log/app.log` in the container if you have trouble getting to the log files.
validations:
required: false
- type: checkboxes

2
.gitignore vendored
View File

@@ -7,7 +7,9 @@ db/*
db/pialert.db
db/app.db
front/log/*
/log/*
front/api/*
/api/*
**/plugins/**/*.log
**/%40eaDir/
**/@eaDir/

View File

@@ -5,9 +5,8 @@ ARG INSTALL_DIR=/app
ENV PYTHONUNBUFFERED=1
# Install build dependencies
RUN apk add --no-cache bash python3 python3-dev gcc musl-dev libffi-dev openssl-dev \
RUN apk add --no-cache bash python3 python3-dev gcc musl-dev libffi-dev openssl-dev git\
&& python -m venv /opt/venv
# Enable venv
ENV PATH="/opt/venv/bin:$PATH"
@@ -15,11 +14,27 @@ ENV PATH="/opt/venv/bin:$PATH"
COPY . ${INSTALL_DIR}/
RUN pip install netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros \
RUN pip install graphene flask netifaces tplink-omada-client pycryptodome requests paho-mqtt scapy cron-converter pytz json2table dhcp-leases pyunifi speedtest-cli chardet python-nmap dnspython librouteros git+https://github.com/foreign-sub/aiofreepybox.git \
&& bash -c "find ${INSTALL_DIR} -type d -exec chmod 750 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f -exec chmod 640 {} \;" \
&& bash -c "find ${INSTALL_DIR} -type f \( -name '*.sh' -o -name '*.py' -o -name 'speedtest-cli' \) -exec chmod 750 {} \;"
# Append Iliadbox certificate to aiofreepybox
RUN printf "\n-----BEGIN CERTIFICATE-----\n\
MIICOjCCAcCgAwIBAgIUI0Tu7zsrBJACQIZgLMJobtbdNn4wCgYIKoZIzj0EAwIw\n\
TDELMAkGA1UEBhMCSVQxDjAMBgNVBAgMBUl0YWx5MQ4wDAYDVQQKDAVJbGlhZDEd\n\
MBsGA1UEAwwUSWxpYWRib3ggRUNDIFJvb3QgQ0EwHhcNMjAxMTI3MDkzODEzWhcN\n\
NDAxMTIyMDkzODEzWjBMMQswCQYDVQQGEwJJVDEOMAwGA1UECAwFSXRhbHkxDjAM\n\
BgNVBAoMBUlsaWFkMR0wGwYDVQQDDBRJbGlhZGJveCBFQ0MgUm9vdCBDQTB2MBAG\n\
ByqGSM49AgEGBSuBBAAiA2IABMryJyb2loHNAioY8IztN5MI3UgbVHVP/vZwcnre\n\
ZvJOyDvE4HJgIti5qmfswlnMzpNbwf/MkT+7HAU8jJoTorRm1wtAnQ9cWD3Ebv79\n\
RPwtjjy3Bza3SgdVxmd6fWPUKaNjMGEwHQYDVR0OBBYEFDUij/4lpoJ+kOXRyrcM\n\
jf2RPzOqMB8GA1UdIwQYMBaAFDUij/4lpoJ+kOXRyrcMjf2RPzOqMA8GA1UdEwEB\n\
/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQC6eUV1\n\
pFh4UpJOTc1JToztN4ttnQR6rIzxMZ6mNCe+nhjkohWp24pr7BpUYSbEizYCMAQ6\n\
LCiBKV2j7QQGy7N1aBmdur17ZepYzR1YV0eI+Kd978aZggsmhjXENQYVTmm/XA==\n\
-----END CERTIFICATE-----\n" >> /opt/venv/lib/python3.12/site-packages/aiofreepybox/freebox_certificates.pem
# second stage
FROM alpine:3.20 AS runner
@@ -57,6 +72,6 @@ COPY install/crontab /etc/crontabs/root
RUN ${INSTALL_DIR}/dockerfiles/pre-setup.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=2 \
CMD curl -sf -o /dev/null ${LISTEN_ADDR}:${PORT}/api/app_state.json
CMD curl -sf -o /dev/null ${LISTEN_ADDR}:${PORT}/php/server/query_json.php?file=app_state.json
ENTRYPOINT ["/init"]

View File

@@ -2,7 +2,7 @@
[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/netalertx?label=Size&logo=Docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/netalertx?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
[![GitHub Release](https://img.shields.io/github/v/release/jokob-sk/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub&style=for-the-badge)](https://github.com/jokob-sk/NetAlertX/releases)
[![Discord](https://img.shields.io/discord/1274490466481602755?color=0aa8d2&logoColor=fff&logo=Discord&style=for-the-badge)](https://discord.gg/UQnnHNYV)
[![Discord](https://img.shields.io/discord/1274490466481602755?color=0aa8d2&logoColor=fff&logo=Discord&style=for-the-badge)](https://discord.gg/NczTUTWyRr)
# 🖧🔍 Network scanner & notification framework
@@ -95,7 +95,6 @@ Thank you to all the wonderful people who are sponsoring this project.
<!-- SPONSORS-LIST DO NOT MODIFY BELOW -->
| All Sponsors |
|---|
| [joel72265](https://github.com/joel72265) |
<!-- SPONSORS-LIST DO NOT MODIFY ABOVE -->

View File

@@ -1,7 +1,7 @@
#!/bin/bash
export INSTALL_DIR=/app
LOG_FILE="${INSTALL_DIR}/front/log/execution_queue.log"
LOG_FILE="${INSTALL_DIR}/log/execution_queue.log"
# Check if there are any entries with cron_restart_backend
if grep -q "cron_restart_backend" "$LOG_FILE"; then

View File

@@ -30,13 +30,12 @@ IEEE_OUI_URL="http://standards-oui.ieee.org/oui/oui.txt"
# Download the file using wget
wget "$IEEE_OUI_URL" -O ieee-oui_dl.txt
# Filter lines containing "(base 16)" and remove the "(base 16)" string
grep "(base 16)" ieee-oui_dl.txt | sed 's/ *(base 16)//' > ieee-oui_new.txt
# Combine ieee-oui_new.txt and ieee-oui.txt, and extract unique MAC start values along with vendor names
# Filter lines containing "(base 16)" and format them with a tab between MAC and vendor
grep "(base 16)" ieee-oui_dl.txt | sed -E 's/ *\(base 16\)//' | awk -F' ' '{printf "%s\t%s\n", $1, substr($0, index($0, $2))}' > ieee-oui_new.txt
# Combine, sort, and remove duplicates, ensuring tab-separated output
cat ieee-oui.txt ieee-oui_new.txt >> ieee-oui_all.txt
sort ieee-oui_all.txt > ieee-oui_all_sort.txt
awk '{$1=$1; print}' ieee-oui_all_sort.txt | sort -u > ieee-oui_all_filtered.txt
sort ieee-oui_all.txt | awk '{$1=$1; print}' | sort -u | awk -F' ' '{printf "%s\t%s\n", $1, substr($0, index($0, $2))}' > ieee-oui_all_filtered.txt

View File

@@ -16,7 +16,7 @@ services:
# - ${APP_DATA_LOCATION}/netalertx_dev/db:/app/db
- ${APP_DATA_LOCATION}/netalertx/db:/app/db
# (optional) useful for debugging if you have issues setting up the container
# - ${LOGS_LOCATION}:/app/front/log
# - ${LOGS_LOCATION}:/app/log
# ---------------------------------------------------------------------------
# DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes
- ${APP_DATA_LOCATION}/netalertx/dhcp_samples/dhcp1.leases:/mnt/dhcp1.leases
@@ -25,6 +25,7 @@ services:
- ${APP_DATA_LOCATION}/netalertx/dhcp_samples/pihole_dhcp_2.leases:/etc/pihole/dhcp2.leases
- ${APP_DATA_LOCATION}/pihole/etc-pihole/pihole-FTL.db:/etc/pihole/pihole-FTL.db
- ${DEV_LOCATION}/server:/app/server
- ${DEV_LOCATION}/test:/app/test
- ${DEV_LOCATION}/dockerfiles:/app/dockerfiles
# - ${APP_DATA_LOCATION}/netalertx/php.ini:/etc/php/8.2/fpm/php.ini
- ${DEV_LOCATION}/install:/app/install
@@ -38,9 +39,10 @@ services:
- ${DEV_LOCATION}/install/user-mapping.debian.sh:/app/install/user-mapping.debian.sh
- ${DEV_LOCATION}/install/install.debian.sh:/app/install/install.debian.sh
- ${DEV_LOCATION}/install/install_dependencies.debian.sh:/app/install/install_dependencies.debian.sh
- ${DEV_LOCATION}/front/api:/app/front/api
- ${DEV_LOCATION}/api:/app/api
- ${DEV_LOCATION}/front/php:/app/front/php
- ${DEV_LOCATION}/front/deviceDetails.php:/app/front/deviceDetails.php
- ${DEV_LOCATION}/front/deviceDetailsEdit.php:/app/front/deviceDetailsEdit.php
- ${DEV_LOCATION}/front/userNotifications.php:/app/front/userNotifications.php
- ${DEV_LOCATION}/front/deviceDetailsTools.php:/app/front/deviceDetailsTools.php
- ${DEV_LOCATION}/front/devices.php:/app/front/devices.php
@@ -64,7 +66,7 @@ services:
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
# ---------------------------------------------------------------------------
environment:
# - APP_CONF_OVERRIDE={"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","UI_dark_mode":"True"}
# - APP_CONF_OVERRIDE={"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","UI_theme":"Dark"}
- TZ=${TZ}
- PORT=${PORT}
# ❗ DANGER ZONE BELOW - Setting ALWAYS_FRESH_INSTALL=true will delete the content of the /db & /config folders

View File

@@ -2,7 +2,7 @@
[![Docker Size](https://img.shields.io/docker/image-size/jokobsk/netalertx?label=Size&logo=Docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
[![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/netalertx?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff&style=for-the-badge)](https://hub.docker.com/r/jokobsk/netalertx)
[![GitHub Release](https://img.shields.io/github/v/release/jokob-sk/NetAlertX?color=0aa8d2&logoColor=fff&logo=GitHub&style=for-the-badge)](https://github.com/jokob-sk/NetAlertX/releases)
[![Discord](https://img.shields.io/discord/1274490466481602755?color=0aa8d2&logoColor=fff&logo=Discord&style=for-the-badge)](https://discord.gg/UQnnHNYV)
[![Discord](https://img.shields.io/discord/1274490466481602755?color=0aa8d2&logoColor=fff&logo=Discord&style=for-the-badge)](https://discord.gg/NczTUTWyRr)
# NetAlertX 🖧🔍 Network scanner & notification framework
@@ -41,9 +41,11 @@ docker run -d --rm --network=host \
| `PORT` |Port of the web interface | `20211` |
| `LISTEN_ADDR` |Set the specific IP Address for the listener address for the nginx webserver (web interface). This could be useful when using multiple subnets to hide the web interface from all untrusted networks. | `0.0.0.0` |
|`TZ` |Time zone to display stats correctly. Find your time zone [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) | `Europe/Berlin` |
|`APP_CONF_OVERRIDE` | JSON override for settings, e.g. `{"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","UI_dark_mode":"True"}` (Experimental 🧪) | `N/A` |
|`APP_CONF_OVERRIDE` | JSON override for settings, e.g. `{"SCAN_SUBNETS":"['192.168.1.0/24 --interface=eth1']","UI_theme":"Dark"}` (Experimental 🧪) | `N/A` |
|`ALWAYS_FRESH_INSTALL` | If `true` will delete the content of the `/db` & `/config` folders. For testing purposes. Can be coupled with [watchtower](https://github.com/containrrr/watchtower) to have an always freshly installed `netalertx`/`netalertx-dev` image. | `N/A` |
> You can override the default GraphQL port setting `GRAPHQL_PORT` (set to `20212`) by using the `APP_CONF_OVERRIDE` env variable.
### Docker paths
> [!NOTE]
@@ -53,10 +55,10 @@ docker run -d --rm --network=host \
| :------------- | :------------- | :-------------|
| ✅ | `:/app/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 (see below for details). |
| ✅ | `:/app/db` | Folder which will contain the `app.db` file |
| | `:/app/front/log` | Logs folder useful for debugging if you have issues setting up the container |
| | `:/app/log` | Logs folder useful for debugging if you have issues setting up the container |
| | `:/etc/pihole/pihole-FTL.db` | PiHole's `pihole-FTL.db` database file. Required if you want to use PiHole DB mapping. |
| | `:/etc/pihole/dhcp.leases` | PiHole's `dhcp.leases` file. Required if you want to use PiHole `dhcp.leases` file. This has to be matched with a corresponding `DHCPLSS_paths_to_check` setting entry (the path in the container must contain `pihole`)|
| | `:/app/front/api` | A simple [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. |
| | `:/app/api` | A simple [API endpoint](https://github.com/jokob-sk/NetAlertX/blob/main/docs/API.md) containing static (but regularly updated) json and other files. |
| | `:/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/front/plugins/README.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). |
@@ -127,7 +129,7 @@ services:
- local/path/config:/app/config
- local/path/db:/app/db
# (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/app/front/log
- local/path/logs:/app/log
environment:
- TZ=Europe/Berlin
- PORT=20211
@@ -176,7 +178,7 @@ services:
- ${APP_DATA_LOCATION}/netalertx/config:/app/config
- ${APP_DATA_LOCATION}/netalertx/db/:/app/db/
# (optional) useful for debugging if you have issues setting up the container
- ${LOGS_LOCATION}:/app/front/log
- ${LOGS_LOCATION}:/app/log
environment:
- TZ=${TZ}
- PORT=${PORT}
@@ -237,4 +239,4 @@ Big thanks to <a href="https://github.com/Macleykun">@Macleykun</a> & for help a
- Bitcoin: `1N8tupjeCK12qRVU2XrV17WvKK7LCawyZM`
- Ethereum: `0x6e2749Cb42F4411bc98501406BdcD82244e3f9C7`
> 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=NetAlertX) if you want to get in touch or if I should add other sponsorship platforms.
> 📧 Email me at [jokob@duck.com](mailto:jokob@duck.com?subject=NetAlertX) if you want to get in touch or if I should add other sponsorship platforms.

View File

@@ -43,6 +43,10 @@ fi
# OVERRIDE settings: Handling APP_CONF_OVERRIDE
# Check if APP_CONF_OVERRIDE is set
# remove old
rm "${INSTALL_DIR}/config/app_conf_override.json"
if [ -z "$APP_CONF_OVERRIDE" ]; then
echo "APP_CONF_OVERRIDE is not set. Skipping config file creation."
else
@@ -102,15 +106,15 @@ fi
# Create an empty log files
# Create the execution_queue.log and app_front.log files if they don't exist
touch "${INSTALL_DIR}"/front/log/{app.log,execution_queue.log,app_front.log,app.php_errors.log,stderr.log,stdout.log,db_is_locked.log}
touch "${INSTALL_DIR}"/front/api/user_notifications.json
touch "${INSTALL_DIR}"/log/{app.log,execution_queue.log,app_front.log,app.php_errors.log,stderr.log,stdout.log,db_is_locked.log}
touch "${INSTALL_DIR}"/api/user_notifications.json
echo "[INSTALL] Fixing permissions after copied starter config & DB"
chown -R nginx:www-data "${INSTALL_DIR}"/{config,front/log,db,front/api}
chown -R nginx:www-data "${INSTALL_DIR}"/front/api/user_notifications.json
chown -R nginx:www-data "${INSTALL_DIR}"/{config,log,db,api}
chown -R nginx:www-data "${INSTALL_DIR}"/api/user_notifications.json
chmod 750 "${INSTALL_DIR}"/{config,front/log,db}
find "${INSTALL_DIR}"/{config,front/log,db} -type f -exec chmod 640 {} \;
chmod 750 "${INSTALL_DIR}"/{config,log,db}
find "${INSTALL_DIR}"/{config,log,db} -type f -exec chmod 640 {} \;
# Check if buildtimestamp.txt doesn't exist
if [ ! -f "${INSTALL_DIR}/front/buildtimestamp.txt" ]; then

View File

@@ -9,7 +9,7 @@ The endpoints are updated when objects in the API endpoints are changed.
### Location of the endpoints
In the container, these files are located under the `/app/front/api/` folder and thus on the `<netalertx_url>/api/<File name>` url.
In the container, these files are located under the `/app/api/` folder. You can acces sthem via the `/php/server/query_json.php?file=user_notifications.json` endpoint.
### Available endpoints
@@ -21,7 +21,6 @@ You can access the following files:
| `notification_text.html` | The full HTML of the last email notification. |
| `notification_json_final.json` | The json version of the last notification (e.g. used for webhooks - [sample JSON](https://github.com/jokob-sk/NetAlertX/blob/main/front/report_templates/webhook_json_sample.json)). |
| `table_devices.json` | The current (at the time of the last update as mentioned above on this page) state of all of the available Devices detected by the app. |
| `table_pholus_scan.json` | The latest state of the [pholus](https://github.com/jokob-sk/NetAlertX/tree/main/pholus) (A multicast DNS and DNS Service Discovery Security Assessment Tool) scan results. |
| `table_plugins_events.json` | The list of the unprocessed (pending) notification events (plugins_events DB table). |
| `table_plugins_history.json` | The list of notification events history. |
| `table_plugins_objects.json` | The content of the plugins_objects table. Find more info on the [Plugin system here](https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins)|
@@ -58,38 +57,38 @@ Example JSON of the `table_devices.json` endpoint with two Devices (database row
{
"data": [
{
"dev_MAC": "Internet",
"dev_Name": "Net - Huawei",
"dev_DeviceType": "Router",
"dev_Vendor": null,
"dev_Group": "Always on",
"dev_FirstConnection": "2021-01-01 00:00:00",
"dev_LastConnection": "2021-01-28 22:22:11",
"dev_LastIP": "192.168.1.24",
"dev_StaticIP": 0,
"dev_PresentLastScan": 1,
"dev_LastNotification": "2023-01-28 22:22:28.998715",
"dev_NewDevice": 0,
"dev_Network_Node_MAC_ADDR": "",
"dev_Network_Node_port": "",
"dev_Icon": "globe"
"devMac": "Internet",
"devName": "Net - Huawei",
"devType": "Router",
"devVendor": null,
"devGroup": "Always on",
"devFirstConnection": "2021-01-01 00:00:00",
"devLastConnection": "2021-01-28 22:22:11",
"devLastIP": "192.168.1.24",
"devStaticIP": 0,
"devPresentLastScan": 1,
"devLastNotification": "2023-01-28 22:22:28.998715",
"devIsNew": 0,
"devParentMAC": "",
"devParentPort": "",
"devIcon": "globe"
},
{
"dev_MAC": "a4:8f:ff:aa:ba:1f",
"dev_Name": "Net - USG",
"dev_DeviceType": "Firewall",
"dev_Vendor": "Ubiquiti Inc",
"dev_Group": "",
"dev_FirstConnection": "2021-02-12 22:05:00",
"dev_LastConnection": "2021-07-17 15:40:00",
"dev_LastIP": "192.168.1.1",
"dev_StaticIP": 1,
"dev_PresentLastScan": 1,
"dev_LastNotification": "2021-07-17 15:40:10.667717",
"dev_NewDevice": 0,
"dev_Network_Node_MAC_ADDR": "Internet",
"dev_Network_Node_port": 1,
"dev_Icon": "shield-halved"
"devMac": "a4:8f:ff:aa:ba:1f",
"devName": "Net - USG",
"devType": "Firewall",
"devVendor": "Ubiquiti Inc",
"devGroup": "",
"devFirstConnection": "2021-02-12 22:05:00",
"devLastConnection": "2021-07-17 15:40:00",
"devLastIP": "192.168.1.1",
"devStaticIP": 1,
"devPresentLastScan": 1,
"devLastNotification": "2021-07-17 15:40:10.667717",
"devIsNew": 0,
"devParentMAC": "Internet",
"devParentPort": 1,
"devIcon": "shield-halved"
}
]
}

View File

@@ -73,7 +73,7 @@ End-result: Partial restore (historical data & configurations from the Maintenan
#### Recovery:
Even with a corrupted database you can recover what I would argue is 99% of the configuration (except of a couple of settings under Maintenance).
Even with a corrupted database you can recover what I would argue is 99% of the configuration.
- map the `/config/app.conf` file as described in the [Setup documentation](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#docker-paths).
- rename the `devices_<timestamp>.csv` to `devices.csv` and place it in the `/config` folder

View File

@@ -14,7 +14,6 @@
| Events | Used to collect connection/disconnection events. | ![Screen4][screen4] |
| Online_History | Used to display the `Device presence` chart | ![Screen6][screen6] |
| Parameters | Used to pass values between the frontend and backend. | ![Screen7][screen7] |
| Pholus_Scan | Scan results of the Pholus python network penetration script. | ![Screen8][screen8] |
| Plugins_Events | For capturing events exposed by a plugin via the `last_result.log` file. If unique then saved into the `Plugins_Objects` table. Entries are deleted once processed and stored in the `Plugins_History` and/or `Plugins_Objects` tables. | ![Screen10][screen10] |
| Plugins_History | History of all entries from the `Plugins_Events` table | ![Screen11][screen11] |
| Plugins_Language_Strings | Language strings collected from the plugin `config.json` files used for string resolution in the frontend. | ![Screen12][screen12] |
@@ -29,7 +28,6 @@
[screen4]: /docs/img/DATABASE/Events.png
[screen6]: /docs/img/DATABASE/Online_History.png
[screen7]: /docs/img/DATABASE/Parameters.png
[screen8]: /docs/img/DATABASE/Pholus_Scan.png
[screen10]: /docs/img/DATABASE/Plugins_Events.png
[screen11]: /docs/img/DATABASE/Plugins_History.png
[screen12]: /docs/img/DATABASE/Plugins_Language_Strings.png

View File

@@ -55,7 +55,7 @@ Input data from the plugin might cause mapping issues in specific edge cases. Lo
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 [API] Update API starting
17:31:06 [API] Updating table_plugins_history.json file in /front/api
17:31:06 [API] Updating table_plugins_history.json file in /api
```
> The debug output between the 🔻red arrows🔺 is important for debugging (arrows added only to highlight the section on this page, they are not available in the actual debug log)
@@ -76,3 +76,16 @@ In the above output notice the section logging how many events are produced by t
These values, if formatted correctly, will also show up in the UI:
![Plugins table](/docs/img/DEBUG_PLUGINS/plugin_objects_pihole.png)
### 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).
2. Wait for the issue to occur.
3. Search for `================ DEVICES table content ================` in your logs.
4. Search for `================ CurrentScan table content ================` in your logs.
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
6. Please set `LOG_LEVEL` to `debug` or lower.

View File

@@ -49,11 +49,22 @@ services:
# Other service configurations...
```
## 5. 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).
2. Wait for the issue to occur.
3. Search for `================ DEVICES table content ================` in your logs.
4. Search for `================ CurrentScan table content ================` in your logs.
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
6. Please set `LOG_LEVEL` to `debug` or lower.
## 📃Common issues
### Permissions
* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/app/front/log`.
* If facing issues (AJAX errors, can't write to DB, empty screen, etc,) make sure permissions are set correctly, and check the logs under `/app/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 /app/db/app.db`.
* If still facing issues, try to map the app.db file (⚠ not folder) to `:/app/db/app.db` (see [docker-compose Examples](https://github.com/jokob-sk/NetAlertX/blob/main/dockerfiles/README.md#-docker-composeyml-examples) for details)

View File

@@ -0,0 +1,6 @@
# Device Display Settings
This set of settings allows you to group Devices under different views. The Archived toggle allows you to exclude a Device from most listings and notifications.
![Display settings](/docs/img/DEVICE_MANAGEMENT/DeviceDetails_DisplaySettings.png)

View File

@@ -1,107 +1,52 @@
# NetAlertX - Device Management
<!--- --------------------------------------------------------------------- --->
To edit device information:
- Select "Devices" in the menu on the left of the screen
- Find the device you want to edit in the central table
- Go to the device page by clicking on the device name or status
- Press "Details" tab of the device
- Edit the device data
- Press the "Save" button
The Main Info section is where most of the device identifyiable 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]
>
> [Bulk-edit devices](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md) by using the _CSV Export_ functionality in the _Maintenance_ section.
> 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](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICES_BULK_EDITING.md).
![Device Details][screen1]
![Main Info](/docs/img/DEVICE_MANAGEMENT/DeviceManagement_MainInfo.png)
## Main Info
- **MAC**: MAC addres of the device. Not editable.
- **Name**: Friendly device name
- **Owner**: Device owner (The list is self-populated with existing owners)
- **Type**: Select a device type from the dropdown list (Smartphone, Table,
Laptop, TV, router, ....) or type a new device type
- **Vendor**: Automatically updated by NetAlertX when empty or unknown
- **Favorite**: Mark the device as favorite and then it will appears at the
begining of the device list
- **Group**: Select a grouper ('Always on', 'Personal', Friends') or type
your own Group name
- **Comments**: Type any comments for the device
## Session Info
- **Status**: Show device status : On-line / Off-Line
- **First Session**: Date and time of the first connection
- **Last Offline**: Date and time of the last last time the device was offline
- **Last IP**: Last known IP used during the last connection
- **Static IP**: Check this box to identify devices that always use the
same IP
- **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.
- **Name**: Friendly device name. Autodetected via various 🆎 Name discovery [plugins](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/README.md).
- **Icon**: Partially autodetected. Select an existing or [add a custom icon](https://github.com/jokob-sk/NetAlertX/blob/main/docs/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).
- **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](https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md).
- **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
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.
- **Comments**: Add any comments for the device, such as a serial number, or maintenance information.
## Events & Alerts config
- **Scan Cycle**: Select the scan cycle: 0, 1', 15'
- Some devices do not respond to all ARP packets, for this cases is better
to use a 15' cycle.
- **For Apple devices I recommend using 15' cycle**
- **Alert All Events**: Send a notification in each event (connection,
disconnection, IP Changed, ...)
- **Alert Down**: Send a notification when the device is down
- *(Userful with "always connected" devices: Camera, Alexa,...)*
- **Skip repeated notifications during**: Do not send more than one
notification to this device for X hours
- *(Useful to avoid notification saturation on devices that frequently
connects and disconnects)*
> [!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.
# Privacy & Random MAC's
<!--- --------------------------------------------------------------------- --->
## Dummy devices
The latest versions of some operating systems (IOS and Android) incorporate a
new & interesting functionality to improve privacy: **Random MACs**.
You can create dummy devices from the Devices listing screen.
This functionality allows you to **hide the true MAC** of the device and
**assign a random MAC** when we connect to WIFI networks.
![Create Dummy Device](/docs/img/DEVICE_MANAGEMENT/Devices_CreateDummyDevice.png)
This behavior is especially useful when connecting to WIFI's that we do not
know, but it **is totally useless when connecting to our own WIFI's** or known
networks.
The **MAC** field and the **Last IP** field will then become editable.
**I recommend disabling this operation when connecting our devices to our own
WIFI's**, in this way, NetAlertX will be able to identify the device, and it
will not identify it as a new device every so often (every time IOS or Android
decides to change the MAC).
### IOS
![ios][ios]
- [Use private Wi-Fi addresses in iOS 14](https://support.apple.com/en-us/HT211227)
### Android
![Android][Android]
- [How to Disable MAC Randomization in Android 10](https://support.boingo.com/s/article/How-to-Disable-MAC-Randomization-in-Android-10-Android-Q)
- [How do I disable random Wi-Fi MAC address on Android 10](https://support.plume.com/hc/en-gb/articles/360052070714-How-do-I-disable-random-Wi-Fi-MAC-address-on-Android-10-)
### License
GPL 3.0
[Read more here](../LICENSE.txt)
### Contact
Always use the Issue tracker for the correct fork, for example:
[jokob-sk/NetAlertX](https://github.com/jokob-sk/NetAlertX/issues). Please also follow the guidelines on:
- [Pull Request guidelines](https://github.com/jokob-sk/NetAlertX/tree/main/docs#-pull-requests-prs)
- 🙏 [Feature request guidelines](https://github.com/jokob-sk/NetAlertX/tree/main/docs#-feature-requests)
- 🐛 [Issue guidelines](https://github.com/jokob-sk/NetAlertX/tree/main/docs#-submitting-an-issue-or-bug)
***Suggestions and comments are welcome***
![Save Dummy Device](/docs/img/DEVICE_MANAGEMENT/DeviceEdit_SaveDummyDevice.png)
<!--- --------------------------------------------------------------------- --->
[main]: ./img/1_devices.jpg "Main screen"
[screen1]: ./img/2_1_device_details.jpg "Screen 1"
[ios]: https://9to5mac.com/wp-content/uploads/sites/6/2020/08/how-to-use-private-wifi-mac-address-iphone-ipad.png?resize=2048,1009 "ios"
[Android]: ./img/android_random_mac.jpg "Android"
> [!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`.
## 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.

View File

@@ -38,7 +38,7 @@ Some examples how to apply the above:
Some useful frontend JavaScript functions:
- `getDeviceDataByMac(macAddress, devicesColumn)` - method to retrieve any device data (database column) based on MAC address in the frontend
- `getDevDataByMac(macAddress, devicesColumn)` - method to retrieve any device data (database column) based on MAC address in the frontend
- `getString(string stringKey)` - method to retrieve translated strings in the frontend
- `getSetting(string stringKey)` - method to retrieve settings in the frontend

View File

@@ -5,6 +5,8 @@ To download and install NetAlertX on the hardware/server directly use the `curl`
> [!NOTE]
> This is an Experimental feature 🧪 and it relies on community support.
>
> Looking for maintainers for this installation method 🙂
>
> There is no guarantee that the install script or any other script will gracefully handle other installed software.
> Data loss is a possibility, **it is recommended to install NetAlertX using the supplied Docker image**.

View File

@@ -45,7 +45,7 @@ Copying the HTML code from [Font Awesome](https://fontawesome.com/search?o=r&m=f
If you own the premium package of Font Awesome icons you can mount it in your Docker container the following way:
```yaml
/font-awesome:/app/front/lib/AdminLTE/bower_components/font-awesome:ro
/font-awesome:/app/front/lib/font-awesome:ro
```
You can use the full range of Font Awesome icons afterwards.

View File

@@ -85,7 +85,7 @@ services:
- local/path/config:/app/config # ⚠ This has changed (🔺required)
- local/path/db:/app/db # ⚠ This has changed (🔺required)
# (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/app/front/log # ⚠ This has changed (🟡optional)
- local/path/logs:/app/log # ⚠ This has changed (🟡optional)
environment:
- TZ=Europe/Berlin
- PORT=20211
@@ -135,7 +135,7 @@ services:
- local/path/config/app.conf:/app/config/app.conf # ⚠ This has changed (🔺required)
- local/path/db/app.db:/app/db/app.db # ⚠ This has changed (🔺required)
# (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/app/front/log # ⚠ This has changed (🟡optional)
- local/path/logs:/app/log # ⚠ This has changed (🟡optional)
environment:
- TZ=Europe/Berlin
- PORT=20211

View File

@@ -2,7 +2,7 @@
Make sure you have a root device with the MAC `Internet` (No other MAC addresses are currently supported as the root node) set to a network device type (e.g.: **Type**:`Router`).
> 💡 Tip: You can add dummy devices via the [Undiscoverables plugin](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/undiscoverables/README.md)
> 💡 Tip: You can add dummy devices via the [Create dummy device](https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_MANAGEMENT.md#dummy-devices) button in the Devices listing page.
> 💡 Tip: Export your configuration of the Network and Devices once in a while via the Export CSV feature under **Maintenance** -> **Backup/Restore** -> **CSV Export**.

View File

@@ -11,17 +11,15 @@ There are 4 ways how to influence notifications:
> It's recommended to use the same schedule interval for all plugins responsible for scanning devices, otherwise false positives might be reported if different devices are discovered by different plugins. Check the **Settings** > **Enabled settings** section for a warning:
> ![Schedules out-of-sync](/docs/img/NOTIFICATIONS/Schedules_out-of-sync.png)
## Device settings 💻
![Device notification settings](/docs/img/NOTIFICATIONS/Device-notification-settings.png)
There are 4 settings on the device for influencing notifications. You can:
1. Completely disable the scanning of the device
2. **Alert all events**, connections, disconnections, IP changes (noisy, usually not recommended)
3. **Alert down** - alerts when a device goes down. This setting overrides disabled Alert All Events, so you will get a notification of a device going down even if you don't have Alert All Events ticked.
4. **Skip repeated notifications**, if for example you know there is a temporary issue and want to pause the same notification for this device for a given time.
1. **Alert Events** - Enables alerts of connections, disconnections, IP changes.
2. **Alert Down** - Alerts when a device goes down. This setting overrides a disabled **Alert Events** setting, so you will get a notification of a device going down even if you don't have **Alert Events** ticked.
3. **Skip repeated notifications**, if for example you know there is a temporary issue and want to pause the same notification for this device for a given time.
## Plugin settings 🔌
@@ -40,7 +38,7 @@ Click the **Read more in the docs.** Link at the top of each plugin to get more
In Notification Processing settings, you can specify blanket rules. These allow you to specify exceptions to the Plugin and Device settings and will override those.
1. Notify on (`NTFPRCS_INCLUDED_SECTIONS`) allows you to specify which events trigger notifications. Usual setups will have `new_devices`, `down_devices`, and possibly `events` set. Setting `plugin` might be too noisy for most setups. More info in the [NTFPRCS plugin](/front/plugins/notification_processing/README.md)
1. Notify on (`NTFPRCS_INCLUDED_SECTIONS`) allows you to specify which events trigger notifications. Usual setups will have `new_devices`, `down_devices`, and possibly `down_reconnected` set. Including `plugin` (dependenton the Plugin `<plugin>_WATCH` and `<plugin>_REPORT_ON` settings) and `events` (dependent on the on-device **Alert Events** setting) might be too noisy for most setups. More info in the [NTFPRCS plugin](/front/plugins/notification_processing/README.md)
2. Alert down after (`NTFPRCS_alert_down_time`) is useful if you want to wait for some time before the system sends out a down notification for a device. This is related to the on-device **Alert down** setting and only devices with this checked will trigger a down notification.
3. A filter to allow you to set device-specific exceptions to New devices being added to the app.
4. A filter to allow you to set device-specific exceptions to generated Events.

View File

@@ -22,3 +22,10 @@ The database cleanup plugin. Check details and related setting in the [DB Cleanu
### Maintenance (MAINT)
The maintenance plugin. Check details and related setting in the [Maintenance plugin docs](/front/plugins/maintenance/README.md). Make sure the plugin is not failing by checking the logs. Try changing the schedule `MAINT_RUN_SCHD` and the timeout `MAINT_RUN_TIMEOUT` (increase) if the plugin is failing to execute.
## Scan frequency and coverage
The more often you scan the networks the more resources, traffic and DB read/write cycles are executed. Especially on busy networks and lower end hardware, consider increasing scan intervals (`<PLUGIN>_RUN_SCHD`) and timeouts (`<PLUGIN>_RUN_TIMEOUT`).
Also consider decreasing the scanned subnet, e.g. from `/16` to `/24` if need be.

View File

@@ -170,20 +170,20 @@ This SQL query is executed on the `app.db` SQLite database file.
> SQL query example:
>
> ```SQL
> SELECT dv.dev_Name as Object_PrimaryID,
> cast(dv.dev_LastIP as VARCHAR(100)) || ':' || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , '/')) as VARCHAR(100)) as Object_SecondaryID,
> SELECT dv.devName as Object_PrimaryID,
> cast(dv.devLastIP as VARCHAR(100)) || ':' || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , '/')) as VARCHAR(100)) as Object_SecondaryID,
> datetime() as DateTime,
> ns.Service as Watched_Value1,
> ns.State as Watched_Value2,
> 'null' as Watched_Value3,
> 'null' as Watched_Value4,
> ns.Extra as Extra,
> dv.dev_MAC as ForeignKey
> dv.devMac as ForeignKey
> FROM
> (SELECT * FROM Nmap_Scan) ns
> LEFT JOIN
> (SELECT dev_Name, dev_MAC, dev_LastIP FROM Devices) dv
> ON ns.MAC = dv.dev_MAC
> (SELECT devName, devMac, devLastIP FROM Devices) dv
> ON ns.MAC = dv.devMac
> ```
>
> Required `CMD` setting example with above query (you can set `"type": "label"` if you want it to make uneditable in the UI):
@@ -192,7 +192,7 @@ This SQL query is executed on the `app.db` SQLite database file.
> {
> "function": "CMD",
> "type": {"dataType":"string", "elements": [{"elementType" : "input", "elementOptions" : [] ,"transformers": []}]},
> "default_value":"SELECT dv.dev_Name as Object_PrimaryID, cast(dv.dev_LastIP as VARCHAR(100)) || ':' || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , '/')) as VARCHAR(100)) as Object_SecondaryID, datetime() as DateTime, ns.Service as Watched_Value1, ns.State as Watched_Value2, 'null' as Watched_Value3, 'null' as Watched_Value4, ns.Extra as Extra FROM (SELECT * FROM Nmap_Scan) ns LEFT JOIN (SELECT dev_Name, dev_MAC, dev_LastIP FROM Devices) dv ON ns.MAC = dv.dev_MAC",
> "default_value":"SELECT dv.devName as Object_PrimaryID, cast(dv.devLastIP as VARCHAR(100)) || ':' || cast( SUBSTR(ns.Port ,0, INSTR(ns.Port , '/')) as VARCHAR(100)) as Object_SecondaryID, datetime() as DateTime, ns.Service as Watched_Value1, ns.State as Watched_Value2, 'null' as Watched_Value3, 'null' as Watched_Value4, ns.Extra as Extra FROM (SELECT * FROM Nmap_Scan) ns LEFT JOIN (SELECT devName, devMac, devLastIP FROM Devices) dv ON ns.MAC = dv.devMac",
> "options": [],
> "localized": ["name", "description"],
> "name" : [{
@@ -460,7 +460,7 @@ Below are some general additional notes, when defining `params`:
- `"name":"name_value"` - is used as a wildcard replacement in the `CMD` setting value by using curly brackets `{name_value}`. The wildcard is replaced by the result of the `"value" : "param_value"` and `"type":"type_value"` combo configuration below.
- `"type":"<sql|setting>"` - is used to specify the type of the params, currently only 2 supported (`sql`,`setting`).
- `"type":"sql"` - will execute the SQL query specified in the `value` property. The sql query needs to return only one column. The column is flattened and separated by commas (`,`), e.g: `SELECT dev_MAC from DEVICES` -> `Internet,74:ac:74:ac:74:ac,44:44:74:ac:74:ac`. This is then used to replace the wildcards in the `CMD` setting.
- `"type":"sql"` - will execute the SQL query specified in the `value` property. The sql query needs to return only one column. The column is flattened and separated by commas (`,`), e.g: `SELECT devMac from DEVICES` -> `Internet,74:ac:74:ac:74:ac,44:44:74:ac:74:ac`. This is then used to replace the wildcards in the `CMD` setting.
- `"type":"setting"` - The setting code name. A combination of the value from `unique_prefix` + `_` + `function` value, or otherwise the code name you can find in the Settings page under the Setting display name, e.g. `PIHOLE_RUN`.
- `"value": "param_value"` - Needs to contain a setting code name or SQL query without wildcards.
- `"timeoutMultiplier" : true` - used to indicate if the value should multiply the max timeout for the whole script run by the number of values in the given parameter.
@@ -474,13 +474,13 @@ Below are some general additional notes, when defining `params`:
> "params" : [{
> "name" : "ips",
> "type" : "sql",
> "value" : "SELECT dev_LastIP from DEVICES",
> "value" : "SELECT devLastIP from DEVICES",
> "timeoutMultiplier" : true
> },
> {
> "name" : "macs",
> "type" : "sql",
> "value" : "SELECT dev_MAC from DEVICES"
> "value" : "SELECT devMac from DEVICES"
> },
> {
> "name" : "timeout",
@@ -527,7 +527,7 @@ The UI component is defined as a JSON object containing a list of `elements`. Ea
```json
{
"function": "dev_Icon",
"function": "devIcon",
"type": {
"dataType": "string",
"elements": [
@@ -536,7 +536,7 @@ The UI component is defined as a JSON object containing a list of `elements`. Ea
"elementOptions": [
{ "cssClasses": "input-group-addon iconPreview" },
{ "getStringKey": "Gen_SelectToPreview" },
{ "customId": "NEWDEV_dev_Icon_preview" }
{ "customId": "NEWDEV_devIcon_preview" }
],
"transformers": []
},
@@ -548,7 +548,7 @@ The UI component is defined as a JSON object containing a list of `elements`. Ea
{
"onChange": "updateIconPreview(this)"
},
{ "customParams": "NEWDEV_dev_Icon,NEWDEV_dev_Icon_preview" }
{ "customParams": "NEWDEV_devIcon,NEWDEV_devIcon_preview" }
],
"transformers": []
}
@@ -649,7 +649,7 @@ The UI will adjust how columns are displayed in the UI based on the resolvers de
| See below for information on `threshold`, `replace`. | |
| | |
| `options` Property | Used in conjunction with types like `threshold`, `replace`, `regex`. |
| `options_params` Property | Used in conjunction with a `"options": "[{value}]"` template and `text.select`/`list.select`. Can specify SQL query (needs to return 2 columns `SELECT dev_Name as name, dev_Mac as id`) or Setting (not tested) to populate the dropdown. Check example below or have a look at the `NEWDEV` plugin `config.json` file. |
| `options_params` Property | Used in conjunction with a `"options": "[{value}]"` template and `text.select`/`list.select`. Can specify SQL query (needs to return 2 columns `SELECT devName as name, devMac as id`) or Setting (not tested) to populate the dropdown. Check example below or have a look at the `NEWDEV` plugin `config.json` file. |
| `threshold` | The `options` array contains objects ordered from the lowest `maximum` to the highest. The corresponding `hexColor` is used for the value background color if it's less than the specified `maximum` but more than the previous one in the `options` array. |
| `replace` | The `options` array contains objects with an `equals` property, which is compared to the "value." If the values are the same, the string in `replacement` is displayed in the UI instead of the actual "value". |
| `regex` | Applies a regex to the value. The `options` array contains objects with an `type` (must be set to `regex`) and `param` (must contain the regex itself) property. |
@@ -669,7 +669,7 @@ The UI will adjust how columns are displayed in the UI based on the resolvers de
```json
"function": "dev_DeviceType",
"function": "devType",
"type": {"dataType":"string", "elements": [{"elementType" : "select", "elementOptions" : [] ,"transformers": []}]},
"maxLength": 30,
"default_value": "",
@@ -678,7 +678,7 @@ The UI will adjust how columns are displayed in the UI based on the resolvers de
{
"name" : "value",
"type" : "sql",
"value" : "SELECT '' as id, '' as name UNION SELECT dev_DeviceType as id, dev_DeviceType as name FROM (SELECT dev_DeviceType FROM Devices UNION SELECT 'Smartphone' UNION SELECT 'Tablet' UNION SELECT 'Laptop' UNION SELECT 'PC' UNION SELECT 'Printer' UNION SELECT 'Server' UNION SELECT 'NAS' UNION SELECT 'Domotic' UNION SELECT 'Game Console' UNION SELECT 'SmartTV' UNION SELECT 'Clock' UNION SELECT 'House Appliance' UNION SELECT 'Phone' UNION SELECT 'AP' UNION SELECT 'Gateway' UNION SELECT 'Firewall' UNION SELECT 'Switch' UNION SELECT 'WLAN' UNION SELECT 'Router' UNION SELECT 'Other') AS all_devices ORDER BY id;"
"value" : "SELECT '' as id, '' as name UNION SELECT devType as id, devType as name FROM (SELECT devType FROM Devices UNION SELECT 'Smartphone' UNION SELECT 'Tablet' UNION SELECT 'Laptop' UNION SELECT 'PC' UNION SELECT 'Printer' UNION SELECT 'Server' UNION SELECT 'NAS' UNION SELECT 'Domotic' UNION SELECT 'Game Console' UNION SELECT 'SmartTV' UNION SELECT 'Clock' UNION SELECT 'House Appliance' UNION SELECT 'Phone' UNION SELECT 'AP' UNION SELECT 'Gateway' UNION SELECT 'Firewall' UNION SELECT 'Switch' UNION SELECT 'WLAN' UNION SELECT 'Router' UNION SELECT 'Other') AS all_devices ORDER BY id;"
},
{
"name" : "uilang",

View File

@@ -27,6 +27,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
#### 📥 Initial Setup
- [Synology Guide](/docs/SYNOLOGY_GUIDE.md)
- [Subnets and VLANs configuration for arp-scan](/docs/SUBNETS.md)
- [SMTP server config](/docs/SMTP.md)
- [Custom Icon configuration and support](/docs/ICONS.md)
@@ -64,6 +65,7 @@ There is also an in-app Help / FAQ section that should be answering frequently a
- [Version history (legacy)](/docs/VERSIONS_HISTORY.md)
- [Reverse proxy (Nginx, Apache, SWAG)](/docs/REVERSE_PROXY.md)
- [Installing Updates](/docs/UPDATES.md)
- [Setting up Authelia](/docs/AUTHELIA.md) (DRAFT)
#### 👩💻For Developers👨💻

View File

@@ -40,7 +40,7 @@ services:
volumes:
- /home/netalertx/config:/app/config
- /home/netalertx/db:/app/db
- /home/netalertx/log:/app/front/log
- /home/netalertx/log:/app/log
environment:
- TZ=Europe/Berlin
- PORT=20211
@@ -66,7 +66,7 @@ services:
volumes:
- ./config/app.conf:/app/config/app.conf
- ./db:/app/db
- ./log:/app/front/log
- ./log:/app/log
- ./config/resolv.conf:/etc/resolv.conf # Mapping the /resolv.conf file for better name resolution
environment:
- TZ=Europe/Berlin

62
docs/SESSION_INFO.md Executable file
View File

@@ -0,0 +1,62 @@
# Sessions Section in 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.
![Session info](/docs/img/SESSION_INFO/DeviceDetails_SessionInfo.png)
---
## Key Fields
1. **Date and Time of First Connection**
- **Description:** Displays the first detected connection time for the device.
- **Editability:** Uneditable (auto-detected).
- **Source:** Automatically captured when the device is first added to the system.
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
### 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)`
- Devices scanned in the current cycle (**CurrentScan**) are checked against the **Devices** table.
- If a device is new:
- A **New Device** event is logged.
- The devices MAC, IP, vendor, and detection time are recorded.
### 2. Logging Connection Sessions
When a new connection is detected, the system creates a session record:
`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)`
- A new session is logged in the **Sessions** table if no prior session exists.
- 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
- 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.
### 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**.
![Monitoring Device Presence](/docs/img/SESSION_INFO/Monitoring_Presence.png)

View File

@@ -110,3 +110,21 @@ Please note the accessibility of macvlans when configured on the same computer.
- NetAlertX does not detect the macvlan container when it is running on the same computer.
- NetAlertX recognizes the macvlan container when it is running on a different computer.
### Wi-Fi Extenders
A Wi-Fi extender typically works by creating a separate network or subnet, which can cause certain network scanning tools, like `arp-scan`, to be unable to detect devices behind the extender.
This happens because `arp-scan` uses ARP (Address Resolution Protocol) to map IP addresses to MAC addresses on the local network. Since ARP is a Layer 2 (data link layer) protocol, it usually only works within a single broadcast domain, which is typically limited to a single router or network segment.
When you introduce a Wi-Fi extender, it may isolate devices on different segments of the network, meaning ARP packets cannot easily traverse from one segment (your main network) to another (the network behind the extender).
To scan devices behind the extender, you can try:
- Scanning the specific subnet that the extender uses, if it is separate from the main network.
- Using [supplementing plugins](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/README.md) that use alternate methods. Protocols used by the `SNMPDSC` or `DHCPLSS` plugins have good support and usually can be used as a workaround.
Check the [plugins list](https://github.com/jokob-sk/NetAlertX/blob/main/front/plugins/README.md) to find a plugin supported by your router and your network setup.

74
docs/SYNOLOGY_GUIDE.md Executable file
View File

@@ -0,0 +1,74 @@
# 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.
## Create the folder structure
The folders you are creating below will contain the configuration and the database. Back them up regularly.
1. Create a parent folder named `netalertx`
2. Create a `db` sub-folder
![Folder structure](/docs/img/SYNOLOGY/01_Create_folder_structure.png)
![Folder structure](/docs/img/SYNOLOGY/02_Create_folder_structure_db.png)
![Folder structure](/docs/img/SYNOLOGY/03_Create_folder_structure_db.png)
3. Create a `config` sub-folder
![Folder structure](/docs/img/SYNOLOGY/04_Create_folder_structure_config.png)
4. Note down the folders Locations:
![Getting the location](/docs/img/SYNOLOGY/05_Access_folder_properties.png)
![Getting the location](/docs/img/SYNOLOGY/06_Note_location.png)
5. Open **Container manager** -> **Project** and click **Create**.
6. Fill in the details:
- Project name: `netalertx`
- Path: `/app_storage/netalertx` (will differ from yours)
- Paste in the following template:
```yaml
version: "3"
services:
netalertx:
container_name: netalertx
# use the below line if you want to test the latest dev image
# image: "jokobsk/netalertx-dev:latest"
image: "jokobsk/netalertx:latest"
network_mode: "host"
restart: unless-stopped
volumes:
- local/path/config:/app/config
- local/path/db:/app/db
# (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/app/log
environment:
- TZ=Europe/Berlin
- PORT=20211
```
![Project settings](/docs/img/SYNOLOGY/07_Create_project.png)
7. Replace the paths to your volume and/or comment out unnecessary line(s):
- This is only an example, your paths will differ.
```yaml
volumes:
- /volume1/app_storage/netalertx/config:/app/config
- /volume1/app_storage/netalertx/db:/app/db
# (optional) useful for debugging if you have issues setting up the container
# - local/path/logs:/app/log <- commented out with # ⚠
```
![Adjusting docker-compose](/docs/img/SYNOLOGY/08_Adjust_docker_compose_volumes.png)
8. (optional) Change the port number from `20211` to an unused port if this port is already used.
9. Build the project:
![Build](/docs/img/SYNOLOGY/09_Run_and_build.png)
10. Navigate to `<Synology URL>:20211` (or your custom port).
11. Read the [Subnets](/docs/SUBNETS.md) and [Plugins](/front/plugins/README.md) docs to complete your setup.

110
docs/UPDATES.md Executable file
View File

@@ -0,0 +1,110 @@
# Docker Update Strategies for NetAlertX
This guide outlines several approaches for updating Docker containers, specifically using NetAlertX. Each method offers different benefits depending on the situation. Here are the methods:
- Manual: Direct commands to stop, remove, and rebuild containers.
- Dockcheck: Semi-automated with more control, suited for bulk updates.
- Watchtower: Fully automated, runs continuously to check and update containers.
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.
## 1. Manual Updates
Use this method when you need precise control over a single container or when dealing with a broken container that needs immediate attention.
Example Commands
To manually update the `netalertx` container, stop it, delete it, remove the old image, and start a fresh one with `docker-compose`.
```bash
# Stop the container
sudo docker container stop netalertx
# Remove the container
sudo docker container rm netalertx
# Remove the old image
sudo docker image rm netalertx
# Pull and start a new container
sudo docker-compose up -d
```
### Alternative: Force Pull with Docker Compose
You can also use `--pull always` to ensure Docker pulls the latest image before starting the container:
```bash
sudo docker-compose up --pull always -d
```
## 2. Dockcheck for Bulk Container Updates
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.
### Example Workflow with Dockcheck
You might use Dockcheck to:
- Inspect container versions.
- Pull the latest images in bulk.
- Apply updates selectively.
Dockcheck can help streamline bulk updates, especially if youre managing multiple containers.
Below is a script I use to run an update of the Dockcheck script and start a check for new containers:
```bash
cd /path/to/Docker &&
rm dockcheck.sh &&
wget https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh &&
sudo chmod +x dockcheck.sh &&
sudo ./dockcheck.sh
```
## 3. Automated Updates with Watchtower
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.
### Setting Up Watchtower
#### 1. Pull the Watchtower Image:
```bash
docker pull containrrr/watchtower
```
#### 2. Run Watchtower to update all images:
```bash
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--interval 300 # Check for updates every 5 minutes
```
#### 3. Run Watchtower to update only NetAlertX:
You can specify which containers to monitor by listing them. For example, to monitor netalertx only:
```bash
docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower netalertx
```
## Summary
- Manual: Ideal for individual or critical updates.
- Dockcheck: Suitable for controlled, mass updates.
- Watchtower: Fully automated, best for continuous deployment setups.
These approaches allow you to maintain flexibility in how you update Docker containers, depending on the urgency and scale of the update.

View File

@@ -41,7 +41,7 @@ In the container execute:
`cat /var/log/nginx/error.log`
`cat /app/front/log/app.php_errors.log`
`cat /app/log/app.php_errors.log`
## 8. Make sure permissions are correct

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -90,6 +90,6 @@ function processData(data) {
</script>
<!-- Datatable -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css"/>
<script src="lib/AdminLTE/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="lib/AdminLTE/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="lib/datatables.net-bs/css/dataTables.bootstrap.min.css"/>
<script src="lib/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="lib/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>

View File

@@ -12,11 +12,36 @@
----------------------------------------------------------------------------- */
:root {
--color-aqua: #00c0ef;
--color-blue: #0060df;
--color-green: #00a65a;
--color-yellow: #f39c12;
--color-red: #dd4b39;
}
.input-group .checkbox
{
margin-left: 5px;
}
h5
{
font-size: medium;
}
/* -----------------------------------------------------------------------------
Helper Classes
----------------------------------------------------------------------------- */
.pointer
{
cursor: pointer;
}
.question
{
cursor: help;
}
/* -----------------------------------------------------------------------------
Text Classes
----------------------------------------------------------------------------- */
@@ -212,6 +237,12 @@
{
line-height: 30px;
}
body
{
background-image: url('../img/background.png');
}
/* -----------------------------------------------------------------------------
Customized Main Menu
----------------------------------------------------------------------------- */
@@ -772,6 +803,35 @@ height: 50px;
display: inline-grid;
}
/* --------------------------------------------------------- */
/* Presence */
/* --------------------------------------------------------- */
.presencenceKey
{
float: right;
}
.presenceOnlineNow{
background-color: var(--color-green);
}
.presenceOnlinePast{
background-color: var(--color-blue);
}
.presenceOnlinePastMiss{
background-color: var(--color-yellow);
}
.presenceKeyBoxes
{
width: 10px;
height: 10px;
display: inline-block;
/* background: #fff; */
opacity: .75;
}
/* --------------------------------------------------------- */
/* report */
/* --------------------------------------------------------- */
@@ -1052,7 +1112,11 @@ input[readonly] {
.settingsSearchWrap
{
padding:10px;
/* padding:10px; */
/* display: flex; */
justify-content: center; /* Centers horizontally */
align-items: center; /* Centers vertically */
/* height: 60px; */
}
.settings-sticky-bottom-section {
@@ -1062,11 +1126,12 @@ input[readonly] {
/* opacity: 0.8; */
bottom: 30px;
border-radius: 5px;
margin:1px;
/* margin:1px; */
border-width: 1px;
border-style: solid;
border-color: inherit;
/* width: 87%; */
padding: 10px;
}
.settings-sticky-bottom-section:hover {
@@ -1085,7 +1150,7 @@ input[readonly] {
width: 14px;
position: absolute;
right: -6px;
top: 6px;
top: 13px;
}
@@ -1097,9 +1162,9 @@ input[readonly] {
.saveSettingsWrapper button
{
width:70%;
margin-top:20px;
/* margin-top:20px; */
margin-left:15%;
margin-bottom:20px;
/* margin-bottom:20px; */
}
#settingsPage .select2-selection
@@ -1136,7 +1201,6 @@ input[readonly] {
height: 200px; */
background-color: #f3f3f3;
border: 1px solid #ccc;
margin: 20px;
z-index: 10;
}
@@ -1162,11 +1226,77 @@ input[readonly] {
/* Devices page */
/* ----------------------------------------------------------------- */
.modal-header .close
{
display: flex;
}
.modal-title
{
display: inline;
}
#iconList
{
padding: 10px;
padding-bottom:30px;
}
.iconPreviewSelector:hover
{
backdrop-filter: brightness(50%);
}
.iconPreviewSelector
{
text-align: center;
padding: 15px;
height: 80px;
margin-bottom: 15px;
}
.iconList
{
display: flex;
}
.iconColumn
{
max-height: 25px;
}
.iconPreviewSelector svg
{
width:40px;
height: 40px;
}
.iconPreviewSelector i
{
font-size: 30px;
height: 40px;
}
.iconPreview {
min-width: 40px;
}
#tableDevices .fab
{
font-size: 1.5em;
}
#tableDevices .fa
{
font-size: 1.0em;
}
#tableDevices tbody tr
{
height: 1.5em;
}
.info-icon-nav
{
top: -6px;
@@ -1176,11 +1306,6 @@ input[readonly] {
font-size: large;
}
.pointer
{
cursor: pointer;
}
.drag
{
cursor: move; /* fallback if grab cursor is unsupported */
@@ -1203,10 +1328,11 @@ input[readonly] {
background-color:#606060 !important;
}
.networkPageHelp{
.helpIconSmallTopRight{
position: absolute;
font-size: x-small;
margin-bottom: 6px;
margin-left: 3px;
}
.pageHelp{
@@ -1234,6 +1360,10 @@ input[readonly] {
height: 1em !important;
}
#panDetails .control-label{
text-align: left;
}
/* ----------------------------------------------------------------- */
/* MODAL popups */
/* ----------------------------------------------------------------- */
@@ -1320,7 +1450,8 @@ input[readonly] {
border: solid;
border-color:cyan;
}
#networkTree .netStatus-Off-line i
#networkTree .netStatus-Off-line i,
#networkTree .netStatus-Off-line svg
{
color: #dd4b39;
}
@@ -1401,7 +1532,17 @@ input[readonly] {
.plugin-content #tabs-content-location
{
margin: 0px;
/* padding-top: 0; */
}
.integrations-plugins .content
{
display: table;
}
.plugin-content .tab-content
{
padding-top: 10px;
}
.plugins-description
@@ -1456,6 +1597,33 @@ input[readonly] {
}
.textOverflow
{
white-space: nowrap; /* Prevent text from wrapping to a new line */
overflow: hidden; /* Hide the overflowed text */
text-overflow: ellipsis; /* Show ellipsis (...) */
}
.table-stretched
{
min-width: -moz-available;
min-width: -webkit-fill-available;
}
.pluginBadge
{
float: right;
}
.pluginBadgeWrap
{
float: right;
display: ruby;
z-index: 1;
position: sticky;
margin-top: 1px;
}
/* -----------------------------------------------------------------------------
Spin
----------------------------------------------------------------------------- */

View File

@@ -17,6 +17,10 @@ html {
background-color: #353c42;
}
body {
background-image: url('../img/boxed-bg-dark.png') !important;
}
body, .bg-yellow, .callout.callout-warning, .alert-warning, .label-warning, .modal-warning .modal-body {
background-color: #353c42 !important;

View File

@@ -0,0 +1,21 @@
@media (prefers-color-scheme: dark) {
.fc-sat {
background-color: #444D56; }
.fc-sun {
background-color: #444D56; }
.fc-today {
background-color: #8D9AAC !important;
border: none !important;
}
.fc-cell-content {
background-color: #272c30;
}
.fc-widget-header {
background-color: #353c42;
}
.fc-unthemed .fc-content, .fc-unthemed .fc-divider, .fc-unthemed .fc-list-heading td, .fc-unthemed .fc-list-view, .fc-unthemed .fc-popover, .fc-unthemed .fc-row, .fc-unthemed tbody, .fc-unthemed td, .fc-unthemed th, .fc-unthemed thead{
border-color: #353c42 !important;
}
}

737
front/css/system-dark-patch.css Executable file
View File

@@ -0,0 +1,737 @@
/* Pi-hole: A black hole for Internet advertisements
* (c) 2020 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license.
*
* The colors used in this theme has been inspired by
* https://github.com/anvyst/adminlte-skin-midnight
*
* Additional fixes For Pi.Alert UI by leiweibau */
@media (prefers-color-scheme: dark) {
:root {
--datatable-bgcolor: rgba(64, 76, 88, 0.8);
}
html {
background-color: #353c42;
}
body {
background-image: url('../img/boxed-bg-dark.png') !important;
}
body, .bg-yellow, .callout.callout-warning, .alert-warning, .label-warning, .modal-warning .modal-body {
background-color: #353c42 !important;
color: #bec5cb !important;
}
h4 {
color: #44def1;
}
.content-header > .breadcrumb > li > a {
color: #bec5cb;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
border-top: 0;
}
.table > thead > tr.odd,
.table > tbody > tr.odd,
.table > tfoot > tr.odd {
background-color: #2a2f34;
}
.table > thead > tr.odd:hover,
.table > tbody > tr.odd:hover,
.table > tfoot > tr.odd:hover,
.table > thead > tr.even:hover,
.table > tbody > tr.even:hover,
.table > tfoot > tr.even:hover {
background-color: #1e2226;
}
.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 1px solid #353c42;
}
.dataTables_wrapper input[type="search"] {
border-radius: 4px;
background-color: #353c42;
border: 0;
color: #bec5cb;
}
.dataTables_paginate .pagination li > a {
background-color: #353c42;
border-color: #353c42;
}
.pagination > .disabled > a,
.pagination > .disabled > a:focus,
.pagination > .disabled > a:hover,
.pagination > .disabled > span,
.pagination > .disabled > span:focus,
.pagination > .disabled > span:hover {
cursor: not-allowed;
color: #bec5cb;
background-color: #353c42;
border-color: #353c42;
}
.pagination > li > a:focus,
.pagination > li > a:hover,
.pagination > li > span:focus,
.pagination > li > span:hover {
z-index: 2;
color: #bec5cb;
background-color: #54606b;
border-color: #54606b;
}
.wrapper,
.main-sidebar,
.left-side {
background-color: #272c30;
}
.user-panel > .info,
.user-panel > .info > a {
color: #fff;
}
.sidebar-menu > li.header {
color: #556068;
background-color: #1e2225;
}
.sidebar-menu > li > a {
border-left: 3px solid transparent;
}
.sidebar-menu > li:hover > a,
.sidebar-menu > li > a:focus,
.sidebar-menu > li.active > a {
color: #fff;
background-color: #22272a;
border-color: #3c8dbc;
}
.sidebar-menu > li > .treeview-menu {
margin: 0 1px;
background-color: #32393e;
}
.sidebar a {
color: #bec5cb;
}
.sidebar a:hover {
text-decoration: none;
}
.treeview-menu > li > a {
color: #949fa8;
}
.treeview-menu > li.active > a,
.treeview-menu > li > a:hover,
.treeview-menu > li > a:focus {
color: #fff;
}
.sidebar-form {
border-radius: 3px;
border: 1px solid #3e464c;
margin: 10px;
}
.sidebar-form input[type="text"],
.sidebar-form .btn {
box-shadow: none;
background-color: #3e464c;
border: 1px solid transparent;
height: 35px;
}
.sidebar-form input[type="text"] {
color: #666;
border-top-left-radius: 2px;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 2px;
}
.sidebar-form input[type="text"]:focus,
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
background-color: #fff;
color: #666;
}
.sidebar-form input[type="text"]:focus + .input-group-btn .btn {
border-left-color: #fff;
}
.sidebar-form .btn {
color: #999;
border-top-left-radius: 0;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
border-bottom-left-radius: 0;
}
.box,
.box-footer,
.info-box,
.box-comment,
.comment-text,
.comment-text .username {
color: #bec5cb;
background-color: #272c30;
}
.box-comments .box-comment {
border-bottom-color: #353c42;
}
.box-footer {
border-top: 1px solid #353c42;
}
.box-header.with-border {
border-bottom: 1px solid #353c42;
}
.box-solid,
.box {
border: 1px solid #272c30;
}
.box-solid > .box-header,
.box > .box-header {
color: #bec5cb;
}
.box-solid > .box-header .btn,
.box > .box-header .btn {
color: #bec5cb;
}
.box.box-info,
.box.box-primary,
.box.box-success,
.box.box-warning,
.box.box-danger {
border-top-width: 3px;
}
.main-header .navbar {
background-color: #272c30;
}
.main-header .navbar .nav > li > a,
.main-header .navbar .nav > li > .navbar-text {
color: #bec5cb;
max-height: 50px;
}
.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:active,
.main-header .navbar .nav > li > a:focus,
.main-header .navbar .nav .open > a,
.main-header .navbar .nav .open > a:hover,
.main-header .navbar .nav .open > a:focus,
.main-header .navbar .nav > .active > a {
background-color: rgba(0, 0, 0, 0.1);
color: #f6f6f6;
}
.main-header .navbar .sidebar-toggle {
color: #bec5cb;
}
.main-header .navbar .sidebar-toggle:hover {
color: #f6f6f6;
background-color: rgba(0, 0, 0, 0.1);
}
.timeline li .timeline-item {
color: #bec5cb;
background-color: #272c30;
border-color: #353c42;
}
.timeline li .timeline-header {
border-bottom-color: #353c42;
}
.nav-stacked > li > a {
color: #bec5cb;
}
.nav-stacked > li > a:hover {
color: white;
background-color: #1e2226;
}
.content-wrapper,
.right-side {
background-color: #353c42;
}
.main-footer,
.nav-tabs-custom {
background-color: #272c30;
border-top-color: #353c42;
color: #bec5cb;
}
.main-footer .nav-tabs,
.nav-tabs-custom .nav-tabs {
background-color: #30383f;
border-bottom-color: #2f363b;
}
.main-footer .tab-content,
.nav-tabs-custom .tab-content {
background-color: #30383f;
}
.nav-tabs-custom > .nav-tabs {
background: rgba(64, 72, 80, 0.666);
}
.nav-tabs-custom > .nav-tabs > li {
margin-right: 1px;
color: #bec5cb;
}
.nav-tabs-custom > .nav-tabs > li.active > a,
.nav-tabs-custom > .nav-tabs > li.active:hover > a {
border-left-color: #30383f;
border-right-color: #30383f;
background-color: #30383f;
color: #bec5cb;
}
.nav-tabs-custom > .nav-tabs > li:not(.active):hover {
border-top-color: #d2d6de;
background-color: transparent;
}
.nav-tabs-custom > .nav-tabs > li > a {
color: #8e959b;
}
.nav-tabs-custom > .nav-tabs > li > a:focus {
color: #3c8dbc;
}
.nav-tabs-custom > .nav-tabs > li:hover > a,
.nav-tabs-custom > .nav-tabs > li.active:hover > a {
background-color: #353c42;
color: #bec5cb;
}
.list-group {
color: #bec5cb;
background-color: #272c30;
}
.list-group .list-group-item {
border-color: #353c42;
background-color: #272c30;
}
.input-group .input-group-addon {
border-right: 1px solid #272c30;
}
.select2 .select2-selection {
background-color: #353c42;
color: #bec5cb;
border: 1px solid #353c42;
}
.select2 .select2-selection .select2-container--default,
.select2 .select2-selection .select2-selection--single,
.select2 .select2-selection .select2-selection--multiple,
.select2 .select2-selection .select2-selection__rendered {
color: #bec5cb;
}
.select2-dropdown {
background-color: #353c42;
color: #bec5cb;
border: 1px solid #353c42;
}
.select2-dropdown .select2-search__field {
background-color: #272c30;
color: #bec5cb;
border: 1px solid #353c42;
}
.select2-container--default.select2-container--open {
background-color: #272c30;
}
.layout-boxed {
background: url("../../img/boxed-bg-dark.png") repeat fixed;
}
.not-used {
background-color: #eee;
}
.not-used:hover {
background-color: #c5c5c5;
}
.used {
background-color: #fff;
}
.used:hover {
background-color: #ddd;
}
.graphs-grid {
background-color: rgba(255, 255, 255, 0.2);
}
.graphs-ticks {
color: #b8c7ce;
}
.queries-permitted {
background-color: #00a65a;
}
.queries-blocked {
background-color: #999;
}
.progress {
background-color: #333;
}
.bg-green {
background-color: #005c32 !important;
}
.bg-aqua {
background-color: #007997 !important;
}
.bg-yellow {
background-color: #b1720c !important;
}
.bg-red {
background-color: #913225 !important;
}
code,
pre {
padding: 2px 4px;
font-size: 90%;
color: #bec5cb;
background-color: #353c42;
border-radius: 4px;
}
/* Used in the Query Log table */
.text-green-light {
color: #5ca314 !important;
}
.text-green {
color: #00aa60 !important;
}
.text-orange {
color: #b1720c !important;
}
.text-red {
color: #bd2c19 !important;
}
.text-vivid-blue {
color: #007997 !important;
}
td.highlight {
background-color: rgba(255, 204, 0, 0.333);
}
.btn-default {
box-shadow: none;
background-color: #3e464c;
color: #bec5cb;
border: 1px solid #353c42;
}
/* Used in debug log page */
.log-red {
color: #ff4038;
}
.log-green {
color: #4c4;
}
.log-yellow {
color: #fb0;
}
.log-blue {
color: #48f;
}
.log-purple {
color: #b8e;
}
.log-cyan {
color: #0df;
}
.log-gray {
color: #999;
}
#output {
border-color: #505458;
background: #272c30;
}
/* Used by the long-term pages */
.daterangepicker {
background-color: #3e464c;
border-radius: 4px;
border: 1px solid #353c42;
}
.daterangepicker .ranges li:hover {
background-color: #353c42;
}
.daterangepicker .ranges li.active {
background-color: #1e2226; /* Color also used in table pagination */
}
.daterangepicker .calendar-table {
background-color: #3e464c;
border-radius: 4px;
border: 1px solid #353c42;
}
.daterangepicker td.off,
.daterangepicker td.off.in-range,
.daterangepicker td.off.start-date,
.daterangepicker td.off.end-date {
background-color: #485158;
}
.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
background-color: #1e2226;
}
.daterangepicker td.active,
.daterangepicker td.active:hover,
.daterangepicker td.in-range:hover {
background-color: #225e92;
}
.daterangepicker td.in-range {
background-color: #1e2226;
color: #bec5cb;
}
input,
select,
select.form-control,
.form-group .input-group-addon,
.input-group .input-group-addon,
.form-group input,
.input-group input,
.form-group textarea,
.input-group textarea,
.daterangepicker select.hourselect,
.daterangepicker select.minuteselect,
.daterangepicker select.secondselect,
.daterangepicker select.ampmselect,
.form-control,
div.dataTables_wrapper div.dataTables_length select {
background-color: #353c42;
color: #bec5cb;
border: 1px solid #3d444b;
}
.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
background-color: #353c42;
opacity: 1;
}
.navbar-custom-menu > .navbar-nav > li > .dropdown-menu {
background-color: #4c5761;
color: #bec5cb;
border: 1px solid #171c20;
}
.table-striped > tbody > tr:nth-of-type(2n + 1) {
background-color: #2d343a;
}
.panel,
.panel-body,
.panel-default > .panel-heading {
background-color: #3e464c;
border-radius: 4px;
border: 1px solid #353c42;
color: #bec5cb;
}
.box.box-solid.box-info,
.box.box-solid.box-info > .box-header {
color: #bec5cb;
background-color: #367fa9 !important;
border: 1px solid #367fa9;
}
input[type="password"]::-webkit-credentials-auto-fill-button {
background: #bfc5ca;
}
input[type="password"]::-webkit-caps-lock-indicator {
filter: invert(100%);
}
.network-never {
background-color: #661b02;
}
.network-recent {
background-color: #114100;
}
.network-old {
background-color: #525200;
}
.network-older {
background-color: #502b00;
}
.network-gradient {
background-image: linear-gradient(to right, #114100 0%, #525200 100%);
}
.icheckbox_polaris,
.icheckbox_futurico,
.icheckbox_minimal-blue {
margin-right: 10px;
}
.iradio_polaris,
.iradio_futurico,
.iradio_minimal-blue {
margin-right: 8px;
}
/* Overlay box with spinners as shown during data collection for graphs */
.box .overlay,
.overlay-wrapper .overlay {
z-index: 50;
background-color: rgba(53, 60, 66, 0.733);
border-radius: 3px;
}
.box .overlay > .fa,
.overlay-wrapper .overlay > .fa,
.navbar-nav > .user-menu > .dropdown-menu > .user-body a {
color: #bec5cb !important;
}
.navbar-nav > .user-menu > .dropdown-menu > .user-footer {
background-color: #353c42bb;
padding: 10px;
}
.modal-content {
background: #272c30;
}
.modal-header {
border-bottom-color: #353c42;
}
.modal-footer {
border-top-color: #353c42;
}
.close {
color: #383838;
}
/*** Fix login input visual misalignment ***/
#loginform,
#loginform input {
color: rgb(120, 127, 133);
}
.login-options input,
.login-options [class*="icheck-"] > input:first-child + input[type="hidden"] + label::before,
.login-options [class*="icheck-"] > input:first-child + label::before {
background: none;
border-color: rgb(120, 127, 133);
}
/*** Additional fixes For Pi.Alert UI ***/
.small-box {
border-radius: 10px;
border-top: 0px;
}
.pa-small-box-aqua .inner {
background-color: rgb(45,108,133);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.pa-small-box-green .inner {
background-color: rgb(31,76,46);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.pa-small-box-yellow .inner {
background-color: rgb(151,104,37);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.pa-small-box-red .inner {
background-color: rgb(120,50,38);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.pa-small-box-gray .inner {
background-color: #777;
/* color: rgba(20,20,20,30%); */
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
.pa-small-box-gray .inner h3 {
color: #bbb;
}
.text-gray-20 {
color: rgba(220,220,220,30%);
}
.bg-gray {
background-color: #888888 !important;
}
.badge.bg-green {
background-color: #00A000 !important;
}
.badge.bg-gray {
background-color: #888 !important;
}
#txtRecord {
background-color: #353c42;
border-color: #888888;
}
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
background-color: rgb(189,192,198);
color: #444;
}
.db_info_table_cell:nth-child(1) {background: #272c30}
.db_info_table_cell:nth-child(2) {background: #272c30}
.db_tools_table_cell_a:nth-child(1) {background: #272c30}
.db_tools_table_cell_a:nth-child(2) {background: #272c30}
.db_tools_table_cell_b:nth-child(1) {background: #272c30}
.db_tools_table_cell_b:nth-child(2) {background: #272c30}
.db_info_table {
display: table;
border-spacing: 0em;
font-weight: 400;
font-size: 15px;
width: 100%;
margin: auto;
}
.nav-tabs-custom > .nav-tabs > li:hover > a, .nav-tabs-custom > .nav-tabs > li.active:hover > a {
background-color: #272c30;
color: #bec5cb;
}
.nav-tabs-custom > .nav-tabs > li.active > a, .nav-tabs-custom > .nav-tabs > li.active:hover > a {
border-left-color: #30383f;
border-right-color: #30383f;
background-color: #272c30;
color: #bec5cb;
}
.nav-tabs-custom > .nav-tabs {
background-color: #353c42;
}
.nav-tabs-custom .tab-content {
background-color: #272c30;
}
.top_small_box_gray_text {
color: white !important;
}
/* remove white border that appears on mobile screen sizes */
.box-body {
border: 0px;
}
/* remove white border that appears on mobile screen sizes */
.table-responsive {
border: 0px;
}
.login-page {
background-color: transparent;
}
.login-logo a {
color: white;
}
.login-box-body {
color: #bec5cb;
background-color: #272c30;
}
/* Add border radius to bottom of the status boxes*/
.pa-small-box-footer {
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
.small-box > .inner h3, .small-box > .inner p {
margin-bottom: 0px;
margin-left: 0px;
}
.small-box:hover .icon {
font-size: 3.74em;
}
.small-box .icon {
top: 0.01em;
font-size: 3.25em;
}
.pa_semitransparent-panel{
background-color: #000 !important;
}
}

File diff suppressed because it is too large Load Diff

467
front/deviceDetailsEdit.php Executable file
View File

@@ -0,0 +1,467 @@
<?php
//------------------------------------------------------------------------------
// check if authenticated
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
?>
<div class="row">
<div class="box-body form-horizontal">
<form id="edit-form">
<!-- Form fields will be appended here -->
</form>
</div>
<!-- Buttons -->
<div class="col-xs-12">
<div class="pull-right">
<button type="button"
class="btn btn-default pa-btn pa-btn-delete"
style="margin-left:0px;"
id="btnDeleteEvents"
onclick="askDeleteDeviceEvents()">
<?= lang('DevDetail_button_DeleteEvents');?>
</button>
<button type="button"
class="btn btn-default pa-btn pa-btn-delete"
style="margin-left:0px;"
id="btnDelete"
onclick="askDeleteDevice()">
<?= lang('DevDetail_button_Delete');?>
</button>
<button type="button"
class="btn btn-primary pa-btn"
style="margin-left:6px; "
id="btnSave"
onclick="setDeviceData()" >
<?= lang('DevDetail_button_Save');?>
</button>
</div>
</div>
</div>
<script defer>
// -------------------------------------------------------------------
// Get plugin and settings data from API endpoints
function getDeviceData(readAllData){
mac = getMac()
console.log(mac);
// get data from server
$.get('php/server/devices.php?action=getServerDeviceData&mac='+ mac + '&period='+ period, function(data) {
// show loading dialog
showSpinner()
var deviceData = JSON.parse(data);
// Deactivate next previous buttons
if (readAllData) {
$('#btnPrevious').attr ('disabled','');
$('#btnPrevious').addClass ('text-gray50');
$('#btnNext').attr ('disabled','');
$('#btnNext').addClass ('text-gray50');
}
// some race condition, need to implement delay
setTimeout(() => {
$.get('/php/server/query_json.php', { file: 'table_settings.json', nocache: Date.now() }, function(res) {
settingsData = res["data"];
// columns to hide
hiddenFields = ["NEWDEV_devScan", "NEWDEV_devPresentLastScan" ]
// columns to disable - conditional depending if a new dummy device is created
disabledFields = mac == "new" ? ["NEWDEV_devLastNotification", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection"] : ["NEWDEV_devLastNotification", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection", "NEWDEV_devMac", "NEWDEV_devLastIP" ];
// Grouping of fields into categories with associated documentation links
const fieldGroups = {
// Group for device main information
DevDetail_MainInfo_Title: {
data: ["devMac", "devLastIP", "devName", "devOwner", "devType", "devVendor", "devGroup", "devIcon", "devLocation", "devComments"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_MANAGEMENT.md",
iconClass: "fa fa-pencil"
},
// Group for session information
DevDetail_SessionInfo_Title: {
data: ["devStatus", "devLastConnection", "devFirstConnection"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/SESSION_INFO.md",
iconClass: "fa fa-calendar"
},
// Group for event and alert settings
DevDetail_EveandAl_Title: {
data: ["devAlertEvents", "devAlertDown", "devSkipRepeated"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
iconClass: "fa fa-bell"
},
// Group for network details
DevDetail_MainInfo_Network_Title: {
data: ["devParentMAC", "devParentPort", "devSSID", "devSite"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md",
iconClass: "fa fa-network-wired"
},
// Group for other fields like static IP, archived status, etc.
DevDetail_DisplayFields_Title: {
data: ["devStaticIP", "devIsNew", "devFavorite", "devIsArchived"],
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/DEVICE_DISPLAY_SETTINGS.md",
iconClass: "fa fa-list-check"
}
};
// Filter settings data to get relevant settings
const relevantSettings = settingsData.filter(set =>
set.setGroup === "NEWDEV" && // Filter for settings in the "NEWDEV" group
set.setKey.includes("_dev") && // Include settings with '_dev' in the key
!hiddenFields.includes(set.setKey) && // Exclude settings listed in hiddenFields
!set.setKey.includes("__metadata") // Exclude metadata fields
);
// Function to generate the form
const generateSimpleForm = settings => {
const form = $('#edit-form'); // Get the form element to append generated fields
// Loop over each field group to generate sections for each category
Object.entries(fieldGroups).forEach(([groupName, obj]) => {
const groupDiv = $('<div>').addClass('field-group col-lg-4 col-sm-6 col-xs-12'); // Create a div for each group with responsive Bootstrap classes
// Add group title and documentation link
groupDiv.append(`<h5><i class="${obj.iconClass}"></i> ${getString(groupName)}
<span class="helpIconSmallTopRight">
<a target="_blank" href="${obj.docs}">
<i class="fa fa-circle-question"></i>
</a>
</span>
</h5>
<hr>
`);
// Filter relevant settings for the current group
const groupSettings = settings.filter(set => obj.data.includes(set.setKey.replace('NEWDEV_', '')));
// Loop over each setting in the group to generate form fields
groupSettings.forEach(setting => {
const column = $('<div>'); // Create a column for each setting (Bootstrap column)
// Get the field data (replace 'NEWDEV_' prefix from the key)
fieldData = deviceData[setting.setKey.replace('NEWDEV_', '')]
fieldData = fieldData == null ? "" : fieldData;
// console.log(setting.setKey);
// console.log(fieldData);
// Additional form elements like the random MAC address button for devMac
let inlineControl = "";
// handle rendom mac
if (setting.setKey == "NEWDEV_devMac" && deviceData["devIsRandomMAC"] == true) {
inlineControl += `<span class="input-group-addon pointer"
title="${getString("RandomMAC_hover")}">
<a href="https://github.com/jokob-sk/NetAlertX/blob/main/docs/RANDOM_MAC.md" target="_blank">
<i class="fa-solid fa-shuffle"></i>
</a>
</span>`;
}
// handle generate MAC for new device
if (setting.setKey == "NEWDEV_devMac" && deviceData["devMac"] == "") {
inlineControl += `<span class="input-group-addon pointer"
onclick="generate_NEWDEV_devMac()"
title="${getString("Gen_Generate")}">
<i class="fa-solid fa-dice" ></i>
</span>`;
}
// handle generate IP for new device
if (setting.setKey == "NEWDEV_devLastIP" && deviceData["devLastIP"] == "") {
inlineControl += `<span class="input-group-addon pointer"
onclick="generate_NEWDEV_devLastIP()"
title="${getString("Gen_Generate")}">
<i class="fa-solid fa-dice" ></i>
</span>`;
}
// handle generate IP for new device
if (setting.setKey == "NEWDEV_devIcon") {
inlineControl += `<span class="input-group-addon pointer"
onclick="showIconSelection()"
title="${getString("Gen_Select")}">
<i class="fa-solid fa-chevron-down" ></i>
</span>`;
}
// Generate the input field HTML
const inputFormHtml = `<div class="form-group col-xs-12">
<label class="col-sm-4 col-xs-12 control-label"> ${setting.setName}
<i my-set-key="${setting.setKey}"
title="${getString("Settings_Show_Description")}"
class="fa fa-circle-info pointer helpIconSmallTopRight"
onclick="showDescriptionPopup(this)">
</i>
</label>
<div class="col-sm-8 col-xs-12 input-group">
${generateFormHtml(setting, fieldData.toString())}
${inlineControl}
</div>
</div>`;
column.append(inputFormHtml); // Append the input field to the column
groupDiv.append(column); // Append the column to the group div
});
form.append(groupDiv); // Append the group div (containing columns) to the form
});
// wait until everything is initialized to update icon
updateIconPreview();
// update readonly fields
handleReadOnly(settingsData, disabledFields);
// Page title - Name
if (mac == "new") {
$('#pageTitle').html(`<i title="${getString("Gen_create_new_device")}" class="fa fa-square-plus"></i> ` + getString("Gen_create_new_device"));
} else if (deviceData['devOwner'] == null || deviceData['devOwner'] == '' ||
(deviceData['devName'].toString()).indexOf(deviceData['devOwner']) != -1) {
$('#pageTitle').html(deviceData['devName']);
} else {
$('#pageTitle').html(deviceData['devName'] + ' (' + deviceData['devOwner'] + ')');
}
};
// console.log(relevantSettings)
generateSimpleForm(relevantSettings);
// <> chevrons
updateChevrons(deviceData)
toggleNetworkConfiguration(mac == 'Internet')
hideSpinner();
})
}, 1);
});
}
// ----------------------------------------
// Handle previous/next arrows/chevrons
function updateChevrons(deviceData) {
devicesList = getDevicesList();
// console.log(devicesList);
// Check if device is part of the devicesList
pos = devicesList.findIndex(item => item.rowid == deviceData['rowid']);
// console.log(pos);
if (pos == -1) {
devicesList.push({"rowid" : deviceData['rowid'], "mac" : deviceData['devMac'], "name": deviceData['devName'], "type": deviceData['devType']});
pos=0;
}
// Record number
$('#txtRecord').html (pos+1 +' / '+ devicesList.length);
// Deactivate previous button
if (pos <= 0) {
$('#btnPrevious').attr ('disabled','');
$('#btnPrevious').addClass ('text-gray50');
} else {
$('#btnPrevious').removeAttr ('disabled');
$('#btnPrevious').removeClass ('text-gray50');
}
// Deactivate next button
if (pos >= (devicesList.length-1)) {
$('#btnNext').attr ('disabled','');
$('#btnNext').addClass ('text-gray50');
} else {
$('#btnNext').removeAttr ('disabled');
$('#btnNext').removeClass ('text-gray50');
}
}
// ----------------------------------------
// Handle the read-only fields
function handleReadOnly(settingsData, disabledFields) {
settingsData.forEach(setting => {
const element = $(`#${setting.setKey}`);
if (disabledFields.includes(setting.setKey)) {
element.prop('readonly', true);
} else {
element.prop('readonly', false);
}
});
}
// ----------------------------------------
// Show the description of a setting
function showDescriptionPopup(e) {
console.log($(e).attr("my-set-key"));
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
}
// -----------------------------------------------------------------------------
function askDeleteDeviceEvents () {
// Check MAC
if (mac == '') {
return;
}
// Ask delete device Events
showModalWarning ('<?= lang('DevDetail_button_DeleteEvents');?>', '<?= lang('DevDetail_button_DeleteEvents_Warning');?>',
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteDeviceEvents');
}
function deleteDeviceEvents () {
// Check MAC
if (mac == '') {
return;
}
// Delete device events
$.get('php/server/devices.php?action=deleteDeviceEvents&mac='+ mac, function(msg) {
showMessage (msg);
});
// Deactivate controls
$('#panDetails :input').attr('disabled', true);
}
// -----------------------------------------------------------------------------
function askDeleteDevice () {
// Check MAC
if (mac == '') {
return;
}
// Ask delete device
showModalWarning ('Delete Device', 'Are you sure you want to delete this device?<br>(maybe you prefer to archive it)',
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteDevice');
}
// -----------------------------------------------------------------------------
function deleteDevice () {
// Check MAC
if (mac == '') {
return;
}
// Delete device
$.get('php/server/devices.php?action=deleteDevice&mac='+ mac, function(msg) {
showMessage (msg);
});
// Deactivate controls
$('#panDetails :input').attr('disabled', true);
// refresh API
updateApi("devices,appevents")
}
// -----------------------------------------------------------------------------
function setDeviceData(direction = '', refreshCallback = '') {
// Check MAC
if (mac === '') {
return;
}
// Determine if a new device should be created
const createNew = mac === 'new' ? 1 : 0;
const devLastIP = $('#NEWDEV_devLastIP').val();
// Validate MAC and Last IP
if (mac === '' || !(isValidIPv4(devLastIP) || isValidIPv6(devLastIP))) {
showMessage(getString("DeviceEdit_ValidMacIp"), 5000, "modal_red");
return;
}
showSpinner();
// update data to server
$.get('php/server/devices.php?action=setDeviceData&mac='+ $('#NEWDEV_devMac').val()
+ '&name=' + encodeURIComponent($('#NEWDEV_devName').val().replace(/'/g, ""))
+ '&owner=' + encodeURIComponent($('#NEWDEV_devOwner').val().replace(/'/g, ""))
+ '&type=' + $('#NEWDEV_devType').val()
+ '&vendor=' + encodeURIComponent($('#NEWDEV_devVendor').val().replace(/'/g, ""))
+ '&icon=' + encodeURIComponent($('#NEWDEV_devIcon').val())
+ '&favorite=' + ($('#NEWDEV_devFavorite')[0].checked * 1)
+ '&group=' + encodeURIComponent($('#NEWDEV_devGroup').val())
+ '&location=' + encodeURIComponent($('#NEWDEV_devLocation').val())
+ '&comments=' + encodeURIComponent(encodeSpecialChars($('#NEWDEV_devComments').val()))
+ '&networknode=' + $('#NEWDEV_devParentMAC').val()
+ '&networknodeport=' + $('#NEWDEV_devParentPort').val()
+ '&ssid=' + $('#NEWDEV_devSSID').val()
+ '&networksite=' + $('#NEWDEV_devSite').val()
+ '&staticIP=' + ($('#NEWDEV_devStaticIP')[0].checked * 1)
+ '&scancycle=' + "1"
+ '&alertevents=' + ($('#NEWDEV_devAlertEvents')[0].checked * 1)
+ '&alertdown=' + ($('#NEWDEV_devAlertDown')[0].checked * 1)
+ '&skiprepeated=' + $('#NEWDEV_devSkipRepeated').val().split(' ')[0]
+ '&newdevice=' + ($('#NEWDEV_devIsNew')[0].checked * 1)
+ '&archived=' + ($('#NEWDEV_devIsArchived')[0].checked * 1)
+ '&devFirstConnection=' + ($('#NEWDEV_devFirstConnection').val())
+ '&devLastConnection=' + ($('#NEWDEV_devLastConnection').val())
+ '&ip=' + ($('#NEWDEV_devLastIP').val())
+ '&createNew=' + createNew
, function(msg) {
showMessage (msg);
// Remove navigation prompt "Are you sure you want to leave..."
window.onbeforeunload = null;
somethingChanged = false;
// refresh API
updateApi("devices,appevents")
// Callback fuction
if (typeof refreshCallback == 'function') {
refreshCallback(direction);
}
// everything loaded
hideSpinner();
});
}
//-----------------------------------------------------------------------------------
// Disables or enables network configuration for the root node
function toggleNetworkConfiguration(disable) {
if (disable) {
// Completely disable the NEWDEV_devParentMAC <select> and NEWDEV_devParentPort
$('#NEWDEV_devParentMAC').prop('disabled', true).val("").prop('selectedIndex', 0);
$('#NEWDEV_devParentMAC').empty() // Remove all options
.append('<option value="">Root Node</option>')
$('#NEWDEV_devParentPort').prop('disabled', true);
$('#NEWDEV_devParentPort').prop('readonly', true );
$('#NEWDEV_devParentMAC').prop('readonly', true );
} else {
// Enable the NEWDEV_devParentMAC <select> and NEWDEV_devParentPort
$('#NEWDEV_devParentMAC').prop('disabled', false);
$('#NEWDEV_devParentPort').prop('disabled', false);
$('#NEWDEV_devParentPort').prop('readonly', false );
$('#NEWDEV_devParentMAC').prop('readonly', false );
}
}
// -------------------- INIT ------------------------
getDeviceData(true);
</script>

View File

@@ -1,74 +1,125 @@
<?php
//------------------------------------------------------------------------------
// check if authenticated
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
?>
<!-- INTERNET INFO -->
<?php if ($_REQUEST["mac"] == "Internet") { ?>
<h4 class=""><i class="fa-solid fa-globe"></i>
<?= lang("DevDetail_Tab_Tools_Internet_Info_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Internet_Info_Description") ?>
</h5>
<br>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="internetinfo()">
<?= lang("DevDetail_Tab_Tools_Internet_Info_Start") ?></button>
<h4 class=""><i class="fa-solid fa-globe"></i>
<?= lang("DevDetail_Tab_Tools_Internet_Info_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Internet_Info_Description") ?>
</h5>
<br>
<div id="internetinfooutput" style="margin-top: 10px;"></div>
</div>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="internetinfo()">
<?= lang("DevDetail_Tab_Tools_Internet_Info_Start") ?></button>
<br>
<div id="internetinfooutput" style="margin-top: 10px;"></div>
</div>
<?php } ?>
<!-- COPY FROM DEVICE -->
<?php if ($_REQUEST["mac"] != "Internet") { ?>
<h4 class=""><i class="fa-solid fa-copy"></i>
<?= lang("DevDetail_Copy_Device_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Copy_Device_Tooltip") ?>
</h5>
<br>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<select class="form-control"
title="<?= lang('DevDetail_Copy_Device_Tooltip');?>"
id="txtCopyFromDevice" >
<option value="lemp_loading" id="lemp_loading">Loading</option>
</select>
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="()">
<?= lang("BackDevDetail_Copy_Title") ?></button>
<br>
</div>
<?php } ?>
<!-- WAKE ON LAN - WOL -->
<?php if ($_REQUEST["mac"] != "Internet") { ?>
<h4 class=""><i class="fa-solid fa-bell"></i>
<?= lang("DevDetail_Tools_WOL_noti") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tools_WOL_noti_text") ?>
</h5>
<br>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="wakeonlan()">
<?= lang("DevDetail_Tools_WOL_noti") ?></button>
<br>
<div id="wol_output" style="margin-top: 10px;"></div>
</div>
<?php } ?>
<!-- SPEEDTEST -->
<?php if ($_REQUEST["mac"] == "Internet") { ?>
<h4 class=""><i class="fa-solid fa-gauge-high"></i>
<?= lang("DevDetail_Tab_Tools_Speedtest_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Speedtest_Description") ?>
</h5>
<br>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="speedtestcli" class="btn btn-primary pa-btn" style="margin: auto;" onclick="speedtestcli()">
<?= lang("DevDetail_Tab_Tools_Speedtest_Start") ?></button>
<h4 class=""><i class="fa-solid fa-gauge-high"></i>
<?= lang("DevDetail_Tab_Tools_Speedtest_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Speedtest_Description") ?>
</h5>
<br>
<div id="speedtestoutput" style="margin-top: 10px;"></div>
</div>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="speedtestcli" class="btn btn-primary pa-btn" style="margin: auto;" onclick="speedtestcli()">
<?= lang("DevDetail_Tab_Tools_Speedtest_Start") ?></button>
<br>
<div id="speedtestoutput" style="margin-top: 10px;"></div>
</div>
<?php } ?>
<!-- TRACEROUTE -->
<?php if ($_REQUEST["mac"] != "Internet") { ?>
<h4 class=""><i class="fa-solid fa-route"></i>
<?= lang("DevDetail_Tab_Tools_Traceroute_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Traceroute_Description") ?>
</h5>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="traceroute" class="btn btn-primary pa-btn" style="margin: auto;" onclick="traceroute()">
<?= lang("DevDetail_Tab_Tools_Traceroute_Start") ?>
</button>
<br>
<div id="tracerouteoutput" style="margin-top: 10px;"></div>
</div>
<h4 class=""><i class="fa-solid fa-route"></i>
<?= lang("DevDetail_Tab_Tools_Traceroute_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Traceroute_Description") ?>
</h5>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="traceroute" class="btn btn-primary pa-btn" style="margin: auto;" onclick="traceroute()">
<?= lang("DevDetail_Tab_Tools_Traceroute_Start") ?>
</button>
<br>
<div id="tracerouteoutput" style="margin-top: 10px;"></div>
</div>
<?php } ?>
<!-- NSLOOKUP -->
<?php if ($_REQUEST["mac"] != "Internet") { ?>
<h4 class=""><i class="fa-solid fa-magnifying-glass"></i>
<?= lang("DevDetail_Tab_Tools_Nslookup_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Nslookup_Description") ?>
</h5>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="nslookup" class="btn btn-primary pa-btn" style="margin: auto;" onclick="nslookup()">
<?= lang("DevDetail_Tab_Tools_Nslookup_Start") ?>
</button>
<br>
<div id="nslookupoutput" style="margin-top: 10px;"></div>
</div>
<h4 class=""><i class="fa-solid fa-magnifying-glass"></i>
<?= lang("DevDetail_Tab_Tools_Nslookup_Title") ?>
</h4>
<h5 class="">
<?= lang("DevDetail_Tab_Tools_Nslookup_Description") ?>
</h5>
<div style="width:100%; text-align: center; margin-bottom: 50px;">
<button type="button" id="nslookup" class="btn btn-primary pa-btn" style="margin: auto;" onclick="nslookup()">
<?= lang("DevDetail_Tab_Tools_Nslookup_Start") ?>
</button>
<br>
<div id="nslookupoutput" style="margin-top: 10px;"></div>
</div>
<?php } ?>
<!-- NMAP SCANS -->
<h4 class=""><i class="fa-solid fa-ethernet"></i>
<?= lang("DevDetail_Nmap_Scans") ?>
</h4>
@@ -77,16 +128,16 @@
<?= lang("DevDetail_Nmap_Scans_desc") ?>
</div>
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'dev_LastIP'), 'fast')">
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'fast')">
<?= lang("DevDetail_Loading") ?>
</button>
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'dev_LastIP'), 'normal')">
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'normal')">
<?= lang("DevDetail_Loading") ?>
</button>
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'dev_LastIP'), 'detail')">
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'detail')">
<?= lang("DevDetail_Loading") ?>
</button>
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'dev_LastIP'), 'skipdiscovery')">
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'skipdiscovery')">
<?= lang("DevDetail_Loading") ?>
</button>
@@ -155,7 +206,7 @@
$( "#tracerouteoutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/traceroute.php?action=get&ip=" + getDeviceDataByMac(getMac(), 'dev_LastIP') + "",
url: "./php/server/traceroute.php?action=get&ip=" + getDevDataByMac(getMac(), 'devLastIP') + "",
beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
@@ -170,7 +221,7 @@
$( "#nslookupoutput" ).empty();
$.ajax({
method: "GET",
url: "./php/server/nslookup.php?action=get&ip=" + getDeviceDataByMac(getMac(), 'dev_LastIP') + "",
url: "./php/server/nslookup.php?action=get&ip=" + getDevDataByMac(getMac(), 'devLastIP') + "",
beforeSend: function() { $('#nslookupoutput').addClass("ajax_scripts_loading"); },
complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); },
success: function(data, textStatus) {
@@ -181,23 +232,110 @@
// ----------------------------------------------------------------
function initNmapButtons() {
setTimeout(function(){
document.getElementById('piamanualnmap_fast').innerHTML=getString(
"DevDetail_Nmap_buttonFast"
) ;
document.getElementById('piamanualnmap_normal').innerHTML=getString(
"DevDetail_Nmap_buttonDefault"
) ;
document.getElementById('piamanualnmap_detail').innerHTML=getString(
"DevDetail_Nmap_buttonDetail"
) ;
document.getElementById('piamanualnmap_skipdiscovery').innerHTML=getString(
"DevDetail_Nmap_buttonSkipDiscovery"
) ;
}, 500);
}
setTimeout(function(){
document.getElementById('piamanualnmap_fast').innerHTML=getString(
"DevDetail_Nmap_buttonFast"
) ;
document.getElementById('piamanualnmap_normal').innerHTML=getString(
"DevDetail_Nmap_buttonDefault"
) ;
document.getElementById('piamanualnmap_detail').innerHTML=getString(
"DevDetail_Nmap_buttonDetail"
) ;
document.getElementById('piamanualnmap_skipdiscovery').innerHTML=getString(
"DevDetail_Nmap_buttonSkipDiscovery"
) ;
}, 500);
}
// ----------------------------------------------------------------
function initCopyFromDevice() {
const devices = getVisibleDevicesList()
console.log(devices);
const $select = $('#txtCopyFromDevice');
$select.empty(); // Clear existing options
devices.forEach(device => {
const option = $('<option></option>')
.val(device.devMac)
.text(device.devName);
$select.append(option);
});
}
// ----------------------------------------------------------------
function wakeonlan() {
macAddress = getMac();
// Execute
$.get('php/server/devices.php?action=wakeonlan&'
+ '&mac=' + macAddress
+ '&ip=' + getDevDataByMac(macAddress, "devLastIP")
, function(msg) {
showMessage (msg);
});
}
// ------------------------------------------------------------
function copyFromDevice() {
macAddress = getMac();
// Execute
$.get('php/server/devices.php?action=copyFromDevice&'
+ '&macTo=' + macAddress
+ '&macFrom=' + $('#txtCopyFromDevice').val()
, function(msg) {
showMessage (msg);
setTimeout(function() {
window.location.reload();
}, 2000);
});
}
// ------------------------------------------------------------
function getVisibleDevicesList()
{
// Read cache (skip cookie expiry check)
devicesList = getCache('devicesListAll_JSON', true);
if (devicesList != '') {
devicesList = JSON.parse (devicesList);
} else {
devicesList = [];
}
// only loop thru the filtered down list
visibleDevices = getCache("ntx_visible_macs")
if(visibleDevices != "") {
visibleDevicesMACs = visibleDevices.split(',');
devicesList_tmp = [];
// Iterate through the data and filter only visible devices
$.each(devicesList, function(index, item) {
// Check if the current item's MAC exists in visibleDevicesMACs
if (visibleDevicesMACs.includes(item.devMac)) {
devicesList_tmp.push(item);
}
});
// Update devicesList with the filtered items
devicesList = devicesList_tmp;
}
return devicesList;
}
// ----------------------------------------------------------------
function internetinfo() {
$( "#internetinfooutput" ).empty();
@@ -210,8 +348,9 @@
$("#internetinfooutput").html(data);
}
})
}
}
// init first time
initNmapButtons();
initCopyFromDevice();
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -176,9 +176,9 @@
<!-- ----------------------------------------------------------------------- -->
<!-- Datatable -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css">
<script src="lib/AdminLTE/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="lib/AdminLTE/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="lib/datatables.net-bs/css/dataTables.bootstrap.min.css">
<script src="lib/datatables.net/js/jquery.dataTables.min.js"></script>
<script src="lib/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
<!-- page script ----------------------------------------------------------- -->

View File

@@ -84,29 +84,31 @@ if (isset ($_SESSION["login"]) == FALSE || $_SESSION["login"] != 1)
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.7 -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="lib/bootstrap/bootstrap.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/Ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="lib/Ionicons/ionicons.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="lib/AdminLTE/dist/css/AdminLTE.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="lib/AdminLTE/plugins/iCheck/square/blue.css">
<link rel="stylesheet" href="lib/iCheck/square/blue.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/fontawesome.min.css">
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/solid.css">
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/brands.css">
<link rel="stylesheet" href="lib/AdminLTE/bower_components/font-awesome/css/v5-font-face.css">
<link rel="stylesheet" href="lib/font-awesome/fontawesome.min.css">
<link rel="stylesheet" href="lib/font-awesome/solid.css">
<link rel="stylesheet" href="lib/font-awesome/brands.css">
<link rel="stylesheet" href="lib/font-awesome/v5-font-face.css">
<!-- Favicon -->
<link id="favicon" rel="icon" type="image/x-icon" href="img/NetAlertX_logo.png">
<!-- Dark-Mode Patch -->
<?php
if ($ENABLED_DARKMODE === True) {
echo '<link rel="stylesheet" href="css/dark-patch.css">';
$BACKGROUND_IMAGE_PATCH='style="background-image: url(\'img/boxed-bg-dark.png\');"';
} else { $BACKGROUND_IMAGE_PATCH='style="background-image: url(\'img/background.png\');"';}
switch ($UI_THEME) {
case "Dark":
echo '<link rel="stylesheet" href="css/dark-patch.css">';
break;
case "System":
echo '<link rel="stylesheet" href="css/system-dark-patch.css">';
break;
}
?>
<link rel="stylesheet" href="/css/offline-font.css">
</head>
@@ -163,11 +165,11 @@ if ($ENABLED_DARKMODE === True) {
<!-- jQuery 3 -->
<script src="lib/AdminLTE/bower_components/jquery/dist/jquery.min.js"></script>
<script src="lib/jquery/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="lib/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="lib/bootstrap/bootstrap.min.js"></script>
<!-- iCheck -->
<script src="lib/AdminLTE/plugins/iCheck/icheck.min.js"></script>
<script src="lib/iCheck/icheck.min.js"></script>
<script>
$(function () {
$('input').iCheck({

View File

@@ -12,7 +12,7 @@ var timerRefreshData = ''
var emptyArr = ['undefined', "", undefined, null, 'null'];
var UI_LANG = "English";
const allLanguages = ["en_us", "es_es", "de_de", "fr_fr", "it_it", "ru_ru", "nb_no", "pl_pl", "pt_br", "tr_tr", "zh_cn", "cs_cz", "ar_ar"]; // needs to be same as in lang.php
const allLanguages = ["en_us", "es_es", "de_de", "fr_fr", "it_it", "ru_ru", "nb_no", "pl_pl", "pt_br", "tr_tr", "zh_cn", "cs_cz", "ar_ar", "ca_ca"]; // needs to be same as in lang.php
var settingsJSON = {}
@@ -115,28 +115,28 @@ function cacheSettings()
return new Promise((resolve, reject) => {
if(!getCache('completedCalls').includes('cacheSettings'))
{
$.get('api/table_settings.json?nocache=' + Date.now(), function(resSet) {
$.get('api/plugins.json?nocache=' + Date.now(), function(resPlug) {
$.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) {
pluginsData = resPlug["data"];
settingsData = resSet["data"];
settingsData.forEach((set) => {
resolvedOptions = createArray(set.Options)
resolvedOptions = createArray(set.setOptions)
resolvedOptionsOld = resolvedOptions
setPlugObj = {};
options_params = [];
resolved = ""
// proceed only if first option item contains something to resolve
if( !set.Code_Name.includes("__metadata") &&
if( !set.setKey.includes("__metadata") &&
resolvedOptions.length != 0 &&
resolvedOptions[0].includes("{value}"))
{
// get setting definition from the plugin config if available
setPlugObj = getPluginSettingObject(pluginsData, set.Code_Name)
setPlugObj = getPluginSettingObject(pluginsData, set.setKey)
// check if options contains parameters and resolve
if(setPlugObj != {} && setPlugObj["options_params"])
@@ -161,8 +161,8 @@ function cacheSettings()
}
}
setCache(`pia_set_${set.Code_Name}`, set.Value)
setCache(`pia_set_opt_${set.Code_Name}`, resolvedOptions)
setCache(`nax_set_${set.setKey}`, set.setValue)
setCache(`nax_set_opt_${set.setKey}`, resolvedOptions)
});
}).then(() => handleSuccess('cacheSettings', resolve())).catch(() => handleFailure('cacheSettings', reject("cacheSettings already completed"))); // handle AJAX synchronization
})
@@ -177,7 +177,7 @@ function getSettingOptions (key) {
// handle initial load to make sure everything is set-up and cached
// handleFirstLoad()
result = getCache(`pia_set_opt_${key}`, true);
result = getCache(`nax_set_opt_${key}`, true);
if (result == "")
{
@@ -195,7 +195,7 @@ function getSetting (key) {
// handle initial load to make sure everything is set-up and cached
// handleFirstLoad()
result = getCache(`pia_set_${key}`, true);
result = getCache(`nax_set_${key}`, true);
if (result == "")
{
@@ -225,7 +225,7 @@ function cacheStrings() {
});
// Fetch strings and translations from plugins
$.get(`api/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) => {
const data = pluginRes["data"];
@@ -336,6 +336,9 @@ function getLangCode() {
case 'Arabic (ar_ar)':
lang_code = 'ar_ar';
break;
case 'Catalan (ca_ca)':
lang_code = 'ca_ca';
break;
}
return lang_code;
@@ -686,11 +689,20 @@ function openUrl(urls) {
}
}
// -----------------------------------------------------------------------------
// force load URL in current window with specific anchor
function forceLoadUrl(relativeUrl) {
window.location.replace(relativeUrl);
window.location.reload()
}
// -----------------------------------------------------------------------------
function navigateToDeviceWithIp (ip) {
$.get('api/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"];
@@ -698,9 +710,9 @@ function navigateToDeviceWithIp (ip) {
$.each(devices, function(index, obj) {
if(obj.dev_LastIP.trim() == ip.trim())
if(obj.devLastIP.trim() == ip.trim())
{
mac = obj.dev_MAC;
mac = obj.devMac;
window.open(window.location.origin +'/deviceDetails.php?mac=' + mac , "_blank");
}
@@ -711,7 +723,7 @@ function navigateToDeviceWithIp (ip) {
// -----------------------------------------------------------------------------
function getNameByMacAddress(macAddress) {
return getDeviceDataByMac(macAddress, "dev_Name")
return getDevDataByMac(macAddress, "devName")
}
// -----------------------------------------------------------------------------
@@ -748,6 +760,12 @@ function isValidIPv6(ipAddress) {
return ipv6Regex.test(ipAddress);
}
function isValidIPv4(ip) {
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
return ipv4Regex.test(ip);
}
function formatIPlong(ipAddress) {
if (ipAddress.includes(':') && isValidIPv6(ipAddress)) {
const parts = ipAddress.split(':');
@@ -812,7 +830,11 @@ function isRandomMAC(mac)
// Empty array
if (input === '[]' || input === '') {
return [];
}
}
// handle integer
if (typeof input === 'number') {
input = input.toString();
}
// Regex pattern for brackets
const patternBrackets = /(^\s*\[)|(\]\s*$)/g;
@@ -864,7 +886,7 @@ function isRandomMAC(mac)
// -----------------------------------------------------------------------------
// A function to get a device property using the mac address as key and DB column nakme as parameter
// for the value to be returned
function getDeviceDataByMac(macAddress, dbColumn) {
function getDevDataByMac(macAddress, dbColumn) {
const sessionDataKey = 'devicesListAll_JSON';
const devicesCache = getCache(sessionDataKey);
@@ -877,7 +899,7 @@ function getDeviceDataByMac(macAddress, dbColumn) {
const devices = JSON.parse(devicesCache);
for (const device of devices) {
if (device["dev_MAC"].toLowerCase() === macAddress.toLowerCase()) {
if (device["devMac"].toLowerCase() === macAddress.toLowerCase()) {
if(dbColumn)
{
@@ -902,7 +924,7 @@ function cacheDevices()
// if(!getCache('completedCalls').includes('cacheDevices'))
// {
$.get('api/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)
@@ -967,6 +989,19 @@ function getGuid() {
// -----------------------------------------------------------------------------
// Loading Spinner overlay
// -----------------------------------------------------------------------------
spinnerHtml = `
<!-- spinner -->
<div id="loadingSpinner" style="display: block">
<div class="pa_semitransparent-panel"></div>
<div class="panel panel-default pa_spinner">
<table>
<td width="130px" align="middle">_text_</td>
<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw"></td>
</table>
</div>
</div>
`
function showSpinner(stringKey='Loading')
{
@@ -985,20 +1020,7 @@ function showSpinner(stringKey='Loading')
$("#loadingSpinner").show();
}
else{
html = `
<!-- spinner -->
<div id="loadingSpinner" style="display: block">
<div class="pa_semitransparent-panel"></div>
<div class="panel panel-default pa_spinner">
<table>
<td width="130px" align="middle">${text}</td>
<td><i class="ion ion-ios-loop-strong fa-spin fa-2x fa-fw"></td>
</table>
</div>
</div>
`
$(".wrapper").append(html)
$(".wrapper").append(spinnerHtml.replace('_text_',text))
}
}
// -----------------------------------------------------------------------------
@@ -1157,9 +1179,9 @@ function arraysContainSameValues(arr1, arr2) {
// -----------------------------------------------------------------------------
// Hide elements on the page based on the supplied setting
function hideUIelements(settingKey) {
function hideUIelements(setKey) {
hiddenSectionsSetting = getSetting(settingKey)
hiddenSectionsSetting = getSetting(setKey)
if(hiddenSectionsSetting != "") // handle if settings not yet initialized
{
@@ -1183,23 +1205,61 @@ function hideUIelements(settingKey) {
}
// ------------------------------------------------------------
function getDevicesList()
{
// Read cache (skip cookie expiry check)
devicesList = getCache('devicesListAll_JSON', true);
if (devicesList != '') {
devicesList = JSON.parse (devicesList);
} else {
devicesList = [];
}
// only loop thru the filtered down list
visibleDevices = getCache("ntx_visible_macs")
if(visibleDevices != "") {
visibleDevicesMACs = visibleDevices.split(',');
devicesList_tmp = [];
// Iterate through the data and filter only visible devices
$.each(devicesList, function(index, item) {
// Check if the current item's MAC exists in visibleDevicesMACs
if (visibleDevicesMACs.includes(item.devMac)) {
devicesList_tmp.push(item);
}
});
// Update devicesList with the filtered items
devicesList = devicesList_tmp;
}
return devicesList;
}
// -----------------------------------------------------------------------------
// apply dark mode
// apply theme
$(document).ready(function() {
// Assume getSetting is a function that returns true or false for dark mode
if (getSetting("UI_dark_mode") === "True") {
// Add the dark mode stylesheet
setCookie("UI_dark_mode", "True")
$('head').append('<link rel="stylesheet" href="css/dark-patch.css">');
// Set the background image for dark mode
$('body').attr('style', 'background-image: url(\'img/boxed-bg-dark.png\');');
let theme = getSetting("UI_theme");
if (theme) {
theme = theme.replace("['","").replace("']","");
// Add the theme stylesheet
setCookie("UI_theme", theme);
switch(theme) {
case "Dark":
$('head').append('<link rel="stylesheet" href="css/dark-patch.css">');
break;
case "System":
$('head').append('<link rel="stylesheet" href="css/system-dark-patch.css">');
break
}
} else {
setCookie("UI_dark_mode", "False")
// Set the background image for light mode
$('body').attr('style', 'background-image: url(\'img/background.png\');');
setCookie("UI_theme", "Light");
}
});
@@ -1230,7 +1290,7 @@ function clearCache() {
// -----------------------------------------------------------------------------
// Function to check if cache needs to be refreshed because of setting changes
function checkSettingChanges() {
$.get('api/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 lastReloaded = parseInt(sessionStorage.getItem(sessionStorageKey + '_time'));
@@ -1253,39 +1313,75 @@ async function handleFirstLoad(callback) {
}
// -----------------------------------------------------------------------------
// Execute callback once app initialized
function callAfterAppInitialized(callback) {
if (!isAppInitialized()) {
// Execute callback once the app is initialized and GraphQL server is running
async function callAfterAppInitialized(callback) {
if (!isAppInitialized() || !(await isGraphQLServerRunning())) {
setTimeout(() => {
callAfterAppInitialized(callback)
callAfterAppInitialized(callback);
}, 500);
} else
{
} else {
callback();
}
}
// -----------------------------------------------------------------------------
// Polling function to repeatedly check if the server is running
async function waitForGraphQLServer() {
const pollInterval = 2000; // 2 seconds between each check
let serverRunning = false;
while (!serverRunning) {
serverRunning = await isGraphQLServerRunning();
if (!serverRunning) {
console.log("GraphQL server not running, retrying in 2 seconds...");
await new Promise(resolve => setTimeout(resolve, pollInterval));
}
}
console.log("GraphQL server is now running.");
}
// -----------------------------------------------------------------------------
// Returns 1 if running, 0 otherwise
async function isGraphQLServerRunning() {
try {
const response = await $.get('/php/server/query_json.php', { file: 'app_state.json', nocache: Date.now()});
console.log("graphQLServerStarted: " + response["graphQLServerStarted"]);
setCache("graphQLServerStarted", response["graphQLServerStarted"]);
return response["graphQLServerStarted"];
} catch (error) {
console.error("Failed to check GraphQL server status:", error);
return false;
}
}
// -----------------------------------------------------------------------------
// Check if the code has been executed before by checking sessionStorage
function isAppInitialized() {
// return arraysContainSameValues(getCache("completedCalls").split(',').filter(Boolean), completedCalls_final);
// loading settings + 1 (or 2 language files if not english) + device cache.
completedCallsCount_final = getLangCode() == 'en_us' ? 3 : 4 ;
completedCalls = parseInt(getCache("completedCallsCount"));
shouldBeCompletedCalls = getLangCode() == 'en_us' ? 3 : 4;
return (parseInt(getCache("completedCallsCount")) >= completedCallsCount_final);
return (
completedCalls >= shouldBeCompletedCalls
);
}
// Define a function that will execute the code only once
// -----------------------------------------------------------------------------
// Main execution logic
async function executeOnce() {
showSpinner();
if (!isAppInitialized()) {
try {
console.log("HERE");
await waitForGraphQLServer(); // Wait for the server to start
await cacheDevices();
await cacheSettings();
await cacheStrings();
await cacheStrings();
console.log("✅ All AJAX callbacks have completed");
onAllCallsComplete();
} catch (error) {
@@ -1294,6 +1390,7 @@ async function executeOnce() {
}
}
// -----------------------------------------------------------------------------
// Function to handle successful completion of an AJAX call
const handleSuccess = (callName) => {

View File

@@ -85,7 +85,7 @@ function renderList(
// Check if database is locked
function checkDbLock() {
$.ajax({
url: "log/db_is_locked.log", // Replace with the actual path to your PHP file
url: "/php/server/query_logs.php?file=db_is_locked.log",
type: "GET",
success: function (response) {

View File

@@ -33,7 +33,7 @@ function versionUpdateUI(){
// Checks if a new version is available via the global app_state.json
function checkIfNewVersionAvailable()
{
$.get('api/app_state.json?nocache=' + Date.now(), function(appState) {
$.get('/php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
// console.log(appState["isNewVersionChecked"])
// console.log(appState["isNewVersion"])

View File

@@ -87,7 +87,8 @@ function showModalInput(
message,
btnCancel = getString("Gen_Cancel"),
btnOK = getString("Gen_Okay"),
callbackFunction = null
callbackFunction = null,
triggeredBy = null
) {
prefix = "modal-input";
@@ -101,6 +102,10 @@ function showModalInput(
modalCallbackFunction = callbackFunction;
}
if (triggeredBy != null) {
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
}
// Show modal
$(`#${prefix}`).modal("show");
@@ -117,7 +122,8 @@ function showModalFieldInput(
btnCancel = getString("Gen_Cancel"),
btnOK = getString("Gen_Okay"),
curValue = "",
callbackFunction = null
callbackFunction = null,
triggeredBy = null
) {
// set captions
prefix = "modal-field-input";
@@ -128,9 +134,14 @@ function showModalFieldInput(
$(`#${prefix}-OK`).html(btnOK);
if (callbackFunction != null) {
modalCallbackFunction = callbackFunction;
}
if (triggeredBy != null) {
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
}
$(`#${prefix}-field`).val(curValue);
setTimeout(function () {
@@ -148,7 +159,13 @@ function modalDefaultOK() {
// timer to execute function
window.setTimeout(function () {
window[modalCallbackFunction]();
if (typeof modalCallbackFunction === "function") {
modalCallbackFunction(); // Direct call
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
window[modalCallbackFunction](); // Call via window
} else {
console.error("Invalid callback function");
}
}, 100);
}
@@ -159,7 +176,13 @@ function modalDefaultInput() {
// timer to execute function
window.setTimeout(function () {
window[modalCallbackFunction]();
if (typeof modalCallbackFunction === "function") {
modalCallbackFunction(); // Direct call
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
window[modalCallbackFunction](); // Call via window
} else {
console.error("Invalid callback function");
}
}, 100);
}
@@ -170,7 +193,13 @@ function modalDefaultFieldInput() {
// timer to execute function
window.setTimeout(function () {
modalCallbackFunction();
if (typeof modalCallbackFunction === "function") {
modalCallbackFunction(); // Direct call
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
window[modalCallbackFunction](); // Call via window
} else {
console.error("Invalid callback function");
}
}, 100);
}
@@ -181,7 +210,13 @@ function modalWarningOK() {
// timer to execute function
window.setTimeout(function () {
window[modalCallbackFunction]();
if (typeof modalCallbackFunction === "function") {
modalCallbackFunction(); // Direct call
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
window[modalCallbackFunction](); // Call via window
} else {
console.error("Invalid callback function");
}
}, 100);
}

View File

@@ -215,14 +215,14 @@ function settingsCollectedCorrectly(settingsArray, settingsJSON_DB) {
}
});
const settingsCodeNames = settingsJSON_DB.map((setting) => setting.Code_Name);
const settingsCodeNames = settingsJSON_DB.map((setting) => setting.setKey);
const detailedCodeNames = settingsArray.map((item) => item[1]);
const missingCodeNamesOnPage = detailedCodeNames.filter(
(codeName) => !settingsCodeNames.includes(codeName)
(setKey) => !settingsCodeNames.includes(setKey)
);
const missingCodeNamesInDB = settingsCodeNames.filter(
(codeName) => !detailedCodeNames.includes(codeName)
(setKey) => !detailedCodeNames.includes(setKey)
);
// check if the number of settings on the page and in the DB are the same
@@ -453,11 +453,11 @@ function filterRows(inputText) {
}
var description = $row.find(".setting_description").text().toLowerCase();
var codeName = $row.find(".setting_name code").text().toLowerCase();
var setKey = $row.find(".setting_name code").text().toLowerCase();
if (
description.includes(inputText.toLowerCase()) ||
codeName.includes(inputText.toLowerCase())
setKey.includes(inputText.toLowerCase())
) {
$row.show();
anyVisible = true; // Set the flag to true if at least one row is visible
@@ -554,7 +554,7 @@ function overrideToggle(element) {
// Generate options or set options based on the provided parameters
function generateOptionsOrSetOptions(
codeName,
setKey,
valuesArray, // Array of values to be pre-selected in the dropdown
placeholder, // ID of the HTML element where dropdown should be rendered (will be replaced)
processDataCallback, // Callback function to generate entries based on options
@@ -562,10 +562,10 @@ function generateOptionsOrSetOptions(
transformers = [] // Transformers to be applied to the values
) {
// console.log(codeName);
// console.log(setKey);
// NOTE {value} options to replace with a setting or SQL value are handled in the cacheSettings() function
options = arrayToObject(createArray(getSettingOptions(codeName)))
options = arrayToObject(createArray(getSettingOptions(setKey)))
// Call to render lists
renderList(
@@ -638,7 +638,7 @@ function reverseTransformers(val, transformers) {
// ------------------------------------------------------------
// Function to initialize relevant variables based on HTML element
const handleElementOptions = (codeName, elementOptions, transformers, val) => {
const handleElementOptions = (setKey, elementOptions, transformers, val) => {
let inputType = "text";
let readOnly = "";
let isMultiSelect = false;
@@ -687,7 +687,7 @@ const handleElementOptions = (codeName, elementOptions, transformers, val) => {
}
if (option.sourceSuffixes) {
$.each(option.sourceSuffixes, function (index, suf) {
sourceIds.push(codeName + suf);
sourceIds.push(setKey + suf);
});
}
if (option.separator) {
@@ -859,3 +859,164 @@ function genListWithInputSet(options, valuesArray, targetField, transformers, pl
// Place the resulting HTML into the specified placeholder div
$("#" + placeholder).replaceWith(listHtml);
}
// ------------------------------------------------------------------------------
// Generate the form control for setting
function generateFormHtml(set, overrideValue) {
let inputHtml = '';
isEmpty(overrideValue) ? inVal = set['setValue'] : inVal = overrideValue;
const setKey = set['setKey'];
const setType = set['setType'];
// console.log(setType);
// console.log(setKey);
// console.log(overrideValue);
// console.log(inVal);
// Parse the setType JSON string
const setTypeObject = JSON.parse(setType.replace(/'/g, '"'));
const dataType = setTypeObject.dataType;
const elements = setTypeObject.elements || [];
// Generate HTML for elements
elements.forEach(elementObj => {
const { elementType, elementOptions = [], transformers = [] } = elementObj;
// Handle element options
const {
inputType,
readOnly,
isMultiSelect,
isOrdeable,
cssClasses,
placeholder,
suffix,
sourceIds,
separator,
editable,
valRes,
getStringKey,
onClick,
onChange,
customParams,
customId
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
// Override value
const val = valRes;
// console.log(val);
// Generate HTML based on elementType
switch (elementType) {
case 'select':
const multi = isMultiSelect ? "multiple" : "";
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
inputHtml += `<select onChange="settingsChanged();${onChange}"
my-data-type="${dataType}"
my-editable="${editable}"
class="form-control ${addCss}"
name="${setKey}"
id="${setKey}"
my-customparams="${customParams}"
my-customid="${customId}"
${multi}>
<option value="" id="${setKey + "_temp_"}"></option>
</select>`;
generateOptionsOrSetOptions(setKey, createArray(val), `${setKey}_temp_`, generateOptions, null, transformers);
break;
case 'input':
const checked = val === 'True' || val === '1' ? 'checked' : '';
const inputClass = inputType === 'checkbox' ? 'checkbox' : 'form-control';
inputHtml += `<input
class="${inputClass} ${cssClasses}"
onChange="settingsChanged();${onChange}"
my-data-type="${dataType}"
my-customparams="${customParams}"
my-customid="${customId}"
id="${setKey}${suffix}"
type="${inputType}"
value="${val}"
${readOnly}
${checked}
placeholder="${placeholder}"
/>`;
break;
case 'button':
inputHtml += `<button
class="btn btn-primary ${cssClasses}"
my-customparams="${customParams}"
my-customid="${customId}"
my-input-from="${sourceIds}"
my-input-to="${setKey}"
onclick="${onClick}">
${getString(getStringKey)}
</button>`;
break;
case 'textarea':
inputHtml += `<textarea
class="form-control input"
my-customparams="${customParams}"
my-customid="${customId}"
my-data-type="${dataType}"
id="${setKey}"
${readOnly}>${val}</textarea>`;
break;
case 'span':
inputHtml += `<span
class="${cssClasses}"
my-data-type="${dataType}"
my-customparams="${customParams}"
my-customid="${customId}">
${getString(getStringKey)}
</span>`;
break;
default:
console.warn(`🟥 Unknown element type: ${elementType}`);
}
});
// Generate event HTML if applicable
let eventsHtml = '';
// console.log(setTypeObject);
// console.log(set);
const eventsList = createArray(set['setEvents']);
// inline buttons events
if (eventsList.length > 0) {
eventsList.forEach(event => {
eventsHtml += `<span class="input-group-addon pointer"
id="${`${event}_${setKey}`}"
data-myparam-setkey="${setKey}"
data-myparam="${setKey}"
data-myparam-plugin="${setTypeObject.prefix || ''}"
data-myevent="${event}"
onclick="execute_settingEvent(this)">
<i title="${getString(event + "_event_tooltip")}" class="fa ${getString(event + "_event_icon")}"></i>
</span>`;
});
}
// Combine and return the final HTML
return inputHtml + eventsHtml;
}

View File

@@ -23,7 +23,7 @@ function initDeviceSelectors(devicesListAll_JSON) {
// Loop through the devices list
devicesList.forEach(function(device) {
selectorFieldsHTML += `<option value="${device.dev_MAC}">${device.dev_Name}</option>`;
selectorFieldsHTML += `<option value="${device.devMac}">${device.devName}</option>`;
});
selector = `<div class="db_info_table_row col-sm-12" >
@@ -67,65 +67,96 @@ function initDeviceSelectors(devicesListAll_JSON) {
}, 10);
}
// -------------------------------------------------------------------
// Utility function to generate a random API token in the format t_<random string of specified length>
function generateApiToken(elem, length) {
// Retrieve and parse custom parameters from the element
let params = $(elem).attr("my-customparams")?.split(',').map(param => param.trim());
if (params && params.length >= 1) {
var targetElementID = params[0]; // Get the target element's ID
}
let targetElement = $('#' + targetElementID);
// Function to generate a random string of a specified length
function generateRandomString(len) {
let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let result = '';
for (let i = 0; i < len; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length));
}
return result;
}
// Generate the token in the format t_<random string of length>
let randomToken = 't_' + generateRandomString(length);
// Set the generated token as the value of the target element
if (targetElement.length) {
targetElement.val(randomToken);
}
}
// ----------------------------------------------
// Updates the icon preview
function updateIconPreview(elem) {
// Retrieve and parse custom parameters from the element
let params = $(elem).attr("my-customparams")?.split(',').map(param => param.trim());
const targetElement = $('[my-customid="NEWDEV_devIcon_preview"]');
const iconInput = $("#NEWDEV_devIcon");
// console.log(params);
let attempts = 0;
if (params && params.length >= 2) {
var inputElementID = params[0];
var targetElementID = params[1];
} else {
console.error("Invalid parameters passed to updateIconPreview function");
return;
}
function tryUpdateIcon() {
let value = iconInput.val();
// Get the input element using the inputElementID
let iconInput = $("#" + inputElementID);
if (value) {
targetElement.html(atob(value));
iconInput.off('change input').on('change input', function () {
let newValue = $(this).val();
targetElement.html(atob(newValue));
});
return; // Stop retrying if successful
}
if (iconInput.length === 0) {
console.error("Icon input element not found");
return;
}
// Get the initial value and update the target element
let value = iconInput.val();
if (!value) {
console.error("Input value is empty or not defined");
return;
}
if (!targetElementID) {
targetElementID = "txtIcon";
}
// Check if the target element exists, if not find an element with matching custom attribute
let targetElement = $('#' + targetElementID);
if (targetElement.length === 0) {
// Look for an element with my-custom-id attribute equal to targetElementID
targetElement = $('[my-customid="' + targetElementID + '"]');
if (targetElement.length === 0) {
console.error("Neither target element with ID nor element with custom attribute found");
return;
attempts++;
if (attempts < 10) {
setTimeout(tryUpdateIcon, 1000); // Retry after 1 second
} else {
console.error("Input value is empty after 10 attempts");
}
}
// Update the target element with decoded base64 value
targetElement.html(atob(value));
// Add event listener to update the icon on input change
iconInput.on('change input', function () {
let newValue = $(this).val();
$('#' + targetElementID).html(atob(newValue));
});
tryUpdateIcon();
}
// -----------------------------------------------------------------------------
// Nice checkboxes with iCheck
function initializeiCheck () {
// Blue
$('input[type="checkbox"].blue').iCheck({
checkboxClass: 'icheckbox_flat-blue',
radioClass: 'iradio_flat-blue',
increaseArea: '20%'
});
// Orange
$('input[type="checkbox"].orange').iCheck({
checkboxClass: 'icheckbox_flat-orange',
radioClass: 'iradio_flat-orange',
increaseArea: '20%'
});
// Red
$('input[type="checkbox"].red').iCheck({
checkboxClass: 'icheckbox_flat-red',
radioClass: 'iradio_flat-red',
increaseArea: '20%'
});
}
// -----------------------------------------------------------------------------
@@ -190,19 +221,24 @@ function getCellValue(row, index) {
return $(row).children('td').eq(index).text();
}
// -----------------------------------------------------------------------------
// handling events on the backend initiated by the front end START
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// handling events
// -----------------------------------------------------------------------------
modalEventStatusId = 'modal-message-front-event'
modalEventStatusId = 'modal-message-front-event'
// --------------------------------------------------------
// Calls a backend function to add a front-end event (specified by the attributes 'data-myevent' and 'data-myparam-plugin' on the passed element) to an execution queue
function addToExecutionQueue_settingEvent(element)
{
function execute_settingEvent(element) {
feEvent = $(element).attr('data-myevent');
fePlugin = $(element).attr('data-myparam-plugin');
feSetKey = $(element).attr('data-myparam-setkey');
feParam = $(element).attr('data-myparam');
feSourceId = $(element).attr('id');
if (["test", "run"].includes(feEvent)) {
// Calls a backend function to add a front-end event (specified by the attributes 'data-myevent' and 'data-myparam-plugin' on the passed element) to an execution queue
// value has to be in format event|param. e.g. run|ARPSCAN
action = `${getGuid()}|${$(element).attr('data-myevent')}|${$(element).attr('data-myparam-plugin')}`
action = `${getGuid()}|${feEvent}|${fePlugin}`
$.ajax({
method: "POST",
@@ -217,29 +253,221 @@ function getCellValue(row, index) {
updateModalState()
}
})
}
} else if (["add_option"].includes(feEvent)) {
showModalFieldInput (
'<i class="fa fa-square-plus pointer"></i> ' + getString('Gen_Add'),
getString('Gen_Add'),
getString('Gen_Cancel'),
getString('Gen_Okay'),
'', // curValue
'addOptionFromModalInput',
feSourceId // triggered by id
);
} else if (["add_icon"].includes(feEvent)) {
// --------------------------------------------------------
// Updating the execution queue in in modal pop-up
function updateModalState() {
setTimeout(function() {
// Fetch the content from the log file using an AJAX request
$.ajax({
url: '/log/execution_queue.log',
type: 'GET',
success: function(data) {
// Update the content of the HTML element (e.g., a div with id 'logContent')
$('#'+modalEventStatusId).html(data);
// Add new icon as base64 string
showModalInput (
'<i class="fa fa-square-plus pointer"></i> ' + getString('DevDetail_button_AddIcon'),
getString('DevDetail_button_AddIcon_Help'),
getString('Gen_Cancel'),
getString('Gen_Okay'),
() => addIconAsBase64(element), // Wrap in an arrow function
feSourceId // triggered by id
);
} else if (["copy_icons"].includes(feEvent)) {
updateModalState();
},
error: function() {
// Handle error, such as the file not being found
$('#logContent').html('Error: Log file not found.');
}
});
}, 2000);
// Ask overwrite icon types
showModalWarning (
getString('DevDetail_button_OverwriteIcons'),
getString('DevDetail_button_OverwriteIcons_Warning'),
getString('Gen_Cancel'),
getString('Gen_Okay'),
'overwriteIconType'
);
} else if (["go_to_node"].includes(feEvent)) {
goToNetworkNode('NEWDEV_devParentMAC');
} else {
console.warn(`🔺Not implemented: ${feEvent}`)
}
}
// -----------------------------------------------------------------------------
// Go to the correct network node in the Network section
function goToNetworkNode(dropdownId)
{
setCache('activeNetworkTab', $('#'+dropdownId).val().replaceAll(":","_")+'_id');
window.location.href = './network.php';
}
// --------------------------------------------------------
// Updating the execution queue in in modal pop-up
function updateModalState() {
setTimeout(function() {
// Fetch the content from the log file using an AJAX request
$.ajax({
url: '/php/server/query_logs.php?file=execution_queue.log',
type: 'GET',
success: function(data) {
// Update the content of the HTML element (e.g., a div with id 'logContent')
$('#'+modalEventStatusId).html(data);
updateModalState();
},
error: function() {
// Handle error, such as the file not being found
$('#logContent').html('Error: Log file not found.');
}
});
}, 2000);
}
// --------------------------------------------------------
// A method to add option to select and make it selected
function addOptionFromModalInput() {
var inputVal = $(`#modal-field-input-field`).val();
console.log($('#modal-field-input-field'));
var triggeredBy = $('#modal-field-input').attr("data-myparam-triggered-by");
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
// Add new option and set it as selected
$('#' + targetId).append(new Option(inputVal, inputVal)).val(inputVal);
}
// --------------------------------------------------------
// Generate a random MAC address starting 00:1A
function generate_NEWDEV_devMac() {
const randomHexPair = () => Math.floor(Math.random() * 256).toString(16).padStart(2, '0').toUpperCase();
$('#NEWDEV_devMac').val(`00:1A:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}`.toLowerCase());
}
// --------------------------------------------------------
// Generate a random IP address starting 192.
function generate_NEWDEV_devLastIP() {
const randomByte = () => Math.floor(Math.random() * 256);
$('#NEWDEV_devLastIP').val(`192.${randomByte()}.${randomByte()}.${Math.floor(Math.random() * 254) + 1}`);
}
// -----------------------------------------------------------------------------
// A method to add an Icon as an option to select and make it selected
function addIconAsBase64 (el) {
var iconHtml = $('#modal-input-textarea').val();
console.log(iconHtml);
iconHtmlBase64 = btoa(iconHtml.replace(/"/g, "'"));
console.log(iconHtmlBase64);
console.log($('#modal-field-input-field'));
var triggeredBy = $('#modal-input').attr("data-myparam-triggered-by");
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
// $('#'+targetId).val(iconHtmlBase64);
// Add new option and set it as selected
$('#' + targetId).append(new Option(iconHtmlBase64, iconHtmlBase64)).val(iconHtmlBase64);
updateIconPreview(el)
}
function showIconSelection() {
const selectElement = document.getElementById('NEWDEV_devIcon');
const modalId = 'dynamicIconModal';
// Create modal HTML dynamically
const modalHTML = `
<div id="${modalId}" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${getString("Gen_Select")}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div id="iconList" class="row"></div>
</div>
</div>
</div>
</div>
`;
// Append the modal to the body
document.body.insertAdjacentHTML('beforeend', modalHTML);
const iconList = document.getElementById('iconList');
// Populate the icon list
Array.from(selectElement.options).forEach(option => {
if (option.value != "") {
const value = option.value;
// Decode the base64 value
let decodedValue;
try {
decodedValue = atob(value);
} catch (e) {
console.warn(`Skipping invalid base64 value: ${value}`);
return;
}
// Create an icon container
const iconDiv = document.createElement('div');
iconDiv.classList.add('iconPreviewSelector','col-md-2' , 'col-sm-3', 'col-xs-4');
iconDiv.style.cursor = 'pointer';
// Render the SVG or HTML content
const iconContainer = document.createElement('div');
iconContainer.innerHTML = decodedValue;
// Append the icon to the div
iconDiv.appendChild(iconContainer);
iconList.appendChild(iconDiv);
// Add click event to select icon
iconDiv.addEventListener('click', () => {
selectElement.value = value; // Update the select element value
$(`#${modalId}`).modal('hide'); // Hide the modal
updateIconPreview();
});
}
});
// Show the modal using AJAX
$(`#${modalId}`).modal('show');
// Remove modal from DOM after it's hidden
$(`#${modalId}`).on('hidden.bs.modal', function () {
document.getElementById(modalId).remove();
});
//
}
// -----------------------------------------------------------------------------
@@ -295,15 +523,14 @@ function initSelect2() {
}
}
// init select2 after dom laoded
// init functions after dom loaded
window.addEventListener("load", function() {
// try to initialize select2
// try to initialize
setTimeout(() => {
initSelect2()
initializeiCheck();
}, 1000);
});
console.log("init ui_components.js")

View File

@@ -1,2 +0,0 @@
documentation/
composer.json

View File

@@ -1,24 +0,0 @@
language: node_js
node_js:
- 8
- 9
- 10
- 11
- 12
env:
- INSTALL=bower
- INSTALL=yarn
- INSTALL=npm
matrix:
fast_finish: true
install:
- if [ "bower" == $INSTALL ]; then yarn global add bower && bower install; fi
- if [ "yarn" == $INSTALL ]; then yarn install; fi
- if [ "npm" == $INSTALL ]; then npm install; fi
script:
- echo 'Tests must be configured'

View File

@@ -1,312 +0,0 @@
// AdminLTE Gruntfile
module.exports = function (grunt) { // jshint ignore:line
'use strict';
grunt.initConfig({
pkg : grunt.file.readJSON('package.json'),
watch : {
less : {
// Compiles less files upon saving
files: ['build/less/*.less'],
tasks: ['less:development', 'less:production', 'replace', 'notify:less']
},
js : {
// Compile js files upon saving
files: ['build/js/*.js'],
tasks: ['js', 'notify:js']
},
skins: {
// Compile any skin less files upon saving
files: ['build/less/skins/*.less'],
tasks: ['less:skins', 'less:minifiedSkins', 'notify:less']
}
},
// Notify end of tasks
notify: {
less: {
options: {
title : 'AdminLTE',
message: 'LESS finished running'
}
},
js : {
options: {
title : 'AdminLTE',
message: 'JS bundler finished running'
}
}
},
// 'less'-task configuration
// This task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
less : {
// Development not compressed
development : {
files: {
// compilation.css : source.less
'dist/css/AdminLTE.css' : 'build/less/AdminLTE.less',
// AdminLTE without plugins
'dist/css/alt/AdminLTE-without-plugins.css' : 'build/less/AdminLTE-without-plugins.less',
// Separate plugins
'dist/css/alt/AdminLTE-select2.css' : 'build/less/select2.less',
'dist/css/alt/AdminLTE-fullcalendar.css' : 'build/less/fullcalendar.less',
'dist/css/alt/AdminLTE-bootstrap-social.css': 'build/less/bootstrap-social.less'
}
},
// Production compressed version
production : {
options: {
compress: true
},
files : {
// compilation.css : source.less
'dist/css/AdminLTE.min.css' : 'build/less/AdminLTE.less',
// AdminLTE without plugins
'dist/css/alt/AdminLTE-without-plugins.min.css' : 'build/less/AdminLTE-without-plugins.less',
// Separate plugins
'dist/css/alt/AdminLTE-select2.min.css' : 'build/less/select2.less',
'dist/css/alt/AdminLTE-fullcalendar.min.css' : 'build/less/fullcalendar.less',
'dist/css/alt/AdminLTE-bootstrap-social.min.css': 'build/less/bootstrap-social.less'
}
},
// Non minified skin files
skins : {
files: {
'dist/css/skins/skin-blue.css' : 'build/less/skins/skin-blue.less',
'dist/css/skins/skin-black.css' : 'build/less/skins/skin-black.less',
'dist/css/skins/skin-yellow.css' : 'build/less/skins/skin-yellow.less',
'dist/css/skins/skin-green.css' : 'build/less/skins/skin-green.less',
'dist/css/skins/skin-red.css' : 'build/less/skins/skin-red.less',
'dist/css/skins/skin-purple.css' : 'build/less/skins/skin-purple.less',
'dist/css/skins/skin-blue-light.css' : 'build/less/skins/skin-blue-light.less',
'dist/css/skins/skin-black-light.css' : 'build/less/skins/skin-black-light.less',
'dist/css/skins/skin-yellow-light.css': 'build/less/skins/skin-yellow-light.less',
'dist/css/skins/skin-green-light.css' : 'build/less/skins/skin-green-light.less',
'dist/css/skins/skin-red-light.css' : 'build/less/skins/skin-red-light.less',
'dist/css/skins/skin-purple-light.css': 'build/less/skins/skin-purple-light.less',
'dist/css/skins/_all-skins.css' : 'build/less/skins/_all-skins.less'
}
},
// Skins minified
minifiedSkins: {
options: {
compress: true
},
files : {
'dist/css/skins/skin-blue.min.css' : 'build/less/skins/skin-blue.less',
'dist/css/skins/skin-black.min.css' : 'build/less/skins/skin-black.less',
'dist/css/skins/skin-yellow.min.css' : 'build/less/skins/skin-yellow.less',
'dist/css/skins/skin-green.min.css' : 'build/less/skins/skin-green.less',
'dist/css/skins/skin-red.min.css' : 'build/less/skins/skin-red.less',
'dist/css/skins/skin-purple.min.css' : 'build/less/skins/skin-purple.less',
'dist/css/skins/skin-blue-light.min.css' : 'build/less/skins/skin-blue-light.less',
'dist/css/skins/skin-black-light.min.css' : 'build/less/skins/skin-black-light.less',
'dist/css/skins/skin-yellow-light.min.css': 'build/less/skins/skin-yellow-light.less',
'dist/css/skins/skin-green-light.min.css' : 'build/less/skins/skin-green-light.less',
'dist/css/skins/skin-red-light.min.css' : 'build/less/skins/skin-red-light.less',
'dist/css/skins/skin-purple-light.min.css': 'build/less/skins/skin-purple-light.less',
'dist/css/skins/_all-skins.min.css' : 'build/less/skins/_all-skins.less'
}
}
},
// Uglify task info. Compress the js files.
uglify: {
options : {
mangle : true,
output: {
comments: 'some'
},
},
production: {
files: {
'dist/js/adminlte.min.js': ['dist/js/adminlte.js']
}
}
},
// Concatenate JS Files
concat: {
options: {
separator: '\n\n',
banner : '/*! AdminLTE app.js\n'
+ '* ================\n'
+ '* Main JS application file for AdminLTE v2. This file\n'
+ '* should be included in all pages. It controls some layout\n'
+ '* options and implements exclusive AdminLTE plugins.\n'
+ '*\n'
+ '* @author Colorlib\n'
+ '* @support <https://github.com/ColorlibHQ/AdminLTE/issues>\n'
+ '* @version <%= pkg.version %>\n'
+ '* @repository <%= pkg.repository.url %>\n'
+ '* @license MIT <http://opensource.org/licenses/MIT>\n'
+ '*/\n\n'
+ '// Make sure jQuery has been loaded\n'
+ 'if (typeof jQuery === \'undefined\') {\n'
+ 'throw new Error(\'AdminLTE requires jQuery\')\n'
+ '}\n\n'
},
dist : {
src : [
'build/js/BoxRefresh.js',
'build/js/BoxWidget.js',
'build/js/ControlSidebar.js',
'build/js/DirectChat.js',
'build/js/PushMenu.js',
'build/js/TodoList.js',
'build/js/Tree.js',
'build/js/Layout.js',
],
dest: 'dist/js/adminlte.js'
}
},
// Replace image paths in AdminLTE without plugins
replace: {
withoutPlugins : {
src : ['dist/css/alt/AdminLTE-without-plugins.css'],
dest : 'dist/css/alt/AdminLTE-without-plugins.css',
replacements: [
{
from: '../img',
to : '../../img'
}
]
},
withoutPluginsMin: {
src : ['dist/css/alt/AdminLTE-without-plugins.min.css'],
dest : 'dist/css/alt/AdminLTE-without-plugins.min.css',
replacements: [
{
from: '../img',
to : '../../img'
}
]
}
},
// Build the documentation files
includes: {
build: {
src : ['*.html'], // Source files
dest : 'documentation/', // Destination directory
flatten: true,
cwd : 'documentation/build',
options: {
silent : true,
includePath: 'documentation/build/include'
}
}
},
// Optimize images
image: {
dynamic: {
files: [
{
expand: true,
cwd : 'build/img/',
src : ['**/*.{png,jpg,gif,svg,jpeg}'],
dest : 'dist/img/'
}
]
}
},
// Validate JS code
jshint: {
options: {
jshintrc: 'build/js/.jshintrc'
},
grunt : {
options: {
jshintrc: 'build/grunt/.jshintrc'
},
src : 'Gruntfile.js'
},
core : {
src: 'build/js/*.js'
},
demo : {
src: 'dist/js/demo.js'
},
pages : {
src: 'dist/js/pages/*.js'
}
},
jscs: {
options: {
config: 'build/js/.jscsrc'
},
core : {
src: '<%= jshint.core.src %>'
},
pages : {
src: '<%= jshint.pages.src %>'
}
},
// Validate CSS files
csslint: {
options: {
csslintrc: 'build/less/.csslintrc'
},
dist : [
'dist/css/AdminLTE.css'
]
},
// Validate Bootstrap HTML
bootlint: {
options: {
relaxerror: ['W005']
},
files : ['pages/**/*.html', '*.html']
},
// Delete images in build directory
// After compressing the images in the build/img dir, there is no need
// for them
clean: {
build: ['build/img/*']
}
});
// Load all grunt tasks
// LESS Compiler
grunt.loadNpmTasks('grunt-contrib-less');
// Watch File Changes
grunt.loadNpmTasks('grunt-contrib-watch');
// Compress JS Files
grunt.loadNpmTasks('grunt-contrib-uglify');
// Include Files Within HTML
grunt.loadNpmTasks('grunt-includes');
// Optimize images
grunt.loadNpmTasks('grunt-image');
// Validate JS code
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
// Delete not needed files
grunt.loadNpmTasks('grunt-contrib-clean');
// Lint CSS
grunt.loadNpmTasks('grunt-contrib-csslint');
// Lint Bootstrap
grunt.loadNpmTasks('grunt-bootlint');
// Concatenate JS files
grunt.loadNpmTasks('grunt-contrib-concat');
// Notify
grunt.loadNpmTasks('grunt-notify');
// Replace
grunt.loadNpmTasks('grunt-text-replace');
// Linting task
grunt.registerTask('lint', ['jshint', 'csslint', 'bootlint']);
// JS task
grunt.registerTask('js', ['concat', 'uglify']);
// CSS Task
grunt.registerTask('css', ['less:development', 'less:production', 'replace']);
// The default task (running 'grunt' in console) is 'watch'
grunt.registerTask('default', ['watch']);
};

View File

@@ -1,64 +0,0 @@
{
"name": "admin-lte",
"homepage": "https://adminlte.io",
"authors": [
"Abdullah Almsaeed <abdullah@almsaeedstudio.com>"
],
"description": "Admin dashboard and control panel template",
"main": [
"index2.html",
"dist/css/AdminLTE.css",
"dist/js/adminlte.js",
"build/less/AdminLTE.less"
],
"keywords": [
"css",
"js",
"html",
"template",
"admin",
"bootstrap",
"theme",
"backend",
"responsive"
],
"license": "MIT",
"ignore": [
"/.*",
"node_modules",
"bower_components",
"composer.json",
"documentation"
],
"dependencies": {
"chart.js": "^1.0",
"ckeditor": "^4.7",
"bootstrap-colorpicker": "^2.5.1",
"bootstrap": "^3.4",
"jquery": "^3.4.1",
"datatables.net": "^1.10.15",
"datatables.net-bs": "^2.1.1",
"bootstrap-datepicker": "^1.7",
"bootstrap-daterangepicker": "^2.1.25",
"moment": "^2.18.1",
"fastclick": "^1.0.6",
"Flot": "flot#^0.8.3",
"fullcalendar": "^3.4",
"inputmask": "jquery.inputmask#^3.3.7",
"ion.rangeSlider": "ionrangeslider#^2.2",
"jvectormap": "^1.2.2",
"jquery-knob": "^1.2.13",
"morris.js": "^0.5.1",
"PACE": "pace#^1.0.2",
"select2": "^4.0.7",
"jquery-slimscroll": "slimscroll#^1.3.8",
"jquery-sparkline": "^2.1.3",
"font-awesome": "^4.7",
"Ionicons": "ionicons#^2.0.1",
"jquery-ui": "^1.12.1",
"seiyria-bootstrap-slider": "^10.6.2"
},
"resolutions": {
"jquery": "^3.4.1"
}
}

View File

@@ -1,18 +0,0 @@
{
"name": "Flot",
"version": "0.8.3",
"main": "jquery.flot.js",
"dependencies": {
"jquery": ">= 1.2.6"
},
"homepage": "https://github.com/flot/flot",
"_release": "0.8.3",
"_resolution": {
"type": "version",
"tag": "v0.8.3",
"commit": "453b017cc5acfd75e252b93e8635f57f4196d45d"
},
"_source": "https://github.com/flot/flot.git",
"_target": "^0.8.3",
"_originalSource": "flot"
}

View File

@@ -1,3 +0,0 @@
language: node_js
node_js:
- 0.8

File diff suppressed because it is too large Load Diff

View File

@@ -1,98 +0,0 @@
## Contributing to Flot ##
We welcome all contributions, but following these guidelines results in less
work for us, and a faster and better response.
### Issues ###
Issues are not a way to ask general questions about Flot. If you see unexpected
behavior but are not 100% certain that it is a bug, please try posting to the
[forum](http://groups.google.com/group/flot-graphs) first, and confirm that
what you see is really a Flot problem before creating a new issue for it. When
reporting a bug, please include a working demonstration of the problem, if
possible, or at least a clear description of the options you're using and the
environment (browser and version, jQuery version, other libraries) that you're
running under.
If you have suggestions for new features, or changes to existing ones, we'd
love to hear them! Please submit each suggestion as a separate new issue.
If you would like to work on an existing issue, please make sure it is not
already assigned to someone else. If an issue is assigned to someone, that
person has already started working on it. So, pick unassigned issues to prevent
duplicated effort.
### Pull Requests ###
To make merging as easy as possible, please keep these rules in mind:
1. Submit new features or architectural changes to the *&lt;version&gt;-work*
branch for the next major release. Submit bug fixes to the master branch.
2. Divide larger changes into a series of small, logical commits with
descriptive messages.
3. Rebase, if necessary, before submitting your pull request, to reduce the
work we need to do to merge it.
4. Format your code according to the style guidelines below.
### Flot Style Guidelines ###
Flot follows the [jQuery Core Style Guidelines](http://docs.jquery.com/JQuery_Core_Style_Guidelines),
with the following updates and exceptions:
#### Spacing ####
Use four-space indents, no tabs. Do not add horizontal space around parameter
lists, loop definitions, or array/object indices. For example:
```js
for ( var i = 0; i < data.length; i++ ) { // This block is wrong!
if ( data[ i ] > 1 ) {
data[ i ] = 2;
}
}
for (var i = 0; i < data.length; i++) { // This block is correct!
if (data[i] > 1) {
data[i] = 2;
}
}
```
#### Comments ####
Use [jsDoc](http://usejsdoc.org) comments for all file and function headers.
Use // for all inline and block comments, regardless of length.
All // comment blocks should have an empty line above *and* below them. For
example:
```js
var a = 5;
// We're going to loop here
// TODO: Make this loop faster, better, stronger!
for (var x = 0; x < 10; x++) {}
```
#### Wrapping ####
Block comments should be wrapped at 80 characters.
Code should attempt to wrap at 80 characters, but may run longer if wrapping
would hurt readability more than having to scroll horizontally. This is a
judgement call made on a situational basis.
Statements containing complex logic should not be wrapped arbitrarily if they
do not exceed 80 characters. For example:
```js
if (a == 1 && // This block is wrong!
b == 2 &&
c == 3) {}
if (a == 1 && b == 2 && c == 3) {} // This block is correct!
```

View File

@@ -1,75 +0,0 @@
## Frequently asked questions ##
#### How much data can Flot cope with? ####
Flot will happily draw everything you send to it so the answer
depends on the browser. The excanvas emulation used for IE (built with
VML) makes IE by far the slowest browser so be sure to test with that
if IE users are in your target group (for large plots in IE, you can
also check out Flashcanvas which may be faster).
1000 points is not a problem, but as soon as you start having more
points than the pixel width, you should probably start thinking about
downsampling/aggregation as this is near the resolution limit of the
chart anyway. If you downsample server-side, you also save bandwidth.
#### Flot isn't working when I'm using JSON data as source! ####
Actually, Flot loves JSON data, you just got the format wrong.
Double check that you're not inputting strings instead of numbers,
like [["0", "-2.13"], ["5", "4.3"]]. This is most common mistake, and
the error might not show up immediately because Javascript can do some
conversion automatically.
#### Can I export the graph? ####
You can grab the image rendered by the canvas element used by Flot
as a PNG or JPEG (remember to set a background). Note that it won't
include anything not drawn in the canvas (such as the legend). And it
doesn't work with excanvas which uses VML, but you could try
Flashcanvas.
#### The bars are all tiny in time mode? ####
It's not really possible to determine the bar width automatically.
So you have to set the width with the barWidth option which is NOT in
pixels, but in the units of the x axis (or the y axis for horizontal
bars). For time mode that's milliseconds so the default value of 1
makes the bars 1 millisecond wide.
#### Can I use Flot with libraries like Mootools or Prototype? ####
Yes, Flot supports it out of the box and it's easy! Just use jQuery
instead of $, e.g. call jQuery.plot instead of $.plot and use
jQuery(something) instead of $(something). As a convenience, you can
put in a DOM element for the graph placeholder where the examples and
the API documentation are using jQuery objects.
Depending on how you include jQuery, you may have to add one line of
code to prevent jQuery from overwriting functions from the other
libraries, see the documentation in jQuery ("Using jQuery with other
libraries") for details.
#### Flot doesn't work with [insert name of Javascript UI framework]! ####
Flot is using standard HTML to make charts. If this is not working,
it's probably because the framework you're using is doing something
weird with the DOM or with the CSS that is interfering with Flot.
A common problem is that there's display:none on a container until the
user does something. Many tab widgets work this way, and there's
nothing wrong with it - you just can't call Flot inside a display:none
container as explained in the README so you need to hold off the Flot
call until the container is actually displayed (or use
visibility:hidden instead of display:none or move the container
off-screen).
If you find there's a specific thing we can do to Flot to help, feel
free to submit a bug report. Otherwise, you're welcome to ask for help
on the forum/mailing list, but please don't submit a bug report to
Flot.

View File

@@ -1,22 +0,0 @@
Copyright (c) 2007-2014 IOLA and Ole Laursen
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,12 +0,0 @@
# Makefile for generating minified files
.PHONY: all
# we cheat and process all .js files instead of an exhaustive list
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
%.min.js: %.js
yui-compressor $< -o $@
test:
./node_modules/.bin/jshint *jquery.flot.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,143 +0,0 @@
## Writing plugins ##
All you need to do to make a new plugin is creating an init function
and a set of options (if needed), stuffing it into an object and
putting it in the $.plot.plugins array. For example:
```js
function myCoolPluginInit(plot) {
plot.coolstring = "Hello!";
};
$.plot.plugins.push({ init: myCoolPluginInit, options: { ... } });
// if $.plot is called, it will return a plot object with the
// attribute "coolstring"
```
Now, given that the plugin might run in many different places, it's
a good idea to avoid leaking names. The usual trick here is wrap the
above lines in an anonymous function which is called immediately, like
this: (function () { inner code ... })(). To make it even more robust
in case $ is not bound to jQuery but some other Javascript library, we
can write it as
```js
(function ($) {
// plugin definition
// ...
})(jQuery);
```
There's a complete example below, but you should also check out the
plugins bundled with Flot.
## Complete example ##
Here is a simple debug plugin which alerts each of the series in the
plot. It has a single option that control whether it is enabled and
how much info to output:
```js
(function ($) {
function init(plot) {
var debugLevel = 1;
function checkDebugEnabled(plot, options) {
if (options.debug) {
debugLevel = options.debug;
plot.hooks.processDatapoints.push(alertSeries);
}
}
function alertSeries(plot, series, datapoints) {
var msg = "series " + series.label;
if (debugLevel > 1) {
msg += " with " + series.data.length + " points";
alert(msg);
}
}
plot.hooks.processOptions.push(checkDebugEnabled);
}
var options = { debug: 0 };
$.plot.plugins.push({
init: init,
options: options,
name: "simpledebug",
version: "0.1"
});
})(jQuery);
```
We also define "name" and "version". It's not used by Flot, but might
be helpful for other plugins in resolving dependencies.
Put the above in a file named "jquery.flot.debug.js", include it in an
HTML page and then it can be used with:
```js
$.plot($("#placeholder"), [...], { debug: 2 });
```
This simple plugin illustrates a couple of points:
- It uses the anonymous function trick to avoid name pollution.
- It can be enabled/disabled through an option.
- Variables in the init function can be used to store plot-specific
state between the hooks.
The two last points are important because there may be multiple plots
on the same page, and you'd want to make sure they are not mixed up.
## Shutting down a plugin ##
Each plot object has a shutdown hook which is run when plot.shutdown()
is called. This usually mostly happens in case another plot is made on
top of an existing one.
The purpose of the hook is to give you a chance to unbind any event
handlers you've registered and remove any extra DOM things you've
inserted.
The problem with event handlers is that you can have registered a
handler which is run in some point in the future, e.g. with
setTimeout(). Meanwhile, the plot may have been shutdown and removed,
but because your event handler is still referencing it, it can't be
garbage collected yet, and worse, if your handler eventually runs, it
may overwrite stuff on a completely different plot.
## Some hints on the options ##
Plugins should always support appropriate options to enable/disable
them because the plugin user may have several plots on the same page
where only one should use the plugin. In most cases it's probably a
good idea if the plugin is turned off rather than on per default, just
like most of the powerful features in Flot.
If the plugin needs options that are specific to each series, like the
points or lines options in core Flot, you can put them in "series" in
the options object, e.g.
```js
var options = {
series: {
downsample: {
algorithm: null,
maxpoints: 1000
}
}
}
```
Then they will be copied by Flot into each series, providing default
values in case none are specified.
Think hard and long about naming the options. These names are going to
be public API, and code is going to depend on them if the plugin is
successful.

View File

@@ -1,110 +0,0 @@
# Flot [![Build status](https://travis-ci.org/flot/flot.png)](https://travis-ci.org/flot/flot)
## About ##
Flot is a Javascript plotting library for jQuery.
Read more at the website: <http://www.flotcharts.org/>
Take a look at the the examples in examples/index.html; they should give a good
impression of what Flot can do, and the source code of the examples is probably
the fastest way to learn how to use Flot.
## Installation ##
Just include the Javascript file after you've included jQuery.
Generally, all browsers that support the HTML5 canvas tag are
supported.
For support for Internet Explorer < 9, you can use [Excanvas]
[excanvas], a canvas emulator; this is used in the examples bundled
with Flot. You just include the excanvas script like this:
```html
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="excanvas.min.js"></script><![endif]-->
```
If it's not working on your development IE 6.0, check that it has
support for VML which Excanvas is relying on. It appears that some
stripped down versions used for test environments on virtual machines
lack the VML support.
You can also try using [Flashcanvas][flashcanvas], which uses Flash to
do the emulation. Although Flash can be a bit slower to load than VML,
if you've got a lot of points, the Flash version can be much faster
overall. Flot contains some wrapper code for activating Excanvas which
Flashcanvas is compatible with.
You need at least jQuery 1.2.6, but try at least 1.3.2 for interactive
charts because of performance improvements in event handling.
## Basic usage ##
Create a placeholder div to put the graph in:
```html
<div id="placeholder"></div>
```
You need to set the width and height of this div, otherwise the plot
library doesn't know how to scale the graph. You can do it inline like
this:
```html
<div id="placeholder" style="width:600px;height:300px"></div>
```
You can also do it with an external stylesheet. Make sure that the
placeholder isn't within something with a display:none CSS property -
in that case, Flot has trouble measuring label dimensions which
results in garbled looks and might have trouble measuring the
placeholder dimensions which is fatal (it'll throw an exception).
Then when the div is ready in the DOM, which is usually on document
ready, run the plot function:
```js
$.plot($("#placeholder"), data, options);
```
Here, data is an array of data series and options is an object with
settings if you want to customize the plot. Take a look at the
examples for some ideas of what to put in or look at the
[API reference](API.md). Here's a quick example that'll draw a line
from (0, 0) to (1, 1):
```js
$.plot($("#placeholder"), [ [[0, 0], [1, 1]] ], { yaxis: { max: 1 } });
```
The plot function immediately draws the chart and then returns a plot
object with a couple of methods.
## What's with the name? ##
First: it's pronounced with a short o, like "plot". Not like "flawed".
So "Flot" rhymes with "plot".
And if you look up "flot" in a Danish-to-English dictionary, some of
the words that come up are "good-looking", "attractive", "stylish",
"smart", "impressive", "extravagant". One of the main goals with Flot
is pretty looks.
## Notes about the examples ##
In order to have a useful, functional example of time-series plots using time
zones, date.js from [timezone-js][timezone-js] (released under the Apache 2.0
license) and the [Olson][olson] time zone database (released to the public
domain) have been included in the examples directory. They are used in
examples/axes-time-zones/index.html.
[excanvas]: http://code.google.com/p/explorercanvas/
[flashcanvas]: http://code.google.com/p/flashcanvas/
[timezone-js]: https://github.com/mde/timezone-js
[olson]: http://ftp.iana.org/time-zones

View File

@@ -1,8 +0,0 @@
{
"name": "Flot",
"version": "0.8.3",
"main": "jquery.flot.js",
"dependencies": {
"jquery": ">= 1.2.6"
}
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Europe (EU27)",
"data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "Japan",
"data": [[1999, -0.1], [2000, 2.9], [2001, 0.2], [2002, 0.3], [2003, 1.4], [2004, 2.7], [2005, 1.9], [2006, 2.0], [2007, 2.3], [2008, -0.7]]
}

View File

@@ -1,4 +0,0 @@
{
"label": "USA",
"data": [[1999, 4.4], [2000, 3.7], [2001, 0.8], [2002, 1.6], [2003, 2.5], [2004, 3.6], [2005, 2.9], [2006, 2.8], [2007, 2.0], [2008, 1.1]]
}

View File

@@ -1,173 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples: AJAX</title>
<link href="../examples.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
<script type="text/javascript">
$(function() {
var options = {
lines: {
show: true
},
points: {
show: true
},
xaxis: {
tickDecimals: 0,
tickSize: 1
}
};
var data = [];
$.plot("#placeholder", data, options);
// Fetch one series, adding to what we already have
var alreadyFetched = {};
$("button.fetchSeries").click(function () {
var button = $(this);
// Find the URL in the link right next to us, then fetch the data
var dataurl = button.siblings("a").attr("href");
function onDataReceived(series) {
// Extract the first coordinate pair; jQuery has parsed it, so
// the data is now just an ordinary JavaScript object
var firstcoordinate = "(" + series.data[0][0] + ", " + series.data[0][1] + ")";
button.siblings("span").text("Fetched " + series.label + ", first point: " + firstcoordinate);
// Push the new data onto our existing data array
if (!alreadyFetched[series.label]) {
alreadyFetched[series.label] = true;
data.push(series);
}
$.plot("#placeholder", data, options);
}
$.ajax({
url: dataurl,
type: "GET",
dataType: "json",
success: onDataReceived
});
});
// Initiate a recurring data update
$("button.dataUpdate").click(function () {
data = [];
alreadyFetched = {};
$.plot("#placeholder", data, options);
var iteration = 0;
function fetchData() {
++iteration;
function onDataReceived(series) {
// Load all the data in one pass; if we only got partial
// data we could merge it with what we already have.
data = [ series ];
$.plot("#placeholder", data, options);
}
// Normally we call the same URL - a script connected to a
// database - but in this case we only have static example
// files, so we need to modify the URL.
$.ajax({
url: "data-eu-gdp-growth-" + iteration + ".json",
type: "GET",
dataType: "json",
success: onDataReceived
});
if (iteration < 5) {
setTimeout(fetchData, 1000);
} else {
data = [];
alreadyFetched = {};
}
}
setTimeout(fetchData, 1000);
});
// Load the first series by default, so we don't have an empty plot
$("button.fetchSeries:first").click();
// Add the Flot version string to the footer
$("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
});
</script>
</head>
<body>
<div id="header">
<h2>AJAX</h2>
</div>
<div id="content">
<div class="demo-container">
<div id="placeholder" class="demo-placeholder"></div>
</div>
<p>Example of loading data dynamically with AJAX. Percentage change in GDP (source: <a href="http://epp.eurostat.ec.europa.eu/tgm/table.do?tab=table&init=1&plugin=1&language=en&pcode=tsieb020">Eurostat</a>). Click the buttons below:</p>
<p>The data is fetched over HTTP, in this case directly from text files. Usually the URL would point to some web server handler (e.g. a PHP page or Java/.NET/Python/Ruby on Rails handler) that extracts it from a database and serializes it to JSON.</p>
<p>
<button class="fetchSeries">First dataset</button>
[ <a href="data-eu-gdp-growth.json">see data</a> ]
<span></span>
</p>
<p>
<button class="fetchSeries">Second dataset</button>
[ <a href="data-japan-gdp-growth.json">see data</a> ]
<span></span>
</p>
<p>
<button class="fetchSeries">Third dataset</button>
[ <a href="data-usa-gdp-growth.json">see data</a> ]
<span></span>
</p>
<p>If you combine AJAX with setTimeout, you can poll the server for new data.</p>
<p>
<button class="dataUpdate">Poll for data</button>
</p>
</div>
<div id="footer">
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
</html>

View File

@@ -1,87 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples: Adding Annotations</title>
<link href="../examples.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
<script type="text/javascript">
$(function() {
var d1 = [];
for (var i = 0; i < 20; ++i) {
d1.push([i, Math.sin(i)]);
}
var data = [{ data: d1, label: "Pressure", color: "#333" }];
var markings = [
{ color: "#f6f6f6", yaxis: { from: 1 } },
{ color: "#f6f6f6", yaxis: { to: -1 } },
{ color: "#000", lineWidth: 1, xaxis: { from: 2, to: 2 } },
{ color: "#000", lineWidth: 1, xaxis: { from: 8, to: 8 } }
];
var placeholder = $("#placeholder");
var plot = $.plot(placeholder, data, {
bars: { show: true, barWidth: 0.5, fill: 0.9 },
xaxis: { ticks: [], autoscaleMargin: 0.02 },
yaxis: { min: -2, max: 2 },
grid: { markings: markings }
});
var o = plot.pointOffset({ x: 2, y: -1.2});
// Append it to the placeholder that Flot already uses for positioning
placeholder.append("<div style='position:absolute;left:" + (o.left + 4) + "px;top:" + o.top + "px;color:#666;font-size:smaller'>Warming up</div>");
o = plot.pointOffset({ x: 8, y: -1.2});
placeholder.append("<div style='position:absolute;left:" + (o.left + 4) + "px;top:" + o.top + "px;color:#666;font-size:smaller'>Actual measurements</div>");
// Draw a little arrow on top of the last label to demonstrate canvas
// drawing
var ctx = plot.getCanvas().getContext("2d");
ctx.beginPath();
o.left += 4;
ctx.moveTo(o.left, o.top);
ctx.lineTo(o.left, o.top - 10);
ctx.lineTo(o.left + 10, o.top - 5);
ctx.lineTo(o.left, o.top);
ctx.fillStyle = "#000";
ctx.fill();
// Add the Flot version string to the footer
$("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
});
</script>
</head>
<body>
<div id="header">
<h2>Adding Annotations</h2>
</div>
<div id="content">
<div class="demo-container">
<div id="placeholder" class="demo-placeholder"></div>
</div>
<p>Flot has support for simple background decorations such as lines and rectangles. They can be useful for marking up certain areas. You can easily add any HTML you need with standard DOM manipulation, e.g. for labels. For drawing custom shapes there is also direct access to the canvas.</p>
</div>
<div id="footer">
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
</html>

View File

@@ -1,97 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples: Interacting with axes</title>
<link href="../examples.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
<script type="text/javascript">
$(function() {
function generate(start, end, fn) {
var res = [];
for (var i = 0; i <= 100; ++i) {
var x = start + i / 100 * (end - start);
res.push([x, fn(x)]);
}
return res;
}
var data = [
{ data: generate(0, 10, function (x) { return Math.sqrt(x);}), xaxis: 1, yaxis:1 },
{ data: generate(0, 10, function (x) { return Math.sin(x);}), xaxis: 1, yaxis:2 },
{ data: generate(0, 10, function (x) { return Math.cos(x);}), xaxis: 1, yaxis:3 },
{ data: generate(2, 10, function (x) { return Math.tan(x);}), xaxis: 2, yaxis: 4 }
];
var plot = $.plot("#placeholder", data, {
xaxes: [
{ position: 'bottom' },
{ position: 'top'}
],
yaxes: [
{ position: 'left' },
{ position: 'left' },
{ position: 'right' },
{ position: 'left' }
]
});
// Create a div for each axis
$.each(plot.getAxes(), function (i, axis) {
if (!axis.show)
return;
var box = axis.box;
$("<div class='axisTarget' style='position:absolute; left:" + box.left + "px; top:" + box.top + "px; width:" + box.width + "px; height:" + box.height + "px'></div>")
.data("axis.direction", axis.direction)
.data("axis.n", axis.n)
.css({ backgroundColor: "#f00", opacity: 0, cursor: "pointer" })
.appendTo(plot.getPlaceholder())
.hover(
function () { $(this).css({ opacity: 0.10 }) },
function () { $(this).css({ opacity: 0 }) }
)
.click(function () {
$("#click").text("You clicked the " + axis.direction + axis.n + "axis!")
});
});
// Add the Flot version string to the footer
$("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
});
</script>
</head>
<body>
<div id="header">
<h2>Interacting with axes</h2>
</div>
<div id="content">
<div class="demo-container">
<div id="placeholder" class="demo-placeholder"></div>
</div>
<p>With multiple axes, you sometimes need to interact with them. A simple way to do this is to draw the plot, deduce the axis placements and insert a couple of divs on top to catch events.</p>
<p>Try clicking an axis.</p>
<p id="click"></p>
</div>
<div id="footer">
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -1,893 +0,0 @@
// -----
// The `timezoneJS.Date` object gives you full-blown timezone support, independent from the timezone set on the end-user's machine running the browser. It uses the Olson zoneinfo files for its timezone data.
//
// The constructor function and setter methods use proxy JavaScript Date objects behind the scenes, so you can use strings like '10/22/2006' with the constructor. You also get the same sensible wraparound behavior with numeric parameters (like setting a value of 14 for the month wraps around to the next March).
//
// The other significant difference from the built-in JavaScript Date is that `timezoneJS.Date` also has named properties that store the values of year, month, date, etc., so it can be directly serialized to JSON and used for data transfer.
/*
* Copyright 2010 Matthew Eernisse (mde@fleegix.org)
* and Open Source Applications Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Credits: Ideas included from incomplete JS implementation of Olson
* parser, "XMLDAte" by Philippe Goetz (philippe.goetz@wanadoo.fr)
*
* Contributions:
* Jan Niehusmann
* Ricky Romero
* Preston Hunt (prestonhunt@gmail.com)
* Dov. B Katz (dov.katz@morganstanley.com)
* Peter Bergström (pbergstr@mac.com)
* Long Ho
*/
(function () {
// Standard initialization stuff to make sure the library is
// usable on both client and server (node) side.
var root = this;
var timezoneJS;
if (typeof exports !== 'undefined') {
timezoneJS = exports;
} else {
timezoneJS = root.timezoneJS = {};
}
timezoneJS.VERSION = '1.0.0';
// Grab the ajax library from global context.
// This can be jQuery, Zepto or fleegix.
// You can also specify your own transport mechanism by declaring
// `timezoneJS.timezone.transport` to a `function`. More details will follow
var $ = root.$ || root.jQuery || root.Zepto
, fleegix = root.fleegix
// Declare constant list of days and months. Unfortunately this doesn't leave room for i18n due to the Olson data being in English itself
, DAYS = timezoneJS.Days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
, MONTHS = timezoneJS.Months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
, SHORT_MONTHS = {}
, SHORT_DAYS = {}
, EXACT_DATE_TIME = {}
, TZ_REGEXP = new RegExp('^[a-zA-Z]+/');
//`{ "Jan": 0, "Feb": 1, "Mar": 2, "Apr": 3, "May": 4, "Jun": 5, "Jul": 6, "Aug": 7, "Sep": 8, "Oct": 9, "Nov": 10, "Dec": 11 }`
for (var i = 0; i < MONTHS.length; i++) {
SHORT_MONTHS[MONTHS[i].substr(0, 3)] = i;
}
//`{ "Sun": 0, "Mon": 1, "Tue": 2, "Wed": 3, "Thu": 4, "Fri": 5, "Sat": 6 }`
for (i = 0; i < DAYS.length; i++) {
SHORT_DAYS[DAYS[i].substr(0, 3)] = i;
}
//Handle array indexOf in IE
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (el) {
for (var i = 0; i < this.length; i++ ) {
if (el === this[i]) return i;
}
return -1;
}
}
// Format a number to the length = digits. For ex:
//
// `_fixWidth(2, 2) = '02'`
//
// `_fixWidth(1998, 2) = '98'`
//
// This is used to pad numbers in converting date to string in ISO standard.
var _fixWidth = function (number, digits) {
if (typeof number !== "number") { throw "not a number: " + number; }
var s = number.toString();
if (number.length > digits) {
return number.substr(number.length - digits, number.length);
}
while (s.length < digits) {
s = '0' + s;
}
return s;
};
// Abstraction layer for different transport layers, including fleegix/jQuery/Zepto
//
// Object `opts` include
//
// - `url`: url to ajax query
//
// - `async`: true for asynchronous, false otherwise. If false, return value will be response from URL. This is true by default
//
// - `success`: success callback function
//
// - `error`: error callback function
// Returns response from URL if async is false, otherwise the AJAX request object itself
var _transport = function (opts) {
if ((!fleegix || typeof fleegix.xhr === 'undefined') && (!$ || typeof $.ajax === 'undefined')) {
throw new Error('Please use the Fleegix.js XHR module, jQuery ajax, Zepto ajax, or define your own transport mechanism for downloading zone files.');
}
if (!opts) return;
if (!opts.url) throw new Error ('URL must be specified');
if (!('async' in opts)) opts.async = true;
if (!opts.async) {
return fleegix && fleegix.xhr
? fleegix.xhr.doReq({ url: opts.url, async: false })
: $.ajax({ url : opts.url, async : false }).responseText;
}
return fleegix && fleegix.xhr
? fleegix.xhr.send({
url : opts.url,
method : 'get',
handleSuccess : opts.success,
handleErr : opts.error
})
: $.ajax({
url : opts.url,
dataType: 'text',
method : 'GET',
error : opts.error,
success : opts.success
});
};
// Constructor, which is similar to that of the native Date object itself
timezoneJS.Date = function () {
var args = Array.prototype.slice.apply(arguments)
, dt = null
, tz = null
, arr = [];
//We support several different constructors, including all the ones from `Date` object
// with a timezone string at the end.
//
//- `[tz]`: Returns object with time in `tz` specified.
//
// - `utcMillis`, `[tz]`: Return object with UTC time = `utcMillis`, in `tz`.
//
// - `Date`, `[tz]`: Returns object with UTC time = `Date.getTime()`, in `tz`.
//
// - `year, month, [date,] [hours,] [minutes,] [seconds,] [millis,] [tz]: Same as `Date` object
// with tz.
//
// - `Array`: Can be any combo of the above.
//
//If 1st argument is an array, we can use it as a list of arguments itself
if (Object.prototype.toString.call(args[0]) === '[object Array]') {
args = args[0];
}
if (typeof args[args.length - 1] === 'string' && TZ_REGEXP.test(args[args.length - 1])) {
tz = args.pop();
}
switch (args.length) {
case 0:
dt = new Date();
break;
case 1:
dt = new Date(args[0]);
break;
default:
for (var i = 0; i < 7; i++) {
arr[i] = args[i] || 0;
}
dt = new Date(arr[0], arr[1], arr[2], arr[3], arr[4], arr[5], arr[6]);
break;
}
this._useCache = false;
this._tzInfo = {};
this._day = 0;
this.year = 0;
this.month = 0;
this.date = 0;
this.hours = 0;
this.minutes = 0;
this.seconds = 0;
this.milliseconds = 0;
this.timezone = tz || null;
//Tricky part:
// For the cases where there are 1/2 arguments: `timezoneJS.Date(millis, [tz])` and `timezoneJS.Date(Date, [tz])`. The
// Date `dt` created should be in UTC. Thus the way I detect such cases is to determine if `arr` is not populated & `tz`
// is specified. Because if `tz` is not specified, `dt` can be in local time.
if (arr.length) {
this.setFromDateObjProxy(dt);
} else {
this.setFromTimeProxy(dt.getTime(), tz);
}
};
// Implements most of the native Date object
timezoneJS.Date.prototype = {
getDate: function () { return this.date; },
getDay: function () { return this._day; },
getFullYear: function () { return this.year; },
getMonth: function () { return this.month; },
getYear: function () { return this.year; },
getHours: function () { return this.hours; },
getMilliseconds: function () { return this.milliseconds; },
getMinutes: function () { return this.minutes; },
getSeconds: function () { return this.seconds; },
getUTCDate: function () { return this.getUTCDateProxy().getUTCDate(); },
getUTCDay: function () { return this.getUTCDateProxy().getUTCDay(); },
getUTCFullYear: function () { return this.getUTCDateProxy().getUTCFullYear(); },
getUTCHours: function () { return this.getUTCDateProxy().getUTCHours(); },
getUTCMilliseconds: function () { return this.getUTCDateProxy().getUTCMilliseconds(); },
getUTCMinutes: function () { return this.getUTCDateProxy().getUTCMinutes(); },
getUTCMonth: function () { return this.getUTCDateProxy().getUTCMonth(); },
getUTCSeconds: function () { return this.getUTCDateProxy().getUTCSeconds(); },
// Time adjusted to user-specified timezone
getTime: function () {
return this._timeProxy + (this.getTimezoneOffset() * 60 * 1000);
},
getTimezone: function () { return this.timezone; },
getTimezoneOffset: function () { return this.getTimezoneInfo().tzOffset; },
getTimezoneAbbreviation: function () { return this.getTimezoneInfo().tzAbbr; },
getTimezoneInfo: function () {
if (this._useCache) return this._tzInfo;
var res;
// If timezone is specified, get the correct timezone info based on the Date given
if (this.timezone) {
res = this.timezone === 'Etc/UTC' || this.timezone === 'Etc/GMT'
? { tzOffset: 0, tzAbbr: 'UTC' }
: timezoneJS.timezone.getTzInfo(this._timeProxy, this.timezone);
}
// If no timezone was specified, use the local browser offset
else {
res = { tzOffset: this.getLocalOffset(), tzAbbr: null };
}
this._tzInfo = res;
this._useCache = true;
return res
},
getUTCDateProxy: function () {
var dt = new Date(this._timeProxy);
dt.setUTCMinutes(dt.getUTCMinutes() + this.getTimezoneOffset());
return dt;
},
setDate: function (n) { this.setAttribute('date', n); },
setFullYear: function (n) { this.setAttribute('year', n); },
setMonth: function (n) { this.setAttribute('month', n); },
setYear: function (n) { this.setUTCAttribute('year', n); },
setHours: function (n) { this.setAttribute('hours', n); },
setMilliseconds: function (n) { this.setAttribute('milliseconds', n); },
setMinutes: function (n) { this.setAttribute('minutes', n); },
setSeconds: function (n) { this.setAttribute('seconds', n); },
setTime: function (n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
this.setFromTimeProxy(n, this.timezone);
},
setUTCDate: function (n) { this.setUTCAttribute('date', n); },
setUTCFullYear: function (n) { this.setUTCAttribute('year', n); },
setUTCHours: function (n) { this.setUTCAttribute('hours', n); },
setUTCMilliseconds: function (n) { this.setUTCAttribute('milliseconds', n); },
setUTCMinutes: function (n) { this.setUTCAttribute('minutes', n); },
setUTCMonth: function (n) { this.setUTCAttribute('month', n); },
setUTCSeconds: function (n) { this.setUTCAttribute('seconds', n); },
setFromDateObjProxy: function (dt) {
this.year = dt.getFullYear();
this.month = dt.getMonth();
this.date = dt.getDate();
this.hours = dt.getHours();
this.minutes = dt.getMinutes();
this.seconds = dt.getSeconds();
this.milliseconds = dt.getMilliseconds();
this._day = dt.getDay();
this._dateProxy = dt;
this._timeProxy = Date.UTC(this.year, this.month, this.date, this.hours, this.minutes, this.seconds, this.milliseconds);
this._useCache = false;
},
setFromTimeProxy: function (utcMillis, tz) {
var dt = new Date(utcMillis);
var tzOffset;
tzOffset = tz ? timezoneJS.timezone.getTzInfo(dt, tz).tzOffset : dt.getTimezoneOffset();
dt.setTime(utcMillis + (dt.getTimezoneOffset() - tzOffset) * 60000);
this.setFromDateObjProxy(dt);
},
setAttribute: function (unit, n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
var dt = this._dateProxy;
var meth = unit === 'year' ? 'FullYear' : unit.substr(0, 1).toUpperCase() + unit.substr(1);
dt['set' + meth](n);
this.setFromDateObjProxy(dt);
},
setUTCAttribute: function (unit, n) {
if (isNaN(n)) { throw new Error('Units must be a number.'); }
var meth = unit === 'year' ? 'FullYear' : unit.substr(0, 1).toUpperCase() + unit.substr(1);
var dt = this.getUTCDateProxy();
dt['setUTC' + meth](n);
dt.setUTCMinutes(dt.getUTCMinutes() - this.getTimezoneOffset());
this.setFromTimeProxy(dt.getTime() + this.getTimezoneOffset() * 60000, this.timezone);
},
setTimezone: function (tz) {
var previousOffset = this.getTimezoneInfo().tzOffset;
this.timezone = tz;
this._useCache = false;
// Set UTC minutes offsets by the delta of the two timezones
this.setUTCMinutes(this.getUTCMinutes() - this.getTimezoneInfo().tzOffset + previousOffset);
},
removeTimezone: function () {
this.timezone = null;
this._useCache = false;
},
valueOf: function () { return this.getTime(); },
clone: function () {
return this.timezone ? new timezoneJS.Date(this.getTime(), this.timezone) : new timezoneJS.Date(this.getTime());
},
toGMTString: function () { return this.toString('EEE, dd MMM yyyy HH:mm:ss Z', 'Etc/GMT'); },
toLocaleString: function () {},
toLocaleDateString: function () {},
toLocaleTimeString: function () {},
toSource: function () {},
toISOString: function () { return this.toString('yyyy-MM-ddTHH:mm:ss.SSS', 'Etc/UTC') + 'Z'; },
toJSON: function () { return this.toISOString(); },
// Allows different format following ISO8601 format:
toString: function (format, tz) {
// Default format is the same as toISOString
if (!format) format = 'yyyy-MM-dd HH:mm:ss';
var result = format;
var tzInfo = tz ? timezoneJS.timezone.getTzInfo(this.getTime(), tz) : this.getTimezoneInfo();
var _this = this;
// If timezone is specified, get a clone of the current Date object and modify it
if (tz) {
_this = this.clone();
_this.setTimezone(tz);
}
var hours = _this.getHours();
return result
// fix the same characters in Month names
.replace(/a+/g, function () { return 'k'; })
// `y`: year
.replace(/y+/g, function (token) { return _fixWidth(_this.getFullYear(), token.length); })
// `d`: date
.replace(/d+/g, function (token) { return _fixWidth(_this.getDate(), token.length); })
// `m`: minute
.replace(/m+/g, function (token) { return _fixWidth(_this.getMinutes(), token.length); })
// `s`: second
.replace(/s+/g, function (token) { return _fixWidth(_this.getSeconds(), token.length); })
// `S`: millisecond
.replace(/S+/g, function (token) { return _fixWidth(_this.getMilliseconds(), token.length); })
// `M`: month. Note: `MM` will be the numeric representation (e.g February is 02) but `MMM` will be text representation (e.g February is Feb)
.replace(/M+/g, function (token) {
var _month = _this.getMonth(),
_len = token.length;
if (_len > 3) {
return timezoneJS.Months[_month];
} else if (_len > 2) {
return timezoneJS.Months[_month].substring(0, _len);
}
return _fixWidth(_month + 1, _len);
})
// `k`: AM/PM
.replace(/k+/g, function () {
if (hours >= 12) {
if (hours > 12) {
hours -= 12;
}
return 'PM';
}
return 'AM';
})
// `H`: hour
.replace(/H+/g, function (token) { return _fixWidth(hours, token.length); })
// `E`: day
.replace(/E+/g, function (token) { return DAYS[_this.getDay()].substring(0, token.length); })
// `Z`: timezone abbreviation
.replace(/Z+/gi, function () { return tzInfo.tzAbbr; });
},
toUTCString: function () { return this.toGMTString(); },
civilToJulianDayNumber: function (y, m, d) {
var a;
// Adjust for zero-based JS-style array
m++;
if (m > 12) {
a = parseInt(m/12, 10);
m = m % 12;
y += a;
}
if (m <= 2) {
y -= 1;
m += 12;
}
a = Math.floor(y / 100);
var b = 2 - a + Math.floor(a / 4)
, jDt = Math.floor(365.25 * (y + 4716)) + Math.floor(30.6001 * (m + 1)) + d + b - 1524;
return jDt;
},
getLocalOffset: function () {
return this._dateProxy.getTimezoneOffset();
}
};
timezoneJS.timezone = new function () {
var _this = this
, regionMap = {'Etc':'etcetera','EST':'northamerica','MST':'northamerica','HST':'northamerica','EST5EDT':'northamerica','CST6CDT':'northamerica','MST7MDT':'northamerica','PST8PDT':'northamerica','America':'northamerica','Pacific':'australasia','Atlantic':'europe','Africa':'africa','Indian':'africa','Antarctica':'antarctica','Asia':'asia','Australia':'australasia','Europe':'europe','WET':'europe','CET':'europe','MET':'europe','EET':'europe'}
, regionExceptions = {'Pacific/Honolulu':'northamerica','Atlantic/Bermuda':'northamerica','Atlantic/Cape_Verde':'africa','Atlantic/St_Helena':'africa','Indian/Kerguelen':'antarctica','Indian/Chagos':'asia','Indian/Maldives':'asia','Indian/Christmas':'australasia','Indian/Cocos':'australasia','America/Danmarkshavn':'europe','America/Scoresbysund':'europe','America/Godthab':'europe','America/Thule':'europe','Asia/Yekaterinburg':'europe','Asia/Omsk':'europe','Asia/Novosibirsk':'europe','Asia/Krasnoyarsk':'europe','Asia/Irkutsk':'europe','Asia/Yakutsk':'europe','Asia/Vladivostok':'europe','Asia/Sakhalin':'europe','Asia/Magadan':'europe','Asia/Kamchatka':'europe','Asia/Anadyr':'europe','Africa/Ceuta':'europe','America/Argentina/Buenos_Aires':'southamerica','America/Argentina/Cordoba':'southamerica','America/Argentina/Tucuman':'southamerica','America/Argentina/La_Rioja':'southamerica','America/Argentina/San_Juan':'southamerica','America/Argentina/Jujuy':'southamerica','America/Argentina/Catamarca':'southamerica','America/Argentina/Mendoza':'southamerica','America/Argentina/Rio_Gallegos':'southamerica','America/Argentina/Ushuaia':'southamerica','America/Aruba':'southamerica','America/La_Paz':'southamerica','America/Noronha':'southamerica','America/Belem':'southamerica','America/Fortaleza':'southamerica','America/Recife':'southamerica','America/Araguaina':'southamerica','America/Maceio':'southamerica','America/Bahia':'southamerica','America/Sao_Paulo':'southamerica','America/Campo_Grande':'southamerica','America/Cuiaba':'southamerica','America/Porto_Velho':'southamerica','America/Boa_Vista':'southamerica','America/Manaus':'southamerica','America/Eirunepe':'southamerica','America/Rio_Branco':'southamerica','America/Santiago':'southamerica','Pacific/Easter':'southamerica','America/Bogota':'southamerica','America/Curacao':'southamerica','America/Guayaquil':'southamerica','Pacific/Galapagos':'southamerica','Atlantic/Stanley':'southamerica','America/Cayenne':'southamerica','America/Guyana':'southamerica','America/Asuncion':'southamerica','America/Lima':'southamerica','Atlantic/South_Georgia':'southamerica','America/Paramaribo':'southamerica','America/Port_of_Spain':'southamerica','America/Montevideo':'southamerica','America/Caracas':'southamerica'};
function invalidTZError(t) { throw new Error('Timezone "' + t + '" is either incorrect, or not loaded in the timezone registry.'); }
function builtInLoadZoneFile(fileName, opts) {
var url = _this.zoneFileBasePath + '/' + fileName;
return !opts || !opts.async
? _this.parseZones(_this.transport({ url : url, async : false }))
: _this.transport({
async: true,
url : url,
success : function (str) {
if (_this.parseZones(str) && typeof opts.callback === 'function') {
opts.callback();
}
return true;
},
error : function () {
throw new Error('Error retrieving "' + url + '" zoneinfo files');
}
});
}
function getRegionForTimezone(tz) {
var exc = regionExceptions[tz]
, reg
, ret;
if (exc) return exc;
reg = tz.split('/')[0];
ret = regionMap[reg];
// If there's nothing listed in the main regions for this TZ, check the 'backward' links
if (ret) return ret;
var link = _this.zones[tz];
if (typeof link === 'string') {
return getRegionForTimezone(link);
}
// Backward-compat file hasn't loaded yet, try looking in there
if (!_this.loadedZones.backward) {
// This is for obvious legacy zones (e.g., Iceland) that don't even have a prefix like "America/" that look like normal zones
_this.loadZoneFile('backward');
return getRegionForTimezone(tz);
}
invalidTZError(tz);
}
function parseTimeString(str) {
var pat = /(\d+)(?::0*(\d*))?(?::0*(\d*))?([wsugz])?$/;
var hms = str.match(pat);
hms[1] = parseInt(hms[1], 10);
hms[2] = hms[2] ? parseInt(hms[2], 10) : 0;
hms[3] = hms[3] ? parseInt(hms[3], 10) : 0;
return hms;
}
function processZone(z) {
if (!z[3]) { return; }
var yea = parseInt(z[3], 10);
var mon = 11;
var dat = 31;
if (z[4]) {
mon = SHORT_MONTHS[z[4].substr(0, 3)];
dat = parseInt(z[5], 10) || 1;
}
var string = z[6] ? z[6] : '00:00:00'
, t = parseTimeString(string);
return [yea, mon, dat, t[1], t[2], t[3]];
}
function getZone(dt, tz) {
var utcMillis = typeof dt === 'number' ? dt : new Date(dt).getTime();
var t = tz;
var zoneList = _this.zones[t];
// Follow links to get to an actual zone
while (typeof zoneList === "string") {
t = zoneList;
zoneList = _this.zones[t];
}
if (!zoneList) {
// Backward-compat file hasn't loaded yet, try looking in there
if (!_this.loadedZones.backward) {
//This is for backward entries like "America/Fort_Wayne" that
// getRegionForTimezone *thinks* it has a region file and zone
// for (e.g., America => 'northamerica'), but in reality it's a
// legacy zone we need the backward file for.
_this.loadZoneFile('backward');
return getZone(dt, tz);
}
invalidTZError(t);
}
if (zoneList.length === 0) {
throw new Error('No Zone found for "' + tz + '" on ' + dt);
}
//Do backwards lookup since most use cases deal with newer dates.
for (var i = zoneList.length - 1; i >= 0; i--) {
var z = zoneList[i];
if (z[3] && utcMillis > z[3]) break;
}
return zoneList[i+1];
}
function getBasicOffset(time) {
var off = parseTimeString(time)
, adj = time.indexOf('-') === 0 ? -1 : 1;
off = adj * (((off[1] * 60 + off[2]) * 60 + off[3]) * 1000);
return off/60/1000;
}
//if isUTC is true, date is given in UTC, otherwise it's given
// in local time (ie. date.getUTC*() returns local time components)
function getRule(dt, zone, isUTC) {
var date = typeof dt === 'number' ? new Date(dt) : dt;
var ruleset = zone[1];
var basicOffset = zone[0];
//Convert a date to UTC. Depending on the 'type' parameter, the date
// parameter may be:
//
// - `u`, `g`, `z`: already UTC (no adjustment).
//
// - `s`: standard time (adjust for time zone offset but not for DST)
//
// - `w`: wall clock time (adjust for both time zone and DST offset).
//
// DST adjustment is done using the rule given as third argument.
var convertDateToUTC = function (date, type, rule) {
var offset = 0;
if (type === 'u' || type === 'g' || type === 'z') { // UTC
offset = 0;
} else if (type === 's') { // Standard Time
offset = basicOffset;
} else if (type === 'w' || !type) { // Wall Clock Time
offset = getAdjustedOffset(basicOffset, rule);
} else {
throw("unknown type " + type);
}
offset *= 60 * 1000; // to millis
return new Date(date.getTime() + offset);
};
//Step 1: Find applicable rules for this year.
//
//Step 2: Sort the rules by effective date.
//
//Step 3: Check requested date to see if a rule has yet taken effect this year. If not,
//
//Step 4: Get the rules for the previous year. If there isn't an applicable rule for last year, then
// there probably is no current time offset since they seem to explicitly turn off the offset
// when someone stops observing DST.
//
// FIXME if this is not the case and we'll walk all the way back (ugh).
//
//Step 5: Sort the rules by effective date.
//Step 6: Apply the most recent rule before the current time.
var convertRuleToExactDateAndTime = function (yearAndRule, prevRule) {
var year = yearAndRule[0]
, rule = yearAndRule[1];
// Assume that the rule applies to the year of the given date.
var hms = rule[5];
var effectiveDate;
if (!EXACT_DATE_TIME[year])
EXACT_DATE_TIME[year] = {};
// Result for given parameters is already stored
if (EXACT_DATE_TIME[year][rule])
effectiveDate = EXACT_DATE_TIME[year][rule];
else {
//If we have a specific date, use that!
if (!isNaN(rule[4])) {
effectiveDate = new Date(Date.UTC(year, SHORT_MONTHS[rule[3]], rule[4], hms[1], hms[2], hms[3], 0));
}
//Let's hunt for the date.
else {
var targetDay
, operator;
//Example: `lastThu`
if (rule[4].substr(0, 4) === "last") {
// Start at the last day of the month and work backward.
effectiveDate = new Date(Date.UTC(year, SHORT_MONTHS[rule[3]] + 1, 1, hms[1] - 24, hms[2], hms[3], 0));
targetDay = SHORT_DAYS[rule[4].substr(4, 3)];
operator = "<=";
}
//Example: `Sun>=15`
else {
//Start at the specified date.
effectiveDate = new Date(Date.UTC(year, SHORT_MONTHS[rule[3]], rule[4].substr(5), hms[1], hms[2], hms[3], 0));
targetDay = SHORT_DAYS[rule[4].substr(0, 3)];
operator = rule[4].substr(3, 2);
}
var ourDay = effectiveDate.getUTCDay();
//Go forwards.
if (operator === ">=") {
effectiveDate.setUTCDate(effectiveDate.getUTCDate() + (targetDay - ourDay + ((targetDay < ourDay) ? 7 : 0)));
}
//Go backwards. Looking for the last of a certain day, or operator is "<=" (less likely).
else {
effectiveDate.setUTCDate(effectiveDate.getUTCDate() + (targetDay - ourDay - ((targetDay > ourDay) ? 7 : 0)));
}
}
EXACT_DATE_TIME[year][rule] = effectiveDate;
}
//If previous rule is given, correct for the fact that the starting time of the current
// rule may be specified in local time.
if (prevRule) {
effectiveDate = convertDateToUTC(effectiveDate, hms[4], prevRule);
}
return effectiveDate;
};
var findApplicableRules = function (year, ruleset) {
var applicableRules = [];
for (var i = 0; ruleset && i < ruleset.length; i++) {
//Exclude future rules.
if (ruleset[i][0] <= year &&
(
// Date is in a set range.
ruleset[i][1] >= year ||
// Date is in an "only" year.
(ruleset[i][0] === year && ruleset[i][1] === "only") ||
//We're in a range from the start year to infinity.
ruleset[i][1] === "max"
)
) {
//It's completely okay to have any number of matches here.
// Normally we should only see two, but that doesn't preclude other numbers of matches.
// These matches are applicable to this year.
applicableRules.push([year, ruleset[i]]);
}
}
return applicableRules;
};
var compareDates = function (a, b, prev) {
var year, rule;
if (a.constructor !== Date) {
year = a[0];
rule = a[1];
a = (!prev && EXACT_DATE_TIME[year] && EXACT_DATE_TIME[year][rule])
? EXACT_DATE_TIME[year][rule]
: convertRuleToExactDateAndTime(a, prev);
} else if (prev) {
a = convertDateToUTC(a, isUTC ? 'u' : 'w', prev);
}
if (b.constructor !== Date) {
year = b[0];
rule = b[1];
b = (!prev && EXACT_DATE_TIME[year] && EXACT_DATE_TIME[year][rule]) ? EXACT_DATE_TIME[year][rule]
: convertRuleToExactDateAndTime(b, prev);
} else if (prev) {
b = convertDateToUTC(b, isUTC ? 'u' : 'w', prev);
}
a = Number(a);
b = Number(b);
return a - b;
};
var year = date.getUTCFullYear();
var applicableRules;
applicableRules = findApplicableRules(year, _this.rules[ruleset]);
applicableRules.push(date);
//While sorting, the time zone in which the rule starting time is specified
// is ignored. This is ok as long as the timespan between two DST changes is
// larger than the DST offset, which is probably always true.
// As the given date may indeed be close to a DST change, it may get sorted
// to a wrong position (off by one), which is corrected below.
applicableRules.sort(compareDates);
//If there are not enough past DST rules...
if (applicableRules.indexOf(date) < 2) {
applicableRules = applicableRules.concat(findApplicableRules(year-1, _this.rules[ruleset]));
applicableRules.sort(compareDates);
}
var pinpoint = applicableRules.indexOf(date);
if (pinpoint > 1 && compareDates(date, applicableRules[pinpoint-1], applicableRules[pinpoint-2][1]) < 0) {
//The previous rule does not really apply, take the one before that.
return applicableRules[pinpoint - 2][1];
} else if (pinpoint > 0 && pinpoint < applicableRules.length - 1 && compareDates(date, applicableRules[pinpoint+1], applicableRules[pinpoint-1][1]) > 0) {
//The next rule does already apply, take that one.
return applicableRules[pinpoint + 1][1];
} else if (pinpoint === 0) {
//No applicable rule found in this and in previous year.
return null;
}
return applicableRules[pinpoint - 1][1];
}
function getAdjustedOffset(off, rule) {
return -Math.ceil(rule[6] - off);
}
function getAbbreviation(zone, rule) {
var res;
var base = zone[2];
if (base.indexOf('%s') > -1) {
var repl;
if (rule) {
repl = rule[7] === '-' ? '' : rule[7];
}
//FIXME: Right now just falling back to Standard --
// apparently ought to use the last valid rule,
// although in practice that always ought to be Standard
else {
repl = 'S';
}
res = base.replace('%s', repl);
}
else if (base.indexOf('/') > -1) {
//Chose one of two alternative strings.
res = base.split("/", 2)[rule[6] ? 1 : 0];
} else {
res = base;
}
return res;
}
this.zoneFileBasePath;
this.zoneFiles = ['africa', 'antarctica', 'asia', 'australasia', 'backward', 'etcetera', 'europe', 'northamerica', 'pacificnew', 'southamerica'];
this.loadingSchemes = {
PRELOAD_ALL: 'preloadAll',
LAZY_LOAD: 'lazyLoad',
MANUAL_LOAD: 'manualLoad'
};
this.loadingScheme = this.loadingSchemes.LAZY_LOAD;
this.loadedZones = {};
this.zones = {};
this.rules = {};
this.init = function (o) {
var opts = { async: true }
, def = this.defaultZoneFile = this.loadingScheme === this.loadingSchemes.PRELOAD_ALL
? this.zoneFiles
: 'northamerica'
, done = 0
, callbackFn;
//Override default with any passed-in opts
for (var p in o) {
opts[p] = o[p];
}
if (typeof def === 'string') {
return this.loadZoneFile(def, opts);
}
//Wraps callback function in another one that makes
// sure all files have been loaded.
callbackFn = opts.callback;
opts.callback = function () {
done++;
(done === def.length) && typeof callbackFn === 'function' && callbackFn();
};
for (var i = 0; i < def.length; i++) {
this.loadZoneFile(def[i], opts);
}
};
//Get the zone files via XHR -- if the sync flag
// is set to true, it's being called by the lazy-loading
// mechanism, so the result needs to be returned inline.
this.loadZoneFile = function (fileName, opts) {
if (typeof this.zoneFileBasePath === 'undefined') {
throw new Error('Please define a base path to your zone file directory -- timezoneJS.timezone.zoneFileBasePath.');
}
//Ignore already loaded zones.
if (this.loadedZones[fileName]) {
return;
}
this.loadedZones[fileName] = true;
return builtInLoadZoneFile(fileName, opts);
};
this.loadZoneJSONData = function (url, sync) {
var processData = function (data) {
data = eval('('+ data +')');
for (var z in data.zones) {
_this.zones[z] = data.zones[z];
}
for (var r in data.rules) {
_this.rules[r] = data.rules[r];
}
};
return sync
? processData(_this.transport({ url : url, async : false }))
: _this.transport({ url : url, success : processData });
};
this.loadZoneDataFromObject = function (data) {
if (!data) { return; }
for (var z in data.zones) {
_this.zones[z] = data.zones[z];
}
for (var r in data.rules) {
_this.rules[r] = data.rules[r];
}
};
this.getAllZones = function () {
var arr = [];
for (var z in this.zones) { arr.push(z); }
return arr.sort();
};
this.parseZones = function (str) {
var lines = str.split('\n')
, arr = []
, chunk = ''
, l
, zone = null
, rule = null;
for (var i = 0; i < lines.length; i++) {
l = lines[i];
if (l.match(/^\s/)) {
l = "Zone " + zone + l;
}
l = l.split("#")[0];
if (l.length > 3) {
arr = l.split(/\s+/);
chunk = arr.shift();
//Ignore Leap.
switch (chunk) {
case 'Zone':
zone = arr.shift();
if (!_this.zones[zone]) {
_this.zones[zone] = [];
}
if (arr.length < 3) break;
//Process zone right here and replace 3rd element with the processed array.
arr.splice(3, arr.length, processZone(arr));
if (arr[3]) arr[3] = Date.UTC.apply(null, arr[3]);
arr[0] = -getBasicOffset(arr[0]);
_this.zones[zone].push(arr);
break;
case 'Rule':
rule = arr.shift();
if (!_this.rules[rule]) {
_this.rules[rule] = [];
}
//Parse int FROM year and TO year
arr[0] = parseInt(arr[0], 10);
arr[1] = parseInt(arr[1], 10) || arr[1];
//Parse time string AT
arr[5] = parseTimeString(arr[5]);
//Parse offset SAVE
arr[6] = getBasicOffset(arr[6]);
_this.rules[rule].push(arr);
break;
case 'Link':
//No zones for these should already exist.
if (_this.zones[arr[1]]) {
throw new Error('Error with Link ' + arr[1] + '. Cannot create link of a preexisted zone.');
}
//Create the link.
_this.zones[arr[1]] = arr[0];
break;
}
}
}
return true;
};
//Expose transport mechanism and allow overwrite.
this.transport = _transport;
this.getTzInfo = function (dt, tz, isUTC) {
//Lazy-load any zones not yet loaded.
if (this.loadingScheme === this.loadingSchemes.LAZY_LOAD) {
//Get the correct region for the zone.
var zoneFile = getRegionForTimezone(tz);
if (!zoneFile) {
throw new Error('Not a valid timezone ID.');
}
if (!this.loadedZones[zoneFile]) {
//Get the file and parse it -- use synchronous XHR.
this.loadZoneFile(zoneFile);
}
}
var z = getZone(dt, tz);
var off = z[0];
//See if the offset needs adjustment.
var rule = getRule(dt, z, isUTC);
if (rule) {
off = getAdjustedOffset(off, rule);
}
var abbr = getAbbreviation(z, rule);
return { tzOffset: off, tzAbbr: abbr };
};
};
}).call(this);

View File

@@ -1,114 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Flot Examples: Time zones</title>
<link href="../examples.css" rel="stylesheet" type="text/css">
<!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../../excanvas.min.js"></script><![endif]-->
<script language="javascript" type="text/javascript" src="../../jquery.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="../../jquery.flot.time.js"></script>
<script language="javascript" type="text/javascript" src="date.js"></script>
<script type="text/javascript">
$(function() {
timezoneJS.timezone.zoneFileBasePath = "tz";
timezoneJS.timezone.defaultZoneFile = [];
timezoneJS.timezone.init({async: false});
var d = [
[Date.UTC(2011, 2, 12, 14, 0, 0), 28],
[Date.UTC(2011, 2, 12, 15, 0, 0), 27],
[Date.UTC(2011, 2, 12, 16, 0, 0), 25],
[Date.UTC(2011, 2, 12, 17, 0, 0), 19],
[Date.UTC(2011, 2, 12, 18, 0, 0), 16],
[Date.UTC(2011, 2, 12, 19, 0, 0), 14],
[Date.UTC(2011, 2, 12, 20, 0, 0), 11],
[Date.UTC(2011, 2, 12, 21, 0, 0), 9],
[Date.UTC(2011, 2, 12, 22, 0, 0), 7.5],
[Date.UTC(2011, 2, 12, 23, 0, 0), 6],
[Date.UTC(2011, 2, 13, 0, 0, 0), 5],
[Date.UTC(2011, 2, 13, 1, 0, 0), 6],
[Date.UTC(2011, 2, 13, 2, 0, 0), 7.5],
[Date.UTC(2011, 2, 13, 3, 0, 0), 9],
[Date.UTC(2011, 2, 13, 4, 0, 0), 11],
[Date.UTC(2011, 2, 13, 5, 0, 0), 14],
[Date.UTC(2011, 2, 13, 6, 0, 0), 16],
[Date.UTC(2011, 2, 13, 7, 0, 0), 19],
[Date.UTC(2011, 2, 13, 8, 0, 0), 25],
[Date.UTC(2011, 2, 13, 9, 0, 0), 27],
[Date.UTC(2011, 2, 13, 10, 0, 0), 28],
[Date.UTC(2011, 2, 13, 11, 0, 0), 29],
[Date.UTC(2011, 2, 13, 12, 0, 0), 29.5],
[Date.UTC(2011, 2, 13, 13, 0, 0), 29],
[Date.UTC(2011, 2, 13, 14, 0, 0), 28],
[Date.UTC(2011, 2, 13, 15, 0, 0), 27],
[Date.UTC(2011, 2, 13, 16, 0, 0), 25],
[Date.UTC(2011, 2, 13, 17, 0, 0), 19],
[Date.UTC(2011, 2, 13, 18, 0, 0), 16],
[Date.UTC(2011, 2, 13, 19, 0, 0), 14],
[Date.UTC(2011, 2, 13, 20, 0, 0), 11],
[Date.UTC(2011, 2, 13, 21, 0, 0), 9],
[Date.UTC(2011, 2, 13, 22, 0, 0), 7.5],
[Date.UTC(2011, 2, 13, 23, 0, 0), 6]
];
var plot = $.plot("#placeholderUTC", [d], {
xaxis: {
mode: "time"
}
});
var plot = $.plot("#placeholderLocal", [d], {
xaxis: {
mode: "time",
timezone: "browser"
}
});
var plot = $.plot("#placeholderChicago", [d], {
xaxis: {
mode: "time",
timezone: "America/Chicago"
}
});
// Add the Flot version string to the footer
$("#footer").prepend("Flot " + $.plot.version + " &ndash; ");
});
</script>
</head>
<body>
<div id="header">
<h2>Time zones</h2>
</div>
<div id="content">
<h3>UTC</h3>
<div class="demo-container" style="height: 300px;">
<div id="placeholderUTC" class="demo-placeholder"></div>
</div>
<h3>Browser</h3>
<div class="demo-container" style="height: 300px;">
<div id="placeholderLocal" class="demo-placeholder"></div>
</div>
<h3>Chicago</h3>
<div class="demo-container" style="height: 300px;">
<div id="placeholderChicago" class="demo-placeholder"></div>
</div>
</div>
<div id="footer">
Copyright &copy; 2007 - 2014 IOLA and Ole Laursen
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -1,413 +0,0 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# From Paul Eggert (1999-11-15):
# To keep things manageable, we list only locations occupied year-round; see
# <a href="http://www.comnap.aq/comnap/comnap.nsf/P/Stations/">
# COMNAP - Stations and Bases
# </a>
# and
# <a href="http://www.spri.cam.ac.uk/bob/periant.htm">
# Summary of the Peri-Antarctic Islands (1998-07-23)
# </a>
# for information.
# Unless otherwise specified, we have no time zone information.
#
# Except for the French entries,
# I made up all time zone abbreviations mentioned here; corrections welcome!
# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
# These rules are stolen from the `southamerica' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule ArgAQ 1964 1966 - Mar 1 0:00 0 -
Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S
Rule ArgAQ 1967 only - Apr 2 0:00 0 -
Rule ArgAQ 1967 1968 - Oct Sun>=1 0:00 1:00 S
Rule ArgAQ 1968 1969 - Apr Sun>=1 0:00 0 -
Rule ArgAQ 1974 only - Jan 23 0:00 1:00 S
Rule ArgAQ 1974 only - May 1 0:00 0 -
Rule ChileAQ 1972 1986 - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 1974 1987 - Oct Sun>=9 4:00u 1:00 S
Rule ChileAQ 1987 only - Apr 12 3:00u 0 -
Rule ChileAQ 1988 1989 - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 1988 only - Oct Sun>=1 4:00u 1:00 S
Rule ChileAQ 1989 only - Oct Sun>=9 4:00u 1:00 S
Rule ChileAQ 1990 only - Mar 18 3:00u 0 -
Rule ChileAQ 1990 only - Sep 16 4:00u 1:00 S
Rule ChileAQ 1991 1996 - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 1991 1997 - Oct Sun>=9 4:00u 1:00 S
Rule ChileAQ 1997 only - Mar 30 3:00u 0 -
Rule ChileAQ 1998 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 1998 only - Sep 27 4:00u 1:00 S
Rule ChileAQ 1999 only - Apr 4 3:00u 0 -
Rule ChileAQ 1999 2010 - Oct Sun>=9 4:00u 1:00 S
Rule ChileAQ 2000 2007 - Mar Sun>=9 3:00u 0 -
# N.B.: the end of March 29 in Chile is March 30 in Universal time,
# which is used below in specifying the transition.
Rule ChileAQ 2008 only - Mar 30 3:00u 0 -
Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
Rule ChileAQ 2012 only - Apr Sun>=23 3:00u 0 -
Rule ChileAQ 2012 only - Sep Sun>=2 4:00u 1:00 S
Rule ChileAQ 2013 max - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2013 max - Oct Sun>=9 4:00u 1:00 S
# These rules are stolen from the `australasia' file.
Rule AusAQ 1917 only - Jan 1 0:01 1:00 -
Rule AusAQ 1917 only - Mar 25 2:00 0 -
Rule AusAQ 1942 only - Jan 1 2:00 1:00 -
Rule AusAQ 1942 only - Mar 29 2:00 0 -
Rule AusAQ 1942 only - Sep 27 2:00 1:00 -
Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 -
Rule AusAQ 1943 only - Oct 3 2:00 1:00 -
Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1968 only - Mar lastSun 2:00s 0 -
Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 -
Rule ATAQ 1972 only - Feb lastSun 2:00s 0 -
Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 -
Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 -
Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 -
Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 -
Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 -
Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 -
Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 -
Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 -
Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 -
Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 -
Rule ATAQ 2007 only - Mar lastSun 2:00s 0 -
Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 -
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
# Esperanza, San Martin Land, -6323-05659, since 1952-12-17
# Jubany, Potter Peninsula, King George Island, -6414-0602320, since 1982-01
# Marambio, Seymour I, -6414-05637, since 1969-10-29
# Orcadas, Laurie I, -6016-04444, since 1904-02-22
# San Martin, Debenham I, -6807-06708, since 1951-03-21
# (except 1960-03 / 1976-03-21)
# Australia - territories
# Heard Island, McDonald Islands (uninhabited)
# previously sealers and scientific personnel wintered
# <a href="http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html">
# Margaret Turner reports
# </a> (1999-09-30) that they're UTC+5, with no DST;
# presumably this is when they have visitors.
#
# year-round bases
# Casey, Bailey Peninsula, -6617+11032, since 1969
# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
# (except 1964-11 - 1969-02)
# Mawson, Holme Bay, -6736+06253, since 1954-02-13
# From Steffen Thorsen (2009-03-11):
# Three Australian stations in Antarctica have changed their time zone:
# Casey moved from UTC+8 to UTC+11
# Davis moved from UTC+7 to UTC+5
# Mawson moved from UTC+6 to UTC+5
# The changes occurred on 2009-10-18 at 02:00 (local times).
#
# Government source: (Australian Antarctic Division)
# <a href="http://www.aad.gov.au/default.asp?casid=37079">
# http://www.aad.gov.au/default.asp?casid=37079
# </a>
#
# We have more background information here:
# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
# http://www.timeanddate.com/news/time/antarctica-new-times.html
# </a>
# From Steffen Thorsen (2010-03-10):
# We got these changes from the Australian Antarctic Division:
# - Macquarie Island will stay on UTC+11 for winter and therefore not
# switch back from daylight savings time when other parts of Australia do
# on 4 April.
#
# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
# The change to UTC+11 is being considered as a regular summer thing but
# has not been decided yet.
#
# - Davis station will revert to its normal time of UTC+7 at 10 March 2010
# 20:00 UTC.
#
# - Mawson station stays on UTC+5.
#
# In addition to the Rule changes for Casey/Davis, it means that Macquarie
# will no longer be like Hobart and will have to have its own Zone created.
#
# Background:
# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
# </a>
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Casey 0 - zzz 1969
8:00 - WST 2009 Oct 18 2:00
# Western (Aus) Standard Time
11:00 - CAST 2010 Mar 5 2:00
# Casey Time
8:00 - WST 2011 Oct 28 2:00
11:00 - CAST 2012 Feb 21 17:00u
8:00 - WST
Zone Antarctica/Davis 0 - zzz 1957 Jan 13
7:00 - DAVT 1964 Nov # Davis Time
0 - zzz 1969 Feb
7:00 - DAVT 2009 Oct 18 2:00
5:00 - DAVT 2010 Mar 10 20:00u
7:00 - DAVT 2011 Oct 28 2:00
5:00 - DAVT 2012 Feb 21 20:00u
7:00 - DAVT
Zone Antarctica/Mawson 0 - zzz 1954 Feb 13
6:00 - MAWT 2009 Oct 18 2:00
# Mawson Time
5:00 - MAWT
Zone Antarctica/Macquarie 0 - zzz 1911
10:00 - EST 1916 Oct 1 2:00
10:00 1:00 EST 1917 Feb
10:00 AusAQ EST 1967
10:00 ATAQ EST 2010 Apr 4 3:00
11:00 - MIST # Macquarie Island Time
# References:
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
# Casey Weather (1998-02-26)
# </a>
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html">
# Davis Station, Antarctica (1998-02-26)
# </a>
# <a href="http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html">
# Mawson Station, Antarctica (1998-02-25)
# </a>
# Brazil - year-round base
# Comandante Ferraz, King George Island, -6205+05824, since 1983/4
# Chile - year-round bases and towns
# Escudero, South Shetland Is, -621157-0585735, since 1994
# Presidente Eduadro Frei, King George Island, -6214-05848, since 1969-03-07
# General Bernardo O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
# Capitan Arturo Prat, -6230-05941
# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
# These locations have always used Santiago time; use TZ='America/Santiago'.
# China - year-round bases
# Great Wall, King George Island, -6213-05858, since 1985-02-20
# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
# France - year-round bases
#
# From Antoine Leca (1997-01-20):
# Time data are from Nicole Pailleau at the IFRTP
# (French Institute for Polar Research and Technology).
# She confirms that French Southern Territories and Terre Adelie bases
# don't observe daylight saving time, even if Terre Adelie supplies came
# from Tasmania.
#
# French Southern Territories with year-round inhabitants
#
# Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950
# Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964
# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951;
# whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
#
# St Paul Island - near Amsterdam, uninhabited
# fishing stations operated variously 1819/1931
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Indian/Kerguelen 0 - zzz 1950 # Port-aux-Francais
5:00 - TFT # ISO code TF Time
#
# year-round base in the main continent
# Dumont-d'Urville, Ile des Petrels, -6640+14001, since 1956-11
#
# Another base at Port-Martin, 50km east, began operation in 1947.
# It was destroyed by fire on 1952-01-14.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/DumontDUrville 0 - zzz 1947
10:00 - PMT 1952 Jan 14 # Port-Martin Time
0 - zzz 1956 Nov
10:00 - DDUT # Dumont-d'Urville Time
# Reference:
# <a href="http://en.wikipedia.org/wiki/Dumont_d'Urville_Station">
# Dumont d'Urville Station (2005-12-05)
# </a>
# Germany - year-round base
# Georg von Neumayer, -7039-00815
# India - year-round base
# Dakshin Gangotri, -7005+01200
# Japan - year-round bases
# Dome Fuji, -7719+03942
# Syowa, -690022+0393524
#
# From Hideyuki Suzuki (1999-02-06):
# In all Japanese stations, +0300 is used as the standard time.
#
# Syowa station, which is the first antarctic station of Japan,
# was established on 1957-01-29. Since Syowa station is still the main
# station of Japan, it's appropriate for the principal location.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Syowa 0 - zzz 1957 Jan 29
3:00 - SYOT # Syowa Time
# See:
# <a href="http://www.nipr.ac.jp/english/ara01.html">
# NIPR Antarctic Research Activities (1999-08-17)
# </a>
# S Korea - year-round base
# King Sejong, King George Island, -6213-05847, since 1988
# New Zealand - claims
# Balleny Islands (never inhabited)
# Scott Island (never inhabited)
#
# year-round base
# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
#
# These rules for New Zealand are stolen from the `australasia' file.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D
Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D
Rule NZAQ 1989 only - Oct 8 2:00s 1:00 D
Rule NZAQ 1990 2006 - Oct Sun>=1 2:00s 1:00 D
Rule NZAQ 1975 only - Feb 23 2:00s 0 S
Rule NZAQ 1976 1989 - Mar Sun>=1 2:00s 0 S
Rule NZAQ 1990 2007 - Mar Sun>=15 2:00s 0 S
Rule NZAQ 2007 max - Sep lastSun 2:00s 1:00 D
Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S
# Norway - territories
# Bouvet (never inhabited)
#
# claims
# Peter I Island (never inhabited)
# Poland - year-round base
# Arctowski, King George Island, -620945-0582745, since 1977
# Russia - year-round bases
# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
# Mirny, Davis coast, -6633+09301, since 1956-02
# Molodezhnaya, Alasheyev Bay, -6740+04551,
# year-round from 1962-02 to 1999-07-01
# Novolazarevskaya, Queen Maud Land, -7046+01150,
# year-round from 1960/61 to 1992
# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
# <a href="http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP">
# From Craig Mundell (1994-12-15)</a>:
# Vostok, which is one of the Russian stations, is set on the same
# time as Moscow, Russia.
#
# From Lee Hotz (2001-03-08):
# I queried the folks at Columbia who spent the summer at Vostok and this is
# what they had to say about time there:
# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
# of GMT). This is a time zone I think two hours east of Moscow. The
# natural time zone is in between the two: 8 hours ahead of GMT.''
#
# From Paul Eggert (2001-05-04):
# This seems to be hopelessly confusing, so I asked Lee Hotz about it
# in person. He said that some Antartic locations set their local
# time so that noon is the warmest part of the day, and that this
# changes during the year and does not necessarily correspond to mean
# solar noon. So the Vostok time might have been whatever the clocks
# happened to be during their visit. So we still don't really know what time
# it is at Vostok. But we'll guess UTC+6.
#
Zone Antarctica/Vostok 0 - zzz 1957 Dec 16
6:00 - VOST # Vostok time
# S Africa - year-round bases
# Marion Island, -4653+03752
# Sanae, -7141-00250
# UK
#
# British Antarctic Territories (BAT) claims
# South Orkney Islands
# scientific station from 1903
# whaling station at Signy I 1920/1926
# South Shetland Islands
#
# year-round bases
# Bird Island, South Georgia, -5400-03803, since 1983
# Deception Island, -6259-06034, whaling station 1912/1931,
# scientific station 1943/1967,
# previously sealers and a scientific expedition wintered by accident,
# and a garrison was deployed briefly
# Halley, Coates Land, -7535-02604, since 1956-01-06
# Halley is on a moving ice shelf and is periodically relocated
# so that it is never more than 10km from its nominal location.
# Rothera, Adelaide Island, -6734-6808, since 1976-12-01
#
# From Paul Eggert (2002-10-22)
# <http://webexhibits.org/daylightsaving/g.html> says Rothera is -03 all year.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Rothera 0 - zzz 1976 Dec 1
-3:00 - ROTT # Rothera time
# Uruguay - year round base
# Artigas, King George Island, -621104-0585107
# USA - year-round bases
#
# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
#
# From Ethan Dicks (1996-10-06):
# It keeps the same time as Punta Arenas, Chile, because, just like us
# and the South Pole, that's the other end of their supply line....
# I verified with someone who was there that since 1980,
# Palmer has followed Chile. Prior to that, before the Falklands War,
# Palmer used to be supplied from Argentina.
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Palmer 0 - zzz 1965
-4:00 ArgAQ AR%sT 1969 Oct 5
-3:00 ArgAQ AR%sT 1982 May
-4:00 ChileAQ CL%sT
#
#
# McMurdo, Ross Island, since 1955-12
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/McMurdo 0 - zzz 1956
12:00 NZAQ NZ%sT
#
# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
#
# From Paul Eggert (1996-09-03):
# Normally it wouldn't have a separate entry, since it's like the
# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
#
# From Chris Carrier (1996-06-27):
# Siple, the first commander of the South Pole station,
# stated that he would have liked to have kept GMT at the station,
# but that he found it more convenient to keep GMT+12
# as supplies for the station were coming from McMurdo Sound,
# which was on GMT+12 because New Zealand was on GMT+12 all year
# at that time (1957). (Source: Siple's book 90 degrees SOUTH.)
#
# From Susan Smith
# http://www.cybertours.com/whs/pole10.html
# (1995-11-13 16:24:56 +1300, no longer available):
# We use the same time as McMurdo does.
# And they use the same time as Christchurch, NZ does....
# One last quirk about South Pole time.
# All the electric clocks are usually wrong.
# Something about the generators running at 60.1hertz or something
# makes all of the clocks run fast. So every couple of days,
# we have to go around and set them back 5 minutes or so.
# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
#
Link Antarctica/McMurdo Antarctica/South_Pole

File diff suppressed because it is too large Load Diff

View File

@@ -1,117 +0,0 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# This file provides links between current names for time zones
# and their old names. Many names changed in late 1993.
Link Africa/Asmara Africa/Asmera
Link Africa/Bamako Africa/Timbuktu
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
Link America/Argentina/Buenos_Aires America/Buenos_Aires
Link America/Argentina/Catamarca America/Catamarca
Link America/Atikokan America/Coral_Harbour
Link America/Argentina/Cordoba America/Cordoba
Link America/Tijuana America/Ensenada
Link America/Indiana/Indianapolis America/Fort_Wayne
Link America/Indiana/Indianapolis America/Indianapolis
Link America/Argentina/Jujuy America/Jujuy
Link America/Indiana/Knox America/Knox_IN
Link America/Kentucky/Louisville America/Louisville
Link America/Argentina/Mendoza America/Mendoza
Link America/Rio_Branco America/Porto_Acre
Link America/Argentina/Cordoba America/Rosario
Link America/St_Thomas America/Virgin
Link Asia/Ashgabat Asia/Ashkhabad
Link Asia/Chongqing Asia/Chungking
Link Asia/Dhaka Asia/Dacca
Link Asia/Kathmandu Asia/Katmandu
Link Asia/Kolkata Asia/Calcutta
Link Asia/Macau Asia/Macao
Link Asia/Jerusalem Asia/Tel_Aviv
Link Asia/Ho_Chi_Minh Asia/Saigon
Link Asia/Thimphu Asia/Thimbu
Link Asia/Makassar Asia/Ujung_Pandang
Link Asia/Ulaanbaatar Asia/Ulan_Bator
Link Atlantic/Faroe Atlantic/Faeroe
Link Europe/Oslo Atlantic/Jan_Mayen
Link Australia/Sydney Australia/ACT
Link Australia/Sydney Australia/Canberra
Link Australia/Lord_Howe Australia/LHI
Link Australia/Sydney Australia/NSW
Link Australia/Darwin Australia/North
Link Australia/Brisbane Australia/Queensland
Link Australia/Adelaide Australia/South
Link Australia/Hobart Australia/Tasmania
Link Australia/Melbourne Australia/Victoria
Link Australia/Perth Australia/West
Link Australia/Broken_Hill Australia/Yancowinna
Link America/Rio_Branco Brazil/Acre
Link America/Noronha Brazil/DeNoronha
Link America/Sao_Paulo Brazil/East
Link America/Manaus Brazil/West
Link America/Halifax Canada/Atlantic
Link America/Winnipeg Canada/Central
Link America/Regina Canada/East-Saskatchewan
Link America/Toronto Canada/Eastern
Link America/Edmonton Canada/Mountain
Link America/St_Johns Canada/Newfoundland
Link America/Vancouver Canada/Pacific
Link America/Regina Canada/Saskatchewan
Link America/Whitehorse Canada/Yukon
Link America/Santiago Chile/Continental
Link Pacific/Easter Chile/EasterIsland
Link America/Havana Cuba
Link Africa/Cairo Egypt
Link Europe/Dublin Eire
Link Europe/London Europe/Belfast
Link Europe/Chisinau Europe/Tiraspol
Link Europe/London GB
Link Europe/London GB-Eire
Link Etc/GMT GMT+0
Link Etc/GMT GMT-0
Link Etc/GMT GMT0
Link Etc/GMT Greenwich
Link Asia/Hong_Kong Hongkong
Link Atlantic/Reykjavik Iceland
Link Asia/Tehran Iran
Link Asia/Jerusalem Israel
Link America/Jamaica Jamaica
Link Asia/Tokyo Japan
Link Pacific/Kwajalein Kwajalein
Link Africa/Tripoli Libya
Link America/Tijuana Mexico/BajaNorte
Link America/Mazatlan Mexico/BajaSur
Link America/Mexico_City Mexico/General
Link Pacific/Auckland NZ
Link Pacific/Chatham NZ-CHAT
Link America/Denver Navajo
Link Asia/Shanghai PRC
Link Pacific/Pago_Pago Pacific/Samoa
Link Pacific/Chuuk Pacific/Yap
Link Pacific/Chuuk Pacific/Truk
Link Pacific/Pohnpei Pacific/Ponape
Link Europe/Warsaw Poland
Link Europe/Lisbon Portugal
Link Asia/Taipei ROC
Link Asia/Seoul ROK
Link Asia/Singapore Singapore
Link Europe/Istanbul Turkey
Link Etc/UCT UCT
Link America/Anchorage US/Alaska
Link America/Adak US/Aleutian
Link America/Phoenix US/Arizona
Link America/Chicago US/Central
Link America/Indiana/Indianapolis US/East-Indiana
Link America/New_York US/Eastern
Link Pacific/Honolulu US/Hawaii
Link America/Indiana/Knox US/Indiana-Starke
Link America/Detroit US/Michigan
Link America/Denver US/Mountain
Link America/Los_Angeles US/Pacific
Link Pacific/Pago_Pago US/Samoa
Link Etc/UTC UTC
Link Etc/UTC Universal
Link Europe/Moscow W-SU
Link Etc/UTC Zulu

View File

@@ -1,81 +0,0 @@
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# These entries are mostly present for historical reasons, so that
# people in areas not otherwise covered by the tz files could "zic -l"
# to a time zone that was right for their area. These days, the
# tz files cover almost all the inhabited world, and the only practical
# need now for the entries that are not on UTC are for ships at sea
# that cannot use POSIX TZ settings.
Zone Etc/GMT 0 - GMT
Zone Etc/UTC 0 - UTC
Zone Etc/UCT 0 - UCT
# The following link uses older naming conventions,
# but it belongs here, not in the file `backward',
# as functions like gmtime load the "GMT" file to handle leap seconds properly.
# We want this to work even on installations that omit the other older names.
Link Etc/GMT GMT
Link Etc/UTC Etc/Universal
Link Etc/UTC Etc/Zulu
Link Etc/GMT Etc/Greenwich
Link Etc/GMT Etc/GMT-0
Link Etc/GMT Etc/GMT+0
Link Etc/GMT Etc/GMT0
# We use POSIX-style signs in the Zone names and the output abbreviations,
# even though this is the opposite of what many people expect.
# POSIX has positive signs west of Greenwich, but many people expect
# positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses
# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC
# (i.e. west of Greenwich) even though many people would expect it to
# mean 4 hours ahead of UTC (i.e. east of Greenwich).
#
# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for
# TZ='<GMT-4>+4'; if you want time zone abbreviations conforming to
# ISO 8601 you can use TZ='<-0400>+4'. Thus the commonly-expected
# offset is kept within the angle bracket (and is used for display)
# while the POSIX sign is kept outside the angle bracket (and is used
# for calculation).
#
# Do not use a TZ setting like TZ='GMT+4', which is four hours behind
# GMT but uses the completely misleading abbreviation "GMT".
# Earlier incarnations of this package were not POSIX-compliant,
# and had lines such as
# Zone GMT-12 -12 - GMT-1200
# We did not want things to change quietly if someone accustomed to the old
# way does a
# zic -l GMT-12
# so we moved the names into the Etc subdirectory.
Zone Etc/GMT-14 14 - GMT-14 # 14 hours ahead of GMT
Zone Etc/GMT-13 13 - GMT-13
Zone Etc/GMT-12 12 - GMT-12
Zone Etc/GMT-11 11 - GMT-11
Zone Etc/GMT-10 10 - GMT-10
Zone Etc/GMT-9 9 - GMT-9
Zone Etc/GMT-8 8 - GMT-8
Zone Etc/GMT-7 7 - GMT-7
Zone Etc/GMT-6 6 - GMT-6
Zone Etc/GMT-5 5 - GMT-5
Zone Etc/GMT-4 4 - GMT-4
Zone Etc/GMT-3 3 - GMT-3
Zone Etc/GMT-2 2 - GMT-2
Zone Etc/GMT-1 1 - GMT-1
Zone Etc/GMT+1 -1 - GMT+1
Zone Etc/GMT+2 -2 - GMT+2
Zone Etc/GMT+3 -3 - GMT+3
Zone Etc/GMT+4 -4 - GMT+4
Zone Etc/GMT+5 -5 - GMT+5
Zone Etc/GMT+6 -6 - GMT+6
Zone Etc/GMT+7 -7 - GMT+7
Zone Etc/GMT+8 -8 - GMT+8
Zone Etc/GMT+9 -9 - GMT+9
Zone Etc/GMT+10 -10 - GMT+10
Zone Etc/GMT+11 -11 - GMT+11
Zone Etc/GMT+12 -12 - GMT+12

Some files were not shown because too many files have changed in this diff Show More