epe*_*elc 5 javascript iframe angularjs grafana
我正试图在我的angularjs应用程序中嵌入grafana.我可以使用简单的iframe轻松完成,但我的应用程序使用jwt进行身份验证,我找不到为iframe设置标头的方法.我已经确认,当我使用基本的iframe关闭身份验证时,它的工作完全正常,但我需要在生产中使用它.
我也尝试过使用$httpgrafana html(这样我可以设置我的jwt标头)但js似乎不能使用这种方法.我认为它与bootstraping有关,因为它们是手动引导的.
//iframe
<iframe id="grafana" layout-fill flex></iframe>
//controller
$http.get('/grafana/dashboard').then(function(response) {
var iframeDocument = document.getElementById('grafana').contentWindow.document
iframeDocument.open('text/html', 'replace')
iframeDocument.write(response.data)
iframeDocument.close()
})
Run Code Online (Sandbox Code Playgroud)
还有其他方法可以在iframe上设置标题吗?我也尝试过使用grafana的html作为模板,但正如我之前所说,他们的引导似乎在另一个应用程序中不起作用.
| 归档时间: |
|
| 查看次数: |
933 次 |
| 最近记录: |