Open tonypowa opened 4 days ago
This issue is a test copy of an issue in another repo. Original issue: https://github.com/grafana/grafana/issues/#88402
Hi @tonypowa, it looks like you are encountering an issue related to embedding Grafana dashboards into a PyQt application. This problem might be due to Grafana's frontend aspects or configuration settings that affect how it runs within a web engine environment. I recommend you to create an issue in the Frontend Platform project, as they might have more insights on integrations with different web view environments and can help troubleshoot the issue with embedding.
Summary: User tonypowa reports an issue when attempting to load Grafana URLs using PyQt's QWebEngineView, with the application files failing to load, though the URLs work in a standard web browser. The issue remains open and unresolved.
Elaboration:
Hi @tonypowa,
Thank you for reaching out for help with your issue related to opening Grafana in a PyQt application. In order to assist you more effectively, there are a few pieces of information that could be very helpful:
Providing this additional information could be vital for diagnosing and resolving the issue you're encountering. Once you've provided it, the community might be able to offer more targeted advice.
Best regards, The Open Source Community Support Team
Dear all:
I'm working with grafana recently to show some figures and tables. While there're issues i found. When I try to open grafana url with PyQt,the fatal problem come out. My python code and the result as following
`
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView
class GrafanaDashboard(QMainWindow):
def init(self, grafana_url):
super().init()
self.browser = QWebEngineView()
self.browser.load(QUrl(grafana_url))
clear all
self.browser.page().profile().clearAllVisitedLinks()
self.browser.page().profile().clearHttpCache()
self.browser.page().profile().cookieStore().deleteAllCookies()
Connect the loadFinished signal to the handler function
self.browser.loadFinished.connect(self.on_load_finished)
self.setCentralWidget(self.browser)
self.showMaximized()
Add a slot to handle the loadFinished signal
def on_load_finished(self, success):
The success parameter indicates whether the page was loaded successfully
if success:
print("Page loaded successfully")
else:
print("Failed to load the page")
if name == 'main':
app = QApplication(sys.argv)
grafana_url = 'http://10.1.160.133:3015'
mainWin = GrafanaDashboard(grafana_url)
mainWin.show()
sys.exit(app.exec_())`
and the results show
if you are seeing this, Grafana has failed to load its application files
I don't know the reason why it gets error. However, when the dashboard url is linked by webbrowser all is OK. Our group has decided to import PyQt to show the statistical tables and images with grafana dashboard url. This iussue bores us for a long time. If anyone who has sovled the same problem give me some useful imformation please.
Thanks a lot.