Start Builder Project and Translation

This commit is contained in:
HUC Stéphane 2021-07-31 21:54:53 +02:00
parent 7b120e3ba1
commit 342cdec074
Signed by: hucste
GPG Key ID: C4ED64222D9B037F
7 changed files with 201 additions and 0 deletions

10
TODO Normal file
View File

@ -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, ?

45
i18n.sh Normal file
View File

@ -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")"

35
pfstat-builder.sh Executable file
View File

@ -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}"

Binary file not shown.

View File

@ -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 <EMAIL@ADDRESS>, 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"

26
share/locale/pfstats.pot Normal file
View File

@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

58
tmpl/pfstats.tmpl.html Normal file
View File

@ -0,0 +1,58 @@
<!doctype html>
<html lang="{{lang}}">
<head>
<link rel="stylesheet" href="pure-min.css" integrity="sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5" crossorigin="anonymous">
<!-- <link rel="stylesheet" href="grids-responsive-min.css"> -->
<link rel="stylesheet" href="styles.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{title}}</title>
</head>
<body>
<main id="layout">
<header class="header">
<h1>{{title}}</h1>
<h2>{{subtitle}}</h2>
</header>
<a class="menu-link" href="#menu" id="menuLink"><span></span></a>
<nav id="menu">
<div class="pure-menu">
<dl>
{{nav}}
</dl>
</div>
</nav>
<div class="content" id="main">
<!-- article for traffic views -->
<article id="traffic-views">
</article>
<!-- article for packets view -->
<article id="packets-views">
</article>
<!-- article for states views -->
<article id="states-views">
</article>
<!-- article for errors views -->
<article id="errors-views">
</article>
</div>
<footer class="footer">
{{footer}}
</footer>
</div>
</main>
<script src="ui.js"></script>
</body>
</html>