Public Dashboards: use default dashboard time range instead of current (#51656)

This commit is contained in:
Ezequiel Victorero 2022-07-06 13:37:39 -03:00 committed by GitHub
parent 119c13e666
commit 9f6297ca9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -138,7 +138,7 @@ export const SharePublicDashboard = (props: Props) => {
<br /> <br />
<div style={{ padding: '5px' }}> <div style={{ padding: '5px' }}>
<Input <Input
value={props.dashboard.time.from} value={props.dashboard.getDefaultTime().from}
disabled={true} disabled={true}
addonBefore={ addonBefore={
<span style={{ width: '50px', display: 'flex', alignItems: 'center', padding: '5px' }}> <span style={{ width: '50px', display: 'flex', alignItems: 'center', padding: '5px' }}>
@ -147,7 +147,7 @@ export const SharePublicDashboard = (props: Props) => {
} }
/> />
<Input <Input
value={props.dashboard.time.to} value={props.dashboard.getDefaultTime().to}
disabled={true} disabled={true}
addonBefore={ addonBefore={
<span style={{ width: '50px', display: 'flex', alignItems: 'center', padding: '5px' }}>To:</span> <span style={{ width: '50px', display: 'flex', alignItems: 'center', padding: '5px' }}>To:</span>

View File

@ -1108,6 +1108,10 @@ export class DashboardModel implements TimeModel {
} }
} }
getDefaultTime() {
return this.originalTime;
}
private getPanelRepeatVariable(panel: PanelModel) { private getPanelRepeatVariable(panel: PanelModel) {
return this.getVariablesFromState(this.uid).find((variable) => variable.name === panel.repeat); return this.getVariablesFromState(this.uid).find((variable) => variable.name === panel.repeat);
} }