Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c344422a
Unverified
Commit
c344422a
authored
Jun 29, 2020
by
Ryan McKinley
Committed by
GitHub
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimeZonePicker: expose for panel configuraiton (#23523)
parent
1378cadb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
1 deletions
+33
-1
packages/grafana-data/src/utils/OptionsUIBuilders.ts
+9
-0
packages/grafana-ui/src/utils/standardEditors.tsx
+24
-1
No files found.
packages/grafana-data/src/utils/OptionsUIBuilders.ts
View file @
c344422a
...
@@ -192,6 +192,15 @@ export class PanelOptionsEditorBuilder<TOptions> extends OptionsUIRegistryBuilde
...
@@ -192,6 +192,15 @@ export class PanelOptionsEditorBuilder<TOptions> extends OptionsUIRegistryBuilde
});
});
}
}
addTimeZonePicker
<
TSettings
=
any
>
(
config
:
PanelOptionsEditorConfig
<
TOptions
,
TSettings
,
string
>
):
this
{
return
this
.
addCustomEditor
({
...
config
,
id
:
config
.
path
,
editor
:
standardEditorsRegistry
.
get
(
'timezone'
).
editor
as
any
,
settings
:
config
.
settings
||
{},
});
}
addUnitPicker
<
TSettings
=
any
>
(
addUnitPicker
<
TSettings
=
any
>
(
config
:
PanelOptionsEditorConfig
<
TOptions
,
TSettings
&
UnitFieldConfigSettings
,
string
>
config
:
PanelOptionsEditorConfig
<
TOptions
,
TSettings
&
UnitFieldConfigSettings
,
string
>
):
this
{
):
this
{
...
...
packages/grafana-ui/src/utils/standardEditors.tsx
View file @
c344422a
...
@@ -17,6 +17,7 @@ import {
...
@@ -17,6 +17,7 @@ import {
ValueMappingFieldConfigSettings
,
ValueMappingFieldConfigSettings
,
valueMappingsOverrideProcessor
,
valueMappingsOverrideProcessor
,
ThresholdsMode
,
ThresholdsMode
,
TimeZone
,
}
from
'@grafana/data'
;
}
from
'@grafana/data'
;
import
{
Switch
}
from
'../components/Switch/Switch'
;
import
{
Switch
}
from
'../components/Switch/Switch'
;
...
@@ -26,6 +27,7 @@ import {
...
@@ -26,6 +27,7 @@ import {
StringValueEditor
,
StringValueEditor
,
StringArrayEditor
,
StringArrayEditor
,
SelectValueEditor
,
SelectValueEditor
,
TimeZonePicker
,
}
from
'../components'
;
}
from
'../components'
;
import
{
ValueMappingsValueEditor
}
from
'../components/OptionsUI/mappings'
;
import
{
ValueMappingsValueEditor
}
from
'../components/OptionsUI/mappings'
;
import
{
ThresholdsValueEditor
}
from
'../components/OptionsUI/thresholds'
;
import
{
ThresholdsValueEditor
}
from
'../components/OptionsUI/thresholds'
;
...
@@ -303,5 +305,26 @@ export const getStandardOptionEditors = () => {
...
@@ -303,5 +305,26 @@ export const getStandardOptionEditors = () => {
description
:
''
,
description
:
''
,
};
};
return
[
text
,
number
,
boolean
,
radio
,
select
,
unit
,
mappings
,
thresholds
,
links
,
color
,
statsPicker
,
strings
];
const
timeZone
:
StandardEditorsRegistryItem
<
TimeZone
>
=
{
id
:
'timezone'
,
name
:
'Time Zone'
,
description
:
'Time zone selection'
,
editor
:
TimeZonePicker
as
any
,
};
return
[
text
,
number
,
boolean
,
radio
,
select
,
unit
,
mappings
,
thresholds
,
links
,
color
,
statsPicker
,
strings
,
timeZone
,
];
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment