Skip to content

Commit

Permalink
Goaccess fixes for report modal (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
dshook authored Jan 5, 2025
1 parent cc43146 commit 3f2bb36
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/containers/apps/appDetails/AccessLogReports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class AccessLogReports extends Component<
<Button
onClick={() =>
this.onReportClick(
r.name,
this.reportName(r),
r.url
)
}
Expand Down Expand Up @@ -178,9 +178,17 @@ export default class AccessLogReports extends Component<
onReportClick(reportName: string, reportUrl: string) {
this.setState({ reportOpen: reportName })

this.props.apiManager.getGoAccessReport(reportUrl).then((report) => {
this.setState({ reportHtml: report })
})
this.props.apiManager
.getGoAccessReport(reportUrl)
.then((report: string) => {
// Add a couple extra override styles to the report to disable the hamburger menu that contains
// links which will result in navigating to the caprover dashboard within the iframe
report = report.replace(
'</head>',
`<style>.nav-bars{ display: none;} nav .nav-gears{ top: 30px;}</style></head>`
)
this.setState({ reportHtml: report })
})
}

onModalClose() {
Expand Down

0 comments on commit 3f2bb36

Please sign in to comment.