Remove redundant stats from screenshots #5

Merged
thopic merged 1 commits from remove-redundant-stats into master 2022-02-10 17:42:40 +01:00
2 changed files with 26 additions and 4 deletions

View File

@ -30,6 +30,7 @@
<ul> <ul>
<li> <a href="#mm" title="https://www.gnous.fr/stats.php#mm">Mattermost</a></li> <li> <a href="#mm" title="https://www.gnous.fr/stats.php#mm">Mattermost</a></li>
<ul> <ul>
<li> <a href="#mmsyn" title="https://www.gnous.fr/stats.php#mmsyn">Synthèse</a></li>
<li> <a href="#mm24h" title="https://www.gnous.fr/stats.php#mm24h">Dernières 24h</a></li> <li> <a href="#mm24h" title="https://www.gnous.fr/stats.php#mm24h">Dernières 24h</a></li>
<li> <a href="#mm7d" title="https://www.gnous.fr/stats.php#mm7d">Dernière semaine</a></li> <li> <a href="#mm7d" title="https://www.gnous.fr/stats.php#mm7d">Dernière semaine</a></li>
<li> <a href="#mm1M" title="https://www.gnous.fr/stats.php#mm1M">Dernier mois</a></li> <li> <a href="#mm1M" title="https://www.gnous.fr/stats.php#mm1M">Dernier mois</a></li>
@ -37,6 +38,7 @@
</ul> </ul>
<li> <a href="#nc" title="https://www.gnous.fr/stats.php#nc">Nextcloud</a></li> <li> <a href="#nc" title="https://www.gnous.fr/stats.php#nc">Nextcloud</a></li>
<ul> <ul>
<li> <a href="#ncsyn" title="https://www.gnous.fr/stats.php#ncsyn">Synthèse</a></li>
<li> <a href="#nc24h" title="https://www.gnous.fr/stats.php#nc24h">Dernières 24h</a></li> <li> <a href="#nc24h" title="https://www.gnous.fr/stats.php#nc24h">Dernières 24h</a></li>
<li> <a href="#nc7d" title="https://www.gnous.fr/stats.php#nc7d">Dernière semaine</a></li> <li> <a href="#nc7d" title="https://www.gnous.fr/stats.php#nc7d">Dernière semaine</a></li>
<li> <a href="#nc1M" title="https://www.gnous.fr/stats.php#nc1M">Dernier mois</a></li> <li> <a href="#nc1M" title="https://www.gnous.fr/stats.php#nc1M">Dernier mois</a></li>
@ -46,9 +48,11 @@
<h2 id=mm>Mattermost</h2> <h2 id=mm>Mattermost</h2>
<h3 id=mmsyn>Synthèse</h3>
<a href="/ressources/stats/mmsyn.png" target="_blank" title="Mattermost - Synthèse"><img src="ressources/stats/mmsyn.png"></a><br>
<h3 id=mm24h>Dernières 24h</h3> <h3 id=mm24h>Dernières 24h</h3>
<a href="/ressources/stats/mm24h.png" target="_blank" title="Mattermost - Dernières 24h"><img src="ressources/stats/mm24h.png"></a><br> <a href="/ressources/stats/mm24h.png" target="_blank" title="Mattermost - Dernières 24h"><img src="ressources/stats/mm24h.png"></a><br>
<h3 id=mm7d>Dernière semaine</h3> <h3 id=mm7d>Dernière semaine</h3>
<a href="/ressources/stats/mm7d.png" target="_blank" title="Mattermost - Dernière semaine"><img src="ressources/stats/mm7d.png"></a><br> <a href="/ressources/stats/mm7d.png" target="_blank" title="Mattermost - Dernière semaine"><img src="ressources/stats/mm7d.png"></a><br>
<h3 id=mm1M>Dernier mois</h3> <h3 id=mm1M>Dernier mois</h3>
<a href="/ressources/stats/mm1M.png" target="_blank" title="Mattermost - Dernier mois"><img src="ressources/stats/mm1M.png"></a><br> <a href="/ressources/stats/mm1M.png" target="_blank" title="Mattermost - Dernier mois"><img src="ressources/stats/mm1M.png"></a><br>
@ -56,6 +60,8 @@
<a href="/ressources/stats/mm1y.png" target="_blank" title="Mattermost - Dernière année"><img src="ressources/stats/mm1y.png"></a><br> <a href="/ressources/stats/mm1y.png" target="_blank" title="Mattermost - Dernière année"><img src="ressources/stats/mm1y.png"></a><br>
<h2 id=nc>Nextcloud</h2> <h2 id=nc>Nextcloud</h2>
<h3 id=ncsyn>Synthèse</h3>
<a href="/ressources/stats/ncsyn.png" target="_blank" title="Nextcloud - Synthèse"><img src="ressources/stats/ncsyn.png"></a><br>
<h3 id=nc24h>Dernières 24h</h3> <h3 id=nc24h>Dernières 24h</h3>
<a href="/ressources/stats/nc24h.png" target="_blank" title="Nextcloud - Dernières 24h"><img src="ressources/stats/nc24h.png"></a><br> <a href="/ressources/stats/nc24h.png" target="_blank" title="Nextcloud - Dernières 24h"><img src="ressources/stats/nc24h.png"></a><br>
<h3 id=nc7d>Dernière semaine</h3> <h3 id=nc7d>Dernière semaine</h3>

View File

@ -8,6 +8,7 @@ from dotenv import load_dotenv
from seleniumwire import webdriver from seleniumwire import webdriver
from seleniumwire.webdriver import FirefoxOptions from seleniumwire.webdriver import FirefoxOptions
try: try:
os.chdir(os.path.dirname(os.path.abspath(__file__))) os.chdir(os.path.dirname(os.path.abspath(__file__)))
load_dotenv() load_dotenv()
@ -15,19 +16,34 @@ try:
opts = FirefoxOptions() opts = FirefoxOptions()
opts.add_argument("--headless") opts.add_argument("--headless")
browser = webdriver.Firefox(options=opts,executable_path="/usr/local/bin/geckodriver") browser = webdriver.Firefox(options=opts,executable_path="/usr/local/bin/geckodriver")
browser.set_window_size(3000, 1120)
def interceptor(request): def interceptor(request):
request.headers['Authorization'] = 'Basic '+os.environ["ES_TOKEN"] request.headers['Authorization'] = 'Basic '+os.environ["ES_TOKEN"]
browser.request_interceptor = interceptor browser.request_interceptor = interceptor
browser.set_window_size(3000, 285)
browser.get("https://mon.gnous.fr/app/dashboards#/view/813e0b00-8544-11ec-876e-0f6254f8a3d0?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-15m%2Cto%3Anow))&hide-filter-bar=true")
sleep(60)
browser.get_screenshot_as_file("html/ressources/stats/mmsyn.png")
browser.set_window_size(3000, 930)
for duration in ["24h", "7d", "1M", "1y"]: for duration in ["24h", "7d", "1M", "1y"]:
browser.get("https://mon.gnous.fr/app/dashboards#/view/380099d0-4944-11ec-81a9-95d7ffa23468?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-"+duration+"%2Cto%3Anow))&hide-filter-bar=true") browser.get("https://mon.gnous.fr/app/dashboards#/view/562f3400-88f2-11ec-876e-0f6254f8a3d0?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-"+duration+"%2Cto%3Anow))&hide-filter-bar=true")
sleep(60) sleep(60)
browser.get_screenshot_as_file("html/ressources/stats/mm"+duration+".png") browser.get_screenshot_as_file("html/ressources/stats/mm"+duration+".png")
browser.set_window_size(3000, 285)
browser.get("https://mon.gnous.fr/app/dashboards#/view/e4e742a0-88fc-11ec-876e-0f6254f8a3d0?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-15m%2Cto%3Anow))&hide-filter-bar=true")
sleep(60)
browser.get_screenshot_as_file("html/ressources/stats/ncsyn.png")
browser.set_window_size(3000, 930)
for duration in ["24h", "7d", "1M", "1y"]: for duration in ["24h", "7d", "1M", "1y"]:
browser.get("https://mon.gnous.fr/app/dashboards#/view/ef70de60-4947-11ec-81a9-95d7ffa23468?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-"+duration+"%2Cto%3Anow))&hide-filter-bar=true") browser.get("https://mon.gnous.fr/app/dashboards#/view/14d78520-8a78-11ec-876e-0f6254f8a3d0?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-"+duration+"%2Cto%3Anow))&hide-filter-bar=true")
sleep(60) sleep(60)
browser.get_screenshot_as_file("html/ressources/stats/nc"+duration+".png") browser.get_screenshot_as_file("html/ressources/stats/nc"+duration+".png")