diff --git a/TODO b/TODO new file mode 100644 index 0000000..7102444 --- /dev/null +++ b/TODO @@ -0,0 +1,10 @@ +- build template html + +- made a generator, ask : + - iface + - ipv(4|6) + - language + - make needed directories + - fill files config and html + +- i18n: EN, FR, ? diff --git a/i18n.sh b/i18n.sh new file mode 100644 index 0000000..aa919bf --- /dev/null +++ b/i18n.sh @@ -0,0 +1,45 @@ +title="$(gettext "PFstats")" +subtitle="$(gettext "Dataviz Project to view the monitoring by pfstat")" + +text_ipv4="$(gettext "IPv4")" +text_ipv6="$(gettext "IPv6")" + +daily_traffic="$(gettext "Daily Traffic")" +hourly_traffic="$(gettext "Hourly Traffic")" +weekly_traffic="$(gettext "Weekly Traffic")" +monthly_traffic="$(gettext "Monthly Traffic")" +yearly_traffic="$(gettext "Yearly Traffic")" + +daily_packets="$(gettext "Daily Packets")" +hourly_packets="$(gettext "Hourly Packets")" +weekly_packets="$(gettext "Weekly Packets")" +monthly_packets="$(gettext "Monthly Packets")" +yearly_packets="$(gettext "Yearly Packets")" + +daily_states="$(gettext "Daily States")" +hourly_states="$(gettext "Hourly States")" +weekly_states="$(gettext "Weekly States")" +monthly_states="$(gettext "Monthly States")" +yearly_states="$(gettext "Yearly States")" + +daily_errors="$(gettext "Daily Errors")" +hourly_errors="$(gettext "Hourly Errors")" +weekly_errors="$(gettext "Weekly Errors")" +monthly_errors="$(gettext "Monthly Errors")" +yearly_errors="$(gettext "Yearly Errors")" + +title_errors="$(gettext "Errors")" +title_packets="$(gettext "Packets")" +title_states="$(gettext "States")" +title_traffic="$(gettext "Traffic")" + +title_daily="$(gettext "Daily")" +title_hourly="$(gettext "Hourly")" +title_weekly="$(gettext "Weekly")" +title_monthly="$(gettext "Monthly")" +title_yearly="$(gettext "Yearly")" + +text_by_me="$(gettext "Made with One Brain, Two Hands and LOL, by Stéphane HUC :: IT Log.")" +text_by_purecss="$(gettext "This site is built using PureCSS")" +text_by_pfstat="$(gettext "pfstat is a project of Daniel Hartmeir.")" +text_license="$(gettext "Licensed by BSD License")" diff --git a/pfstat-builder.sh b/pfstat-builder.sh new file mode 100755 index 0000000..e4faa55 --- /dev/null +++ b/pfstat-builder.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +set -e +#set -u +#set -x +[ -n "$TERM" ] && clear +######################################################################## +### +## +# +# Author: Stéphane HUC +# mail: devs@stephane-huc.net +# gpg:fingerprint: CE2C CF7C AB68 0329 0D20 5F49 6135 D440 4D44 BD58 +# +# License: BSD License 2-Clause +# +# Git: +# +# Date: 2021/07/31 +# +## +### +######################################################################## + +ROOT="$(dirname "$(readlink -f -- "$0")")" + +TEXTDOMAIN="pfstats" +TEXTDOMAINDIR="${ROOT}/share/locale/" +export TEXTDOMAIN TEXTDOMAINDIR + +. gettext.sh +. "${ROOT}/i18n.sh" + +echo "${title}" +echo "${subtitle}" diff --git a/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.mo b/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.mo new file mode 100644 index 0000000..c6a8fb5 Binary files /dev/null and b/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.mo differ diff --git a/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.po b/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.po new file mode 100644 index 0000000..dccbbc4 --- /dev/null +++ b/share/locale/fr_FR.UTF-8/LC_MESSAGES/pfstats.po @@ -0,0 +1,27 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-07-31 21:16+0200\n" +"PO-Revision-Date: 2021-07-31 21:17+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0\n" +"Last-Translator: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: fr\n" + +#: pfstat-builder.sh:35 +msgid "PFstats" +msgstr "PFstats" + +#: pfstat-builder.sh:36 +msgid "Dataviz Project to view the monitoring by pfstat" +msgstr "Projet Dataviz pour analyser le monitoring de pfstat" diff --git a/share/locale/pfstats.pot b/share/locale/pfstats.pot new file mode 100644 index 0000000..f9c65d7 --- /dev/null +++ b/share/locale/pfstats.pot @@ -0,0 +1,26 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-07-31 21:16+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: pfstat-builder.sh:35 +msgid "PFstats" +msgstr "" + +#: pfstat-builder.sh:36 +msgid "Dataviz Project to view the monitoring by pfstat" +msgstr "" diff --git a/tmpl/pfstats.tmpl.html b/tmpl/pfstats.tmpl.html new file mode 100644 index 0000000..9272155 --- /dev/null +++ b/tmpl/pfstats.tmpl.html @@ -0,0 +1,58 @@ + + + + + + + + +{{title}} + + + +
+ +
+

{{title}}

+

{{subtitle}}

+
+ + + + +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ {{footer}} +
+ + + +
+ + +