mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Snapshots: Sanitize orignal url (#23254)
This commit is contained in:
parent
ea35ae4d1f
commit
fb114a7524
@ -17,6 +17,7 @@ import { DashboardModel } from '../../state';
|
||||
import { CoreEvents, StoreState } from 'app/types';
|
||||
import { ShareModal } from 'app/features/dashboard/components/ShareModal';
|
||||
import { SaveDashboardModalProxy } from 'app/features/dashboard/components/SaveDashboard/SaveDashboardModalProxy';
|
||||
import { sanitizeUrl } from 'app/core/utils/text';
|
||||
|
||||
export interface OwnProps {
|
||||
dashboard: DashboardModel;
|
||||
@ -134,6 +135,7 @@ export class DashNav extends PureComponent<Props> {
|
||||
const { canStar, canSave, canShare, showSettings, isStarred } = dashboard.meta;
|
||||
const { snapshot } = dashboard;
|
||||
const snapshotUrl = snapshot && snapshot.originalUrl;
|
||||
|
||||
return (
|
||||
<div className="navbar">
|
||||
{isFullscreen && this.renderBackButton()}
|
||||
@ -222,7 +224,7 @@ export class DashNav extends PureComponent<Props> {
|
||||
tooltip="Open original dashboard"
|
||||
classSuffix="snapshot-origin"
|
||||
icon="gicon gicon-link"
|
||||
href={snapshotUrl}
|
||||
href={sanitizeUrl(snapshotUrl)}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user