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
b1b5e8d7
Commit
b1b5e8d7
authored
Mar 15, 2019
by
ryan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use singlestat base where appropriate
parent
77b78e36
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
packages/grafana-ui/src/utils/displayValue.test.ts
+2
-2
public/app/plugins/panel/bargauge/module.tsx
+2
-2
public/app/plugins/panel/gauge/module.tsx
+2
-2
public/app/plugins/panel/singlestat2/module.tsx
+4
-4
No files found.
packages/grafana-ui/src/utils/displayValue.test.ts
View file @
b1b5e8d7
import
{
getDisplayProcessor
,
getColorFromThreshold
,
DisplayProcessor
,
DisplayValue
}
from
'./displayValue'
;
import
{
MappingType
,
ValueMapping
}
from
'../types/panel'
;
function
assertSame
(
input
:
any
,
processors
s
:
DisplayProcessor
[],
match
:
DisplayValue
)
{
processors
s
.
forEach
(
processor
=>
{
function
assertSame
(
input
:
any
,
processors
:
DisplayProcessor
[],
match
:
DisplayValue
)
{
processors
.
forEach
(
processor
=>
{
const
value
=
processor
(
input
);
expect
(
value
.
text
).
toEqual
(
match
.
text
);
if
(
match
.
hasOwnProperty
(
'numeric'
))
{
...
...
public/app/plugins/panel/bargauge/module.tsx
View file @
b1b5e8d7
...
...
@@ -3,10 +3,10 @@ import { ReactPanelPlugin } from '@grafana/ui';
import
{
BarGaugePanel
}
from
'./BarGaugePanel'
;
import
{
BarGaugePanelEditor
}
from
'./BarGaugePanelEditor'
;
import
{
BarGaugeOptions
,
defaults
}
from
'./types'
;
import
{
singleStatOptionsCheck
}
from
'../singlestat2/module'
;
import
{
singleStat
Base
OptionsCheck
}
from
'../singlestat2/module'
;
export
const
reactPanel
=
new
ReactPanelPlugin
<
BarGaugeOptions
>
(
BarGaugePanel
);
reactPanel
.
setEditor
(
BarGaugePanelEditor
);
reactPanel
.
setDefaults
(
defaults
);
reactPanel
.
setPanelTypeChangedHook
(
singleStatOptionsCheck
);
reactPanel
.
setPanelTypeChangedHook
(
singleStat
Base
OptionsCheck
);
public/app/plugins/panel/gauge/module.tsx
View file @
b1b5e8d7
...
...
@@ -3,10 +3,10 @@ import { ReactPanelPlugin } from '@grafana/ui';
import
{
GaugePanelEditor
}
from
'./GaugePanelEditor'
;
import
{
GaugePanel
}
from
'./GaugePanel'
;
import
{
GaugeOptions
,
defaults
}
from
'./types'
;
import
{
singleStatOptionsCheck
}
from
'../singlestat2/module'
;
import
{
singleStat
Base
OptionsCheck
}
from
'../singlestat2/module'
;
export
const
reactPanel
=
new
ReactPanelPlugin
<
GaugeOptions
>
(
GaugePanel
);
reactPanel
.
setEditor
(
GaugePanelEditor
);
reactPanel
.
setDefaults
(
defaults
);
reactPanel
.
setPanelTypeChangedHook
(
singleStatOptionsCheck
);
reactPanel
.
setPanelTypeChangedHook
(
singleStat
Base
OptionsCheck
);
public/app/plugins/panel/singlestat2/module.tsx
View file @
b1b5e8d7
import
{
ReactPanelPlugin
}
from
'@grafana/ui'
;
import
{
SingleStatOptions
,
defaults
}
from
'./types'
;
import
{
SingleStatOptions
,
defaults
,
SingleStatBaseOptions
}
from
'./types'
;
import
{
SingleStatPanel
}
from
'./SingleStatPanel'
;
import
cloneDeep
from
'lodash/cloneDeep'
;
import
{
SingleStatEditor
}
from
'./SingleStatEditor'
;
...
...
@@ -8,8 +8,8 @@ export const reactPanel = new ReactPanelPlugin<SingleStatOptions>(SingleStatPane
const
optionsToKeep
=
[
'valueOptions'
,
'stat'
,
'maxValue'
,
'maxValue'
,
'thresholds'
,
'valueMappings'
];
export
const
singleStatOptionsCheck
=
(
options
:
Partial
<
SingleStatOptions
>
,
export
const
singleStat
Base
OptionsCheck
=
(
options
:
Partial
<
SingleStat
Base
Options
>
,
prevPluginId
?:
string
,
prevOptions
?:
any
)
=>
{
...
...
@@ -26,4 +26,4 @@ export const singleStatOptionsCheck = (
reactPanel
.
setEditor
(
SingleStatEditor
);
reactPanel
.
setDefaults
(
defaults
);
reactPanel
.
setPanelTypeChangedHook
(
singleStatOptionsCheck
);
reactPanel
.
setPanelTypeChangedHook
(
singleStat
Base
OptionsCheck
);
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