ntp as png
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Wolfgang Hottgenroth 2025-02-11 19:42:19 +01:00
parent 2d3eab0db8
commit 4213dc7329
Signed by: wn
GPG Key ID: 18FDFA577A8871AD

View File

@ -1,4 +1,4 @@
from flask import Flask, session, g, render_template_string
from flask import Flask, session, g, render_template_string, Response
from flask_session import Session
from flask_oidc import OpenIDConnect
from werkzeug.middleware.proxy_fix import ProxyFix
@ -174,8 +174,6 @@ def ntpserver():
fig.add_trace(po.Scatter(x=df['bucket'], y=df['stratum'], mode='lines', name='Stratum', yaxis='y2', line=dict(color='blue')))
fig.update_layout(
title='NTP Server Numbers',
# Linke Y-Achse
yaxis=dict(
title='Root Dispersion'
@ -193,19 +191,9 @@ def ntpserver():
legend=dict(x=0.05, y=1) # Position der Legende
)
img = fig.to_image(format='png')
return Response(img, mimetype='image/png')
graph_html = fig.to_html(full_html=False, default_height='30%')
return render_template_string(f"""
<html>
<head>
<title>NTP Server Numbers</title>
</head>
<body>
{graph_html}
</body>
</html>
""")
except Exception as e:
raise Exception(f"Error when querying NTP server values: {e}")
finally: